/* =========================================================
   Midnight 1911 · site styles (from concept B «ნეონის ნუარი», Neon Noir)
   A 1911 night street after rain: near-black base, a teal tube
   and a red tube, cold steel type. Editorial, cinematic.
   Every colour lives in :root. Components only read tokens.
   ========================================================= */

:root {
  /* ink: the night */
  --ink-0: #07090c;
  --ink-1: #0a0e13;
  --ink-2: #0e141a;
  --ink-3: #141c24;
  --ink-4: #1b2530;
  --ink-film: #020304;

  /* steel: the type */
  --steel-0: #eef3f6;
  --steel-1: #cfd8df;
  --steel-2: #97a4b0;
  --steel-3: #67737e;
  --steel-4: #3b4651;
  --white: #ffffff;

  /* the two tubes */
  --teal: #2de2e6;
  --red: #ff3b4e;
  --amber: #ffcfa6;
  --tube-teal: color-mix(in srgb, var(--teal) 42%, var(--white));
  --tube-red: color-mix(in srgb, var(--red) 52%, var(--white));

  /* lines + surfaces */
  --line: color-mix(in srgb, var(--steel-1) 11%, transparent);
  --line-2: color-mix(in srgb, var(--steel-1) 20%, transparent);
  --line-soft: color-mix(in srgb, var(--steel-1) 7%, transparent);
  --glass: color-mix(in srgb, var(--ink-0) 70%, transparent);
  --nav-bg: color-mix(in srgb, var(--ink-0) 84%, transparent);
  --hl: color-mix(in srgb, var(--teal) 34%, transparent);
  --focus: var(--teal);
  --edge: linear-gradient(90deg, var(--teal), color-mix(in srgb, var(--teal) 45%, var(--red)) 52%, var(--red));

  /* glows */
  --glow-teal: 0 0 4px color-mix(in srgb, var(--teal) 80%, transparent), 0 0 18px color-mix(in srgb, var(--teal) 50%, transparent), 0 0 44px color-mix(in srgb, var(--teal) 28%, transparent);
  --glow-red: 0 0 4px color-mix(in srgb, var(--red) 80%, transparent), 0 0 18px color-mix(in srgb, var(--red) 50%, transparent), 0 0 44px color-mix(in srgb, var(--red) 28%, transparent);
  --glow-teal-soft: 0 0 14px color-mix(in srgb, var(--teal) 40%, transparent);
  --glow-red-soft: 0 0 14px color-mix(in srgb, var(--red) 40%, transparent);
  --shadow-card: 0 30px 60px -30px color-mix(in srgb, var(--ink-film) 90%, transparent);

  /* type */
  --font-sans: "MD Sans", system-ui, sans-serif;
  --font-disp: "MD Disp", "MD Sans", sans-serif;
  --font-num: "MD Num", "MD Sans", sans-serif;
  --font-mono: Consolas, "DejaVu Sans Mono", ui-monospace, monospace;

  /* layout */
  --nav-h: 68px;
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1240px;
  --r: 14px;
  --r-lg: 22px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* neon sign (assets/kit/neon-sign.js) */
  --neon-1: var(--teal);
  --neon-2: var(--red);
  --neon-off: .12;
  --neon-glow: 1;
  --neon-mount: color-mix(in srgb, var(--steel-1) 30%, transparent);

  /* wet street (assets/kit/street.css), recoloured teal / red */
  --street-sky: #0a1419;
  --street-base: #07090c;
  --street-wall: #19292e;
  --street-cool: var(--teal);
  --street-warm: var(--red);
  --street-lamp: var(--amber);
  --street-cobble: #4d8689;
  --street-vignette: #020304;
  --street-wall-a: .5;
  --street-haze-a: .72;
  --street-light-a: .9;
  --street-cobble-a: .45;
  --street-horizon: 52%;

  /* grain */
  --grain-a: .075;

  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--ink-0);
  color: var(--steel-1);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-locked { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--teal) 35%, transparent); color: var(--white); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -.22em; }
.wrap { width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  background: var(--teal); color: var(--ink-0); font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

.grain {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: var(--grain-a); mix-blend-mode: overlay; z-index: 2;
}

/* ---------- shared atoms ---------- */
.led {
  width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block;
  background: var(--steel-4);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--steel-4) 30%, transparent);
}
.led.is-online { background: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 22%, transparent), var(--glow-teal-soft); }
.led.is-offline { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent), var(--glow-red-soft); }
/* no live data: a dim grey dot, neither online green nor offline red */
[data-mn-online].is-unknown { background: var(--steel-3); opacity: .7; box-shadow: 0 0 0 3px color-mix(in srgb, var(--steel-3) 18%, transparent); }

.num-glow { font-family: var(--font-num); font-weight: 600; color: var(--tube-teal); text-shadow: var(--glow-teal); font-variant-numeric: tabular-nums; }
.num-glow--red { color: var(--tube-red); text-shadow: var(--glow-red); }

.code {
  font-family: var(--font-mono); font-size: 14px; color: var(--tube-teal);
  overflow-wrap: anywhere; letter-spacing: .01em;
}
.code--inline {
  padding: 1px 8px; border-radius: 6px; background: var(--ink-3); border: 1px solid var(--line);
  white-space: nowrap;
}
.code--link { text-decoration: none; transition: border-color .2s, box-shadow .2s, color .2s; }
.code--link:hover { color: var(--white); border-color: color-mix(in srgb, var(--teal) 60%, transparent); box-shadow: var(--glow-teal-soft); }

.link {
  color: var(--tube-teal); text-decoration: none; font-weight: 600;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .3s var(--ease), color .2s;
}
.link:hover { background-size: 100% 1px; color: var(--white); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--ink-2); color: var(--steel-0);
  font: 600 15px/1.2 var(--font-sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background-color .25s, border-color .25s, color .25s;
}
.btn:active { transform: scale(.97); }
.btn .ico { width: 18px; height: 18px; }
.btn--teal { background: var(--teal); border-color: var(--teal); color: var(--ink-0); }
.btn--teal:hover { box-shadow: var(--glow-teal); background: var(--tube-teal); }
.btn--red { background: color-mix(in srgb, var(--red) 10%, transparent); border-color: color-mix(in srgb, var(--red) 60%, transparent); color: var(--tube-red); }
.btn--red:hover { box-shadow: var(--glow-red-soft); background: color-mix(in srgb, var(--red) 18%, transparent); }
.btn--ghost { background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn--ghost:hover { border-color: color-mix(in srgb, var(--teal) 60%, transparent); color: var(--white); }
.btn--tube { background: transparent; border-color: color-mix(in srgb, var(--teal) 65%, transparent); color: var(--tube-teal); box-shadow: inset 0 0 14px color-mix(in srgb, var(--teal) 14%, transparent); }
.btn--tube:hover { box-shadow: inset 0 0 16px color-mix(in srgb, var(--teal) 24%, transparent), var(--glow-teal-soft); color: var(--white); }
.btn--copy { min-height: 40px; padding: 0 14px; font-size: 14px; background: var(--ink-3); flex: none; }
.btn--copy:hover { border-color: color-mix(in srgb, var(--teal) 60%, transparent); }
.btn--copy.is-copied { border-color: var(--teal); color: var(--tube-teal); box-shadow: var(--glow-teal-soft); }
.btn--copy.is-copy-failed { border-color: var(--red); color: var(--tube-red); }
.btn--sm { min-height: 42px; padding: 0 16px; font-size: 14px; }
.btn--lg { min-height: 56px; padding: 0 30px; font-size: 17px; }
.btn--block { width: 100%; }

/* ---------- top nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 50;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--ink-0) 70%, transparent), transparent);
  border-bottom: 1px solid transparent;
  transition: background-color .35s, border-color .35s, backdrop-filter .35s;
}
.nav.is-solid {
  background: var(--nav-bg);
  border-bottom-color: var(--line);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.nav__inner {
  height: 100%; max-width: 1480px; margin-inline: auto; padding-inline: var(--gutter);
  display: flex; align-items: center; gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-height: 44px; flex: none; }
.brand__emblem { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-2), 0 0 18px color-mix(in srgb, var(--teal) 16%, transparent); }
.brand__name { font-family: var(--font-disp); font-size: 23px; letter-spacing: .07em; color: var(--steel-0); line-height: 1; }
.brand__name b { font-weight: 400; color: var(--tube-red); text-shadow: var(--glow-red-soft); }
.nav__links { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav__links a {
  position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px;
  font-size: 14px; font-weight: 500; color: var(--steel-2); text-decoration: none; border-radius: 8px;
  transition: color .2s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 1.5px; border-radius: 2px;
  background: var(--teal); box-shadow: var(--glow-teal-soft);
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--steel-0); }
.nav__links a:hover::after, .nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.nav__actions { display: flex; align-items: center; gap: 10px; flex: none; }
.nav__burger {
  display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--glass); cursor: pointer;
}
.nav__burger .ico { width: 22px; height: 22px; }

@media (max-width: 1279px) {
  .nav__links { display: none; }
  .nav__actions { margin-left: auto; }
  .nav__burger { display: inline-flex; }
}
@media (max-width: 420px) {
  .nav__actions .btn--tube { display: none; }
  .brand__name { font-size: 21px; }
}

/* ---------- full-screen mobile menu ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  padding: 0 var(--gutter) calc(20px + env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 70% 40% at 15% 100%, color-mix(in srgb, var(--teal) 14%, transparent), transparent),
    radial-gradient(ellipse 60% 40% at 90% 0%, color-mix(in srgb, var(--red) 12%, transparent), transparent),
    var(--ink-0);
  overflow-y: auto;
}
.overlay[hidden] { display: none; }
.overlay__top { height: var(--nav-h); flex: none; display: flex; align-items: center; justify-content: space-between; }
.overlay__close {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--ink-2); cursor: pointer;
}
.overlay__close .ico { width: 22px; height: 22px; }
.overlay__links { display: flex; flex-direction: column; margin: 12px 0 auto; }
.overlay__links a {
  display: flex; align-items: baseline; gap: 16px; min-height: 52px; padding: 8px 0;
  font-size: clamp(26px, 7.4vw, 40px); font-weight: 750; font-stretch: 78%; line-height: 1.15;
  color: var(--steel-0); text-decoration: none; border-bottom: 1px solid var(--line-soft);
}
.overlay__links a span { font-family: var(--font-num); font-size: 13px; font-weight: 500; letter-spacing: .16em; color: var(--teal); min-width: 26px; }
.overlay__links a:hover, .overlay__links a[aria-current="page"] { color: var(--tube-teal); }
.overlay__foot { display: flex; align-items: center; gap: 10px; padding-top: 24px; font-size: 14px; color: var(--steel-2); flex-wrap: wrap; }
.overlay__count { margin-left: auto; font-family: var(--font-num); color: var(--steel-1); }
.overlay__count b { color: var(--tube-teal); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .overlay:not([hidden]) { animation: fade-in .3s var(--ease) both; }
  .overlay:not([hidden]) .overlay__links a { animation: rise-in .5s var(--ease) both; }
  .overlay:not([hidden]) .overlay__links a:nth-child(2) { animation-delay: .03s; }
  .overlay:not([hidden]) .overlay__links a:nth-child(3) { animation-delay: .06s; }
  .overlay:not([hidden]) .overlay__links a:nth-child(4) { animation-delay: .09s; }
  .overlay:not([hidden]) .overlay__links a:nth-child(5) { animation-delay: .12s; }
  .overlay:not([hidden]) .overlay__links a:nth-child(6) { animation-delay: .15s; }
  .overlay:not([hidden]) .overlay__links a:nth-child(7) { animation-delay: .18s; }
  .overlay:not([hidden]) .overlay__links a:nth-child(8) { animation-delay: .21s; }
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- hero: the street ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-rows: var(--nav-h) minmax(0, 1fr) auto auto;
  padding-bottom: clamp(16px, 3.5vh, 40px);
}
.hero > .mn-street { z-index: 0; }
.hero__marks { position: absolute; inset: calc(var(--nav-h) + 14px) var(--gutter) 18px; pointer-events: none; z-index: 1; }
.hero__mark {
  position: absolute; font-family: var(--font-num); font-size: 12px; letter-spacing: .06em; color: var(--steel-3);
  padding: 8px 12px;
}
.hero__mark::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-color: var(--steel-4); border-style: solid;
}
.hero__mark--tl { top: 0; left: 0; }
.hero__mark--tl::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
.hero__mark--tr { right: 0; top: 0; }
.hero__mark--tr::before { right: 0; top: 0; border-width: 1px 1px 0 0; }

.hero__stage { grid-row: 2; position: relative; z-index: 3; display: grid; place-items: center; padding: 3vh var(--gutter) 0; }
.hero__title { margin: 0; width: clamp(280px, min(78vw, (100svh - 430px) * 3.1), 1000px); line-height: 0; }
.hero[data-layout="stack"] .hero__title { width: clamp(220px, min(80vw, (100svh - 520px) * 1.15), 380px); }
.hero__sign { display: block; }
.hero__fallback {
  display: block; line-height: 1; text-align: center;
  font-family: var(--font-disp); font-weight: 400; font-size: clamp(56px, 10vw, 150px); letter-spacing: .06em;
  color: var(--tube-teal); text-shadow: var(--glow-teal);
}

.hero__copy {
  grid-row: 3; position: relative; z-index: 3;
  display: grid; justify-items: center; gap: 18px; text-align: center;
  padding: 0 var(--gutter); margin-top: -2vh;
}
.hero__kicker {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--glass);
  font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--steel-1);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.hero__lead {
  max-width: 58ch; font-size: clamp(16px, 1.45vw, 19px); line-height: 1.7; color: var(--steel-1);
  text-shadow: 0 2px 18px var(--ink-0), 0 0 2px var(--ink-0);
  text-wrap: pretty;
}
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 4px; }

/* ticket: live status strip */
.ticket {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: auto auto minmax(0, 1fr);
  border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden;
  background: color-mix(in srgb, var(--ink-0) 76%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.ticket::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: var(--edge); opacity: .8; }
.hero__ticket { grid-row: 4; width: min(1040px, 100% - 2 * var(--gutter)); margin: clamp(20px, 3.5vh, 36px) auto 0; }
.ticket__cell { display: flex; align-items: center; gap: 12px; padding: 14px 20px; min-width: 0; }
.ticket__cell + .ticket__cell { border-left: 1px solid var(--line); }
.ticket__state { font-size: 14px; font-weight: 600; color: var(--steel-0); white-space: nowrap; }
.ticket__count { gap: 8px; align-items: baseline; }
.ticket__count .num-glow { font-size: 30px; line-height: 1; }
.ticket__max { font-family: var(--font-num); font-weight: 500; font-size: 15px; color: var(--steel-2); white-space: nowrap; }
.ticket__connect { justify-content: space-between; }
@media (max-width: 760px) {
  .ticket { grid-template-columns: minmax(0, 1fr) auto; }
  .ticket__state { white-space: normal; line-height: 1.35; }
  .ticket__connect { grid-column: 1 / -1; border-left: 0 !important; border-top: 1px solid var(--line); }
  .ticket__cell { padding: 12px 14px; }
  .ticket__count .num-glow { font-size: 26px; }
  /* keep "cfx.re/join/<code>" in one piece: the copy button drops below instead */
  .ticket__connect { flex-wrap: wrap; row-gap: 10px; }
  .ticket__connect .code { overflow-wrap: normal; white-space: nowrap; }
}

/* ---------- section scaffolding ---------- */
.section { position: relative; padding-block: clamp(84px, 11vw, 168px); }
.section__head { margin-bottom: clamp(40px, 5vw, 72px); }
.section__head--split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px 64px; align-items: end; }
.section__sub { font-size: 17px; line-height: 1.7; color: var(--steel-2); max-width: 44ch; }
@media (max-width: 860px) { .section__head--split { grid-template-columns: 1fr; } }

.slate { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.slate__no { font-family: var(--font-num); font-weight: 500; font-size: 13px; letter-spacing: .04em; color: var(--steel-3); }
.slate__no b { letter-spacing: .12em; margin-left: 2px; }
.slate__no b { font-weight: 600; color: var(--tube-teal); text-shadow: var(--glow-teal-soft); }
.slate__line { flex: 0 0 56px; height: 1px; background: linear-gradient(90deg, var(--teal), transparent); }
.slate__eye { font-size: 13.5px; font-weight: 600; letter-spacing: .06em; color: var(--steel-2); }

.display {
  margin-top: 20px;
  font-family: var(--font-sans); font-weight: 800; font-stretch: 66%;
  font-size: clamp(38px, 6vw, 88px); line-height: 1.04; letter-spacing: -.005em;
  color: var(--steel-0); text-wrap: balance;
}
.display em, .band__title em { font-style: normal; color: var(--tube-teal); text-shadow: var(--glow-teal-soft); }
.display .em-red, .band__title .em-red { color: var(--tube-red); text-shadow: var(--glow-red-soft); }

/* ---------- about ---------- */
.about__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 7vw, 112px); align-items: center; }
.plate { max-width: 440px; justify-self: center; width: 100%; }
.plate__frame {
  position: relative; isolation: isolate; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 6px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2); box-shadow: var(--shadow-card);
  background:
    linear-gradient(to bottom, color-mix(in srgb, var(--ink-0) 70%, transparent), transparent 28%, transparent 72%, color-mix(in srgb, var(--ink-0) 80%, transparent)),
    var(--ink-film);
}
.plate__glow {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--teal) 16%, transparent), transparent 46%),
    radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--red) 13%, transparent), transparent 48%);
}
/* the engraved emblem (white on transparent) used as a mask, lit by the two tubes */
.plate__mark {
  position: relative; z-index: 1; width: 86%; aspect-ratio: 1;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--teal) 32%, transparent)) drop-shadow(0 0 26px color-mix(in srgb, var(--red) 18%, transparent));
}
.plate__mark i {
  position: absolute; inset: 0;
  background: linear-gradient(170deg, var(--tube-teal) 0%, var(--steel-1) 46%, var(--tube-red) 100%);
  -webkit-mask: url("../img/dl_emblem_engrave.png") center / contain no-repeat;
  mask: url("../img/dl_emblem_engrave.png") center / contain no-repeat;
}
.plate__frame .grain { z-index: 2; }
.plate__corner {
  position: absolute; z-index: 3; padding: 9px 12px;
  font-family: var(--font-num); font-size: 12px; letter-spacing: .06em; line-height: 1; color: var(--steel-3);
}
.plate__corner::before { content: ""; position: absolute; width: 16px; height: 16px; border: 0 solid var(--steel-4); }
.plate__corner--tl { top: 12px; left: 12px; }
.plate__corner--tl::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
.plate__corner--tr { top: 12px; right: 12px; color: var(--tube-teal); }
.plate__corner--tr::before { top: 0; right: 0; border-width: 1px 1px 0 0; }
.plate__corner--bl { bottom: 12px; left: 12px; }
.plate__corner--bl::before { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.plate__corner--br { bottom: 12px; right: 12px; color: var(--tube-red); }
.plate__corner--br::before { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

.prose { margin-top: 28px; display: grid; gap: 18px; max-width: 60ch; }
.prose p { font-size: 17px; line-height: 1.8; color: var(--steel-2); }
.prose .prose__lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.7; color: var(--steel-1); }
.checks { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checks li {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--ink-1);
  font-size: 15px; font-weight: 600; color: var(--steel-1);
}
.checks .ico {
  width: 28px; height: 28px; padding: 6px; border-radius: 50%;
  color: var(--tube-teal); background: color-mix(in srgb, var(--teal) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 40%, transparent);
}
@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
  .plate { max-width: 360px; order: 2; }
}
@media (max-width: 560px) { .checks { grid-template-columns: 1fr; } }

/* ---------- features ---------- */
.features { background: linear-gradient(to bottom, var(--ink-0), var(--ink-1) 40%, var(--ink-0)); }
.feat { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feat__card {
  --tube: var(--teal);
  position: relative; padding: 30px 28px 32px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: linear-gradient(160deg, var(--ink-2), var(--ink-1));
  transition: border-color .3s, transform .3s var(--ease), box-shadow .3s;
}
.feat__card--red { --tube: var(--red); }
.feat__card::before {
  content: ""; position: absolute; left: 28px; right: 28px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--tube), transparent); opacity: 0; transition: opacity .3s;
}
.feat__card:hover { border-color: color-mix(in srgb, var(--tube) 35%, transparent); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.feat__card:hover::before { opacity: 1; }
.feat__top { display: flex; align-items: flex-start; justify-content: space-between; }
.feat__no {
  font-family: var(--font-disp); font-size: 54px; line-height: .8; letter-spacing: .02em;
  color: transparent; -webkit-text-stroke: 1px var(--steel-4); transition: -webkit-text-stroke-color .3s;
}
.feat__card:hover .feat__no { -webkit-text-stroke-color: var(--tube); }
.feat__card h3 { margin: 28px 0 10px; font-size: 21px; font-weight: 700; color: var(--steel-0); line-height: 1.3; }
.feat__card p { font-size: 15.5px; line-height: 1.7; color: var(--steel-2); }

.tile {
  --tube: var(--teal);
  width: 54px; height: 54px; border-radius: 15px; flex: none;
  display: inline-grid; place-items: center;
  color: color-mix(in srgb, var(--tube) 45%, var(--white));
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--tube) 30%, transparent), transparent 60%),
    linear-gradient(150deg, color-mix(in srgb, var(--tube) 20%, var(--ink-2)), var(--ink-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tube) 45%, transparent), inset 0 0 18px color-mix(in srgb, var(--tube) 16%, transparent), 0 0 26px color-mix(in srgb, var(--tube) 12%, transparent);
  transition: box-shadow .3s;
}
.tile--red { --tube: var(--red); }
.tile .ico { width: 26px; height: 26px; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--tube) 60%, transparent)); }
.feat__card:hover .tile { box-shadow: inset 0 0 0 1px var(--tube), inset 0 0 22px color-mix(in srgb, var(--tube) 26%, transparent), 0 0 34px color-mix(in srgb, var(--tube) 28%, transparent); }
@media (max-width: 1000px) { .feat { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .feat { grid-template-columns: 1fr; } }

/* ---------- professions: the cast list ---------- */
.cast { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 48px; border-top: 1px solid var(--line); }
.cast__row {
  position: relative; display: grid; grid-template-columns: 30px 24px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  min-height: 72px; padding: 14px 4px; border-bottom: 1px solid var(--line);
}
.cast__row::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, var(--teal), transparent); transform: scaleX(0); transform-origin: left;
  transition: transform .45s var(--ease);
}
.cast__row:nth-child(even)::after { background: linear-gradient(90deg, var(--red), transparent); }
.cast__row:hover::after { transform: scaleX(1); }
.cast__no { font-family: var(--font-num); font-size: 13px; color: var(--steel-3); letter-spacing: .08em; }
.cast__row .ico { width: 22px; height: 22px; color: var(--tube-teal); transition: filter .3s; }
.cast__row:nth-child(even) .ico { color: var(--tube-red); }
.cast__row:hover .ico { filter: drop-shadow(0 0 6px currentColor); }
.cast__ka { font-size: 18px; font-weight: 650; color: var(--steel-0); line-height: 1.3; }
.cast__en { font-family: var(--font-disp); font-size: 16px; letter-spacing: .14em; color: var(--steel-3); transition: color .3s; }
.cast__row:hover .cast__en { color: var(--steel-1); }
@media (max-width: 1000px) { .cast { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .cast { grid-template-columns: 1fr; } }

/* ---------- outlaw band ---------- */
.band {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(520px, 84vh, 860px); display: grid; align-items: center;
  background: var(--ink-film);
}
.band__still { position: absolute; inset: clamp(40px, 9vh, 90px) 0; overflow: hidden; z-index: -1; border-block: 1px solid var(--line-soft); }
.band__still::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ink-film) 94%, transparent) 0%, color-mix(in srgb, var(--ink-film) 60%, transparent) 50%, transparent 78%);
}
/* drawn night line: rails to the horizon, telegraph poles, a moon */
.rails { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke-linecap: round; }
.rails__moon { stroke: color-mix(in srgb, var(--amber) 45%, transparent); stroke-width: 1.5; fill: color-mix(in srgb, var(--amber) 5%, transparent); filter: drop-shadow(0 0 28px color-mix(in srgb, var(--amber) 22%, transparent)); }
.rails__horizon { stroke: color-mix(in srgb, var(--steel-1) 14%, transparent); stroke-width: 1; }
.rails__poles { stroke: var(--steel-4); }
.rails__wire { stroke-width: .8; stroke: color-mix(in srgb, var(--steel-3) 50%, transparent); }
.rails__ties { stroke: color-mix(in srgb, var(--steel-3) 42%, transparent); }
.rails__rail { stroke-width: 4; }
.rails__rail--teal { stroke: var(--tube-teal); filter: drop-shadow(0 0 4px var(--teal)) drop-shadow(0 0 14px color-mix(in srgb, var(--teal) 55%, transparent)); }
.rails__rail--red { stroke: var(--tube-red); filter: drop-shadow(0 0 4px var(--red)) drop-shadow(0 0 14px color-mix(in srgb, var(--red) 55%, transparent)); }
@media (max-width: 760px) {
  /* keep the vanishing point (x = 1160 of 1600) in the middle of a narrow screen */
  .rails { right: auto; left: 50%; width: auto; aspect-ratio: 16 / 9; transform: translateX(-72.5%); }
  .band__still::after { background: linear-gradient(90deg, color-mix(in srgb, var(--ink-film) 90%, transparent), color-mix(in srgb, var(--ink-film) 55%, transparent)); }
}
.band__inner { padding-block: 140px; }
.band__eye { color: var(--tube-red); text-shadow: var(--glow-red-soft); }
.band__title {
  margin-top: 18px; max-width: 15ch;
  font-weight: 800; font-stretch: 66%; font-size: clamp(38px, 5.6vw, 84px); line-height: 1.04;
  color: var(--steel-0); text-wrap: balance;
}
.band__text { margin-top: 24px; max-width: 42ch; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.7; color: var(--steel-1); }

/* ---------- connect ---------- */
.connect { background: radial-gradient(ellipse 60% 50% at 100% 30%, color-mix(in srgb, var(--teal) 6%, transparent), transparent), var(--ink-0); }
.connect__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.steps { list-style: none; padding: 0; margin: 0; }
.step { --tube: var(--teal); display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 20px; padding: 30px 0; border-top: 1px solid var(--line); }
.step:last-child { border-bottom: 1px solid var(--line); }
.step--red { --tube: var(--red); }
.step__no {
  font-family: var(--font-disp); font-size: 84px; line-height: .78;
  color: transparent; -webkit-text-stroke: 1.6px color-mix(in srgb, var(--tube) 45%, var(--white));
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--tube) 70%, transparent)) drop-shadow(0 0 18px color-mix(in srgb, var(--tube) 35%, transparent));
}
.step h3 { display: flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 700; color: var(--steel-0); line-height: 1.3; }
.step h3 .ico { width: 22px; height: 22px; color: color-mix(in srgb, var(--tube) 45%, var(--white)); }
.step p { margin-top: 10px; font-size: 16px; line-height: 1.75; color: var(--steel-2); }
.step__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.step__links .link { display: inline-flex; align-items: center; min-height: 40px; }
.copybox {
  margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 10px 10px 16px; border-radius: 12px; background: var(--ink-film); border: 1px solid var(--line-2);
}
.copybox .code { font-size: 15px; }

.console {
  position: sticky; top: calc(var(--nav-h) + 24px);
  padding: 28px; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line-2); background: linear-gradient(170deg, var(--ink-3), var(--ink-1) 60%);
  box-shadow: var(--shadow-card);
}
.console::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--edge); box-shadow: var(--glow-teal-soft); }
.console__head { display: flex; align-items: center; gap: 10px; }
.console__label { font-weight: 600; color: var(--steel-0); font-size: 15px; }
.console__tag {
  margin-left: auto; font-size: 12px; font-weight: 700; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px;
  color: var(--tube-red); border: 1px solid color-mix(in srgb, var(--red) 55%, transparent); text-shadow: var(--glow-red-soft);
}
.console__count { display: flex; align-items: flex-end; gap: 12px; margin: 22px 0 8px; }
.console__big { font-size: clamp(72px, 8vw, 104px); line-height: .85; }
.console__of { font-family: var(--font-num); font-size: 22px; font-weight: 500; color: var(--steel-2); display: grid; line-height: 1.2; }
.console__of small { font-family: var(--font-sans); font-size: 13px; color: var(--steel-3); font-weight: 500; }
.console__meta { margin: 22px 0; display: grid; }
.console__meta div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.console__meta dt { font-size: 13px; color: var(--steel-3); }
.console__meta dd { margin: 0; font-size: 14.5px; color: var(--steel-1); text-align: right; min-width: 0; }
.console__cta { display: grid; gap: 10px; }
/* the "live" tag and glowing count only make sense with live data */
.console:not(:has(.led.is-online)) .console__tag { display: none; }
.console:has(.led.is-unknown) .console__big,
.ticket:has(.led.is-unknown) .ticket__count .num-glow { color: var(--steel-3); text-shadow: none; }
@media (max-width: 900px) {
  .connect__grid { grid-template-columns: 1fr; }
  .console { position: relative; top: 0; }
}
@media (max-width: 480px) {
  .step { grid-template-columns: 52px minmax(0, 1fr); gap: 14px; }
  .step__no { font-size: 64px; }
}

/* ---------- faq ---------- */
.faq__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 6vw, 96px); align-items: start; }
.faq .section__head { position: sticky; top: calc(var(--nav-h) + 32px); }
.faq .section__sub { margin-top: 22px; }
.acc { border-top: 1px solid var(--line); }
.acc__item { border-bottom: 1px solid var(--line); }
.acc__item summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 24px; align-items: center; gap: 8px;
  min-height: 64px; padding: 18px 0;
  font-size: 18px; font-weight: 650; color: var(--steel-1); line-height: 1.4;
  transition: color .2s;
}
.acc__item summary::-webkit-details-marker { display: none; }
.acc__item summary:hover, .acc__item[open] summary { color: var(--steel-0); }
.acc__no { font-family: var(--font-num); font-size: 13px; font-weight: 500; color: var(--steel-3); letter-spacing: .1em; }
.acc__item[open] .acc__no { color: var(--tube-teal); text-shadow: var(--glow-teal-soft); }
.acc__ico { width: 22px; height: 22px; color: var(--steel-3); transition: transform .3s var(--ease), color .3s; }
.acc__item[open] .acc__ico { transform: rotate(45deg); color: var(--tube-teal); }
.acc__a p { padding: 0 32px 24px 52px; font-size: 16px; line-height: 1.8; color: var(--steel-2); }
@media (prefers-reduced-motion: no-preference) {
  .acc__item[open] .acc__a { animation: rise-in .35s var(--ease) both; }
}
@media (max-width: 900px) {
  .faq__grid { grid-template-columns: 1fr; }
  .faq .section__head { position: static; }
}
@media (max-width: 480px) {
  .acc__item summary { grid-template-columns: 34px minmax(0, 1fr) 22px; font-size: 16.5px; }
  .acc__a p { padding: 0 0 22px 42px; }
}

/* ---------- finale ---------- */
.finale {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(600px, 92vh, 920px); display: grid; place-items: center; text-align: center;
  border-top: 1px solid var(--line);
  --street-wall-a: .38;
}
.finale > .mn-street { z-index: 0; }
.finale__inner { position: relative; z-index: 3; display: grid; justify-items: center; gap: 18px; padding-block: 96px 72px; }
.finale__sign { width: min(720px, 82vw); line-height: 0; margin-bottom: 6px; }
.finale__eye { color: var(--steel-2); }
.finale__title {
  font-weight: 800; font-stretch: 66%; font-size: clamp(36px, 5.4vw, 76px); line-height: 1.05; color: var(--steel-0);
  text-shadow: 0 4px 30px var(--ink-0);
}
.finale__text { font-size: clamp(17px, 1.5vw, 20px); color: var(--steel-1); margin-bottom: 10px; text-shadow: 0 2px 16px var(--ink-0); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); background: var(--ink-0); padding: 64px 0 32px; }
.foot__grid { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 32px 56px; align-items: center; }
.foot__brand { display: flex; align-items: center; gap: 16px; }
.foot__brand img { width: 72px; height: 72px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-2); }
.foot__name { font-family: var(--font-disp); font-size: 30px; letter-spacing: .07em; color: var(--steel-0); line-height: 1; }
.foot__name b { font-weight: 400; color: var(--tube-red); text-shadow: var(--glow-red-soft); }
.foot__tag { margin-top: 6px; font-size: 13.5px; color: var(--steel-3); }
.foot__nav { display: flex; flex-wrap: wrap; gap: 0 22px; }
.foot__nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 40px; font-size: 14px; color: var(--steel-2); text-decoration: none; transition: color .2s; }
.foot__nav a:hover { color: var(--tube-teal); }
.foot__discord {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px;
  border: 1px solid var(--line-2); color: var(--steel-1); transition: color .2s, border-color .2s, box-shadow .2s;
}
.foot__discord .ico { width: 24px; height: 24px; }
.foot__discord:hover { color: var(--tube-teal); border-color: var(--teal); box-shadow: var(--glow-teal-soft); }
.foot__bottom {
  margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13px; color: var(--steel-3);
}
@media (max-width: 900px) { .foot__grid { grid-template-columns: minmax(0, 1fr) auto; } .foot__nav { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- scroll reveal (one-shot) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .motion .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--rd, 0s); }
  .motion .reveal.is-in { opacity: 1; transform: none; }
}

/* =========================================================
   RULES PAGE
   ========================================================= */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 70; pointer-events: none; }
.progress i {
  display: block; height: 100%; background: var(--edge); box-shadow: var(--glow-teal-soft);
  transform-origin: 0 50%; transform: scaleX(var(--read, 0));
}

.rhero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(460px, 66vh, 660px); padding-top: var(--nav-h);
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
  --street-horizon: 50%;
}
.rhero > .mn-street { z-index: 0; }
.rhero__stage { position: relative; z-index: 3; display: grid; place-items: center; padding: 28px var(--gutter) 0; }
.rhero__sign { width: clamp(260px, 60vw, 640px); line-height: 0; }
.rhero__copy { position: relative; z-index: 3; text-align: center; display: grid; justify-items: center; gap: 12px; padding: 0 var(--gutter) 44px; }
.rhero__crumb { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--steel-2); }
.rhero__crumb a { display: inline-flex; align-items: center; min-height: 40px; color: var(--steel-1); text-decoration: none; }
.rhero__crumb a:hover { color: var(--tube-teal); }
.rhero__title { font-weight: 800; font-stretch: 66%; font-size: clamp(44px, 7vw, 96px); line-height: 1; color: var(--steel-0); text-shadow: 0 4px 30px var(--ink-0); }
.rhero__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: 15px; color: var(--steel-2); }
.rhero__meta b { font-size: 22px; margin-right: 6px; }

.rlayout {
  width: min(1320px, 100% - 2 * var(--gutter)); margin-inline: auto;
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(32px, 5vw, 88px);
  padding: 56px 0 140px;
}

/* sidebar: search + chapter index */
.rside {
  position: sticky; top: calc(var(--nav-h) + 20px); align-self: start;
  max-height: calc(100vh - var(--nav-h) - 40px);
  display: flex; flex-direction: column; gap: 14px; min-height: 0;
}
.rside__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rside__title { font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--steel-2); }
.rside__close, .rside__done { display: none; }
.rsearch { position: relative; }
.rsearch .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--steel-3); pointer-events: none; }
.rsearch input {
  width: 100%; min-height: 48px; padding: 0 84px 0 42px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--ink-1); color: var(--steel-0);
  font: 500 15px/1.2 var(--font-sans); outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .2s, box-shadow .2s;
}
.rsearch input::placeholder { color: var(--steel-3); }
.rsearch input::-webkit-search-cancel-button { display: none; }
.rsearch input:focus { border-color: color-mix(in srgb, var(--teal) 70%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 16%, transparent); }
.rsearch input:focus-visible { outline: none; }
.rsearch__kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 12px; color: var(--steel-3);
  padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-2); pointer-events: none;
}
.rsearch__clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  border: 0; background: transparent; color: var(--steel-2); cursor: pointer;
}
.rsearch__clear .ico { position: static; transform: none; width: 18px; height: 18px; color: currentColor; }
.rsearch__clear:hover { color: var(--steel-0); background: var(--ink-3); }
.rsearch.has-q .rsearch__kbd { display: none; }
.rsearch:not(.has-q) .rsearch__clear { display: none; }
.rsearch__meta { font-size: 13px; color: var(--steel-3); min-height: 20px; }
.rsearch__meta b { font-family: var(--font-num); font-weight: 600; color: var(--tube-teal); }

.toc { overflow-y: auto; min-height: 0; flex: 1; margin-inline: -6px; padding: 0 6px 8px; scrollbar-width: thin; scrollbar-color: var(--ink-4) transparent; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a {
  position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  min-height: 42px; padding: 7px 10px; border-radius: 10px;
  font-size: 14px; line-height: 1.35; color: var(--steel-2); text-decoration: none;
  transition: background-color .2s, color .2s, opacity .2s;
}
.toc a::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 2px;
  background: var(--teal); box-shadow: var(--glow-teal-soft); opacity: 0; transition: opacity .2s;
}
.toc a:hover { background: var(--ink-2); color: var(--steel-0); }
.toc a.is-active { background: color-mix(in srgb, var(--teal) 8%, transparent); color: var(--steel-0); }
.toc a.is-active::before { opacity: 1; }
.toc__n { font-family: var(--font-num); font-size: 13px; font-weight: 600; color: var(--steel-3); letter-spacing: .04em; }
.toc a.is-active .toc__n { color: var(--tube-teal); }
.toc__c {
  font-family: var(--font-num); font-size: 11.5px; font-weight: 500; color: var(--steel-3);
  min-width: 26px; text-align: center; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line);
}
.is-searching .toc__c { color: var(--tube-teal); border-color: color-mix(in srgb, var(--teal) 40%, transparent); }
.toc a.is-empty { opacity: .32; }
.toc a.is-empty .toc__c { color: var(--steel-3); border-color: var(--line); }

/* the reading column */
.rdoc { min-width: 0; max-width: 840px; font-size: 17px; line-height: 1.8; color: var(--steel-1); overflow-wrap: anywhere; }
.rdoc b, .rdoc strong { color: var(--steel-0); font-weight: 700; }

.pre { padding-bottom: 56px; border-bottom: 1px solid var(--line); }
.pre__title { font-weight: 800; font-stretch: 76%; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; color: var(--steel-0); }
.pre__text { margin-top: 20px; display: grid; gap: 14px; max-width: 70ch; }
.agree {
  margin-top: 28px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 18px 20px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent);
  background: color-mix(in srgb, var(--red) 6%, transparent);
}
.agree .ico { width: 22px; height: 22px; color: var(--tube-red); margin-top: 4px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--red) 60%, transparent)); }
.agree p { color: var(--steel-0); font-weight: 500; }
.terms { margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.term { padding: 18px 18px 20px; border-radius: var(--r); border: 1px solid var(--line); background: var(--ink-1); }
.term dt { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.term__k { font-family: var(--font-disp); font-size: 30px; line-height: 1; letter-spacing: .04em; color: var(--tube-teal); text-shadow: var(--glow-teal-soft); }
.term:nth-child(2) .term__k { color: var(--tube-red); text-shadow: var(--glow-red-soft); }
.term__en { font-family: var(--font-disp); font-size: 15px; letter-spacing: .12em; color: var(--steel-3); }
.term dd { margin: 10px 0 0; font-size: 15px; line-height: 1.65; color: var(--steel-2); }
@media (max-width: 720px) { .terms { grid-template-columns: 1fr; } }

.chapter { --tube: var(--teal); padding-top: clamp(72px, 9vw, 112px); scroll-margin-top: calc(8px - clamp(72px, 9vw, 112px)); }
.chapter--red { --tube: var(--red); }
.chapter__open { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 28px; align-items: end; padding-bottom: 26px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.chapter__num {
  font-family: var(--font-disp); font-size: clamp(88px, 10vw, 148px); line-height: .76; letter-spacing: .01em;
  color: color-mix(in srgb, var(--tube) 50%, var(--white));
  text-shadow: 0 0 18px color-mix(in srgb, var(--tube) 55%, transparent);
}
@supports (-webkit-text-stroke: 1px black) {
  .chapter__num {
    color: transparent; text-shadow: none;
    -webkit-text-stroke: 2px color-mix(in srgb, var(--tube) 42%, var(--white));
    filter: drop-shadow(0 0 5px color-mix(in srgb, var(--tube) 80%, transparent)) drop-shadow(0 0 22px color-mix(in srgb, var(--tube) 45%, transparent));
  }
}
.chapter__eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--steel-3); }
.chapter__title { margin-top: 6px; font-weight: 800; font-stretch: 78%; font-size: clamp(26px, 3.2vw, 42px); line-height: 1.12; color: var(--steel-0); text-wrap: balance; }
.chapter__en { margin-top: 8px; font-family: var(--font-disp); font-size: 17px; letter-spacing: .16em; color: color-mix(in srgb, var(--tube) 45%, var(--steel-2)); }
@media (max-width: 560px) {
  .chapter__open { grid-template-columns: 1fr; }
  .chapter__num { font-size: 96px; }
}

.block-intro {
  margin: 26px 0 8px; padding: 18px 22px; border-radius: 0 var(--r) var(--r) 0;
  border-left: 2px solid var(--tube);
  background: linear-gradient(90deg, color-mix(in srgb, var(--tube) 9%, transparent), transparent 85%);
  box-shadow: -6px 0 18px -10px var(--tube);
  color: var(--steel-0); font-weight: 500;
}
.block-note {
  margin: 26px 0 8px; padding: 16px 20px; border-radius: var(--r); border: 1px dashed var(--line-2);
  color: var(--steel-1); font-size: 16px;
}
.block-note__k { display: block; margin-bottom: 4px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; color: var(--steel-3); }

.rule {
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0 18px;
  padding: 20px 0; border-bottom: 1px solid var(--line-soft);
}
.rule__n {
  align-self: start; display: inline-flex; align-items: flex-start; min-height: 40px; padding-top: 2px;
  font-family: var(--font-num); font-weight: 600; font-size: 16px; letter-spacing: .02em;
  color: color-mix(in srgb, var(--tube) 50%, var(--white)); text-decoration: none;
  transition: text-shadow .2s;
}
.rule__n:hover { text-shadow: 0 0 10px var(--tube); }
.rule:target { background: linear-gradient(90deg, color-mix(in srgb, var(--tube) 10%, transparent), transparent 70%); border-radius: 8px; }
.rule__body { min-width: 0; }
.rule__body .rule-text { margin: 0; }
.rule__body .rule-sub { list-style: none; margin: .7em 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .45em; }
.rule__body .rule-sub li { position: relative; padding-left: 24px; }
.rule__body .rule-sub li::before {
  content: ""; position: absolute; left: 2px; top: .9em; width: 11px; height: 1.5px; border-radius: 2px;
  background: var(--tube); box-shadow: 0 0 6px var(--tube);
}
.rule__body .rule-after { margin: .7em 0 0; }
.rule__body .rule-penalty {
  --pen: var(--teal);
  margin: 14px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px;
  padding: 10px 14px; border-left: 2px solid var(--pen); border-radius: 0 10px 10px 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--pen) 9%, transparent), transparent 90%);
  font-size: 15.5px; line-height: 1.6;
}
.rule__body .rule-penalty.is-black { --pen: var(--red); }
.rule__body .rp-ico { display: none; }
.rule__body .rp-k {
  flex: none; font-size: 12px; font-weight: 700; letter-spacing: .06em; line-height: 1.6;
  padding: 1px 10px; border-radius: 999px;
  color: color-mix(in srgb, var(--pen) 45%, var(--white));
  border: 1px solid color-mix(in srgb, var(--pen) 60%, transparent);
  text-shadow: 0 0 8px color-mix(in srgb, var(--pen) 70%, transparent);
}
.rule__body .rp-v { color: var(--steel-1); min-width: 0; }
@media (max-width: 560px) {
  .rule { grid-template-columns: 1fr; }
  .rule__n { min-height: 40px; min-width: 44px; justify-self: start; align-items: center; }
  .rdoc { font-size: 16.5px; }
}

.rhit-note { display: none; }
::highlight(mn-hit) { background-color: var(--hl); color: var(--white); }

.noresult {
  margin-top: 48px; padding: 56px 24px; text-align: center; border-radius: var(--r-lg);
  border: 1px dashed var(--line-2); display: grid; justify-items: center; gap: 12px;
}
.noresult[hidden] { display: none; }
.noresult__big { font-family: var(--font-disp); font-size: 72px; line-height: .9; color: transparent; -webkit-text-stroke: 1.5px var(--tube-red); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--red) 50%, transparent)); }
.noresult h2 { font-size: 22px; font-weight: 700; color: var(--steel-0); }
.noresult p { color: var(--steel-2); }

.closing {
  position: relative; overflow: hidden; margin-top: clamp(88px, 10vw, 128px); padding: clamp(32px, 5vw, 56px);
  border-radius: var(--r-lg); border: 1px solid var(--line-2); text-align: center;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, color-mix(in srgb, var(--teal) 8%, transparent), transparent), var(--ink-1);
}
.closing::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--edge); }
.closing__title { font-weight: 800; font-stretch: 76%; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; color: var(--steel-0); }
.closing__text { margin: 20px auto 0; max-width: 62ch; display: grid; gap: 14px; }
.closing__sign { margin-top: 26px; font-family: var(--font-sans); font-weight: 700; letter-spacing: .04em; color: var(--tube-teal); text-shadow: var(--glow-teal-soft); }
.closing__cta { margin: 28px auto 0; padding-top: 24px; border-top: 1px solid var(--line); max-width: 62ch; display: grid; justify-items: center; gap: 16px; color: var(--steel-2); font-size: 16px; }

/* search state */
.is-searching .pre, .is-searching .closing, .is-searching .block-intro, .is-searching .block-note { display: none; }
.rule.is-hidden, .chapter.is-hidden { display: none; }
.is-searching .chapter { padding-top: 48px; }

/* floating buttons */
.totop, .sheet-btn {
  position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; border: 1px solid var(--line-2); cursor: pointer;
  background: color-mix(in srgb, var(--ink-2) 90%, transparent); color: var(--steel-0);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
  transition: border-color .2s, box-shadow .2s, opacity .3s, transform .3s var(--ease);
}
.totop { right: 16px; width: 48px; border-radius: 50%; color: var(--tube-teal); }
.totop .ico { width: 22px; height: 22px; }
.totop:hover { border-color: var(--teal); box-shadow: var(--glow-teal-soft); }
.totop[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .totop:not([hidden]) { animation: rise-in .35s var(--ease) both; } }
.sheet-btn { left: 16px; padding: 0 18px; border-radius: 999px; font: 600 14.5px/1 var(--font-sans); display: none; }
.sheet-btn .ico { width: 20px; height: 20px; color: var(--tube-teal); }
.sheet-btn__n { font-family: var(--font-num); font-size: 13px; color: var(--tube-teal); }
.sheet-btn__n:empty { display: none; }
.sheet-scrim { position: fixed; inset: 0; z-index: 79; background: color-mix(in srgb, var(--ink-film) 66%, transparent); }
.sheet-scrim[hidden] { display: none; }

@media (max-width: 1023px) {
  .rlayout { grid-template-columns: minmax(0, 1fr); padding-top: 32px; }
  .rdoc { margin-inline: auto; width: 100%; }
  .sheet-btn { display: inline-flex; }
  .rside {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 80;
    max-height: min(86vh, 760px); padding: 14px var(--gutter) calc(16px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0; border: 1px solid var(--line-2); border-bottom: 0;
    background: var(--ink-1); box-shadow: 0 -30px 60px -20px var(--ink-film);
    transform: translateY(105%); visibility: hidden;
    transition: transform .35s var(--ease), visibility 0s linear .35s;
  }
  .rside::before { content: ""; width: 44px; height: 4px; border-radius: 4px; background: var(--steel-4); align-self: center; flex: none; }
  .rside.is-open { transform: none; visibility: visible; transition: transform .35s var(--ease), visibility 0s; }
  .rside__close {
    display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid var(--line-2); background: var(--ink-2); cursor: pointer;
  }
  .rside__close .ico { width: 20px; height: 20px; }
  .rside__done { display: inline-flex; flex: none; }
  .rsearch__kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rside { transition: none !important; }
}

/* ---------- reduced motion: keep feedback, drop travel ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn, .feat__card, .cast__row::after, .nav__links a::after, .acc__ico, .link { transition: none; }
  .feat__card:hover { transform: none; }
}

/* phones: the corner slate marks crowd the stacked sign */
@media (max-width: 599px) {
  .hero__marks { display: none; }
  .hero__stage { padding-top: 4vh; }
}

/* =========================================================
   SUBPAGES (map, donate, legal, 404): shared building blocks
   See build/SUBPAGE-NOTES.md. Page CSS (map.css, donate.css, legal.css)
   only adds what is unique to that page and reads these tokens.
   ========================================================= */

/* ---------- containers + sections ---------- */
.wrap--narrow { width: min(860px, 100% - 2 * var(--gutter)); }
.wrap--wide { width: min(1440px, 100% - 2 * var(--gutter)); }
.section--tight { padding-block: clamp(56px, 7vw, 104px); }
.section--flush-top { padding-top: 0; }
.section--alt { background: linear-gradient(to bottom, var(--ink-0), var(--ink-1) 40%, var(--ink-0)); }
.page-body { padding-block: clamp(48px, 6vw, 88px) clamp(88px, 10vw, 140px); }

/* ---------- page hero: compact editorial heading over a short wet street ---------- */
.phero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(360px, 50vh, 520px); padding-top: var(--nav-h);
  display: grid; align-items: end;
  border-bottom: 1px solid var(--line);
  --street-horizon: 46%;
  --street-wet-h: 40%;
}
.phero > .mn-street { z-index: 0; }
.phero::after {
  /* keeps the copy readable over the brightest reflections */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to top, color-mix(in srgb, var(--ink-0) 82%, transparent) 0%, color-mix(in srgb, var(--ink-0) 40%, transparent) 46%, transparent 72%),
    linear-gradient(90deg, color-mix(in srgb, var(--ink-0) 55%, transparent), transparent 70%);
}
.phero__inner { position: relative; z-index: 3; padding-block: 40px clamp(36px, 5vw, 60px); }
.phero__crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 13.5px; color: var(--steel-2); }
.phero__crumb a { display: inline-flex; align-items: center; min-height: 40px; color: var(--steel-1); text-decoration: none; }
.phero__crumb a:hover { color: var(--tube-teal); }
.phero .slate { margin-top: 6px; }
.phero__title {
  margin-top: 16px; max-width: 18ch;
  font-weight: 800; font-stretch: 66%; font-size: clamp(42px, 6.6vw, 92px); line-height: 1.02; letter-spacing: -.005em;
  color: var(--steel-0); text-shadow: 0 4px 30px var(--ink-0); text-wrap: balance;
}
.phero__title em { font-style: normal; color: var(--tube-teal); text-shadow: var(--glow-teal); }
.phero__title .em-red { color: var(--tube-red); text-shadow: var(--glow-red); }
.phero__lead {
  margin-top: 18px; max-width: 62ch; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.7; color: var(--steel-1);
  text-shadow: 0 2px 16px var(--ink-0); text-wrap: pretty;
}
.phero__actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }
.phero__sign { width: clamp(180px, 26vw, 320px); line-height: 0; margin-bottom: 18px; }
.phero--tall { min-height: clamp(440px, 64vh, 640px); }
.phero--center { text-align: center; }
.phero--center .phero__inner { display: grid; justify-items: center; }
.phero--center .phero__crumb, .phero--center .slate { justify-content: center; }
.phero--center::after { background: linear-gradient(to top, color-mix(in srgb, var(--ink-0) 82%, transparent) 0%, color-mix(in srgb, var(--ink-0) 40%, transparent) 46%, transparent 72%); }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.card {
  --tube: var(--teal);
  position: relative; display: block; min-width: 0; padding: 24px 24px 26px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: linear-gradient(160deg, var(--ink-2), var(--ink-1));
  color: inherit; text-decoration: none;
  transition: border-color .3s, transform .3s var(--ease), box-shadow .3s;
}
.card--red { --tube: var(--red); }
.card::before {
  content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--tube), transparent); opacity: 0; transition: opacity .3s;
}
a.card:hover, .card--hover:hover, .card.is-active { border-color: color-mix(in srgb, var(--tube) 40%, transparent); box-shadow: var(--shadow-card); }
a.card:hover, .card--hover:hover { transform: translateY(-3px); }
a.card:hover::before, .card--hover:hover::before, .card.is-active::before { opacity: 1; }
.card__media { margin: -24px -24px 20px; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--ink-film); border-bottom: 1px solid var(--line); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__eyebrow { font-family: var(--font-num); font-size: 12.5px; font-weight: 500; letter-spacing: .1em; color: color-mix(in srgb, var(--tube) 50%, var(--steel-2)); }
.card__title { margin-top: 6px; font-size: 19px; font-weight: 700; line-height: 1.3; color: var(--steel-0); }
.card__text { margin-top: 8px; font-size: 15.5px; line-height: 1.7; color: var(--steel-2); }
.card__foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.card__price { font-family: var(--font-num); font-weight: 600; font-size: 22px; color: var(--tube-teal); text-shadow: var(--glow-teal-soft); font-variant-numeric: tabular-nums; }
.card--red .card__price { color: var(--tube-red); text-shadow: var(--glow-red-soft); }
.panel { position: relative; overflow: hidden; padding: clamp(20px, 3vw, 32px); border-radius: var(--r-lg); border: 1px solid var(--line-2); background: linear-gradient(170deg, var(--ink-3), var(--ink-1) 60%); box-shadow: var(--shadow-card); }
.panel::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--edge); }

/* ---------- chips (filters, toggles) + tags (static labels) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  --tube: var(--teal);
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--ink-1); color: var(--steel-2);
  font: 600 14px/1.2 var(--font-sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: color .2s, border-color .2s, background-color .2s, box-shadow .2s;
}
.chip--red { --tube: var(--red); }
.chip:hover { color: var(--steel-0); border-color: color-mix(in srgb, var(--tube) 50%, transparent); }
.chip.is-active, .chip[aria-pressed="true"], .chip[aria-selected="true"], .chip[aria-current] {
  color: color-mix(in srgb, var(--tube) 45%, var(--white)); border-color: color-mix(in srgb, var(--tube) 70%, transparent);
  background: color-mix(in srgb, var(--tube) 10%, transparent);
  box-shadow: inset 0 0 12px color-mix(in srgb, var(--tube) 14%, transparent);
}
.chip .ico { width: 16px; height: 16px; }
.chip__n { font-family: var(--font-num); font-size: 12.5px; font-weight: 500; color: var(--steel-3); }
.chip.is-active .chip__n, .chip[aria-pressed="true"] .chip__n { color: inherit; }
.tag {
  --tube: var(--teal);
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; line-height: 1.6;
  color: color-mix(in srgb, var(--tube) 45%, var(--white)); border: 1px solid color-mix(in srgb, var(--tube) 55%, transparent);
}
.tag--red { --tube: var(--red); }
.tag--mute { color: var(--steel-2); border-color: var(--line-2); }

/* ---------- 404 ---------- */
.nf {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh; padding: calc(var(--nav-h) + 40px) var(--gutter) 64px;
  display: grid; place-items: center; text-align: center;
  --street-horizon: 56%;
}
.nf > .mn-street { z-index: 0; }
.nf__inner { position: relative; z-index: 3; display: grid; justify-items: center; gap: 16px; }
.nf__code {
  font-family: var(--font-disp); font-size: clamp(120px, 24vw, 260px); line-height: .82; letter-spacing: .04em;
  color: transparent; -webkit-text-stroke: 2px var(--tube-red);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--red) 80%, transparent)) drop-shadow(0 0 26px color-mix(in srgb, var(--red) 45%, transparent));
}
.nf__title { font-weight: 800; font-stretch: 66%; font-size: clamp(34px, 5vw, 64px); line-height: 1.05; color: var(--steel-0); text-shadow: 0 4px 30px var(--ink-0); }
.nf__text { max-width: 46ch; font-size: clamp(16px, 1.4vw, 19px); color: var(--steel-1); text-shadow: 0 2px 16px var(--ink-0); }
.nf__actions { margin-top: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  .card, .chip { transition: none; }
  a.card:hover, .card--hover:hover { transform: none; }
}
