/* Colours come only from tokens.css (generated from src/tokens.mjs). No literals here. */
:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  /* Measured on the reference: 120ms for small state changes, 200ms for fades. */
  --t-fast: 120ms;
  --t-base: 200ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gut: 16px;
  --maxw: 1120px;
  --top-h: 0px;
  --bg: var(--ink);
  --surface: color-mix(in srgb, var(--pit) 72%, var(--ink));
  --surface-hi: color-mix(in srgb, var(--pit) 40%, var(--slate) 22%);
  --line: color-mix(in srgb, var(--slate) 80%, transparent);
  --muted: var(--stone);
  --text: var(--bone);
  --up: var(--lime);
  --down: var(--poppy);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 150px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--font); overflow-x: hidden; min-width: 320px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--lime); color: var(--ink); padding: 12px 16px; font-weight: 800; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--zest); outline-offset: 2px; }

/* progress */
.progress { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 90; pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--lime), var(--zest)); }

/* top: bar + contract slot, always visible */
.top { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--ink) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 2px solid var(--line); }
.bar { max-width: var(--maxw); margin: 0 auto; padding: 8px var(--gut); display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 60px; }
.brand { display: block; width: 108px; flex: none; min-height: 44px; }
.brand img { width: 108px; height: auto; margin-top: 7px; }
.bar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.social { display: flex; gap: 4px; }
.icon-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; color: var(--text); border: 2px solid var(--line); background: var(--surface); text-decoration: none; transition: transform var(--t-fast) ease, border-color var(--t-fast) ease; overflow: hidden; }
a.icon-btn:hover { transform: translateY(-2px); border-color: var(--lime); }
.icon-btn[aria-disabled="true"] { color: var(--muted); opacity: .55; cursor: not-allowed; }

/* status pill */
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 2px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.dot { width: 10px; height: 10px; background: var(--muted); display: block; position: relative; }
.pill[data-state="live"] .dot { background: var(--lime); }
.pill[data-state="live"] .dot::after { content: ""; position: absolute; inset: 0; background: var(--lime); animation: ping 1.8s var(--ease) infinite; }
.pill[data-state="error"] .dot { background: var(--poppy); }
.pill[data-state="loading"] .dot { background: var(--daisy); }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.8); opacity: 0; } }

/* contract slot */
.ca-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut) 10px; }
.ca { position: relative; width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 14px; padding: 10px 14px; min-height: 64px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 2px solid var(--line); overflow: hidden; }
.ca-tag { font-weight: 900; letter-spacing: .1em; color: var(--ink); background: var(--lime); padding: 4px 8px; font-size: 14px; box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--ink) 30%, transparent); }
.ca-value { font-family: var(--mono); font-size: clamp(15px, 4.1vw, 26px); line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; word-break: break-all; letter-spacing: .01em; }
.ca-act { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; background: var(--lime); color: var(--ink); }
.ca-note { background: none; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 500; padding: 0; font-size: 13px; }
.ca[data-state="stated"] { cursor: pointer; border-color: var(--lime); transition: transform var(--t-fast) ease, box-shadow var(--t-base) ease; }
.ca[data-state="stated"]:hover { transform: translateY(-1px); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 30%, transparent); }
.ca:not([data-state="stated"]) .ca-value { color: var(--muted); }
.ca:not([data-state="stated"]) .ca-tag { background: var(--slate); color: var(--chalk); }
.ca.copied .ca-act { background: var(--zest); }

/* hero */
.hero { position: relative; isolation: isolate; min-height: clamp(520px, 78svh, 700px); overflow: hidden; display: grid; align-items: end; border-bottom: 2px solid var(--line); }
.layer { position: absolute; left: -4%; right: -4%; will-change: transform; }
.layer.sky { top: -6%; height: 70%; background: url(/assets/sky.webp) center/cover no-repeat; z-index: -3; }
.layer.land { bottom: -10%; height: 62%; background: url(/assets/land.webp) center bottom/cover no-repeat; z-index: -1; -webkit-mask-image: linear-gradient(to bottom, transparent, var(--ink) 38%); mask-image: linear-gradient(to bottom, transparent, var(--ink) 38%); }
.layer.mark { left: 0; right: 0; top: 17%; z-index: -2; display: flex; justify-content: center; pointer-events: none; }
.layer.mark img { width: min(86vw, 700px); filter: drop-shadow(0 10px 0 color-mix(in srgb, var(--ink) 55%, transparent)); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, transparent 40%, color-mix(in srgb, var(--ink) 55%, transparent) 72%, var(--ink) 100%); }
.hero-copy { max-width: var(--maxw); margin: 0 auto; width: 100%; padding: 280px var(--gut) 36px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); background: var(--zest); padding: 4px 10px; }
h1 { margin-top: 12px; font-size: clamp(34px, 8.6vw, 72px); line-height: 1; font-weight: 900; text-transform: uppercase; letter-spacing: .01em; text-shadow: 0 4px 0 var(--ink), 0 8px 0 color-mix(in srgb, var(--ink) 60%, transparent); }
.lede { margin-top: 14px; max-width: 560px; font-size: clamp(16px, 2.2vw, 19px); color: var(--chalk); text-shadow: 0 2px 0 var(--ink); }
.cta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 44px; padding: 0 22px; font-weight: 800; text-decoration: none; text-transform: uppercase; letter-spacing: .06em; font-size: 14px; color: var(--text); background: var(--surface); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--ink); overflow: hidden; transition: transform var(--t-fast) ease, box-shadow var(--t-fast) ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.btn.primary { background: var(--lime); color: var(--ink); border-color: var(--zest); }

/* spotlight */
.spot { position: relative; overflow: hidden; }
.spot::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity var(--t-base) ease; background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--lime) 26%, transparent), transparent 70%); z-index: 0; }
.spot:hover::before, .spot:focus-visible::before { opacity: 1; }
.spot > * { position: relative; z-index: 1; }

/* sections */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 56px var(--gut) 0; }
.wrap.narrow { max-width: 760px; }
.sec-head { margin-bottom: 18px; display: grid; gap: 4px; }
h2 { font-size: clamp(26px, 5vw, 38px); line-height: 1.05; font-weight: 900; text-transform: uppercase; letter-spacing: .01em; }
.sec-head p { color: var(--muted); max-width: 620px; }
h3 { font-size: 15px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { padding: 16px; background: var(--surface); border: 2px solid var(--line); box-shadow: inset 0 3px 0 color-mix(in srgb, var(--bone) 8%, transparent); display: grid; gap: 8px; align-content: start; min-height: 148px; }
.tile h3 { color: var(--muted); font-size: 13px; }
.val { position: relative; min-height: 44px; display: flex; align-items: center; }
.real { white-space: nowrap; font-size: clamp(18px, 5vw, 32px); font-weight: 800; line-height: 1.1; opacity: 0; transform: translateY(6px); transition: opacity var(--t-base) ease, transform var(--t-base) var(--ease); overflow-wrap: anywhere; }
.skel { position: absolute; left: 0; height: 28px; width: 70%; max-width: 220px; background: linear-gradient(100deg, var(--slate) 30%, var(--surface-hi) 50%, var(--slate) 70%) 0 0 / 220% 100%; animation: shimmer 1.3s linear infinite; opacity: 1; transition: opacity var(--t-base) ease; }
@keyframes shimmer { to { background-position: -220% 0; } }
[data-state="ready"] > .val .real, [data-state="error"] > .val .real { opacity: 1; transform: none; }
[data-state="ready"] > .val .skel, [data-state="error"] > .val .skel { opacity: 0; pointer-events: none; }
.tile[data-state="error"] .real { color: var(--muted); }
.sub { color: var(--muted); font-size: 13px; line-height: 1.4; }
.tile[data-state="error"] .sub { color: var(--poppy); }
.flash-up { animation: flash-up .9s ease-out; }
.flash-down { animation: flash-down .9s ease-out; }
@keyframes flash-up { 0% { color: var(--zest); text-shadow: 0 0 14px color-mix(in srgb, var(--lime) 80%, transparent); } 100% { text-shadow: none; } }
@keyframes flash-down { 0% { color: var(--poppy); text-shadow: 0 0 14px color-mix(in srgb, var(--poppy) 80%, transparent); } 100% { text-shadow: none; } }

/* marquee */
.strip { margin-top: 48px; border-block: 2px solid var(--line); background: var(--surface); }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, var(--ink) 8%, var(--ink) 92%, transparent); mask-image: linear-gradient(90deg, transparent, var(--ink) 8%, var(--ink) 92%, transparent); }
.track { display: flex; width: max-content; gap: 12px; padding: 12px 6px; align-items: center; min-height: 72px; }
.marquee[data-state="ready"] .track { animation: scroll var(--dur, 40s) linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }
.mq-msg { color: var(--muted); padding: 0 var(--gut); font-size: 14px; white-space: normal; }
.marquee:not([data-state="ready"]) .track { width: auto; }
.face { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border: 2px solid var(--line); background: var(--ink); flex: none; }
.face img, .face .ph { width: 40px; height: 40px; object-fit: cover; background: var(--slate); image-rendering: auto; }
.face .ph { display: grid; place-items: center; font-weight: 900; color: var(--chalk); }
.face b { font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }

/* tabs */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { min-height: 44px; padding: 0 18px; font: 800 14px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--chalk); background: var(--surface); border: 2px solid var(--line); cursor: pointer; transition: transform var(--t-fast) ease, background var(--t-fast) ease; }
.tab[aria-selected="true"] { background: var(--lime); color: var(--ink); border-color: var(--zest); }
.tab:active { transform: translateY(2px); }

/* board */
.board { display: grid; gap: 10px; }
.rows { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "logo name act" "logo stats stats" "tag tag tag"; gap: 4px 12px; align-items: center; padding: 12px; background: var(--surface); border: 2px solid var(--line); }
.row .tok { grid-area: logo; width: 48px; height: 48px; object-fit: cover; background: var(--slate); }
.row .ph { grid-area: logo; width: 48px; height: 48px; display: grid; place-items: center; background: var(--slate); font-weight: 900; font-size: 20px; color: var(--chalk); }
.row .name { grid-area: name; min-width: 0; display: grid; }
.row .name b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .name small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .stats { grid-area: stats; display: flex; flex-wrap: wrap; gap: 4px 16px; font-family: var(--mono); font-size: 14px; }
.row .stats span { white-space: nowrap; }
.row .stats .lab { color: var(--muted); font-family: var(--font); font-size: 12px; margin-right: 6px; text-transform: uppercase; letter-spacing: .06em; }
.row .act { grid-area: act; }
.row .tag { grid-area: tag; justify-self: start; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; background: var(--slate); color: var(--chalk); }
.row .tag.ok { background: var(--lime); color: var(--ink); }
.row .tag.warn { background: var(--daisy); color: var(--ink); }
.up { color: var(--up); }
.down { color: var(--down); }
.cp { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 12px; font: 800 13px/1 var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--text); background: var(--ink); border: 2px solid var(--line); cursor: pointer; transition: transform var(--t-fast) ease, border-color var(--t-fast) ease; }
.cp:hover { border-color: var(--lime); transform: translateY(-1px); }
.cp .cp-t { display: none; }
.skel-row { min-height: 84px; grid-template-columns: 48px 1fr 1fr; }
.skel-row .skel { position: relative; width: 100%; max-width: none; height: 20px; }
.skel-row .skel:first-child { height: 48px; width: 48px; }
.board-msg { padding: 18px; border: 2px dashed var(--line); color: var(--chalk); background: var(--surface); }
.board[data-state="error"] .board-msg { border-color: var(--poppy); }
.board[data-state="ready"] .row, .board[data-state="empty"] .row { animation: row-in var(--t-base) var(--ease) both; }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } }

/* cards, faq */
.cards { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.card { padding: 20px; background: var(--surface); border: 2px solid var(--line); display: grid; gap: 10px; align-content: start; box-shadow: inset 0 3px 0 color-mix(in srgb, var(--lime) 40%, transparent); }
.card p { color: var(--chalk); }
.faq { display: grid; gap: 10px; }
details { background: var(--surface); border: 2px solid var(--line); }
summary { list-style: none; cursor: pointer; min-height: 52px; padding: 12px 16px; font-weight: 800; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 900 22px/1 var(--mono); color: var(--lime); flex: none; }
details[open] summary::after { content: "\2212"; }
details p { padding: 0 16px 16px; color: var(--chalk); }

/* footer */
.foot { margin-top: 72px; border-top: 2px solid var(--line); background: var(--surface); }
.foot-in { padding-block: 28px; display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
.foot-in .mono { color: var(--text); font-weight: 700; }
.fine { font-size: 13px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 120; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px); padding: 12px 18px; font-weight: 800; background: var(--lime); color: var(--ink); border: 2px solid var(--zest); box-shadow: 0 4px 0 var(--ink); transition: opacity var(--t-base) ease, transform 360ms cubic-bezier(.34, 1.56, .64, 1); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* reveal: only hidden when JS is present, so the page degrades to fully visible */
.js [data-reveal]:not(.is-in) { opacity: 0; }

@media (min-width: 640px) {
  .brand, .brand img { width: 132px; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ca { padding: 12px 18px; }
  .ca-tag { font-size: 16px; padding: 6px 12px; }
  .row { grid-template-columns: 56px minmax(160px, 1.3fr) minmax(0, 2fr) auto auto; grid-template-areas: "logo name stats tag act"; padding: 12px 16px; }
  .row .tok, .row .ph { width: 56px; height: 56px; }
  .row .stats { flex-wrap: nowrap; justify-content: space-between; gap: 12px; }
  .row .stats span { flex: 1; }
  .row .tag { justify-self: end; }
  .cp .cp-t { display: inline; }
  .hero-copy { padding-top: 330px; }
  .wrap { padding-top: 72px; }
}
@media (max-width: 420px) {
  .pill .pill-long { display: none; }
  .pill { padding: 0 10px; }
  .ca { grid-template-columns: auto 1fr; padding: 8px 12px; min-height: 0; }
  .ca-act { grid-column: 2; grid-row: 1; justify-self: end; min-height: 0; padding: 4px 10px; font-size: 12px; }
  .ca-note { text-align: right; }
  .ca-value { grid-column: 1 / -1; grid-row: 2; }
}

/* reduced motion: everything lands instantly, nothing loops */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal]:not(.is-in) { opacity: 1; }
  .real { opacity: 1; transform: none; }
  [data-state="loading"] > .val .real { opacity: 0; }
  .marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .toast { transform: translate(-50%, 0); }
  .layer { transform: none !important; }
}

.skel-row { grid-template-areas: none; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr); }
@media (min-width: 640px) { .skel-row { grid-template-columns: 56px minmax(0, 1fr) minmax(0, 2fr); } }
.row .stats em, .row .stats i { font-style: normal; }
