/* =============================================================================
   LINEAGE UNIVERSE REBORN — SITE STYLESHEET
   -----------------------------------------------------------------------------
   Single stylesheet, organised into cascade layers. Read in this order:

     tokens      design tokens — colour, type, space, motion. Change here first.
     base        resets, document defaults, typography primitives
     ornament    the fantasy identity: rules, filigree, frames, atmosphere
     components  reusable pieces — buttons, cards, nav, media
     sections    page-level composition blocks
     utilities   small single-purpose helpers (last, so they win)

   Palette is derived from the realm artwork so page and art read as one image:
   obsidian ground, antique gold structure, and the aqua/violet elemental light
   that appears in the Celestial Destiny key art. Elemental colour is only ever
   used as *light* — hairlines, glows, gradients — never as a flat fill.
   ============================================================================= */

@layer tokens, base, ornament, components, sections, utilities;

/* =============================================================================
   TOKENS
   ============================================================================= */
@layer tokens {
  :root {
    /* --- ground ------------------------------------------------------------ */
    --obsidian:      #06080c;
    --abyss:         #080b11;
    --slate-900:     #0b0f16;
    --slate-800:     #10151e;
    --slate-700:     #161d29;
    --slate-600:     #1e2734;
    --steel:         #2b3745;

    /* --- ink --------------------------------------------------------------- */
    --parchment:     #e9e4d7;
    --parchment-dim: #bcb8ae;
    --muted:         #8c939d;
    --muted-deep:    #6b727b;

    /* --- antique gold (matte, never a rainbow gradient) -------------------- */
    --gold:          #c2a26a;
    --gold-light:    #dfc998;
    --gold-deep:     #8b7141;
    --gold-shadow:   #6d5730;

    /* --- elemental light (from the key art) -------------------------------- */
    --aqua:          #6fc9d4;
    --violet:        #9d84d8;
    --ember:         #c98a4a;

    /* --- lines & surfaces -------------------------------------------------- */
    --line:          rgba(194, 162, 106, .16);
    --line-strong:   rgba(194, 162, 106, .34);
    --line-cool:     rgba(150, 175, 200, .10);
    --surface:       linear-gradient(160deg, #141b26 0%, #0b1018 66%);
    --surface-flat:  #0d121b;
    /* crafted-plate edge: a hairline of light along the top of a panel */
    --plate-edge:    inset 0 1px 0 rgba(214, 228, 245, .07);

    /* --- depth ------------------------------------------------------------- */
    --shadow-sm:     0 2px 10px rgba(0, 0, 0, .35);
    --shadow-md:     0 18px 44px rgba(0, 0, 0, .42);
    --shadow-lg:     0 34px 90px rgba(0, 0, 0, .55);
    --glow-gold:     0 0 34px rgba(194, 162, 106, .16);

    /* --- type -------------------------------------------------------------- */
    --display: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif;
    --body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono:    ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;

    --fs-display: clamp(2.9rem, 1.30rem + 5.10vw, 5.60rem);
    --fs-h1:      clamp(2.4rem, 1.32rem + 3.45vw, 4.20rem);
    --fs-h2:      clamp(1.9rem, 1.28rem + 1.98vw, 3.00rem);
    --fs-h3:      clamp(1.15rem, 1.04rem + 0.35vw, 1.35rem);
    --fs-lead:    clamp(1.02rem, 0.96rem + 0.20vw, 1.16rem);
    --fs-body:    1rem;
    --fs-sm:      .905rem;
    --fs-xs:      .80rem;
    --fs-label:   .705rem;

    --tracking-label: .215em;
    --tracking-wide:  .34em;

    /* --- space (4px base) --------------------------------------------------- */
    --s-1: .25rem;  --s-2: .5rem;   --s-3: .75rem;  --s-4: 1rem;
    --s-5: 1.5rem;  --s-6: 2rem;    --s-7: 2.75rem; --s-8: 3.5rem;
    --s-9: 5rem;    --s-10: 7rem;
    --section-y: clamp(4.5rem, 3.0rem + 6.2vw, 8.5rem);
    --gutter:    clamp(1.25rem, .55rem + 2.2vw, 2.5rem);
    --measure:   66ch;

    /* --- motion ------------------------------------------------------------- */
    --ease:      cubic-bezier(.22, .61, .36, 1);
    --ease-out:  cubic-bezier(.16, 1, .3, 1);
    --dur-fast:  .18s;
    --dur:       .32s;
    --dur-slow:  .7s;

    --header-h:  84px;
    --header-h-compact: 64px;

    color-scheme: dark;
  }

  @media (max-width: 900px) {
    :root { --header-h: 62px; --header-h-compact: 62px; }
  }
}

/* =============================================================================
   BASE
   ============================================================================= */
@layer base {
  *, *::before, *::after { box-sizing: border-box; }

  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h-compact) + 1.5rem);
  }

  body {
    margin: 0;
    background: var(--obsidian);
    color: var(--parchment);
    font-family: var(--body);
    font-size: var(--fs-body);
    line-height: 1.68;
    font-synthesis-weight: none;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
  }

  h1, h2, h3, h4 {
    margin: 0 0 var(--s-4);
    font-family: var(--display);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: .015em;
    text-wrap: balance;
  }
  h1 { font-size: var(--fs-h1); }
  h2 { font-size: var(--fs-h2); }
  h3 { font-size: var(--fs-h3); letter-spacing: .04em; }

  p { margin: 0 0 var(--s-4); max-width: var(--measure); }
  p:last-child { margin-bottom: 0; }

  a { color: inherit; text-decoration-color: rgba(194, 162, 106, .45); text-underline-offset: .22em; }
  img, svg, video { display: block; max-width: 100%; }
  img { height: auto; }
  ul, ol { margin: 0; padding: 0; list-style: none; }
  button { font: inherit; color: inherit; }
  strong, b { font-weight: 600; }

  ::selection { background: rgba(194, 162, 106, .28); color: #fff; }

  :focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
    border-radius: 2px;
  }
  :focus:not(:focus-visible) { outline: none; }

  .skip-link {
    position: fixed;
    top: -6rem; left: var(--s-4);
    z-index: 200;
    padding: var(--s-3) var(--s-5);
    background: var(--gold-light);
    color: #0a0a0a;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    text-decoration: none;
    transition: top var(--dur) var(--ease);
  }
  .skip-link:focus { top: var(--s-4); }
}

/* =============================================================================
   ORNAMENT — the fantasy identity layer
   ============================================================================= */
@layer ornament {

  /* --- elemental accent rule ----------------------------------------------
     A short aqua-to-violet hairline above a section's eyebrow. It is the one
     place the chronicle's own two colours appear as themselves, and it gives
     every section head a consistent, recognisable opening mark. */
  .section-head > div > .eyebrow::after,
  .intro-copy > .eyebrow::after,
  .chronicle-copy > .eyebrow::after,
  .race-head > div > .eyebrow::after {
    content: "";
    position: absolute;
    left: 0; top: -.95rem;
    width: 54px; height: 2px;
    background: linear-gradient(90deg, var(--aqua), var(--violet));
    opacity: .8;
  }
  .section-head > div > .eyebrow,
  .intro-copy > .eyebrow,
  .chronicle-copy > .eyebrow,
  .race-head > div > .eyebrow { position: relative; margin-top: .95rem; }

  /* --- eyebrow: small-caps label with a lozenge marker -------------------- */
  .eyebrow {
    display: flex;
    align-items: center;
    gap: .7em;
    margin: 0 0 var(--s-4);
    max-width: none;
    color: var(--gold);
    font-family: var(--body);
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
  }
  .eyebrow::before {
    content: "";
    flex: none;
    width: 5px; height: 5px;
    background: currentColor;
    transform: rotate(45deg);
    opacity: .85;
  }
  .eyebrow--center { justify-content: center; }

  /* --- filigree divider: hairline + lozenge, drawn in pure CSS ------------ */
  .ornament {
    --orn-w: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-4);
    width: min(var(--orn-w), 100%);
    margin-inline: auto;
    color: var(--gold);
  }
  .ornament::before, .ornament::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, currentColor);
    opacity: .42;
  }
  .ornament::after { background: linear-gradient(270deg, transparent, currentColor); }
  .ornament > span {
    flex: none;
    position: relative;
    width: 7px; height: 7px;
    border: 1px solid currentColor;
    transform: rotate(45deg);
    opacity: .8;
  }
  .ornament > span::before {
    content: "";
    position: absolute;
    inset: 2px;
    background: currentColor;
  }
  .ornament--left { margin-inline: 0; margin-bottom: var(--s-4); justify-content: flex-start; }
  /* An ornament immediately above an eyebrow would stack two lozenges; the
     rule carries the mark, so the eyebrow drops its own. */
  .ornament + .eyebrow::before { display: none; }
  .ornament + .eyebrow { gap: 0; }
  .ornament--left::before { display: none; }

  /* --- frame: understated corner brackets --------------------------------- */
  .frame { position: relative; }
  .frame::before, .frame::after {
    content: "";
    position: absolute;
    width: 22px; height: 22px;
    border: 1px solid var(--line-strong);
    pointer-events: none;
  }
  .frame::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
  .frame::after  { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

  /* --- hairline rules ------------------------------------------------------ */
  .rule {
    height: 1px;
    border: 0;
    background: linear-gradient(90deg, transparent, var(--line-strong) 22%, var(--line-strong) 78%, transparent);
  }

  /* --- atmosphere: slow elemental light, hero only ------------------------ */
  .aura {
    position: absolute;
    inset: -20%;
    z-index: 0;
    pointer-events: none;
    background:
      radial-gradient(46% 40% at 16% 42%, rgba(111, 201, 212, .16), transparent 68%),
      radial-gradient(42% 38% at 86% 38%, rgba(157, 132, 216, .16), transparent 68%);
    filter: blur(28px);
    opacity: .85;
    animation: aura-drift 34s var(--ease) infinite alternate;
    will-change: transform;
  }
  @keyframes aura-drift {
    from { transform: translate3d(-1.4%, 0.8%, 0) scale(1); }
    to   { transform: translate3d( 1.4%, -1.0%, 0) scale(1.06); }
  }

  /* --- film grain, very fine, hero only ----------------------------------- */
  .grain {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: .16;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  }

  /* --- scrim helpers ------------------------------------------------------- */
  .scrim-bottom {
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(to top, var(--obsidian) 0, rgba(6, 8, 12, .62) 26%, transparent 62%);
  }
  .scrim-vignette {
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: radial-gradient(78% 70% at 50% 44%, transparent 30%, rgba(6, 8, 12, .58) 82%, rgba(6, 8, 12, .88) 100%);
  }
}

/* =============================================================================
   COMPONENTS
   ============================================================================= */
@layer components {

  /* --- layout primitives ---------------------------------------------------- */
  .container {
    width: min(1220px, 100% - (var(--gutter) * 2));
    margin-inline: auto;
  }
  .container--narrow { width: min(880px, 100% - (var(--gutter) * 2)); }

  /* Grid and flex children default to `min-width: auto`, which lets a wide
     min-content item (a nowrap button, a long digest) push its track — and so
     the whole page — wider than the viewport. Opt every layout child out. */
  .intro-grid > *,
  .feature-split > *,
  .news-editorial > *,
  .download-shell > *,
  .download-band-inner > *,
  .chronicle-facts > *,
  .realm-grid > *,
  .card-grid > *,
  .path > *,
  .class-roster > *,
  .footer-grid > * { min-width: 0; }

  .lead {
    max-width: 60ch;
    color: var(--parchment-dim);
    font-size: var(--fs-lead);
    line-height: 1.62;
  }
  .prose { color: var(--muted); }
  .prose p { max-width: 58ch; }

  /* --- buttons: matte antique metal, no rainbow gradient ------------------- */
  .btn {
    --btn-bg: linear-gradient(178deg, #d3b477 0%, #c2a26a 46%, #a98a53 100%);
    --btn-fg: #100d07;
    --btn-bd: var(--gold-light);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6em;
    min-height: 50px;
    padding: 0 1.7rem;
    border: 1px solid var(--btn-bd);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-family: var(--body);
    font-size: var(--fs-label);
    font-weight: 700;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), var(--shadow-sm);
    transition: transform var(--dur) var(--ease-out),
                box-shadow var(--dur) var(--ease-out),
                filter var(--dur) var(--ease-out),
                border-color var(--dur) var(--ease-out),
                background-color var(--dur) var(--ease-out),
                color var(--dur) var(--ease-out);
  }
  /* inner hairline — reads as an inlaid metal edge */
  .btn::before {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(20, 15, 5, .22);
    pointer-events: none;
  }
  .btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), 0 14px 32px rgba(194, 162, 106, .2);
  }
  .btn:active { transform: translateY(0); filter: brightness(.97); }

  .btn--ghost {
    --btn-bg: rgba(10, 14, 20, .5);
    --btn-fg: var(--parchment);
    --btn-bd: rgba(233, 228, 215, .3);
    box-shadow: none;
    backdrop-filter: blur(10px);
  }
  .btn--ghost::before { border-color: rgba(233, 228, 215, .1); }
  .btn--ghost:hover {
    --btn-bd: var(--gold-light);
    background-color: rgba(194, 162, 106, .1);
    color: var(--gold-light);
    filter: none;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .4);
  }

  .btn--lg { min-height: 58px; padding: 0 2.2rem; font-size: var(--fs-xs); }
  .btn--block { width: 100%; }

  /* --- text link with a sliding underline ---------------------------------- */
  .link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .55em;
    color: var(--gold-light);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    text-decoration: none;
    padding-block: .3em;
  }
  .link > svg { flex: none; transition: transform var(--dur) var(--ease-out); }
  .link:hover > svg { transform: translateX(4px); }
  .link::after {
    content: "";
    position: absolute;
    left: 0; right: 100%; bottom: 0;
    height: 1px;
    background: currentColor;
    opacity: .6;
    transition: right var(--dur) var(--ease-out);
  }
  .link:hover::after { right: 0; }

  /* --- header --------------------------------------------------------------- */
  .site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    height: var(--header-h);
    border-bottom: 1px solid transparent;
    background: linear-gradient(to bottom, rgba(4, 6, 9, .82), rgba(4, 6, 9, .28) 62%, transparent);
    transition: height var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  }
  /* Without JavaScript the scroll listener never runs, so the header would stay
     transparent over scrolled content. Pin it to its solid state instead. */
  html:not(.js) .site-header {
    height: var(--header-h-compact);
    background: rgba(6, 8, 12, .94);
    border-bottom-color: var(--line);
  }
  .site-header.is-compact {
    height: var(--header-h-compact);
    background: rgba(6, 8, 12, .9);
    border-bottom-color: var(--line);
    backdrop-filter: blur(18px) saturate(1.1);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .34);
  }
  .nav-shell {
    height: 100%;
    display: flex;
    align-items: center;
    gap: var(--s-6);
  }

  /* --- brand lockup --------------------------------------------------------- */
  .brand {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    white-space: nowrap;
  }
  .brand svg, .brand img { flex: none; width: 34px; height: 34px; }
  .brand-copy { display: grid; gap: .12rem; }
  .brand-name {
    font-family: var(--display);
    font-size: .885rem;
    font-weight: 600;
    letter-spacing: .155em;
    line-height: 1;
    color: var(--parchment);
  }
  .brand-sub {
    font-size: .565rem;
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    line-height: 1;
    text-transform: uppercase;
    color: var(--gold);
  }

  /* --- primary navigation ---------------------------------------------------- */
  .site-nav {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 1.9vw, 2.1rem);
    margin-left: auto;
  }
  .site-nav a:not(.btn),
  .site-nav .nav-group-toggle {
    position: relative;
    padding-block: .4rem;
    color: var(--parchment-dim);
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: .155em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color var(--dur) var(--ease);
  }
  .site-nav a:not(.btn)::after,
  .site-nav .nav-group-toggle::after {
    content: "";
    position: absolute;
    left: 0; right: 100%; bottom: -.1rem;
    height: 1px;
    background: var(--gold);
    transition: right var(--dur) var(--ease-out);
  }
  .site-nav a:not(.btn):hover,
  .site-nav .nav-group-toggle:hover { color: var(--parchment); }
  .site-nav a:not(.btn):hover::after,
  .site-nav .nav-group-toggle:hover::after,
  .site-nav .nav-group-toggle[aria-expanded="true"]::after,
  .site-nav a:not(.btn)[aria-current="page"]::after { right: 0; }
  .site-nav a:not(.btn)[aria-current="page"] { color: var(--gold-light); }

  .nav-actions { display: flex; align-items: center; gap: var(--s-3); }
  .nav-cta { min-height: 42px; padding: 0 1.25rem; font-size: .66rem; }
  /* CTA that only appears inside the mobile drawer */
  .nav-drawer-cta { display: none; }

  /* --- mobile menu button ---------------------------------------------------- */
  .menu-toggle {
    display: none;
    place-items: center;
    width: 46px; height: 46px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--line);
    background: rgba(10, 14, 20, .7);
    color: var(--parchment);
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
  }
  .menu-toggle:hover { border-color: var(--line-strong); }
  .menu-toggle .bars { display: grid; gap: 5px; width: 20px; }
  .menu-toggle .bars i {
    display: block; height: 1px; background: currentColor;
    transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease);
    transform-origin: center;
  }
  .menu-toggle[aria-expanded="true"] .bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .bars i:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] .bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  /* --- media frame ------------------------------------------------------------ */
  .media {
    position: relative;
    overflow: hidden;
    background: var(--slate-900);
    border: 1px solid var(--line);
  }
  .media img { width: 100%; height: 100%; object-fit: cover; }
  .media--tall { aspect-ratio: 3 / 4; }
  .media--wide { aspect-ratio: 16 / 10; }

  /* --- status pill ------------------------------------------------------------ */
  .status {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-family: var(--display);
    font-size: .9rem;
    color: var(--gold-light);
  }
  .status::before {
    content: "";
    flex: none;
    width: 7px; height: 7px;
    border: 1px solid currentColor;
    background: rgba(223, 201, 152, .3);
    transform: rotate(45deg);
  }
  .status[data-state="online"]  { color: #86c98d; }
  .status[data-state="offline"] { color: #c98686; }
  .status[data-state="checking"],
  .status[data-state="maintenance"],
  .status[data-state="degraded"] { color: var(--gold-light); }

  /* --- reveal-on-scroll --------------------------------------------------------
     Scoped to `.js`, which an inline script in <head> sets. Without JavaScript
     the rule never applies, so every section is visible instead of the page
     rendering as an empty void below the hero. */
  .js .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}

/* =============================================================================
   SECTIONS
   ============================================================================= */
@layer sections {

  .section { position: relative; padding-block: var(--section-y); }
  .section--tight { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }

  /* Two sections on the same ground would otherwise stack their full padding
     and leave a dead band between them. Collapse the join. */
  .section + .section--tight,
  .section--tight + .section--tight { padding-top: 0; }
  .section--soft {
    background:
      radial-gradient(58% 70% at 8% 0%, rgba(111, 201, 212, .055), transparent 70%),
      radial-gradient(58% 70% at 92% 100%, rgba(157, 132, 216, .055), transparent 70%),
      linear-gradient(180deg, var(--obsidian), var(--slate-900) 42%, var(--obsidian));
  }
  .section--soft::before,
  .section--soft::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong) 30%, var(--line-strong) 70%, transparent);
  }
  .section--soft::before { top: 0; }
  .section--soft::after  { bottom: 0; }

  .section-head {
    display: grid;
    gap: var(--s-5);
    margin-bottom: var(--s-8);
  }
  .section-head h2 { margin-bottom: 0; max-width: 18ch; }
  .section-head .lead { max-width: 52ch; }
  @media (min-width: 900px) {
    .section-head--split {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      align-items: end;
      gap: var(--s-7);
    }
    .section-head--split .section-head-aside {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: var(--s-4);
      padding-bottom: .3rem;
    }
  }

  /* ---------------------------------------------------------------------------
     HERO
     --------------------------------------------------------------------------- */
  .hero {
    position: relative;
    min-height: min(100svh, 980px);
    display: grid;
    align-items: center;
    isolation: isolate;
    overflow: hidden;
    background: var(--abyss);
  }
  .hero-media {
    position: absolute;
    inset: -6% 0 0;
    z-index: 0;
    will-change: transform;
  }
  .hero-media img {
    width: 100%; height: 106%;
    object-fit: cover;
    object-position: center 42%;
  }
  .hero-content {
    position: relative;
    z-index: 4;
    width: min(880px, 100% - (var(--gutter) * 2));
    margin-inline: auto;
    padding-block: calc(var(--header-h) + var(--s-8)) var(--s-10);
    text-align: center;
  }
  .hero .ornament { --orn-w: 260px; margin-bottom: var(--s-5); }
  .hero .eyebrow { justify-content: center; color: var(--parchment-dim); }
  .hero .eyebrow::before { color: var(--gold); }

  .hero-title {
    margin-bottom: var(--s-5);
    font-size: var(--fs-display);
    font-weight: 600;
    line-height: .98;
    letter-spacing: .045em;
    text-shadow: 0 4px 42px rgba(0, 0, 0, .8), 0 1px 2px rgba(0, 0, 0, .6);
  }
  .hero-title .reborn {
    display: block;
    margin-top: .28em;
    font-size: .30em;
    font-weight: 400;
    letter-spacing: var(--tracking-wide);
    color: var(--gold-light);
    text-indent: var(--tracking-wide);
  }

  /* chronicle band — rule / name / rule */
  .chronicle-band {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-5);
    margin-bottom: var(--s-6);
  }
  .chronicle-band::before, .chronicle-band::after {
    content: "";
    flex: 1 1 0;
    max-width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold));
    opacity: .55;
  }
  .chronicle-band::after { background: linear-gradient(270deg, transparent, var(--gold)); }
  .chronicle-band span {
    flex: none;
    font-family: var(--display);
    font-size: clamp(.82rem, .68rem + .45vw, 1.05rem);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--parchment);
    text-indent: var(--tracking-wide);
    text-shadow: 0 2px 20px rgba(0, 0, 0, .8);
  }

  .hero-copy {
    max-width: 54ch;
    margin: 0 auto var(--s-7);
    color: #d3d0c8;
    font-size: var(--fs-lead);
    text-shadow: 0 2px 18px rgba(0, 0, 0, .7);
  }
  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--s-4);
  }
  .hero-note {
    margin: var(--s-5) auto 0;
    color: var(--muted);
    font-size: var(--fs-xs);
    letter-spacing: .04em;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .8);
  }
  .hero-note--link { margin-top: var(--s-3); }

  .hero-scroll {
    position: absolute;
    z-index: 4;
    bottom: var(--s-5); left: 50%;
    transform: translateX(-50%);
    display: grid;
    justify-items: center;
    gap: .6rem;
    color: var(--parchment-dim);
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .9);
  }
  .hero-scroll::after {
    content: "";
    width: 1px; height: 42px;
    background: linear-gradient(var(--gold), transparent);
  }

  /* ---------------------------------------------------------------------------
     REALM BAR
     --------------------------------------------------------------------------- */
  .realm-bar {
    position: relative;
    z-index: 5;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, var(--slate-900), var(--obsidian));
  }
  .realm-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .realm-stat {
    display: grid;
    align-content: center;
    gap: .3rem;
    min-height: 104px;
    padding: var(--s-4) var(--s-5);
    border-left: 1px solid var(--line);
  }
  .realm-stat:last-child { border-right: 1px solid var(--line); }
  .realm-stat dt {
    color: var(--muted-deep);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
  }
  .realm-stat dd {
    margin: 0;
    color: var(--parchment);
    font-family: var(--display);
    font-size: .95rem;
    line-height: 1.35;
  }

  /* ---------------------------------------------------------------------------
     INTRO — what this realm is
     --------------------------------------------------------------------------- */
  .intro-grid {
    display: grid;
    gap: var(--s-8);
  }
  @media (min-width: 940px) {
    .intro-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: var(--s-9); align-items: start; }
  }
  .intro-copy h2 { margin-bottom: var(--s-5); }
  .intro-copy .lead { margin-bottom: var(--s-5); }

  /* pillar list — hairline rows, not cards */
  .pillars { display: grid; }
  .pillars li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--s-4) var(--s-5);
    padding: var(--s-5) 0;
    border-top: 1px solid var(--line);
  }
  .pillars li:last-child { border-bottom: 1px solid var(--line); }
  .pillars .pillar-mark {
    color: var(--gold);
    font-family: var(--display);
    font-size: .78rem;
    letter-spacing: .1em;
    padding-top: .35rem;
  }
  .pillars h3 { margin-bottom: .35rem; }
  .pillars p { margin: 0; color: var(--muted); font-size: var(--fs-sm); max-width: 46ch; }

  /* ---------------------------------------------------------------------------
     CHRONICLE SHOWCASE — Celestial Destiny
     --------------------------------------------------------------------------- */
  .chronicle {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-block: 1px solid var(--line);
    background: var(--abyss);
  }
  .chronicle-media { position: absolute; inset: 0; z-index: 0; }
  .chronicle-media img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 46%; }
  .chronicle-media::after {
    content: "";
    position: absolute; inset: 0;
    background:
      linear-gradient(100deg, rgba(6, 8, 12, .96) 0 30%, rgba(6, 8, 12, .74) 52%, rgba(6, 8, 12, .34) 100%),
      linear-gradient(to top, rgba(6, 8, 12, .9), transparent 46%);
  }
  .chronicle-inner {
    position: relative;
    z-index: 2;
    padding-block: clamp(4.5rem, 3rem + 7vw, 9rem);
  }
  .chronicle-copy { max-width: 46rem; }
  .chronicle-copy h2 { margin-bottom: var(--s-5); }
  .chronicle-copy .lead { margin-bottom: var(--s-6); }

  .chronicle-facts {
    display: grid;
    gap: 1px;
    margin-top: var(--s-7);
    background: var(--line);
    border: 1px solid var(--line);
  }
  @media (min-width: 720px) { .chronicle-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .chronicle-facts div {
    display: grid;
    gap: .35rem;
    padding: var(--s-5);
    background: rgba(8, 11, 17, .82);
    backdrop-filter: blur(6px);
  }
  .chronicle-facts dt {
    color: var(--muted-deep);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
  }
  .chronicle-facts dd {
    margin: 0;
    color: var(--parchment);
    font-family: var(--display);
    font-size: 1.02rem;
  }

  /* ---------------------------------------------------------------------------
     FEATURE ROWS — asymmetric, art + hairline list
     --------------------------------------------------------------------------- */
  .feature-split { display: grid; gap: var(--s-8); align-items: center; }
  @media (min-width: 940px) {
    .feature-split { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: var(--s-9); }
    .feature-split--flip .feature-art { order: 2; }
  }
  .feature-art { position: relative; }
  .feature-art .media { aspect-ratio: 4 / 5; }
  .feature-art .media img { transition: transform 1.2s var(--ease-out); }
  .feature-art:hover .media img { transform: scale(1.03); }
  .feature-art::after {
    content: "";
    position: absolute;
    inset: -10px;
    border: 1px solid var(--line);
    pointer-events: none;
  }

  .feature-rows { display: grid; }
  .feature-rows li {
    display: grid;
    grid-template-columns: 3.4rem minmax(0, 1fr);
    gap: var(--s-4);
    padding: var(--s-5) 0;
    border-bottom: 1px solid var(--line);
    transition: border-color var(--dur) var(--ease);
  }
  .feature-rows li:first-child { border-top: 1px solid var(--line); }
  .feature-rows li:hover { border-bottom-color: var(--line-strong); }
  .feature-rows .idx {
    color: var(--gold);
    font-family: var(--display);
    font-size: .8rem;
    letter-spacing: .12em;
    padding-top: .4rem;
  }
  .feature-rows h3 { margin-bottom: .4rem; }
  .feature-rows p { margin: 0; color: var(--muted); font-size: var(--fs-sm); max-width: 48ch; }

  /* ---------------------------------------------------------------------------
     CLASS ROSTER — heraldic sigils
     --------------------------------------------------------------------------- */
  .class-roster {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px;
    border: 1px solid var(--line);
    background: var(--line);
  }
  .class-card {
    position: relative;
    display: grid;
    align-content: end;
    gap: .3rem;
    min-height: 260px;
    padding: var(--s-5);
    background: var(--surface);
    overflow: hidden;
    transition: background var(--dur) var(--ease);
    box-shadow: var(--plate-edge);
  }
  .class-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(70% 52% at 50% 22%, var(--tone, rgba(111, 201, 212, .22)), transparent 72%);
    opacity: .55;
    transition: opacity var(--dur) var(--ease);
  }
  .class-card:hover::before { opacity: 1; }
  .class-sigil {
    position: absolute;
    top: var(--s-6); left: 50%;
    transform: translateX(-50%);
    width: 62px; height: 62px;
    color: var(--gold-light);
    opacity: .78;
    transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur) var(--ease);
  }
  .class-card:hover .class-sigil { transform: translateX(-50%) translateY(-4px); opacity: 1; }
  .class-card h3 { position: relative; margin: 0; color: var(--parchment); font-size: 1.05rem; letter-spacing: .09em; }
  .class-card p { position: relative; margin: 0; color: var(--muted); font-size: var(--fs-xs); letter-spacing: .04em; }

  /* ---------------------------------------------------------------------------
     NEWS — editorial lead + list
     --------------------------------------------------------------------------- */
  .news-editorial { display: grid; gap: var(--s-7); }
  @media (min-width: 940px) {
    .news-editorial { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: var(--s-8); align-items: start; }
  }

  .news-lead { display: grid; text-decoration: none; }
  .news-lead .media { aspect-ratio: 16 / 9; margin-bottom: var(--s-5); }
  .news-lead .media img { transition: transform 1.1s var(--ease-out), filter var(--dur) var(--ease); filter: saturate(.86); }
  .news-lead:hover .media img { transform: scale(1.035); filter: saturate(1); }
  .news-lead:hover .media { border-color: var(--line-strong); }
  .news-lead h3 { font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); margin-bottom: var(--s-3); transition: color var(--dur) var(--ease); }
  .news-lead:hover h3 { color: var(--gold-light); }
  .news-lead p { color: var(--muted); margin-bottom: var(--s-4); }

  .news-meta {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: var(--s-3);
    font-size: .655rem;
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
  }
  .news-meta .cat { color: var(--gold); }
  .news-meta time { color: var(--muted-deep); }
  .news-meta .sep { width: 14px; height: 1px; background: var(--line-strong); }

  .news-list { display: grid; }
  .news-item {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: var(--s-4);
    padding: var(--s-5) 0;
    border-top: 1px solid var(--line);
    text-decoration: none;
    transition: background var(--dur) var(--ease);
  }
  .news-item:last-child { border-bottom: 1px solid var(--line); }
  .news-item:hover { background: rgba(194, 162, 106, .045); }
  .news-item .media { aspect-ratio: 1; border-color: var(--line); }
  .news-item .media img { filter: saturate(.8); transition: filter var(--dur) var(--ease); }
  .news-item:hover .media img { filter: saturate(1); }
  .news-item h3 { margin: 0 0 .3rem; font-size: 1.02rem; line-height: 1.28; transition: color var(--dur) var(--ease); }
  .news-item:hover h3 { color: var(--gold-light); }
  .news-item p { margin: 0; color: var(--muted); font-size: var(--fs-xs); }
  .news-item .news-meta { margin-bottom: .35rem; }

  .news-list-more { margin: 0; padding-top: var(--s-5); }

  /* full news index list */
  .article-list { display: grid; border-top: 1px solid var(--line); }
  .article {
    display: grid;
    gap: var(--s-3) var(--s-7);
    padding: var(--s-7) 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: calc(var(--header-h-compact) + 2rem);
  }
  @media (min-width: 780px) { .article { grid-template-columns: 190px minmax(0, 1fr); } }
  .article .article-when { display: grid; gap: .3rem; align-content: start; padding-top: .3rem; }
  .article time { color: var(--gold); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .1em; }
  .article .cat { color: var(--muted-deep); font-size: .62rem; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; }
  .article h2, .article h3 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.8rem); margin-bottom: var(--s-3); }
  .article p { color: var(--muted); }

  /* ---------------------------------------------------------------------------
     GETTING STARTED — a path, not four cards
     --------------------------------------------------------------------------- */
  .path { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
  @media (min-width: 780px) { .path { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .path-step {
    position: relative;
    display: grid;
    align-content: start;
    gap: var(--s-3);
    padding: var(--s-6) var(--s-5) var(--s-7);
    background: var(--surface);
    box-shadow: var(--plate-edge);
  }
  .path-step .step-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    margin-bottom: var(--s-4);
    border: 1px solid var(--line-strong);
    color: var(--gold-light);
    font-family: var(--display);
    font-size: .82rem;
    transform: rotate(45deg);
  }
  .path-step .step-no span { transform: rotate(-45deg); }
  .path-step h3 { margin: 0; }
  .path-step p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }

  /* ---------------------------------------------------------------------------
     DOWNLOAD
     --------------------------------------------------------------------------- */
  .download-band {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: var(--surface-flat);
    box-shadow: var(--shadow-md);
  }
  .download-band .band-art { position: absolute; inset: 0; z-index: 0; }
  .download-band .band-art img { width: 100%; height: 100%; object-fit: cover; object-position: 64% 34%; }
  .download-band .band-art::after {
    content: "";
    position: absolute; inset: 0;
    background:
      linear-gradient(96deg, rgba(7, 10, 15, .96) 0 34%, rgba(7, 10, 15, .78) 56%, rgba(7, 10, 15, .42) 100%),
      linear-gradient(to top, rgba(7, 10, 15, .7), transparent 55%);
  }
  .download-band-inner {
    position: relative;
    z-index: 2;
    display: grid;
    gap: var(--s-7);
    padding: clamp(2rem, 1.2rem + 3.4vw, 4rem);
  }
  @media (min-width: 900px) {
    .download-band-inner { grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); align-items: center; gap: var(--s-9); }
  }
  .download-band h2 { margin-bottom: var(--s-4); }
  .download-facts { display: grid; gap: .55rem; margin-top: var(--s-5); }
  .download-facts li {
    display: flex; align-items: baseline; gap: var(--s-4);
    color: var(--parchment-dim); font-size: var(--fs-sm);
  }
  .download-facts .k {
    flex: none; min-width: 6.5rem;
    color: var(--muted-deep); font-size: .62rem; font-weight: 600;
    letter-spacing: var(--tracking-label); text-transform: uppercase;
  }

  .download-shell { display: grid; gap: var(--s-6); align-items: stretch; }
  @media (min-width: 940px) { .download-shell { grid-template-columns: minmax(0, 1.4fr) minmax(300px, .7fr); gap: var(--s-7); } }

  .download-card {
    padding: clamp(1.75rem, 1.1rem + 2.6vw, 3rem);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    box-shadow: var(--plate-edge), var(--shadow-md);
  }
  .download-card h2 { margin-bottom: var(--s-4); }
  .download-card .lead { margin-bottom: var(--s-6); }
  .download-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); margin-bottom: var(--s-6); }
  .download-hint { color: var(--muted); font-size: var(--fs-xs); }

  .trust-list { display: grid; }
  .trust-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--s-4);
    padding: var(--s-4) 0;
    border-top: 1px solid var(--line);
    color: var(--parchment-dim);
    font-size: var(--fs-sm);
  }
  .trust-list li::before {
    content: "";
    width: 6px; height: 6px;
    margin-top: .62em;
    border: 1px solid var(--gold);
    background: rgba(194, 162, 106, .35);
    transform: rotate(45deg);
  }

  .detail-panel {
    display: flex;
    flex-direction: column;
    padding: var(--s-6);
    border: 1px solid var(--line);
    background: var(--surface-flat);
    box-shadow: var(--plate-edge);
  }
  .detail-panel > .eyebrow { margin-bottom: var(--s-5); }
  /* Push the verification disclosure to the foot of the panel so the panel
     fills the row rather than leaving a void beside a taller card. */
  .detail-panel > .verify { margin-top: auto; }
  .detail-list { display: grid; }
  .detail-list div {
    display: grid; gap: .25rem;
    padding: var(--s-4) 0;
    border-top: 1px solid var(--line);
  }
  .detail-list div:first-child { border-top: 0; padding-top: 0; }
  .detail-list dt {
    color: var(--muted-deep); font-size: .62rem; font-weight: 600;
    letter-spacing: var(--tracking-label); text-transform: uppercase;
  }
  .detail-list dd { margin: 0; color: var(--parchment-dim); font-size: var(--fs-sm); overflow-wrap: anywhere; }

  .verify {
    margin-top: var(--s-5);
    border-top: 1px solid var(--line);
    padding-top: var(--s-4);
  }
  .verify > summary {
    cursor: pointer;
    color: var(--gold-light);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    list-style: none;
    display: flex; align-items: center; gap: .55rem;
  }
  .verify > summary::-webkit-details-marker { display: none; }
  .verify > summary::before {
    content: "";
    width: 6px; height: 6px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(-45deg);
    transition: transform var(--dur) var(--ease);
  }
  .verify[open] > summary::before { transform: rotate(45deg); }
  .verify-body { padding-top: var(--s-4); }
  .verify-body p { color: var(--muted); font-size: var(--fs-xs); }
  .hash {
    display: block;
    max-width: 100%;
    margin-top: .5rem;
    padding: .7rem .85rem;
    border: 1px solid var(--line);
    background: rgba(4, 6, 9, .7);
    color: var(--parchment-dim);
    font-family: var(--mono);
    font-size: .72rem;
    line-height: 1.55;
    /* A 64-character digest has no break opportunities of its own, so it must
       be told it may break anywhere or it will push the layout wider than the
       viewport on a 360px phone. */
    overflow-wrap: anywhere;
    word-break: break-all;
  }

  /* ---------------------------------------------------------------------------
     PAGE HERO (interior pages)
     --------------------------------------------------------------------------- */
  .page-hero {
    position: relative;
    display: grid;
    align-items: end;
    min-height: clamp(380px, 46vh, 560px);
    isolation: isolate;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: var(--abyss);
  }
  .page-hero-media { position: absolute; inset: 0; z-index: 0; }
  .page-hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 44%; }
  .page-hero-media::after {
    content: "";
    position: absolute; inset: 0;
    background:
      linear-gradient(to top, var(--obsidian) 0, rgba(6, 8, 12, .58) 46%, rgba(6, 8, 12, .5)),
      linear-gradient(100deg, rgba(6, 8, 12, .88), rgba(6, 8, 12, .2) 72%);
  }
  .page-hero .container {
    position: relative;
    z-index: 2;
    padding-block: calc(var(--header-h) + var(--s-8)) var(--s-8);
  }
  .page-hero h1 { max-width: 20ch; margin-bottom: var(--s-4); }
  .page-hero .lead { color: #cfccc4; }

  /* ---------------------------------------------------------------------------
     SUPPORT / CARD GRID
     --------------------------------------------------------------------------- */
  /* Capped at three columns on purpose: `auto-fit` would make four at 1440px,
     which leaves a six-card section with two empty cells showing through. */
  .card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    border: 1px solid var(--line);
    background: var(--line);
  }
  @media (min-width: 620px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 940px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .card {
    display: grid;
    align-content: start;
    gap: var(--s-3);
    padding: var(--s-6);
    background: var(--surface);
    box-shadow: var(--plate-edge);
  }
  .card h3 { margin: 0; }
  .card p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
  .card .link { margin-top: var(--s-3); }

  /* ---------------------------------------------------------------------------
     COMMUNITY BAND
     --------------------------------------------------------------------------- */
  .community-band {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }
  .community-band .band-art { position: absolute; inset: 0; z-index: 0; }
  .community-band .band-art img { width: 100%; height: 100%; object-fit: cover; object-position: 76% 34%; }
  .community-band .band-art::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(96deg, rgba(7, 10, 15, .97) 0 40%, rgba(7, 10, 15, .72) 62%, rgba(7, 10, 15, .28));
  }
  .community-inner {
    position: relative;
    z-index: 2;
    max-width: 44rem;
    padding: clamp(2.25rem, 1.4rem + 3.6vw, 4.5rem);
  }
  .community-inner h2 { margin-bottom: var(--s-4); }
  .community-inner .lead { margin-bottom: var(--s-6); }

  /* ---------------------------------------------------------------------------
     TAG LIST — dense, scannable content inventory
     --------------------------------------------------------------------------- */
  .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: var(--s-6);
  }
  .tag-list li {
    padding: .5rem .9rem;
    border: 1px solid var(--line);
    background: rgba(10, 14, 20, .74);
    backdrop-filter: blur(4px);
    color: var(--parchment-dim);
    font-size: var(--fs-xs);
    letter-spacing: .03em;
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  }
  .tag-list li:hover { border-color: var(--line-strong); color: var(--parchment); }

  /* ---------------------------------------------------------------------------
     RACE TILES — compact roster preview
     --------------------------------------------------------------------------- */
  /*
   * Capped at four columns.
   *
   * `auto-fit` alone produced six columns at 1440px, which left the eight-race
   * roster as a row of six and a row of two — a wide empty gap under the tail.
   * Four columns divides the roster evenly and keeps each tile wide enough for
   * its tagline to sit on one or two lines.
   */
  .race-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1px;
    border: 1px solid var(--line);
    background: var(--line);
  }
  @media (min-width: 60rem) {
    /* auto-fit, NOT repeat(4): a realm running six races left two dead cells
       in a fixed four-column grid, and they read as missing content rather
       than as empty space. */
    .race-tiles { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  }
  .race-tile {
    display: grid;
    align-content: start;
    gap: .3rem;
    padding: var(--s-5);
    background: var(--surface);
    text-decoration: none;
    transition: background var(--dur) var(--ease);
    box-shadow: var(--plate-edge);
  }
  .race-tile:hover { background: linear-gradient(160deg, #161d29, #0c111a 62%); }
  .race-tile-name {
    font-family: var(--display);
    font-size: 1.12rem;
    letter-spacing: .06em;
    color: var(--parchment);
  }
  .race-tile-count {
    color: var(--gold);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
  }
  .race-tile-tagline { margin-top: .35rem; color: var(--muted); font-size: var(--fs-xs); }

  /* ---------------------------------------------------------------------------
     CLASS ROSTER — race sections with full progressions
     --------------------------------------------------------------------------- */
  .race-nav {
    display: grid;
    gap: var(--s-4);
    margin-bottom: var(--s-9);
    padding-bottom: var(--s-5);
    border-bottom: 1px solid var(--line);
  }
  .race-nav-label {
    color: var(--muted-deep);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
  }
  .race-links { display: flex; flex-wrap: wrap; gap: .5rem; }
  .race-link {
    display: inline-flex;
    align-items: baseline;
    gap: .5rem;
    padding: .55rem 1rem;
    border: 1px solid var(--line);
    color: var(--parchment-dim);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease);
  }
  .race-link b { color: var(--gold); font-size: .68rem; }
  .race-link:hover {
    border-color: var(--line-strong);
    background: rgba(194, 162, 106, .06);
    color: var(--parchment);
  }

  .race {
    padding-block: var(--s-8);
    border-top: 1px solid var(--line);
    scroll-margin-top: calc(var(--header-h-compact) + 2rem);
  }
  .race:first-of-type { border-top: 0; padding-top: 0; }
  .race-head { display: grid; gap: var(--s-4); margin-bottom: var(--s-7); }
  @media (min-width: 900px) {
    .race-head { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: end; gap: var(--s-7); }
  }
  .race-head h2 { margin: 0; }
  .race-head .lead { margin: 0; }

  .class-entries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
    gap: 1px;
    border: 1px solid var(--line);
    background: var(--line);
  }
  .class-entry {
    display: grid;
    align-content: start;
    padding: var(--s-5);
    background: var(--surface);
    transition: background var(--dur) var(--ease);
    box-shadow: var(--plate-edge);
  }
  .class-entry:hover { background: linear-gradient(160deg, #161d29, #0c111a 62%); }
  .class-entry header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-4);
    margin-bottom: var(--s-4);
    padding-bottom: var(--s-3);
    border-bottom: 1px solid var(--line);
  }
  .class-entry h3 {
    margin: 0;
    font-size: 1.12rem;
    letter-spacing: .045em;
    color: var(--parchment);
  }
  .class-entry .discipline {
    flex: none;
    color: var(--muted-deep);
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
  }
  .class-entry[data-discipline="mystic"] .discipline { color: var(--violet); }
  .class-entry[data-discipline="summoner"] .discipline { color: var(--aqua); }
  .class-entry[data-discipline="fighter"] .discipline { color: var(--ember); }

  /* the progression chain */
  .progression { display: grid; gap: .1rem; }
  .progression li {
    position: relative;
    padding: .22rem 0 .22rem 1.15rem;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.45;
  }
  .progression li::before {
    content: "";
    position: absolute;
    left: 2px; top: .78em;
    width: 5px; height: 5px;
    border: 1px solid var(--muted-deep);
    transform: rotate(45deg);
  }
  /* connecting spine between tiers */
  .progression li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 4px; top: calc(.78em + 6px);
    width: 1px; height: calc(100% - 6px);
    background: var(--line);
  }
  .progression li.is-final { color: var(--gold-light); font-weight: 600; }
  .progression li.is-final::before {
    border-color: var(--gold-light);
    background: rgba(223, 201, 152, .35);
  }

  /* ---------------------------------------------------------------------------
     HUNTING GROUNDS
     --------------------------------------------------------------------------- */
  .area-list { display: grid; border-top: 1px solid var(--line); }
  .area {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: var(--s-5);
    padding: var(--s-6) 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: calc(var(--header-h-compact) + 2rem);
  }
  .area-level {
    display: grid;
    place-items: center;
    align-self: start;
    width: 5.5rem; height: 3.4rem;
    border: 1px solid var(--line-strong);
    background: rgba(194, 162, 106, .05);
  }
  .area-level span {
    font-family: var(--display);
    font-size: 1.05rem;
    letter-spacing: .04em;
    color: var(--gold-light);
  }
  .area-body h3 { margin: 0 0 .5rem; font-size: 1.28rem; }
  .area-body > p { margin: 0 0 var(--s-4); color: var(--muted); font-size: var(--fs-sm); max-width: 60ch; }
  .area-facts { display: flex; flex-wrap: wrap; gap: .4rem 2rem; margin: 0; }
  .area-facts div { display: grid; gap: .1rem; }
  .area-facts dt {
    color: var(--muted-deep);
    font-size: .58rem; font-weight: 600;
    letter-spacing: var(--tracking-label); text-transform: uppercase;
  }
  .area-facts dd { margin: 0; color: var(--parchment-dim); font-size: var(--fs-xs); }

  .area-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: var(--s-6); }
  .area-chip {
    display: inline-flex; align-items: baseline; gap: .6rem;
    padding: .5rem .9rem;
    border: 1px solid var(--line);
    background: rgba(10, 14, 20, .74);
    backdrop-filter: blur(4px);
    color: var(--parchment-dim);
    font-size: var(--fs-xs);
    text-decoration: none;
    transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
  }
  .area-chip-level { color: var(--gold); font-size: .62rem; font-weight: 700; letter-spacing: .08em; }
  .area-chip:hover { border-color: var(--line-strong); color: var(--parchment); }
  .area-chip--more { border-color: var(--line-strong); color: var(--gold-light); }

  @media (max-width: 560px) {
    .area { grid-template-columns: 1fr; gap: var(--s-4); }
    .area-level { width: 4.6rem; height: 2.6rem; }
  }

  /* ---------------------------------------------------------------------------
     NOTICE
     --------------------------------------------------------------------------- */
  .notice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--s-4);
    padding: var(--s-5);
    border: 1px solid var(--line);
    border-left: 2px solid var(--gold);
    background: rgba(194, 162, 106, .05);
    color: var(--parchment-dim);
    font-size: var(--fs-sm);
  }
  .notice::before {
    content: "";
    width: 7px; height: 7px;
    margin-top: .55em;
    border: 1px solid var(--gold);
    transform: rotate(45deg);
  }
  .notice p { margin: 0; max-width: 62ch; }

  /* ---------------------------------------------------------------------------
     FOOTER
     --------------------------------------------------------------------------- */
  .site-footer {
    position: relative;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, var(--abyss), #04060a);
    padding-block: var(--s-9) var(--s-6);
  }
  .footer-grid { display: grid; gap: var(--s-7); }
  @media (min-width: 720px) { .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  @media (min-width: 980px) { .footer-grid { grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr)); gap: var(--s-8); } }

  .footer-about p { max-width: 38ch; margin: var(--s-5) 0 0; color: var(--muted-deep); font-size: var(--fs-xs); line-height: 1.7; }
  .footer-col h2 {
    margin-bottom: var(--s-4);
    color: var(--gold);
    font-family: var(--body);
    font-size: .655rem;
    font-weight: 700;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
  }
  .footer-col a {
    display: block;
    padding: .38rem 0;
    color: var(--muted);
    font-size: var(--fs-sm);
    text-decoration: none;
    transition: color var(--dur) var(--ease);
  }
  .footer-col a:hover { color: var(--parchment); }

  /* ===========================================================================
     THE STAT BAND — what a realm runs, as figures rather than a bullet list.
     ===========================================================================
     This replaced a <ul> of "158 classes / 14,086 NPCs / 48,604 items". The
     owner's verdict on that was "it just looks like a list", and they were
     right: the most interesting thing a realm page can say was set in body copy
     at body size.

     The numerals carry the weight now. Everything else on the card — label,
     rule, frame — is deliberately quieter than the number it describes.
  */
  .stat-band {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin: var(--s-7) 0 0;
    border: 1px solid var(--line);
    background: var(--line);            /* the 1px gap becomes the rule */
    border-radius: 3px;
    overflow: hidden;
  }
  .stat-cell {
    position: relative;
    padding: var(--s-6) var(--s-5);
    background: linear-gradient(170deg, var(--slate-800), var(--slate-900) 70%);
    text-align: center;
    isolation: isolate;
  }
  /* A slow gold wash that rises from the base of each cell. Static, so it costs
     nothing to animate and nothing to read. */
  .stat-cell::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 55%;
    background: radial-gradient(120% 100% at 50% 100%,
                rgba(194, 162, 106, .13), transparent 70%);
    pointer-events: none;
    z-index: -1;
  }
  .stat-value {
    display: block;
    font-family: var(--display);
    font-size: clamp(1.9rem, 1.2rem + 2.2vw, 3.1rem);
    line-height: 1;
    letter-spacing: -.01em;
    color: var(--gold-light);
    text-shadow: 0 0 22px rgba(194, 162, 106, .30),
                 0 1px 0 rgba(0, 0, 0, .55);
  }
  .stat-label {
    display: block;
    margin-top: .6rem;
    color: var(--muted);
    font-size: var(--fs-xs);
    letter-spacing: .16em;
    text-transform: uppercase;
  }
  .stat-note {
    margin: var(--s-5) 0 0;
    color: var(--muted-deep);
    font-size: var(--fs-xs);
    line-height: 1.7;
  }

  /* ---------------------------------------------------------------------------
     ORNAMENT — a hairline flourish under a section eyebrow.
     A rule that tapers rather than stopping dead; the diamond is the same mark
     the hero ornament uses, so the vocabulary is one thing and not two.
  */
  .flourish {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 0 var(--s-5);
    color: var(--gold-deep);
  }
  .flourish::before,
  .flourish::after {
    content: "";
    height: 1px;
    flex: 1 1 auto;
    max-width: 84px;
    background: linear-gradient(90deg, transparent, var(--line-strong));
  }
  .flourish::after { background: linear-gradient(270deg, transparent, var(--line-strong)); }
  .flourish i {
    width: 5px; height: 5px;
    transform: rotate(45deg);
    background: var(--gold);
    box-shadow: 0 0 10px rgba(194, 162, 106, .6);
  }
  .flourish--center { justify-content: center; }

  /* ---------------------------------------------------------------------------
     RACE PORTRAIT — official class-guide art behind a race heading.
     The art is 256x150 from the client's own L2ClassGuide package, so it is
     wide and short; it sits as a banner rather than a column, masked into the
     page so it has no hard edge.
  */
  .race--art .race-head {
    position: relative;
    padding: var(--s-7) var(--s-6);
    border: 1px solid var(--line);
    border-radius: 3px;
    overflow: hidden;
    isolation: isolate;
  }
  .race-art {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(52%, 460px);
    object-fit: cover;
    object-position: center 28%;
    opacity: .5;
    z-index: -1;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 55%);
            mask-image: linear-gradient(90deg, transparent, #000 55%);
  }
  .race--art .race-head::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--slate-900) 18%, transparent 78%);
    z-index: -1;
  }
  @media (max-width: 720px) {
    .race-art { width: 100%; opacity: .26; mask-image: none; -webkit-mask-image: none; }
  }

  /* ---------------------------------------------------------------------------
     CARD LIFT — the class and feature cards answer the pointer.
     Transform and box-shadow only: both composite, so this never lays out.
  */
  .class-entry,
  .card,
  .area {
    transition: transform .28s cubic-bezier(.2, .7, .3, 1),
                border-color .28s ease,
                box-shadow .28s ease;
  }
  @media (hover: hover) {
    .class-entry:hover,
    .card:hover,
    .area:hover {
      transform: translateY(-3px);
      border-color: var(--line-strong);
      box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .9),
                  0 0 0 1px rgba(194, 162, 106, .10),
                  0 0 30px -14px rgba(194, 162, 106, .45);
    }
  }

  /* EVERY MOTION RULE ABOVE IS OFF HERE. Someone who has asked their system to
     stop animating has asked this page too, and a hover that still lifts is a
     page that did not listen. */
  @media (prefers-reduced-motion: reduce) {
    .class-entry, .card, .area { transition: none; }
    .class-entry:hover, .card:hover, .area:hover { transform: none; }
  }

  /* ---------------------------------------------------------------------------
     CLASS PORTRAIT — the client's own creation art, behind the card.

     Only the classes the package NAMES have one (the eleven creation roots and
     Ertheia 184-189); the rest of the roster is unchanged. That reads as
     deliberate rather than patchy because the classes with art are exactly the
     ones you can pick at creation, which the card already says.
  */
  .class-entry { position: relative; isolation: isolate; overflow: hidden; }
  .class-portrait-art {
    position: absolute;
    inset: 0 0 auto auto;
    /* NEVER WIDER THAN THE PIXELS WE HAVE.
       The client's class art is 256px across and there is nothing larger in any
       of its 159 texture packages - so the @2x file IS 256px. At `width: 62%`
       the card asked for ~236 CSS px, which a retina screen renders from 471
       device pixels: a 1.84x upscale, and that is exactly the gritty look.
       Capped at 128px the 2x asset maps 1:1 on a DPR-2 display and 2:1 on DPR-1,
       so it is sharp on both. Smaller and crisp beats bigger and mushy. */
    width: 40%;
    max-width: 128px;
    height: auto;
    opacity: .34;
    z-index: -1;
    transform: scale(1.04);
    transform-origin: top right;
    transition: opacity .4s ease, transform .6s cubic-bezier(.2,.7,.3,1);
    -webkit-mask-image: linear-gradient(210deg, #000 22%, transparent 86%);
            mask-image: linear-gradient(210deg, #000 22%, transparent 86%);
  }
  .class-entry.has-art::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, var(--slate-800) 26%, rgba(16,21,30,.55) 62%, transparent);
    z-index: -1;
  }
  @media (hover: hover) {
    .class-entry.has-art:hover .class-portrait-art { opacity: .52; transform: scale(1.09); }
  }

  /* =========================================================================
     THE HERO — depth, drift and an entrance.
     =========================================================================
     Three layers that move at different rates as the page scrolls, a slow
     aurora that never repeats visibly, and a staggered reveal on load. All of
     it is transform/opacity so it composites; none of it reflows.
  */
  .page-hero, .hero { position: relative; overflow: hidden; }

  .page-hero-media img,
  .hero-media img { will-change: transform; }

  /* A second, slower wash of colour above the art. Two gradients rotating at
     different speeds never land in the same place twice, which is what stops a
     loop from reading as a loop. */
  .hero-aurora {
    position: absolute;
    inset: -30% -10%;
    pointer-events: none;
    z-index: 0;
    background:
      radial-gradient(38% 46% at 22% 32%, rgba(157,132,216,.20), transparent 68%),
      radial-gradient(34% 40% at 78% 58%, rgba(111,201,212,.16), transparent 70%),
      radial-gradient(44% 38% at 55% 84%, rgba(194,162,106,.14), transparent 72%);
    filter: blur(14px);
    animation: hero-drift 38s ease-in-out infinite alternate;
  }
  @keyframes hero-drift {
    0%   { transform: translate3d(-2.5%, -1.5%, 0) scale(1.03) rotate(0deg); }
    50%  { transform: translate3d( 1.5%,  2.0%, 0) scale(1.07) rotate(1.2deg); }
    100% { transform: translate3d( 2.5%, -2.0%, 0) scale(1.02) rotate(-1deg); }
  }

  /* Embers. Six of them, each with its own delay and drift, so the eye never
     catches a pattern. Purely decorative and hidden from assistive tech. */
  .hero-embers { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
  .hero-embers i {
    position: absolute;
    bottom: -10px;
    width: 2px; height: 2px;
    border-radius: 50%;
    background: var(--gold-light);
    box-shadow: 0 0 8px 1px rgba(223,201,152,.55);
    opacity: 0;
    animation: ember-rise 14s linear infinite;
  }
  .hero-embers i:nth-child(1) { left: 12%; animation-delay: 0s;    animation-duration: 15s; }
  .hero-embers i:nth-child(2) { left: 28%; animation-delay: 2.6s;  animation-duration: 18s; }
  .hero-embers i:nth-child(3) { left: 46%; animation-delay: 5.1s;  animation-duration: 13s; }
  .hero-embers i:nth-child(4) { left: 63%; animation-delay: 7.8s;  animation-duration: 17s; }
  .hero-embers i:nth-child(5) { left: 79%; animation-delay: 10.2s; animation-duration: 14s; }
  .hero-embers i:nth-child(6) { left: 91%; animation-delay: 12.5s; animation-duration: 19s; }
  @keyframes ember-rise {
    0%   { opacity: 0;   transform: translate3d(0, 0, 0) scale(.6); }
    12%  { opacity: .85; }
    70%  { opacity: .5; }
    100% { opacity: 0;   transform: translate3d(14px, -78vh, 0) scale(1.25); }
  }

  /* The entrance. Each line of the hero arrives just after the one above it —
     a cadence, not a slideshow. */
  .page-hero .container > *,
  .hero .hero-copy > * { animation: hero-enter .9s cubic-bezier(.2,.75,.3,1) backwards; }
  .page-hero .container > *:nth-child(1), .hero .hero-copy > *:nth-child(1) { animation-delay: .05s; }
  .page-hero .container > *:nth-child(2), .hero .hero-copy > *:nth-child(2) { animation-delay: .16s; }
  .page-hero .container > *:nth-child(3), .hero .hero-copy > *:nth-child(3) { animation-delay: .27s; }
  .page-hero .container > *:nth-child(4), .hero .hero-copy > *:nth-child(4) { animation-delay: .38s; }
  .page-hero .container > *:nth-child(5), .hero .hero-copy > *:nth-child(5) { animation-delay: .49s; }
  @keyframes hero-enter {
    from { opacity: 0; transform: translate3d(0, 14px, 0); filter: blur(3px); }
    to   { opacity: 1; transform: none; filter: none; }
  }

  /* A gold hairline that draws itself across the base of the hero. */
  .page-hero::after, .hero::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong) 22%, var(--gold-deep) 50%, var(--line-strong) 78%, transparent);
    transform: scaleX(0);
    transform-origin: 50% 50%;
    animation: hairline 1.6s .5s cubic-bezier(.2,.75,.3,1) forwards;
  }
  @keyframes hairline { to { transform: scaleX(1); } }

  /* NOTHING ABOVE SURVIVES THIS. Someone who has asked their system to stop
     animating has asked this page too - so the drift, the embers, the entrance
     and the hairline all stop, and every element sits where it finished. */
  @media (prefers-reduced-motion: reduce) {
    .hero-aurora, .hero-embers i { animation: none; }
    .hero-embers { display: none; }
    .page-hero .container > *, .hero .hero-copy > * { animation: none; }
    .page-hero::after, .hero::after { animation: none; transform: scaleX(1); }
    .class-portrait-art { transition: none; }
  }

  .footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    margin-top: var(--s-8);
    padding-top: var(--s-5);
    border-top: 1px solid var(--line);
    color: var(--muted-deep);
    font-size: var(--fs-xs);
  }
  .footer-bottom p { margin: 0; max-width: none; }
}

/* =============================================================================
   UTILITIES
   ============================================================================= */
@layer utilities {
  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .stack > * + * { margin-top: var(--s-4); }
  .mt-6 { margin-top: var(--s-6); }
  .mt-7 { margin-top: var(--s-7); }
  .center { text-align: center; }
  .center .lead, .center p { margin-inline: auto; }
  .center .ornament { margin-inline: auto; }
}

/* =============================================================================
   RESPONSIVE — navigation drawer and layout stepdowns
   ============================================================================= */
@media (max-width: 900px) {
  .nav-actions .nav-cta { display: none; }
  .menu-toggle { display: grid; }

  .site-header,
  .site-header.is-compact {
    background: rgba(6, 8, 12, .93);
    border-bottom-color: var(--line);
    backdrop-filter: blur(18px);
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    z-index: 90;
    display: grid;
    align-content: start;
    gap: 0;
    max-height: calc(100svh - var(--header-h));
    overflow-y: auto;
    padding: var(--s-4) var(--gutter) var(--s-6);
    margin: 0;
    border-bottom: 1px solid var(--line);
    /* Fully opaque: a translucent drawer lets hero type ghost through the
       navigation labels and reads as unfinished. */
    background: var(--obsidian);
    box-shadow: var(--shadow-lg);
    transform: translateY(-101%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--dur) var(--ease-out), opacity var(--dur) var(--ease), visibility var(--dur);
  }
  .site-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .site-nav a:not(.btn),
  .site-nav .nav-group-toggle {
    padding: 1.05rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, .055);
    font-size: .78rem;
    letter-spacing: .18em;
  }
  .site-nav a:not(.btn)::after,
  .site-nav .nav-group-toggle::after { display: none; }
  .site-nav a:not(.btn)[aria-current="page"]::before {
    content: "";
    display: inline-block;
    width: 5px; height: 5px;
    margin-right: .7rem;
    background: var(--gold);
    transform: rotate(45deg);
    vertical-align: middle;
  }
  .site-nav .nav-drawer-cta { display: block; margin-top: var(--s-5); }
  .site-nav .nav-drawer-cta .btn { width: 100%; }

  /* Dim the page behind an open drawer so focus sits on the menu. */
  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(4, 6, 9, .74);
    animation: scrim-in var(--dur) var(--ease) both;
  }
  @keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }

  .realm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .realm-stat:nth-child(-n+2) { border-top: 0; }
  .realm-stat:nth-child(2n) { border-right: 1px solid var(--line); }
  .realm-stat:nth-child(n+3) { border-top: 1px solid var(--line); }

  .news-editorial { gap: var(--s-7); }
}

@media (max-width: 680px) {
  .hero { min-height: 660px; }
  .hero-content { padding-block: calc(var(--header-h) + var(--s-7)) calc(var(--s-9) + var(--s-6)); }
  /* Portrait: the horizontal scrim leaves art behind the copy. Go vertical. */
  .chronicle-media::after {
    background: linear-gradient(to top, rgba(6, 8, 12, .96) 0 18%, rgba(6, 8, 12, .84) 62%, rgba(6, 8, 12, .74) 100%);
  }
  .community-band .band-art::after {
    background: linear-gradient(to top, rgba(7, 10, 15, .95) 0 14%, rgba(7, 10, 15, .82) 66%, rgba(7, 10, 15, .7) 100%);
  }
  .download-band .band-art::after {
    background: linear-gradient(to top, rgba(7, 10, 15, .95) 0 14%, rgba(7, 10, 15, .84) 66%, rgba(7, 10, 15, .72) 100%);
  }
  .hero-actions { display: grid; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .chronicle-band::before, .chronicle-band::after { max-width: 40px; }

  .realm-grid { grid-template-columns: 1fr; }
  .realm-stat { min-height: 0; padding: var(--s-4) var(--s-5); border-right: 1px solid var(--line); }
  .realm-stat:first-child { border-top: 0; }
  .realm-stat:not(:first-child) { border-top: 1px solid var(--line); }

  .news-item { grid-template-columns: 74px minmax(0, 1fr); gap: var(--s-4); }
  .feature-rows li { grid-template-columns: 2.6rem minmax(0, 1fr); }
  .class-roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .class-card { min-height: 210px; }
  .class-sigil { width: 48px; height: 48px; top: var(--s-5); }
  .download-cta-row .btn { width: 100%; }
  .download-facts li { display: grid; gap: .1rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* Narrowest supported phone (360px). An uppercase, letterspaced CTA label is
   wide; at this width it is allowed to soften and, if it still must, to wrap
   onto a second line rather than push the page sideways. */
@media (max-width: 400px) {
  .btn {
    white-space: normal;
    height: auto;
    padding: .95rem 1.1rem;
    font-size: .665rem;
    letter-spacing: .15em;
    line-height: 1.3;
    text-align: center;
  }
  .btn--lg { padding: 1.05rem 1.25rem; font-size: .715rem; }
  .download-cta-row { display: grid; }
}

@media (max-width: 380px) {
  .class-roster { grid-template-columns: 1fr; }
}

/* =============================================================================
   PORTRAIT VIEWPORTS — phones and tablets held upright
   -----------------------------------------------------------------------------
   Keyed to aspect ratio, not width: a 768px tablet in portrait has the same
   framing problem as a phone, and a 900px-wide window in landscape does not.
   ============================================================================= */
@media (max-aspect-ratio: 1/1) {
  /* Cap the hero so a tall viewport does not leave a dead band under the CTAs. */
  .hero { min-height: min(100svh, 820px); }

  /* A portrait crop of wide landscape key art lands on the empty centre of the
     composition and loses both figures; bias toward the right-hand archmage. */
  .hero-media img { object-position: 73% 44%; }

  /* That part of the art is bright, so deepen the vignette to keep type legible. */
  .scrim-vignette {
    background: radial-gradient(96% 58% at 50% 40%, rgba(6, 8, 12, .42) 12%, rgba(6, 8, 12, .74) 66%, rgba(6, 8, 12, .92) 100%);
  }
}

/* =============================================================================
   REDUCED MOTION — stable, static experience
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .aura { animation: none; }
  .hero-media { transform: none !important; }
  .hero-scroll { display: none; }
}

/* =============================================================================
   PRINT
   ============================================================================= */
@media print {
  .site-header, .hero-scroll, .aura, .grain, .menu-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Inline download link inside the hero note — deliberately quiet, so the page
   leads with the game rather than the installer. */
.hero-note-link { font-size: inherit; letter-spacing: .06em; text-transform: none; }

/* In-development paths: deliberately set apart from the playable roster. */
.in-development { padding-top: var(--s-8); border-top: 1px solid var(--line); margin-top: var(--s-8); }
.class-entry--dev { background: linear-gradient(160deg, #12161d, #0a0d13 66%); }
.class-entry--dev .discipline { color: var(--muted-deep); }
.class-entry--dev h3 { color: var(--parchment-dim); }
.class-entry--dev .dev-summary { margin: 0 0 var(--s-3); color: var(--muted); font-size: var(--fs-sm); }
.class-entry--dev .dev-note { margin: 0; color: var(--muted-deep); font-size: var(--fs-xs); }
.class-note { margin: var(--s-4) 0 0; padding-top: var(--s-3); border-top: 1px solid var(--line); color: var(--gold); font-size: var(--fs-xs); line-height: 1.5; }

/* Hero: the chronicle is the headline, the brand sits above it. */
.chronicle-band--over { margin-bottom: var(--s-5); }
.chronicle-band--over span { font-size: clamp(.7rem, .6rem + .35vw, .86rem); color: var(--gold-light); }
.hero-title-line { display: block; }

/* Optional race portrait. Renders only when `image` is set on a race in
   content/classes.json — the layout is identical without one. */
.race-portrait { position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--slate-900); }
.race-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; filter: saturate(.92); }
.race-portrait::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6,8,12,.72), transparent 46%);
}
@media (min-width: 900px) {
  .race--illustrated .race-head { grid-template-columns: 200px minmax(0,.9fr) minmax(0,1.1fr); align-items: end; }
  .race-portrait { aspect-ratio: 3/4; align-self: stretch; }
}
@media (max-width: 899px) {
  .race-portrait { aspect-ratio: 16/9; margin-bottom: var(--s-4); }
}

/* =========================================================================
   Legal / policy long-form
   -------------------------------------------------------------------------
   Terms and Privacy are the only pages on the site that are mostly running
   prose with nested headings and lists. They get a dedicated block rather
   than being forced through .prose, which is a one-line colour helper.
   Measure is capped so lines stay readable at desktop widths.
   ========================================================================= */
@layer sections {
  .legal { color: var(--muted); }
  .legal > * + * { margin-top: var(--s-4); }

  .legal h2 {
    margin-top: var(--s-7);
    padding-top: var(--s-5);
    border-top: 1px solid var(--line);
    color: var(--fg);
    font-size: clamp(1.15rem, 1.6vw, 1.4rem);
    letter-spacing: .01em;
  }
  .legal h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

  .legal h3 {
    margin-top: var(--s-5);
    color: var(--fg);
    font-size: 1.02rem;
  }

  .legal p,
  .legal li { max-width: 68ch; line-height: 1.75; }

  .legal ul,
  .legal ol { padding-left: 1.25rem; display: grid; gap: .55rem; }
  .legal li { padding-left: .15rem; }
  .legal ul li { list-style: none; position: relative; }
  .legal ul li::before {
    content: "";
    position: absolute;
    left: -.95rem;
    top: .62em;
    width: 5px;
    height: 5px;
    transform: rotate(45deg);
    background: var(--gold-light);
    opacity: .65;
  }
  .legal ol li { list-style: decimal; }

  .legal a { color: var(--fg); text-decoration: underline; text-underline-offset: .18em; }
  .legal a:hover { color: var(--gold-light); }

  .legal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3) var(--s-6);
    padding-bottom: var(--s-5);
    margin-bottom: var(--s-6);
    border-bottom: 1px solid var(--line);
    font-size: .82rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .legal-meta b { color: var(--fg); font-weight: 600; }
}

/* Header sign-in link, beside the Download button. Hidden on narrow widths,
   where the same link lives in the drawer instead. */
@layer components {
  .nav-signin {
    margin-right: var(--s-4);
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  @media (max-width: 63.99rem) {
    .nav-signin { display: none; }
  }
  .nav-drawer-cta .btn--ghost { margin-bottom: var(--s-3); }
}

/* =========================================================================
   Account & admin forms
   -------------------------------------------------------------------------
   The account pages shipped with no form styling at all, so labels and inputs
   fell back to browser defaults and sat inline next to each other. These rules
   give them the same plate-and-gold treatment as the rest of the site.

   Notes that matter:
   * Inputs are 16px on mobile. Anything smaller makes iOS Safari zoom the page
     on focus, which is what made the sign-in form jump around.
   * Focus is a visible gold ring, never `outline: none`. Keyboard users have to
     be able to see where they are.
   ========================================================================= */
@layer components {

  .form {
    display: grid;
    gap: var(--s-5);
    max-width: 27rem;
    margin-top: var(--s-6);
  }

  .form-row { display: grid; gap: .45rem; }

  .form-row label {
    font-family: var(--body);
    font-size: var(--fs-label);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold);
  }

  .form input[type="text"],
  .form input[type="email"],
  .form input[type="password"],
  .form input[type="number"],
  .form select,
  .form textarea {
    width: 100%;
    padding: .78rem .9rem;
    font-family: var(--body);
    font-size: 1rem;               /* 16px — stops iOS zooming on focus */
    line-height: 1.4;
    color: var(--parchment);
    background: var(--surface-flat);
    border: 1px solid var(--line);
    border-radius: 2px;
    box-shadow: var(--plate-edge);
    transition: border-color .16s ease, box-shadow .16s ease;
    appearance: none;
  }

  .form input::placeholder { color: var(--muted-deep); }

  .form input:hover,
  .form select:hover,
  .form textarea:hover { border-color: var(--line-strong); }

  .form input:focus-visible,
  .form select:focus-visible,
  .form textarea:focus-visible {
    outline: none;
    border-color: var(--gold);
    box-shadow: var(--plate-edge), 0 0 0 3px rgba(194, 162, 106, .18);
  }

  .form input:autofill,
  .form input:-webkit-autofill {
    -webkit-text-fill-color: var(--parchment);
    -webkit-box-shadow: 0 0 0 1000px var(--slate-800) inset;
  }

  .form-hint {
    font-size: var(--fs-xs);
    line-height: 1.55;
    color: var(--muted);
  }

  .form-actions { margin-top: var(--s-2); }
  .form-actions .btn { width: 100%; }

  @media (min-width: 30rem) {
    .form-actions .btn { width: auto; min-width: 12rem; }
  }

  /* Links that follow a form: sign in / register / forgot password. */
  .form + p,
  .form ~ p { margin-top: var(--s-5); font-size: var(--fs-sm); color: var(--muted); }

  /* --- notices -----------------------------------------------------------
     The base .notice is a two-column grid expecting an icon plus text. These
     pages pass a single paragraph, so it is collapsed to one column here and
     given state colours. */
  .notice--info,
  .notice--error {
    grid-template-columns: minmax(0, 1fr);
    margin-bottom: var(--s-6);
  }
  .notice--error {
    border-left-color: var(--ember);
    background: rgba(201, 138, 74, .07);
    color: var(--parchment);
  }
  .notice--info {
    border-left-color: var(--aqua);
    background: rgba(111, 201, 212, .06);
  }

  /* --- admin ------------------------------------------------------------- */
  .admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3) var(--s-5);
    padding-bottom: var(--s-5);
    margin-bottom: var(--s-6);
    border-bottom: 1px solid var(--line);
    font-size: var(--fs-sm);
  }
}

@layer sections {
  /* A hero with no artwork behind it should not reserve space for artwork.
     This must sit in the `sections` layer: `.page-hero` is defined there, and
     a `components`-layer override would lose to it regardless of specificity. */
  .page-hero--plain {
    min-height: 0;
    padding-block: clamp(2.75rem, 8vw, 4.5rem);
    background: linear-gradient(180deg, var(--slate-900) 0%, var(--abyss) 100%);
  }
  /* The hero container carries ~118px of top padding to clear the artwork
     behind it. With no artwork that is just dead space above the heading. */
  .page-hero--plain .container { padding-top: 0; padding-bottom: 0; }
}

/* =========================================================================
   Header + hero alignment corrections
   ========================================================================= */
@layer components {
  /* "Servers" and "Hunting Grounds" were wrapping onto two lines, making
     those two items 51px tall against 32px for everything else. That pushed
     the whole bar out of alignment and added dead height on desktop. */
  .site-nav a[data-nav] { white-space: nowrap; }
}

@layer sections {
  /* The chronicle band is a flex container, but as a flex ITEM inside
     .hero-content it was sized to its own content and aligned to the start —
     so "LINEAGE UNIVERSE REBORN" sat left of the eyebrow and the title, which
     stretch to full width. Making it full width lets its own
     `justify-content: center` do the centring, and the rule-name-rule
     decoration spans properly. */
  .chronicle-band {
    width: 100%;
    /* The band is a <p>, so it inherits a measure cap (~60ch) meant for body
       copy. That cap is what left it narrower than the eyebrow and title and
       therefore visually off-centre. */
    max-width: none;
  }
}

/* =========================================================================
   Hero ambience — "bringing the artwork to life"
   -------------------------------------------------------------------------
   This is an OVERLAY on the still image, not video. It adds three things:

     1. a very slow drift of the sky, so the storm reads as moving
     2. a pulsing glow at each mage's staff — aqua on the left, violet on the
        right, matching the artwork
     3. a soft breathing glow along the lightning arc between them

   Deliberate restraint, for two reasons:

   * **Photosensitivity.** Real lightning flicker means rapid luminance
     flashes, which is a genuine seizure risk and fails WCAG 2.3.1. The storm
     here BREATHES over several seconds; it never strobes.
   * **Performance.** Only `opacity` and `transform` are animated — both
     composited on the GPU. No animated blurs or boxshadows over large areas,
     which is what makes this kind of effect stutter on phones.

   Everything here is off under `prefers-reduced-motion`, and the staff glows
   only render on wide viewports, where `object-fit: cover` still shows the
   part of the painting they sit on.
   ========================================================================= */
@layer sections {
  .hero-magic {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
  }

  .hero-magic-staff,
  .hero-magic-storm {
    position: absolute;
    display: block;
    border-radius: 50%;
    opacity: 0;
    will-change: opacity, transform;
  }

  /* Left mage: the trident head, roughly 18% across and 24% down. */
  .hero-magic-staff--light {
    left: 18.2%;
    top: 23.5%;
    width: 190px;
    height: 190px;
    margin: -95px 0 0 -95px;
    background: radial-gradient(circle,
      rgba(203, 247, 255, .55) 0%,
      rgba(111, 201, 212, .30) 26%,
      rgba(111, 201, 212, .10) 48%,
      transparent 70%);
  }

  /* Right mage: the staff orb, close to the right edge. */
  .hero-magic-staff--dark {
    left: 98.4%;
    top: 21%;
    width: 210px;
    height: 210px;
    margin: -105px 0 0 -105px;
    background: radial-gradient(circle,
      rgba(226, 205, 255, .48) 0%,
      rgba(157, 132, 216, .30) 26%,
      rgba(157, 132, 216, .10) 50%,
      transparent 72%);
  }

  /* The arc of lightning across the upper middle. */
  .hero-magic-storm {
    left: 50%;
    top: 12%;
    width: 62%;
    height: 34%;
    margin-left: -31%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center,
      rgba(233, 228, 215, .17) 0%,
      rgba(157, 132, 216, .09) 38%,
      transparent 68%);
  }

  @media (prefers-reduced-motion: no-preference) {
    /* The sky drifts. Tiny amplitude over a long cycle: felt, not watched. */
    .hero-media img {
      animation: hero-sky-drift 54s ease-in-out infinite alternate;
      transform-origin: 52% 40%;
    }

    .hero-magic-staff--light { animation: hero-pulse-light 7.5s ease-in-out infinite; }
    .hero-magic-staff--dark  { animation: hero-pulse-dark 9s ease-in-out infinite; }
    .hero-magic-storm        { animation: hero-storm-breathe 11s ease-in-out infinite; }
  }

  @keyframes hero-sky-drift {
    from { transform: scale(1.015) translate3d(-.5%, 0, 0); }
    to   { transform: scale(1.045) translate3d(.5%, -1%, 0); }
  }

  /* Offset phases so the two staffs never pulse in lockstep — synchronised
     glows read as a UI effect; staggered ones read as two separate casters. */
  @keyframes hero-pulse-light {
    0%, 100% { opacity: .30; transform: scale(.94); }
    46%      { opacity: .85; transform: scale(1.07); }
  }
  @keyframes hero-pulse-dark {
    0%, 100% { opacity: .26; transform: scale(.96); }
    38%      { opacity: .78; transform: scale(1.09); }
  }
  @keyframes hero-storm-breathe {
    0%, 100% { opacity: .20; transform: scale(1); }
    30%      { opacity: .62; transform: scale(1.05); }
    62%      { opacity: .34; transform: scale(1.02); }
  }

  /* Below this width `object-fit: cover` crops the sides away, so the glows
     would float over empty sky rather than over the staffs. */
  @media (max-width: 63.99rem) {
    .hero-magic-staff { display: none; }
    .hero-magic-storm { opacity: .22; animation-duration: 14s; }
  }
}

/* Motion off entirely when the visitor has asked for that. */
@media (prefers-reduced-motion: reduce) {
  .hero-media img { animation: none !important; transform: none !important; }
  .hero-magic-staff,
  .hero-magic-storm { animation: none !important; }
  .hero-magic-staff--light { opacity: .40; }
  .hero-magic-staff--dark { opacity: .34; }
  .hero-magic-storm { opacity: .26; }
}

/* =========================================================================
   My Page — Account / Security / Payment
   -------------------------------------------------------------------------
   Grouped list rows in the shape of a modern account console.

   The three row states are a deliberate honesty device:
     .is-off   a real feature that is currently off  — muted
     .is-soon  not built yet                          — dimmer, italic, inert
   A row that is not clickable is a <div>, not an <a>, so it cannot be tabbed
   to or clicked and then do nothing.
   ========================================================================= */
@layer sections {
  .mypage-tabs {
    display: flex;
    gap: var(--s-6);
    margin-bottom: var(--s-7);
    border-bottom: 1px solid var(--line);
  }
  .mypage-tab {
    position: relative;
    padding: 0 0 var(--s-4);
    font-size: var(--fs-sm);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
  }
  .mypage-tab:hover { color: var(--parchment-dim); }
  .mypage-tab.is-active { color: var(--parchment); }
  .mypage-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--gold);
  }

  .mypage-identity {
    display: flex;
    align-items: center;
    gap: var(--s-5);
    padding: var(--s-5);
    margin-bottom: var(--s-7);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--plate-edge);
  }
  .mypage-avatar {
    display: grid;
    place-items: center;
    width: 58px; height: 58px;
    flex: 0 0 58px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: var(--slate-800);
    font-family: var(--display);
    font-size: 1.4rem;
    color: var(--gold-light);
  }
  .mypage-name { margin: 0; font-family: var(--display); font-size: 1.15rem; color: var(--parchment); }
  .mypage-sub  { margin: .2rem 0 0; font-size: var(--fs-xs); color: var(--muted); }


  /* ---- character card ---------------------------------------------------
   *
   * The same INFORMATION design the launcher renders, in this site's visual
   * language rather than the launcher's:
   *
   *     Calickro          row 1  name    identity, alone so it is scannable
   *     No clan           row 2  clan    allegiance; italic + dim when absent
   *     Crow | Lv 1       row 3  server and level - both "where you are",
   *                              one in the world, one in progression
   *
   * A player should recognise the same identity in both places. Matching the
   * fields, their order and the empty state is what does that; matching the
   * launcher's colours would not, and would look wrong here.
   */
  .char-card {
    display: grid;
    gap: .15rem;
    padding: var(--s-4) var(--s-5);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--plate-edge);
  }
  .char-name {
    font-family: var(--display);
    font-size: 1.05rem;
    color: var(--parchment);
    line-height: 1.25;
  }
  .char-clan { font-size: var(--fs-sm); color: var(--muted); line-height: 1.3; }
  /* Italic and dimmer so it reads as a STATE, not as a clan called "None".
     The API sends null; this is where that null becomes words. */
  .char-clan.is-empty { color: var(--muted-deep); font-style: italic; }
  .char-foot {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    font-size: var(--fs-sm);
    color: var(--muted);
    margin-top: .1rem;
  }
  .char-foot .char-pipe { color: var(--line-strong); }
  .char-lv { color: var(--gold-light); font-weight: 600; font-variant-numeric: tabular-nums; }
  .char-lv i {
    font-style: normal;
    font-size: .62em;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold);
    margin-right: .3em;
  }
  .char-empty { font-size: var(--fs-sm); color: var(--muted-deep); font-style: italic; }

  .mypage-group-title {
    margin: var(--s-7) 0 var(--s-4);
    font-family: var(--body);
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold);
  }

  .mypage-group {
    border: 1px solid var(--line);
    background: var(--surface-flat);
    box-shadow: var(--plate-edge);
  }

  .mypage-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s-3) var(--s-5);
    padding: var(--s-5);
    border-bottom: 1px solid var(--line);
    color: var(--parchment-dim);
    text-decoration: none;
    transition: background-color .14s ease;
  }
  .mypage-group > .mypage-row:last-child { border-bottom: 0; }
  a.mypage-row:hover { background: rgba(194, 162, 106, .05); }
  a.mypage-row::after {
    content: "›";
    grid-column: 3;
    color: var(--muted-deep);
    font-size: 1.2rem;
    line-height: 1;
  }
  a.mypage-row { grid-template-columns: minmax(0, 1fr) auto auto; }

  .mypage-row-label { font-size: var(--fs-body); color: var(--parchment); }
  .mypage-row-value { font-size: var(--fs-sm); color: var(--muted); text-align: right; }
  .mypage-row-value.is-off  { color: var(--ember); }
  .mypage-row-value.is-soon { color: var(--muted-deep); font-style: italic; }
  .mypage-row-note {
    grid-column: 1 / -1;
    margin-top: .2rem;
    font-size: var(--fs-xs);
    line-height: 1.5;
    color: var(--muted-deep);
  }

  .notice--soon {
    grid-template-columns: minmax(0, 1fr);
    border-left-color: var(--muted-deep);
    background: rgba(140, 147, 157, .06);
    margin-bottom: var(--s-6);
  }

  @media (max-width: 32rem) {
    .mypage-tabs { gap: var(--s-5); }
    .mypage-row { padding: var(--s-4); }
    .mypage-row-label { font-size: var(--fs-sm); }
  }
}

/* =========================================================================
   My Page shell — sidebar rail + main column
   ========================================================================= */
@layer sections {
  /* The site header is fixed, so content must clear its height or the first
     heading sits underneath it. The static pages do this via
     `.page-hero .container`; My Page needs the same allowance. */
  .mypage { padding-block: calc(var(--header-h) + var(--s-7)) var(--s-9); }

  .mypage-shell { display: grid; gap: var(--s-7); }
  @media (min-width: 60rem) {
    .mypage-shell { grid-template-columns: 220px minmax(0, 1fr); gap: var(--s-9); }
  }

  .mypage-nav { display: flex; flex-direction: column; gap: .1rem; }
  @media (max-width: 59.99rem) {
    /* On narrow screens the rail becomes a scrollable strip rather than a tall
       stack that pushes the content off-screen. */
    .mypage-nav {
      flex-direction: row;
      gap: var(--s-5);
      overflow-x: auto;
      padding-bottom: var(--s-4);
      border-bottom: 1px solid var(--line);
      -webkit-overflow-scrolling: touch;
    }
    .mypage-nav-children { display: none; }
  }

  .mypage-nav-top {
    padding: .5rem 0;
    font-family: var(--body);
    font-size: var(--fs-sm);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
  }
  .mypage-nav-top:hover { color: var(--parchment-dim); }
  .mypage-nav-top.is-active { color: var(--parchment); }

  .mypage-nav-children {
    display: grid;
    gap: .1rem;
    margin: .2rem 0 var(--s-5);
    padding-left: var(--s-4);
    border-left: 1px solid var(--line);
  }
  .mypage-nav-sub {
    padding: .3rem 0;
    font-size: var(--fs-xs);
    color: var(--muted-deep);
    text-decoration: none;
  }
  .mypage-nav-sub:hover { color: var(--gold-light); }

  .mypage-heading {
    margin: 0 0 var(--s-6);
    font-family: var(--display);
    font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.3rem);
    font-weight: 400;
    color: var(--parchment);
  }
  .mypage-main > .mypage-group-title:first-of-type { margin-top: 0; }
}

@layer sections {
  /* Staff-only entry in the account rail. Marked so it reads as a different
     kind of destination, not another personal setting. */
  .mypage-nav-admin {
    margin-top: var(--s-5);
    padding-top: var(--s-4);
    border-top: 1px solid var(--line);
    color: var(--gold);
  }
  .mypage-nav-admin:hover { color: var(--gold-light); }
}

@layer sections {
  /* Inline access-level setter on the admin character rows. */
  .inline-set { display: flex; gap: var(--s-3); align-items: center; margin-top: var(--s-3); }
  .inline-set input[type="number"] {
    width: 6rem; padding: .45rem .6rem; font-size: .95rem;
    color: var(--parchment); background: var(--surface-flat);
    border: 1px solid var(--line); border-radius: 2px;
  }
  .inline-set input[type="number"]:focus-visible {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(194, 162, 106, .18);
  }
  .inline-set .btn { padding: .45rem 1rem; font-size: .8rem; }
}

@layer sections {
  /* --- support tickets ---------------------------------------------------- */

  .ticket-list { display: grid; gap: .5rem; margin-top: 1rem; }

  .ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1.1rem;
    background: var(--surface-flat);
    border: 1px solid var(--line);
    border-radius: 3px;
    text-decoration: none;
    color: var(--parchment);
  }
  .ticket-row:hover { border-color: var(--line-strong); }
  .ticket-row-main { display: grid; gap: .15rem; min-width: 0; }
  .ticket-row-subject { font-weight: 600; }
  .ticket-row-meta { font-size: .85rem; color: var(--muted); }

  .ticket-state {
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: .2rem .55rem;
    border-radius: 2px;
    white-space: nowrap;
    flex: none;
  }
  .ticket-state--info { color: #7fa6cf; background: rgba(127, 166, 207, .13); }
  .ticket-state--warn { color: #d9a441; background: rgba(217, 164, 65, .13); }
  .ticket-state--ok   { color: #6fb98a; background: rgba(111, 185, 138, .13); }
  .ticket-state--off  { color: var(--muted); background: rgba(255, 255, 255, .05); }

  .ticket-message {
    background: var(--surface-flat);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line-strong);
    border-radius: 3px;
    padding: .9rem 1.1rem;
    margin-top: .75rem;
  }
  /* Staff replies carry the accent so a conversation is readable at a glance. */
  .ticket-message.is-staff { border-left-color: var(--gold); }
  .ticket-message-who {
    margin: 0 0 .35rem;
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--gold);
  }
  .ticket-message-who span { color: var(--muted); letter-spacing: 0; text-transform: none; }
  .ticket-message-body { margin: 0; white-space: pre-wrap; }

  .form textarea {
    width: 100%;
    font: inherit;
    line-height: 1.55;
    color: var(--parchment);
    background: var(--surface-flat);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: .6rem .75rem;
    resize: vertical;
  }
  .form textarea:focus-visible {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(194, 162, 106, .18);
  }
  .form select {
    font: inherit;
    color: var(--parchment);
    background: var(--surface-flat);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: .6rem .75rem;
  }
}

@layer sections {
  /* Which class you actually pick at character creation — different from where
     the line ends, and the distinction the old roster page lost. */
  .class-origin {
    margin: .6rem 0 0;
    font-size: .86rem;
    color: var(--muted);
  }
  .class-origin b {
    color: var(--gold);
    font-weight: 600;
  }
}

@layer sections {
  /* --- creatable class cards ---------------------------------------------- */
  /* The roster lists what you PICK at creation, not every awakened class. A
     root that branches shows where it leads rather than pretending each branch
     was a separate choice. */

  .class-line-name {
    margin: -.35rem 0 .75rem;
    font-size: .82rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--gold);
  }

  .class-branches {
    margin: 0 0 .6rem;
    font-size: .86rem;
    color: var(--muted);
  }

  .branch-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .45rem;
  }
  .branch-list li {
    display: grid;
    gap: .1rem;
    padding-left: .8rem;
    border-left: 2px solid var(--line);
  }
  .branch-list b {
    font-weight: 600;
    color: var(--parchment);
  }
  .branch-list span {
    font-size: .82rem;
    color: var(--muted);
  }
}

@layer sections {
  /* A playable line that is not on the creation screen. Saying so stops a new
     player hunting for a button that is not there. */
  .class-entry-route {
    margin: -.35rem 0 .8rem;
    font-size: .78rem;
    line-height: 1.4;
    color: var(--muted-deep);
    border-left: 2px solid var(--line);
    padding-left: .6rem;
  }
}

@layer sections {
  /* =====================================================================
     CLASS ROSTER
     Twenty cards of prose over ten screens, with nothing to look at and a
     nav that scrolled away at the top. Three fixes: real card surfaces, the
     client's own sigils, and a nav that stays.
     ===================================================================== */

  /* Per-race accent. Not decoration — it is what makes eight sections
     distinguishable while scrolling past them. */
  .race[data-race="kamael"]   { --race: #b98fd6; }
  .race[data-race="human"]    { --race: #c2a26a; }
  .race[data-race="high-elf"] { --race: #d9c98a; }
  .race[data-race="elf"]      { --race: #7fc6a8; }
  .race[data-race="dark-elf"] { --race: #a97fc6; }
  .race[data-race="orc"]      { --race: #cf8560; }
  .race[data-race="dwarf"]    { --race: #cfa85f; }
  .race[data-race="sylph"]    { --race: #7fa6cf; }
  .race { --race: var(--gold); }

  /* --- sticky nav ------------------------------------------------------- */

  .race-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem 1.25rem;
    padding: .7rem 0;
    margin-bottom: 2rem;
    background: color-mix(in srgb, var(--surface-flat) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }

  .race-nav-label {
    display: flex;
    gap: 1rem;
    font-size: .78rem;
    letter-spacing: .04em;
    color: var(--muted);
  }
  /* Two different quantities sat adjacent with nothing between them. */
  .stat-pair b { color: var(--parchment); font-weight: 600; }
  .stat-pair + .stat-pair {
    padding-left: 1rem;
    border-left: 1px solid var(--line);
  }

  .race-links { display: flex; flex-wrap: wrap; gap: .35rem; }

  .race-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .6rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    color: var(--parchment-dim);
    font-size: .82rem;
    white-space: nowrap;
  }
  .race-link img { width: 20px; height: 20px; opacity: .75; }
  .race-link b { color: var(--muted-deep); font-weight: 500; font-size: .74rem; }
  .race-link:hover,
  .race-link:focus-visible {
    color: var(--parchment);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, .03);
  }
  .race-link:hover img { opacity: 1; }

  /* --- the cards -------------------------------------------------------- */

  .class-entries {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  }

  .class-entry {
    background: #10141c;
    border: 1px solid rgba(194, 162, 106, .14);
    border-top: 2px solid var(--race);
    border-radius: 4px;
    padding: 1.25rem 1.35rem 1.35rem;
  }
  .class-entry.is-creatable { border-color: rgba(194, 162, 106, .28); }

  .class-entry-head {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: .5rem;
  }
  .class-entry-head h3 { margin: 0; font-size: 1.05rem; line-height: 1.2; }
  .class-entry-head .discipline {
    font-size: .74rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted-deep);
  }

  .class-icon {
    width: 42px;
    height: 42px;
    flex: none;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, .6));
  }

  .class-entry-route {
    margin: 0 0 .9rem;
    font-size: .74rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted-deep);
  }
  .class-entry-route.is-creatable { color: var(--race); }

  /* --- progression, one grammar ---------------------------------------- */

  .progression { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
  .progression li {
    display: grid;
    grid-template-columns: 1.6rem 1fr;
    align-items: baseline;
    gap: .5rem;
    font-size: .9rem;
    color: var(--parchment-dim);
  }
  .progression .stage-n {
    font-size: .68rem;
    letter-spacing: .08em;
    color: var(--muted-deep);
    text-align: right;
  }
  .progression li.is-final { color: var(--parchment); font-weight: 600; }
  .progression li.is-final .stage-n { color: var(--race); }

  .branch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
  .branch-list li {
    display: grid;
    grid-template-columns: 30px 1fr;
    grid-template-areas: "icon name" "icon path";
    align-items: center;
    gap: 0 .6rem;
  }
  .branch-list .class-icon { grid-area: icon; width: 30px; height: 30px; }
  .branch-name { grid-area: name; font-weight: 600; font-size: .92rem; }
  .branch-path { grid-area: path; font-size: .76rem; color: var(--muted-deep); }

  /* --- race heading ----------------------------------------------------- */

  .race { scroll-margin-top: 4.5rem; }
  .race + .race { margin-top: 3rem; }
  .race-head { border-left: 3px solid var(--race); padding-left: 1rem; }
}

@layer sections {
  /* The roster is a reference page: 22 cards carrying 46 progressions is
     simply a lot of information, and the sticky nav is what makes it findable
     rather than making it short. These are the reductions available without
     hiding anything. */
  .race + .race { margin-top: 2rem; }
  .race-head { margin-bottom: 1.1rem; }
  .race-head .lead { margin-bottom: 0; font-size: .95rem; }
  .class-entries { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
  .class-entry { padding: 1.1rem 1.15rem 1.2rem; }
  .class-entry-route { margin-bottom: .7rem; }
}

@layer sections {
  /* --- lines open to more than one race --------------------------------- */
  /* Death Knight was three identical cards and Assassin was two. One card
     each now, carrying which races may take it — because the sigils being
     byte-identical does not make them the same class, and the restriction
     differs by race. */

  .race--shared { --race: var(--gold); }

  .avail-label {
    margin: 1rem 0 .4rem;
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted-deep);
  }

  .avail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
  }
  .avail-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .22rem .5rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: .8rem;
    color: var(--parchment-dim);
  }
  .avail-pill img { width: 18px; height: 18px; opacity: .8; }
  .avail-pill b {
    font-weight: 500;
    font-size: .7rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--gold);
  }
}

@layer sections {
  /* The hero headline is the chronicle wordmark rather than set type.
     It stays an <h1> with the name in `alt`, so the heading outline and the
     section's aria-labelledby are unchanged — a screen reader still hears the
     chronicle name, and the file is named by role so a rebrand is a swap. */
  .hero-title--wordmark {
    margin-bottom: var(--s-5);
    line-height: 1;
    /* The gold art carries its own highlights; the type shadow would muddy it. */
    text-shadow: none;
  }
  .hero-title--wordmark img {
    display: block;
    /* `.hero-content` is text-align:center, which centres INLINE content. A
       block element with an explicit width ignores that and sits flush left —
       440px off centre at 1440px wide. It looked fine on mobile only because
       88vw leaves barely any slack to be off by. */
    margin-inline: auto;
    width: min(38rem, 60vw);
    height: auto;
    max-width: 100%;
    filter: drop-shadow(0 6px 34px rgba(0, 0, 0, .7));
  }

  @media (max-width: 40rem) {
    .hero-title--wordmark img { width: 88vw; }
  }
}

/* ============================================================ SERVERS ======
   The Servers dropdown and the opening countdown for realms that have not
   launched. Gated behind `features.servers` - when that flag is off none of
   this markup is built, and these rules simply match nothing.
   ========================================================================== */

@layer components {

  /* --- nav dropdown ------------------------------------------------------ */

  .nav-group { position: relative; display: inline-flex; }

  /*
   * Button reset ONLY. Every typographic property - size, weight, letter-spacing,
   * uppercase, colour, the underline - comes from the shared `.site-nav a:not(.btn),
   * .site-nav .nav-group-toggle` rule above, so this control cannot drift away from
   * the links beside it.
   *
   * It did exactly that when shipped: `font: inherit` on a <button> inherits from its
   * PARENT, not from its sibling anchors, so the nav read HOME CLASSES NEWS and then
   * `Servers` - wrong case, wrong size, wrong weight, wrong tracking, wrong colour.
   * Five properties. I had verified the menu opened and linked correctly and never
   * compared it against the items next to it.
   */
  .nav-group-toggle {
    display: inline-flex; align-items: center; gap: .4em;
    background: none; border: 0; margin: 0;
    font-family: inherit; cursor: pointer;
  }
  .nav-group-toggle:hover { color: var(--gold-light); }
  .nav-group-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

  .nav-caret {
    width: .42em; height: .42em; margin-top: -.18em;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform .18s ease;
  }
  .nav-group.is-open .nav-caret { transform: rotate(-135deg); margin-top: .1em; }

  /*
     Closed by DEFAULT here, opened by .is-open - NOT by the [hidden] attribute.
     A previous menu used [hidden] and never hid: any class-based display rule
     outranks the user-agent [hidden] rule, so the menu won its own race and
     stayed on screen. Owning both states in the stylesheet removes the race
     rather than adding !important to it.
  */
  .nav-group-menu {
    display: none;
    position: absolute; top: calc(100% + .85rem); left: 50%;
    transform: translateX(-50%);
    min-width: 15.5rem; padding: .55rem;
    background: var(--surface-flat);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-md), var(--plate-edge);
    z-index: 60;
  }
  .nav-group.is-open .nav-group-menu { display: block; }

  .nav-group-heading {
    margin: .5rem .75rem .3rem;
    font-family: var(--display);
    font-size: var(--fs-label);
    letter-spacing: .18em; text-transform: uppercase;
    color: var(--gold-deep);
  }
  .nav-group-heading + .realm-link { margin-top: 0; }

  .realm-link {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1rem; padding: .5rem .75rem;
    text-decoration: none; color: var(--parchment);
    border-left: 2px solid transparent;
  }
  .realm-link:hover,
  .realm-link:focus-visible {
    background: rgba(194, 162, 106, .07);
    border-left-color: var(--gold);
    color: var(--gold-light);
  }
  .realm-name { font-family: var(--display); letter-spacing: .04em; }
  .realm-state {
    font-size: var(--fs-xs); color: var(--muted-deep);
    letter-spacing: .09em; text-transform: uppercase; white-space: nowrap;
  }
  .realm-state--open { color: var(--aqua); }

  /* LIVE REALM STATE in the server menu.

     The dot is an ADDITION to the word, never a replacement for it. Colour
     alone excludes anyone reading by screen reader and anyone who cannot
     separate the red from the green, so the state is always spelled out and the
     dot is decorative. Greens and reds match the status banner's existing
     values; maintenance is the aqua, which reads as "deliberate" rather than
     "broken". A realm with no measurement behind it gets NO dot at all - an
     absent claim should look absent. */
  .realm-state[data-realm-state]::before {
    content: ""; display: inline-block; width: .5em; height: .5em;
    border-radius: 50%; margin-right: .45em; vertical-align: baseline;
    background: currentColor;
  }
  .realm-state[data-realm-state="online"]      { color: #86c98d; }
  .realm-state[data-realm-state="offline"]     { color: #c98686; }
  .realm-state[data-realm-state="maintenance"] { color: var(--aqua); }
  .realm-state[data-realm-state="unavailable"] { color: var(--gold-light); }
  /* No dot: nothing was measured, so nothing is claimed. */
  .realm-state[data-realm-state="planned"]::before,
  .realm-state[data-realm-state="unknown"]::before { content: none; }
  .realm-state[data-realm-state="planned"],
  .realm-state[data-realm-state="unknown"]     { color: var(--muted-deep); }

  /* Before the status endpoint answers. No dot and no claim - a visitor sees
     that we are looking rather than a state we have not measured. */
  /* A DOT MEANS MEASURED. `open` is the build's own statement that a realm is
     open - true, and not a ping - so it is worded but not dotted; the measured
     `online` that replaces it brings the dot with it. */
  .realm-state[data-realm-state="open"]::before { content: none; }
  .realm-state[data-realm-state="open"]        { color: var(--aqua); }
  .realm-state[data-realm-state="pending"]::before { content: none; }
  .realm-state[data-realm-state="pending"]     { color: var(--muted-deep); }

  /* In the mobile drawer the nav is a vertical stack, so an absolutely
     positioned overlay would sit on top of the links beneath it. Inline there. */
  @media (max-width: 60rem) {
    .nav-group { display: block; width: 100%; }
    .nav-group-menu {
      position: static; transform: none; min-width: 0;
      border: 0; border-left: 1px solid var(--line);
      box-shadow: none; background: none;
      margin: .3rem 0 .6rem .35rem;
    }
  }
}

@layer sections {

  /* --- opening countdown ------------------------------------------------- */

  .realm-card {
    max-width: 46rem; margin: 0 auto; padding: clamp(1.6rem, 4vw, 2.8rem);
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-md), var(--plate-edge);
  }

  .realm-card-label {
    margin: 0 0 .55rem;
    font-family: var(--display); font-size: var(--fs-label);
    letter-spacing: .26em; text-transform: uppercase; color: var(--gold-deep);
  }

  .realm-opens {
    margin: 0 0 1.9rem;
    font-family: var(--display);
    font-size: clamp(1.25rem, .95rem + 1.1vw, 1.85rem);
    color: var(--gold-light);
  }
  .realm-opens time { border-bottom: 1px solid var(--line-strong); padding-bottom: .18em; }

  .countdown {
    display: flex; align-items: flex-start; justify-content: center;
    gap: clamp(.35rem, 2vw, 1.1rem);
  }
  .countdown-unit { min-width: 4.2rem; }

  .countdown-value {
    display: block;
    font-family: var(--display);
    /* Tabular figures: without them the width of every digit differs, so the
       seconds column jitters sideways once per second for as long as the page
       is open. */
    font-variant-numeric: tabular-nums;
    font-size: clamp(2.1rem, 1.3rem + 2.6vw, 3.4rem);
    line-height: 1; color: var(--parchment);
    text-shadow: 0 0 26px rgba(194, 162, 106, .18);
  }
  .countdown-label {
    display: block; margin-top: .5rem;
    font-size: var(--fs-label); letter-spacing: .2em;
    text-transform: uppercase; color: var(--muted-deep);
  }
  .countdown-sep {
    width: 1px; align-self: stretch; margin-top: .35rem; max-height: 2.6rem;
    background: linear-gradient(180deg, transparent, var(--line-strong), transparent);
  }

  .countdown-local {
    margin: 1.7rem 0 0; font-size: var(--fs-sm); color: var(--muted);
  }
  .countdown-open {
    margin: 1.4rem 0 0;
    font-family: var(--display); font-size: var(--fs-h3); color: var(--aqua);
  }

  .realm-notes { max-width: 44rem; margin: clamp(2.6rem, 6vw, 4.4rem) auto 0; }
  .realm-notes h2 { font-size: var(--fs-h3); letter-spacing: .04em; }
  .realm-notes p { color: var(--parchment-dim); }
  .realm-notes-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

  @media (max-width: 34rem) {
    /* Four units plus separators will not fit; drop the separators and let the
       units wrap into two rows rather than shrinking the numerals to unreadable. */
    .countdown { flex-wrap: wrap; gap: .9rem 1.6rem; }
    .countdown-sep { display: none; }
    .countdown-unit { min-width: 5.5rem; }
    /* The date wraps to two lines at this width, and an underline drawn on the
       inline <time> breaks with it - two stubby rules, one under each line,
       each stopping mid-sentence. Underlining a wrapped inline element is
       always going to look like that, so drop the rule rather than fight it. */
    .realm-opens time { border-bottom: 0; padding-bottom: 0; }
  }

  @media (prefers-reduced-motion: reduce) {
    .nav-caret { transition: none; }
  }
}

/* --- the Servers landing page ------------------------------------------------
   Three realms, read top to bottom, in the same dark-and-gold language as the
   rest of the site. Deliberately not a status dashboard: a realm's tile answers
   "what is this and can I play it", and everything else lives on its own page. */

.realm-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.realm-tile {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.6rem 1.5rem 1.5rem;
  background: rgba(12, 16, 24, .72);
  border: 1px solid rgba(194, 162, 106, .18);
  border-radius: 4px;
}

/* The open realm is the one a visitor can act on, so it carries the accent. */
.realm-tile--open { border-color: rgba(194, 162, 106, .42); }

.realm-tile-family {
  margin: 0;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #c2a26a;
}

.realm-tile-name {
  font-family: Cinzel, Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
  margin: .1rem 0 0;
}

.realm-tile-chronicle { margin: 0; color: #97a1b0; font-size: .95rem; }

.realm-tile-state {
  margin: .5rem 0 0;
  align-self: flex-start;
  padding: .2rem .6rem;
  border: 1px solid rgba(151, 161, 176, .4);
  border-radius: 999px;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #97a1b0;
}

.realm-tile-state--open {
  border-color: rgba(111, 185, 138, .55);
  color: #6fb98a;
}

.realm-tile-blurb { margin: .75rem 0 0; }
.realm-tile-opens { margin: .9rem 0 .2rem; font-size: .9rem; color: #97a1b0; }
.realm-tile-go { margin: auto 0 0; padding-top: 1.1rem; }

/* The landing page's countdown is a summary; the realm's own page carries the
   full one. Same markup and same script - only the scale differs. */
.countdown--compact { gap: .4rem; }
.countdown--compact .countdown-value { font-size: 1.35rem; }
.countdown--compact .countdown-label { font-size: .62rem; }

.realm-grid-note {
  margin: 1.75rem 0 0;
  color: #97a1b0;
  max-width: 46rem;
}

/* "All servers" closes the Servers menu: without it the menu lists realms and
   offers no way to the page that compares them. */
.realm-link--all { border-top: 1px solid rgba(194, 162, 106, .16); margin-top: .35rem; }

/* The name the GAME CLIENT draws for a realm, published beside ours.
   The client owns its server-list text and the registration packet carries none,
   so where a player can see both surfaces the site states the client's version
   rather than quietly showing something else. */
.realm-tile-client,
.realm-client-name {
  margin: .3rem 0 0;
  font-size: .85rem;
  color: #97a1b0;
}
.realm-client-name { margin-top: .9rem; }
.realm-client-name b { color: #c2a26a; font-weight: 600; }
/* --- registration hardening --------------------------------------------------
   The bot challenge sits in the form's own rhythm rather than in a boxed-off
   "security" panel: it is a step in signing up, not an apology for one. */

.form-row--challenge { margin-top: 1.1rem; }
.form-row--challenge .cf-turnstile { min-height: 65px; }

/* The honeypot. Hidden three ways because each one alone is a known bypass:
   moved off-screen rather than display:none (some bots skip display-none),
   untabbable, and hidden from assistive technology. Never `visibility:hidden`
   either - that is equally easy to test for. */
.form-row--hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* =============================================================================
   STORE — realm tabs, placement tabs, hero, catalogue grid
   -----------------------------------------------------------------------------
   Structure from store.plaync.com, walked 2026-09-27 at Josh's direction: a
   realm strip, three placement tabs under it, a wide hero card, and a grid of
   uniform cards beneath. The SHAPE is theirs; the surface is ours — obsidian,
   antique gold hairlines and elemental light, the same as every other page.

   The one place this deliberately diverges: their hero is a flat teal panel.
   Flat elemental colour is the one thing this palette never does (see the file
   header), so ours is the same panel in obsidian with the aqua present as light
   along its edges and behind the art.

   EVERY PIECE HERE HAS TO SURVIVE ITS OWN ABSENCE. A product may have no art,
   no subtitle and no badge — the single product in the catalogue today has none
   of the three — so nothing below sizes itself from an image, and no rule
   leaves a hole when the element it styles was never rendered.
   ============================================================================= */
@layer sections {

  .store-shell { display: grid; gap: var(--s-6); }
  /* The hero and the row under it are one block, not two sections. */
  .store-shell [data-role="panel"] { display: grid; gap: var(--s-5); }

  /* --- the realm strip ----------------------------------------------------- */
  .store-realms {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-6);
    padding-bottom: var(--s-3);
    border-bottom: 1px solid var(--line);
  }
  .store-realm {
    position: relative;
    appearance: none;
    border: 0;
    background: none;
    padding: var(--s-2) 0;
    text-align: left;
    color: var(--muted);
    font-family: var(--display);
    font-size: var(--fs-h3);
    letter-spacing: .08em;
    cursor: pointer;
    transition: color var(--dur) var(--ease);
  }
  .store-realm::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    transform: scaleX(0);
    transition: transform var(--dur) var(--ease-out);
  }
  .store-realm:hover { color: var(--parchment-dim); }
  .store-realm[aria-selected="true"] { color: var(--gold-light); }
  .store-realm[aria-selected="true"]::after { transform: scaleX(1); }
  .store-realm-family {
    display: block;
    font-family: var(--body);
    font-size: var(--fs-label);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted-deep);
  }

  /* --- the three placement tabs -------------------------------------------- */
  .store-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid var(--line);
    background: var(--line);
  }
  .store-tab {
    appearance: none;
    border: 0;
    padding: var(--s-4) var(--s-3);
    background: var(--surface-flat);
    color: var(--muted);
    font-family: var(--body);
    font-size: var(--fs-sm);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  }
  .store-tab:hover { color: var(--parchment-dim); background: var(--slate-700); }
  .store-tab[aria-selected="true"] {
    background: var(--surface);
    color: var(--gold-light);
    box-shadow: var(--plate-edge), inset 0 -2px 0 var(--gold-deep);
  }
  /* The count sits beside the label so an empty tab reads as empty BEFORE it is
     opened. The official store makes you click to find out. */
  .store-count { color: var(--muted-deep); font-variant-numeric: tabular-nums; }

  /* --- the hero card ------------------------------------------------------- */
  .store-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    align-content: end;
    gap: var(--s-2);
    min-height: 300px;
    padding: var(--s-7);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    box-shadow: var(--shadow-md), var(--plate-edge);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
  }
  .store-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
      radial-gradient(64% 86% at 82% 42%, rgba(111, 201, 212, .20), transparent 70%),
      radial-gradient(48% 70% at 12% 88%, rgba(157, 132, 216, .14), transparent 72%);
  }
  /* MASKED AT THE EDGES, because the art is whatever an editor uploaded.
     A cut-out object on transparency needs no mask and is unaffected by one; a
     rectangular screenshot without it reads as a photograph pasted onto the
     panel, hard edge and all. The mask costs the first case nothing and saves
     the second, so it is unconditional rather than a class somebody has to
     remember to add. */
  .store-hero-art {
    position: absolute;
    z-index: -1;
    top: 50%; right: -2%;
    transform: translateY(-50%);
    width: min(46%, 380px);
    filter: drop-shadow(0 22px 40px rgba(0, 0, 0, .55));
    -webkit-mask-image: radial-gradient(74% 74% at 50% 50%, #000 58%, transparent 100%);
            mask-image: radial-gradient(74% 74% at 50% 50%, #000 58%, transparent 100%);
    transition: transform var(--dur-slow) var(--ease-out);
  }
  .store-hero:hover .store-hero-art { transform: translateY(-50%) scale(1.04); }
  .store-hero h3 {
    margin: 0;
    max-width: 14ch;
    font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.3rem);
    line-height: 1.16;
    color: var(--parchment);
  }
  .store-hero .store-sub {
    margin: 0;
    max-width: 34ch;
    color: var(--parchment-dim);
    font-size: var(--fs-sm);
  }

  /* --- the grid ------------------------------------------------------------ */
  /* REAL GAPS, NOT THE HAIRLINE-GRID TRICK USED ELSEWHERE ON THIS SITE.
     The card grids on the class and news pages draw their dividers by giving
     the container a 1px gap over a line-coloured background, which is elegant
     when the row is full and produces empty tinted cells when it is not. Josh
     flagged exactly that on the Talking Island page on 2026-09-26: "what is up
     with the empty alternate color, it just doesn't look right."

     A store row is short by nature — a realm may have one product — so this
     grid gives each card its own border and leaves the space between them as
     nothing at all. One card looks like one card. */
  .store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
    gap: var(--s-4);
  }
  /* And it stops at four, so a wide screen does not stretch a three-product
     shelf into six tracks with three of them empty. */
  @media (min-width: 1100px) {
    .store-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }

  /* =========================================================================
     THE DISCORD PROMPT
     -------------------------------------------------------------------------
     A floating invitation, bottom right, on every page. Built from the site's
     own plate and gold rather than Discord's blurple, so it reads as part of
     this page instead of as an advert pasted onto it.

     It is HIDDEN in the markup and shown by assets/discord.js. With scripting
     off it never appears, which is deliberate - the close button would not work
     either, and a floating box that cannot be dismissed is worse than no box.
     ========================================================================= */
  .discord-prompt {
    position: fixed;
    right: var(--s-5);
    bottom: var(--s-5);
    z-index: 60;
    width: min(21rem, calc(100vw - var(--s-5) * 2));
    display: grid;
    gap: var(--s-3);
    padding: var(--s-5) var(--s-5) var(--s-4);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-md), var(--plate-edge);
    /* Out of flow entirely, so appearing a beat after load cannot reflow or
       shift anything the reader is already looking at. */
    /* ANIMATED BY CSS, NOT BY A CLASS JAVASCRIPT ADDS IN requestAnimationFrame.
       The first version started at opacity 0 and relied on rAF to add `is-open`
       - and rAF DOES NOT FIRE IN A BACKGROUNDED TAB. Load the page, switch tab
       within the 1.2s delay, and the panel became `hidden = false` with opacity
       0: invisible, still at z-index 60, still swallowing clicks in the corner.
       Measured at opacity "0" with the element shown, which is how it was
       found.

       Replacing it with a CSS animation was NOT ENOUGH, and that is the part
       worth writing down. Animations do not run in a hidden document either,
       and `fill-mode: both` holds the FIRST keyframe - so an opacity-0 start
       left exactly the same invisible, clickable panel. Measured again with
       document.hidden true, and the stylesheet confirmed as the new one before
       blaming it.

       SO NOTHING THE ELEMENT NEEDS TO BE SEEN DEPENDS ON THE ANIMATION. It is
       opaque in its own right; the animation moves it and nothing else. A
       paused or never-started animation now means "it appears without sliding",
       which is invisible to a reader, instead of "it is there and you cannot
       see it". */
    animation: lu-prompt-in .28s ease;
  }
  .discord-prompt[hidden] { display: none; }

  /* TRANSFORM ONLY. An opacity keyframe here would reintroduce the defect. */
  @keyframes lu-prompt-in {
    from { transform: translateY(.5rem); }
    to   { transform: none; }
  }

  /* THE DOOR THAT STAYS. Dismissing the panel used to remove Discord from the
     site permanently for that browser - Josh, 2026-10-08: "there is no button
     that stays to reopen the discord on the bottom right". It collapses to this
     instead, which is what the panel it was copied from does.

     Same corner, so it reads as the panel folded up rather than as a second
     thing. 3rem is above the 44px touch target with room for the mark. */
  .discord-launcher {
    position: fixed;
    right: var(--s-5);
    bottom: var(--s-5);
    z-index: 60;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-md), var(--plate-edge);
    color: var(--gold, #c9a96e);
    cursor: pointer;
    /* Same reasoning as the panel: visibility never depends on the animation
       running, because a hidden document does not run it. */
    animation: lu-launcher-in .2s ease;
    transition: border-color .2s ease;
  }
  .discord-launcher[hidden] { display: none; }

  @keyframes lu-launcher-in {
    from { transform: scale(.9); }
    to   { transform: none; }
  }
  .discord-launcher:hover { border-color: var(--gold, #c9a96e); }
  .discord-launcher:focus-visible {
    outline: 2px solid var(--gold, #c9a96e);
    outline-offset: 2px;
  }


  .discord-prompt-head {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin: 0;
    font-family: var(--display);
    font-size: 1rem;
    letter-spacing: .04em;
    color: var(--parchment);
  }
  .discord-prompt-mark { flex: none; color: var(--gold, #c9a96e); }

  .discord-prompt-body {
    margin: 0;
    font-size: var(--fs-sm, .875rem);
    line-height: 1.55;
    color: var(--muted);
  }

  .discord-prompt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    align-items: center;
    margin: var(--s-1) 0 0;
  }
  .discord-prompt-actions .btn { flex: 1 1 auto; text-align: center; }

  /* A REAL BUTTON, not a styled span: focusable, announced, and keyboard
     operable without anything extra. Sized to the 44px touch target rather than
     to the glyph, which is why the padding looks generous for an x. */
  .discord-prompt-close {
    position: absolute;
    top: .25rem;
    right: .25rem;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    background: none;
    border: 0;
    color: var(--muted-deep, var(--muted));
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
  }
  .discord-prompt-close:hover { color: var(--parchment); }
  .discord-prompt-close:focus-visible {
    outline: 2px solid var(--line-strong);
    outline-offset: -2px;
  }

  /* Phone: a strip across the bottom rather than a box sitting on the content.
     A 21rem card at 375px covers most of the screen and lands on whatever the
     reader was in the middle of. */
  @media (max-width: 620px) {
    .discord-prompt {
      right: 0;
      left: 0;
      bottom: 0;
      width: auto;
      border-left: 0;
      border-right: 0;
      border-bottom: 0;
    }
  }

  /* Somebody who asked their system to stop animating gets the panel without
     the movement. It still appears; it just does not slide. */
  @media (prefers-reduced-motion: reduce) {
    /* No movement, and still visible - `none` on the animation means the
       element simply renders at its natural state rather than at the first
       keyframe. */
    .discord-prompt, .discord-launcher { animation: none; }
  }

  /* =========================================================================
     THE VOTE PAGE
     -------------------------------------------------------------------------
     This page had NO styling at all until 2026-09-30. Its markup carried
     .vote-site, .vote-steps, .vote-actions and .vote-note, and none of them
     existed here - so it rendered as bare headings and buttons down the left
     edge. Josh: "keep them formatted properly and professionally".

     TWO CARDS MUST NOT BECOME TWO HALF-PAGE SLABS, which is what a plain
     `1fr 1fr` does with a short list. The cards take a sensible maximum width
     and sit left, the same problem and the same answer as the store's shelf.
     ========================================================================= */
  .vote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 340px));
    gap: var(--s-4);
    margin-top: var(--s-6);
  }

  .vote-site {
    display: grid;
    grid-template-rows: auto 1fr;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm, none), var(--plate-edge, none);
    overflow: hidden;
  }

  /* THE BANNER PLATE IS A FIXED HEIGHT and the logo is contained inside it.
     Vote sites' badges come in wildly different aspect ratios - a wordmark, a
     square icon - and `cover` would crop somebody's logo to a detail. `contain`
     keeps each one whole and lets the plate do the aligning, so a row of
     mismatched badges still reads as a row. */
  .vote-banner {
    display: grid;
    place-items: center;
    height: 96px;
    padding: var(--s-4);
    background: linear-gradient(180deg,
                rgba(255, 255, 255, .05), rgba(255, 255, 255, .01));
    border-bottom: 1px solid var(--line);
  }
  .vote-banner img {
    max-width: 100%;
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  /* A badge that is an ICON PLUS A WORDMARK, composed rather than baked into
     one picture. L2Votes publish theirs this way and the icon on its own is a
     third of their mark. Set to match the proportions of their own snippet:
     the icon a little under 40px, the name heavy and letterspaced in their
     gold, the tagline small and dim beneath it. */
  .vote-banner--lockup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
  }
  .vote-banner--lockup img { max-height: 38px; }
  .vote-lockup {
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: left;
  }
  .vote-lockup b {
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
    line-height: 1.2;
    /* `color` comes from the site's own accent, set inline per partner, and
       falls back to the page's own parchment rather than to black. */
    color: var(--parchment);
  }
  .vote-lockup i {
    font-size: .6rem;
    font-weight: 700;
    font-style: normal;
    letter-spacing: .09em;
    text-transform: uppercase;
    line-height: 1.2;
    color: var(--muted-deep, rgba(255, 255, 255, .4));
  }

  /* The fallback for a site whose banner we do not hold. Deliberately NOT a
     broken-image icon or a grey box: a partner we have not got round to should
     not look like a partner whose file is missing. Same plate, same height, so
     the row stays level. */
  .vote-banner--text span {
    font-family: var(--display);
    font-size: 1.15rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--parchment-dim, var(--parchment));
  }

  /* THE ACTIONS PIN TO THE BOTTOM so two cards line their buttons up whatever
     their descriptions do. `align-content: start` packed everything to the top,
     which meant a two-line description and a three-line one put their Vote
     buttons at different heights - the cards were the same size and looked
     misaligned, which is worse than being different sizes.

     Three rows: the description takes the slack, everything else keeps its own
     height. */
  .vote-body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: var(--s-3);
    padding: var(--s-5);
  }
  .vote-site { align-items: stretch; }
  .vote-site h2 {
    font-family: var(--display);
    font-size: 1.05rem;
    letter-spacing: .06em;
    margin: 0;
  }
  .vote-steps {
    margin: 0;
    font-size: var(--fs-sm, .875rem);
    line-height: 1.55;
    color: var(--muted);
  }

  /* The actions sit at the BOTTOM of the card whatever the text above does, so
     a two-line description and a four-line one still line their buttons up. */
  .vote-actions {
    display: grid;
    gap: var(--s-3);
    margin: var(--s-2) 0 0;
    align-self: end;
  }
  /* Both buttons full width of the card. They were inline and wrapped, so one
     card ended up with its two buttons side by side and the other stacked,
     depending on how long the partner's name was. */
  .vote-actions > .btn,
  .vote-actions .vote-claim-form .btn { width: 100%; text-align: center; }
  .vote-claim-form {
    display: grid;
    gap: var(--s-2);
    margin: 0;
    width: 100%;
  }

  /* WHERE THE REWARD GOES. Inside the claim form rather than once at the top of
     the page: a form submits its own fields and nothing else, so a page-level
     select would need script to copy its value into whichever form was pressed.
     Duplicating a short select is cheaper than making the claim depend on
     JavaScript. */
  .vote-deliver {
    display: grid;
    gap: .3rem;
    font-size: var(--fs-xs, .78rem);
  }
  .vote-deliver > span {
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted-deep, var(--muted));
  }
  .vote-deliver select {
    width: 100%;
    padding: .5rem .6rem;
    background: var(--slate-800, rgba(0, 0, 0, .25));
    border: 1px solid var(--line);
    color: inherit;
    font: inherit;
    font-size: var(--fs-sm, .875rem);
  }
  .vote-deliver select:focus-visible {
    outline: 2px solid var(--line-strong);
    outline-offset: 1px;
  }
  .vote-actions .btn { white-space: nowrap; }

  .vote-note {
    margin: 0;
    padding: var(--s-3) var(--s-4);
    border-left: 3px solid var(--line-strong);
    background: rgba(255, 255, 255, .03);
    font-size: var(--fs-sm, .875rem);
    line-height: 1.5;
  }
  .vote-note.success { border-left-color: var(--ok, #6fc9a8); }
  .vote-note.warn    { border-left-color: var(--warn, #d8a657); }
  .vote-note.info    { border-left-color: var(--line-strong); }

  @media (max-width: 620px) {
    .vote-grid { grid-template-columns: minmax(0, 1fr); }
    .vote-actions .btn { width: 100%; text-align: center; }
    .vote-claim-form { width: 100%; }
  }

  /* --- the featured row ----------------------------------------------------
     THE HERO IS A GRID ITEM, NOT A BANNER ABOVE ONE. It used to be rendered as
     a block with a separate grid under it, which forced the lead onto its own
     row and everything else onto a second - so a three-product Featured tab
     needed scrolling to see all three. The official store puts all three in one
     row with the hero at twice the width, and that is what this does.

     FOUR FIXED TRACKS, and the hero takes two of them. I reached first for
     `repeat(auto-fit, minmax(0, 1fr))` so a lone hero would stretch to fill the
     row; that is wrong twice over. It does not work - auto-fit needs a non-zero
     minimum to count tracks with, and a 0 minimum collapses it to one - and it
     is not what the official store does anyway: its Classic Featured tab has a
     single hero sitting at about a third of the width with empty space beside
     it, not a stretched banner. Fixed tracks reproduce all three of his tabs:

       3 featured   hero(2) + card + card   fills the row exactly
       2 featured   hero(2) + card          one empty track, as Aden has
       1 featured   hero(2)                 two empty, as Classic has

     WRITTEN AS `.store-grid.store-grid--featured`, TWO CLASSES, ON PURPOSE.
     A single-class selector here has the same specificity as the plain
     `.store-grid` rules, so it wins or loses on SOURCE ORDER - and the phone
     rule for `.store-grid` lives further down this file, after these. The first
     version of this block used one class and was silently overridden at 375px:
     three featured items came out in two rows with the hero shrunk to a card,
     which is the exact complaint this block exists to fix, reappearing at the
     one width nobody had looked at. Measured, not noticed by eye. */
  @media (min-width: 900px) {
    .store-grid.store-grid--featured {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .store-grid.store-grid--featured > .store-hero { grid-column: span 2; }
  }
  /* Narrow: one column, hero included, so nothing is squeezed to a sliver. */
  @media (max-width: 899px) {
    .store-grid.store-grid--featured { grid-template-columns: minmax(0, 1fr); }
  }
  /* The hero is taller than a card by design. In a shared row that would leave
     the cards floating at the top; stretching them keeps the row level. */
  .store-grid--featured > .store-card { align-self: stretch; }
  .store-card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: var(--s-3);
    padding: var(--s-5);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--plate-edge);
    text-decoration: none;
    color: inherit;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  }
  .store-card:hover { background: var(--slate-700); border-color: var(--line-strong); }
  .store-card-art {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    background: radial-gradient(58% 58% at 50% 46%, rgba(194, 162, 106, .10), transparent 72%);
  }
  .store-card-art img {
    max-width: 78%;
    max-height: 78%;
    /* Same reasoning as the hero: see the note on .store-hero-art. */
    -webkit-mask-image: radial-gradient(76% 76% at 50% 50%, #000 62%, transparent 100%);
            mask-image: radial-gradient(76% 76% at 50% 50%, #000 62%, transparent 100%);
    transition: transform var(--dur-slow) var(--ease-out);
  }
  .store-card:hover .store-card-art img { transform: scale(1.06); }
  /* The placeholder for a product with no art yet. A sigil rather than a grey
     box: an empty frame reads as a failed image, and this reads as a product
     nobody has drawn yet — which is what it is. */
  .store-card-art[data-art="none"]::after {
    content: "";
    width: 44%;
    aspect-ratio: 1;
    border: 1px solid var(--line-strong);
    transform: rotate(45deg);
    opacity: .5;
  }
  .store-badge {
    position: absolute;
    right: 6%; bottom: 6%;
    padding: .15rem .5rem;
    border: 1px solid var(--line-strong);
    background: rgba(6, 8, 12, .82);
    color: var(--gold-light);
    font-size: var(--fs-xs);
    letter-spacing: .06em;
    font-variant-numeric: tabular-nums;
  }
  .store-card h3 {
    margin: 0;
    font-family: var(--body);
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .01em;
    color: var(--parchment);
  }
  .store-price {
    margin: 0;
    color: var(--gold-light);
    font-size: var(--fs-body);
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
  }
  .store-hero .store-price { font-size: 1.3rem; }

  /* --- the states that are not products ------------------------------------ */
  /* An empty shelf and a broken shelf look identical to a shopper, and only one
     of them is worth anybody hearing about. Same rule the old page followed; it
     is why this has a class of its own rather than being a bare paragraph. */
  .store-state {
    margin: 0;
    padding: var(--s-8) var(--s-5);
    border: 1px dashed var(--line);
    text-align: center;
    color: var(--muted);
    font-size: var(--fs-sm);
  }
  .store-state--error { border-color: rgba(201, 138, 74, .34); color: var(--parchment-dim); }

  @media (max-width: 620px) {
    .store-tab { padding: var(--s-3) var(--s-2); font-size: var(--fs-xs); letter-spacing: .12em; }
    .store-hero { min-height: 230px; padding: var(--s-5); }
    .store-hero-art { width: 42%; right: -8%; opacity: .85; }
    .store-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  }

  /* Somebody who asked their system to stop animating gets the layout and none
     of the movement. The hover transforms above are the whole effect, so this
     is one block rather than a list. */
  @media (prefers-reduced-motion: reduce) {
    .store-hero-art,
    .store-card-art img,
    .store-realm::after { transition: none; }
    .store-hero:hover .store-hero-art { transform: translateY(-50%); }
    .store-card:hover .store-card-art img { transform: none; }
  }
}

/* =============================================================================
   PRODUCT — the detail page under /shop/product/
   -----------------------------------------------------------------------------
   Two columns on a wide screen, art left and everything you decide with on the
   right, which is the arrangement the official store uses and the one that puts
   price, realm and quantity in a single glance.

   One column below 900px, art first. On a phone the art is the thing that tells
   you you opened the right product.
   ============================================================================= */
@layer sections {

  .product-layout { display: grid; gap: var(--s-6); }
  @media (min-width: 900px) {
    .product-layout {
      grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
      gap: var(--s-8);
      align-items: start;
    }
  }

  .product-art {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    padding: var(--s-6);
    border: 1px solid var(--line);
    background:
      radial-gradient(62% 62% at 50% 46%, rgba(111, 201, 212, .12), transparent 74%),
      var(--surface);
    box-shadow: var(--shadow-md), var(--plate-edge);
    overflow: hidden;
  }
  .product-art img {
    max-width: 82%;
    max-height: 82%;
    filter: drop-shadow(0 18px 34px rgba(0, 0, 0, .5));
    /* Same masking reasoning as the store cards - see .store-hero-art. */
    -webkit-mask-image: radial-gradient(76% 76% at 50% 50%, #000 62%, transparent 100%);
            mask-image: radial-gradient(76% 76% at 50% 50%, #000 62%, transparent 100%);
  }
  .product-art-empty {
    width: 38%;
    aspect-ratio: 1;
    border: 1px solid var(--line-strong);
    transform: rotate(45deg);
    opacity: .5;
  }

  .product-detail { display: grid; gap: var(--s-4); align-content: start; }
  .product-detail h1 { margin: 0; font-size: var(--fs-h2); line-height: 1.12; }
  .product-detail .eyebrow a { color: inherit; text-decoration: none; }
  .product-detail .eyebrow a:hover { color: var(--gold-light); }
  .product-detail .lead { margin: 0; }

  /* The realm line. Gold, bordered and above the price, because it is the one
     claim on this page a buyer cannot verify for themselves afterwards. */
  .product-realm {
    margin: 0;
    padding: var(--s-3) var(--s-4);
    border-left: 2px solid var(--gold-deep);
    background: rgba(194, 162, 106, .06);
    font-size: var(--fs-sm);
    color: var(--parchment-dim);
  }
  .product-realm strong { color: var(--gold-light); }
  .product-realm span {
    margin-left: .4rem;
    font-size: var(--fs-label);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted-deep);
  }
  .product-realm--none { border-left-color: var(--ember); color: var(--parchment-dim); }

  .product-price {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem);
    color: var(--gold-light);
    font-variant-numeric: tabular-nums;
  }
  .product-desc { margin: 0; color: var(--muted); font-size: var(--fs-sm); max-width: var(--measure); }
  .product-note { margin: 0; color: var(--muted-deep); font-size: var(--fs-xs); }

  .product-buy {
    display: grid;
    gap: var(--s-4);
    margin-top: var(--s-2);
    padding: var(--s-5);
    border: 1px solid var(--line);
    background: var(--surface-flat);
    box-shadow: var(--plate-edge);
  }
  @media (min-width: 560px) {
    .product-buy { grid-template-columns: auto 1fr auto; align-items: end; }
  }
  .product-qty { display: grid; gap: var(--s-2); }
  .product-qty span {
    font-size: var(--fs-label);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted-deep);
  }
  .product-qty input {
    width: 6rem;
    padding: var(--s-3);
    border: 1px solid var(--line);
    background: var(--slate-800);
    color: var(--parchment);
    font: inherit;
    font-variant-numeric: tabular-nums;
  }
  .product-qty input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
  .product-total {
    margin: 0;
    font-size: var(--fs-label);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted-deep);
  }
  .product-total strong {
    display: block;
    margin-top: var(--s-1);
    font-family: var(--display);
    font-size: 1.4rem;
    letter-spacing: normal;
    text-transform: none;
    color: var(--parchment);
    font-variant-numeric: tabular-nums;
  }
  /* A product with no realm has nowhere to be delivered, so the control says so
     rather than accepting a click that could only fail later. */
  .product-purchase[aria-disabled="true"] {
    pointer-events: none;
    opacity: .4;
  }

  .product-body {
    margin-top: var(--s-3);
    padding-top: var(--s-5);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: var(--fs-sm);
    white-space: pre-wrap;
    max-width: var(--measure);
  }
}

/* =============================================================================
   NCOIN HISTORY — the one table on the public site
   -----------------------------------------------------------------------------
   There is no table styling anywhere else here, because nothing else on the
   public site is tabular. This is, genuinely: four columns of the same shape
   repeated, where a reader compares DOWN a column — "when did my balance drop"
   — rather than reading each row as prose. Rendering it as cards would make
   that comparison impossible.

   Numbers are tabular-figure and right-aligned so the digits line up and a
   balance that changed by an order of magnitude is visible without reading it.
   ============================================================================= */
@layer sections {

  .ncoin-history {
    width: 100%;
    margin-top: var(--s-4);
    border-collapse: collapse;
    font-size: var(--fs-sm);
  }
  .ncoin-history th,
  .ncoin-history td {
    padding: var(--s-3) var(--s-2);
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: baseline;
  }
  .ncoin-history th {
    font-family: var(--body);
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted-deep);
    border-bottom-color: var(--line-strong);
  }
  .ncoin-history td { color: var(--parchment-dim); }
  .ncoin-history tr:last-child td { border-bottom: 0; }

  /* The two number columns. Right-aligned and tabular so the digits stack. */
  .ncoin-history td:nth-child(3),
  .ncoin-history td:nth-child(4),
  .ncoin-history th:nth-child(3),
  .ncoin-history th:nth-child(4) {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  /* Money in is gold, money out is plain. NOT red and green: the difference
     here is not good and bad — a purchase is what the player came to do. */
  .ncoin-history td.is-in { color: var(--gold-light); }

  .ncoin-history caption {
    caption-side: top;
    padding-bottom: var(--s-2);
    text-align: left;
    color: var(--muted);
    font-size: var(--fs-xs);
  }

  /* On a phone the first column is the one that can give: a date is
     recoverable from order, an amount is not. */
  @media (max-width: 560px) {
    .ncoin-history th:first-child,
    .ncoin-history td:first-child { display: none; }
  }
}

@layer sections {
  /* Sits above the realm strip, the way the official store puts its balance and
     Purchase button above the tabs: the first thing a shopper needs is not a
     product, it is the currency everything here is priced in. */
  .store-wallet {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s-4);
    margin: 0 0 var(--s-5);
  }
  .store-wallet-balance {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
  }
  .store-wallet-balance img { flex: none; }
  .store-wallet-balance b {
    font-family: var(--display);
    font-size: 1.15rem;
    line-height: 1;
    color: var(--gold-light);
    font-variant-numeric: tabular-nums;
  }
  @media (max-width: 560px) {
    .store-wallet { justify-content: space-between; }
  }
}

/* =============================================================================
   NCOIN BAR — balance and top-up, at the top of the Payment page
   -----------------------------------------------------------------------------
   The shape is the row Josh supplied from the official store: the name on the
   left, the coin mark and the number in the middle, a Purchase button on the
   right. Theirs is a white card; this is the same arrangement on our own
   surface, with the gold hairline the rest of the console uses.

   The number is the only thing here that changes, so it is the only thing given
   emphasis — gold, tabular, and larger than its label.
   ============================================================================= */
@layer sections {

  .ncoin-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--s-4);
    margin-bottom: var(--s-6);
    padding: var(--s-4) var(--s-5);
    border: 1px solid var(--line-strong);
    background:
      radial-gradient(60% 200% at 100% 50%, rgba(111, 201, 212, .07), transparent 70%),
      var(--surface);
    box-shadow: var(--plate-edge);
  }

  .ncoin-bar-label {
    font-size: var(--fs-label);
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--muted-deep);
  }

  /* Pushed to the right of the flexible column so it sits beside the button,
     the way the official row reads: label ... amount [Purchase]. */
  .ncoin-bar-amount {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s-2);
  }
  .ncoin-bar-amount img {
    /* Published at 44px and drawn at 22, so a retina screen gets an exact 2x
       and nothing is ever upscaled. */
    width: 22px;
    height: 22px;
    flex: none;
  }
  .ncoin-bar-amount b {
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1;
    color: var(--gold-light);
    font-variant-numeric: tabular-nums;
  }

  /* No wallet yet. Says so in words rather than showing a zero, because zero
     and "nowhere to hold it" are different problems that look the same as a
     number. */
  .ncoin-bar-note {
    justify-self: end;
    color: var(--muted);
    font-size: var(--fs-sm);
  }

  @media (max-width: 560px) {
    .ncoin-bar {
      grid-template-columns: 1fr auto;
      row-gap: var(--s-3);
    }
    .ncoin-bar-label { grid-column: 1; }
    .ncoin-bar-amount { grid-column: 2; }
    /* The button takes the full width below, where it is a target rather than
       something to aim at between two other things. */
    .ncoin-bar .btn { grid-column: 1 / -1; text-align: center; }
    .ncoin-bar-note { grid-column: 1 / -1; justify-self: start; }
  }
}

/* =============================================================================
   PACK PICKER — choosing how much NCoin to buy
   -----------------------------------------------------------------------------
   The arrangement is the one from the official store: a grid of amounts, the
   coin mark and the NCoin figure large, the money price small beside it, and
   the resulting balance stated above. Theirs is a white modal; this is the same
   arrangement on our own surface.

   THE TILES ARE REAL RADIO INPUTS. The input is hidden visually and NOT with
   `display:none`, because a display-none radio is unreachable by keyboard - the
   whole grid would become unusable for anyone not using a mouse, silently. It
   keeps its focus ring, drawn on the tile.
   ============================================================================= */
@layer sections {

  .pack-picker { display: grid; gap: var(--s-5); }

  .pack-picker-head { display: grid; gap: var(--s-2); }
  .pack-picker-head h2 { margin: 0; }
  .pack-after { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
  .pack-after b {
    color: var(--gold-light);
    font-variant-numeric: tabular-nums;
    font-size: 1.05rem;
  }

  .pack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: var(--s-3);
  }
  @media (min-width: 640px) {
    /* Two across, like the official grid. `auto-fit` above would make four on a
       wide screen and turn a six-pack list into two ragged rows. */
    .pack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  .pack { position: relative; display: block; cursor: pointer; }

  /* Visually hidden, NOT display:none — see the block comment above. */
  .pack input {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip-path: inset(50%);
    overflow: hidden;
  }

  .pack-body {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-4) var(--s-5);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--plate-edge);
    transition: border-color var(--dur) var(--ease),
                background var(--dur) var(--ease);
  }
  .pack:hover .pack-body { border-color: var(--line-strong); }

  .pack-coin { flex: none; }
  .pack-ncoin {
    font-family: var(--display);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
    color: var(--parchment);
    font-variant-numeric: tabular-nums;
  }
  /* Pushed to the far edge so the money price lines up down the column and can
     be compared without reading each tile. */
  .pack-price {
    margin-left: auto;
    color: var(--muted);
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
  }

  /* The chosen one. A gold edge and a mark, because colour alone is not a
     state anyone can rely on. */
  .pack input:checked + .pack-body {
    border-color: var(--gold);
    background: linear-gradient(160deg, #1a2130 0%, #10161f 66%);
  }
  .pack input:checked + .pack-body::after {
    content: "";
    width: 16px; height: 16px;
    margin-left: var(--s-2);
    flex: none;
    border-left: 2px solid var(--gold-light);
    border-bottom: 2px solid var(--gold-light);
    transform: rotate(-45deg) translate(2px, -2px);
  }
  .pack input:checked + .pack-body .pack-ncoin { color: var(--gold-light); }

  /* The focus ring lives on the tile, since the input it belongs to is hidden. */
  .pack input:focus-visible + .pack-body {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
  }

  .pack-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-3) var(--s-5);
  }
  .pack-note { color: var(--muted-deep); font-size: var(--fs-xs); }

  @media (prefers-reduced-motion: reduce) {
    .pack-body { transition: none; }
  }
}
