/* ==========================================================================
   TCG Keepr — design system
   Single stylesheet, no build step, no external dependencies.
   ========================================================================== */

:root {
  /* Base surfaces */
  --bg:            #080a0f;
  --bg-alt:        #0c0f16;
  --panel:         #111520;
  --panel-2:       #161b28;
  --line:          #232a3a;
  --line-soft:     #1a2030;

  /* Ink */
  --ink:           #e8ecf5;
  --ink-2:         #aeb8cc;
  --ink-3:         #7b8699;
  --ink-4:         #58607255;

  /* Accents */
  --accent:        #5b8dff;
  --accent-2:      #38e0c8;
  --accent-3:      #ff64b4;
  --gold:          #f5c451;
  --danger:        #ff6b6b;
  --ok:            #3ddc97;

  /* Holo gradient — used sparingly, it's the brand signature */
  --holo: linear-gradient(100deg, #ff64b4 0%, #a06bff 22%, #5b8dff 46%, #38e0c8 70%, #f5c451 100%);

  /* Type */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Metrics */
  --radius:    14px;
  --radius-sm: 9px;
  --maxw:      1180px;
  --gutter:    clamp(1rem, 4vw, 2.5rem);
}

/* --------------------------------------------------------------- reset -- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* `clip`, not `hidden`: overflow-x:hidden on body turns it into a scroll
     container, which breaks position:sticky on the header. `clip` contains
     stray overflow without creating one. */
  overflow-x: clip;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  line-height: 1.15;
  letter-spacing: -0.022em;
  margin: 0 0 .6em;
  font-weight: 680;
}
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.35rem); }
h3 { font-size: clamp(1.12rem, 2vw, 1.35rem); }
h4 { font-size: 1rem; letter-spacing: 0; }
p  { margin: 0 0 1.15em; color: var(--ink-2); }

code, kbd, pre, .mono { font-family: var(--mono); font-size: .875em; }

code:not(pre code) {
  background: #1b2233;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: .12em .42em;
  color: #b9c9f0;
  white-space: nowrap;
}

hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

::selection { background: rgba(91,141,255,.32); }

/* -------------------------------------------------------------- layout -- */

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-narrow { max-width: 860px; }

section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
section.tight { padding-block: clamp(2.2rem, 5vw, 3.6rem); }

.grid { display: grid; gap: 1.25rem; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

@media (max-width: 900px) {
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
}

.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.tiny  { font-size: .8rem; }
.nowrap { white-space: nowrap; }

/* --------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(8,10,15,.82);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .bar {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: .8rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 760;
  letter-spacing: -.03em;
  font-size: 1.12rem;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 30px; height: 30px;
  flex: none;
  /* 7px ≈ the SVG's own rx=15 at this scale (15/64 × 30), so the 1px ring
     below hugs the artwork instead of floating off its corners */
  border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.09), 0 6px 18px -8px rgba(91,141,255,.9);
}
.brand em { font-style: normal; color: var(--ink-3); font-weight: 500; }

.nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
}
.nav a {
  color: var(--ink-2);
  font-size: .92rem;
  font-weight: 520;
  padding: .45rem .68rem;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--panel-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--ink); background: var(--panel-2); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: .45rem .7rem;
  font: inherit; font-size: .9rem;
  cursor: pointer;
}

@media (max-width: 940px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line);
    padding: .5rem var(--gutter) 1rem;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: .7rem .5rem; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
  .nav .btn { margin-top: .8rem; text-align: center; border-bottom: 0; }
}

/* -------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .68rem 1.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 620;
  font-size: .94rem;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(180deg, #6b98ff, #4276f0);
  color: #fff;
  box-shadow: 0 10px 26px -14px rgba(91,141,255,.95);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 32px -14px rgba(91,141,255,1); }
.btn-ghost {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: #33405c; background: #1b2131; }
.btn-sm { padding: .48rem .8rem; font-size: .86rem; }

/* ---------------------------------------------------------------- hero -- */

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 130%;
  background:
    radial-gradient(52% 42% at 18% 8%,  rgba(91,141,255,.20), transparent 62%),
    radial-gradient(46% 40% at 82% 4%,  rgba(255,100,180,.14), transparent 60%),
    radial-gradient(40% 38% at 55% 46%, rgba(56,224,200,.10), transparent 62%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 { margin-bottom: .5em; }
.hero .lede { font-size: clamp(1.02rem, 1.5vw, 1.18rem); color: var(--ink-2); max-width: 56ch; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line);
  background: var(--panel);
  padding: .32rem .7rem;
  border-radius: 100px;
  margin-bottom: 1.4rem;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(61,220,151,.16);
}

.gradient-text {
  background: var(--holo);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.9rem; }

/* -------------------------------------------------------- card visuals -- */

.slab {
  position: relative;
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(165deg, #1b2130, #0e121b);
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -50px #000, inset 0 1px 0 rgba(255,255,255,.05);
}
.slab-label {
  display: flex;
  align-items: center;
  gap: .7rem;
  background: linear-gradient(180deg, #f3f5fa, #d8dde8);
  color: #10131a;
  border-radius: 8px;
  padding: .55rem .7rem;
  margin-bottom: 12px;
}
.slab-label .grade {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1;
  padding: .28rem .5rem;
  border-radius: 6px;
  background: #10131a;
  color: #ffd76e;
}
.slab-label .meta { font-size: .72rem; line-height: 1.32; letter-spacing: .01em; }
.slab-label .meta strong { display: block; font-size: .84rem; letter-spacing: -.01em; }
.slab-label .cert { margin-left: auto; text-align: right; font-family: var(--mono); font-size: .64rem; color: #495166; }

.slab-window {
  aspect-ratio: 63 / 88;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.1), rgba(255,255,255,0) 45%),
    var(--holo);
  background-size: 300% 300%;
  animation: holoshift 9s ease-in-out infinite;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.slab-window::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.14) 0 2px, transparent 2px 9px);
  mix-blend-mode: overlay;
}
.slab-window .figure {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .12em;
  color: #0a0d14;
  background: rgba(255,255,255,.72);
  padding: .4rem .8rem;
  border-radius: 100px;
  z-index: 1;
  text-transform: uppercase;
}

@keyframes holoshift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .slab-window { animation: none; }
  html { scroll-behavior: auto; }
}

/* --------------------------------------------------------------- cards -- */

.card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.45rem 1.4rem;
  position: relative;
}
.card h3 { margin-bottom: .45rem; }
.card p:last-child { margin-bottom: 0; }
.card-hover { transition: border-color .18s ease, transform .18s ease; }
.card-hover:hover { border-color: #2e3a55; transform: translateY(-2px); }

.card .icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  margin-bottom: .95rem;
  font-size: 1rem;
}

.numbered { counter-reset: step; }
.numbered .card::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--accent);
  letter-spacing: .1em;
  display: block;
  margin-bottom: .6rem;
}

/* ---------------------------------------------------------------- stats -- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.stats > div { background: var(--panel); padding: 1.3rem 1.25rem; }
.stats .n {
  font-family: var(--mono);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
  display: block;
}
.stats .k { font-size: .8rem; color: var(--ink-3); letter-spacing: .02em; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* --------------------------------------------------------------- table -- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel);
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .89rem;
  min-width: 560px;
}
thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  white-space: nowrap;
}
tbody td {
  padding: .78rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #141926; }
tbody td strong, tbody th { color: var(--ink); }
tbody th {
  text-align: left;
  font-weight: 620;
  padding: .78rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- code -- */

pre {
  background: #0a0d15;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.3rem;
  line-height: 1.6;
  font-size: .82rem;
  -webkit-overflow-scrolling: touch;
}
pre code { color: #c3cee6; white-space: pre; }
.tok-key { color: #8fb2ff; }
.tok-str { color: #7ee0b8; }
.tok-num { color: #f5c451; }
.tok-com { color: #59627a; font-style: italic; }
.tok-fn  { color: #ff9ecb; }
.tok-punc{ color: #6f7a92; }

.code-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--line-soft);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--panel-2);
  padding: .55rem 1rem;
}
.code-head + pre { border-radius: 0 0 var(--radius) var(--radius); }
.code-head .verb {
  font-weight: 700;
  color: #0a0d14;
  background: var(--accent-2);
  border-radius: 4px;
  padding: .05rem .38rem;
  letter-spacing: .04em;
}
.code-head .verb.post { background: var(--gold); }
.code-head .verb.get  { background: var(--accent-2); }

/* --------------------------------------------------------------- badges -- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge.ok    { color: var(--ok);     border-color: rgba(61,220,151,.35);  background: rgba(61,220,151,.08); }
.badge.warn  { color: var(--gold);   border-color: rgba(245,196,81,.35);  background: rgba(245,196,81,.08); }
.badge.bad   { color: var(--danger); border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.08); }
.badge.info  { color: var(--accent); border-color: rgba(91,141,255,.35);  background: rgba(91,141,255,.08); }

/* --------------------------------------------------------------- notes -- */

.note {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(91,141,255,.07), transparent 70%);
  padding: 1rem 1.15rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.6rem 0;
}
.note p:last-child { margin-bottom: 0; }
.note.warn   { border-left-color: var(--gold);   background: linear-gradient(90deg, rgba(245,196,81,.07), transparent 70%); }
.note.danger { border-left-color: var(--danger); background: linear-gradient(90deg, rgba(255,107,107,.07), transparent 70%); }
.note strong { color: var(--ink); }

/* ---------------------------------------------------------- section head -- */

.sec-head { max-width: 68ch; margin-bottom: 2.4rem; }
.sec-head .kicker {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: .8rem;
}
.sec-head.center { margin-inline: auto; text-align: center; }

/* --------------------------------------------------------------- steps -- */

.flow { position: relative; display: grid; gap: 0; }
.flow-step {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 1.4rem;
  padding-bottom: 2.2rem;
  position: relative;
}
.flow-step:last-child { padding-bottom: 0; }
.flow-step::before {
  content: "";
  position: absolute;
  left: 25px; top: 52px; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, var(--line), transparent);
}
.flow-step:last-child::before { display: none; }
.flow-num {
  width: 51px; height: 51px;
  border-radius: 13px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: .95rem;
  color: var(--accent);
  position: relative; z-index: 1;
}
.flow-body h3 { margin-bottom: .35rem; }
.flow-body p:last-child { margin-bottom: 0; }
@media (max-width: 620px) {
  .flow-step { grid-template-columns: 1fr; gap: .8rem; }
  .flow-step::before { display: none; }
}

/* -------------------------------------------------------------- ledger -- */

.ledger {
  font-family: var(--mono);
  font-size: .8rem;
  background: #0a0d15;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.ledger-row {
  display: grid;
  /* minmax(0,…) — an auto-min fr track will not shrink below its nowrap
     content, which blows the page out horizontally on narrow screens */
  grid-template-columns: minmax(0,1.1fr) minmax(0,1.5fr) minmax(0,1fr) minmax(0,.8fr);
  gap: 1rem;
  padding: .62rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-row.head { color: var(--ink-3); background: var(--panel-2); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.ledger-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger .dr { color: var(--accent-2); }
.ledger .cr { color: var(--accent-3); }
@media (max-width: 720px) {
  .ledger-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); font-size: .72rem; gap: .5rem; }
}

/* ------------------------------------------------------------- markers -- */

.checks { list-style: none; padding: 0; margin: 0; }
.checks li {
  position: relative;
  padding-left: 1.7rem;
  margin-bottom: .6rem;
  color: var(--ink-2);
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0; top: .55em;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(91,141,255,.13);
}
.checks.teal li::before { background: var(--accent-2); box-shadow: 0 0 0 3px rgba(56,224,200,.13); }
.checks.gold li::before { background: var(--gold);     box-shadow: 0 0 0 3px rgba(245,196,81,.13); }

dl.spec { margin: 0; }
dl.spec div {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 1rem;
  padding: .62rem 0;
  border-bottom: 1px solid var(--line-soft);
}
dl.spec div:last-child { border-bottom: 0; }
dl.spec dt { font-family: var(--mono); font-size: .78rem; color: var(--ink-3); letter-spacing: .02em; }
dl.spec dd { margin: 0; color: var(--ink-2); font-size: .92rem; }
@media (max-width: 620px) { dl.spec div { grid-template-columns: 1fr; gap: .2rem; } }

/* ------------------------------------------------------------ facility -- */

.facility {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.facility-head {
  padding: 1.3rem 1.4rem;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.facility-head h3 { margin: 0 0 .15rem; }
.facility-head .code {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--ink-3);
  letter-spacing: .1em;
}
.facility-body { padding: 1.3rem 1.4rem; }

/* --------------------------------------------------------------- tabs -- */

.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.tab {
  font: inherit;
  font-size: .88rem;
  font-weight: 560;
  padding: .48rem .9rem;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-3);
  cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--panel-2); color: var(--ink); border-color: #33405c; }
.tabpanel[hidden] { display: none; }

/* -------------------------------------------------------------- footer -- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  background: var(--bg-alt);
  padding-block: 3.2rem 2.2rem;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2rem;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .9rem;
  font-weight: 600;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer li a { color: var(--ink-2); font-size: .9rem; }
.site-footer li a:hover { color: var(--ink); }
.colophon {
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  color: var(--ink-3);
  font-size: .82rem;
}

/* ------------------------------------------------------------ page head -- */

.page-head {
  padding-block: clamp(2.6rem, 6vw, 4.2rem) clamp(1.6rem, 3vw, 2.4rem);
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(60% 100% at 12% 0%, rgba(91,141,255,.13), transparent 60%),
    var(--bg-alt);
}
.page-head h1 { margin-bottom: .35em; }
.page-head p { max-width: 68ch; font-size: 1.05rem; margin-bottom: 0; }
.crumb {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1.1rem;
}
.crumb a { color: var(--ink-3); }

/* ----------------------------------------------------------------- toc -- */

.toc {
  border: 1px solid var(--line-soft);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem;
  margin-bottom: 2.6rem;
}
.toc h4 { margin-bottom: .7rem; color: var(--ink-3); font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: 2rem; }
.toc li { margin-bottom: .3rem; font-size: .9rem; }
@media (max-width: 620px) { .toc ol { columns: 1; } }

/* --------------------------------------------------------------- misc -- */

.rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.rule-grid > div { background: var(--panel); padding: 1.15rem 1.2rem; }
.rule-grid h4 { margin-bottom: .3rem; color: var(--ink); }
.rule-grid p { margin: 0; font-size: .87rem; }

.centering-vis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px,1fr));
  gap: 1rem;
}
.centering-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: .9rem;
  text-align: center;
}
.centering-frame {
  aspect-ratio: 63/88;
  border-radius: 5px;
  background: #1d2433;
  padding: var(--pad-t, 10%) var(--pad-r, 10%) var(--pad-b, 10%) var(--pad-l, 10%);
  margin-bottom: .7rem;
}
.centering-frame > div {
  width: 100%; height: 100%;
  border-radius: 2px;
  background: var(--holo);
  background-size: 200% 200%;
}
.centering-card .lbl { font-family: var(--mono); font-size: .74rem; color: var(--ink-2); }
.centering-card .verdict { font-size: .72rem; margin-top: .2rem; }

.kv-inline { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }

.anchor-h { scroll-margin-top: 100px; }

/* homepage card gallery — real printings, with a holo fallback beneath */
.gallery-art {
  aspect-ratio: 63/88;
  border-radius: 9px;
  background: var(--holo);
  background-size: 220% 220%;
  overflow: hidden;
  margin-bottom: .85rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.gallery-art img { width: 100%; height: 100%; object-fit: contain; background: #0a0d14; }
#gallery figcaption strong { display: block; font-size: .96rem; margin-bottom: .15rem; }
#gallery figcaption .mono { display: block; color: var(--ink-3); margin-bottom: .5rem; line-height: 1.4; }

.cta-band {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(2rem, 5vw, 3.2rem);
  background:
    radial-gradient(70% 130% at 8% 0%, rgba(91,141,255,.16), transparent 62%),
    radial-gradient(60% 120% at 92% 100%, rgba(255,100,180,.12), transparent 60%),
    var(--panel);
  text-align: center;
}
.cta-band h2 { margin-bottom: .4em; }
.cta-band p { max-width: 56ch; margin-inline: auto; }

/* focus states */
a:focus-visible, button:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
