/* =====================================================================
   Fillipe Alves · Portfólio
   Ordem: fontes → tokens → base → layout → componentes → seções → movimento
   ===================================================================== */

/* ---------- Fontes ----------------------------------------------------
   Em Apple, -apple-system resolve para SF Pro e a Inter nem é baixada.
   Nos demais sistemas, entra a Inter variável (com eixo óptico).        */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-opsz-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Arial ajustada às métricas da Inter, para a troca de fonte não deslocar o layout. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.2%;
  descent-override: 22.48%;
  line-gap-override: 0%;
  size-adjust: 107.4%;
}

/* ---------- Tokens ---------------------------------------------------- */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Inter Fallback", sans-serif;

  /* Cor: claro */
  --bg: #ffffff;
  --surface: #f5f5f7;
  --tile: #f5f5f7;
  --tile-on-surface: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --hairline: rgb(0 0 0 / 0.1);
  --chip: rgb(0 0 0 / 0.05);
  --accent: #5856d6;
  --accent-fill: #5856d6;
  --on-accent: #ffffff;
  --nav-bg: rgb(255 255 255 / 0.72);

  /* Palco da POLIA: escuro nos dois temas */
  --stage-bg: #000000;
  --stage-text: #f5f5f7;
  --stage-text-2: #a1a1a6;
  --stage-accent: #8e8cff;
  --stage-line: rgb(255 255 255 / 0.14);
  --stage-step: rgb(255 255 255 / 0.06);

  /* Forma: raios concêntricos, maiores para superfícies maiores */
  --radius-xl: 2rem;
  --radius-lg: 1.5rem;
  --radius-md: 1.125rem;

  /* Espaço */
  --gutter: clamp(1rem, 0.4rem + 2.6vw, 2.5rem);
  --wide: 75rem;
  --narrow: 61.25rem;
  --text-width: 50rem;
  --nav-h: 3rem;
  --section-y: clamp(5.5rem, 3.5rem + 7vw, 10rem);

  /* Movimento: mola criticamente amortecida (sem overshoot) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: var(--ease-out);
  --dur-reveal: 1000ms;

  color-scheme: light;
}

/* Curva de mola real (damping 1.0) onde linear() é suportado. */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(0, 0.0755 5%, 0.2275 10%, 0.3909 15%, 0.5372 20%, 0.6574 25%, 0.7513 30%,
      0.8222 35%, 0.8743 40%, 0.912 45%, 0.9389 50%, 0.9711 60%, 0.9866 70%, 0.9939 80%, 0.9972 90%, 1);
  }
}

/* Cor: escuro (preferência do sistema, sem escolha manual) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #000000;
    --tile: #161617;
    --tile-on-surface: #161617;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --hairline: rgb(255 255 255 / 0.14);
    --chip: rgb(255 255 255 / 0.08);
    --accent: #8e8cff;
    --accent-fill: #5e5ce6;
    --nav-bg: rgb(22 22 23 / 0.72);
    --stage-bg: #161617;
    color-scheme: dark;
  }
}

/* Cor: escuro (escolha manual) */
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #000000;
  --tile: #161617;
  --tile-on-surface: #161617;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --hairline: rgb(255 255 255 / 0.14);
  --chip: rgb(255 255 255 / 0.08);
  --accent: #8e8cff;
  --accent-fill: #5e5ce6;
  --nav-bg: rgb(22 22 23 / 0.72);
  --stage-bg: #161617;
  color-scheme: dark;
}

/* ---------- Base ------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  background: var(--bg);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  letter-spacing: -0.011em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
  margin: 0;
}

h1, h2, h3, h4 {
  font-weight: 700;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

ul, ol {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.5rem;
}

::selection {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

main:focus {
  outline: none;
}

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

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-weight: 600;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Layout ---------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--wide));
  margin-inline: auto;
}

.container--narrow {
  max-width: var(--narrow);
}

.container--text {
  max-width: var(--text-width);
}

.section {
  padding-block: var(--section-y);
}

.section--surface {
  background: var(--surface);
  --tile: var(--tile-on-surface);
}

.section-head {
  max-width: 46rem;
  margin: 0 auto clamp(3rem, 2rem + 4vw, 5.5rem);
  text-align: center;
}

.section-title {
  font-size: clamp(2.5rem, 1.6rem + 4vw, 4.75rem);
  line-height: 1.04;
  letter-spacing: -0.032em;
}

.section-sub {
  margin-top: 1rem;
  color: var(--text-2);
  font-size: clamp(1.1875rem, 1rem + 0.8vw, 1.625rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.018em;
}

/* ---------- Componentes ---------------------------------------------- */

/* Botões em pílula: resposta imediata no toque (pointer-down) */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0 1.125rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform 220ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}

@media (min-width: 40rem) {
  .button {
    padding: 0 1.5rem;
    font-size: 1.0625rem;
  }
}

.button:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}

.button--primary {
  background: var(--accent-fill);
  color: var(--on-accent);
}

.button--primary:hover {
  background: color-mix(in srgb, var(--accent-fill) 86%, #000);
}

.button--secondary {
  color: var(--accent);
  box-shadow: inset 0 0 0 1.5px currentColor;
}

.button--secondary:hover {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 200ms ease, transform 160ms var(--ease-out);
}

.icon-button:hover {
  background: var(--chip);
}

.icon-button:active {
  transform: scale(0.92);
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Molduras de foto: recorte arredondado, imagem um pouco maior para o parallax */
.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--tile);
  isolation: isolate;
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.js .media-frame img[data-parallax] {
  transform: translate3d(0, var(--parallax-y, 0px), 0) scale(1.08);
  will-change: transform;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips li {
  padding: 0.375rem 0.8125rem;
  border-radius: 999px;
  background: var(--chip);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* ---------- Navegação ------------------------------------------------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: box-shadow 300ms ease;
}

/* Divisória só aparece quando há conteúdo passando por baixo */
.nav.is-scrolled {
  box-shadow: 0 1px 0 var(--hairline);
}

.nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2 * var(--gutter), var(--wide));
  height: 100%;
  margin-inline: auto;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Mesmo desenho do favicon, com a fonte do site */
.nav__logo {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
}

.nav__logo rect {
  fill: var(--accent-fill);
}

.nav__logo text {
  fill: var(--on-accent);
  font-family: var(--font);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1px;
}

.nav__links a {
  transition: color 200ms ease, opacity 200ms ease;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  margin-right: -0.5rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  margin-right: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.lang-switch button {
  min-width: 2.25rem;
  min-height: 2.75rem;
  padding: 0 0.25rem;
  border: 0;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  transition: color 200ms ease;
}

.lang-switch button[aria-pressed="true"] {
  color: var(--text);
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch__sep {
  color: var(--hairline);
}

/* Ícone do tema mostra a ação: lua no claro, sol no escuro */
.icon--sun {
  display: none;
}

:root[data-theme="dark"] .icon--sun {
  display: block;
}

:root[data-theme="dark"] .icon--moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon--sun {
    display: block;
  }

  :root:not([data-theme="light"]) .icon--moon {
    display: none;
  }
}

.nav__menu path {
  transform-origin: center;
  transition: transform 360ms var(--ease-spring);
}

.nav.is-open .nav__menu-top {
  transform: translateY(3px) rotate(45deg);
}

.nav.is-open .nav__menu-bottom {
  transform: translateY(-3px) rotate(-45deg);
}

/* Celular e tablet: menu em painel que desce a partir da barra */
@media (max-width: 63.99rem) {
  .nav.is-open {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .nav__links {
    position: fixed;
    inset: var(--nav-h) 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.5rem var(--gutter) 3rem;
    background: var(--bg);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, -0.75rem, 0);
    transition: opacity 220ms ease, transform 420ms var(--ease-spring), visibility 0s linear 420ms;
  }

  .nav.is-open .nav__links {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
  }

  .nav__links a {
    display: block;
    padding: 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.025em;
  }

  .nav__links a[aria-current="true"] {
    color: var(--accent);
  }
}

@media (min-width: 64rem) {
  .nav__menu {
    display: none;
  }

  .nav__links {
    display: flex;
    gap: clamp(1.25rem, 2vw, 2.25rem);
    font-size: 0.8125rem;
    letter-spacing: -0.005em;
  }

  .nav__links a {
    opacity: 0.78;
  }

  .nav__links a:hover,
  .nav__links a[aria-current="true"] {
    opacity: 1;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .nav {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ---------- Hero ------------------------------------------------------ */
.hero {
  padding-top: calc(var(--nav-h) + clamp(2.5rem, 1rem + 5vw, 5rem));
  padding-bottom: clamp(4rem, 2rem + 6vw, 7rem);
}

.hero__inner {
  display: grid;
  justify-items: center;
  gap: clamp(2.5rem, 1.5rem + 4vw, 4rem);
  text-align: center;
}

.hero__name {
  font-size: clamp(4rem, 1.6rem + 10vw, 8.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.hero__role {
  margin-top: 1.25rem;
  color: var(--text-2);
  font-size: clamp(1.1875rem, 1rem + 0.7vw, 1.5rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.016em;
}

/* No celular, cada parte do título em uma linha, sem o ponto solto no fim */
.hero__role span {
  display: block;
}

.hero__role .hero__role-sep {
  display: none;
}

@media (min-width: 40rem) {
  .hero__role span,
  .hero__role .hero__role-sep {
    display: inline;
  }
}

.hero__statement {
  margin: 1.5rem auto 0;
  font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* Uma frase por linha: passado em cinza, presente em destaque */
.hero__statement-past {
  display: block;
  color: var(--text-2);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.hero__media {
  width: min(100%, 28rem);
  aspect-ratio: 4 / 5;
}

@media (min-width: 64rem) {
  .hero__inner {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    justify-items: start;
    min-height: min(calc(100svh - var(--nav-h) - 8rem), 46rem);
    text-align: left;
  }

  .hero__statement {
    margin-inline: 0;
  }

  .hero__actions {
    justify-content: flex-start;
  }

  .hero__media {
    justify-self: end;
    width: min(100%, 30rem);
  }
}

/* ---------- Sobre ----------------------------------------------------- */
#sobre {
  padding-top: clamp(3rem, 2rem + 4vw, 6rem);
}

#sobre .section-title {
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  text-align: center;
}

.about {
  display: grid;
  gap: 1.1em;
  font-size: clamp(1.5rem, 1.05rem + 1.9vw, 2.5rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.028em;
}

/* "pretty" deixava as linhas irregulares neste tamanho de fonte */
.about p {
  text-wrap: wrap;
}

.muted {
  color: var(--text-2);
}

/* ---------- Trajetória ------------------------------------------------ */
.timeline-group + .timeline-group {
  margin-top: clamp(3.5rem, 2.5rem + 3vw, 5rem);
}

.timeline-group__title {
  margin-bottom: 1.75rem;
  color: var(--text-2);
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.timeline {
  position: relative;
  display: grid;
  gap: clamp(2.5rem, 2rem + 2vw, 3.5rem);
}

/* Trilho vertical */
.timeline::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  bottom: 0.6rem;
  left: 0.4375rem;
  width: 2px;
  border-radius: 2px;
  background: var(--hairline);
}

.timeline__item {
  position: relative;
  padding-left: 2.5rem;
}

/* Marcador */
.timeline__item::before {
  content: "";
  position: absolute;
  top: 0.35rem;
  left: 0;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--text-2);
  border-radius: 50%;
  background: var(--surface);
}

.timeline__item--current::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent);
}

.timeline__when {
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.timeline__title {
  margin-top: 0.25rem;
  font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.026em;
}

.timeline__role {
  margin-top: 0.25rem;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.timeline__context,
.timeline__desc {
  max-width: 40rem;
  margin-top: 0.75rem;
  color: var(--text-2);
}

.timeline__note {
  margin-top: 1rem;
  color: var(--accent);
  font-weight: 600;
}

.roles {
  display: grid;
  gap: 0.5rem;
  max-width: 40rem;
  margin-top: 1.5rem;
}

.role {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.125rem 1rem;
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-md);
  background: var(--tile);
}

.role__title {
  font-weight: 600;
  color: var(--text-2);
}

.role--current .role__title {
  color: var(--text);
}

.role__when {
  color: var(--text-2);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

.timeline__media {
  margin-top: 1.5rem;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
}

@media (min-width: 48rem) {
  .timeline__item--media {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22rem;
    align-items: start;
    gap: 2.5rem;
  }

  .timeline__media {
    margin-top: 0;
  }
}

/* ---------- Projetos -------------------------------------------------- */

/* Palco da POLIA: o momento mais forte da página */
.feature {
  padding: clamp(3rem, 2rem + 5vw, 6.5rem) clamp(1.25rem, 0.5rem + 4vw, 5rem);
  border-radius: var(--radius-xl);
  background: var(--stage-bg);
  color: var(--stage-text);
  box-shadow: inset 0 0 0 1px var(--stage-line);
}

.feature__head {
  max-width: 48rem;
  margin-inline: auto;
  text-align: center;
}

.feature__kicker {
  color: var(--stage-accent);
  font-size: 1.0625rem;
  font-weight: 600;
}

.feature__name {
  margin-top: 0.5rem;
  font-size: clamp(5.5rem, 2rem + 17vw, 13rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  background: linear-gradient(100deg, #f5f5f7 15%, #b9b8ff 55%, #7471ff 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* Evita corte do gradiente na última letra com tracking negativo */
  padding-inline: 0.04em;
}

.feature__tagline {
  margin-top: 1.25rem;
  font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.028em;
}

.feature__desc {
  max-width: 38rem;
  margin: 1.25rem auto 0;
  color: var(--stage-text-2);
  font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.3125rem);
  line-height: 1.45;
}

.flow {
  display: grid;
  gap: 0.75rem;
  margin-top: clamp(2.5rem, 2rem + 3vw, 4.5rem);
  counter-reset: none;
}

.flow__step {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.25rem;
  padding: 1.125rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--stage-step);
  box-shadow: inset 0 0 0 1px var(--stage-line);
}

.flow__step strong {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.flow__step span {
  color: var(--stage-text-2);
  font-size: 0.9375rem;
  line-height: 1.4;
}

/* Conectores entre as etapas */
.flow__step + .flow__step::before {
  content: "";
  position: absolute;
  top: -0.75rem;
  left: 1.75rem;
  width: 1.5px;
  height: 0.75rem;
  background: var(--stage-accent);
  opacity: 0.7;
}

@media (min-width: 48rem) {
  .flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .flow__step + .flow__step::before {
    top: 50%;
    left: -1.25rem;
    width: 1.25rem;
    height: 1.5px;
  }
}

.case {
  display: grid;
  gap: 1rem;
}

.case dt {
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.003em;
}

.case dd {
  margin-top: 0.125rem;
}

.case--feature {
  gap: 1.5rem;
  margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  padding-top: clamp(2rem, 1.5rem + 2vw, 3rem);
  border-top: 1px solid var(--stage-line);
}

.case--feature dt {
  color: var(--stage-text-2);
}

.case--feature dd {
  font-size: 1.125rem;
}

@media (min-width: 48rem) {
  .case--feature {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
  }
}

.chips--stage {
  justify-content: center;
  margin-top: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.chips--stage li {
  background: var(--stage-step);
  box-shadow: inset 0 0 0 1px var(--stage-line);
}

.cases {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.case-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
  border-radius: var(--radius-xl);
  background: var(--tile);
}

.case-card__kicker {
  margin-bottom: -1rem;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 600;
}

.case-card__title {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.024em;
}

.case-card .chips {
  margin-top: auto;
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
}

.metric {
  display: grid;
  gap: 0.25rem;
}

.metric__value {
  font-size: clamp(3.5rem, 2.5rem + 3.5vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.metric__label {
  color: var(--text-2);
  font-weight: 500;
}

/* Card com foto (monitoramento de tokens): no celular a foto vem primeiro */
.case-card__body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.case-card__media {
  order: -1;
  aspect-ratio: 2 / 1;
  border-radius: var(--radius-lg);
}

/* Mantém a tela do ESP32 inteira quando a foto é recortada */
.case-card__media img {
  object-position: 0% 50%;
}

@media (min-width: 48rem) {
  .cases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-card--media {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: clamp(2rem, 1rem + 3vw, 3.5rem);
  }

  .case-card__media {
    order: 0;
    aspect-ratio: auto;
    min-height: 20rem;
  }

  .case-card__media picture,
  .case-card__media img {
    position: absolute;
    inset: 0;
  }
}

/* ---------- Bento (competências e hobbies) ---------------------------- */
.bento {
  display: grid;
  gap: 1rem;
}

.tile {
  display: flex;
  flex-direction: column;
  padding: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
  border-radius: var(--radius-xl);
  background: var(--tile);
}

.tile__icon {
  width: 2rem;
  height: 2rem;
  margin-bottom: 1.25rem;
  fill: none;
  stroke: var(--text-2);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile--ai .tile__icon {
  stroke: var(--accent);
}

.tile__title {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.024em;
}

.tile__note {
  margin-top: 0.75rem;
  color: var(--text-2);
}

.tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.25rem;
  margin-top: 1.25rem;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.016em;
}

.tokens--large {
  flex-direction: column;
  gap: 0.25rem;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.tile--ai .tile__note {
  margin-top: auto;
  padding-top: 2rem;
  font-size: 1.1875rem;
  font-weight: 500;
}

@media (min-width: 48rem) {
  .bento--skills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile--ai {
    grid-column: 1 / -1;
  }
}

@media (min-width: 64rem) {
  .bento--skills {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .tile--ai {
    grid-column: span 7;
    grid-row: span 2;
    min-height: 34rem;
  }

  .tile--data,
  .tile--practices {
    grid-column: span 5;
  }

  .tile--backend,
  .tile--devops {
    grid-column: span 6;
  }
}

/* Hobbies */
.instruments {
  margin-top: 1.5rem;
  font-size: clamp(1.875rem, 1.3rem + 2.2vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.038em;
}

/* Ritmo: instrumentos alternam entre texto e cinza */
.instruments span:nth-child(even) {
  color: var(--text-2);
}

.tile--music .tile__note {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: 1.1875rem;
  font-weight: 500;
}

.tile--photo {
  padding: 0;
  overflow: hidden;
}

.tile__text {
  padding: clamp(1.75rem, 1.25rem + 1.5vw, 2.5rem) clamp(1.75rem, 1.25rem + 1.5vw, 2.5rem) 1.5rem;
}

/* Foto embutida no card, com cantos concêntricos */
.tile__media {
  flex: 1;
  margin: 0 0.625rem 0.625rem;
  aspect-ratio: 4 / 3;
  border-radius: calc(var(--radius-xl) - 0.625rem);
}

.tile--car .tile__media,
.tile--gym .tile__media,
.tile--reading .tile__media {
  aspect-ratio: 4 / 5;
}

@media (min-width: 48rem) {
  .bento--life {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile--music,
  .tile--maker {
    grid-column: 1 / -1;
  }
}

@media (min-width: 64rem) {
  .bento--life {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .tile--music {
    grid-column: span 7;
  }

  .tile--car {
    grid-column: span 5;
  }

  .tile--maker {
    grid-column: span 6;
  }

  .tile--gym,
  .tile--reading {
    grid-column: span 3;
  }

  /* No desktop a foto ocupa o espaço restante do card */
  .tile--photo .tile__media {
    aspect-ratio: auto;
    min-height: 22rem;
  }

  /* Mantém o display do ESP32 visível no recorte largo */
  .tile--maker img {
    object-position: 50% 30%;
  }

  .tile--music .tile__media {
    min-height: 24rem;
  }

  .tile--music img {
    object-position: 50% 35%;
  }

  .tile--photo .tile__media picture,
  .tile--photo .tile__media img {
    position: absolute;
    inset: 0;
  }
}

/* ---------- Certificações -------------------------------------------- */
.learning__photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.photo-card .media-frame {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
}

/* No celular, a terceira foto ocupa a linha inteira em formato paisagem */
.photo-card--wide-mobile {
  grid-column: 1 / -1;
}

.photo-card--wide-mobile .media-frame {
  aspect-ratio: 16 / 10;
}

.photo-card--wide-mobile img {
  object-position: 50% 55%;
}

@media (min-width: 48rem) {
  .learning__photos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .photo-card--wide-mobile {
    grid-column: auto;
  }

  .photo-card--wide-mobile .media-frame {
    aspect-ratio: 4 / 5;
  }
}

.photo-card figcaption {
  margin-top: 0.75rem;
  color: var(--text-2);
  font-size: 0.875rem;
}

.learning__lists {
  display: grid;
  gap: 3rem;
  margin-top: clamp(3.5rem, 2.5rem + 3vw, 5rem);
}

@media (min-width: 48rem) {
  .learning__lists {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: 3.5rem;
  }
}

.cert-group__title {
  margin-bottom: 0.75rem;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.cert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.125rem 1rem;
  padding-block: 1rem;
  border-top: 1px solid var(--hairline);
}

.cert__name {
  font-weight: 600;
}

.cert__meta {
  grid-column: 1;
  color: var(--text-2);
  font-size: 0.9375rem;
}

.cert__date {
  grid-row: 1;
  grid-column: 2;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Em andamento: ponto de status */
.cert--progress .cert__name::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.625rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.15em;
}

/* ---------- Contato --------------------------------------------------- */
.contact__head {
  text-align: center;
}

.contact__title {
  font-size: clamp(3rem, 1.6rem + 6vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.contact__email {
  display: inline-block;
  margin-top: clamp(2rem, 1.5rem + 2vw, 3rem);
  color: var(--accent);
  font-size: clamp(1.25rem, 0.9rem + 1.8vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 2px;
}

.contact__email:hover {
  text-decoration-line: underline;
}

.contact__list {
  display: grid;
  margin-top: clamp(3rem, 2rem + 3vw, 4.5rem);
  border-top: 1px solid var(--hairline);
}

.contact__link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 1.125rem 0.25rem;
  border-bottom: 1px solid var(--hairline);
  transition: color 200ms ease;
}

.contact__label {
  color: var(--text-2);
}

.contact__value {
  font-weight: 600;
  letter-spacing: -0.012em;
}

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

@media (min-width: 48rem) {
  .contact__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 3rem;
  }
}

/* ---------- Rodapé ---------------------------------------------------- */
.footer {
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--hairline);
  color: var(--text-2);
  font-size: 0.8125rem;
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

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

/* ---------- Movimento ------------------------------------------------- */

/* Um único momento orquestrado: a entrada do hero */
@media (prefers-reduced-motion: no-preference) {
  .js [data-hero] {
    animation: hero-in 1100ms var(--ease-spring) both;
    animation-delay: calc(var(--i, 0) * 90ms + 60ms);
  }

  .js .hero__media[data-hero] {
    animation-name: hero-media-in;
  }

  /* Rolagem: surgimento discreto, uma vez só */
  .js [data-reveal] {
    opacity: 0;
    transform: translate3d(0, 1.5rem, 0);
    transition:
      opacity 700ms var(--ease-out) var(--reveal-delay, 0ms),
      transform var(--dur-reveal) var(--ease-spring) var(--reveal-delay, 0ms);
  }

  .js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translate3d(0, 1.25rem, 0);
  }
}

@keyframes hero-media-in {
  from {
    opacity: 0;
    transform: scale(0.965);
  }
}

/* Movimento reduzido: só um fade curto, sem deslocamento nem parallax */
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 0;
    transition: opacity 300ms ease;
  }

  .js [data-reveal].is-visible {
    opacity: 1;
  }

  .js .media-frame img[data-parallax] {
    transform: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Troca de tema com cross-fade (View Transitions) */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 350ms;
  animation-timing-function: ease;
}

@media (prefers-contrast: more) {
  :root {
    --hairline: currentColor;
  }

  .tile,
  .case-card,
  .role {
    box-shadow: inset 0 0 0 1px var(--text-2);
  }
}
