/* ==========================================================================
   Sunny Go Support: the site-wide stylesheet
   --------------------------------------------------------------------------
   The look is taken from Sunny's own mascot art: an indigo night, a gold sun
   with hard rays, a lacquer-red hull and woodblock-print waves. So the site is
   built like a Japanese print crossed with a sea chart:

   * Colour   indigo night, washi paper, sun gold, lacquer red, and nothing else.
   * Type     Fraunces (a soft, slightly "wonky" display serif) for headlines,
              Instrument Sans for reading, JetBrains Mono for commands and the
              small chart-style labels in the margins.
   * Texture  a faint paper grain over every page, seigaiha (the overlapping
              wave-scale pattern) as ornament, and hard offset shadows, like an
              ink block printed slightly out of register, instead of soft blurs.
   * Motion   transform and opacity only, gated on prefers-reduced-motion, and
              never required to read anything: with JavaScript or motion off,
              every element is simply in its final place.

   Order: fonts > tokens > base > layout pieces (header, footer, buttons) >
   page sections > pages > motion. Dashboard and admin have their own sheets
   that build on these tokens.
   ========================================================================== */

/* --- Fonts ----------------------------------------------------------------
   Self-hosted variable fonts (OFL, licences beside them), so there is no
   third-party request and one file covers every weight. font-display: swap
   shows text straight away in the fallback, then swaps in. */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/fraunces-latin-full-normal.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 100 900; font-display: swap; src: url("../fonts/fraunces-latin-full-italic.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-stretch: 75% 100%; font-display: swap; src: url("../fonts/instrument-sans-latin-standard-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); }

/* --- Tokens ---------------------------------------------------------------
   Every colour on the public site comes from here. The night shades are the
   mascot's background, deepened so gold text on them passes WCAG AA with room
   to spare; the paper shades are warm so the gold reads as sunlight, not
   yellow. --ink and --muted on --paper are 13:1 and 6:1. */
:root {
  --night: #0a1730;
  --night-2: #0f2142;
  --night-3: #18305c;
  --paper: #f4ead3;
  --paper-2: #eadcba;
  --paper-3: #dfcb9f;
  --foam: #fbf6ea;
  --ink: #1b2133;
  --muted: #5c584e;
  --sun: #f6b930;
  --sun-soft: #ffd77a;
  --ember: #e4772c;
  --lacquer: #b5322a;
  --lacquer-deep: #8d2620;
  --sea: #2d64ab;
  --sea-soft: #8db5e6;
  --on-night: #f6eedb;
  --on-night-muted: #b5bfd0;
  --rule: rgba(27, 33, 51, 0.16);
  --rule-night: rgba(246, 238, 219, 0.14);

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Spacing follows the page width, so phones get tight gutters and big screens breathe. */
  --gutter: clamp(16px, 4vw, 56px);
  --section: clamp(72px, 11vw, 160px);
  --max: 1240px;
  --header-h: 76px;

  /* The hard "print" shadow used on buttons, plates and posters. */
  --print: 5px 5px 0 var(--ink);

  /* One easing for everything that moves: quick out of the gate, long gentle landing. */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: light;
  scrollbar-color: var(--sun) var(--night);
}

/* --- Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--body);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
/* clip (not hidden): stops a tilted band or a wide decoration from widening the page on a phone,
   without making main a scroll container, so sticky elements inside it still stick. */
main { flex: 1; overflow-x: clip; }
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; }
::selection { background: var(--sun); color: var(--night); }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 4px; border-radius: 2px; }
code, kbd { font-family: var(--mono); font-size: 0.86em; }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 560;
  /* opsz: the large optical size is drawn with tighter spacing and finer hairlines for headlines.
     SOFT rounds the serifs a little, which is what makes Fraunces feel friendly, not stiff. */
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 0;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-wrap: balance;
}
h3 { font-variation-settings: "opsz" 48, "SOFT" 50; letter-spacing: -0.01em; line-height: 1.15; }
/* Italic headline words switch WONK on: Fraunces' leaning, hand-cut italic forms. */
h1 em, h2 em, .display em { font-style: italic; font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1; }
p { text-wrap: pretty; max-width: 66ch; }

.container { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 10px 18px; background: var(--sun); color: var(--night); font-weight: 600; }
.skip-link:focus { top: 12px; }

/* The paper grain: a tiny SVG noise tile laid over the whole page, multiplied so it darkens
   paper like real fibre and almost vanishes on the night sections. It's fixed, so it costs one
   composited layer and doesn't repaint on scroll; pointer-events: none keeps it out of the way. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: multiply;
  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='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .26 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Small mono caps used as chart-style labels ("N°01 · Bounties"). */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.kicker::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: 0.6; }

/* Seigaiha, the overlapping wave-scale pattern. Each tile holds one full set of rings and two
   halves, which overlap the next row like fish scales. Used as a quiet texture on dark bands. */
.seigaiha, .page-head::before, .deck::before, .site-footer::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='28' viewBox='0 0 56 28'%3E%3Cg fill='none' stroke='%23f6eedb' stroke-width='1'%3E%3Cg id='s'%3E%3Ccircle cx='28' cy='28' r='26'/%3E%3Ccircle cx='28' cy='28' r='19.5'/%3E%3Ccircle cx='28' cy='28' r='13'/%3E%3Ccircle cx='28' cy='28' r='6.5'/%3E%3C/g%3E%3Cuse href='%23s' x='-28' y='-14'/%3E%3Cuse href='%23s' x='28' y='-14'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 28px;
}

/* --- Buttons ---------------------------------------------------------------
   Printed blocks: flat colour, an ink outline and a hard offset shadow. On
   hover the block lifts towards the light (shadow grows), and on press it is
   pushed flat into the page (shadow gone), which reads as a physical stamp. */
.btn {
  --btn-bg: var(--sun);
  --btn-fg: var(--night);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 24px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  box-shadow: 4px 4px 0 var(--ink);
  font: 600 15px/1 var(--body);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.2s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); transition-duration: 0.06s; }
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translate(3px, -3px); }
/* On the night background the outline and shadow switch to the paper colour so they still show. */
.on-night .btn, .btn-on-night { border-color: var(--night); box-shadow: 4px 4px 0 var(--sun-soft); }
.on-night .btn:hover, .btn-on-night:hover { box-shadow: 6px 6px 0 var(--sun-soft); }
.on-night .btn:active { box-shadow: 0 0 0 var(--sun-soft); }
.btn-ghost { --btn-bg: transparent; --btn-fg: currentColor; border-color: currentColor; box-shadow: none; }
.btn-ghost:hover { box-shadow: none; transform: none; background: rgba(246, 238, 219, 0.08); }
.btn-small { min-height: 42px; padding: 10px 18px; font-size: 14px; }
button.btn { font-family: var(--body); }

/* A text link with a line that draws itself in from the left on hover. */
.link {
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  transition: background-size 0.35s var(--ease);
  padding-bottom: 2px;
}
.link:hover { background-size: 100% 1.5px; }

/* --- Header ----------------------------------------------------------------
   Always night-coloured, because every page starts with a night section, so
   the header melts into it. Once the page scrolls, site.js adds .is-stuck and
   the header shrinks a little and gains a hairline, so it reads as a bar
   floating over paper. view-transition-name keeps it perfectly still while
   the rest of the page cross-fades between pages. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--on-night);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
  view-transition-name: site-header;
}
/* The frosted glass is painted by a layer behind the header's content, not by the header itself.
   A backdrop-filter on the header would make it the containing block for position: fixed
   children, and the phone menu sheet (fixed, "the rest of the screen") then shrank to the
   header's own 64px height, showing only a sliver of the first link. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--night) 92%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  transition: background-color 0.3s;
}
.site-header.is-stuck { border-bottom-color: var(--rule-night); }
.site-header.is-stuck::before { background: color-mix(in srgb, var(--night) 97%, transparent); }
/* Fixed height on purpose: a sticky header that changes height pushes everything below it, so
   the page would jump as soon as you scroll. Scrolled state only changes colour and border. */
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; text-decoration: none; }
.brand img { width: 42px; height: 42px; border-radius: 50%; box-shadow: 0 0 0 2px var(--sun); transition: transform 0.6s var(--ease); }
.brand:hover img { transform: rotate(-14deg) scale(1.05); }
.brand-name { display: grid; line-height: 1; }
.brand-name b { font: 600 25px/1 var(--display); font-variation-settings: "opsz" 72, "SOFT" 100, "WONK" 1; letter-spacing: -0.02em; }
.brand-name small { white-space: nowrap; margin-top: 4px; font: 500 9.5px/1 var(--mono); letter-spacing: 0.24em; color: var(--sun-soft); }

.site-nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); }
.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); margin: 0; padding: 0; list-style: none; }
.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  color: var(--on-night-muted);
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current=page] { color: var(--on-night); }
/* The current page gets a small sun under it; hovering others draws a thin line. */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 100%;
  height: 1.5px;
  background: var(--sun);
  transform: translateX(-50%) scaleX(0);
  transition: transform 0.35s var(--ease);
}
.nav-links a:hover::after { transform: translateX(-50%) scaleX(1); }
.nav-links a[aria-current=page]::after { width: 6px; height: 6px; border-radius: 50%; bottom: 0; transform: translateX(-50%) scale(1); }
.nav-ext { font-size: 0.8em; opacity: 0.7; }

/* The phone menu button. Hidden unless JavaScript is running (html.js), because without
   JavaScript the links simply wrap under the logo and stay usable. */
.menu-btn { display: none; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: inherit; font: 600 14px var(--body); cursor: pointer; }
.menu-btn-lines { position: relative; width: 22px; height: 10px; }
.menu-btn-lines::before, .menu-btn-lines::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform 0.35s var(--ease), top 0.35s var(--ease); }
.menu-btn-lines::before { top: 0; }
.menu-btn-lines::after { top: 8px; }
.menu-btn[aria-expanded=true] .menu-btn-lines::before { top: 4px; transform: rotate(45deg); }
.menu-btn[aria-expanded=true] .menu-btn-lines::after { top: 4px; transform: rotate(-45deg); }

/* --- Footer ----------------------------------------------------------------
   A huge outlined "Sunny" wordmark sits behind the links like a ship's name
   painted on the stern, with a band of seigaiha across the top edge. */
.site-footer { position: relative; overflow: hidden; background: var(--night); color: var(--on-night); padding-top: clamp(64px, 9vw, 120px); }
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto; height: 56px; opacity: 0.08; }
.footer-grid { position: relative; display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 40px; padding-bottom: 56px; }
.footer-grid p { color: var(--on-night-muted); font-size: 15px; margin-top: 16px; max-width: 34ch; }
.footer-col h2 { font: 500 12px/1.4 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--sun-soft); margin-bottom: 14px; }
.footer-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.footer-col a { display: inline-flex; min-height: 36px; align-items: center; color: var(--on-night-muted); text-decoration: none; font-size: 15px; transition: color 0.2s; }
.footer-col a:hover { color: var(--on-night); }
.footer-mark {
  position: relative;
  margin: 0 0 -0.06em;
  font: 600 clamp(6rem, 27vw, 24rem)/0.8 var(--display);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  font-style: italic;
  letter-spacing: -0.05em;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(246, 185, 48, 0.4);
  user-select: none;
  white-space: nowrap;
}
.footer-bottom { position: relative; z-index: 1; background: var(--night); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; padding-block: 22px 28px; border-top: 1px solid var(--rule-night); color: var(--on-night-muted); font-size: 12.5px; }
.footer-bottom p { max-width: 70ch; }
.footer-bottom .coords { font-family: var(--mono); letter-spacing: 0.08em; }

/* --- Page heads ----------------------------------------------------------------
   Every inner page opens with a night band: a mono kicker, a big serif title,
   and seigaiha fading in from the right edge. A torn wave edge at the bottom
   hands over to the paper below. */
.page-head { position: relative; overflow: hidden; background: var(--night); color: var(--on-night); padding-block: clamp(48px, 8vw, 104px) clamp(88px, 11vw, 140px); isolation: isolate; }
.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.09;
  -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 85%);
  mask-image: linear-gradient(100deg, transparent 35%, #000 85%);
}
.page-head .kicker { color: var(--sun-soft); }
.page-head h1 { margin-top: 22px; max-width: 16ch; font-size: clamp(2.7rem, 7.2vw, 6rem); }
.page-head p { margin-top: 24px; max-width: 56ch; color: var(--on-night-muted); font-size: clamp(16px, 1.6vw, 19px); }
.page-head .head-meta { max-width: none; display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 32px; font: 500 13px var(--mono); color: var(--on-night-muted); }
.page-head .head-meta strong { color: var(--sun); font-weight: 600; }
/* The wave edge: an SVG path filled with the paper colour, so it "eats" the bottom of the band. */
.wave-edge { position: absolute; left: 0; right: 0; bottom: -1px; height: clamp(28px, 4vw, 56px); width: 100%; fill: var(--paper); }

.section { padding-block: clamp(48px, 7vw, 96px) var(--section); }

/* A centred message for empty or unavailable states, with Sunny in a gold ring. */
.notice { max-width: 640px; margin-inline: auto; padding-block: 16px; text-align: center; }
.notice img { width: 112px; height: 112px; margin: 0 auto 28px; border-radius: 50%; box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--sun), var(--print); }
.notice h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
.notice p { margin: 18px auto 0; color: var(--muted); }
.notice .btn { margin-top: 30px; }
.notice code { padding: 2px 6px; border-radius: 4px; background: var(--paper-2); }

/* ==========================================================================
   Home page
   ========================================================================== */

/* --- Hero ------------------------------------------------------------------
   Layers, back to front: the night sky; a gold ray burst turning slowly
   behind Sunny; Sunny in a porthole with a ring of text; the headline; and a
   canvas of woodblock-style waves rolling along the bottom (hero.js). Without
   JavaScript the canvas stays empty and a static SVG wave edge shows instead. */
.hero { position: relative; overflow: hidden; isolation: isolate; background: radial-gradient(120% 90% at 78% 20%, var(--night-3) 0%, var(--night-2) 38%, var(--night) 75%); color: var(--on-night); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr); align-items: center; gap: clamp(24px, 4vw, 64px); min-height: min(900px, calc(100svh - var(--header-h))); padding-block: clamp(32px, 4vw, 56px) clamp(130px, 13vw, 200px); }
.hero .kicker { color: var(--sun-soft); }
.hero h1 { margin-top: 24px; font-size: clamp(2.9rem, 5.6vw, 5.8rem); font-weight: 520; line-height: 0.96; letter-spacing: -0.035em; }
/* Each line of the headline is its own block, kept on one line on wide screens so the break
   always falls after "sunshine." rather than wherever the width happens to cut it. */
.hero h1 .line { display: block; white-space: nowrap; }
.hero h1 em { color: var(--sun); font-weight: 480; }
/* The brush-stroke underline under "adventure", drawn in by stroke-dashoffset on load. */
.swash { position: relative; display: inline-block; white-space: nowrap; }
.swash svg { position: absolute; left: -2%; right: -2%; bottom: -0.16em; width: 104%; height: 0.32em; overflow: visible; }
.swash path { fill: none; stroke: var(--lacquer); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; vector-effect: non-scaling-stroke; }
.hero .lead { margin-top: 34px; max-width: 44ch; font-size: clamp(17px, 1.5vw, 20px); color: var(--on-night-muted); }
.hero .lead strong { color: var(--on-night); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 38px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 40px; font: 500 12px/1.4 var(--mono); letter-spacing: 0.06em; color: var(--on-night-muted); }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px rgba(246, 185, 48, 0.18); }
.hero-meta span:first-child::before { animation: pulse 2.4s ease-in-out infinite; }

.hero-art { position: relative; justify-self: center; width: min(100%, 470px); aspect-ratio: 1; }
/* Rays: a repeating conic gradient gives 24 hard-edged wedges, and a radial mask fades them out
   towards the edge, so it reads as a printed sunburst rather than a spinner. */
.hero-rays {
  position: absolute;
  inset: -38%;
  z-index: -1;
  background: repeating-conic-gradient(from 0deg, rgba(246, 185, 48, 0.17) 0deg 6deg, transparent 6deg 15deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
  animation: spin 140s linear infinite;
}
.porthole { position: absolute; inset: 9%; border-radius: 50%; box-shadow: 0 0 0 3px var(--sun), 0 0 0 12px var(--night), 0 0 0 14px rgba(246, 185, 48, 0.5), 0 40px 80px -20px rgba(0, 0, 0, 0.6); overflow: hidden; background: var(--night-2); }
.porthole img { width: 100%; height: 100%; object-fit: cover; }
.ring-text { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 60s linear infinite reverse; }
.ring-text text { font: 500 11.5px var(--mono); letter-spacing: 0.32em; fill: var(--sun-soft); text-transform: uppercase; }
/* hero.js moves these two custom properties with the pointer, for a few pixels of parallax. */
.hero-art { translate: calc(var(--px, 0) * -14px) calc(var(--py, 0) * -10px); transition: translate 0.6s var(--ease); }

.hero-sea { position: absolute; inset: auto 0 0 0; height: clamp(150px, 20vw, 260px); pointer-events: none; }
.hero-sea canvas { width: 100%; height: 100%; }
/* Shown until hero.js draws the first frame, and for good if JavaScript is off. */
.hero-sea .wave-edge { height: 40%; }
.hero-sea.is-live .wave-edge { opacity: 0; transition: opacity 0.6s; }

/* --- Command ribbon ----------------------------------------------------------
   A lacquer-red band of real slash commands scrolling sideways, like a ship's
   name ribbon. The list is printed twice and the track moves by exactly half
   its width, so the loop is seamless. Hover (or focus inside) pauses it. */
.ribbon { position: relative; z-index: 2; overflow: hidden; background: var(--lacquer); color: var(--foam); border-block: 2px solid var(--ink); transform: rotate(-1.2deg); margin-block: -22px -10px; box-shadow: 0 10px 0 -4px rgba(27, 33, 51, 0.18); }
.ribbon-track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.ribbon:hover .ribbon-track, .ribbon:focus-within .ribbon-track { animation-play-state: paused; }
.ribbon-list { display: flex; align-items: center; margin: 0; padding: 0; list-style: none; }
.ribbon-list li { display: inline-flex; align-items: center; gap: 26px; padding: 15px 0 15px 26px; font: 500 15px/1 var(--mono); white-space: nowrap; }
.ribbon-list li::after { content: "✺"; color: var(--sun-soft); font-size: 13px; }
/* The links fill the band's height, so each is a full-size tap target rather than a line of text. */
.ribbon-list li { padding-block: 0; }
.ribbon a { display: inline-flex; align-items: center; min-height: 46px; text-decoration: none; }
.ribbon a:hover { color: var(--sun-soft); }
.ribbon-slash { color: var(--sun-soft); }

/* --- "What's aboard": six feature chapters -------------------------------------
   Each chapter is a two-column spread, text on one side and a printed "plate"
   on the other, alternating sides down the page. The plates are built in HTML
   and CSS (not screenshots), so they stay crisp, are readable by screen
   readers as a description, and can animate when they come into view. */
.aboard { padding-block: var(--section) clamp(40px, 6vw, 80px); }
.aboard-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); align-items: end; gap: 24px 64px; margin-bottom: clamp(56px, 8vw, 110px); }
.aboard-head h2 { font-size: clamp(2.6rem, 6vw, 5.2rem); }
.aboard-head p { color: var(--muted); font-size: 18px; }
.aboard-head .kicker { color: var(--lacquer); grid-column: 1 / -1; }

.chapter { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); align-items: center; gap: clamp(36px, 7vw, 110px); padding-block: clamp(48px, 7vw, 96px); border-top: 1px solid var(--rule); }
.chapter:nth-of-type(even) .chapter-text { order: 2; }
.chapter-num { display: block; font: 300 clamp(4rem, 9vw, 8rem)/0.8 var(--display); font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 1; font-style: italic; color: transparent; -webkit-text-stroke: 1.4px var(--ink); opacity: 0.85; }
.chapter .kicker { margin-top: 26px; color: var(--lacquer); }
.chapter h3 { margin-top: 12px; font-size: clamp(2rem, 3.6vw, 3.2rem); font-weight: 560; letter-spacing: -0.025em; line-height: 1.02; }
.chapter-text > p { margin-top: 20px; color: var(--muted); font-size: 17.5px; }
.chapter-cmds { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; list-style: none; }

/* A slash command written like a key cap: mono, ink outline, paper inside. */
.cmd-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 8px; background: var(--foam); box-shadow: 2px 2px 0 var(--ink); font: 500 13.5px/1 var(--mono); text-decoration: none; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s; }
.cmd-chip::before { content: "/"; color: var(--lacquer); margin-right: 1px; }
a.cmd-chip:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); background: #fff; }

/* The plate: a framed print on slightly darker paper with the hard shadow. */
.plate { position: relative; min-height: 380px; display: grid; place-items: center; padding: clamp(24px, 4vw, 48px); border: 2px solid var(--ink); border-radius: 22px; background: var(--paper-2); box-shadow: 8px 8px 0 var(--ink); overflow: hidden; isolation: isolate; }
.plate::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.5; background-image: radial-gradient(rgba(27, 33, 51, 0.13) 1px, transparent 1.4px); background-size: 14px 14px; }
.plate-night { background: var(--night-2); color: var(--on-night); }
.plate-night::before { background-image: radial-gradient(rgba(246, 238, 219, 0.09) 1px, transparent 1.4px); }
.plate-red { background: var(--lacquer); color: var(--foam); }
.plate-red::before { opacity: 0.4; background-image: radial-gradient(rgba(0, 0, 0, 0.35) 1.5px, transparent 2px); background-size: 12px 12px; }
.plate-caption { position: absolute; left: 18px; bottom: 14px; font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.65; }

/* Plate 1: two real wanted posters pinned to the board, slightly fanned. The front one
   straightens and lifts when the chapter is hovered; the back one peeks out behind it. */
.plate-board { background: #d9c49a; }
.posters { position: relative; width: min(330px, 74%); aspect-ratio: 624 / 889; }
.real-poster { position: absolute; inset: 0; margin: 0; box-shadow: 6px 6px 0 var(--ink); transition: transform 0.7s var(--ease); }
.real-poster img { width: 100%; height: 100%; object-fit: cover; }
/* The pin: a lacquer-red tack at the top of each poster. */
.real-poster::before { content: ""; position: absolute; z-index: 1; top: -8px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #e8665d, var(--lacquer-deep)); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.real-poster-back { transform: translate(34%, 4%) rotate(7deg) scale(0.92); }
.real-poster-front { transform: translate(-16%, 0) rotate(-4deg); }
.chapter:hover .real-poster-front { transform: translate(-18%, -6px) rotate(-1deg); }
.chapter:hover .real-poster-back { transform: translate(38%, 6%) rotate(9deg) scale(0.92); }

/* Plate 2: the real vote poster, held up like a card. --rx/--ry tilt it towards the pointer and
   --mx/--my move a soft gloss across it (site.js); with no pointer it just sits flat. */
.tilt-stage { width: 100%; perspective: 1100px; }
.vote-poster { --rx: 0deg; --ry: 0deg; position: relative; margin: 0; border: 3px solid #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.6), 6px 6px 0 var(--ink); transform: rotateX(var(--rx)) rotateY(var(--ry)) rotate(-1.5deg); transition: transform 0.5s var(--ease); }
.vote-poster img { width: 100%; height: auto; }
.vote-poster::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--mx, 30%) var(--my, 20%), rgba(255, 255, 255, 0.28), transparent 50%); mix-blend-mode: soft-light; }
.chapter:hover .vote-poster { transform: rotateX(var(--rx)) rotateY(var(--ry)) rotate(0deg) scale(1.02); }

/* Plate 3: a rank card with an XP bar that fills when the chapter scrolls into view. */
.rank-card { width: min(420px, 100%); padding: 22px; border-radius: 18px; background: linear-gradient(135deg, #1a2f5a, #0d1a36); color: var(--on-night); box-shadow: 6px 6px 0 var(--ink); border: 2px solid var(--ink); }
.rank-top { display: flex; align-items: center; gap: 16px; }
.rank-top img { width: 64px; height: 64px; border-radius: 50%; box-shadow: 0 0 0 3px var(--sun); }
.rank-top b { display: block; font: 600 1.4rem/1.1 var(--display); }
.rank-top small { font: 500 12px var(--mono); color: var(--on-night-muted); }
.rank-level { margin-left: auto; text-align: right; font: 600 12px var(--mono); color: var(--on-night-muted); letter-spacing: 0.1em; text-transform: uppercase; }
.rank-level b { display: block; font: 600 2.6rem/1 var(--display); color: var(--sun); letter-spacing: -0.02em; }
.xp { margin-top: 20px; }
.xp-bar { height: 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.xp-bar span { display: block; width: var(--fill, 72%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ember), var(--sun)); transform-origin: left; }
.xp-meta { display: flex; justify-content: space-between; margin-top: 8px; font: 500 12px var(--mono); color: var(--on-night-muted); }
.rank-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.rank-stats div { padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); }
.rank-stats dt { font: 500 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-night-muted); }
.rank-stats dd { font: 600 1.1rem var(--display); }
.toast { position: absolute; right: 18px; top: 18px; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--sun); color: var(--night); font: 600 13px var(--body); box-shadow: 3px 3px 0 var(--ink); }

/* Plate 4: the guessing game, with the real Discord messages. The round (blurred picture) is
   shown first; once the chapter is in view the answer is typed, then the real "Correct!"
   message fades in over it. Without motion, both are shown side by side instead. */
.guess { display: grid; justify-items: center; gap: 16px; width: min(400px, 100%); }
.guess-stage { position: relative; display: grid; place-items: center; width: 100%; min-height: 340px; }
.guess-stage img { width: auto; max-height: 340px; border-radius: 10px; box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.7), 5px 5px 0 rgba(0, 0, 0, 0.5); }
.guess-answer { position: absolute; }
.guess-input { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 12px; background: var(--foam); color: var(--ink); font: 500 14px var(--mono); box-shadow: 3px 3px 0 var(--sun); }
.guess-input .slash { color: var(--lacquer); }
.guess-input .typed { overflow: hidden; white-space: nowrap; border-right: 2px solid var(--ink); }

/* Plate 5: a moderation case log with the escalation ladder beside it. */
.caselog { display: grid; gap: 10px; width: min(440px, 100%); margin: 0; padding: 0; list-style: none; }
.caselog li { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--rule-night); border-radius: 12px; background: rgba(255, 255, 255, 0.04); font-size: 14px; }
.caselog .cid { font: 600 12px var(--mono); color: var(--on-night-muted); }
.caselog .why { color: var(--on-night-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { display: inline-flex; padding: 3px 10px; border-radius: 999px; font: 700 12px var(--body); white-space: nowrap; }
.pill-warn { background: rgba(246, 185, 48, 0.18); color: var(--sun-soft); }
.pill-timeout { background: rgba(228, 119, 44, 0.22); color: #ffb37d; }
.pill-ban { background: rgba(181, 50, 42, 0.35); color: #ff9e95; }
.pill-auto { background: rgba(141, 181, 230, 0.2); color: var(--sea-soft); }
.ladder { display: flex; align-items: center; gap: 6px; margin-top: 6px; font: 500 12px var(--mono); color: var(--on-night-muted); }
.ladder span { flex: 1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); }
.ladder span.on { background: var(--sun); }

/* Plate 6: a stats chart whose line draws itself (stroke-dashoffset) when in view. */
.statcard { width: min(460px, 100%); padding: 20px 22px; border: 2px solid var(--ink); border-radius: 18px; background: var(--foam); box-shadow: 6px 6px 0 var(--ink); }
.statcard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.statcard-head b { font: 600 2.4rem/1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.statcard-head span { font: 500 12px var(--mono); color: var(--muted); }
.trend { padding: 3px 9px; border-radius: 999px; background: rgba(47, 138, 79, 0.14); color: #23683c; font: 700 12px var(--body); }
.statcard svg { width: 100%; height: 150px; margin-top: 14px; overflow: visible; }
.chart-line { fill: none; stroke: var(--sea); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-area { fill: url(#chartFill); }
.chart-grid { stroke: var(--rule); stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.statcard-foot { display: flex; justify-content: space-between; margin-top: 8px; font: 500 11px var(--mono); color: var(--muted); }

/* --- The deck: the dashboard pitch, on night ----------------------------------- */
.deck { position: relative; overflow: hidden; isolation: isolate; padding-block: var(--section); background: var(--night); color: var(--on-night); }
.deck::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.06; }
.deck-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; gap: clamp(40px, 7vw, 96px); }
.deck .kicker { color: var(--sun-soft); }
.deck h2 { margin-top: 22px; font-size: clamp(2.5rem, 5.4vw, 4.6rem); }
.deck p { margin-top: 22px; color: var(--on-night-muted); font-size: 18px; }
.deck-list { display: grid; gap: 0; margin: 30px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--rule-night); }
.deck-list li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule-night); color: var(--on-night-muted); font-size: 15.5px; }
.deck-list b { color: var(--on-night); font-weight: 600; }
.deck-list i { font: normal 500 12px/1.9 var(--mono); color: var(--sun); }
.deck .btn { margin-top: 34px; }

/* A miniature of the dashboard, drawn in HTML: window bar, sidebar and tiles. Slightly turned
   in 3D, and it straightens as it scrolls into the middle of the screen (motion section). */
.mini-dash { --tilt: 1; position: relative; border: 1.5px solid var(--rule-night); border-radius: 16px; background: #0b1826; box-shadow: 0 50px 90px -30px rgba(0, 0, 0, 0.8), 10px 10px 0 rgba(246, 185, 48, 0.85); overflow: hidden; transform: perspective(1400px) rotateY(calc(var(--tilt) * -9deg)) rotateX(calc(var(--tilt) * 4deg)); transform-origin: 30% 50%; }
.mini-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-bottom: 1px solid #22405c; background: #0e1f31; }
.mini-bar i { width: 9px; height: 9px; border-radius: 50%; background: #2a4561; }
.mini-bar span { margin-left: 12px; font: 500 11px var(--mono); color: #7f97ad; }
.mini-body { display: grid; grid-template-columns: 150px 1fr; min-height: 330px; }
.mini-side { display: grid; align-content: start; gap: 4px; padding: 14px 10px; border-right: 1px solid #22405c; background: #0e1f31; }
.mini-side b { margin: 0 6px 10px; font-size: 13px; }
.mini-side span { display: block; padding: 6px 8px; border-radius: 6px; color: #9fb3c6; font-size: 12px; }
.mini-side span.on { background: #1a344d; color: #fff; box-shadow: inset 3px 0 0 var(--sun); }
.mini-side em { margin: 10px 8px 2px; font: normal 600 9px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: #6d859b; }
.mini-main { padding: 18px; display: grid; gap: 12px; align-content: start; }
.mini-main h4 { margin: 0; font: 600 1.25rem var(--display); }
.mini-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-tiles div { padding: 10px; border: 1px solid #22405c; border-radius: 9px; background: #132a40; }
.mini-tiles small { display: block; font-size: 10px; color: #9fb3c6; }
.mini-tiles b { font-size: 1.2rem; }
.mini-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini-cards div { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid #22405c; border-radius: 9px; background: #132a40; font-size: 12px; }
.mini-cards i { width: 22px; height: 22px; border-radius: 50%; background: #1a344d; box-shadow: inset 0 0 0 6px #1a344d, inset 0 0 0 20px var(--sun); flex: none; opacity: 0.85; }
.mini-cards em { margin-left: auto; padding: 1px 7px; border-radius: 999px; font: normal 700 10px var(--body); background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.mini-cards em.off { background: rgba(255, 255, 255, 0.07); color: #9fb3c6; }

/* --- Boarding call --------------------------------------------------------------- */
.boarding { padding-block: var(--section) 0; }
.boarding-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px 56px; padding: clamp(32px, 6vw, 80px); border: 2px solid var(--ink); border-radius: 28px; background: var(--sun); box-shadow: 10px 10px 0 var(--ink); overflow: hidden; isolation: isolate; }
/* A slow-turning ray burst in the card's corner, as a quieter echo of the hero. */
.boarding-card::before { content: ""; position: absolute; right: -240px; top: -240px; width: 600px; height: 600px; z-index: -1; background: repeating-conic-gradient(rgba(228, 119, 44, 0.35) 0 6deg, transparent 6deg 15deg); -webkit-mask-image: radial-gradient(closest-side, #000, transparent); mask-image: radial-gradient(closest-side, #000, transparent); animation: spin 120s linear infinite; }
.boarding-card h2 { font-size: clamp(2.4rem, 5.6vw, 4.8rem); color: var(--night); }
.boarding-card p { margin-top: 18px; max-width: 48ch; font-size: 18px; color: #3b2a10; }
.boarding-card .btn { --btn-bg: var(--night); --btn-fg: var(--on-night); }

/* --- FAQ ----------------------------------------------------------------------------
   Native <details>, so it works with no JavaScript. The plus turns into a minus by
   rotating its vertical stroke away, and the answer slides open where the browser
   supports animating to height: auto (interpolate-size). */
.faq { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 40px clamp(40px, 8vw, 120px); padding-block: var(--section); }
.faq h2 { font-size: clamp(2.4rem, 5vw, 4rem); }
.faq .kicker { color: var(--lacquer); margin-bottom: 20px; }
.faq-list { border-top: 1.5px solid var(--ink); }
.faq details { border-bottom: 1.5px solid var(--ink); }
.faq summary { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; padding: 18px 0; list-style: none; cursor: pointer; font: 560 clamp(1.2rem, 2vw, 1.5rem)/1.2 var(--display); font-variation-settings: "opsz" 48, "SOFT" 50; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 34px; height: 34px; border: 1.5px solid var(--ink); border-radius: 50%; background: linear-gradient(var(--ink), var(--ink)) center / 12px 1.5px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 1.5px 12px no-repeat; transition: transform 0.4s var(--ease), background-color 0.2s; }
.faq details[open] summary::after { transform: rotate(135deg); background-color: var(--sun); }
.faq details p { padding: 0 60px 24px 0; color: var(--muted); }
.faq details a { font-weight: 600; }

/* ==========================================================================
   Commands page
   ========================================================================== */
.cmd-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
/* The module index: sticky beside the list, with a count for each module. site.js marks the
   module currently on screen with aria-current, so the index doubles as a "you are here". */
.cmd-index { position: sticky; top: calc(var(--header-h) + 96px); display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.cmd-index a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 6px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; transition: background-color 0.2s, color 0.2s; }
.cmd-index a:hover { background: var(--paper-2); color: var(--ink); }
.cmd-index a[aria-current=true] { background: var(--ink); color: var(--paper); }
.cmd-index small { font: 500 12px var(--mono); opacity: 0.75; }

/* The search bar sticks under the header while the list scrolls. */
.cmd-tools { position: sticky; top: var(--header-h); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 36px; padding: 14px 0; background: var(--paper); border-bottom: 1.5px solid var(--ink); }
.cmd-search { position: relative; flex: 1 1 280px; }
.cmd-search input { width: 100%; min-height: 54px; padding: 0 56px 0 48px; border: 2px solid var(--ink); border-radius: 14px; background: var(--foam); color: var(--ink); font: 500 16px var(--mono); box-shadow: 3px 3px 0 var(--ink); transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease); }
.cmd-search input:focus { outline: none; transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ember); }
.cmd-search input::placeholder { color: #8b8578; }
/* z-index keeps the magnifier above the input, whose focus transform gives it its own layer. */
.cmd-search svg { position: absolute; z-index: 1; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: translate 0.2s var(--ease); }
.cmd-search input:focus ~ svg { translate: -1px -1px; }
/* The "/" hint steps aside once you're typing, so it doesn't clash with the browser's clear button. */
.cmd-search input:focus ~ kbd, .cmd-search input:not(:placeholder-shown) ~ kbd { opacity: 0; }
.cmd-search kbd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); padding: 3px 9px; border: 1.5px solid var(--rule); border-radius: 6px; color: var(--muted); font-size: 12px; }
.cmd-filter { display: inline-flex; padding: 4px; border: 2px solid var(--ink); border-radius: 999px; background: var(--foam); }
.cmd-filter button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 14px var(--body); cursor: pointer; transition: background-color 0.25s var(--ease), color 0.25s; }
.cmd-filter button[aria-pressed=true] { background: var(--ink); color: var(--paper); }
.cmd-count { font: 500 13px var(--mono); color: var(--muted); }

.cmd-module { padding-bottom: 56px; }
.cmd-module + .cmd-module { padding-top: 20px; }
.cmd-module-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; align-items: baseline; margin-bottom: 22px; }
.cmd-module-head h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); }
.cmd-module-head .num { grid-row: span 2; font: italic 300 clamp(2.6rem, 4vw, 3.4rem)/0.8 var(--display); font-variation-settings: "opsz" 144, "WONK" 1; color: var(--lacquer); }
.cmd-module-head p { color: var(--muted); }
.cmd-family { margin-top: 18px; border: 1.5px solid var(--ink); border-radius: 16px; background: var(--foam); overflow: hidden; }
.cmd-family-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: var(--paper-2); border-bottom: 1.5px solid var(--ink); font: 600 14px var(--mono); }
.cmd-family-head span { font-weight: 500; color: var(--muted); font-size: 12px; }
.cmd-family-head { max-width: none; margin: 0; }
details.cmd-family:not([open]) > .cmd-family-head { border-bottom: 0; }
/* A folded group's header is its toggle: a chevron that turns when it opens. */
details.cmd-family > summary { list-style: none; cursor: pointer; }
details.cmd-family > summary::-webkit-details-marker { display: none; }
details.cmd-family > summary span::after { content: "  ›"; display: inline-block; margin-left: 6px; font-size: 16px; transition: transform 0.3s var(--ease); }
details.cmd-family[open] > summary span::after { transform: rotate(90deg); }
details.cmd-family > summary:hover { background: var(--paper-3); }
.cmd-list { margin: 0; padding: 0; list-style: none; }
.cmd-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 18px; padding: 15px 18px; border-top: 1px solid var(--rule); transition: background-color 0.2s; }
.cmd-row:first-child { border-top: 0; }
.cmd-row:hover { background: #fff; }
.cmd-name { justify-self: start; display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.5ch; padding: 0; border: 0; background: none; color: var(--ink); font: 600 15.5px/1.5 var(--mono); text-align: left; cursor: copy; }
.cmd-name::before { content: "/"; margin-right: -0.5ch; color: var(--lacquer); }
.cmd-name .sub { color: var(--sea); }
.cmd-name:hover { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 3px; }
.cmd-desc { grid-column: 1; color: var(--muted); font-size: 15.5px; }
.cmd-opts { grid-column: 1; display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.cmd-opts li { padding: 2px 9px; border: 1px solid var(--rule); border-radius: 6px; font: 500 12.5px/1.6 var(--mono); color: var(--muted); }
.cmd-opts li.req { border-color: var(--ink); color: var(--ink); }
.cmd-opts li.req::after { content: "*"; color: var(--lacquer); }
.cmd-perm { grid-column: 2; grid-row: 1; align-self: start; padding: 4px 10px; border-radius: 999px; background: var(--paper-2); color: var(--ink); font: 600 11.5px var(--body); white-space: nowrap; }
.cmd-perm-everyone { background: rgba(45, 100, 171, 0.12); color: var(--sea); }
.cmd-empty { padding: 64px 0; text-align: center; color: var(--muted); }
.cmd-empty b { display: block; font: 560 2rem var(--display); color: var(--ink); margin-bottom: 8px; }
.cmd-menus { margin-top: 18px; padding: 16px 18px; border: 1.5px dashed var(--ink); border-radius: 16px; font-size: 15px; color: var(--muted); }
.cmd-menus b { color: var(--ink); }
.cmd-note { margin-top: 24px; font-size: 14px; color: var(--muted); }
[hidden] { display: none !important; }

/* The small "Copied" bubble site.js shows after a command name is clicked. */
.copied { position: fixed; z-index: 70; padding: 6px 12px; border-radius: 8px; background: var(--ink); color: var(--paper); font: 600 13px var(--mono); pointer-events: none; transform: translate(-50%, -130%); animation: pop 1.4s var(--ease) forwards; }

/* ==========================================================================
   Leaderboards
   ========================================================================== */
.board-guild { padding-block: 8px clamp(56px, 8vw, 96px); }
.board-guild + .board-guild { padding-top: clamp(56px, 8vw, 96px); border-top: 1.5px solid var(--ink); }
.board-title { display: flex; align-items: center; gap: 18px; font-size: clamp(2rem, 4.4vw, 3.4rem); }
.board-title img { width: 64px; height: 64px; flex: none; border-radius: 50%; box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink), 4px 4px 0 3px var(--ink); }
.board-title span { min-width: 0; overflow-wrap: anywhere; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: 24px; margin-top: 36px; }
.board { position: relative; padding: 22px 22px 18px; border: 2px solid var(--ink); border-radius: 20px; background: var(--foam); box-shadow: 6px 6px 0 var(--ink); }
.board h3 { font-size: 1.6rem; padding-right: 80px; }
/* A small chart-style label in the board's corner ("LEVEL", "BERRIES"), from data-mark. */
.board[data-mark]::before { content: attr(data-mark); position: absolute; right: 22px; top: 30px; font: 500 11px var(--mono); letter-spacing: 0.14em; color: var(--muted); }
.board-list { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: rank; }
.board-list li { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); counter-increment: rank; }
.board-list li::before { content: counter(rank); grid-row: span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font: 600 13px var(--mono); color: var(--muted); }
/* Gold, silver and bronze discs for the top three. */
.board-list li:nth-child(1)::before { background: var(--sun); color: var(--night); box-shadow: 2px 2px 0 var(--ink); }
.board-list li:nth-child(2)::before { background: #d5d3cf; color: var(--night); box-shadow: 2px 2px 0 var(--ink); }
.board-list li:nth-child(3)::before { background: #d9965b; color: var(--night); box-shadow: 2px 2px 0 var(--ink); }
.board-name { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.board-value { font: 500 13px var(--mono); color: var(--muted); }
/* A thin bar under each level row, as long as that member's XP relative to first place. */
.board-meter { grid-column: 2; height: 4px; margin-top: 4px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.board-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--sun)); border-radius: inherit; }
/* Sunny Premium members: a gold-washed row with a crown before the name, on every board. The
   wash sits behind the row's own content, so ranks, meters and values read exactly as before. */
.board-list li.is-premium { margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; background: linear-gradient(90deg, rgba(246, 185, 48, 0.24), rgba(246, 185, 48, 0.06) 70%, transparent); }
.board-list li.is-premium + li { border-top-color: transparent; }
/* The premium crown: an inked SVG (templates/_crown.html), tilted a touch as if set on by hand. */
.board-crown { display: inline-block; margin-right: 6px; vertical-align: -3px; transform: rotate(-10deg); }
.crown-icon { display: block; width: 22px; height: 19px; filter: drop-shadow(1.5px 1.5px 0 rgba(29, 26, 43, 0.85)); }
/* A premium row: a warm gold wash, a gilt rule down its left edge and a slow shine across it. */
.board-list li.is-premium { position: relative; overflow: hidden; box-shadow: inset 3px 0 0 #e0a92a; }
.board-list li.is-premium::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 244, 200, 0.55) 50%, transparent 65%); transform: translateX(-100%); animation: premium-shine 6s ease-in-out 1.2s infinite; pointer-events: none; }
@keyframes premium-shine { 0%, 70% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .board-list li.is-premium::after { animation: none; display: none; } }
.board-empty, .board-note { margin-top: 14px; color: var(--muted); font-size: 14.5px; }
.board-note { margin-top: 48px; font: 500 13px var(--mono); text-align: center; max-width: none; }

/* Bounties: the top three as small wanted posters across the top of the board. */
.board-bounty .board-list li { grid-template-columns: 34px minmax(0, 1fr); }
.wanted-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; padding: 0; list-style: none; }
.wanted { padding: 10px 8px 12px; background: linear-gradient(180deg, #f1dfb4, #e0c486); color: #3b2414; text-align: center; box-shadow: 3px 3px 0 var(--ink), inset 0 0 20px rgba(110, 66, 20, 0.3); transform: rotate(var(--r, 0deg)); transition: transform 0.4s var(--ease); }
.wanted:nth-child(1) { --r: -2deg; }
.wanted:nth-child(2) { --r: 1.5deg; }
.wanted:nth-child(3) { --r: -1deg; }
.wanted:hover { transform: rotate(0) translateY(-3px); }
.wanted b { display: block; font: 800 1rem/1 var(--display); letter-spacing: 0.12em; }
.wanted .who { display: block; margin-top: 8px; font: 700 0.95rem/1.15 var(--display); overflow-wrap: anywhere; }
.wanted .amt { display: block; margin-top: 4px; font: 600 12px var(--mono); }
.wanted .rk { display: block; margin-top: 6px; font: 600 9px var(--mono); letter-spacing: 0.2em; opacity: 0.7; }

/* Anime Battles Hall of Fame: recent battles as two team lists, the winner in gold. */
.hall { margin-top: 36px; }
.hall h3 { font-size: 1.6rem; margin-bottom: 14px; }
.hall-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 18px; }
.hall-card { padding: 16px 18px; border: 2px solid var(--ink); border-radius: 16px; background: var(--night-2); color: var(--on-night); box-shadow: 5px 5px 0 var(--lacquer); }
.hall-meta { font: 500 12px var(--mono); color: var(--on-night-muted); }
.hall-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.hall-side { padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.hall-winner { background: rgba(246, 185, 48, 0.12); box-shadow: inset 0 0 0 1.5px var(--sun); }
.hall-player { font-weight: 600; overflow-wrap: anywhere; }
.hall-player span { display: block; font: 500 12px var(--mono); color: var(--on-night-muted); }
.hall-winner .hall-player { color: var(--sun); }
.hall-side ul { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.hall-side li { display: flex; align-items: baseline; gap: 7px; padding-block: 2px; overflow-wrap: anywhere; }
.rarity { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 4px; font: 800 11px var(--body); color: #120f1c; }
.rarity-legendary { background: #ffc428; }
.rarity-epic { background: #b05cff; color: #fff; }
.rarity-rare { background: #409cff; }
.rarity-common { background: #d4d4da; }

/* ==========================================================================
   Legal pages (Terms, Privacy)
   A reading layout: a sticky contents list built by site.js from the h2s, a
   measure of about 68 characters, and a reading-progress line under the header.
   ========================================================================== */
/* The contents column is there from the first paint, so the text never shifts sideways when
   site.js fills the list in; its label stays invisible until there is a list to label. */
.legal-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.legal-toc:not(:has(li)) { visibility: hidden; }
.legal-toc { position: sticky; top: calc(var(--header-h) + 32px); font-size: 14px; }
.legal-toc p { font: 500 12px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.legal-toc ol { margin: 0; padding: 0; list-style: none; border-left: 1.5px solid var(--rule); }
.legal-toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1.5px; border-left: 1.5px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; transition: color 0.2s, border-color 0.2s; }
.legal-toc a:hover { color: var(--ink); }
.legal-toc a[aria-current=true] { color: var(--ink); border-left-color: var(--lacquer); font-weight: 600; }
.legal { max-width: 68ch; font-size: 17.5px; }
.legal > p:first-child { font-size: 1.25rem; line-height: 1.55; color: var(--ink); }
.legal h2 { margin-top: 56px; padding-top: 20px; border-top: 1.5px solid var(--ink); font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.legal h3 { margin-top: 28px; font-size: 1.25rem; }
.legal p, .legal ul, .legal ol, .legal table { margin-top: 14px; }
.legal p, .legal li { color: #3a3a40; }
.legal ul { padding-left: 22px; }
.legal li::marker { color: var(--lacquer); }
.legal li + li { margin-top: 8px; }
.legal a { font-weight: 600; text-decoration-color: var(--sun); text-decoration-thickness: 2px; }
.legal a:hover { color: var(--lacquer); }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; }
.legal th, .legal td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.reading-line { position: fixed; left: 0; right: 0; top: 0; z-index: 55; height: 3px; background: var(--sun); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }

/* ==========================================================================
   Dashboard sign-in page (/dashboard when signed out). It uses the public
   frame, so its styles live here rather than in dashboard.css.
   ========================================================================== */
.signin-head { padding-bottom: clamp(110px, 12vw, 160px); }
.signin-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); align-items: center; gap: 48px; }
.signin-head .btn { margin-top: 34px; }
.signin-small { font-size: 14px !important; margin-top: 26px !important; }
.signin-small a { color: var(--sun-soft); }
.signin-art { width: 100%; max-width: 340px; justify-self: center; border-radius: 50%; box-shadow: 0 0 0 3px var(--sun), 0 0 0 12px var(--night), 0 0 0 14px rgba(246, 185, 48, 0.5); }
@media (max-width: 860px) { .signin-grid { grid-template-columns: 1fr; } .signin-art { display: none; } }


/* --- Reading aids panel -----------------------------------------------------------------
   The "Aa" button in the header (templates/_header.html) opens this panel, a native popover, so
   the browser gives it Escape and tap-outside closing for free. It looks like a small printed
   card pinned under the header: paper, an ink outline and the hard print shadow. The button is
   hidden without JavaScript, because the switches need site.js to do anything. */
.aids-btn { display: none; order: 3; flex: none; place-items: center; width: 44px; height: 44px; padding: 0; border: 1.5px solid var(--rule-night); border-radius: 50%; background: none; color: var(--on-night); font: 600 19px/1 var(--display); cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.aids-btn small { font-size: 0.72em; }
.aids-btn:hover, .aids-btn:focus-visible { border-color: var(--sun); }
html.js .aids-btn { display: inline-grid; }
.site-nav { order: 2; }
.menu-btn { order: 4; }
.aids-panel {
  /* A popover is fixed and centred by default; this pins it under the header's right edge. */
  inset: calc(var(--header-h) + 8px) var(--gutter) auto auto;
  width: min(360px, 100vw - 2 * var(--gutter));
  max-height: calc(100svh - var(--header-h) - 24px);
  overflow-y: auto;
  margin: 0;
  padding: 18px 18px 14px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--foam);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.aids-panel::backdrop { background: rgba(10, 23, 48, 0.35); }
.aids-title { font: 600 1.35rem/1.1 var(--display); }
.aids-note { margin-top: 4px; color: var(--muted); font-size: 14px; }
.aids-list { margin: 12px 0 0; padding: 0; list-style: none; }
.aids-list li + li { border-top: 1px solid var(--rule); }
.aids-list label { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 8px 0; cursor: pointer; }
.aids-list b { display: block; font-size: 16px; font-weight: 600; }
.aids-list small { display: block; color: var(--muted); font-size: 14px; line-height: 1.35; }
/* A checkbox drawn as a switch (role="switch" tells screen readers it's on/off). */
.aids-list input { appearance: none; position: relative; flex: none; width: 52px; height: 30px; margin: 0; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper-3); cursor: pointer; transition: background-color 0.2s; }
.aids-list input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); transition: transform 0.25s var(--ease); }
.aids-list input:checked { background: var(--night); }
.aids-list input:checked::after { background: var(--sun); transform: translateX(22px); }
.aids-reset { min-height: 44px; margin-top: 6px; padding: 0; border: 0; background: none; color: var(--ink); font: 600 15px var(--body); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* --- Back to top -----------------------------------------------------------------------
   site.js adds this button on long pages (the command list, the legal pages) once the visitor
   is a couple of screens down, which on a phone is a lot of thumb-scrolling to undo. */
.to-top { position: fixed; z-index: 45; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: grid; place-items: center; width: 52px; height: 52px; border: 2px solid var(--ink); border-radius: 50%; background: var(--sun); color: var(--night); box-shadow: 3px 3px 0 var(--ink); font: 700 20px/1 var(--body); text-decoration: none; opacity: 0; transform: translateY(12px); visibility: hidden; transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s 0.25s; }
.to-top.is-shown { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
body.app .to-top { border-color: var(--night); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }

/* ==========================================================================
   Phones and small tablets
   ========================================================================== */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; min-height: 0; text-align: left; padding-bottom: clamp(170px, 30vw, 230px); }
  .hero-art { grid-row: 1; width: min(68vw, 360px); justify-self: start; }
  .aboard-head, .deck-grid, .faq { grid-template-columns: 1fr; }
  .chapter { grid-template-columns: 1fr; }
  .chapter:nth-of-type(even) .chapter-text { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .cmd-layout, .legal-wrap { grid-template-columns: 1fr; }
  .legal-wrap .legal { margin-inline: auto; }
  .boarding-card { grid-template-columns: 1fr; }
  /* The command index becomes a row of module chips that scrolls sideways (site.js keeps the
     current module's chip in view). The fade at the edge hints that there's more to the side. */
  .cmd-index { position: static; display: flex; gap: 8px; margin: -16px calc(var(--gutter) * -1) 0; padding: 4px var(--gutter) 14px; overflow-x: auto; scrollbar-width: none; scroll-padding-inline: var(--gutter); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
  .cmd-index::-webkit-scrollbar { display: none; }
  .cmd-index li { flex: none; }
  .cmd-index a { min-height: 44px; padding: 6px 16px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--foam); color: var(--ink); white-space: nowrap; }
  .cmd-index a:hover { background: #fff; }
  /* The legal pages' contents list sits above the text as a boxed "On this page" list. */
  .legal-toc { position: static; margin-bottom: 8px; padding: 16px 18px 10px; border: 1.5px solid var(--ink); border-radius: 16px; background: var(--foam); }
  .legal-toc:not(:has(li)) { display: none; }
  .legal-toc ol { border-left: 0; }
  .legal-toc a { display: flex; align-items: center; min-height: 44px; padding: 4px 0; margin: 0; border: 0; border-top: 1px solid var(--rule); font-size: 16px; }
  .legal-toc li:first-child a { border-top: 0; }
  .legal-toc a[aria-current=true] { border-left: 0; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  body { font-size: 16px; }
  .brand img { width: 36px; height: 36px; }
  .brand-name b { font-size: 22px; }
  /* With JavaScript: the links fold into a full-screen sheet behind the Menu button. */
  html.js .menu-btn { display: inline-flex; }
  html.js .site-nav { position: fixed; inset: var(--header-h) 0 0 0; z-index: 49; display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 24px var(--gutter) 40px; background: var(--night); visibility: hidden; opacity: 0; transform: translateY(-12px); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0s 0.35s; overflow-y: auto; }
  html.js .site-header.menu-open .site-nav { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  html.js .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  html.js .nav-links a { min-height: 68px; border-bottom: 1px solid var(--rule-night); color: var(--on-night); font: 500 2rem/1 var(--display); font-variation-settings: "opsz" 72, "SOFT" 50; }
  html.js .nav-links a::after { display: none; }
  html.js .site-nav .btn { margin-top: 32px; align-self: flex-start; }
  html.js .menu-open .nav-links li { animation: rise 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + 60ms); }
  /* Without JavaScript: the links wrap onto a second row under the logo. */
  html:not(.js) .header-inner { flex-wrap: wrap; height: auto; padding-block: 12px; }
  html:not(.js) .site-nav, html:not(.js) .nav-links { flex-wrap: wrap; gap: 4px 16px; }

  .hero h1 { font-size: clamp(2.7rem, 12.5vw, 4.4rem); }
  .hero h1 .line { display: inline; white-space: normal; }
  .ribbon-list li { font-size: 13.5px; }
  .ribbon a { min-height: 44px; }
  /* "Explore 235 commands": a taller tap area, with the hover line kept under the text. */
  .hero-actions .link { padding-block: 10px; background-position: 0 calc(100% - 8px); }
  .plate { min-height: 320px; border-radius: 18px; box-shadow: 6px 6px 0 var(--ink); }
  /* Room above the rank card so the "Level up!" toast doesn't sit on its level number. */
  .plate .rank-card { margin-top: 30px; }
  /* Narrower posters on phones, so the fanned pair fits the plate with room for the caption. */
  .plate-board { min-height: 430px; padding-bottom: 44px; }
  .posters { width: 56%; }
  .guess-stage { min-height: 280px; }
  .guess-stage img { max-height: 280px; }
  .toast { top: 14px; right: 14px; }
  .mini-body { grid-template-columns: 1fr; }
  .mini-side { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .faq details p { padding-right: 0; }
  .cmd-tools { top: var(--header-h); margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .cmd-row { grid-template-columns: 1fr; }
  .cmd-perm { grid-column: 1; grid-row: auto; justify-self: start; }
  .cmd-search kbd { display: none; }
  .cmd-search input { padding-right: 16px; }
  /* Command names are tap-to-copy buttons: taller tap area without moving the text. */
  .cmd-name { padding-block: 10px; margin-block: -10px; }
  .cmd-perm { font-size: 13px; }
  .cmd-opts li { font-size: 13.5px; }
  .cmd-family-head span { font-size: 13px; }
  .footer-col a { min-height: 44px; }
  .footer-bottom { font-size: 13.5px; }
  /* Home: chapter command chips and the hero's small labels a size up for small screens. */
  .cmd-chip { min-height: 44px; padding-inline: 14px; font-size: 14.5px; }
  .hero-meta { font-size: 13px; }
  .plate-caption { font-size: 12px; }
  .board-value, .hall-meta, .hall-player span { font-size: 13.5px; }
  .wanted .rk { font-size: 11px; }
  .rarity { width: 20px; height: 20px; font-size: 12px; }
  /* The Aa panel spans the screen on a phone, under the header. */
  .aids-panel { inset: calc(var(--header-h) + 8px) var(--gutter) auto; width: auto; }
  .hall-sides { grid-template-columns: 1fr; }
  .wanted-row { gap: 6px; }
  .board { padding: 18px 16px 14px; }
}

/* ==========================================================================
   Motion
   Everything below is decoration. With prefers-reduced-motion it is all
   switched off and every element is shown in its final state.
   ========================================================================== */
@keyframes spin { to { rotate: 360deg; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(246, 185, 48, 0); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -100%) scale(0.9); } 15%, 75% { opacity: 1; transform: translate(-50%, -140%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -160%); } }
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes typing { from { width: 0; } }
@keyframes caret { 50% { border-color: transparent; } }
@keyframes fill { from { transform: scaleX(0); } }

@media (prefers-reduced-motion: no-preference) {
  /* Scroll reveals. site.js adds .js to <html> and .is-in to each [data-reveal] block as it
     enters the screen. Without JavaScript the start state never applies, so nothing is hidden.
     --d staggers siblings: style="--d:2" waits 2 × 90ms. */
  html.js [data-reveal] { opacity: 0; transform: translateY(34px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
  html.js [data-reveal].is-in { opacity: 1; transform: none; }

  /* The hero's lines rise in one after another on load. */
  .hero [data-enter] { animation: rise 1s var(--ease) both; animation-delay: calc(var(--d, 0) * 110ms + 100ms); }
  .hero-art { animation: rise 1.2s var(--ease) both 0.2s; }
  .swash path { stroke-dashoffset: 1; animation: ink 1.1s var(--ease) 0.9s forwards; }
  @keyframes ink { to { stroke-dashoffset: 0; } }

  /* Plates animate once their chapter is in view. */
  .is-in .xp-bar span { animation: fill 1.6s var(--ease) 0.3s both; }
  .is-in .guess-input .typed { animation: typing 1s steps(12) 0.5s both, caret 0.8s step-end infinite; }
  .guess-answer { opacity: 0; transform: translateY(14px) scale(0.96); transition: opacity 0.6s var(--ease) 1.8s, transform 0.6s var(--ease) 1.8s; }
  /* The end state fans the two messages out, so the blurred round stays readable behind
     the answer instead of just vanishing. */
  .guess-round { transition: opacity 0.6s var(--ease) 1.7s, transform 0.8s var(--ease) 1.7s; }
  .is-in .guess-answer { opacity: 1; transform: translateX(20%) rotate(3deg); }
  .is-in .guess-round { opacity: 0.6; transform: translateX(-24%) rotate(-6deg) scale(0.9); }
  .is-in .chart-line { stroke-dasharray: 1; animation: draw 2s var(--ease) 0.2s both; }
  .is-in .chart-area { animation: rise 1.4s var(--ease) 0.6s both; }

  /* The dashboard miniature straightens as it reaches the middle of the screen. A scroll-driven
     animation (Chrome, Edge, Safari 26), so it costs no JavaScript; elsewhere it just stays
     slightly turned, which looks deliberate. */
  @supports (animation-timeline: view()) {
    .mini-dash { animation: untilt linear both; animation-timeline: view(); animation-range: entry 10% cover 50%; }
    @keyframes untilt { from { --tilt: 1; } to { --tilt: 0; } }

    /* Legal pages: the gold line under the header fills as you read. */
    .reading-line { animation: read linear both; animation-timeline: scroll(root); }
    @keyframes read { to { transform: scaleX(1); } }
  }

  /* Page-to-page cross-fade in browsers with cross-document view transitions. The header has
     its own view-transition-name, so it stays still while the page under it changes. */
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: 0.22s var(--ease) both vt-out; }
  ::view-transition-new(root) { animation: 0.38s var(--ease) both vt-in; }
  @keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
  @keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
}

/* --tilt is animated above; registering it as a number lets the browser interpolate it. */
@property --tilt { syntax: "<number>"; inherits: true; initial-value: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .mini-dash { --tilt: 0; }
  .guess-stage { grid-auto-flow: column; gap: 12px; }
  .guess-stage img { max-height: 300px; max-width: 48%; }
  .guess-answer { position: static; }
}

/* ==========================================================================
   Reading aids
   Classes on <html>, put there before the first paint by the inline script
   in base.html and switched by the "Aa" panel (site.js). They come last so
   they win over everything above, on the public pages and the dashboard.
   ========================================================================== */

/* Larger text. Most sizes on the site are in px (the design is set like print), so rem scaling
   wouldn't reach them; zoom scales every size, gap and icon together, so nothing ends up
   cramped. The layout still fits: widths are fluid, and the phone layout reflows at the zoomed
   size. */
html.aid-text body { zoom: 1.15; }

/* Higher contrast: muted text and hairlines darken (or lighten on night), and the purely
   decorative textures that sit behind text (paper grain, wave patterns, ray bursts) go away. */
html.aid-contrast {
  --muted: #34312a;
  --on-night-muted: #e8ecf3;
  --rule: rgba(27, 33, 51, 0.5);
  --rule-night: rgba(246, 238, 219, 0.5);
}
html.aid-contrast body::after,
html.aid-contrast .page-head::before,
html.aid-contrast .deck::before,
html.aid-contrast .site-footer::before,
html.aid-contrast .plate::before,
html.aid-contrast .hero-rays,
html.aid-contrast .boarding-card::before { display: none; }
html.aid-contrast .legal p, html.aid-contrast .legal li { color: var(--ink); }
html.aid-contrast .cmd-search input::placeholder { color: #4d4940; }
html.aid-contrast .nav-links a { color: var(--on-night); }
html.aid-contrast .dash-app { --d-text: #ffffff; --d-muted: #dfe6f2; --d-line: #5b77a8; }
html.aid-contrast .app-footer { color: #dfe6f2; }
html.aid-contrast :focus-visible { outline-width: 4px; }

/* Stop motion: the same as the system's reduced-motion setting, for people who want it on this
   site only. site.js and hero.js read the class too (no reveals, no count-up, a still sea). */
html.aid-still { scroll-behavior: auto; }
html.aid-still *, html.aid-still *::before, html.aid-still *::after { animation: none !important; transition: none !important; }
html.aid-still [data-reveal] { opacity: 1 !important; transform: none !important; }
html.aid-still::view-transition-group(*), html.aid-still::view-transition-old(*), html.aid-still::view-transition-new(*) { animation: none !important; }
html.aid-still .mini-dash { --tilt: 0; }
html.aid-still .guess-stage { grid-auto-flow: column; gap: 12px; }
html.aid-still .guess-stage img { max-height: 300px; max-width: 48%; }
html.aid-still .guess-answer, html.aid-still .guess-round { position: static; opacity: 1 !important; transform: none !important; }
html.aid-still .swash path { stroke-dashoffset: 0; }

/* Underline links, so what's tappable doesn't depend on colour alone. Buttons and the logo keep
   their own look; they already read as controls. */
html.aid-links a:not(.btn):not(.brand):not(.dash-btn):not(.to-top) { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Plain lettering: one simple sans-serif for headings, labels and command names, without the
   display serif's italics or the wide-spaced mono caps. */
html.aid-plain { --display: "Instrument Sans", ui-sans-serif, system-ui, sans-serif; --mono: "Instrument Sans", ui-sans-serif, system-ui, sans-serif; }
html.aid-plain h1 em, html.aid-plain h2 em, html.aid-plain .display em, html.aid-plain .chapter-num, html.aid-plain .cmd-module-head .num, html.aid-plain .footer-mark { font-style: normal; }
html.aid-plain .kicker, html.aid-plain .footer-col h2, html.aid-plain .brand-name small, html.aid-plain .dash-side-sec > summary, html.aid-plain .dash-tiles dt, html.aid-plain .legal-toc p { letter-spacing: 0.04em; }
html.aid-plain .ring-text { display: none; }

/* Windows High Contrast and other forced-colour modes: keep the custom switches and chips
   visible, since their state is otherwise drawn with background colours the mode removes. */
@media (forced-colors: active) {
  .aids-list input, .dash-switch { border: 2px solid ButtonText; }
  .aids-list input:checked::after, .dash-switch:checked::after { background: Highlight; }
  .cmd-index a[aria-current=true], .dash-side-list a[aria-current=page] { outline: 2px solid Highlight; }
}

/* --- The Anime Battles hall (/battles): one quiet line for this week's featured anime. The
   ladder, picks and battle cards reuse the leaderboards page's .board and .hall styles. --- */
.battles-featured { margin: 0 0 28px; padding: 12px 16px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--foam); }
.battles-featured span { color: var(--muted); }
