/* ==========================================================================
   BASE — tokens, reset, tipografia, revelações, cursor, header, progresso
   ========================================================================== */
:root {
  --ink: #0F1111;
  --ink-2: #131921;
  --ink-3: #1B2330;
  --paper: #EFE8DC;
  --paper-2: #E2D8C6;
  --kraft: #C49A6C;
  --orange: #FF9900;
  --orange-2: #FFB547;
  --orange-deep: #E47911;
  --green: #10B981;
  --green-2: #34D399;
  --red: #B42318;

  /* cores do contexto (trocadas por tema de painel) */
  --fg: var(--paper);
  --fg-2: rgba(239, 232, 220, .68);
  --fg-3: rgba(239, 232, 220, .42);
  --line: rgba(239, 232, 220, .14);

  --f-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --gutter: clamp(20px, 4vw, 48px);
  --maxw: 1320px;
  --header-h: 72px;
  --radius-panel: clamp(22px, 3vw, 36px);

  --ease: cubic-bezier(.19, 1, .22, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --motion: 1;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } }   /* não quebra position: sticky */

img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--orange); color: var(--ink); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 4px; }

html { scrollbar-color: #2b3440 var(--ink); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: #2b3440; border-radius: 10px; border: 2px solid var(--ink); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.skip-link { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 10px 16px; background: var(--orange); color: var(--ink); font-weight: 700; border-radius: 8px; }
.skip-link:focus { top: 12px; }

/* ---------- Tipografia ---------- */
.mono { font-family: var(--f-mono); font-size: 12px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
.serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.nowrap { white-space: nowrap; }
.text-green { color: var(--green); }

.display {
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 88%;
  font-size: clamp(40px, 6.6vw, 108px);
  line-height: .95;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.display--sm { font-size: clamp(36px, 5vw, 80px); }
.display .serif { font-size: 1.1em; line-height: .8; letter-spacing: -.02em; }

.index { display: flex; align-items: center; gap: 12px; color: var(--fg-2); margin-bottom: clamp(18px, 3vw, 32px); }
.index b { font-weight: 500; color: var(--orange); }
.index b::after { content: ""; display: inline-block; width: 28px; height: 1px; margin-left: 12px; vertical-align: middle; background: currentColor; opacity: .6; }

/* ---------- Revelação reversível (aparece ao entrar, some ao sair) ---------- */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, calc(48px * var(--motion)), 0);
  transition: opacity .9s var(--ease) var(--d, 0s), transform 1.2s var(--ease) var(--d, 0s);
}
.js .reveal.is-above { transform: translate3d(0, calc(-48px * var(--motion)), 0); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Títulos divididos em linhas com máscara */
.js [data-split]:not(.is-split) { visibility: hidden; }
[data-split] .sl { display: block; overflow: hidden; padding: .08em 0 .16em; margin: -.08em 0 -.16em; }
[data-split] .sl > span { display: block; }
.js [data-split] .sl > span {
  transform: translate3d(0, 115%, 0) rotate(calc(3deg * var(--motion)));
  transform-origin: 0 100%;
  transition: transform 1.25s var(--ease) calc(var(--i, 0) * 90ms + var(--d, 0s));
}
.js [data-split].is-in .sl > span { transform: none; }
.js [data-split].is-above .sl > span { transform: translate3d(0, -115%, 0); }

/* Entrada da primeira dobra (após fontes carregadas) */
.js .intro { opacity: 0; transform: translate3d(0, calc(32px * var(--motion)), 0); transition: opacity 1s var(--ease) var(--d, 0s), transform 1.3s var(--ease) var(--d, 0s); }
.is-loaded .intro { opacity: 1; transform: none; }

/* ---------- Grão de papel (textura estática, custo zero por frame) ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: .06;
  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='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Cursor (só mouse) ---------- */
.cursor { display: none; color: var(--paper); }
.has-cursor .cursor { display: block; }
.cursor-ring, .cursor-dot { position: fixed; top: 0; left: 0; z-index: 80; pointer-events: none; will-change: transform; }
.cursor-ring {
  width: 80px; height: 80px;
  margin: -40px 0 0 -40px;
  display: grid; place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .3s ease, background-color .3s ease, border-color .3s ease;
}
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--orange); opacity: 0; transition: opacity .3s; }
.cursor.is-visible .cursor-ring { opacity: .55; }
.cursor.is-visible .cursor-dot { opacity: 1; }
.cursor.is-hover .cursor-ring { opacity: 1; background: rgba(255, 153, 0, .14); border-color: var(--orange); }
.cursor.is-area .cursor-ring { opacity: 1; border-color: var(--orange); }
.cursor.is-text .cursor-ring { opacity: 0; }
.cursor-label { font: 500 10px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--orange); opacity: 0; transition: opacity .2s; }
.cursor.is-area .cursor-label { opacity: 1; }
html[data-under="light"] .cursor { color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  padding-top: env(safe-area-inset-top);
  color: var(--paper);
  transition: transform .7s var(--ease), color .4s ease;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -24px 0;
  background: linear-gradient(180deg, rgba(15, 17, 17, .85), rgba(15, 17, 17, 0));
  pointer-events: none;
  transition: opacity .4s ease;
}
html[data-under="light"] .site-header { color: var(--ink); }
html[data-under="light"] .site-header::before { opacity: 0; }
.site-header.is-hidden { transform: translate3d(0, -110%, 0); }

.header-inner {
  position: relative;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 105%;
  font-size: 19px;
  letter-spacing: -.03em;
}
.wordmark i { font-style: normal; color: var(--orange); margin: 0 .06em; }
.header-meta { display: none; align-items: center; gap: 10px; opacity: .8; }
.header-meta .sep { opacity: .4; }
@media (min-width: 920px) { .header-meta { display: flex; } }

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}
.header-cta:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }
@media (max-width: 380px) { .header-cta { padding: 0 12px; font-size: 13px; } .wordmark { font-size: 17px; } }

.live-dot { position: relative; display: inline-block; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--green); }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green); animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.8); opacity: 0; } }

/* ---------- Progresso vertical (desktop) ---------- */
.progress {
  position: fixed;
  left: 14px;
  top: 50%;
  z-index: 55;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transform: translateY(-50%);
  color: var(--paper);
  transition: color .4s ease;
}
html[data-under="light"] .progress { color: var(--ink); }
@media (min-width: 1100px) and (hover: hover) { .progress { display: flex; } }
.progress-num { font-size: 11px; }
.progress-bar { position: relative; width: 1px; height: 22vh; background: currentColor; opacity: .25; }
.progress-bar i { position: absolute; inset: 0; background: var(--orange); transform-origin: top; transform: scaleY(0); }
.progress-bar { opacity: 1; background: rgba(128, 128, 128, .35); }
.progress-name { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; opacity: .7; }

/* ---------- Movimento reduzido ----------
   Windows com "Efeitos de animação" desligado e macOS/iOS com "Reduzir movimento"
   ativam .motion-soft (tudo mantido, deslocamentos menores). "respect" → .motion-off. */
.motion-soft { --motion: .55; }
.motion-off { --motion: 0; }
.motion-off *, .motion-off *::before, .motion-off *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  transition-delay: 0s !important;
}

/* ---------- Impressão / PDF ---------- */
@media print {
  .js .reveal, .js .intro, .js [data-split] .sl > span { opacity: 1 !important; transform: none !important; visibility: visible !important; }
  .grain, .cursor, .site-header, .progress, .sticky-cta, .bands, .hero-scene { display: none !important; }
  .panel, .journey { position: static !important; }
}
