/* Layout values measured off the reference at 1024 wide: header 101, ruler 9,
   hero 958, record panel 460 with 70/65 padding, footer 100 with 30/35 padding.
   Display type 127px at -5.5% tracking, secondary 38px at -3%, mono labels at
   +10% tracking. Transitions 0.2s to 0.5s ease. Breakpoints 1150, 760, 420. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", monospace; letter-spacing: 0.1em; text-transform: uppercase; }
.serif { font-family: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif; font-weight: 400; }
.accent { color: var(--cyan); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* progress */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 80; }
.progress i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--cyan), var(--green), var(--magenta)); }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 0 var(--pad);
}
.hd-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; }
.brand-mark { width: 44px; height: 44px; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--cyan) 40%, transparent)); }
.brand-text { display: grid; line-height: 1.1; }
.brand-text b { font-size: 20px; letter-spacing: 0.04em; font-weight: 600; }
.brand-text small { font-size: 9px; color: var(--muted); }
.hd-nav { display: flex; gap: 4px; font-size: 11px; color: var(--muted); }
.hd-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }
.hd-nav a:hover { color: var(--bone); }
.socials { display: flex; gap: 4px; margin-left: auto; }
.hd-nav + .socials { margin-left: 0; }
.soc {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--bone);
  transition: color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
a.soc:hover { color: var(--cyan); border-color: var(--cyan); transform: translateY(-2px); }
.soc.is-inert { color: var(--quiet); border-style: dashed; cursor: default; }

/* CA slot */
.ca-row { padding: 0 0 12px; }
.ca {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; width: 100%; min-height: 44px;
  padding: 8px 16px; text-align: left; border: 1px solid var(--line-hot); border-radius: 10px;
  background: var(--panel);
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
button.ca:hover { border-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 7%, transparent); }
.ca-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.ca-val {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: clamp(13px, 2.4vw, 28px); line-height: 1.25; letter-spacing: 0.01em;
  overflow-wrap: anywhere; word-break: break-all; flex: 1 1 auto; min-width: 0;
}
.ca-act { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); font-family: ui-monospace, Consolas, monospace; }
.ca.is-inert { border-style: dashed; border-color: var(--line); }
.ca.is-inert .ca-val { color: var(--dim); }
.ca.is-copied { border-color: var(--green); }
.ca.is-copied .ca-act { color: var(--green); }

/* ruler */
.ruler {
  display: flex; justify-content: space-between; gap: 16px; padding: 0 var(--pad);
  height: 9px; font-size: 7px; line-height: 9px; color: var(--quiet); overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 12px) bottom / 100% 4px no-repeat;
}

/* hero */
.hero { position: relative; padding: 0 var(--pad); min-height: 958px; isolation: isolate; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.15; will-change: transform; }
.b1 { width: 46%; aspect-ratio: 1; left: -8%; top: 8%; background: radial-gradient(circle, color-mix(in srgb, var(--blue) 70%, transparent), transparent 70%); animation: drift 24s ease-in-out infinite alternate; }
.b2 { width: 40%; aspect-ratio: 1; right: -6%; top: 20%; background: radial-gradient(circle, color-mix(in srgb, var(--magenta) 45%, transparent), transparent 70%); animation: drift 30s ease-in-out infinite alternate-reverse; }
.b3 { width: 55%; aspect-ratio: 1; left: 22%; bottom: -30%; background: radial-gradient(circle, color-mix(in srgb, var(--green) 38%, transparent), transparent 70%); animation: drift 36s ease-in-out infinite alternate; }
.dotfield {
  position: absolute; inset: -10%;
  background-image: radial-gradient(circle, var(--line-hot) 1.2px, transparent 1.6px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 55%, black 0%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 55%, black 0%, transparent 70%);
}
.horizon {
  position: absolute; left: 0; right: 0; bottom: 0; height: 180px;
  background:
    radial-gradient(ellipse 36% 55% at 50% 100%, color-mix(in srgb, var(--green) 55%, transparent), transparent 70%),
    radial-gradient(ellipse 70% 70% at 50% 100%, color-mix(in srgb, var(--blue) 50%, transparent), transparent 72%);
  opacity: 0.8;
}
@keyframes levitate {
  0%, 100% { transform: translateY(-12px) rotate(-1.5deg); }
  50% { transform: translateY(12px) rotate(1.5deg); }
}
.display .h-in { display: inline-block; }
.h-in { animation: slideUp 0.6s ease both; animation-delay: var(--d, 0s); }
.h-sub { animation: fadeIn 0.6s ease both; animation-delay: 0.9s; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes drift { from { translate: 0 0; scale: 1; } to { translate: 6% -8%; scale: 1.18; } }

.hero-head { display: grid; grid-template-columns: 1fr minmax(0, 340px); align-items: end; column-gap: 40px; padding-top: 44px; }
.hero-head .eyebrow { grid-column: 1 / -1; margin-bottom: 8px; }
.eyebrow { font-size: 10px; color: var(--muted); }
.display {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif; font-weight: 400;
  font-size: clamp(76px, 12.4vw, 238px); line-height: 1; letter-spacing: -0.055em;
}
.lede { font-size: clamp(16px, 1.6vw, 22px); line-height: 1.35; color: var(--dim); padding-bottom: 14px; }
.lede em { font-family: "Iowan Old Style", Georgia, serif; color: var(--bone); font-weight: 600; }

.stage { position: relative; height: 640px; margin-top: 8px; }
.stage-register { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; font-size: 8px; color: var(--quiet); z-index: 2; }
.skull-wrap { position: absolute; left: 50%; top: 0; width: min(560px, 54vw); aspect-ratio: 1; margin-left: calc(min(560px, 54vw) / -2); will-change: transform; }
.skull { width: 100%; height: 100%; animation: levitate 4s ease-in-out infinite; filter: drop-shadow(0 0 28px color-mix(in srgb, var(--cyan) 38%, transparent)); }
.stage .channel { position: absolute; bottom: 0; width: min(300px, 26vw); }
.stage .channel.left { left: 0; }
.stage .channel.right { right: 0; }
.ch-title { font-size: clamp(30px, 3.7vw, 54px); line-height: 1; letter-spacing: -0.03em; margin: 8px 0 10px; }
.ch-copy { font-size: 13px; color: var(--dim); max-width: 280px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.tile { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); min-height: 74px; display: grid; align-content: space-between; gap: 8px; }
.t-label { font-size: 8px; color: var(--muted); line-height: 1.3; }
.t-val { font-size: clamp(16px, 1.6vw, 22px); font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }

/* spotlight */
.spot { position: relative; overflow: hidden; isolation: isolate; }
.spot::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(260px circle at var(--sx, 50%) var(--sy, 50%), color-mix(in srgb, var(--cyan) 16%, transparent), transparent 70%);
  transition: opacity 0.35s ease;
}
.spot:hover::before { opacity: 1; }

/* ticker */
.ticker { border-block: 1px solid var(--line); overflow: hidden; background: color-mix(in srgb, var(--bone) 2%, transparent); }
.tk-track { display: flex; width: max-content; animation: tick var(--tk-dur, 60s) linear infinite; }
.ticker:hover .tk-track { animation-play-state: paused; }
.tk-item { display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; font-size: 11px; white-space: nowrap; border-right: 1px solid var(--line); }
.tk-item b { font-weight: 600; }
.up { color: var(--green); }
.down { color: var(--magenta); }
@keyframes tick { to { transform: translateX(-50%); } }

/* blocks */
.block { padding: 70px var(--pad) 65px; border-bottom: 1px solid var(--line); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.sec-title { font-size: clamp(40px, 5.4vw, 96px); line-height: 1; letter-spacing: -0.04em; margin: 10px 0 12px; }
.sub { color: var(--dim); max-width: 560px; }
.fine { color: var(--muted); font-size: 13px; margin-top: 20px; max-width: 720px; min-height: 20px; }

.pill {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-hot); font-size: 13px; background: var(--panel);
  transition: border-color 0.35s ease, color 0.35s ease;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--quiet); position: relative; }
.pill[data-tone="live"] .live-dot, .pill[data-tone="backup"] .live-dot { background: var(--green); animation: pulse 1.8s ease-out infinite; }
.pill[data-tone="fallback"] .live-dot { background: var(--cyan); animation: pulse 1.8s ease-out infinite; }
.pill[data-tone="error"] .live-dot { background: var(--magenta); }
.pill[data-tone="live"], .pill[data-tone="backup"] { border-color: color-mix(in srgb, var(--green) 55%, transparent); }
.pill[data-tone="fallback"] { border-color: color-mix(in srgb, var(--cyan) 55%, transparent); }
.pill[data-tone="error"] { border-color: color-mix(in srgb, var(--magenta) 60%, transparent); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

/* tabs */
.tabs { position: relative; display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; margin-bottom: 20px; }
.tab { position: relative; z-index: 1; min-height: 44px; min-width: 44px; padding: 0 22px; border-radius: 999px; color: var(--muted); transition: color 0.25s ease; }
.tab:hover { color: var(--bone); }
.tab.is-on { color: var(--ink); }
.tab-ink { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--bone); transition: transform 0.5s ease, width 0.5s ease; }

/* board */
.board { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.b-head, .b-row {
  display: grid; align-items: center; column-gap: 16px;
  grid-template-columns: 36px minmax(180px, 2.2fr) repeat(4, minmax(90px, 1fr)) 120px;
  padding: 0 20px;
}
.b-head { min-height: 44px; font-size: 10px; color: var(--muted); border-bottom: 1px solid var(--line); }
.b-row { position: relative; min-height: 64px; border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease, background-color 0.25s ease; transition-delay: calc(var(--i, 0) * 45ms), calc(var(--i, 0) * 45ms), 0s; }
.b-row.in { opacity: 1; transform: none; }
.b-row:last-child { border-bottom: 0; }
.b-row.spot:hover { background: color-mix(in srgb, var(--bone) 3%, transparent); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.c-rank { color: var(--muted); font-size: 12px; }
.c-pool { display: flex; align-items: center; gap: 12px; min-width: 0; }
.c-pool > span { min-width: 0; display: grid; }
.c-pool b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-pool small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tileimg { flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: var(--ink); background: var(--cyan); position: relative; }
.tileimg.t1 { background: var(--green); }
.tileimg.t2 { background: var(--magenta); }
.tileimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--ink); }
.cell-lab { display: none; }
.copy {
  justify-self: end; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--dim);
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.copy:hover:not([disabled]) { color: var(--cyan); border-color: var(--cyan); }
.copy.is-done { color: var(--green); border-color: var(--green); }
.copy[disabled] { color: var(--quiet); border-style: dashed; cursor: default; }
.flash-up { animation: flashUp 0.9s ease-out; }
.flash-down { animation: flashDown 0.9s ease-out; }
@keyframes flashUp { from { background: color-mix(in srgb, var(--green) 35%, transparent); } to { background: transparent; } }
@keyframes flashDown { from { background: color-mix(in srgb, var(--magenta) 35%, transparent); } to { background: transparent; } }

/* skeleton */
.sk { display: inline-block; height: 14px; width: 70%; border-radius: 6px; background: linear-gradient(90deg, var(--line) 0%, var(--line-hot) 50%, var(--line) 100%) 0 0 / 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.sk.round { width: 36px; height: 36px; border-radius: 50%; }
.b-row.is-skel { opacity: 1; transform: none; transition: opacity 0.4s ease; }
.b-row.is-skel.gone, .b-row.is-dash.gone { opacity: 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* cards, steps */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card, .step, .rcard { padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); transition: border-color 0.25s ease, transform 0.25s ease; }
.card:hover, .step:hover { border-color: var(--line-hot); }
.card h3, .step h3 { font-size: 22px; letter-spacing: -0.02em; font-weight: 500; margin: 18px 0 10px; }
.card p, .step p { color: var(--dim); font-size: 15px; }
.c-idx, .s-idx { font-size: 11px; color: var(--cyan); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.rgrid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 16px; }
.rc-name { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 400; font-family: ui-monospace, Consolas, monospace; }
.rc-list { margin: 18px 0 0; display: grid; gap: 10px; }
.rc-list div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.rc-list dt { color: var(--muted); font-size: 13px; }
.rc-list dd { margin: 0; font-size: 14px; text-align: right; overflow-wrap: anywhere; }
.rc-pending { margin-top: 18px; font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.1em; text-transform: uppercase; font-size: 13px; color: var(--quiet); }
.rc-val { margin-top: 18px; overflow-wrap: anywhere; }
.rcard.is-inert { border-style: dashed; }

/* footer */
.site-footer { padding: 30px var(--pad) 35px; }
.ft-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.ft-note { font-size: 10px; color: var(--muted); }

/* reveal: JS drives the spring; without JS everything is visible */
.js .rv { opacity: 0; }
.js .rv { transition: opacity 0.5s ease; }
.js .rv.in { opacity: 1; }
.rv.springing { transition: opacity 0.5s ease !important; }

@media (min-width: 1700px) {
  .stage { height: 760px; }
  .hero { min-height: 1040px; }
}
@media (max-width: 1150px) {
  .hd-nav { display: none; }
  .socials { margin-left: auto; }
  .rgrid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .b-head, .b-row { grid-template-columns: 30px minmax(150px, 2fr) repeat(4, minmax(70px, 1fr)) 96px; column-gap: 12px; padding: 0 14px; }
}
@media (max-width: 760px) {
  .block { padding: 48px var(--pad) 44px; }
  .hero { min-height: 0; padding-bottom: 28px; }
  .hero-head { grid-template-columns: 1fr; row-gap: 14px; padding-top: 28px; }
  .stage { height: auto; display: grid; gap: 20px; }
  .stage-register { position: static; }
  .skull-wrap { position: relative; left: auto; top: auto; margin: 0 auto; width: min(420px, 82vw); }
  .stage .channel { position: relative; width: auto; }
  .ch-copy { max-width: none; }
  .cards { grid-template-columns: 1fr; }
  .b-head { display: none; }
  .b-row { grid-template-columns: 1fr 1fr; row-gap: 10px; padding: 16px; }
  .c-rank { display: none; }
  .c-pool { grid-column: 1 / 2; }
  .c-price { grid-column: 2 / 3; }
  .c-chg { text-align: right; }
  .b-row > .num { text-align: left; }
  .b-row > .c-price { text-align: right; }
  .b-row > .c-chg { grid-column: 2 / 3; text-align: right; grid-row: 2; }
  .cell-lab { display: block; font-size: 10px; letter-spacing: 0.1em; color: var(--muted); font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }
  .copy { grid-column: 1 / -1; justify-self: stretch; }
  .ca { padding: 8px 12px; }
}
@media (max-width: 420px) {
  .brand-text small { display: none; }
  .steps, .rgrid, .tiles { grid-template-columns: 1fr; }
  .tab { padding: 0 16px; }
  .tabs { display: flex; width: 100%; }
  .tab { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .rv { opacity: 1; }
  .b-row { opacity: 1; transform: none; }
  .tk-track { overflow-x: auto; width: auto; }
  .ticker { overflow-x: auto; }
}
