/* ==========================================================================
   Planet Design Language — BASE
   Reset, typography primitives, atmosphere, reveal, reduced-motion.
   Requires: tokens.css + one theme file.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: var(--w-light);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tr-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--d-base) var(--ease), color var(--d-base) var(--ease);
}
::selection { background: var(--accent); color: var(--accent-ink); }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-xs); }

/* ---- Typography primitives --------------------------------------------- */
.display { font-size: var(--t-display); font-weight: var(--w-medium); letter-spacing: var(--tr-display); line-height: var(--lh-tight); }
.h1 { font-size: var(--t-h1); font-weight: var(--w-medium); letter-spacing: var(--tr-h2); line-height: 1; }
.h2 { font-size: var(--t-h2); font-weight: var(--w-medium); letter-spacing: var(--tr-h2); line-height: var(--lh-head); }
.h3 { font-size: var(--t-h3); font-weight: var(--w-medium); letter-spacing: var(--tr-h3); line-height: 1.06; }
.h4 { font-size: var(--t-h4); font-weight: var(--w-medium); letter-spacing: var(--tr-h4); line-height: 1.15; }
.h5 { font-size: var(--t-h5); font-weight: var(--w-medium); letter-spacing: -0.02em; line-height: 1.3; }
.lede { font-size: var(--t-lede); color: var(--ink-2); max-width: 600px; }
.sub { font-size: calc(var(--t-lede) - 2px); color: var(--ink-2); max-width: 620px; }
.lede b, .sub b { color: var(--ink); font-weight: var(--w-regular); }
.small { font-size: var(--t-small); color: var(--ink-2); }
.caption { font-size: var(--t-caption); color: var(--ink-3); }

/* Mono label — where a machine would speak */
.mono {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: var(--tr-label);
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: var(--w-regular);
}
.num { font-variant-numeric: tabular-nums; }

/* The voice line — italic second line under a headline. Planet's signature. */
.voice {
  font-family: var(--font-voice);
  font-style: var(--voice-style);
  font-weight: var(--voice-weight);
  letter-spacing: var(--tr-italic);
  color: var(--ink-2);
}
.voice.g {
  background: var(--voice-gradient);
  -webkit-background-clip: text; background-clip: text;
  color: var(--voice-fill);
  padding-right: .06em;
}

.sig { color: var(--accent); }
.ink-2 { color: var(--ink-2); }
.ink-3 { color: var(--ink-3); }

/* ---- Layout ------------------------------------------------------------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---- Atmosphere --------------------------------------------------------- */
.grain::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: var(--z-grain);
  opacity: var(--atmo-grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
canvas.stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .55; }

/* ---- Reveal (driven by behaviors.js) ------------------------------------ */
.rv {
  opacity: 0; transform: translateY(var(--reveal-y)); filter: blur(var(--reveal-blur));
  transition: opacity var(--d-reveal) var(--ease), transform var(--d-reveal) var(--ease), filter var(--d-reveal) var(--ease);
}
.rv.in { opacity: 1; transform: none; filter: none; }

@keyframes pl-pulse { 50% { opacity: .35; } }
@keyframes pl-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes pl-rim { 50% { opacity: .6; } }
@keyframes pl-beam { from { left: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } to { left: 86%; opacity: 0; } }
@keyframes pl-cue { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
@keyframes pl-in { from { opacity: 0; transform: translateY(var(--reveal-y)); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rv { opacity: 1; transform: none; filter: none; }
}
