/* Rafael R. Leão — portfolio
   Identity: "Pausa no feed" · black / paper / signal red · Archivo Expanded + Inter */

:root {
  --red: #E3262F;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --radius: 14px;
  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 56px);
  --font-display: 'Archivo', 'Arial Black', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E0E0E;
  --bg-2: #141414;
  --surface: #1A1A1A;
  --text: #F5F3EF;
  --text-2: #A8A6A2;
  --text-3: #6F6D6A;
  --line: rgba(245, 243, 239, 0.09);
  --line-2: rgba(245, 243, 239, 0.18);
  --accent: #E3262F;
  --accent-text: #FF4A52;
  --nav-bg: rgba(14, 14, 14, 0.72);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F5F3EF;
  --bg-2: #ECE9E3;
  --surface: #FFFFFF;
  --text: #0E0E0E;
  --text-2: #4A4845;
  --text-3: #85827D;
  --line: rgba(14, 14, 14, 0.09);
  --line-2: rgba(14, 14, 14, 0.2);
  --accent: #E3262F;
  --accent-text: #C41E27;
  --nav-bg: rgba(245, 243, 239, 0.76);
}

/* ---------- i18n ---------- */
:root[data-lang="en"] [data-l="pt"],
:root[data-lang="pt"] [data-l="en"] { display: none !important; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
:root.theme-anim body,
:root.theme-anim .nav,
:root.theme-anim .card,
:root.theme-anim .surface { transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
.display, h1, h2, h3 { font-family: var(--font-display); font-stretch: 115%; font-weight: 900; margin: 0; }
h1, .display { font-size: clamp(2.6rem, 7.2vw, 6.2rem); line-height: 0.98; letter-spacing: -0.025em; }
h2 { font-size: clamp(2rem, 4.4vw, 3.6rem); line-height: 1.02; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.15; letter-spacing: -0.01em; }
.eyebrow {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-2); display: inline-flex; align-items: center; gap: 12px; margin-bottom: 22px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--text-2); max-width: 46ch; }
.accent { color: var(--accent); }

/* Signature: crop-mark frame */
.framed { position: relative; display: inline-block; padding: 0 0.12em; }
.framed::before, .framed::after {
  content: ""; position: absolute; width: 0.28em; height: 0.28em; border: 0.055em solid var(--accent);
}
.framed::before { top: 0.02em; left: -0.06em; border-right: 0; border-bottom: 0; }
.framed::after { bottom: 0.06em; right: -0.06em; border-left: 0; border-top: 0; }

.corners { position: relative; }
.corners > .c { position: absolute; width: 26px; height: 26px; border: 0 solid var(--accent); pointer-events: none; z-index: 2; }
.corners > .c.tl { top: -10px; left: -10px; border-top-width: 3px; border-left-width: 3px; }
.corners > .c.tr { top: -10px; right: -10px; border-top-width: 3px; border-right-width: 3px; }
.corners > .c.bl { bottom: -10px; left: -10px; border-bottom-width: 3px; border-left-width: 3px; }
.corners > .c.br { bottom: -10px; right: -10px; border-bottom-width: 3px; border-right-width: 3px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 20px; }
.logo { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-display); font-stretch: 115%; font-weight: 900; font-size: 1rem; letter-spacing: 0.01em; }
.logo-mark { position: relative; width: 36px; height: 36px; display: grid; place-items: center; font-size: 0.82rem; }
.logo-mark::before, .logo-mark::after { content: ""; position: absolute; width: 11px; height: 11px; border: 2px solid var(--accent); }
.logo-mark::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.logo-mark::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.nav-links { display: flex; gap: 30px; font-size: 0.92rem; color: var(--text-2); }
.nav-links a { transition: color 160ms ease; }
.nav-tools { display: flex; align-items: center; gap: 8px; }

.seg {
  display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em;
}
.seg button {
  appearance: none; border: 0; background: transparent; color: var(--text-2); font: inherit;
  padding: 6px 11px; border-radius: 999px; cursor: pointer; min-height: 30px;
  transition: background-color 180ms ease, color 180ms ease, transform 140ms var(--ease-out);
}
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.icon-btn {
  appearance: none; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer;
  transition: transform 140ms var(--ease-out), border-color 160ms ease;
}
.icon-btn svg { width: 17px; height: 17px; }
:root[data-theme="dark"] .icon-sun, :root[data-theme="light"] .icon-moon { display: none; }
.seg button:active, .icon-btn:active, .btn:active { transform: scale(0.97); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 26px; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem; border: 1px solid var(--line-2); cursor: pointer; background: transparent; color: var(--text);
  transition: transform 140ms var(--ease-out), background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn svg { width: 16px; height: 16px; }
.arrow { transition: transform 200ms var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--text); }
  .btn:hover { border-color: var(--text); }
  .btn-primary:hover { background: #F0343D; border-color: #F0343D; }
  .btn:hover .arrow, .card:hover .arrow, .next:hover .arrow { transform: translateX(4px); }
  .icon-btn:hover { border-color: var(--text); }
  .seg button:hover:not([aria-pressed="true"]) { color: var(--text); }
}

/* ---------- hero ---------- */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(48px, 7vw, 88px); }
.hero h1 { max-width: 13ch; }
.hero .lead { margin-top: 30px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 38px; }
.reel {
  margin-top: clamp(48px, 7vw, 84px); border-radius: var(--radius); overflow: hidden; position: relative;
  aspect-ratio: 16 / 9; background: #000; cursor: pointer; border: 0; padding: 0; width: 100%; display: block;
}
.reel video, .reel img { width: 100%; height: 100%; object-fit: cover; }
.reel-play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  display: inline-flex; align-items: center; gap: 12px; padding: 14px 24px 14px 18px; border-radius: 999px;
  background: rgba(14,14,14,0.62); color: #F5F3EF; font-weight: 600; font-size: 0.95rem;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,0.16);
  transition: transform 200ms var(--ease-out);
}
.reel-play .dot { width: 34px; height: 34px; border-radius: 999px; background: var(--red); display: grid; place-items: center; }
.reel-play svg { width: 13px; height: 13px; margin-left: 2px; }
.reel:active .reel-play { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .reel:hover .reel-play { transform: scale(1.04); } }

/* ---------- stats ---------- */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 40px 28px 38px 0; }
.stat + .stat { padding-left: 28px; border-left: 1px solid var(--line); }
.stat .n { font-family: var(--font-display); font-stretch: 115%; font-weight: 900; font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1; letter-spacing: -0.02em; }
.stat .n em { font-style: normal; color: var(--accent); }
.stat .l { margin-top: 10px; font-size: 0.88rem; color: var(--text-2); line-height: 1.4; max-width: 22ch; }
.stats-note { font-size: 0.74rem; color: var(--text-3); padding: 14px 0 0; }

/* ---------- sections ---------- */
section { scroll-margin-top: 80px; }
.section { padding: clamp(80px, 11vw, 140px) 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: clamp(36px, 5vw, 60px); flex-wrap: wrap; }
.section-head p { max-width: 40ch; color: var(--text-2); margin: 0; }

/* ---------- work cards ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(20px, 3vw, 36px); }
.card { display: block; border-radius: var(--radius); }
.card-media { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface); }
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.card-body { display: flex; justify-content: space-between; align-items: start; gap: 20px; padding: 22px 2px 0; }
.card-body h3 { margin-bottom: 8px; }
.card-body p { color: var(--text-2); font-size: 0.95rem; margin: 0; max-width: 42ch; }
.card .arrow-wrap { flex: none; width: 46px; height: 46px; border-radius: 999px; border: 1px solid var(--line-2); display: grid; place-items: center; transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease; }
.card .arrow-wrap svg { width: 16px; height: 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); }
@media (hover: hover) and (pointer: fine) {
  .card:hover .card-media img, .card:hover .card-media video { transform: scale(1.03); }
  .card:hover .arrow-wrap { background: var(--accent); border-color: var(--accent); color: #fff; }
}

/* Triptych of vertical loops (short-form card) */
.card-media.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 7% 9%; background: var(--bg-2); align-items: center; }
.card-media.tri video { height: auto; aspect-ratio: 9 / 16; border-radius: 10px; object-fit: cover; background: #000; }
.card-media.tri video:nth-child(2) { transform: translateY(-6%); }
@media (hover: hover) and (pointer: fine) {
  .card:hover .card-media.tri video { transform: none; }
  .card:hover .card-media.tri video:nth-child(2) { transform: translateY(-6%); }
}

/* Type-only card media (ICT) */
.xp-visual { position: absolute; inset: 0; display: grid; place-content: center; gap: 22px; padding: 10%; background: var(--bg-2); }
.xp-label { display: flex; justify-content: space-between; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); }
.xp-bar { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.xp-fill { height: 100%; width: 72%; background: var(--accent); border-radius: inherit; transform-origin: left; }
.powerups { display: flex; flex-wrap: wrap; gap: 8px; }
.powerup { font-size: 0.8rem; font-weight: 600; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); }
.powerup.locked { color: var(--text-3); border-style: dashed; background: transparent; }
.xp-title { font-family: var(--font-display); font-stretch: 115%; font-weight: 900; font-size: clamp(1.4rem, 3vw, 2.2rem); line-height: 1; }

/* ---------- manifesto ---------- */
.manifesto { background: var(--bg-2); }
.manifesto .big { font-family: var(--font-display); font-stretch: 115%; font-weight: 900; font-size: clamp(2rem, 5vw, 4.4rem); line-height: 1.02; letter-spacing: -0.02em; max-width: 16ch; }
.manifesto-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: end; }
.manifesto-cols p { color: var(--text-2); font-size: 1.08rem; }
.manifesto-cols p strong { color: var(--text); font-weight: 600; }
.manifesto-cols p.big { color: var(--text); font-size: clamp(2rem, 5vw, 4.4rem); }

/* ---------- capabilities ---------- */
.caps { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.cap { padding: 32px 26px 8px 0; }
.cap + .cap { padding-left: 26px; border-left: 1px solid var(--line); }
.cap .num { font-size: 0.78rem; font-weight: 600; color: var(--accent-text); letter-spacing: 0.1em; }
.cap h3 { margin: 14px 0 12px; font-size: 1.3rem; }
.cap p { color: var(--text-2); font-size: 0.95rem; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.portrait { aspect-ratio: 4 / 5; border-radius: var(--radius); background: var(--bg-2); display: grid; place-items: center; position: relative; overflow: hidden; }
.portrait .mono { font-family: var(--font-display); font-stretch: 125%; font-weight: 900; font-size: clamp(4rem, 9vw, 7.5rem); letter-spacing: -0.03em; }
.portrait .mono span { color: var(--accent); }
.about-text p { color: var(--text-2); font-size: 1.08rem; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 34px 0; border-top: 1px solid var(--line); }
.fact { padding: 16px 0; border-bottom: 1px solid var(--line); }
.fact dt { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.fact dd { margin: 4px 0 0; font-weight: 500; }

/* ---------- contact ---------- */
.contact { text-align: left; }
.contact .mail { font-family: var(--font-display); font-stretch: 115%; font-weight: 900; font-size: clamp(1.6rem, 5.2vw, 4.6rem); letter-spacing: -0.02em; line-height: 1.05; display: inline-block; margin: 26px 0 36px; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 3px no-repeat; transition: background-size 400ms var(--ease-out); padding-bottom: 6px; }
@media (hover: hover) and (pointer: fine) { .contact .mail:hover { background-size: 100% 3px; } }
.socials { display: flex; flex-wrap: wrap; gap: 12px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); color: var(--text-3); font-size: 0.85rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------- showreel dialog ---------- */
dialog.player {
  border: 0; padding: 0; background: transparent; max-width: min(1200px, 92vw); width: 100%;
  opacity: 0; transform: scale(0.96);
  transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out), overlay 260ms allow-discrete, display 260ms allow-discrete;
}
dialog.player[open] { opacity: 1; transform: scale(1); }
@starting-style { dialog.player[open] { opacity: 0; transform: scale(0.96); } }
dialog.player::backdrop { background: rgba(0, 0, 0, 0); transition: background-color 260ms ease, overlay 260ms allow-discrete, display 260ms allow-discrete; }
dialog.player[open]::backdrop { background: rgba(0, 0, 0, 0.82); }
@starting-style { dialog.player[open]::backdrop { background: rgba(0, 0, 0, 0); } }
dialog.player video { width: 100%; border-radius: var(--radius); background: #000; aspect-ratio: 16 / 9; }
dialog.player .close { position: absolute; top: -52px; right: 0; color: #F5F3EF; border-color: rgba(255,255,255,0.3); }

/* ---------- case study pages ---------- */
.case-hero { padding: clamp(48px, 8vw, 100px) 0 clamp(36px, 5vw, 56px); }
.back { display: flex; width: fit-content; align-items: center; gap: 8px; color: var(--text-2); font-size: 0.9rem; margin-bottom: 40px; transition: color 160ms ease; }
.back svg { width: 15px; height: 15px; transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .back:hover { color: var(--text); } }
.case-hero h1 { font-size: clamp(2.3rem, 6vw, 5rem); max-width: 18ch; }
.meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: clamp(40px, 6vw, 64px); border-top: 1px solid var(--line); }
.meta div { padding: 18px 20px 0 0; }
.meta div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.meta dt { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.meta dd { margin: 0; font-size: 0.95rem; }
.meta a { color: var(--accent-text); }
.case-media { border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.case-media img { width: 100%; height: auto; }
.case-body { display: grid; grid-template-columns: 0.75fr 1.25fr; gap: clamp(28px, 6vw, 96px); padding: clamp(64px, 9vw, 120px) 0 0; }
.case-body + .case-body { padding-top: clamp(48px, 7vw, 88px); }
.case-body .label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-text); position: sticky; top: 100px; align-self: start; }
.prose { font-size: 1.1rem; color: var(--text-2); max-width: 62ch; }
.prose strong { color: var(--text); font-weight: 600; }
.prose h3 { color: var(--text); margin: 38px 0 12px; font-size: 1.3rem; }
.prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 1em; }
.xp-fill { transform: scaleX(0.72); width: 100%; }
.js .reveal .xp-fill, .js .card .xp-fill { transform: scaleX(0); transition: transform 1200ms var(--ease-out) 300ms; }
.js .reveal.in .xp-fill, .js .card.in .xp-fill { transform: scaleX(0.72); }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--accent); }
.pull { font-family: var(--font-display); font-stretch: 115%; font-weight: 900; font-size: clamp(1.6rem, 3.4vw, 2.8rem); line-height: 1.08; letter-spacing: -0.015em; color: var(--text); max-width: 22ch; }
.gallery { display: grid; gap: clamp(12px, 2vw, 20px); margin-top: clamp(56px, 8vw, 96px); }
.gallery.g2 { grid-template-columns: repeat(2, 1fr); }
.gallery.g3 { grid-template-columns: repeat(3, 1fr); }
.gallery.g5 { grid-template-columns: repeat(5, 1fr); }
.gallery img, .gallery video { width: 100%; border-radius: 10px; background: var(--surface); }
.gallery .phone { aspect-ratio: 9 / 16; object-fit: cover; }
.figcap { font-size: 0.85rem; color: var(--text-3); margin-top: 12px; }
.results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 1px solid var(--line); margin-bottom: 26px; }
.results div { padding: 20px 20px 18px 0; border-bottom: 1px solid var(--line); }
.results div:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--line); }
.results .n { font-family: var(--font-display); font-stretch: 115%; font-weight: 900; font-size: clamp(1.8rem, 3.4vw, 2.7rem); line-height: 1; color: var(--text); }
.results .l { font-size: 0.88rem; color: var(--text-2); margin-top: 8px; }
.next { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: clamp(80px, 10vw, 140px); padding: clamp(32px, 5vw, 56px) 0; border-top: 1px solid var(--line); }
.next small { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.next .t { font-family: var(--font-display); font-stretch: 115%; font-weight: 900; font-size: clamp(1.5rem, 3.6vw, 3rem); line-height: 1.05; letter-spacing: -0.015em; }
.next svg { width: 28px; height: 28px; flex: none; color: var(--accent); }

/* ---------- scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }

/* Hero entrance: one sequence, non-uniform delays */
.js .hero .h-in { opacity: 0; transform: translateY(14px); animation: rise 800ms var(--ease-out) forwards; }
.js .hero .h-in:nth-child(1) { animation-delay: 40ms; }
.js .hero .h-in:nth-child(2) { animation-delay: 120ms; }
.js .hero .h-in:nth-child(3) { animation-delay: 230ms; }
.js .hero .h-in:nth-child(4) { animation-delay: 300ms; }
.js .hero .h-in:nth-child(5) { animation-delay: 420ms; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .stats-grid, .caps { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3), .cap:nth-child(n+3) { border-top: 1px solid var(--line); }
  .cap:nth-child(3) { padding-left: 0; border-left: 0; }
  .work-grid, .manifesto-cols, .about, .case-body { grid-template-columns: 1fr; }
  .case-body .label { position: static; }
  .meta { grid-template-columns: repeat(2, 1fr); }
  .meta div:nth-child(3) { padding-left: 0; border-left: 0; }
  .gallery.g5 { grid-template-columns: repeat(3, 1fr); }
  .gallery.g3 { grid-template-columns: repeat(2, 1fr); }
  .portrait { max-width: 420px; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .logo-text { display: none; }
  .stat, .stat + .stat { padding: 26px 14px 24px 0; }
  .stat + .stat { padding-left: 14px; }
  .stat:nth-child(3) { padding-left: 0; }
  .caps { grid-template-columns: 1fr; }
  .cap, .cap + .cap { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .results { grid-template-columns: 1fr; }
  .results div:nth-child(even) { padding-left: 0; border-left: 0; }
  .facts { grid-template-columns: 1fr; }
  .gallery.g2, .gallery.g3 { grid-template-columns: 1fr 1fr; }
  .btn { height: 48px; padding: 0 20px; }
  .corners > .c { width: 18px; height: 18px; }
  .corners > .c.tl, .corners > .c.tr { top: -6px; } .corners > .c.bl, .corners > .c.br { bottom: -6px; }
  .corners > .c.tl, .corners > .c.bl { left: -6px; } .corners > .c.tr, .corners > .c.br { right: -6px; }
}

/* ---------- accessibility preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; transition: opacity 400ms ease; }
  .js .hero .h-in { transform: none; animation-name: fade; }
  dialog.player, dialog.player[open] { transform: none; }
  .card-media img, .card-media video { transition: none; }
}
@keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .reel-play { background: #0E0E0E; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root[data-theme="dark"] { --text-2: #D8D6D2; --line: rgba(245,243,239,0.3); }
  :root[data-theme="light"] { --text-2: #222; --line: rgba(14,14,14,0.35); }
}
