/* ─────────────────────────────────────────────
   Hélder Mota — página pessoal
   Editorial, minimalista, com profundidade 3D
   ───────────────────────────────────────────── */

:root {
  --bg: #F4F1EA;
  --bg-tint: #ECE7DC;
  --ink: #16140F;
  --muted: #6B665C;
  --line: rgba(22, 20, 15, .14);
  --card: #FBF9F4;
  --accent: #D7262B;
  --accent-ink: #fff;
  --shadow: 0 30px 60px -30px rgba(22, 20, 15, .35);

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --pad: clamp(20px, 5vw, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --buddy-h: clamp(124px, 24vh, 220px); /* altura do boneco; o rodapé reserva-lhe espaço */
}

:root[data-theme="dark"] {
  --bg: #100F0D;
  --bg-tint: #181613;
  --ink: #F1EDE4;
  --muted: #9C968A;
  --line: rgba(241, 237, 228, .16);
  --card: #1A1815;
  --accent: #FF4B4B;
  --accent-ink: #100F0D;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .8);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(16px, 1.05vw + 12px, 18px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; color: var(--accent); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--pad); }

/* ── Canvas do avatar: fixo, por cima do conteúdo, sem capturar cliques ── */
#avatar-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* ── Navegação ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .5s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__brand { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -.01em; }
.nav__mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1; padding-bottom: 2px;
}
.nav__links { display: flex; gap: clamp(14px, 2.4vw, 34px); font-size: 14px; color: var(--muted); }
.nav__links a { position: relative; padding: 6px 0; transition: color .2s; }
.nav__links a:hover { color: var(--ink); }
.nav__links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); }
.nav__tools { display: flex; gap: 8px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px;
  font: 500 12px/1 var(--mono); letter-spacing: .04em; color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.chip-btn:hover { border-color: var(--ink); color: var(--ink); }
.chip-btn i { font-style: normal; opacity: .4; }
.chip-btn .is-on { color: var(--ink); }
.chip-btn--icon { width: 34px; padding: 0; justify-content: center; }

/* ── Tipografia partilhada ── */
.eyebrow, .label, .stage__hint, .proj__n, .tags, .path__where, .next__k, .footer {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.eyebrow { display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 12px transparent; } }

.label { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); }
.label b { font-weight: 500; color: var(--accent); }
.label::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 4.4vw, 58px);
  line-height: 1.06; letter-spacing: -.025em; text-wrap: balance;
}
.h2--wide { max-width: 18ch; margin-bottom: clamp(36px, 5vw, 72px); }
.prose { max-width: 56ch; color: var(--muted); font-size: 1.05em; }

/* ── Botões ── */
.btn {
  display: inline-flex; align-items: center; height: 50px; padding: 0 24px;
  border: 1px solid var(--ink); border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform .3s var(--ease), background-color .3s, color .3s, border-color .3s;
}
.btn:hover { transform: translateY(-3px); background: var(--ink); color: var(--bg); }
.btn--solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--solid:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ── Hero ── */
.hero {
  min-height: min(100svh, 1080px);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: clamp(16px, 3vw, 48px);
  padding-top: 96px; padding-bottom: 48px;
}
.hero__title {
  font-family: var(--serif); font-weight: 350; font-size: clamp(40px, 5.5vw, 82px);
  line-height: .98; letter-spacing: -.035em; margin: 22px 0 28px; text-wrap: balance;
}
.hero__lead { max-width: 50ch; font-size: clamp(17px, 1.3vw, 20px); color: var(--muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.hero__stage { display: flex; flex-direction: column; align-items: center; }
.stage {
  position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 72svh; cursor: pointer;
  display: grid; place-items: center;
}
.stage::before { /* halo suave atrás do avatar */
  content: ''; position: absolute; inset: 14%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 68%);
  filter: blur(10px);
}
.stage--small { max-width: 420px; justify-self: end; cursor: pointer; }
.stage__fallback {
  display: none; font-family: var(--serif); font-style: italic; font-size: clamp(80px, 16vw, 180px); color: var(--accent);
}
.no-webgl .stage__fallback { display: block; }
.no-webgl #avatar-canvas { display: none; }
.stage__hint { margin-top: 4px; text-align: center; }
.orbit-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.orbit-legend li { display: flex; align-items: center; gap: 7px; }
.orbit-legend li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); }

/* ── Secções ── */
.section { padding-block: clamp(84px, 12vw, 170px); position: relative; }
.section--tight { padding-block: clamp(60px, 8vw, 110px); }
.section--tint { background: var(--bg-tint); transition: background-color .5s var(--ease); }

/* ── Manifesto ── */
.manifesto__text {
  font-family: var(--serif); font-weight: 350; font-size: clamp(44px, 9.4vw, 148px);
  line-height: .96; letter-spacing: -.04em; max-width: 12ch;
}
.manifesto__text .w { opacity: .13; transition: opacity .5s var(--ease); }
.manifesto__text .w.on { opacity: 1; }
.manifesto__foot {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 4vw, 64px);
  margin-top: clamp(40px, 6vw, 90px); padding-top: 28px; border-top: 1px solid var(--line);
}
.manifesto__foot p:first-child { font-family: var(--serif); font-size: clamp(21px, 2.2vw, 30px); line-height: 1.25; letter-spacing: -.015em; }
.manifesto__foot p:last-child { color: var(--muted); max-width: 48ch; }

/* ── Percurso ── */
.path { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.path__num { position: sticky; top: 110px; display: flex; flex-direction: column; }
.path__big {
  font-family: var(--serif); font-weight: 300; font-size: clamp(140px, 22vw, 330px); line-height: .8; letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 1.5px var(--ink);
  background: linear-gradient(180deg, var(--accent), var(--accent)) no-repeat 0 100% / 100% 0%;
  -webkit-background-clip: text; background-clip: text;
  transition: background-size 1.4s var(--ease) .2s;
}
.in .path__big, html:not(.js) .path__big { background-size: 100% 100%; -webkit-text-stroke-color: var(--accent); }
.path__cap { margin-top: 22px; font-family: var(--serif); font-size: clamp(19px, 1.8vw, 25px); line-height: 1.2; max-width: 16ch; }
.path__where { margin-top: 14px; }
.path__body .prose { margin-top: 24px; }
.roles { margin-top: 40px; counter-reset: r; border-top: 1px solid var(--line); }
.roles li {
  counter-increment: r; display: flex; align-items: baseline; gap: 20px; padding: 17px 0; border-bottom: 1px solid var(--line);
  font-family: var(--serif); font-size: clamp(20px, 2vw, 27px); letter-spacing: -.015em;
  transition: padding-left .4s var(--ease), color .3s, opacity .8s var(--ease), transform .8s var(--ease);
}
.roles li::before { content: counter(r, decimal-leading-zero); font: 400 12px var(--mono); color: var(--muted); letter-spacing: .08em; }
.roles li:hover { padding-left: 14px; color: var(--accent); }
.next { margin-top: 36px; display: grid; gap: 8px; }
.next__v { font-weight: 600; }

/* ── Inclinação 3D (cartões) ── */
.tilt { perspective: 1100px; }
.tilt > * {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .3s;
  will-change: transform;
}
.tilt.is-tilting { --z: 1; }
.tilt.is-tilting > * { transition-duration: .08s, .5s, .3s; box-shadow: var(--shadow); }

/* ── Etiquetas e ligações ── */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags i { font-style: normal; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; }
.link { font-weight: 600; border-bottom: 2px solid var(--accent); padding-bottom: 2px; transition: color .2s; }
.link:hover { color: var(--accent); }

/* ── Projetos em destaque ── */
.case {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: clamp(28px, 5vw, 72px); align-items: start;
  padding-block: clamp(36px, 5vw, 72px); border-top: 1px solid var(--line);
}
.case--flip .case__media { order: 2; }
.case__media { position: sticky; top: 96px; }
.frame { margin: 0; }
.frame__in { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.frame__bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.frame__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.frame__bar span { margin-left: 10px; font: 400 12px var(--mono); color: var(--muted); }
.case__img { display: block; width: 100%; height: auto; transition: opacity .25s; }
.case__img.is-swapping { opacity: 0; }
.shots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.shots button {
  padding: 0; background: none; border: 0; cursor: pointer; text-align: left; color: var(--muted);
  font: 400 11px var(--mono); letter-spacing: .06em; text-transform: uppercase;
}
.shots img {
  display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top;
  border-radius: 9px; border: 1px solid var(--line); margin-bottom: 7px; opacity: .6;
  transition: opacity .25s, border-color .25s, transform .35s var(--ease);
}
.shots button:hover img { opacity: 1; transform: translateY(-3px); }
.shots .is-on { color: var(--ink); }
.shots .is-on img { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.case__n { font: 400 12px var(--mono); letter-spacing: .08em; color: var(--accent); }
.case h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.1vw, 58px); overflow-wrap: anywhere; line-height: 1; letter-spacing: -.035em; margin-top: 12px; }
.case__kind { margin-top: 12px; font-size: 14px; color: var(--muted); }
.case__desc { margin-top: 22px; font-size: 1.1em; }
.case__list { margin-top: 22px; border-top: 1px solid var(--line); }
.case__list li { position: relative; padding: 13px 0 13px 24px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .96em; }
.case__list li::before { content: ''; position: absolute; left: 2px; top: 1.45em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.facts dt { font-family: var(--serif); font-size: clamp(28px, 3vw, 42px); line-height: 1; letter-spacing: -.03em; white-space: nowrap; }
.facts dd { margin-top: 8px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.case__foot { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }

/* ── Trabalho em contexto de empresa ── */
.work { margin-top: clamp(20px, 3vw, 40px); padding: clamp(28px, 4.5vw, 64px); background: var(--ink); color: var(--bg); border-radius: 26px; }
.work__k { font: 400 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.work__title { font-family: var(--serif); font-weight: 350; font-size: clamp(34px, 5.6vw, 84px); line-height: 1; letter-spacing: -.035em; margin: 18px 0 16px; max-width: 16ch; text-wrap: balance; }
.work__note { opacity: .7; max-width: 52ch; }
.work__cols {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 44px);
  margin: clamp(30px, 4vw, 54px) 0; padding-top: 28px; border-top: 1px solid color-mix(in srgb, var(--bg) 22%, transparent);
}
.work__cols h4 { margin: 0 0 10px; font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 2.1vw, 29px); letter-spacing: -.02em; }
.work__cols p { opacity: .72; font-size: .96em; }
.tags--lg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tags--lg i { border-color: color-mix(in srgb, var(--bg) 28%, transparent); color: var(--bg); font-size: 12px; letter-spacing: .04em; text-transform: none; padding: 8px 13px; }

/* ── Princípios ── */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: p; border-top: 1px solid var(--line); }
.principles li { counter-increment: p; padding: clamp(24px, 3vw, 40px) clamp(16px, 2.4vw, 34px) clamp(28px, 3.4vw, 48px) 0; border-bottom: 1px solid var(--line); }
.principles li::before { content: counter(p, decimal-leading-zero); display: block; font: 400 12px var(--mono); letter-spacing: .08em; color: var(--accent); margin-bottom: 30px; }
.principles h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(23px, 2.2vw, 31px); line-height: 1.1; letter-spacing: -.02em; margin-bottom: 12px; }
.principles p { color: var(--muted); max-width: 34ch; }

/* ── Vida (bento) ── */
.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 24px); }
.tile { grid-column: span 2; }
.tile--family { grid-column: span 4; }
.tile--benfica { grid-column: span 2; }
.tile__in {
  position: relative; height: 100%; min-height: 250px; display: flex; flex-direction: column; gap: 12px;
  padding: clamp(24px, 2.8vw, 38px); background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
}
.tile__ico { width: 40px; height: 40px; color: var(--accent); margin-bottom: auto; transform: translateZ(calc(var(--z, 0) * 40px)); transition: transform .5s var(--ease); }
.tile h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.05; letter-spacing: -.025em; margin-top: 28px; transform: translateZ(calc(var(--z, 0) * 30px)); transition: transform .5s var(--ease); }
.tile p { color: var(--muted); max-width: 46ch; transform: translateZ(calc(var(--z, 0) * 16px)); transition: transform .5s var(--ease); }
.tile--family h3 { font-size: clamp(38px, 5vw, 72px); }
.tile--family p { font-size: 1.08em; color: var(--ink); }
.tile--benfica .tile__in { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tile--benfica .tile__ico, .tile--benfica p { color: inherit; }
.tile--benfica p { opacity: .92; }
.tile__motto { font-family: var(--serif); font-style: italic; font-size: 19px; opacity: .85; }
.tile--food .tile__ico { color: #E08A2E; }

/* ── Ferramentas ── */
.tools > div { display: grid; grid-template-columns: minmax(150px, .32fr) 1fr; gap: 12px 32px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.tools > div:first-child { border-top: 1px solid var(--line); }
.tools dt { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 5px; }
.tools dd { font-family: var(--serif); font-size: clamp(19px, 1.9vw, 25px); line-height: 1.35; letter-spacing: -.01em; }

/* ── Contacto ── */
.contact__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(20px, 4vw, 60px); align-items: center; }
.contact__title { font-family: var(--serif); font-weight: 350; font-size: clamp(42px, 7vw, 108px); line-height: .98; letter-spacing: -.04em; margin-bottom: 28px; text-wrap: balance; }

/* ── Rodapé ── */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-block: 28px 36px; border-top: 1px solid var(--line); }
/* no fim da página o boneco pára no canto inferior direito: o rodapé deixa-lhe esse espaço livre */
.footer { padding-right: calc(var(--pad) + var(--buddy-h) * .452 + 8px); }
.footer__motto { color: var(--ink); }
.footer a:hover { color: var(--accent); }

/* ── O companheiro: caminha pelo fundo do ecrã com o scroll ── */
.buddy {
  --h: var(--buddy-h);
  position: fixed; left: 0; bottom: 0; z-index: 15;
  width: calc(var(--h) * .452); height: var(--h);
  transform: translate3d(var(--x, 16px), 0, 0);
  opacity: 0; transition: opacity .6s var(--ease);
}
.buddy.is-ready { opacity: 1; }
.buddy__btn { position: absolute; inset: 0; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.buddy__fig { position: absolute; inset: 0; display: block; transform: scaleX(var(--dir, 1)); }
.buddy__body {
  position: absolute; inset: 0; display: block; transform-origin: 50% 100%;
  animation: buddy-breathe 3.4s ease-in-out infinite;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18));
}
/* parado: de frente · a andar: tira de 6 passos, de lado */
.buddy__idle, .buddy__walk { position: absolute; inset: 0; display: block; width: 100%; height: 100%; transition: opacity .12s; }
.buddy__idle { object-fit: contain; object-position: bottom; }
.buddy__walk { background: url(../img/hm-andar.webp) 0 0 / 600% 100% no-repeat; opacity: 0; }
.buddy.is-walking .buddy__idle { opacity: 0; }
.buddy.is-walking .buddy__walk { opacity: 1; animation: buddy-steps .72s steps(6, jump-none) infinite; }
.buddy.is-walking .buddy__body { animation: none; }
.buddy.is-jumping .buddy__body { animation: buddy-jump .7s var(--ease); }
.buddy__shadow {
  position: absolute; left: 18%; right: 18%; bottom: -3px; height: 9px; border-radius: 50%;
  background: rgba(0, 0, 0, .22); filter: blur(4px); z-index: -1; transition: transform .3s, opacity .3s;
}
.buddy.is-jumping .buddy__shadow { transform: scale(.6); opacity: .5; }
.buddy__bubble {
  position: absolute; bottom: calc(100% + 6px); left: 50%; width: max-content; max-width: min(240px, 62vw);
  padding: 10px 14px; border-radius: 16px 16px 16px 4px;
  background: var(--ink); color: var(--bg); font: 500 13px/1.35 var(--sans); text-align: left;
  text-wrap: balance;
  opacity: 0; transform: translateY(8px) scale(.94); transform-origin: 0 100%;
  transition: opacity .3s var(--ease), transform .3s var(--ease); pointer-events: none;
}
.buddy.is-right .buddy__bubble { left: auto; right: 50%; border-radius: 16px 16px 4px 16px; transform-origin: 100% 100%; }
.buddy.is-talking .buddy__bubble, .buddy:hover .buddy__bubble, .buddy:focus-within .buddy__bubble { opacity: 1; transform: none; }
.buddy.is-talking .buddy__bubble { pointer-events: auto; }
.buddy__bubble a { display: inline-block; margin-top: 4px; font-weight: 700; white-space: nowrap; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.buddy__bubble a:hover { color: var(--accent); }
@keyframes buddy-breathe { 50% { transform: scaleY(1.012); } }
@keyframes buddy-steps { from { background-position-x: 0%; } to { background-position-x: 100%; } }
@keyframes buddy-jump {
  0% { transform: scale(1.06, .9); }
  35% { transform: translateY(-34%) scale(.95, 1.06) rotate(-4deg); }
  60% { transform: translateY(-34%) scale(.97, 1.03) rotate(4deg); }
  85% { transform: translateY(0) scale(1.07, .9); }
  100% { transform: none; }
}

/* ── Revelar ao scroll (só com JS) ── */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ── Responsivo ── */
@media (max-width: 900px) {
  .nav__links { display: none; }
  :root { --buddy-h: clamp(92px, 16vh, 140px); }
  .footer { padding-right: var(--pad); padding-bottom: calc(var(--buddy-h) + 22px); }
  .hero { grid-template-columns: 1fr; padding-top: 84px; gap: 8px; }
  .hero__stage { order: -1; margin-bottom: 20px; }
  .stage { max-width: 440px; max-height: 46svh; }
  .orbit-legend { display: none; }
  .path { grid-template-columns: 1fr; }
  .path__num { position: static; }
  .manifesto__foot { grid-template-columns: 1fr; }
  .case { grid-template-columns: 1fr; }
  .case--flip .case__media { order: 0; }
  .case__media { position: static; }
  .work__cols { grid-template-columns: 1fr; }
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile, .tile--benfica { grid-column: span 1; }
  .tile--family { grid-column: 1 / -1; }
  .contact__grid { grid-template-columns: 1fr; }
  .stage--small { justify-self: center; max-width: 320px; }
}
@media (max-width: 560px) {
  .nav__name { display: none; }
  .principles, .bento { grid-template-columns: 1fr; }
  .tile { grid-column: 1 / -1; }
  .tile__in { min-height: 0; }
  .tools > div { grid-template-columns: 1fr; gap: 6px; }
  .btn { height: 48px; padding: 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .manifesto__text .w { opacity: 1; }
  .dot { animation: none; }
  .buddy__body { animation: none !important; }
  .buddy__walk { display: none; }
  .buddy.is-walking .buddy__idle { opacity: 1; }
  .tilt > * { transform: none !important; }
}
