/* ==========================================================================
   Jean Valencia — Portefólio
   Minimalismo sofisticado · dark mode · 3D e interação
   ========================================================================== */

/* fontes:inicio */
/* Geist, Geist Mono e Instrument Serif (SIL Open Font License 1.1), servidas pelo próprio site. Gerado por _build/fontes.py */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/geist-normal-latin-ext-f81819.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/geist-normal-latin-04ce1a.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/geist-mono-normal-symbols2-3f14fa.woff2") format("woff2"); unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/geist-mono-normal-latin-ext-341e82.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/geist-mono-normal-latin-749b50.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/geist-mono-normal-symbols2-3f14fa.woff2") format("woff2"); unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/geist-mono-normal-latin-ext-341e82.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/geist-mono-normal-latin-749b50.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/instrument-serif-italic-latin-ext-7f7326.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/instrument-serif-italic-latin-253e49.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/instrument-serif-normal-latin-ext-73b57d.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/instrument-serif-normal-latin-d65c26.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* fontes:fim */

:root {
  --bg: #0a0a0b;
  --bg-2: #111113;
  --bg-3: #19191c;
  --fg: #ecebe6;
  --fg-2: #a4a39d;
  --fg-3: #85847f; /* texto secundário: contraste ≥ 4,5:1 sobre os três fundos */
  --line: rgba(236, 235, 230, .13);
  --line-2: rgba(236, 235, 230, .07);
  --accent: #ff5b23;
  --accent-ink: #0a0a0b;

  --f-sans: "Geist", "Helvetica Neue", Arial, system-ui, sans-serif;
  --f-serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* margem lateral; no iPhone deitado respeita o recorte do ecrã */
  --pad: max(clamp(16px, 4vw, 56px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --safe-b: env(safe-area-inset-bottom, 0px);
  --hdr: 72px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.76, 0, .24, 1);
  --r: 4px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr) + 16px); scrollbar-gutter: stable; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip; /* corta sem criar uma área de scroll (mantém os elementos sticky) */
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Ligação «saltar para o conteúdo»: só aparece com o teclado */
.skip {
  position: fixed; left: var(--pad); top: 12px; z-index: 400; padding: 10px 16px; border-radius: 999px;
  background: var(--fg); color: var(--accent-ink); font-size: 14px; font-weight: 500;
  transform: translateY(-160%); transition: transform .4s var(--ease);
}
.skip:focus, .skip:focus-visible { transform: none; outline-offset: 2px; }

/* Textos à espera da tradução inglesa (evita ver o português por instantes) */
html.i18n-wait [data-i18n] { visibility: hidden; }

/* Grão de película — dá matéria ao preto */
body::after {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: 200;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
@media (pointer: coarse) { body::after { animation: none; } }

/* ---------- Tipografia ---------- */
.mono {
  font-family: var(--f-mono);
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 400;
}
.serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.muted { color: var(--fg-2); }
.dim { color: var(--fg-3); }
.accent { color: var(--accent); }
.kicker { margin-bottom: 18px; }
.t-h2 {
  font-size: clamp(2.6rem, 7.2vw, 7.4rem);
  line-height: .92;
  letter-spacing: -.045em;
  font-weight: 500;
}
.t-h2 .serif { letter-spacing: -.02em; }
.t-h2--gap { margin-bottom: clamp(48px, 6vw, 88px); }
.t-lead {
  font-size: clamp(1.45rem, 3.1vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -.03em;
  font-weight: 400;
}

/* ---------- Palavras divididas (animação de entrada) ---------- */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .04em .12em; margin: 0 -.04em -.12em; }
.wi { display: inline-block; }
html.motion [data-split] .wi, html.motion .hero__title .wi, html.motion .w-hero__title .wi { transform: translateY(115%); }
html.motion [data-hero-fade] { opacity: 0; }
html.motion [data-reveal] { opacity: 0; transform: translateY(28px); }

/* ---------- Cursor ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; display: none; }
html.has-cursor .cursor { display: block; }
html.has-cursor, html.has-cursor a, html.has-cursor button, html.has-cursor [data-cursor] { cursor: none; }
.cursor__dot {
  position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: var(--accent); transition: transform .3s var(--ease), opacity .3s;
}
.cursor__ring {
  position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 1px solid rgba(236, 235, 230, .35);
  display: grid; place-items: center;
  transition: width .5s var(--ease), height .5s var(--ease), margin .5s var(--ease), background-color .4s, border-color .4s;
}
.cursor__label {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-ink); opacity: 0; transform: scale(.6); transition: opacity .3s, transform .4s var(--ease);
  white-space: nowrap;
}
.cursor.is-link .cursor__ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: rgba(236, 235, 230, .6); }
.cursor.is-label .cursor__ring { width: 96px; height: 96px; margin: -48px 0 0 -48px; background: var(--fg); border-color: var(--fg); }
.cursor.is-label .cursor__label { opacity: 1; transform: none; }
.cursor.is-label .cursor__dot, .cursor.is-link .cursor__dot { transform: scale(0); }
.cursor.is-down .cursor__ring { transform: scale(.82); }
.cursor.is-hidden { opacity: 0; }

/* ---------- Barra de progresso ---------- */
.progress { position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 120; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; transition: opacity .3s; }
html.pv-open .progress { opacity: 0; }

/* ---------- Cabeçalho ---------- */
.hdr {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--hdr);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  padding: 0 var(--pad);
  transition: background-color .5s, backdrop-filter .5s;
}
.hdr.is-scrolled { background: rgba(10, 10, 11, .62); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); }
.hdr.is-scrolled::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line-2); }
.logo { display: inline-flex; align-items: center; gap: 12px; justify-self: start; }
.logo svg { height: 21px; width: auto; max-width: none; overflow: visible; flex: 0 0 auto; } /* sem max-width, a grelha do cabeçalho reserva o espaço do símbolo */
.jv .jv-dot { transition: transform .7s var(--ease); }
.logo__name { font-size: 14px; font-weight: 500; letter-spacing: -.01em; line-height: 1.1; white-space: nowrap; }
.logo__name small { display: block; font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); font-weight: 400; margin-top: 3px; }
.nav { display: flex; gap: 4px; padding: 5px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(17, 17, 19, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.nav a {
  position: relative; display: inline-flex; align-items: baseline; gap: 6px;
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; color: var(--fg-2); white-space: nowrap;
  transition: color .4s, background-color .4s;
}
.nav a sup { font-family: var(--f-mono); font-size: 9px; color: var(--fg-3); transition: color .4s; }
.nav a.is-active { color: var(--accent-ink); background: var(--fg); }
.nav a.is-active sup { color: var(--accent-ink); opacity: .7; }
.hdr__right { justify-self: end; display: flex; align-items: center; gap: 18px; }
.clock { color: var(--fg-3); white-space: nowrap; }
.clock b { color: var(--fg-2); font-weight: 400; }
.menu-btn { display: none; align-items: center; gap: 10px; min-height: 44px; padding: 0 2px; }
.menu-btn__icon { width: 22px; height: 10px; position: relative; flex: 0 0 auto; }
.menu-btn__icon::before, .menu-btn__icon::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform .6s var(--ease), top .6s var(--ease); }
.menu-btn__icon::before { top: 0; } .menu-btn__icon::after { top: 8.5px; }
.menu-open .menu-btn__icon::before { top: 4.25px; transform: rotate(45deg); }
.menu-open .menu-btn__icon::after { top: 4.25px; transform: rotate(-45deg); }

/* Comutador de língua (PT / EN) */
.lsw { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; flex: 0 0 auto; }
.lsw a { min-width: 32px; height: 28px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 999px; color: var(--fg-3); transition: color .3s, background-color .3s; }
.lsw a.is-active { background: var(--fg); color: var(--accent-ink); }
.lsw--lg { padding: 4px; }
.lsw--lg a { height: 38px; padding: 0 16px; font-size: 12px; }

/* ---------- Botões ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  height: 46px; padding: 0 22px; border-radius: 999px; overflow: hidden; isolation: isolate;
  border: 1px solid var(--line); font-size: 14px; font-weight: 500; letter-spacing: -.005em; white-space: nowrap;
  transition: border-color .5s, color .5s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fg);
  transform: translateY(101%); border-radius: 50% 50% 0 0 / 30% 30% 0 0;
  transition: transform .7s var(--ease), border-radius .7s var(--ease);
}
.btn--solid { background: var(--fg); color: var(--accent-ink); border-color: var(--fg); }
.btn--solid::before { background: var(--accent); }
.btn--sm { height: 38px; padding: 0 16px; font-size: 13px; }
.btn .arr { display: inline-block; transition: transform .6s var(--ease); }
.btn:active { transform: scale(.97); }

/* Link sublinhado animado */
.ulink { position: relative; display: inline-block; }
.ulink::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .7s var(--ease); }

/* Estados de hover só em dispositivos com rato (no toque ficavam «presos» depois de tocar) */
@media (hover: hover) {
  .logo:hover .jv-dot { transform: translateY(-5px); }
  .nav a:hover { color: var(--fg); }
  .nav a.is-active:hover { color: var(--accent-ink); }
  .lsw a:hover { color: var(--fg); }
  .lsw a.is-active:hover { color: var(--accent-ink); }
  .btn:hover { color: var(--accent-ink); border-color: var(--fg); }
  .btn:hover::before { transform: translateY(0); border-radius: 0; }
  .btn:hover .arr { transform: translateX(4px) rotate(-45deg); }
  .ulink:hover::after { transform: scaleX(1); transform-origin: left; }
}

/* ---------- Menu móvel ---------- */
.mmenu {
  position: fixed; inset: 0; z-index: 95; background: var(--bg-2);
  padding: calc(var(--hdr) + 32px) var(--pad) calc(32px + var(--safe-b));
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  overflow-y: auto; overscroll-behavior: contain;
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path .9s var(--ease-io), visibility 0s .9s;
}
.menu-open .mmenu { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .9s var(--ease-io); }
.mmenu ol { display: grid; gap: 4px; }
.mmenu a { display: flex; align-items: baseline; gap: 14px; }
.mmenu ol a { font-size: clamp(2.2rem, min(11vw, 8.5vh), 4.2rem); letter-spacing: -.045em; line-height: 1.02; font-weight: 500; }
.mmenu ol a span { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; color: var(--fg-3); }
.mmenu ol a:focus-visible { outline-offset: -3px; }
.mmenu li { overflow: hidden; }
.mmenu li > a { transform: translateY(105%); transition: transform .9s var(--ease); }
.menu-open .mmenu li > a { transform: none; }
.menu-open .mmenu li:nth-child(2) > a { transition-delay: .05s; } .menu-open .mmenu li:nth-child(3) > a { transition-delay: .1s; }
.menu-open .mmenu li:nth-child(4) > a { transition-delay: .15s; } .menu-open .mmenu li:nth-child(5) > a { transition-delay: .2s; }
.menu-open .mmenu li:nth-child(6) > a { transition-delay: .25s; } .menu-open .mmenu li:nth-child(7) > a { transition-delay: .3s; }
.menu-open .mmenu li:nth-child(8) > a { transition-delay: .35s; }
.mmenu__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; color: var(--fg-2); }
.mmenu__foot .lsw { flex-basis: 100%; justify-content: flex-start; width: max-content; }

/* ---------- Transição de página e pré-carregamento ---------- */
.pt { position: fixed; inset: 0; z-index: 250; pointer-events: none; display: grid; place-items: center; }
.pt__panel { position: absolute; inset: 0; background: var(--bg-3); transform: scaleY(0); transform-origin: 50% 100%; }
.pt__mark { position: relative; width: 84px; height: auto; opacity: 0; }
html.pt-in .pt__panel { transform: scaleY(1); }
html.pt-in .pt__mark { opacity: 1; }

.loader { position: fixed; inset: 0; z-index: 260; background: var(--bg); display: none; padding: var(--pad); }
html.motion.is-loading .loader { display: grid; grid-template-rows: auto 1fr auto; }
.loader__top { display: flex; justify-content: space-between; color: var(--fg-3); padding-top: 8px; }
.loader__mark { align-self: center; justify-self: center; width: min(200px, 40vw); overflow: visible; }
.loader__mark path { stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0; }
.loader__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.loader__count { font-size: clamp(4rem, 16vw, 12rem); line-height: .8; letter-spacing: -.06em; font-weight: 500; font-variant-numeric: tabular-nums; }
.loader__bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Canvas 3D ---------- */
.gl { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.gl-fallback {
  position: fixed; z-index: 0; pointer-events: none; width: 46vmax; height: 46vmax; right: -6vmax; top: 18vh;
  border-radius: 50%; filter: blur(60px); opacity: .55;
  background: radial-gradient(circle at 35% 35%, #ff7a45 0%, #6b3bff 45%, transparent 70%);
  display: none;
}
html.no-webgl .gl-fallback { display: block; }
html.no-webgl .gl { display: none; }

/* ---------- Estrutura de secções ---------- */
main { position: relative; z-index: 1; }
.section { position: relative; padding: clamp(110px, 14vw, 210px) var(--pad); }
.section--flush { padding-left: 0; padding-right: 0; }
.pad-x { padding: 0 var(--pad); }
.sec-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; margin-bottom: clamp(48px, 7vw, 104px); color: var(--fg-2); }
.sec-head--index { margin-bottom: 0; margin-top: clamp(72px, 9vw, 130px); }
.sec-head__line { height: 1px; background: var(--line); transform-origin: 0 50%; }
html.motion .sec-head__line { transform: scaleX(0); }
.sec-head__n { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; padding: calc(var(--hdr) + 24px) var(--pad) 32px;
  display: grid; grid-template-rows: auto 1fr auto; gap: 24px;
}
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--fg-2); }
.hero__meta > span { display: inline-flex; align-items: center; gap: 10px; }
.dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(3.6); opacity: 0; } }
.hero__center { align-self: end; }
.hero__title {
  font-size: clamp(4.2rem, 15.5vw, 16.5rem);
  line-height: .84; letter-spacing: -.06em; font-weight: 500;
  margin-left: -.05em;
}
.hero__title .row { display: block; }
.hero__title .row--2 { padding-left: clamp(0px, 9vw, 180px); }
.hero__title .serif { font-weight: 400; letter-spacing: -.035em; padding-right: .08em; }
.hero__sub { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px; margin-top: clamp(28px, 4vw, 48px); }
.hero__lede { max-width: 30ch; font-size: clamp(1.15rem, 1.9vw, 1.65rem); line-height: 1.25; letter-spacing: -.02em; color: var(--fg-2); }
.hero__lede em { font-family: var(--f-serif); color: var(--fg); font-size: 1.15em; }
.hero__foot { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 22px; border-top: 1px solid var(--line-2); color: var(--fg-3); }
.scroll-cue { display: inline-flex; align-items: center; gap: 12px; color: var(--fg-2); min-height: 34px; }
.scroll-cue i { position: relative; width: 1px; height: 34px; background: var(--line); overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 40%; background: var(--fg); transform: translateY(-100%); animation: cue 2s var(--ease-io) infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 100% { transform: translateY(260%); } }
.hint-3d { display: inline-flex; align-items: center; gap: 10px; }
.hint-3d svg { width: 18px; height: 18px; animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sobre ---------- */
.statement { max-width: 22ch; font-size: clamp(2rem, 4.9vw, 4.9rem); line-height: 1.04; letter-spacing: -.045em; font-weight: 400; }
.statement .serif { letter-spacing: -.02em; }
.statement .sw { transition: color .2s; }
html.motion .statement .sw { color: rgba(236, 235, 230, .14); }
.about { display: grid; grid-template-columns: minmax(280px, 5fr) 7fr; gap: clamp(40px, 7vw, 120px); margin-top: clamp(64px, 9vw, 140px); align-items: start; }
.about__text { display: grid; gap: 22px; max-width: 60ch; font-size: clamp(1rem, 1.25vw, 1.15rem); color: var(--fg-2); }
.about__text p:first-child { color: var(--fg); font-size: 1.12em; }
.about__text strong { color: var(--fg); font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(56px, 7vw, 104px); border-top: 1px solid var(--line); }
.stat { padding: 26px 18px 0 0; border-right: 1px solid var(--line-2); padding-left: 18px; }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: 0; }
.stat__n { font-size: clamp(2.8rem, 6vw, 5.6rem); line-height: .9; letter-spacing: -.055em; font-weight: 500; font-variant-numeric: tabular-nums; }
.stat__n sup { font-size: .4em; color: var(--accent); vertical-align: top; margin-left: 2px; position: relative; top: .25em; }
.stat__l { margin-top: 12px; color: var(--fg-2); }

/* Cartão de visita 3D */
.card3d { perspective: 1200px; width: 100%; max-width: 440px; border-radius: 10px; cursor: pointer; }
.card3d:focus-visible { outline-offset: 6px; }
.card3d__inner {
  position: relative; aspect-ratio: 1.6; transform-style: preserve-3d;
  transition: transform 1.1s var(--ease);
}
.card3d.is-flipped .card3d__inner { transform: rotateY(180deg); }
.card3d__face {
  position: absolute; inset: 0; border-radius: 10px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  padding: 24px; display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at var(--gx, 20%) var(--gy, 0%), rgba(255, 255, 255, .09), transparent 46%),
    linear-gradient(135deg, #1c1c20 0%, #0f0f11 60%, #151517 100%);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.card3d__face--back { transform: rotateY(180deg); background: var(--fg); color: var(--accent-ink); border-color: var(--fg); }
.card3d__face--back .mono { color: rgba(10, 10, 11, .66); }
.card3d__top { display: flex; justify-content: space-between; align-items: flex-start; }
.card3d__top svg { height: 24px; width: auto; }
.card3d__name { font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -.035em; line-height: 1; font-weight: 500; }
.card3d__name .serif { display: block; font-size: .78em; color: var(--fg-2); margin-top: 6px; }
.card3d__contacts { display: grid; gap: 6px; font-size: 15px; letter-spacing: -.01em; }
.card3d__hint { margin-top: 16px; color: var(--fg-3); display: flex; align-items: center; gap: 10px; }

/* ---------- Experiência ---------- */
.xp-intro { margin: 28px 0 56px; max-width: 52ch; }
.xp { border-top: 1px solid var(--line); }
.xp__item { position: relative; border-bottom: 1px solid var(--line); }
.xp__head {
  position: relative; width: 100%; text-align: left; display: grid; align-items: center;
  grid-template-columns: 150px minmax(0, 1.25fr) minmax(0, 1fr) 40px; gap: 24px;
  padding: 30px 0; isolation: isolate;
}
.xp__head::before {
  content: ""; position: absolute; inset: 0 calc(var(--pad) * -1); z-index: -1; background: var(--bg-2);
  transform: scaleY(0); transform-origin: 50% 100%; transition: transform .6s var(--ease);
}
.xp__item.is-open .xp__head::before { transform: scaleY(1); }
.xp__years { color: var(--fg-2); font-variant-numeric: tabular-nums; }
.xp__role { font-size: clamp(1.25rem, 2.3vw, 2.1rem); letter-spacing: -.035em; line-height: 1.08; font-weight: 500; transition: transform .6s var(--ease); }
.xp__co { display: grid; gap: 4px; }
.xp__co b { font-weight: 500; font-size: 15px; }
.xp__co span { color: var(--fg-3); }
.xp__toggle { justify-self: end; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); position: relative; transition: background-color .4s, border-color .4s, transform .7s var(--ease); }
.xp__toggle::before, .xp__toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1px; margin-left: -5.5px; background: currentColor; }
.xp__toggle::after { transform: rotate(90deg); transition: transform .6s var(--ease); }
.xp__item.is-open .xp__toggle { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: rotate(180deg); }
.xp__item.is-open .xp__toggle::after { transform: rotate(0deg); }
html.js .xp__body { height: 0; overflow: hidden; } /* sem JavaScript, o detalhe fica sempre visível */
.xp__body-inner { display: grid; grid-template-columns: 150px minmax(0, 1.25fr) minmax(0, 1fr) 40px; gap: 24px; padding: 0 0 36px; }
.xp__list { grid-column: 2 / 4; display: grid; gap: 10px; color: var(--fg-2); max-width: 74ch; }
.xp__list li { position: relative; padding-left: 22px; }
.xp__list li::before { content: ""; position: absolute; left: 0; top: .72em; width: 10px; height: 1px; background: var(--accent); }
@media (hover: hover) {
  .xp__head:hover::before { transform: scaleY(1); }
  .xp__head:hover .xp__role { transform: translateX(10px); }
}

/* ---------- Competências ---------- */
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; perspective: 1400px; }
.skill {
  position: relative; min-height: 290px; padding: 28px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line-2); background: var(--bg-2);
  display: flex; flex-direction: column; gap: 28px;
  transform-style: preserve-3d; transition: border-color .5s;
}
.skill > div:last-child { margin-top: auto; }
.skill::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 91, 35, .16), transparent 45%);
}
.skill__top { display: flex; justify-content: space-between; color: var(--fg-3); transform: translateZ(30px); }
.skill__icon { width: 44px; height: 44px; color: var(--fg); transform: translateZ(50px); }
.skill h3 { font-size: clamp(1.35rem, 2vw, 1.8rem); letter-spacing: -.035em; line-height: 1.05; font-weight: 500; transform: translateZ(40px); }
.skill p { color: var(--fg-2); font-size: 15px; margin-top: 12px; transform: translateZ(24px); }

.tools { display: grid; grid-template-columns: 1fr 2fr; gap: clamp(32px, 6vw, 96px); margin-top: clamp(80px, 10vw, 150px); }
.tools__groups { display: grid; gap: 0; border-top: 1px solid var(--line); }
.tgroup { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line-2); align-items: baseline; }
.tgroup .mono { color: var(--fg-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; height: 36px; padding: 0 15px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 14px; color: var(--fg); background: rgba(17, 17, 19, .6);
  transition: background-color .4s, color .4s, border-color .4s;
}
@media (hover: hover) {
  .skill:hover { border-color: var(--line); }
  .skill:hover::before { opacity: 1; }
  .chip:hover { background: var(--fg); color: var(--accent-ink); border-color: var(--fg); }
}

.langs { margin-top: clamp(80px, 10vw, 150px); display: grid; grid-template-columns: 1fr 2fr; gap: clamp(32px, 6vw, 96px); }
.ltable { --lcols: 130px repeat(3, minmax(0, 1fr)) 128px; }
.lrow-head, .lang { display: grid; grid-template-columns: var(--lcols); align-items: center; gap: 20px; }
.lrow-head { padding-bottom: 14px; color: var(--fg-3); border-bottom: 1px solid var(--line); }
.lrow-head span:last-child { text-align: right; }
.lang { padding: 20px 0; border-bottom: 1px solid var(--line-2); }
.lang__name { font-size: 18px; letter-spacing: -.02em; }
.lang__note { margin-top: 16px; color: var(--fg-3); }
.lang__scale { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.lang__scale i { height: 6px; border-radius: 2px; background: var(--line-2); position: relative; overflow: hidden; }
.lang__scale i::after { content: ""; position: absolute; inset: 0; background: var(--fg); transform: scaleX(0); transform-origin: 0 50%; transition: transform .8s var(--ease); transition-delay: calc(var(--i) * 70ms); }
.lang.is-in .lang__scale i.on::after { transform: scaleX(1); }
.lang.is-in .lang__scale i.top::after { background: var(--accent); }
.lang__lvl { text-align: right; color: var(--fg-2); }

/* ---------- Formação ---------- */
/* linha do tempo: três formações por linha, da mais recente (ponto laranja) para a mais antiga;
   cada linha tem o seu traço, por isso a grelha aceita qualquer número de formações */
.edu { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.edu__item { position: relative; padding: 32px 28px 48px; border-top: 1px solid var(--line); border-right: 1px solid var(--line-2); }
.edu__item::before { content: ""; position: absolute; left: 28px; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--fg); }
.edu__item:nth-child(3n + 1) { padding-left: 0; }
.edu__item:nth-child(3n + 1)::before { left: 0; }
.edu__item:nth-child(3n), .edu__item:last-child { border-right: 0; }
.edu__item:first-child::before { background: var(--accent); }
.edu__years { color: var(--fg-2); }
.edu__title { margin-top: 22px; font-size: clamp(1.3rem, 2vw, 1.9rem); line-height: 1.08; letter-spacing: -.035em; font-weight: 500; }
.edu__school { margin-top: 14px; color: var(--fg); }
.edu__desc { margin-top: 14px; color: var(--fg-2); font-size: 15px; max-width: 42ch; }

/* Formação complementar: workshops e cursos curtos, em lista compacta */
.certs { margin-top: clamp(56px, 7vw, 104px); }
.certs__title { color: var(--fg-3); margin-bottom: 18px; }
.certs__list { border-top: 1px solid var(--line); }
.cert { display: grid; grid-template-columns: 150px minmax(0, 1.05fr) minmax(0, .8fr) minmax(0, 1.25fr); gap: 24px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--line-2); }
.cert__year { color: var(--fg-2); font-variant-numeric: tabular-nums; }
.cert__name { font-size: clamp(1.05rem, 1.4vw, 1.3rem); line-height: 1.2; letter-spacing: -.02em; font-weight: 500; }
.cert__org { color: var(--fg); font-size: 15px; }
.cert__note { color: var(--fg-2); font-size: 15px; }

/* ---------- Trabalho (resumo) ---------- */
.work-intro { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: end; margin-bottom: clamp(48px, 6vw, 80px); }
.work-intro p { color: var(--fg-2); max-width: 46ch; font-size: clamp(1rem, 1.3vw, 1.18rem); }
.work-intro__ctas { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }

.rail { position: relative; overflow: hidden; padding: 0 0 clamp(40px, 6vw, 80px); }
.rail__track { display: flex; gap: clamp(16px, 2vw, 28px); padding: 0 var(--pad); width: max-content; perspective: 1600px; }
.fcard { position: relative; width: clamp(300px, 36vw, 560px); flex: 0 0 auto; transform-style: preserve-3d; }
.fcard__media { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--bg-3); }
.fcard__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 1.4s var(--ease), filter .8s; filter: saturate(.9); }
.fcard__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .28) 0%, transparent 22%, transparent 55%, rgba(0, 0, 0, .55)); }
.fcard__n { position: absolute; left: 16px; top: 14px; z-index: 1; color: rgba(255, 255, 255, .92); text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
.fcard__count { position: absolute; right: 16px; top: 14px; z-index: 1; color: rgba(255, 255, 255, .92); text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
.fcard__body { padding-top: 16px; display: grid; gap: 6px; }
.fcard__brand { color: var(--fg-3); }
.fcard__title { font-size: clamp(1.2rem, 1.7vw, 1.55rem); letter-spacing: -.03em; line-height: 1.1; font-weight: 500; }
.fcard__type { color: var(--fg-2); font-size: 14px; }
.rail__end { width: clamp(300px, 36vw, 560px); flex: 0 0 auto; aspect-ratio: 4 / 3; border-radius: 8px; border: 1px dashed var(--line); display: grid; place-items: center; text-align: center; padding: 24px; transition: border-color .5s, background-color .5s; }
.rail__end strong { display: block; font-size: clamp(1.6rem, 2.6vw, 2.4rem); letter-spacing: -.04em; font-weight: 500; line-height: 1; margin-bottom: 14px; }
/* sem animações (ou sem ScrollTrigger) a faixa desliza com o scroll horizontal normal */
html:not(.motion) .rail__track { overflow-x: auto; width: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--pad); scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding-bottom: 12px; }
html:not(.motion) .rail__progress { display: none; }
.rail__progress { margin: 28px var(--pad) 0; height: 1px; background: var(--line-2); position: relative; }
.rail__progress i { position: absolute; inset: 0; background: var(--fg); transform-origin: 0 50%; transform: scaleX(0); }

.brands { margin-top: clamp(80px, 10vw, 140px); border-top: 1px solid var(--line); }
.brands--flush { margin-top: 0; border-top: 0; }
.brow { position: relative; display: grid; grid-template-columns: 60px 1fr auto auto; gap: 24px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); isolation: isolate; transition: color .3s; }
.brow::before { content: ""; position: absolute; inset: 0 calc(var(--pad) * -1); z-index: -1; background: var(--fg); transform: scaleY(0); transform-origin: 50% 100%; transition: transform .55s var(--ease); }
.brow__n { color: var(--fg-3); transition: color .4s; }
.brow__name { font-size: clamp(1.7rem, 4.4vw, 4.2rem); letter-spacing: -.05em; line-height: 1; font-weight: 500; transition: transform .7s var(--ease); }
.brow__meta { color: var(--fg-2); text-align: right; transition: color .4s; }
.brow__arr { width: 44px; height: 44px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; opacity: .5; transition: transform .7s var(--ease), opacity .4s; }
@media (hover: hover) {
  .fcard:hover .fcard__media img { transform: scale(1.0); filter: saturate(1.05); }
  .rail__end:hover { border-color: var(--fg); background: var(--bg-2); }
  .brow:hover { color: var(--accent-ink); transition: color .35s .12s; }
  .brow:hover::before { transform: scaleY(1); transform-origin: 50% 0; }
  .brow:hover .brow__n, .brow:hover .brow__meta { color: rgba(10, 10, 11, .66); }
  .brow:hover .brow__name { transform: translateX(14px); }
  .brow:hover .brow__arr { transform: rotate(-45deg); opacity: 1; }
}

/* Pré-visualização que segue o cursor */
.peek { position: fixed; left: 0; top: 0; z-index: 90; width: 320px; aspect-ratio: 4 / 3; pointer-events: none; border-radius: 8px; overflow: hidden; opacity: 0; transform: scale(.6); transition: opacity .4s, transform .6s var(--ease); background: var(--bg-3); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); }
.peek.is-on { opacity: 1; transform: scale(1); }
.peek img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.peek img.is-on { opacity: 1; }

/* ---------- Contacto ---------- */
.contact { padding-bottom: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.contact__big { font-size: clamp(3.4rem, 12.5vw, 13rem); line-height: .86; letter-spacing: -.06em; font-weight: 500; }
.contact__big .serif { letter-spacing: -.035em; }
.contact__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-top: clamp(56px, 8vw, 120px); padding-top: 28px; border-top: 1px solid var(--line); }
.contact__grid .mono { color: var(--fg-3); margin-bottom: 12px; }
.contact__mail { display: inline-flex; align-items: center; gap: 14px; font-size: clamp(1.3rem, 2.6vw, 2.4rem); letter-spacing: -.035em; font-weight: 500; overflow-wrap: anywhere; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.contact__val { font-size: clamp(1.05rem, 1.5vw, 1.35rem); letter-spacing: -.02em; }
.contact__grid .contact__time { margin-top: 10px; margin-bottom: 0; }
/* o espaço à direita evita que o botão fixo «voltar ao início» tape a última ligação do rodapé */
.foot { margin-top: auto; padding: clamp(64px, 9vw, 120px) 76px calc(28px + var(--safe-b)) 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 28px; color: var(--fg-3); }
.foot a { color: var(--fg-2); }
.foot__legal { display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* ---------- Formulário de contacto ---------- */
.contact__layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr); gap: clamp(40px, 7vw, 120px); align-items: start; margin-top: clamp(56px, 8vw, 120px); padding-top: 28px; border-top: 1px solid var(--line); }
.contact__kicker { margin-bottom: 26px; }
.contact__aside { display: grid; gap: 40px; }
.contact__aside .mono { color: var(--fg-3); margin-bottom: 12px; }
.contact__aside .contact__mail { font-size: clamp(1.3rem, 2vw, 1.9rem); }
.cform { display: grid; gap: 30px; }
.cform__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.field { display: grid; gap: 10px; min-width: 0; }
.field__label { color: var(--fg-3); }
.field__input {
  width: 100%; min-width: 0; padding: 8px 0 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--fg); font: inherit; font-size: clamp(1.05rem, 1.35vw, 1.22rem); letter-spacing: -.01em;
  -webkit-appearance: none; appearance: none; transition: border-color .4s;
}
textarea.field__input { min-height: 156px; resize: vertical; line-height: 1.5; }
select.field__input {
  padding-right: 30px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a4a39d' stroke-width='1.6'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 2px center / 14px;
}
select.field__input option { background: var(--bg-2); color: var(--fg); }
select.field__input:invalid { color: var(--fg-3); }
.field__input:focus { outline: none; border-bottom-color: var(--accent); }
.field__input:focus-visible { outline: none; box-shadow: 0 1px 0 var(--accent); }
.field.is-invalid .field__input { border-bottom-color: var(--accent); }
.field__error { color: var(--accent); font-size: 13.5px; line-height: 1.45; }
.field__error:empty { display: none; }
/* armadilha para robôs: fora do ecrã, fora da navegação por teclado e escondida dos leitores de ecrã */
.cform__hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; align-items: start; color: var(--fg-2); font-size: 15px; line-height: 1.5; cursor: pointer; }
.check__box { width: 22px; height: 22px; margin-top: 1px; border: 1px solid var(--line); border-radius: 6px; display: grid; place-items: center; transition: background-color .3s, border-color .3s; }
.check__box::after { content: ""; width: 10px; height: 5px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .35s var(--ease); }
.check input:checked + .check__box { background: var(--fg); border-color: var(--fg); }
.check input:checked + .check__box::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.check input:focus-visible + .check__box { outline: 2px solid var(--accent); outline-offset: 3px; }
.field.is-invalid .check__box { border-color: var(--accent); }
.check a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.cform__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.cform__status { color: var(--fg-2); }
.cform__status.is-error { color: var(--accent); }
.cform.is-sending .cform__submit { opacity: .55; pointer-events: none; }
.cform__done { display: grid; gap: 18px; justify-items: start; }
.cform[hidden], .cform__done[hidden] { display: none; }
.cform__done h3 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 500; }
.cform__done p:not(.mono) { color: var(--fg-2); max-width: 44ch; font-size: clamp(1rem, 1.25vw, 1.12rem); }
@media (hover: hover) {
  .field__input:hover { border-bottom-color: var(--fg-3); }
  .field__input:focus:hover { border-bottom-color: var(--accent); }
  .check:hover .check__box { border-color: var(--fg-3); }
}

/* ---------- Consentimento para a análise de visitas ---------- */
.consent {
  position: fixed; left: var(--pad); bottom: calc(24px + var(--safe-b)); z-index: 230;
  width: min(440px, calc(100vw - 2 * var(--pad))); padding: 22px 22px 20px; border-radius: 14px;
  display: grid; gap: 12px; background: rgba(17, 17, 19, .95); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .75);
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: opacity .5s, transform .7s var(--ease), visibility 0s .7s;
}
.consent.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .5s, transform .7s var(--ease), visibility 0s; }
.consent__title { color: var(--fg); }
.consent__text { color: var(--fg-2); font-size: 14px; line-height: 1.5; }
.consent__text a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.consent__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.consent__actions .btn { flex: 1 1 0; justify-content: center; }
.foot__btn { color: var(--fg-2); font: inherit; letter-spacing: inherit; text-transform: inherit; }

/* ---------- Páginas de informação legal ---------- */
.legal { padding-top: calc(var(--hdr) + clamp(64px, 9vw, 140px)); }
.legal__title { margin-bottom: 26px; }
.legal__meta { color: var(--fg-3); }
.legal__body { max-width: 74ch; margin-top: clamp(44px, 6vw, 88px); display: grid; gap: 18px; color: var(--fg-2); font-size: clamp(1rem, 1.15vw, 1.08rem); line-height: 1.65; }
.legal__body h2 { margin-top: 26px; color: var(--fg); font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.2; letter-spacing: -.02em; font-weight: 500; }
.legal__body ul { display: grid; gap: 8px; padding-left: 1.2em; list-style: disc; }
.legal__body li::marker { color: var(--accent); }
.legal__body a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; overflow-wrap: anywhere; }
.legal__body strong { color: var(--fg); font-weight: 500; }
.legal__table { width: 100%; border-collapse: collapse; font-size: .95em; }
.legal__table th, .legal__table td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal__table th { font-family: var(--f-mono); font-size: 11.5px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.legal__table td:first-child { color: var(--fg); white-space: nowrap; }
.legal__scroll { overflow-x: auto; }
.notfound { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: calc(var(--hdr) + 40px) var(--pad) 64px; }
.notfound__code { color: var(--accent); }
.notfound__actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (hover: hover) {
  .legal__body a:hover, .check a:hover { text-decoration-color: var(--accent); }
}

/* ---------- Voltar ao início (sempre disponível) ---------- */
.totop {
  position: fixed; right: var(--pad); bottom: calc(24px + var(--safe-b)); z-index: 115; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(17, 17, 19, .78); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; visibility: hidden; transform: translateY(20px) scale(.8); pointer-events: none;
  transition: opacity .5s, transform .7s var(--ease), background-color .4s, color .4s, visibility 0s .5s;
}
.totop.is-on { opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity .5s, transform .7s var(--ease), background-color .4s, color .4s; }
.totop:active { transform: scale(.92); }
.totop svg { grid-area: 1 / 1; }
.totop__ring { width: 56px; height: 56px; transform: rotate(-90deg); fill: none; stroke-width: 1.4; }
.totop__ring circle:first-child { stroke: var(--line); }
.totop__prog { stroke: var(--accent); stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .2s linear; }
.totop__arrow { width: 18px; height: 18px; }
.totop__label { position: absolute; right: calc(100% + 12px); white-space: nowrap; color: var(--fg-2); opacity: 0; transform: translateX(8px); transition: opacity .4s, transform .6s var(--ease); pointer-events: none; }
@media (hover: hover) {
  .totop:hover { background: var(--fg); color: var(--accent-ink); }
  .totop:hover .totop__label { opacity: 1; transform: none; }
}
.lb.is-open ~ .totop, html.menu-open .totop { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- Toast ---------- */
/* escondido: desce para fora do ecrã por inteiro (altura + distância ao fundo) e fica invisível;
   antes ficavam 2 px à vista no fundo da página */
.toast { position: fixed; left: 50%; bottom: calc(28px + var(--safe-b)); z-index: 280; transform: translate(-50%, calc(100% + 40px + var(--safe-b))); visibility: hidden; padding: 12px 18px; border-radius: 999px; background: var(--fg); color: var(--accent-ink); font-size: 14px; display: flex; gap: 10px; align-items: center; transition: transform .7s var(--ease), visibility 0s .7s; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.is-on { transform: translate(-50%, 0); visibility: visible; transition: transform .7s var(--ease), visibility 0s; }
.toast i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }

/* ==========================================================================
   Página de trabalhos
   ========================================================================== */
.w-hero { position: relative; min-height: 88vh; min-height: 88svh; padding: calc(var(--hdr) + 40px) var(--pad) 48px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.w-hero__kicker { margin-bottom: 22px; }
.wall { position: absolute; inset: 0; z-index: 0; perspective: 1500px; overflow: hidden; pointer-events: none;
  -webkit-mask-image: radial-gradient(110% 80% at 70% 40%, #000 25%, transparent 75%); mask-image: radial-gradient(110% 80% at 70% 40%, #000 25%, transparent 75%); }
.wall__plane { --rx: 46deg; --rz: -20deg; position: absolute; left: 50%; top: 50%; width: 175vw; display: grid; grid-template-columns: repeat(10, 1fr); gap: 14px;
  transform: translate(-44%, -46%) rotateX(var(--rx)) rotateZ(var(--rz)); transform-style: preserve-3d; opacity: .5; }
.wall__col { display: grid; gap: 14px; align-content: start; animation: wallUp 70s linear infinite; }
.wall__col:nth-child(even) { animation-name: wallDown; }
.wall__col img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; filter: grayscale(.25) brightness(.8); }
@keyframes wallUp { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes wallDown { from { transform: translateY(-50%); } to { transform: translateY(0); } }
.w-hero::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(10, 10, 11, .3) 0%, rgba(10, 10, 11, .1) 40%, var(--bg) 96%); pointer-events: none; }
.w-hero > *:not(.wall) { position: relative; z-index: 1; }
.w-hero__title { font-size: clamp(4rem, 15vw, 15.5rem); line-height: .84; letter-spacing: -.06em; font-weight: 500; margin-left: -.05em; }
.w-hero__row { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end; margin-top: 32px; }
.w-hero__row p { max-width: 52ch; color: var(--fg-2); font-size: clamp(1rem, 1.35vw, 1.2rem); }
.w-stats { display: flex; gap: clamp(20px, 4vw, 56px); }
.w-stats div { display: grid; gap: 6px; }
.w-stats b { font-size: clamp(2rem, 4vw, 3.6rem); line-height: .9; letter-spacing: -.05em; font-weight: 500; font-variant-numeric: tabular-nums; }
.w-stats span { color: var(--fg-3); }

.filters { position: sticky; top: var(--hdr); z-index: 60; padding: 14px var(--pad); display: flex; justify-content: space-between; align-items: center; gap: 20px;
  background: rgba(10, 10, 11, .72); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line-2); }
.filters__chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); padding: 3px 30px 3px 3px; }
.filters__chips::-webkit-scrollbar { display: none; }
.fchip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13.5px; color: var(--fg-2); white-space: nowrap; transition: color .4s, background-color .4s, border-color .4s, transform .4s var(--ease); }
.fchip:focus-visible { outline-offset: -3px; }
.fchip sup { font-family: var(--f-mono); font-size: 9.5px; color: var(--fg-3); transition: color .4s; }
.fchip.is-active { background: var(--fg); color: var(--accent-ink); border-color: var(--fg); }
.fchip.is-active sup { color: rgba(10, 10, 11, .66); }
.fchip:active { transform: scale(.95); }
@media (hover: hover) {
  .fchip:hover { color: var(--fg); border-color: rgba(236, 235, 230, .35); }
  .fchip.is-active:hover { color: var(--accent-ink); border-color: var(--fg); }
}
.views { flex: 0 0 auto; position: relative; display: inline-flex; padding: 4px; border-radius: 999px; border: 1px solid var(--line); }
.views button { position: relative; z-index: 1; height: 30px; padding: 0 14px; font-size: 13px; color: var(--fg-2); display: inline-flex; align-items: center; gap: 8px; transition: color .4s; }
.views button.is-active { color: var(--accent-ink); }
.views button svg { width: 14px; height: 14px; }
.views__pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; border-radius: 999px; background: var(--fg); transition: transform .6s var(--ease), width .6s var(--ease); }

.wlist { padding: 0 var(--pad) 40px; }
.bsec { padding-top: clamp(72px, 9vw, 130px); scroll-margin-top: calc(var(--hdr) + 80px); }
.bsec.is-hidden { display: none; }
.bsec__head { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.bsec__n { color: var(--accent); margin-bottom: 18px; display: flex; gap: 16px; }
.bsec__n span { color: var(--fg-3); }
.bsec__name { font-size: clamp(2.4rem, 6.4vw, 6.4rem); line-height: .9; letter-spacing: -.055em; font-weight: 500; }
.bsec__desc { color: var(--fg-2); max-width: 52ch; justify-self: end; }
.bsec__desc .mono { display: block; margin-top: 16px; color: var(--fg-3); }

/* Vista em lista */
.plist { display: block; }
.prow { border-bottom: 1px solid var(--line-2); }
.prow__a { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1.3fr) minmax(0, 1fr) 110px 48px; gap: 20px; align-items: center; padding: 22px 0; isolation: isolate; }
.prow__a::before { content: ""; position: absolute; inset: 0 calc(var(--pad) * -1); z-index: -1; background: var(--bg-2); transform: scaleY(0); transform-origin: 50% 100%; transition: transform .5s var(--ease); }
.prow__n { color: var(--fg-3); }
.prow__title { font-size: clamp(1.25rem, 2.3vw, 2.1rem); letter-spacing: -.035em; line-height: 1.08; font-weight: 500; transition: transform .7s var(--ease), color .4s; }
.prow__type { color: var(--fg-2); font-size: 14px; }
.prow__count { color: var(--fg-2); text-align: right; }
.prow__arr { justify-self: end; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; transition: transform .7s var(--ease), background-color .4s, color .4s, border-color .4s; }
.prow__thumb { display: none; }
@media (hover: hover) {
  .prow__a:hover::before { transform: scaleY(1); transform-origin: 50% 0; }
  .prow__a:hover .prow__title { transform: translateX(12px); }
  .prow__a:hover .prow__arr { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: rotate(-45deg); }
}

/* Vista em grelha */
.is-grid .plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 36px 20px; padding-top: 36px; }
.is-grid .prow { border: 0; }
.is-grid .prow__a { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; perspective: 1200px; }
.is-grid .prow__a::before { display: none; }
.is-grid .prow__thumb { display: block; position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--bg-3); margin-bottom: 16px; transform-style: preserve-3d; }
.is-grid .prow__thumb img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.2s var(--ease); }
.is-grid .prow__n { position: absolute; z-index: 2; left: 14px; top: 12px; color: rgba(255, 255, 255, .92); }
.is-grid .prow__title { font-size: clamp(1.15rem, 1.6vw, 1.45rem); }
.is-grid .prow__type { margin-top: 6px; }
.is-grid .prow__count { position: absolute; z-index: 2; right: 14px; top: 12px; color: rgba(255, 255, 255, .92); font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.is-grid .prow__arr { display: none; }
.is-grid .prow__a .prow__n, .is-grid .prow__a .prow__count { text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
@media (hover: hover) {
  .is-grid .prow__a:hover .prow__thumb img { transform: scale(1); }
  .is-grid .prow__a:hover .prow__title { transform: none; color: var(--accent); }
}

/* ---------- Vista de projeto ---------- */
.pv { position: fixed; inset: 0; z-index: 110; background: var(--bg); visibility: hidden; clip-path: inset(100% 0 0 0); }
.pv.is-open { visibility: visible; }
.pv__scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.pv__bar { position: sticky; top: 0; z-index: 5; height: var(--hdr); display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 var(--pad);
  background: rgba(10, 10, 11, .7); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-2); }
.pv__crumb { display: flex; gap: 10px; align-items: center; color: var(--fg-2); min-width: 0; }
.pv__crumb b { color: var(--fg); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv__nav { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; transition: background-color .4s, color .4s, border-color .4s, transform .6s var(--ease); }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 16px; height: 16px; }
@media (hover: hover) {
  .icon-btn:hover { background: var(--fg); color: var(--accent-ink); border-color: var(--fg); }
  .icon-btn--close:hover { transform: rotate(90deg); }
}
.pv__hero { padding: clamp(48px, 8vw, 120px) var(--pad) clamp(40px, 5vw, 72px); display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: end; }
.pv__kicker { color: var(--accent); margin-bottom: 20px; }
.pv__title { font-size: clamp(2.8rem, 8vw, 8.4rem); line-height: .9; letter-spacing: -.055em; font-weight: 500; overflow-wrap: break-word; }
.pv__desc { font-size: clamp(1.05rem, 1.45vw, 1.3rem); line-height: 1.45; color: var(--fg-2); letter-spacing: -.01em; }
.pv__meta { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 12px 36px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.pv__meta dt { color: var(--fg-3); margin-bottom: 6px; }
.pv__meta dd { font-size: 15px; }
.pv__sec { padding: clamp(64px, 8vw, 120px) var(--pad) 0; }
.pv__sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding-bottom: 18px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.pv__sec-head h3 { font-size: clamp(1.3rem, 2.2vw, 2rem); letter-spacing: -.035em; font-weight: 500; }
.pv__sec-head .mono { color: var(--fg-3); text-align: right; }
.pv__docs { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 22px; }
.mason { columns: 4 240px; column-gap: 14px; }
.tile { break-inside: avoid; margin-bottom: 14px; position: relative; border-radius: 6px; overflow: hidden; background: var(--bg-3); display: block; width: 100%; text-align: left; }
.tile:focus-visible { outline-offset: -3px; }
.tile img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1s var(--ease), opacity .6s; opacity: 0; }
.tile img.is-loaded { opacity: 1; }
.tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); pointer-events: none; }
.tile__badge { position: absolute; left: 10px; bottom: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: rgba(10, 10, 11, .8); }
.tile__badge svg { width: 10px; height: 10px; }
@media (hover: hover) { .tile:hover img { transform: scale(1.04); } }
html.motion .tile { opacity: 0; transform: translateY(40px) scale(.98); }
html.motion .tile.is-in { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform 1.1s var(--ease); }
.more { display: flex; justify-content: center; padding: 28px 0 0; }

/* Grelha em linhas (ordem de leitura) para redes sociais e conjuntos */
.mason--wide { columns: 2 360px; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 14px; align-items: start; }
.sgrid--tall { grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr)); }
.sgrid > .tile { margin: 0; }
.ugroup { grid-column: 1 / -1; padding: 14px 14px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: linear-gradient(180deg, var(--bg-2), rgba(17, 17, 19, .4)); }
.ugroup__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; color: var(--fg-2); }
.ugroup__head span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.ugroup__head i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.ugroup--s .ugroup__head i, .ugroup--v .ugroup__head i, .ugroup--f .ugroup__head i { background: var(--fg); }
.ugroup__hint { color: var(--fg-3); }
.ugroup__strip { container-type: inline-size; display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--line) transparent; padding-bottom: 4px; }
.ugroup__strip .tile {
  flex: 0 0 auto; margin: 0; border-radius: 0; scroll-snap-align: start; width: auto;
  height: 300px; /* browsers sem unidades de contentor */
  height: max(200px, min(460px, calc((100cqw - (var(--n) - 1) * 2px) / (var(--n) * var(--a)))));
}
.ugroup__strip .tile:first-child { border-radius: 6px 0 0 6px; }
.ugroup__strip .tile:last-child { border-radius: 0 6px 6px 0; }
.ugroup__strip .tile img { width: 100%; height: 100%; }
.tile__num { position: absolute; right: 8px; top: 8px; z-index: 1; padding: 3px 7px; border-radius: 999px; font-size: 10px; background: rgba(10, 10, 11, .72); color: var(--fg); }
.ugroup--v .ugroup__strip { gap: 10px; }
.ugroup--v .ugroup__strip .tile { border-radius: 6px; height: 240px; height: max(160px, min(300px, calc((100cqw - (var(--n) - 1) * 10px) / (var(--n) * var(--a))))); }
/* a mesma peça em vários formatos: lado a lado, à mesma altura */
.ugroup--f .ugroup__strip { gap: 12px; }
.ugroup--f .ugroup__strip .tile { border-radius: 6px; height: 320px; height: max(200px, min(440px, calc((100cqw - (var(--n) - 1) * 12px) / (var(--n) * var(--a))))); }

/* Revista digital */
.mag__stage {
  position: relative; padding: clamp(28px, 5vw, 72px) clamp(8px, 4vw, 64px); border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line-2);
  background: radial-gradient(90% 80% at 50% 45%, #1d1d21 0%, #111113 55%, #0b0b0c 100%);
}
.mag__stage::before { content: ""; position: absolute; left: 10%; right: 10%; bottom: 6%; height: 18%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .55), transparent); filter: blur(10px); pointer-events: none; }
.mag__book { margin: 0 auto; }
.mag .stf__parent { margin: 0 auto; }
.mag__page { background: #f4f2ee; overflow: hidden; }
.mag__page img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; pointer-events: none; }
.mag__ui { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.mag__info { flex: 1; display: grid; gap: 10px; min-width: 0; }
.mag__count { color: var(--fg-2); }
.mag__bar { display: block; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.mag__bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); transition: transform .7s var(--ease); }
.mag--static .mag__book { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.mag--static .mag__page { flex: 0 0 min(86%, 720px); scroll-snap-align: center; border-radius: 4px; }
.pv__sec--mag .pv__docs { margin-bottom: 18px; }
.pv__next { display: block; margin: clamp(80px, 10vw, 160px) var(--pad) 0; padding: 40px 0 calc(56px + var(--safe-b)); border-top: 1px solid var(--line); }
.pv__next .mono { color: var(--fg-3); }
.pv__next-title { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 18px; font-size: clamp(2.2rem, 7vw, 7rem); line-height: .92; letter-spacing: -.055em; font-weight: 500; transition: color .4s; }
.pv__next-title svg { flex: 0 0 auto; width: clamp(40px, 6vw, 90px); height: auto; transition: transform .8s var(--ease); }
@media (hover: hover) {
  .pv__next:hover .pv__next-title { color: var(--accent); }
  .pv__next:hover .pv__next-title svg { transform: translateX(14px); }
}

/* ---------- Visualizador (lightbox) ---------- */
.lb { position: fixed; inset: 0; z-index: 210; display: grid; grid-template-rows: auto 1fr auto; visibility: hidden; }
.lb.is-open { visibility: visible; }
.lb__bg { position: absolute; inset: 0; background: rgba(7, 7, 8, .94); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); opacity: 0; }
.lb__top, .lb__bottom { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px var(--pad); }
.lb__bottom { padding-bottom: calc(14px + var(--safe-b)); }
.lb__count { font-variant-numeric: tabular-nums; color: var(--fg-2); flex: 0 0 auto; }
.lb__count b { color: var(--fg); font-weight: 400; }
.lb__caption { color: var(--fg-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb__stage { position: relative; z-index: 1; min-height: 0; display: grid; place-items: center; padding: 0 clamp(16px, 7vw, 110px); overflow: hidden; touch-action: pan-y; }
.lb__media { position: relative; max-width: 100%; max-height: 100%; display: grid; place-items: center; }
.lb__media img, .lb__media video { max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100svh - 150px); width: auto; height: auto; object-fit: contain; border-radius: 3px; user-select: none; -webkit-user-drag: none; transition: transform .6s var(--ease); transform-origin: var(--ox, 50%) var(--oy, 50%); }
.lb.is-zoom .lb__media img { transform: scale(2.2); }
.lb__stage.is-tall { place-items: start center; overflow-y: auto; overscroll-behavior: contain; padding-top: 8px; padding-bottom: 40px; }
.lb__stage.is-tall .lb__media img { max-height: none; width: min(980px, 100%); }
.lb__arrow { position: absolute; top: 50%; z-index: 3; transform: translateY(-50%); }
.lb__arrow:active { transform: translateY(-50%) scale(.9); }
.lb__arrow--prev { left: max(clamp(10px, 2vw, 32px), env(safe-area-inset-left, 0px)); }
.lb__arrow--next { right: max(clamp(10px, 2vw, 32px), env(safe-area-inset-right, 0px)); }
.lb__arrow.icon-btn { width: 52px; height: 52px; background: rgba(10, 10, 11, .5); }
.lb__hint { color: var(--fg-3); }
.lb__spinner { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px; border-radius: 50%; border: 1px solid var(--line); border-top-color: var(--fg); animation: spin .8s linear infinite; opacity: 0; transition: opacity .3s; z-index: 2; pointer-events: none; }
.lb.is-loading .lb__spinner { opacity: 1; }

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 1360px) {
  .clock { display: none; }
}
@media (max-width: 1180px) {
  .nav a sup { display: none; }
  .nav a { padding: 8px 11px; }
  .hdr { gap: 16px; }
  .hdr__right { gap: 12px; }
}
@media (max-width: 1080px) {
  .hdr__right .btn { display: none; }
}
/* ecrãs médios: formação em duas colunas */
@media (min-width: 981px) and (max-width: 1180px) {
  .edu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edu__item:nth-child(n) { padding-left: 28px; border-right: 1px solid var(--line-2); }
  .edu__item:nth-child(n)::before { left: 28px; }
  .edu__item:nth-child(odd) { padding-left: 0; }
  .edu__item:nth-child(odd)::before { left: 0; }
  .edu__item:nth-child(even), .edu__item:last-child { border-right: 0; }
}
@media (max-width: 980px) {
  .hdr { grid-template-columns: 1fr auto; }
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .about { grid-template-columns: 1fr; }
  .card3d { max-width: 420px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3) { padding-left: 0; }
  .stat:nth-child(n+3) { margin-top: 28px; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools, .langs { grid-template-columns: 1fr; }
  .edu { grid-template-columns: 1fr; }
  .edu__item:nth-child(n) { padding: 32px 0 40px; border-right: 0; }
  .edu__item:nth-child(n)::before { left: 0; }
  .cert { grid-template-columns: 1fr; gap: 6px; padding: 18px 0; }
  .cert__year { margin-bottom: 2px; }
  .work-intro { grid-template-columns: 1fr; }
  .rail__track { overflow-x: auto; width: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad); scrollbar-width: none; padding-bottom: 6px; }
  .rail__track::-webkit-scrollbar { display: none; }
  .fcard, .rail__end { scroll-snap-align: start; width: min(76vw, 360px); }
  .rail__progress { display: none; }
  .contact__grid { grid-template-columns: 1fr; gap: 28px; }
  .contact__layout { grid-template-columns: 1fr; gap: 64px; }
  .contact__aside { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
  .bsec__head { grid-template-columns: 1fr; }
  .bsec__desc { justify-self: start; }
  .pv__hero { grid-template-columns: 1fr; }
  .w-hero__row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --hdr: 64px; }
  .hdr__right { gap: 10px; }
  .hero__title .row--2 { padding-left: 0; }
  .hero__sub { grid-template-columns: 1fr; }
  .hero__foot .hint-3d { display: none; }
  .xp__head { grid-template-columns: 1fr 36px; gap: 8px 16px; padding: 24px 0; }
  .xp__years { grid-column: 1; }
  .xp__role { grid-column: 1; }
  .xp__co { grid-column: 1; }
  .xp__toggle { grid-column: 2; grid-row: 1 / 4; align-self: center; }
  .xp__body-inner { grid-template-columns: 1fr; }
  .xp__list { grid-column: 1; }
  .skills { grid-template-columns: 1fr; }
  .skill { min-height: 0; }
  .tgroup { grid-template-columns: 1fr; gap: 12px; }
  .lrow-head { display: none; }
  .lang { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 12px; }
  .lrow-head + .lang { border-top: 1px solid var(--line); }
  .lang__name { grid-column: 1; grid-row: 1; }
  .lang__lvl { grid-column: 2 / 4; grid-row: 1; white-space: nowrap; }
  .lang__scale::before { content: attr(data-l); grid-column: 1 / -1; margin-bottom: 4px; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
  .brow { grid-template-columns: 1fr auto; gap: 12px; }
  .brow__n { display: none; }
  .brow__meta { grid-column: 1; grid-row: 2; text-align: left; }
  .brow__arr { grid-column: 2; grid-row: 1 / 3; }
  .prow__a { grid-template-columns: 1fr 40px; gap: 6px 14px; padding: 18px 0; }
  .prow__n { display: none; }
  .prow__type { grid-column: 1; }
  .prow__count { grid-column: 1; text-align: left; }
  .prow__arr { grid-column: 2; grid-row: 1 / 4; }
  .is-grid .plist { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
  .is-grid .prow__type { display: none; }
  .views button span { display: none; }
  .pv__meta { grid-template-columns: repeat(2, auto); }
  [data-pv-index] { display: none; }
  .mason { columns: 2; column-gap: 10px; }
  .mason--wide { columns: 1; }
  .sgrid, .sgrid--tall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ugroup { padding: 10px 10px 12px; }
  .ugroup__hint { display: none; }
  .tile { margin-bottom: 10px; }
  .mag__stage { padding: 20px 8px; }
  .mag__zoom { padding: 0 12px; font-size: 0; gap: 0; }
  .mag__zoom svg { width: 16px; height: 16px; }
  .lb__arrow.icon-btn { width: 40px; height: 40px; background: rgba(10, 10, 11, .62); }
  .lb__arrow--prev { left: max(6px, env(safe-area-inset-left, 0px)); }
  .lb__arrow--next { right: max(6px, env(safe-area-inset-right, 0px)); }
  .lb__stage { padding: 0 8px; }
  .totop { width: 50px; height: 50px; bottom: calc(18px + var(--safe-b)); }
  .totop__ring { width: 50px; height: 50px; }
  .lb__hint { display: none; }
  .w-stats { gap: 24px; }
  .foot { flex-direction: column; align-items: flex-start; padding-right: 64px; }
  .cform__row { grid-template-columns: 1fr; }
  .legal__table td:first-child { white-space: normal; }
}
@media (max-width: 480px) {
  .pv__crumb-root { display: none; }
  .pv__nav { gap: 6px; }
}
@media (max-width: 420px) {
  .menu-btn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .menu-btn { min-width: 44px; justify-content: center; }
  .lsw a { min-width: 30px; padding: 0 7px; }
}
@media (max-width: 359px) {
  .logo__name small { display: none; }
}
/* Telemóvel deitado: barras fixas mais baixas e filtros que não ficam presos ao topo */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --hdr: 56px; }
  .filters { position: relative; top: 0; }
  .mmenu { padding-top: calc(var(--hdr) + 16px); }
  .mmenu ol a { font-size: clamp(1.6rem, 9vh, 2.6rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  body::after { animation: none; }
}

/* ---------- Impressão (o percurso imprime como um CV legível) ---------- */
@media print {
  :root { --bg: #fff; --bg-2: #fff; --bg-3: #f2f2f2; --fg: #111; --fg-2: #333; --fg-3: #555; --line: rgba(0, 0, 0, .18); --line-2: rgba(0, 0, 0, .1); }
  body { background: #fff; color: #111; }
  body::after, .gl, .gl-fallback, .loader, .pt, .cursor, .progress, .hdr, .mmenu, .totop, .toast, .peek, .skip, .consent,
  .rail, .hero__foot, .card3d__hint, .contact__actions, .contact__form, .wall, .filters, .pv, .lb, .xp__toggle, .work-intro__ctas { display: none !important; }
  [data-reveal], [data-hero-fade], .wi, .sec-head__line, .tile, .brow, .prow { opacity: 1 !important; transform: none !important; }
  .statement .sw { color: inherit !important; }
  html.js .xp__body { height: auto !important; }
  .hero { min-height: 0; padding: 0 0 24px; }
  .section { padding: 28px 0; }
  .contact { min-height: 0; }
  .card3d { display: none; }
  .about { grid-template-columns: 1fr; margin-top: 24px; }
  .xp__head, .xp__body-inner, .skill, .edu__item, .lang, .brow { break-inside: avoid; }
  a { color: inherit; }
}
