/* ============================================================
   Sides demo set, base layer
   Reset, atmosphere, grain, typography, focus, scrollbars.
   Depends on tokens.css.
   ============================================================ */

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

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  overflow-x: hidden;
}

/* ---- Atmosphere + grain (shared with the landing page look) ---- */
.atmosphere {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(115% 80% at 6% 110%, var(--theatre-red) 0%, rgba(92,26,31,0.30) 24%, transparent 56%),
    radial-gradient(80% 65% at 98% -12%, rgba(140,39,50,0.36) 0%, transparent 52%),
    linear-gradient(180deg, var(--archive-ink) 0%, var(--bg) 46%, var(--velvet-end) 100%);
}
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Typography primitives ---- */
h1, h2, h3, h4 { font-weight: 600; line-height: var(--lh-snug); letter-spacing: -0.01em; }
.display-1 { font-size: var(--fs-d1); line-height: var(--lh-tight); letter-spacing: -0.02em; font-weight: 700; }
.display-2 { font-size: var(--fs-d2); line-height: var(--lh-tight); letter-spacing: -0.02em; font-weight: 700; }
.display-3 { font-size: var(--fs-d3); font-weight: 600; }
.display-4 { font-size: var(--fs-d4); font-weight: 600; }
.lede { font-size: var(--fs-lg); line-height: var(--lh-body); color: var(--ink-dim); max-width: 60ch; }
.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
strong, b { font-weight: 600; color: var(--ink); }

.eyebrow {
  font-size: var(--fs-eyebrow); letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase; color: var(--ink-faint); font-weight: 500;
  display: inline-flex; align-items: center; gap: 0.7rem;
}
.eyebrow--rule::before {
  content: ""; width: clamp(22px, 3vw, 40px); height: 1px; background: var(--hairline-loud);
}

a { color: inherit; text-decoration: none; }
a.link { color: var(--theatrical); transition: color var(--t-fast) var(--ease); }
a.link:hover { color: var(--ink); }

/* ---- Focus + selection ---- */
:focus-visible { outline: 2px solid var(--theatrical); outline-offset: 2px; border-radius: var(--r-xs); }
::selection { background: var(--crimson-35); color: var(--ink); }

/* ---- Scrollbars (kept quiet, dark) ---- */
* { scrollbar-width: thin; scrollbar-color: var(--hairline) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: var(--r-pill); }
*::-webkit-scrollbar-thumb:hover { background: var(--hairline-loud); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---- Entrance reveal (one orchestrated load, staggered) ---- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.reveal { opacity: 0; animation: rise 0.85s var(--ease) forwards; }
.d1 { animation-delay: 0.04s; } .d2 { animation-delay: 0.13s; } .d3 { animation-delay: 0.24s; }
.d4 { animation-delay: 0.36s; } .d5 { animation-delay: 0.5s; }  .d6 { animation-delay: 0.66s; }
.d7 { animation-delay: 0.82s; } .d8 { animation-delay: 0.98s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { animation: none; opacity: 1; transform: none; }
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ---- Utility layout helpers ---- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.wrap-gap { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.grow { flex: 1; }
.center { text-align: center; }
.gap-1 { gap: var(--s-1); } .gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); } .gap-5 { gap: var(--s-5); } .gap-6 { gap: var(--s-6); }
.mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); } .mt-6 { margin-top: var(--s-6); } .mt-7 { margin-top: var(--s-7); }
.hide { display: none !important; }
