/* LusoAnalytica: hero + reel + link strip (index) and the contact / press pages (redesign round 2).
   Draft design, local only. Palette: warm black -> bone, one accent (cobalt). One family: Archivo.
   Motion rule: every animation shows a state change the copy talks about, runs once when its
   slide becomes active (class .is-active), then holds. Only transform / opacity / stroke-dashoffset. */

/* Archivo, self-hosted (assets/fonts/, Google's variable font v25, weights 400-800 in one file per subset).
   Root-absolute URLs so the same rule works from /estudos/. No request leaves this site. */
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/assets/fonts/archivo-latin-ext.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: "Archivo"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/assets/fonts/archivo-latin.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;
}

/* Theme tokens. Dark is the default and is exactly the original palette; light is html[data-theme="light"].
   The inline script in every <head> sets data-theme before first paint (localStorage 'luso-theme', else
   prefers-color-scheme); theme.js owns the toggle. Constants that do not change with the theme come first. */
:root {
  --bone: #f6efe2;             /* constant: logo plate, quinas */
  --ink: #17130e;              /* constant: text on the bone contact surface */
  --cobalt: #1a73e8;
  --cobalt-text: #6aa5ff;      /* same hue, lifted: small text on dark clears 4.5:1 */
  --cobalt-deep: #0f56b8;      /* same hue, darkened: small text on bone is 6:1 (cobalt itself is 3.9:1) */
  --navy: #0d2a5c;
  --err: #a31515;

  --pad-x: 7.5dvh;
  --mask: 10dvh;
  --radius: 20px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);

  --f: "Archivo", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* dark set (default, also when no data-theme is present) */
:root, html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0908;
  --bg-rgb: 10, 9, 8;
  --bg-2: #12100e;
  --fg: #f6efe2;
  --ink-2: rgba(246, 239, 226, 0.82);
  --ink-3: rgba(246, 239, 226, 0.66);
  --line: rgba(246, 239, 226, 0.16);
  --line-strong: rgba(246, 239, 226, 0.55);
  --inv: #f6efe2;              /* pressed PT|EN, skip link */
  --on-inv: #17130e;
  --accent-text: #6aa5ff;      /* small text and links on the page background */
  --accent-line: rgba(106, 165, 255, 0.55);
  --hover-bg: #1a73e8;
  --hover-fg: #fff;
  --focus: #6aa5ff;
  --focus-inv: #0f56b8;
  --vis-bg: #0f0d0b;           /* drawn visuals (main.js reads these through var()) */
  --vis-ink: #f6efe2;
  --vis-accent: #1a73e8;
  --shade-rgb: 10, 9, 8;
  --scrim-rgb: 10, 9, 8;
  --scrim-a: 0.55;
  --panel-bg: #100e0c;
  --panel-line: rgba(246, 239, 226, 0.12);
  --sh-frame: 0 30px 80px -20px rgba(0, 0, 0, 0.55), 0 8px 30px -10px rgba(0, 0, 0, 0.35);
  --sh-panel: -30px 0 80px -20px rgba(0, 0, 0, 0.6);
  --close-bg: rgba(10, 9, 8, 0.7);
  --close-line: rgba(246, 239, 226, 0.4);
  --close-hover-fg: #f6efe2;
  --pip: rgba(246, 239, 226, 0.4);
  --contact-bg: #f6efe2;
  --alert-bg: #2e1210;         /* draft alert (privacidade.html): 12:1 text on bg */
  --alert-fg: #ffdad6;
  --alert-line: #ff8a80;
}

/* light set: cool off-white (no cream: impeccable [cream-palette]), neutral ink text, same cobalt.
   Small text and thin lines use the darker cobalt (#0f56b8). */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg-rgb: 246, 248, 251;
  --bg-2: #edf1f6;
  --fg: #11151a;
  --ink-2: rgba(17, 21, 26, 0.84);
  --ink-3: rgba(17, 21, 26, 0.7);
  --line: rgba(17, 21, 26, 0.2);
  --line-strong: rgba(17, 21, 26, 0.6);
  --inv: #11151a;
  --on-inv: #f6f8fb;
  --accent-text: #0f56b8;
  --accent-line: rgba(15, 86, 184, 0.7);
  --hover-bg: #0f56b8;
  --hover-fg: #fff;
  --focus: #0f56b8;
  --focus-inv: #6aa5ff;
  --vis-bg: #edf1f6;
  --vis-ink: #11151a;
  --vis-accent: #1a73e8;
  --shade-rgb: 237, 241, 246;
  --scrim-rgb: 17, 21, 26;
  --scrim-a: 0.4;
  --panel-bg: #ffffff;
  --panel-line: rgba(17, 21, 26, 0.14);
  --sh-frame: 0 30px 80px -20px rgba(17, 21, 26, 0.3), 0 8px 30px -10px rgba(17, 21, 26, 0.18);
  --sh-panel: -30px 0 80px -20px rgba(17, 21, 26, 0.28);
  --close-bg: rgba(246, 248, 251, 0.88);
  --close-line: rgba(17, 21, 26, 0.6);
  --close-hover-fg: #fff;
  --pip: rgba(17, 21, 26, 0.55);
  --contact-bg: #fff;
  --alert-bg: #fdecea;
  --alert-fg: #6b0d0d;
  --alert-line: #a31515;
}

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

html {
  background: var(--bg);
  color: var(--fg);
  scroll-behavior: smooth;
  scrollbar-color: var(--cobalt) var(--bg);
  scrollbar-width: thin;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--f);
  font-size: 1.0625rem;
  line-height: 1.6;
  background: var(--bg);
  caret-color: var(--cobalt);
  overflow-x: hidden;
}
::selection { background: var(--cobalt); color: #fff; }
h1, h2, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.contact { color-scheme: light; }                    /* the contact surface is light in both themes: native controls follow it */
.contact :focus-visible { outline-color: var(--cobalt-deep); }

/* theme switch: a short colour fade, only while theme.js has just toggled (class removed after 250 ms) */
@media (prefers-reduced-motion: no-preference) {
  html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
    transition: background-color 200ms ease-out, color 200ms ease-out, border-color 200ms ease-out, fill 200ms ease-out, stroke 200ms ease-out !important;
  }
}

/* small labels and indices only */
.label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 100;
  padding: 0.7rem 1rem; background: var(--inv); color: var(--on-inv);
  font-weight: 600; font-size: 0.9375rem; line-height: 1;
  transition: top 160ms var(--ease-out);
}
.skip:focus { top: 1rem; }

/* ───────── Brand ───────── */
.brand {
  display: inline-flex; align-items: center;
  text-decoration: none; padding: 0.55rem 1rem;
  background: var(--bone); border-radius: 10px;
}
.brand-word { font-size: 1.75rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.brand-word .luso { color: var(--navy); }
.brand-word .analytica { color: var(--cobalt); }   /* logo colour; large bold text, 3:1 is enough */

/* ───────── Shared reveal pieces (start states only exist under motion + JS, see end of file) ───────── */
.ln { display: block; overflow: hidden; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.ln > span { display: block; }
.accent { color: var(--accent-text); }

/* ───────── [00] Hero ───────── */
.hero {
  position: relative; isolation: isolate;
  min-height: 100vh; min-height: 100dvh;
  padding: clamp(1.4rem, 4.2dvh, 3rem) clamp(1.4rem, 5vw, 4.5rem);
  display: grid; grid-template-rows: auto 1fr auto;
  overflow: hidden; scroll-snap-align: start;
}
.hero-vis { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-vis svg { display: block; width: 100%; height: 100%; }

.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.hero-tag { color: var(--ink-3); }

/* header tools: theme button + PT | EN switch, together at the right of every page header */
.tools { display: inline-flex; align-items: center; gap: 0.5rem; flex: none; }

/* theme button (theme.js fills the label and shows it; hidden without JS). Shows the theme it switches TO. */
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; padding: 0; background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; color: var(--ink-3);
}
.theme-btn[hidden] { display: none; }
.theme-btn:hover { color: var(--fg); }
.theme-btn svg { display: block; }
.theme-btn .i-moon { display: none; }
html[data-theme="light"] .theme-btn .i-sun { display: none; }
html[data-theme="light"] .theme-btn .i-moon { display: block; }

/* PT | EN switch: two plain links in every page header (the language is the URL; aria-current marks the page's own).
   44 px targets, one radius family. */
.lang { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 10px; }
.lang-btn {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  min-width: 44px; min-height: 44px; padding: 0 0.9rem; background: none; border: 0; border-radius: 0;
  color: var(--ink-3); font: inherit; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; cursor: pointer;
}
.lang-btn:first-child { border-radius: 9px 0 0 9px; }
.lang-btn:last-child { border-radius: 0 9px 9px 0; border-left: 1px solid var(--line); }
.lang-btn:hover { color: var(--fg); }
.lang-btn[aria-current] { background: var(--inv); color: var(--on-inv); cursor: default; }
.lang-btn:focus-visible { outline-offset: -3px; }
.lang-btn[aria-current]:focus-visible { outline-color: var(--focus-inv); }

.hero-body {
  align-self: center; display: grid; gap: clamp(1.6rem, 5dvh, 3.5rem);
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); align-items: end;
  padding-block: clamp(1.4rem, 4dvh, 3rem);
}
.beats {
  font-size: clamp(3.2rem, min(10.5vw, 15dvh), 8.5rem); font-weight: 800;
  line-height: 0.95; letter-spacing: -0.04em; color: var(--fg);
}
.hero-side { position: relative; display: grid; gap: 1.8rem; justify-items: start; padding-bottom: 0.6rem; }
/* the texture lines must not run through the mission paragraph or the button: a page-coloured backing behind
   the right column, feathered on all four edges so it reads as a gap in the lines, not as a card */
.hero-side::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: -2.6rem -3.4rem; background: var(--bg);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 2.4rem, #000 calc(100% - 2.4rem), transparent), linear-gradient(180deg, transparent, #000 1.8rem, #000 calc(100% - 1.8rem), transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 2.4rem, #000 calc(100% - 2.4rem), transparent), linear-gradient(180deg, transparent, #000 1.8rem, #000 calc(100% - 1.8rem), transparent);
  mask-composite: intersect;
}
.mission { max-width: 40ch; font-size: 1.25rem; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }

.cta {
  display: inline-flex; align-items: center; gap: 0.9rem; text-decoration: none;
  padding: 0.85rem 1.5rem; border: 1px solid var(--line-strong); border-radius: 10px;
  min-height: 48px; font-size: 1.0625rem; font-weight: 600; color: var(--fg);
  transition: background-color 220ms var(--ease-out), border-color 220ms var(--ease-out), color 220ms var(--ease-out);
}
.cta:hover { background: var(--hover-bg); border-color: var(--hover-bg); color: var(--hover-fg); }
.hero-foot { color: var(--ink-3); }

/* ───────── Reel ───────── */
.reel {
  position: relative; isolation: isolate; overflow: hidden;
  height: 100vh; height: 100dvh; background: var(--bg);
  scroll-snap-align: start;
  user-select: none; -webkit-user-select: none;
}

.track {
  position: absolute; inset: 0 0 auto 0; padding-inline: var(--pad-x);
  touch-action: none; will-change: transform;
}
.slide { position: relative; width: 100%; height: 80dvh; margin-bottom: 5dvh; perspective: 2000px; }
.frame {
  position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: var(--radius);
  background: var(--bg-2); transform-origin: 0% 50%; transform-style: preserve-3d;
  transition: transform 700ms var(--ease-out), box-shadow 700ms var(--ease-out);
}
.frame.is-open { transform: rotateY(15deg); box-shadow: var(--sh-frame); }

.slide-image {
  position: absolute; top: 50%; left: 50%; width: 100vw; height: 120dvh;
  margin: -60dvh 0 0 -50vw; will-change: transform;
}
.vis { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vis text { font-family: var(--f); font-weight: 600; font-size: 30px; fill: var(--vis-ink); }
.shade {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(var(--shade-rgb), 0.86) 0%, rgba(var(--shade-rgb), 0.55) 38%, rgba(var(--shade-rgb), 0) 68%);
}

.slide-content { position: absolute; inset: 0; z-index: 2; will-change: opacity, transform; }
.js .slide-content { opacity: 0; }
.s-top { position: absolute; left: 6dvh; top: 5.5dvh; display: flex; gap: 1.2rem; flex-wrap: wrap; color: var(--fg); }
.s-top .dim { color: var(--ink-3); }
.s-mid { position: absolute; left: 6dvh; right: 6dvh; bottom: 14dvh; display: grid; gap: 1.4rem; max-width: 46rem; }
.s-title {
  font-size: clamp(2.6rem, 9dvh, 6rem); font-weight: 700; line-height: 1;
  letter-spacing: -0.035em; color: var(--fg); text-wrap: balance;
}
.lede { max-width: 34ch; font-size: clamp(1.0625rem, 2.3dvh, 1.375rem); line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.s-cta { position: absolute; right: 6dvh; bottom: 5dvh; }

.explore {
  display: inline-flex; align-items: center; gap: 1rem; min-height: 48px;
  padding: 0.85rem 1.6rem; background: transparent; border: 1px solid var(--line-strong);
  border-radius: 10px; color: var(--fg); cursor: pointer; font-size: 1.0625rem; font-weight: 600;
  transition: background-color 220ms ease-out, border-color 220ms ease-out, color 220ms ease-out;
}
.explore:hover { background: var(--hover-bg); border-color: var(--hover-bg); color: var(--hover-fg); }

.mask { position: absolute; left: 0; right: 0; height: var(--mask); z-index: 30; pointer-events: none; }
.mask-top { top: 0; background: linear-gradient(180deg, var(--bg) 0%, rgba(var(--bg-rgb), 0) 100%); }
.mask-bottom { bottom: 0; background: linear-gradient(0deg, var(--bg) 0%, rgba(var(--bg-rgb), 0) 100%); }

/* indicator */
.indicator {
  position: absolute; right: 3.5dvh; top: 50%; z-index: 40; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; pointer-events: none;
  transition: opacity 400ms ease-out;
}
.reel.panel-open .indicator { opacity: 0; }
.ind-num { font-size: 0.8125rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.pips { display: flex; flex-direction: column; align-items: center; pointer-events: auto; }
.pip {
  display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  padding: 0; background: none; border: 0; cursor: pointer;
}
.pip i {
  display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--pip);
  transition: width 320ms cubic-bezier(0.16, 1, 0.3, 1), height 320ms cubic-bezier(0.16, 1, 0.3, 1), background-color 320ms cubic-bezier(0.16, 1, 0.3, 1);
}
.pip[aria-current="true"] i { width: 8px; height: 8px; background: var(--fg); }
.pip:hover i { background: var(--accent-text); }

.reel-links { position: absolute; left: var(--pad-x); bottom: 3.2dvh; z-index: 40; display: flex; gap: 1.6rem; }
.reel-links a, .links-strip a, .back {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; text-decoration: none; color: var(--ink-3);
  transition: color 200ms ease-out;
}
.reel-links a:hover, .links-strip a:hover, .back:hover { color: var(--fg); }
.up { transform: rotate(180deg); }
.go { transform: rotate(-90deg); }
.back .up { transform: rotate(90deg); }

/* link strip: after the reel, before the mission/vision banner; same look as the reel exit links */
.links-strip {
  display: flex; flex-wrap: wrap; gap: 0.4rem 2.4rem; background: var(--bg);
  padding: clamp(1rem, 3dvh, 1.6rem) clamp(1.4rem, 6vw, 6rem);
  border-top: 1px solid var(--line);
}

/* detail panel */
.backdrop {
  position: absolute; z-index: 40; top: 10dvh; height: 80dvh; left: var(--pad-x); right: var(--pad-x);
  border-radius: var(--radius); overflow: hidden; pointer-events: none;
  background: rgba(var(--scrim-rgb), 0);
  transition: background-color 600ms var(--ease-out);
}
.reel.panel-open .backdrop { pointer-events: auto; background: rgba(var(--scrim-rgb), var(--scrim-a)); }
.panel {
  position: absolute; z-index: 50; top: 10dvh; height: 80dvh; right: var(--pad-x);
  width: min(640px, 52%); border-radius: var(--radius); overflow: hidden;
  background: var(--panel-bg); border: 1px solid var(--panel-line);
  transform: translate3d(calc(100% + var(--pad-x) + 2dvh), 0, 0); visibility: hidden;
  transition: transform 700ms var(--ease-out), visibility 0s linear 700ms, box-shadow 700ms var(--ease-out);
  will-change: transform; user-select: text; -webkit-user-select: text; cursor: auto;
}
.reel.panel-open .panel {
  transform: none; visibility: visible; transition-delay: 0s; box-shadow: var(--sh-panel);
}
.panel-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: thin; scrollbar-color: var(--cobalt) transparent; }
.panel-vis { position: relative; height: 35dvh; overflow: hidden; background: var(--vis-bg); }
.panel-vis .vis { z-index: 0; }
.panel-body { padding: 1.6rem clamp(1.4rem, 3.5dvh, 2.4rem) 4dvh; display: grid; gap: 1.4rem; }
.panel-idx { color: var(--ink-3); }
#panel-text { display: grid; gap: 1.1rem; }
#panel-text h2 { font-size: clamp(2.2rem, 5.2dvh, 3.4rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; color: var(--fg); text-wrap: balance; }
#panel-text p { font-size: 1.1875rem; line-height: 1.55; color: var(--ink-2); max-width: 42ch; text-wrap: pretty; }
.readout { list-style: none; margin: 0.4rem 0 0; padding: 1.1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.6rem; border-top: 1px solid var(--line); }
.readout li { padding: 0.5rem 0.8rem; border: 1px solid var(--accent-line); border-radius: 6px; color: var(--accent-text); }
.panel-hint { color: var(--ink-3); }
.panel-close {
  position: absolute; right: 3dvh; top: 3dvh; z-index: 5; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center; border-radius: 10px;
  background: var(--close-bg); border: 1px solid var(--close-line); color: var(--fg); cursor: pointer;
  transition: background-color 200ms ease-out, border-color 200ms ease-out;
}
.panel-close:hover { background: var(--hover-bg); border-color: var(--hover-bg); color: var(--close-hover-fg); }

/* ───────── Sub-pages (contacto.html, imprensa.html): dark header with the brand, content fills the rest ───────── */
.page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.page > main { flex: 1; }
.page-top { padding: clamp(1.4rem, 4.2dvh, 3rem) clamp(1.4rem, 5vw, 4.5rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* ───────── Contact page (bone) ───────── */
.contact {
  position: relative; background: var(--contact-bg); color: var(--ink);
  padding: clamp(3rem, 10dvh, 6rem) clamp(1.4rem, 6vw, 6rem);
}
.contact-inner { display: grid; gap: clamp(1.6rem, 5dvh, 3rem); max-width: 78rem; }
.contact-claim { font-size: clamp(2.4rem, 6.2vw, 5rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.04em; max-width: 18ch; text-wrap: balance; }
.contact .back { justify-self: start; color: rgba(23, 19, 14, 0.78); }
.contact .back:hover { color: var(--ink); }
.noscript { padding: 1rem; color: var(--ink-3); }

/* contact form: sits on bone, 16 px+ text (no iOS zoom), 44 px targets, one radius family (10 px) */
.cform { display: grid; gap: 1.2rem; width: 100%; max-width: 38rem; margin-top: 1rem; }
.cform-title { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.cform-draft { margin-left: 0.6rem; color: var(--navy); vertical-align: middle; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: 1.0625rem; font-weight: 600; }
.field .opt { font-weight: 500; color: rgba(23, 19, 14, 0.78); }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 0.7rem 0.9rem; font: inherit; font-size: 1.0625rem; line-height: 1.4;
  color: var(--ink); background: #fff; border: 1.5px solid rgba(23, 19, 14, 0.62); border-radius: 10px;
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--err); border-width: 2px; }
.err { margin: 0; font-size: 1rem; font-weight: 600; color: var(--err); }
.err[hidden] { display: none; }
.submit {
  justify-self: start; min-height: 48px; padding: 0.8rem 1.8rem; font-size: 1.0625rem; font-weight: 700; cursor: pointer;
  color: var(--bone); background: var(--navy); border: 2px solid var(--navy); border-radius: 10px;
  transition: background-color 200ms ease-out, border-color 200ms ease-out;
}
.submit:hover { background: var(--cobalt-deep); border-color: var(--cobalt-deep); }
.notice { margin: 0; padding: 0.9rem 1rem; font-size: 1.0625rem; font-weight: 600; color: var(--navy); background: #efe5d0; border: 1.5px solid var(--navy); border-radius: 10px; }
.notice:empty { display: none; }
.notice-err { color: var(--err); border-color: var(--err); background: #fff; }
/* honeypot: off-screen, not display:none (some bots skip hidden fields); people and screen readers never reach it */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.submit:disabled { cursor: progress; opacity: 0.7; }
/* noscript sentence above the first field */
.form-note { margin: 0; max-width: 38rem; font-size: 1.0625rem; line-height: 1.5; color: var(--ink); }

/* press page: dark */
.press { background: var(--bg-2); color: var(--fg); padding: clamp(3rem, 10dvh, 6rem) clamp(1.4rem, 6vw, 6rem); }
.press-inner { max-width: 78rem; display: grid; gap: 1.4rem; }
.press .back { justify-self: start; }
.press-title { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.035em; text-wrap: balance; }
/* paper cards: one centred column (max 47.5rem), picture on top, text centred beneath, same order on every card */
.press-list { list-style: none; margin: 1rem auto 0; padding: 0; width: 100%; max-width: 47.5rem; display: grid; gap: clamp(3rem, 8vw, 6rem); }
.pp-row { display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 4vw, 2.5rem); justify-items: center; text-align: center; }
.pp-pic { width: 100%; border-radius: 32px; overflow: hidden; background: var(--vis-bg); border: 1px solid var(--line); aspect-ratio: 4 / 3; }
.pp-pic > svg, .pp-pic > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pp-body { display: grid; justify-items: center; gap: 1.1rem; }
.pp-title { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.75rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.035em; text-wrap: balance; }
.pp-tag { margin: 0; padding: 0.25rem 0.85rem; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 0.95rem; font-weight: 600; color: var(--fg); }
.pp-meta { margin: 0; color: var(--ink-2); }
.pp-sum { margin: 0; color: var(--ink-2); max-width: 36ch; font-size: 1.125rem; line-height: 1.5; text-wrap: pretty; }
.pp-btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 1.5rem; margin-top: 0.4rem;
  border-radius: 999px; background: var(--inv); color: var(--on-inv); font-weight: 700; text-decoration: none;
  transition: background-color 200ms ease-out, color 200ms ease-out;
}
a.pp-btn:hover { background: var(--hover-bg); color: var(--hover-fg); }
a.pp-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.pp-more { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); text-underline-offset: 0.25em; }
.pp-more:hover { color: var(--fg); }
.pp-more:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
/* no address yet: a plain, non-link pill that looks switched off (muted, not clickable) */
.pp-btn.is-off { background: transparent; color: var(--ink-3); border: 1px dashed var(--line-strong); cursor: not-allowed; }

/* Studies section on the home page (#estudos): five cards, each one link to the paper's landing page */
.st { background: var(--bg-2); color: var(--fg); padding: clamp(3rem, 10dvh, 6rem) clamp(1.4rem, 6vw, 6rem); border-top: 1px solid var(--line); }
.st-inner { max-width: 78rem; margin-inline: auto; display: grid; gap: 1.6rem; }
.st-h { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.035em; text-wrap: balance; }
.st-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: clamp(1rem, 2.5vw, 1.6rem); }
/* five cards: one column on a phone, 2 + 2 + 1 (last card full width) on a tablet, 3 + 2 (wider cards on the second row) on a desktop */
@media (min-width: 40rem) {
  .st-grid { grid-template-columns: repeat(2, 1fr); }
  .st-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 64rem) {
  .st-grid { grid-template-columns: repeat(6, 1fr); }
  .st-card { grid-column: span 2; }
  .st-card:nth-child(n+4) { grid-column: span 3; }
}
.st-card { position: relative; display: grid; align-content: start; gap: 0.8rem; height: 100%; padding: 1.4rem; background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.st-title { margin: 0; font-size: 1.35rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.st-title a { color: inherit; text-decoration: none; }
.st-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }   /* the whole card is the link */
.st-title a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.st-title a:focus-visible { outline: none; }
.st-title a:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 3px; }
.st-sum { max-width: 58ch; margin: 0; color: var(--ink-2); line-height: 1.5; text-wrap: pretty; }
.st-all { justify-self: start; }

/* paper landing pages (estudos/*.html): reading column on .doc, a few extras */
.ps-crumb { margin: 0; color: var(--ink-3); }
.ps-crumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; }
.ps-crumb li + li::before { content: "/"; margin-right: 0.6rem; color: var(--ink-3); }
.ps-crumb a { color: var(--ink-2); text-underline-offset: 0.25em; }
.ps-crumb a:hover { color: var(--fg); }
.ps-crumb [aria-current="page"] { color: var(--fg); }
.ps-sub { margin: 0; font-size: 1.25rem; line-height: 1.4; color: var(--ink-2); max-width: 40ch; text-wrap: balance; }
.ps-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; color: var(--ink-3); font-size: 1rem; }
.doc .ps-kf { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.9rem; }
.ps-dl { justify-self: start; margin-top: 0.6rem; }

/* text pages (sobre.html, privacidade.html): plain reading column on the page background */
.doc { background: var(--bg); color: var(--fg); padding: clamp(2.4rem, 8dvh, 5rem) clamp(1.4rem, 6vw, 6rem) clamp(3rem, 10dvh, 6rem); }
.doc-inner { max-width: 46rem; display: grid; gap: 1.2rem; }
.doc-title { font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance; }
.doc-lede { font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); max-width: 40ch; text-wrap: pretty; }
.doc-note { color: var(--ink-3); font-size: 1rem; }
.doc-status { margin: 0; padding: 0.7rem 1rem; max-width: 46rem; font-weight: 600; color: var(--fg); background: var(--bg-2); border: 1.5px solid var(--line-strong); border-radius: 10px; }
.doc h2 { margin-top: clamp(1.4rem, 4dvh, 2.4rem); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance; }
.doc p, .doc li, .doc dd { color: var(--ink-2); max-width: 60ch; text-wrap: pretty; }
.doc ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.5rem; }
.doc li::marker { color: var(--accent-text); }
.doc strong { color: var(--fg); font-weight: 700; }
.doc dl { margin: 0; display: grid; gap: 0.2rem; }
.doc dt { margin-top: 0.8rem; font-weight: 700; color: var(--fg); }
.doc dd { margin: 0; }
.doc .back { justify-self: start; margin-top: 1rem; }
.verify { text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 0.22em; }
.draft-alert {
  margin: 0; padding: 0.9rem clamp(1.4rem, 5vw, 4.5rem); text-align: center; font-size: 1.125rem; font-weight: 800;
  color: var(--alert-fg); background: var(--alert-bg); border-bottom: 2px solid var(--alert-line);
}

/* footer on every page: Início, Contacto, Imprensa, Sobre nós, Privacidade, Mowei; centred, wraps on phones */
.site-foot {
  background: var(--bg); color: var(--ink-3);
  padding: clamp(0.6rem, 2dvh, 1rem) clamp(1.4rem, 6vw, 6rem); border-top: 1px solid var(--line);
}
.site-foot nav { display: flex; flex-wrap: wrap; justify-content: center; text-align: center; gap: 0.2rem 2rem; }
.site-foot a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--ink-3); transition: color 200ms ease-out; }
.site-foot a:hover { color: var(--fg); }
.site-foot a[aria-current="page"] { color: var(--fg); text-decoration: underline; text-underline-offset: 0.4em; text-decoration-thickness: 2px; }
/* external Mowei link: may wrap onto two lines inside a 345 px footer rather than overflow */
.site-foot a.foot-ext { max-width: 100%; line-height: 1.35; padding-block: 0.35rem; }

/* PT | EN switch needs JS (html.js: main.js on index, an inline head script elsewhere); the theme button is `hidden` until theme.js shows it */
html:not(.js) .theme-btn { display: none; }

/* Mowei profile: one centred column, info on top, lighthouse photo (max 45rem) below.
   Scoped to .mw: the Mowei brand tokens of mowei.pt (css/tokens.css); the rest of the site keeps its own palette.
   Contrast (WCAG, computed by hand): dark text 19.2, secondary 7.5 (6.7 on surface), button black on mint 17.9 (hover 15.6), teal 10.5;
   light text 18.3, secondary 11.4, button white on #111 18.9 (hover #333 12.6), teal 5.8. */
.mw {
  --mw-bg: #0f0f0f; --mw-surface: #1c1c1e; --mw-line: #2a2a2c; --mw-fg: #ffffff; --mw-2: #a2a2a7;
  --mw-accent: #d0f4f0; --mw-accent-hover: #a8ebd0; --mw-on-accent: #000000; --mw-teal: #76cfba;
  background: var(--mw-bg); color: var(--mw-fg); padding: clamp(3rem, 10dvh, 6rem) clamp(1.4rem, 6vw, 6rem);
}
html[data-theme="light"] .mw {
  --mw-bg: #fcfbf8; --mw-surface: #ffffff; --mw-line: rgba(17, 17, 17, 0.08); --mw-fg: #111111; --mw-2: #3d3732;
  --mw-accent: #111111; --mw-accent-hover: #333333; --mw-on-accent: #ffffff; --mw-teal: #1f6f5f;
}
.mw-inner { max-width: 68.75rem; margin-inline: auto; display: grid; grid-template-columns: 1fr; gap: clamp(2rem, 5vw, 3rem); justify-items: center; text-align: center; }
.mw-info { display: grid; justify-items: center; gap: 1.1rem; }
.mw-avatar { width: 5.5rem; height: 5.5rem; border-radius: 22%; object-fit: cover; background: #fff; }
.mw-name { margin: 0; font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.mw-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.6rem 1rem; color: var(--mw-2); }
.mw-loc { display: inline-flex; align-items: center; gap: 0.4rem; }
.mw-loc svg { color: var(--mw-teal); }
.mw-tag { padding: 0.25rem 0.85rem; border: 1px solid var(--mw-2); border-radius: 999px; font-size: 0.95rem; font-weight: 600; color: var(--mw-2); }
.mw-title { margin: 0.4rem 0 0; font-size: clamp(1.8rem, 3.4vw, 2.75rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.035em; text-wrap: balance; }
.mw-desc { margin: 0; color: var(--mw-2); max-width: 36ch; font-size: 1.125rem; line-height: 1.5; text-wrap: pretty; }
.mw-btn {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 48px; padding: 0 1.5rem; margin-top: 0.4rem;
  border-radius: 999px; background: var(--mw-accent); color: var(--mw-on-accent); font-weight: 700; text-decoration: none;
  transition: background-color 200ms ease-out, color 200ms ease-out;
}
.mw-btn:hover { background: var(--mw-accent-hover); color: var(--mw-on-accent); }
.mw-btn:focus-visible, .mw-ext:focus-visible { outline: 2px solid var(--mw-fg); outline-offset: 3px; }
.mw-vis { position: relative; width: 100%; max-width: 45rem; border-radius: 32px; overflow: hidden; background: var(--mw-surface); border: 1px solid var(--mw-line); aspect-ratio: 16 / 10; }
.mw-vis > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.mw-ext {
  position: absolute; right: 1rem; bottom: 1rem; width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 14px; background: var(--mw-accent); color: var(--mw-on-accent); text-decoration: none;
  transition: background-color 200ms ease-out, color 200ms ease-out;
}
.mw-ext:hover { background: var(--mw-accent-hover); color: var(--mw-on-accent); }

/* mission and vision: last element of the page */
.mv { background: var(--bg); color: var(--fg); padding: clamp(3.5rem, 12dvh, 7rem) clamp(1.4rem, 6vw, 6rem); }
.mv-inner { max-width: 78rem; display: grid; gap: 2rem; }
.mv-grid { display: grid; gap: clamp(2.5rem, 6vw, 5rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.mv-col { display: grid; align-content: start; gap: 1.2rem; }
.mv-w { color: var(--ink-3); }
.mv-h { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.75rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.035em; text-wrap: balance; }
.mv-dl { margin: 0; display: grid; gap: 0.3rem 1.2rem; grid-template-columns: max-content 1fr; }
.mv-dl dt { font-weight: 700; color: var(--accent-text); }
.mv-dl dd { margin: 0 0 0.8rem; color: var(--ink-2); max-width: 52ch; }
.mv-p { color: var(--ink-2); max-width: 52ch; }
.mv-line { font-size: 1.25rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; max-width: 30ch; }
@media (max-width: 520px) { .mv-dl { grid-template-columns: 1fr; } .mv-dl dd { margin-bottom: 0.6rem; } }

/* ───────── No-JS: stacked, readable ───────── */
html:not(.js) .reel { height: auto; overflow: visible; }
html:not(.js) .track { position: static; touch-action: auto; }
html:not(.js) .slide { height: auto; margin-bottom: 4dvh; }
html:not(.js) .frame { height: auto; }
html:not(.js) .slide-image { top: 0; left: 0; width: 100%; height: 100%; margin: 0; }
html:not(.js) .slide-content { position: relative; inset: auto; display: grid; gap: 1.4rem; padding: 6dvh; }
html:not(.js) .s-top, html:not(.js) .s-mid, html:not(.js) .s-cta { position: static; }
.slide-full { display: none; }
html:not(.js) .slide-full { display: block; position: relative; z-index: 4; padding: 1rem 6dvh 2rem; }
html:not(.js) .indicator, html:not(.js) .panel, html:not(.js) .backdrop, html:not(.js) .mask, html:not(.js) .reel-links, html:not(.js) .explore { display: none; }

/* ───────── Mobile (<= 768px): swipe reel, full-width sheet ───────── */
@media (max-width: 768px) {
  :root { --pad-x: 2dvh; --radius: 16px; }
  .hero-body { grid-template-columns: 1fr; align-items: start; }
  .hero-side::before { inset: -2rem -1.4rem; }
  .brand-word { font-size: 1.45rem; }
  /* header: brand + theme button + PT | EN must fit one row at 390 px (2 x 1.4rem padding leaves ~345 px: tools 140, brand ~195);
     if a narrower screen cannot, the tools wrap under the brand instead of overflowing */
  .page-top { flex-wrap: wrap; row-gap: 0.6rem; }
  .tools { margin-left: auto; }
  /* hero header: brand and the PT | EN switch share the first row, the tagline wraps below */
  .hero-tag { order: 3; flex-basis: 100%; }
  .lang-btn { padding: 0 0.6rem; }
  .s-top { left: 3dvh; top: 3.6dvh; gap: 0.6rem; }
  .s-top .dim { display: none; }
  .s-mid { left: 3dvh; right: 3dvh; bottom: 13dvh; gap: 1rem; }
  .s-title { font-size: clamp(2.1rem, 7dvh, 3.2rem); }
  .s-cta { right: 3dvh; bottom: 3dvh; }
  .explore { padding: 0.8rem 1.3rem; }
  .shade { background: linear-gradient(0deg, rgba(var(--shade-rgb), 0.9) 0%, rgba(var(--shade-rgb), 0.6) 46%, rgba(var(--shade-rgb), 0.1) 100%); }
  /* pips move to a row in the top-right of the slide, level with the "[ 01 / 06 ]" label, so they never crowd the titles */
  .indicator {
    right: calc(var(--pad-x) + 3dvh - 10px); top: calc(13.6dvh - 6px); transform: none;
    flex-direction: row; align-items: center; gap: 0;
  }
  .ind-num { display: none; }
  .pips { flex-direction: row; }
  .reel-links { left: calc(var(--pad-x) + 1rem); bottom: 1.2dvh; gap: 1rem; }
  /* the panel becomes a full-width sheet rising from the bottom */
  .panel {
    left: 0; right: 0; width: 100%; top: 6dvh; height: 94dvh; border-radius: 20px 20px 0 0;
    transform: translate3d(0, 105%, 0);
  }
  .panel-vis { height: 24dvh; }
}

/* narrow screens: soften the hero texture lines so they do not cross the mission paragraph */
@media (max-width: 600px) {
  .hero-vis { opacity: 0.28; }
}

/* phones: a slightly smaller logo plate so brand + theme button + PT | EN share one row at 390 px */
@media (max-width: 480px) {
  .tools { gap: 0.4rem; }
  .brand { padding: 0.4rem 0.7rem; }
  .brand-word { font-size: 1.2rem; }
}

/* ───────── Motion: start states + one-shot animations (only with JS and no reduced-motion) ─────────
   Without the media query the final state shows, so reduced motion and no-JS are static by default.
   Start states live on the base selectors; .is-active (any ancestor) plays the change once and holds. */
@media (prefers-reduced-motion: no-preference) {
  .js .ln > span { transform: translate3d(0, 110%, 0); }
  .js .fx { opacity: 0; }
  .js .draw { stroke-dashoffset: 1; }
  .js .pop { opacity: 0; }
  .js .settle { transform: translate3d(var(--dx, 0px), var(--dy, 0px), 0) rotate(var(--r, 0deg)); }
  .js .clear { opacity: 1; transform: none; }

  .draw, .pop, .clear { transform-box: fill-box; transform-origin: center; }
  .settle { transform-box: view-box; transform-origin: 50% 50%; }

  .is-active .ln > span { animation: rise 900ms var(--ease-quart) both; animation-delay: calc(var(--l, 0) * 120ms + 100ms); }
  .is-active .fx { animation: fade-up 800ms var(--ease-quart) both; animation-delay: var(--fx, 0ms); }
  .is-active .draw { animation: draw var(--t, 1200ms) var(--tf, var(--ease-out)) both; animation-delay: var(--dl, 0ms); }
  .is-active .pop { animation: pop var(--t, 500ms) var(--ease-out) both; animation-delay: var(--dl, 0ms); }
  .is-active .settle { animation: settle var(--t, 1600ms) var(--ease-out) both; animation-delay: var(--dl, 0ms); }
  .is-active .clear { animation: clear var(--t, 700ms) var(--ease-out) both; animation-delay: var(--dl, 0ms); }
}
/* final states (reduced motion / no JS): paths fully drawn, "clear" pieces cleared */
.draw { stroke-dasharray: 1; stroke-dashoffset: 0; stroke-linecap: butt; }
.clear { opacity: 0; }

@keyframes rise { from { transform: translate3d(0, 110%, 0); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: none; } }
@keyframes settle { to { transform: none; } }
@keyframes clear { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.4); } }

/* ───────── Reduced motion: final states, no transitions, no parallax (parallax is skipped in main.js) ───────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .frame.is-open { transform: none; }
}

/* ───────── Forced colours (Windows High Contrast): pips use system colours; only drawn art opts out ───────── */
@media (forced-colors: active) {
  .pip i { background: ButtonText; border: 1px solid ButtonText; forced-color-adjust: none; }
  .pip[aria-current="true"] i { background: Highlight; border-color: Highlight; }
  .pip:hover i { background: Highlight; border-color: Highlight; }
  .hero-vis, .panel-vis, .panel-vis svg { forced-color-adjust: none; }
}
