/* =========================================================================
   Um roteiro, cinco Brasis: base do protótipo do site do FUNCINE
   Camada do fundo (tela e sala) + variáveis de cada mundo.
   ========================================================================= */

:root {
  /* Fundo: a sala escura e a tela */
  --room: #000000;
  --screen: #ECEBE6;
  --screen-2: #E2E1DB;
  --ink: #16181B;
  --graphite: #54575D;
  --silver: #B6B8B3;
  --light: #FFF6DF;
  --riza-brand: #DE9000;

  /* Motoboys do Sertão */
  --mb-asphalt: #0D0A09;
  --mb-earth: #663715;
  --mb-dust: #BA9055;
  --mb-yellow: #FDDA3B;
  --mb-cyan: #22E7FF;
  --mb-sky: #5B87AB;

  /* The Last of the Tribe */
  --tr-dark: #090C0D;
  --tr-teal: #0D292D;
  --tr-moss: #293E2E;
  --tr-mist: #7BA2A1;
  --tr-bone: #CEC8B6;
  --tr-ember: #9C2A26;

  /* E.T. de Varginha */
  --vg-night: #06081B;
  --vg-lead: #111A22;
  --vg-steel: #86B6CF;
  --vg-phosphor: #BCCFBE;
  --vg-amber: #AC976F;
  --vg-fire: #E8742F;

  /* Elza */
  --el-paper: #FFFDEC;
  --el-orange: #F38247;
  --el-accent: #FF9300;
  --el-graphite: #5E5E5E;
  --el-stage: #060707;
  --el-sepia: #DBD1C2;

  /* Julia Cenne */
  --jc-black: #0A0A0A;
  --jc-graphite: #1E1E1E;
  --jc-draft: #8A8A8A;
  --jc-track: #D3D3D3;
  --jc-white: #FFFFFF;
  --jc-magenta: #FF2BD6;
  --jc-sun: #F2B886;

  /* Tipografia do fundo: Archivo com eixo de largura (62 a 125) */
  --font-fund: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --s-0: 1.0625rem;   /* 17 */
  --s-1: 1.3125rem;   /* 21 */
  --s-2: 1.625rem;    /* 26 */
  --s-3: 2.0625rem;   /* 33 */
  --s-4: 2.5625rem;   /* 41 */
  --s-5: clamp(2.6rem, 5.2vw, 4.1rem);
  --s-6: clamp(3.2rem, 8.4vw, 7.8rem);

  --gutter: clamp(16px, 4vw, 56px);
  --rail: 0px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --header-h: 64px;
}

@media (min-width: 1024px) {
  :root { --rail: 72px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-fund);
  font-size: var(--s-0);
  line-height: 1.55;
  color: var(--ink);
  background: var(--room);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus, #3D8BFF); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--light); color: var(--room); padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Tons de seção ---------- */
[data-tone="room"] { background: var(--room); color: var(--light); --focus: var(--light); }
[data-tone="screen"] { background: var(--screen); color: var(--ink); --focus: #1f4fd1; }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 var(--gutter) 0 calc(var(--gutter) + var(--rail));
  color: var(--light);
  transition: color .4s var(--ease), background-color .4s var(--ease);
}
.site-header[data-tone="screen"] { color: var(--ink); background: color-mix(in srgb, var(--screen) 86%, transparent); backdrop-filter: blur(10px); }
.site-header[data-tone="room"] { background: linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,0)); }
.brand { display: flex; flex-direction: column; line-height: 1; text-decoration: none; margin-right: auto; }
.brand b { font-weight: 800; font-stretch: 125%; font-size: 1.05rem; letter-spacing: .02em; }
.brand span { font-size: .72rem; font-stretch: 100%; opacity: .75; margin-top: 4px; }
.menu { display: none; gap: 22px; font-size: .9rem; }
.menu a { text-decoration: none; opacity: .82; }
.menu a:hover, .menu a[aria-current="true"] { opacity: 1; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
@media (min-width: 1180px) { .menu { display: flex; } }
.controls { display: flex; gap: 8px; align-items: center; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid currentColor; border-radius: 999px;
  padding: 7px 12px; font-size: .78rem; cursor: pointer; opacity: .85;
}
.toggle[aria-pressed="true"] { opacity: 1; background: currentColor; }
.toggle[aria-pressed="true"] span { color: var(--room); }
.site-header[data-tone="screen"] .toggle[aria-pressed="true"] span,
.site-header[data-tone="screen"] .toggle[aria-pressed="true"] svg { color: var(--screen); }
.toggle svg { width: 14px; height: 14px; }
.toggle[aria-pressed="true"] svg { color: var(--room); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px;
  border-radius: 2px; border: 1px solid currentColor;
  text-decoration: none; font-weight: 600; font-size: .92rem; cursor: pointer;
  background: transparent;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.btn--solid { background: var(--light); color: var(--room); border-color: var(--light); }
[data-tone="screen"] .btn--solid, .site-header[data-tone="screen"] .btn--solid { background: var(--ink); color: var(--screen); border-color: var(--ink); }
.btn:hover { background: currentColor; }
.btn:hover span { color: var(--room); }
[data-tone="screen"] .btn:hover span { color: var(--screen); }
.btn--solid:hover { filter: brightness(1.08); }
.btn--solid:hover span { color: inherit; }
.site-header .btn { min-height: 38px; font-size: .82rem; padding: 0 14px; }
@media (max-width: 640px) {
  .toggle .label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .toggle { min-width: 36px; min-height: 36px; justify-content: center; }
  .site-header .btn { display: none; }
}
.toggle .short { display: none; font-weight: 600; }
@media (max-width: 640px) { .toggle .short { display: inline; } }

/* ---------- Trilho do fio condutor (navegação por capítulos) ---------- */
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail); z-index: 40;
  display: none; pointer-events: none;
}
@media (min-width: 1024px) { .rail { display: block; } }
.rail svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.rail .rail__base { stroke: currentColor; opacity: .25; fill: none; stroke-width: 1.5; }
.rail .rail__progress { stroke: var(--thread, var(--light)); fill: none; stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--thread, var(--light))); }
.rail ol { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: auto; }
.rail li { position: absolute; left: 0; width: var(--rail); display: flex; justify-content: center; transform: translateY(-50%); }
.rail a {
  width: 14px; height: 14px; border-radius: 50%; display: block; position: relative;
  background: var(--marker-bg, var(--room)); border: 2px solid var(--thread, var(--light));
}
.rail a[aria-current="true"] { background: var(--thread, var(--light)); }
.rail a span {
  position: absolute; left: 26px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-size: .78rem; padding: 3px 8px; border-radius: 2px;
  background: var(--thread, var(--light)); color: var(--room); opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.rail a:hover span, .rail a:focus-visible span { opacity: 1; }
.progress-bar { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 60; transform-origin: 0 50%; transform: scaleX(0); background: var(--thread, var(--light)); }
@media (min-width: 1024px) { .progress-bar { display: none; } }

/* ---------- Grão de película ---------- */
.grain { position: fixed; inset: -50%; z-index: 45; pointer-events: none; opacity: var(--grain, .07); mix-blend-mode: overlay; }

/* ---------- Layout ---------- */
main { position: relative; }
.section { position: relative; padding: clamp(88px, 12vw, 180px) var(--gutter) clamp(72px, 10vw, 150px) calc(var(--gutter) + var(--rail)); }
.wrap { max-width: 1240px; margin: 0 auto; }
.text { max-width: 64ch; }
.fund-title {
  font-weight: 750; font-stretch: 125%; letter-spacing: -.01em;
  font-size: var(--s-5); line-height: 1.02; margin: 0 0 .5em;
  text-wrap: balance;
}
.lead { font-size: var(--s-1); line-height: 1.45; max-width: 46ch; text-wrap: pretty; }
.note { font-size: .82rem; color: var(--graphite); max-width: 70ch; }
[data-tone="room"] .note { color: color-mix(in srgb, var(--light) 62%, transparent); }
.provisional { border-left: 2px solid currentColor; padding-left: 12px; }

/* Quadro scope 2,39:1 usado em todo o site */
.scope { position: relative; aspect-ratio: 2.39 / 1; overflow: hidden; background: #000; }
.scope img { width: 100%; height: 100%; object-fit: cover; }

/* Legendas no estilo de legenda de cinema */
.caption { font-size: var(--s-1); line-height: 1.35; text-align: center; max-width: 34ch; margin: 0 auto; text-shadow: 0 2px 12px rgba(0,0,0,.6); }

/* ---------- Rodapé legal ---------- */
.site-footer { padding: 56px var(--gutter) 64px calc(var(--gutter) + var(--rail)); background: var(--room); color: color-mix(in srgb, var(--light) 70%, transparent); font-size: .82rem; }
.site-footer .wrap { display: grid; gap: 28px; }
@media (min-width: 900px) { .site-footer .wrap { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer h2 { font-size: .9rem; color: var(--light); margin: 0 0 8px; font-weight: 650; }
.site-footer p { margin: 0 0 10px; max-width: 70ch; }
.site-footer a { color: var(--light); }

/* ---------- Redução de movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
html.reduced-motion *, html.reduced-motion *::before, html.reduced-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
