:root {
  --bg: #0a0e12;
  --bg-2: #0c1218;
  --card: #10161d;
  --card-2: #141c24;
  --line: rgb(255 255 255 / 8%);
  --line-2: rgb(255 255 255 / 16%);
  --text: #e7e9ec;
  --text-2: #98a2ab;
  --text-3: #5c666e;
  --accent: #3fb950;
  --accent-hover: #4ccb5e;
  --accent-dark: #04140a;
  --accent-dim: rgb(63 185 80 / 12%);
  --accent-glow: rgb(63 185 80 / 50%);
  --selection: rgb(63 185 80 / 30%);
  --selection-text: #fff;
  --header-bg: rgb(10 14 18 / 72%);
  --overlay: rgb(10 14 18 / 70%);
  --card-shadow: 0 30px 80px -40px rgb(0 0 0 / 80%);
  --hover-shadow: 0 18px 40px -22px rgb(0 0 0 / 70%);
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-heading: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
  --container: 1180px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f5f7f8;
  --bg-2: #edf0f2;
  --card: #fff;
  --card-2: #eef1f3;
  --line: rgb(15 30 22 / 10%);
  --line-2: rgb(15 30 22 / 20%);
  --text: #17211c;
  --text-2: #47555c;
  --text-3: #75828a;
  --accent: #1a7f37;
  --accent-hover: #116329;
  --accent-dark: #f4fff7;
  --accent-dim: rgb(26 127 55 / 10%);
  --accent-glow: rgb(26 127 55 / 40%);
  --selection: rgb(26 127 55 / 22%);
  --selection-text: #10240f;
  --header-bg: rgb(245 247 248 / 78%);
  --overlay: rgb(255 255 255 / 72%);
  --card-shadow: 0 30px 80px -46px rgb(20 40 30 / 45%);
  --hover-shadow: 0 18px 40px -24px rgb(20 40 30 / 35%);
  color-scheme: light;
}

html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition:
    background-color 320ms var(--ease),
    border-color 320ms var(--ease),
    color 320ms var(--ease),
    fill 320ms var(--ease),
    box-shadow 320ms var(--ease) !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--text-3) var(--bg);
}

body {
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

button {
  color: inherit;
  font: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
}

::selection {
  background: var(--selection);
  color: var(--selection-text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

section {
  scroll-margin-top: 92px;
}

.container,
.nav {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 28px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 9px 13px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 180ms var(--ease);
}

.skip-link:focus {
  color: var(--accent-dark);
  transform: translateY(0);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav {
  min-height: 65px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding-block: 13px;
}

.brand {
  flex: 0 0 auto;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
}

.brand > span:first-child,
.terminal-cursor {
  color: var(--accent);
}

.terminal-cursor {
  display: inline-block;
  margin-left: 2px;
  animation: blink 1.1s step-end infinite;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.nav-links a {
  position: relative;
  padding-block: 3px;
  color: var(--text-2);
  transition: color 160ms ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 1.5px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.language-switch {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.language-button {
  padding: 7px 12px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.language-button.is-active {
  background: var(--accent);
  color: var(--accent-dark);
  font-weight: 600;
}

.social-link {
  display: flex;
  color: var(--text-2);
  transition: color 160ms ease, transform 200ms var(--ease);
}

.social-link:hover {
  color: var(--text);
  transform: translateY(-2px);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition:
    color 200ms ease,
    border-color 200ms ease,
    transform 200ms var(--ease);
}

.theme-toggle:hover {
  border-color: var(--line-2);
  color: var(--accent);
  transform: translateY(-2px);
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle svg {
  transition: transform 420ms var(--ease), opacity 260ms ease;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.theme-toggle:hover svg {
  transform: rotate(35deg);
}

.resume-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 160ms ease;
}

.resume-link:hover {
  background: var(--accent-hover);
  color: var(--accent-dark);
}

/* Shared typography and controls */
.command {
  margin-bottom: 14px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 600;
}

h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section {
  padding-block: 72px;
  border-top: 1px solid var(--line);
}

#sobre {
  padding-block: 60px;
}

.section-heading {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  align-items: end;
  gap: 20px;
  margin-bottom: 8px;
}

.section-heading > p {
  color: var(--text-2);
  font-size: 15px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    transform 200ms var(--ease),
    box-shadow 200ms var(--ease);
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--hover-shadow);
}

.button:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}

.button > span[aria-hidden] {
  transition: transform 220ms var(--ease);
}

.button:hover > span[aria-hidden] {
  transform: translate(2px, -1px);
}

.button--primary {
  background: var(--accent);
  color: var(--accent-dark);
  font-weight: 600;
}

.button--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-dark);
}

.button--secondary {
  border-color: var(--line-2);
  color: var(--text);
}

.button--secondary:hover {
  border-color: var(--text-2);
  background: var(--card);
  color: var(--text);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-list li {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms var(--ease);
}

.tag-list li:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Hero */
.hero {
  padding-block: 74px 96px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  align-items: center;
  gap: 52px;
}

.hero-copy > .command {
  margin-bottom: 20px;
}

.availability {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.availability > span:first-child {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s infinite;
}

.hero h1 {
  color: var(--text);
  font-size: clamp(42px, 6.4vw, 74px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.hero-role {
  margin-top: 20px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: -0.01em;
}

.hero-summary {
  max-width: 52ch;
  margin-top: 22px;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-tags {
  gap: 8px;
  margin-top: 30px;
}

.hero-tags li {
  padding: 5px 10px;
  font-size: 12px;
}

.portrait-wrap {
  width: 100%;
  max-width: 380px;
  justify-self: center;
}

.portrait-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--card-shadow);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease);
}

.portrait-card:hover {
  transform: translateY(-6px);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

.window-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.window-dot--red { background: #ff5f56; }
.window-dot--yellow { background: #ffbd2e; }
.window-dot--green { background: #27c93f; }

.window-title {
  margin-left: 8px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}

.portrait-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

.portrait-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--card-2);
  color: var(--text-3);
}

.portrait-placeholder .portrait-avatar {
  width: 190px;
  height: 190px;
  overflow: visible;
}

.avatar-halo {
  fill: var(--accent-dim);
}

.avatar-glyph {
  fill: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9px;
}

.avatar-head,
.avatar-body {
  fill: var(--card);
  stroke: var(--accent);
  stroke-width: 2;
}

.avatar-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.avatar-glasses rect,
.avatar-glasses path {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
}

.avatar-glasses rect {
  fill: var(--accent-dim);
}

.avatar-prompt {
  fill: var(--accent);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
  .avatar-figure {
    animation: avatar-float 6s var(--ease) infinite;
  }

  .avatar-eye {
    transform-box: fill-box;
    transform-origin: center;
    animation: avatar-blink 5.5s ease-in-out infinite;
  }

  .avatar-glyph {
    animation: avatar-drift 7s ease-in-out infinite alternate;
  }

  .avatar-glyph--2 {
    animation-duration: 9s;
    animation-delay: 0.8s;
  }

  .avatar-glyph--3 {
    animation-duration: 8s;
    animation-delay: 1.6s;
  }

  .avatar-glyph--4 {
    animation-duration: 6.5s;
    animation-delay: 0.4s;
  }
}

@keyframes avatar-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@keyframes avatar-blink {
  0%,
  90%,
  96%,
  100% {
    transform: scaleY(1);
  }

  93% {
    transform: scaleY(0.08);
  }
}

@keyframes avatar-drift {
  from {
    transform: translateY(-3px);
  }

  to {
    transform: translateY(3px);
  }
}

.portrait-placeholder-text {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
}

.portrait-location {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 15px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
}

.portrait-location > span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  align-items: start;
  gap: 48px;
}

.about-grid h2 {
  margin-bottom: 22px;
}

.about-grid p {
  margin-bottom: 16px;
  color: var(--text-2);
  font-size: 16px;
}

.about-grid p:last-child {
  margin-bottom: 0;
}

.metrics-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.metric-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  transition:
    transform 240ms var(--ease),
    border-color 240ms ease,
    box-shadow 240ms var(--ease);
}

.metric-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--hover-shadow);
  transform: translateY(-4px);
}

.metric-card strong {
  display: block;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}

.metric-card span {
  display: block;
  margin-top: 6px;
  color: var(--text-2);
  font-size: 14px;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 34px;
}

.principles-grid article {
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
}

.principles-grid article > span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

.principles-grid h3 {
  margin-block: 8px 6px;
  font-size: 17px;
}

.principles-grid p {
  color: var(--text-2);
  font-size: 14.5px;
}

/* Featured work */
.featured-project {
  display: grid;
  grid-template-columns: repeat(2, minmax(310px, 1fr));
  align-items: center;
  gap: 36px;
  padding-block: 34px;
  border-top: 1px solid var(--line);
}

.project-carousel,
.compact-carousel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
}

.carousel-viewport {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transform: translateX(0);
  transition: transform 450ms var(--ease);
}

.carousel-slide {
  min-width: 100%;
  flex: 0 0 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-2);
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 700ms var(--ease);
}

.project-carousel:hover .carousel-slide img,
.compact-carousel:hover .carousel-slide img {
  transform: scale(1.035);
}

.project-carousel--single .carousel-viewport > .carousel-slide {
  width: 100%;
}

.carousel-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--overlay);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.carousel-button:hover,
.carousel-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-dark);
}

.carousel-button--previous { left: 12px; }
.carousel-button--next { right: 12px; }

.carousel-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  background: linear-gradient(transparent, rgb(0 0 0 / 60%));
}

.carousel-overlay > span,
.compact-status {
  color: #c8cdd2;
  font-family: var(--font-mono);
  font-size: 11px;
}

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: rgb(255 255 255 / 22%);
  cursor: pointer;
  transition:
    width 300ms ease,
    background 300ms ease;
}

.carousel-dot.is-active {
  width: 20px;
  background: var(--accent);
}

.project-meta {
  margin-bottom: 10px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}

.project-meta strong {
  color: var(--accent);
  font-weight: 400;
}

.project-copy h3 {
  font-size: clamp(21px, 2.4vw, 27px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.project-lead {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 15.5px;
}

.case-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.case-list > div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
}

.case-list dt {
  padding-top: 2px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}

.case-list > div:last-child dt {
  color: var(--accent);
}

.case-list dd {
  color: var(--text-2);
  font-size: 14.5px;
}

.case-list > div:last-child dd {
  color: var(--text);
}

.project-copy > .tag-list {
  margin-top: 20px;
}

/* Lab */
.lab {
  margin-top: 66px;
}

.lab-heading {
  margin-bottom: 26px;
}

.lab-heading h3 {
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -0.02em;
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(290px, 1fr));
  gap: 18px;
}

.lab-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition:
    border-color 240ms ease,
    transform 240ms var(--ease),
    box-shadow 240ms var(--ease);
}

.lab-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--hover-shadow);
  transform: translateY(-5px);
}

.compact-carousel {
  border: 0;
  border-radius: 0;
}

.carousel-button--compact {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.compact-carousel .carousel-button--previous { left: 9px; }
.compact-carousel .carousel-button--next { right: 9px; }

.compact-status {
  position: absolute;
  bottom: 10px;
  left: 12px;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgb(0 0 0 / 50%);
  font-size: 10.5px;
}

.project-placeholder {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(135deg, var(--bg-2), var(--bg-2) 11px, var(--card-2) 11px, var(--card-2) 22px);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}

.lab-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 18px 20px;
}

.lab-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lab-meta > span {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}

.lab-meta strong {
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
}

.lab-card h4 {
  font-size: 19px;
  letter-spacing: -0.01em;
}

.lab-card-body > p {
  flex: 1;
  color: var(--text-2);
  font-size: 14px;
}

.lab-card .tag-list {
  gap: 6px;
  margin-top: 4px;
}

.lab-card .tag-list li {
  padding: 3px 7px;
  border-radius: 5px;
  color: var(--text-3);
  font-size: 11px;
}

.lab-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  margin-top: 4px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  transition: gap 160ms ease, color 160ms ease;
}

.lab-link:hover {
  gap: 10px;
  color: var(--accent-hover);
}

/* Experience */
#experiencia .section-heading,
#competencias .section-heading {
  margin-bottom: 30px;
}

.current-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 20px;
}

.experience-card {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition:
    border-color 240ms ease,
    transform 240ms var(--ease),
    box-shadow 240ms var(--ease);
}

.experience-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--hover-shadow);
  transform: translateY(-4px);
}

.experience-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.experience-top > span {
  padding: 4px 9px;
  border-radius: 5px;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
}

.experience-top time,
.experience-focus,
.history-item time {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.company {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.experience-card h3 {
  margin-top: 3px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.experience-card > p:not(.experience-focus),
.outcome-list li {
  color: var(--text-2);
  font-size: 14px;
}

.experience-card > p:not(.experience-focus) {
  font-size: 14.5px;
}

.outcome-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 2px;
}

.outcome-list li {
  position: relative;
  padding-left: 18px;
}

.outcome-list li::before {
  content: "›";
  position: absolute;
  top: 1px;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

.experience-card > .tag-list {
  gap: 6px;
  margin-top: 4px;
}

.experience-card > .tag-list li {
  padding: 3px 8px;
  border-radius: 5px;
  color: var(--text-3);
  font-size: 11px;
}

.history-label {
  margin-block: 34px 4px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(230px, 1fr);
  gap: 6px 26px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
}

.history-item > div:first-child {
  max-width: 200px;
}

.history-item > div:first-child span {
  display: block;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

.history-item h4 {
  margin-block: 3px 6px;
  font-size: 17px;
}

.history-item h4 small {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
}

.history-item > div:last-child > p:last-child {
  color: var(--text-2);
  font-size: 14px;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(250px, 1fr));
  gap: 18px;
}

.skill-card {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition:
    border-color 240ms ease,
    transform 240ms var(--ease),
    box-shadow 240ms var(--ease);
}

.skill-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--hover-shadow);
  transform: translateY(-4px);
}

.skill-card > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.skill-card > div > span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

.skill-card h3 {
  font-size: 18px;
  letter-spacing: -0.01em;
}

.skill-card > p {
  margin-bottom: 15px;
  color: var(--text-2);
  font-size: 14px;
}

.skill-card .tag-list {
  gap: 6px;
}

.skill-card .tag-list li {
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11px;
}

/* Contact and footer */
.contact-section {
  padding-block: 80px 40px;
  border-top: 1px solid var(--line);
}

.contact-section > .container > .command {
  margin-bottom: 16px;
}

.contact-section h2 {
  max-width: 16ch;
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.contact-copy {
  max-width: 56ch;
  margin-top: 20px;
  color: var(--text-2);
  font-size: 16px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.contact-location {
  margin-top: 24px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.contact-location > span:first-child {
  color: var(--accent);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Animação de fundo (caracteres subindo) */
.code-rain {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
}

:root[data-theme="light"] .code-rain {
  opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
  .code-rain {
    display: none;
  }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 700ms var(--ease),
    transform 700ms var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-revealed {
  opacity: 1;
  transform: none;
}

/* Stack proficiency */
.stack-panel {
  margin-top: 54px;
}

.stack-heading {
  margin-bottom: 6px;
}

.stack-heading h3 {
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -0.02em;
}

.stack-note {
  margin-bottom: 26px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}

.stack-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 22px 46px;
}

.stack-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.stack-name {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
}

.stack-name::before {
  content: "▸ ";
  color: var(--accent);
}

.stack-value {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.stack-bar {
  overflow: hidden;
  height: 6px;
  margin-top: 9px;
  border-radius: 999px;
  background: var(--line);
}

.stack-bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 1200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.stack-item:hover .stack-name {
  color: var(--accent);
}

/* Contact form */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.05fr) minmax(300px, 1fr);
  align-items: start;
  gap: 48px;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 13px;
}

.contact-email a {
  color: var(--accent);
  transition: color 160ms ease;
}

.contact-email a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.contact-form-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px 24px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-field label {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
}

.form-field label::before {
  content: "$ ";
  color: var(--accent);
}

.form-field input,
.form-field textarea {
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition:
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-3);
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-honey {
  position: absolute !important;
  left: -9999px !important;
}

.contact-form .button {
  align-self: flex-start;
  cursor: pointer;
}

.contact-form .button[disabled] {
  opacity: 0.6;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.form-status {
  min-height: 20px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.form-status.is-success { color: var(--accent); }
.form-status.is-error { color: #e5534b; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (max-width: 1140px) {
  .skills-grid {
    grid-template-columns: repeat(2, minmax(250px, 1fr));
  }

  .lab-grid {
    grid-template-columns: repeat(2, minmax(290px, 1fr));
  }
}

@media (max-width: 960px) {
  .nav {
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    margin-left: 0;
    padding-top: 4px;
  }

  .hero-grid,
  .about-grid,
  .featured-project,
  .current-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 760px;
  }

  .portrait-wrap {
    justify-self: start;
  }

  .featured-project {
    gap: 28px;
  }

  .project-carousel {
    max-width: 720px;
  }
}

@media (max-width: 680px) {
  .container,
  .nav {
    padding-inline: 20px;
  }

  section {
    scroll-margin-top: 140px;
  }

  .nav {
    gap: 12px;
  }

  .brand {
    font-size: 13px;
  }

  .nav-actions {
    gap: 10px;
  }

  .social-link {
    display: none;
  }

  .nav-links {
    justify-content: space-between;
    gap: 10px 14px;
    font-size: 11.5px;
  }

  .hero {
    padding-block: 54px 72px;
  }

  .hero-grid {
    gap: 44px;
  }

  .hero h1 {
    font-size: clamp(40px, 13vw, 58px);
  }

  .hero-role {
    font-size: 12.5px;
  }

  .hero-summary {
    font-size: 16px;
  }

  .section,
  #sobre {
    padding-block: 58px;
  }

  .section-heading {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .principles-grid,
  .lab-grid,
  .skills-grid,
  .history-item,
  .stack-list {
    grid-template-columns: 1fr;
  }

  .featured-project {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 30px;
  }

  .case-list > div {
    grid-template-columns: 78px 1fr;
    gap: 10px;
  }

  .lab {
    margin-top: 52px;
  }

  .history-item > div:first-child {
    max-width: none;
  }

  .contact-section {
    padding-block: 64px 34px;
  }
}

@media (max-width: 430px) {
  .language-button {
    padding-inline: 9px;
  }

  .resume-link {
    padding-inline: 10px;
  }

  .hero-actions .button,
  .contact-actions .button {
    width: 100%;
  }

  .availability {
    font-size: 10.5px;
  }

  .case-list > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .experience-card {
    padding: 21px 20px;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
