/* ritz — "Console" theme.
   A launch console for your launch console: terminal-chrome panels, an indigo
   accent, monospace command headers set against a warm serif body face. Committed to
   dark-only (this is a CRT, not a color-scheme toggle) — color-scheme: dark below tells
   browsers not to fight it with forced light-mode form chrome.

   Accent/scope palette is kept in sync with the real app's Graphite theme
   (crates/ritz-app/src/theme.rs) — same ACCENT for brand + links (the app has no
   separate link color, so neither does this site), same scope chip hexes, same
   warning color reserved for the warning role only. */

:root {
  color-scheme: dark;

  --bg:      #0a0c0e;
  --bg-alt:  #0d1013;
  --panel:   #12161a;
  --panel2:  #0e1114;
  --field:   #0a0d10;
  --border:  #23292f;
  --border-lit: #34404a;

  --ink:     #e9e6dc;   /* warm paper-white body text */
  --ink-dim: #9aa0a6;
  --ink-faint: #5b6169;

  /* Brand accent — matches the app's ACCENT (crates/ritz-app/src/theme.rs).
     Reused for links too, same as the app's v.hyperlink_color = ACCENT: there is no
     separate secondary/link accent, by design. */
  --accent:     #5b8bf0;
  --accent-dim: #4269ba;
  --accent-glow: rgba(91,139,240,0.35);
  /* Warning role only (the app's COL_WARN) — never the brand accent. Wired up via
     .note.warn below for the day a genuine caveat/heads-up callout is added; no page
     copy needs it yet. */
  --warn:       #e1a854;

  --global:  #e15554;  /* red   — COL_GLOBAL */
  --profile: #6cc551;  /* green — COL_PROFILE */
  --game:    #4d9de0;  /* blue  — COL_GAME */
  --default: #464d57;  /* gray  — COL_DEFAULT */

  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --serif: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, "Noto Serif", serif;

  --maxw: 960px;
  --ease: cubic-bezier(.22,.9,.3,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 1000px 560px at 12% -12%, rgba(91,139,240,0.10), transparent 60%),
    radial-gradient(ellipse 760px 520px at 104% 4%, rgba(91,139,240,0.05), transparent 55%),
    radial-gradient(ellipse 700px 480px at 50% 115%, rgba(91,139,240,0.04), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* fine grain texture for depth — a repeating dot pattern, barely-there */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 3px 3px;
}
header.nav, .hero, main, footer { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: rgba(91,139,240,0.32); color: #fff; }

/* ---------------- entrance ---------------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero > * { animation: fade-up .7s var(--ease) both; }
.hero .logo-wrap   { animation-delay: .02s; }
.hero .kicker      { animation-delay: .09s; }
.hero h1           { animation-delay: .15s; }
.hero .tag         { animation-delay: .22s; }
.hero .cta         { animation-delay: .3s; }
@media (prefers-reduced-motion: reduce) {
  .hero > * { animation: none !important; }
  .cursor { animation: none !important; }
  .hero .logo-wrap img { animation: none !important; }
}

/* ---------------- nodding logo ---------------- */
/* Clones the app's splash-screen logo animation (crates/ritz-app/src/splash.rs,
   paint_logo_anim): a continuous, looping nod/tilt, not a one-shot entrance.
   Ping-pong period 3.8s (two 1.9s smoothstep-eased swings). Horizontal translate and
   rotation follow the smoothstep ease `e`; vertical translate follows a separate
   parabolic "dip" curve `s = 1 - (2e-1)^2` that peaks at each swing's midpoint — the
   two curves are genuinely different shapes, so the 21 stops below are numerically
   sampled from the real formulas (5% steps) rather than expressed as one CSS easing
   function. Amplitudes scaled from the app's k = logo_px/300 (0.4 at the app's 120px)
   to this site's 128px logo: k = 128/300 ≈ 0.4267. Rotation pivots 78% down the logo
   (near its base), matching the app's pivot point, via transform-origin below. */
@keyframes logo-nod {
  0%   { transform: translate(-9.81px, -3.84px) rotate(-4.50deg); }
  5%   { transform: translate(-9.26px, -2.40px) rotate(-4.25deg); }
  10%  { transform: translate(-7.77px, 1.09px)  rotate(-3.56deg); }
  15%  { transform: translate(-5.57px, 5.12px)  rotate(-2.56deg); }
  20%  { transform: translate(-2.90px, 8.23px)  rotate(-1.33deg); }
  25%  { transform: translate(0.00px, 9.39px)   rotate(0.00deg); }
  30%  { transform: translate(2.90px, 8.23px)   rotate(1.33deg); }
  35%  { transform: translate(5.57px, 5.12px)   rotate(2.56deg); }
  40%  { transform: translate(7.77px, 1.09px)   rotate(3.56deg); }
  45%  { transform: translate(9.26px, -2.40px)  rotate(4.25deg); }
  50%  { transform: translate(9.81px, -3.84px)  rotate(4.50deg); }
  55%  { transform: translate(9.26px, -2.40px)  rotate(4.25deg); }
  60%  { transform: translate(7.77px, 1.09px)   rotate(3.56deg); }
  65%  { transform: translate(5.57px, 5.12px)   rotate(2.56deg); }
  70%  { transform: translate(2.90px, 8.23px)   rotate(1.33deg); }
  75%  { transform: translate(0.00px, 9.39px)   rotate(0.00deg); }
  80%  { transform: translate(-2.90px, 8.23px)  rotate(-1.33deg); }
  85%  { transform: translate(-5.57px, 5.12px)  rotate(-2.56deg); }
  90%  { transform: translate(-7.77px, 1.09px)  rotate(-3.56deg); }
  95%  { transform: translate(-9.26px, -2.40px) rotate(-4.25deg); }
  100% { transform: translate(-9.81px, -3.84px) rotate(-4.50deg); }
}

/* ---------------- terminal-tab top nav ---------------- */
header.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10,12,14,0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px) saturate(1.15);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.nav-brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-weight: 600; color: var(--ink);
  font-size: 15px; letter-spacing: .02em;
}
.nav-brand img { width: 24px; height: 24px; border-radius: 6px; box-shadow: 0 0 0 1px var(--border), 0 2px 10px rgba(0,0,0,.4); }
.nav-brand .prompt { color: var(--accent); }
.nav-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; font-family: var(--mono); font-size: 13.5px; }
.nav-links a {
  color: var(--ink-dim); padding: 7px 12px; border-radius: 6px; position: relative;
  transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--panel); text-decoration: none; }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::before { content: "// "; color: var(--accent-dim); }
.nav-links a.gh { color: var(--ink-faint); border: 1px solid var(--border); }
.nav-links a.gh:hover { border-color: var(--border-lit); color: var(--ink); }

/* ---------------- layout ---------------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 22px 100px; }
section { padding-top: 56px; }
footer {
  max-width: var(--maxw); margin: 0 auto; padding: 36px 22px 76px;
  border-top: 1px solid var(--border); color: var(--ink-faint);
  font-family: var(--mono); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: space-between;
}
footer a { color: var(--ink-dim); }

/* ---------------- hero ---------------- */
.hero { padding: 96px 22px 26px; text-align: center; position: relative; }
.hero .logo-wrap {
  width: 128px; height: 128px; margin: 0 auto 26px; position: relative;
}
.hero .logo-wrap img {
  width: 100%; height: 100%; display: block;
  filter: drop-shadow(0 0 44px rgba(91,139,240,0.32)) drop-shadow(0 12px 28px rgba(0,0,0,.6));
  transform-origin: 50% 78%;
  animation: logo-nod 3.8s linear .7s infinite;
}
.hero .kicker {
  display: inline-flex; align-items: center; gap: 0;
  font-family: var(--mono); font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-dim); margin: 0 0 18px;
}
.hero .kicker::before { content: "$ "; color: var(--accent); }
.hero h1 {
  font-family: var(--mono); font-size: 58px; margin: 0 0 16px; letter-spacing: -0.025em;
  font-weight: 600;
  background: linear-gradient(180deg, var(--ink) 45%, #b9bdc4 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .tag {
  color: var(--ink-dim); font-size: 19px; max-width: 640px; margin: 0 auto 34px;
  font-family: var(--serif);
}
.hero .tag code { color: var(--accent); }
.hero .cta { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* blinking cursor after hero tagline */
.cursor {
  display: inline-block; width: .5em; height: 1em; background: var(--accent);
  vertical-align: text-bottom; margin-left: 2px; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 21px; border-radius: 8px;
  font-family: var(--mono); font-weight: 600; font-size: 14.5px;
  border: 1px solid var(--accent); background: var(--accent); color: #0c1420;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 8px 22px -8px var(--accent-glow);
  transition: transform .16s var(--ease), filter .16s var(--ease), box-shadow .16s var(--ease);
}
.btn:hover { text-decoration: none; filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 14px 30px -10px var(--accent-glow); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--panel); border-color: var(--border-lit); color: var(--ink); box-shadow: none; }
.btn.secondary:hover { border-color: var(--accent-dim); color: var(--accent); box-shadow: 0 8px 22px -12px rgba(0,0,0,.5); }

/* ---------------- headings ---------------- */
h1, h2, h3 { line-height: 1.3; font-weight: 600; color: var(--ink); }
h2 {
  font-family: var(--mono); font-size: 22px; margin: 12px 0 18px; padding-bottom: 12px;
  position: relative; letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 10px;
}
h2::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, var(--border) 40%, transparent 100%);
}
h2::before { content: "#"; color: var(--accent-dim); font-weight: 400; }
h3 { font-size: 18.5px; margin: 30px 0 10px; font-family: var(--serif); font-weight: 700; }
p { color: #cfd1cd; }
main p, main li { color: #cfd1cd; }

/* ---------------- inline code / blocks ---------------- */
/* Inline `code` keeps its own warm tan hue rather than switching to --accent: with
   links, buttons, headings and section markers all blue now, code needs a distinct
   hue to still pop out of body copy. Not a warning and not amber-derived from
   --accent — an unrelated, deliberately-kept warm tone (unchanged: #e6b880). */
code {
  font-family: var(--mono); font-size: .88em;
  background: var(--field); border: 1px solid var(--border);
  padding: 1.5px 6px; border-radius: 5px; color: #e6b880;
}

/* code blocks — plain terminal-field styling, no fake window chrome */
pre {
  background: var(--field); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px; margin: 18px 0;
  overflow-x: auto; position: relative;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.65;
  box-shadow: 0 1px 0 rgba(255,255,255,.02) inset, 0 14px 32px -18px rgba(0,0,0,.7);
}
pre code { background: none; border: none; padding: 0; font-size: inherit; color: #d7dadd; }

/* ---------------- cards / grid ---------------- */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin: 20px 0; }
.card {
  background: linear-gradient(175deg, var(--panel), var(--panel2));
  border: 1px solid var(--border);
  border-radius: 12px; padding: 20px 21px; position: relative;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.card:hover { border-color: var(--border-lit); transform: translateY(-3px); box-shadow: 0 16px 34px -20px rgba(0,0,0,.75), 0 0 0 1px rgba(91,139,240,0.08); }
.card h3 { margin: 0 0 9px; font-size: 16px; font-family: var(--mono); font-weight: 600; }
.card h3 a { color: var(--ink); }
.card p { margin: 0; color: var(--ink-dim); font-size: 14.5px; }

/* module cards (extensions page) */
.mod-card { display: flex; flex-direction: column; gap: 8px; }
.mod-card .mod-target { font-family: var(--mono); font-size: 11.5px; color: var(--accent-dim); text-transform: uppercase; letter-spacing: .07em; }
.mod-card h3 { margin: 0; }
.mod-card p { color: var(--ink-dim); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 480px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: rgba(255,255,255,0.018); }
th {
  color: var(--ink-faint); font-weight: 600; text-transform: uppercase; font-size: 11.5px;
  letter-spacing: .06em; font-family: var(--mono); background: var(--panel2);
}
td code { white-space: nowrap; }

/* ---------------- scope chips & callouts ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  font-family: var(--mono);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.chip.global  { color: var(--global);  background: rgba(225,85,84,0.13); }
.chip.profile { color: var(--profile); background: rgba(108,197,81,0.13); }
.chip.game    { color: var(--game);    background: rgba(77,157,224,0.13); }
.chip.default { color: #b7bcc2;        background: rgba(70,77,87,0.30); }

.note {
  border-left: 3px solid var(--accent); background: var(--panel);
  border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 20px 0; color: var(--ink-dim);
  font-size: 15px;
}
.note strong { color: var(--ink); }

/* Genuine caveat/heads-up variant — the app's COL_WARN role, not the brand accent.
   Opt-in via class="note warn" (no current page copy needs it, kept ready). */
.note.warn { border-left-color: var(--warn); }
.note.warn strong { color: var(--warn); }

/* ---------------- steps ---------------- */
ol.steps { counter-reset: s; list-style: none; padding-left: 0; margin: 20px 0; }
ol.steps > li {
  counter-increment: s; position: relative; padding: 3px 0 22px 46px; margin: 0;
}
ol.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(91,139,240,0.12); border: 1px solid rgba(91,139,240,0.35); color: var(--accent);
  display: grid; place-items: center; font-weight: 600; font-size: 13.5px; font-family: var(--mono);
}
ol.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 1px;
  background: linear-gradient(180deg, var(--border-lit), var(--border));
}

/* ---------------- screenshots — clean bordered frame, no fake window chrome ---------------- */
figure.shot { margin: 30px 0; text-align: center; position: relative; }
figure.shot .frame {
  position: relative; display: inline-block; max-width: 100%;
  border: 1px solid var(--border); border-radius: 14px; padding: 9px;
  background: linear-gradient(180deg, var(--panel2), var(--field));
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.75);
}
figure.shot img {
  max-width: 100%; height: auto; display: block; border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
}
figure.shot figcaption {
  color: var(--ink-faint); font-size: 13px; margin-top: 14px; font-family: var(--mono);
}

/* step-by-step screenshot gallery for a single self-contained flow (e.g. the
   new-game wizard's 3 steps) — same .frame treatment as a single .shot, laid out as
   an evenly-spaced row/grid so the steps read as one sequence. Deliberately scoped to
   flows that really are sequential: an unrelated screen (like the countdown splash
   shown on a later, separate launch) gets its own plain .shot instead, so it doesn't
   visually read as "step 4" of this grid. */
.shot-gallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin: 30px 0; text-align: center;
}
.shot-gallery figure.shot { margin: 0; }
.shot-gallery .frame { display: block; padding: 7px; border-radius: 12px; }
.shot-gallery img { border-radius: 6px; }
.shot-gallery figcaption {
  margin-top: 10px; font-size: 12px; color: var(--ink-faint);
}
@media (max-width: 640px) {
  .shot-gallery { grid-template-columns: 1fr; }
}

kbd {
  font-family: var(--mono); font-size: .82em; background: var(--panel2);
  border: 1px solid var(--border-lit); border-bottom-width: 2px;
  border-radius: 6px; padding: 2px 8px; color: var(--ink);
}

/* command-block: the 5-part launch assembly diagram */
.assembly {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-family: var(--mono); font-size: 13px; margin: 20px 0;
  padding: 18px; background: var(--field); border: 1px solid var(--border); border-radius: 12px;
}
.assembly span {
  padding: 7px 12px; border-radius: 7px; border: 1px solid var(--border-lit);
  background: var(--panel); transition: border-color .15s ease, background .15s ease;
}
.assembly span.cmd { color: var(--accent); border-color: var(--accent-dim); background: rgba(91,139,240,0.10); font-weight: 600; }
.assembly span.arrow { border: none; background: none; padding: 0 2px; color: var(--ink-faint); }

/* on-this-page pill nav */
.pagenav { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--mono); font-size: 12.5px; }
.pagenav a {
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; color: var(--ink-dim);
  transition: border-color .15s ease, color .15s ease;
}
.pagenav a:hover { border-color: var(--accent-dim); color: var(--accent); text-decoration: none; }

/* ---------------- page hero (usage / extensions) ---------------- */
.page-hero h1 {
  margin-top: 44px; font-family: var(--mono); font-size: 34px; letter-spacing: -0.02em;
}
.page-hero .tag { color: var(--ink-dim); max-width: 640px; font-size: 17px; }

@media (max-width: 860px) {
  .hero { padding: 70px 20px 20px; }
}

@media (max-width: 620px) {
  .hero h1 { font-size: 38px; }
  .hero .tag { font-size: 16.5px; }
  .nav-brand span.name { display: none; }
  footer { flex-direction: column; }
}
