/* MIRAI — block-city design system. Palettes A–E are token sets; the owner picks one (local switcher ?palet=A..E). A = Kertas (Priors colours). */
@font-face { font-family: "Inter"; src: url(/fonts/inter-latin.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-latin-ext.woff2) format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/ibm-plex-mono-400-latin.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/ibm-plex-mono-500-latin.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Pixelify"; src: url(/fonts/pixelify-sans-400-700.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --gut: max(16px, 3vw);
  --max: 1520px;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Inter", system-ui, sans-serif;
  --f-pixel: "Pixelify", "Plex Mono", monospace;
  --f-mono: "Plex Mono", ui-monospace, Menlo, monospace;
  --display-wt: 800;
  --display-track: -0.035em;
  --r: 0px;
  --notch: 8px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  /* A · Kertas — warm paper, ink, forest green and brass (the Priors colour family) */
  --bg: #f1ece1; --bg-2: #e9e2d3; --bg-3: #e2dac8; --surface: #faf7f0; --surface-2: #f5f0e5;
  --line: rgba(27, 26, 22, .12); --line-2: rgba(27, 26, 22, .22);
  --ink: #1b1a16; --ink-2: #3a372f; --muted: #6d675a; --faint: #857d6c;
  --accent: #2f6b4f; --accent-ink: #f7f2e7; --accent-2: #94763a; --accent-3: #57a07a;
  --up: #2f6b4f; --down: #a9432c; --warn: #94763a;
  --sky-top: #f1ece1; --sky-mid: #ede7da; --sky-low: #e4dccb;
  --stone: #b9ae98; --stone-2: #a39780; --stone-top: #ddd5c4; --sand: #c9a671; --glass: #1b1a16;
  --mira: #f8f4eb; --mira-joint: #c4561f; --mira-eye: #ecbb48;
  --shadow: 0 1px 0 rgba(255,255,255,.75) inset, 0 -3px 0 rgba(27,26,22,.1) inset;
  color-scheme: light; --mark-filter: invert(1); /* logo flips to a black head on a white tile */
}
:root[data-theme="dark"]:is([data-palet="A"], :not([data-palet])) { /* A · Kertas, dark — the Priors night: warm near-black, bone ink, pale green, light brass */
  --bg: #15140f; --bg-2: #1b1a14; --bg-3: #23221b; --surface: #1c1b15; --surface-2: #23221b;
  --line: rgba(236, 230, 214, .1); --line-2: rgba(236, 230, 214, .18);
  --ink: #ece6d6; --ink-2: #cdc6b5; --muted: #9d9686; --faint: #8e877a;
  --accent: #7fbf98; --accent-ink: #15140f; --accent-2: #d1ae68; --accent-3: #95d0ab;
  --up: #7fbf98; --down: #e0876d; --warn: #d1ae68;
  --sky-top: #12110d; --sky-mid: #17160f; --sky-low: #211f17;
  --stone: #4a463b; --stone-2: #3b382f; --stone-top: #5e594c; --sand: #c9a671; --glass: #0c0b08;
  --mira: #f3eee2; --mira-joint: #d9723f; --mira-eye: #ecbb48;
  --shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 -3px 0 rgba(0,0,0,.35) inset;
  color-scheme: dark; --mark-filter: none;
}
:root[data-palet="E"] { /* Yozakura — night, amber lanterns + sakura (the first MIRAI palette) */
  --bg: #0a0c19; --bg-2: #0f1224; --bg-3: #151933; --surface: #181c37; --surface-2: #1f2443;
  --line: rgba(222, 226, 255, .09); --line-2: rgba(222, 226, 255, .16);
  --ink: #f4efe4; --ink-2: #d9d5cc; --muted: #9a9cb6; --faint: #6b6e8c;
  --accent: #ffb54a; --accent-ink: #1b1204; --accent-2: #ff7fa8; --accent-3: #8fa2ff;
  --up: #7fd0ff; --down: #ff6f7d; --warn: #ffcf66;
  --sky-top: #070816; --sky-mid: #141a3f; --sky-low: #3a2550;
  --stone: #3b4166; --stone-2: #2b3052; --stone-top: #59608a; --sand: #c9a671; --glass: #0a0b14;
  --mira: #ece7dc; --mira-joint: #ff8a5c; --mira-eye: #ffc066;
  --shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 -3px 0 rgba(0,0,0,.35) inset;
  color-scheme: dark; --mark-filter: none;
}

:root[data-palet="B"] { /* Shiro — snow-white blocks, vermilion gate, ink */
  --bg: #eef1f6; --bg-2: #e6eaf2; --bg-3: #dde2ec; --surface: #ffffff; --surface-2: #f4f6fa;
  --line: rgba(17, 22, 46, .1); --line-2: rgba(17, 22, 46, .18);
  --ink: #10152b; --ink-2: #2a3050; --muted: #5d6482; --faint: #8a90aa;
  --accent: #ff4b2e; --accent-ink: #fff6f2; --accent-2: #2f5bff; --accent-3: #ffb000;
  --up: #2f5bff; --down: #e5323f; --warn: #c98a00;
  --sky-top: #cfe0ff; --sky-mid: #e9f0ff; --sky-low: #fff3ea;
  --stone: #c9cfdd; --stone-2: #aeb6c9; --stone-top: #f2f4f8; --sand: #e6c58f; --glass: #121726;
  --mira: #f7f5f0; --mira-joint: #ff4b2e; --mira-eye: #7fd3ff;
  --shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 -3px 0 rgba(17,22,46,.12) inset;
  color-scheme: light; --mark-filter: invert(1); /* logo flips to a black head on a white tile */
}
:root[data-palet="C"] { /* Kuro & Kin — obsidian blocks, gold seams */
  --bg: #09090a; --bg-2: #0f0f11; --bg-3: #16161a; --surface: #17171b; --surface-2: #1e1e23;
  --line: rgba(255, 240, 210, .08); --line-2: rgba(255, 240, 210, .15);
  --ink: #f2ecdf; --ink-2: #d6cfbf; --muted: #9b958a; --faint: #6d685f;
  --accent: #e8b84f; --accent-ink: #140f02; --accent-2: #d9d2c3; --accent-3: #b07a3a;
  --up: #e8b84f; --down: #ff6b5e; --warn: #ffcf66;
  --sky-top: #050506; --sky-mid: #121115; --sky-low: #2a2216;
  --stone: #2a2a30; --stone-2: #1d1d22; --stone-top: #3e3d45; --sand: #b89255; --glass: #050506;
  --mira: #1f1f24; --mira-joint: #e8b84f; --mira-eye: #ffd36b;
  color-scheme: dark; --mark-filter: none;
}
:root[data-palet="D"] { /* Sora — dawn sky, cloud blocks, sky blue + peach */
  --bg: #0d1530; --bg-2: #111b3b; --bg-3: #172248; --surface: #18244c; --surface-2: #1f2d5a;
  --line: rgba(200, 220, 255, .1); --line-2: rgba(200, 220, 255, .18);
  --ink: #f1f5ff; --ink-2: #d4def5; --muted: #98a6c9; --faint: #6c7aa0;
  --accent: #7cc6ff; --accent-ink: #04162a; --accent-2: #ffc98a; --accent-3: #c6a8ff;
  --up: #7cc6ff; --down: #ff7b8a; --warn: #ffd27a;
  --sky-top: #0b1330; --sky-mid: #2a3a78; --sky-low: #f2a477;
  --stone: #3a4a80; --stone-2: #2b3866; --stone-top: #6577b5; --sand: #f0c28c; --glass: #070c1d;
  --mira: #eef3ff; --mira-joint: #ffb36b; --mira-eye: #8fd8ff;
  color-scheme: dark; --mark-filter: none;
}

/* display font options (owner picks on /_fonts/; files load only when used) */
:root[data-font="pixelify"] { --f-display: "Pixelify", system-ui, sans-serif; --display-wt: 700; --display-track: 0; }
@font-face { font-family: "Silkscreen"; src: url(/fonts/silkscreen-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
:root[data-font="silkscreen"] { --f-display: "Silkscreen", system-ui, sans-serif; --display-wt: 700; --display-track: 0; }
@font-face { font-family: "Jersey 10"; src: url(/fonts/jersey-10-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
:root[data-font="jersey"] { --f-display: "Jersey 10", system-ui, sans-serif; --display-wt: 400; --display-track: 0.01em; }
@font-face { font-family: "Tiny5"; src: url(/fonts/tiny5-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
:root[data-font="tiny5"] { --f-display: "Tiny5", system-ui, sans-serif; --display-wt: 400; --display-track: 0; }
@font-face { font-family: "Doto"; src: url(/fonts/doto-400-900.woff2) format("woff2"); font-weight: 400 900; font-display: swap; }
:root[data-font="doto"] { --f-display: "Doto", system-ui, sans-serif; --display-wt: 900; --display-track: -0.01em; }
@font-face { font-family: "Handjet"; src: url(/fonts/handjet-300-800.woff2) format("woff2"); font-weight: 300 800; font-display: swap; }
:root[data-font="handjet"] { --f-display: "Handjet", system-ui, sans-serif; --display-wt: 800; --display-track: 0; }
@font-face { font-family: "Sixtyfour"; src: url(/fonts/sixtyfour-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
:root[data-font="sixtyfour"] { --f-display: "Sixtyfour", system-ui, sans-serif; --display-wt: 400; --display-track: -0.02em; }
@font-face { font-family: "Dela Gothic One"; src: url(/fonts/dela-gothic-one-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
:root[data-font="dela"] { --f-display: "Dela Gothic One", system-ui, sans-serif; --display-wt: 400; --display-track: -0.02em; }
@font-face { font-family: "Zen Dots"; src: url(/fonts/zen-dots-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
:root[data-font="zendots"] { --f-display: "Zen Dots", system-ui, sans-serif; --display-wt: 400; --display-track: -0.01em; }
@font-face { font-family: "Bungee"; src: url(/fonts/bungee-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
:root[data-font="bungee"] { --f-display: "Bungee", system-ui, sans-serif; --display-wt: 400; --display-track: 0; }
@font-face { font-family: "Space Grotesk"; src: url(/fonts/space-grotesk-400-700.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
:root[data-font="space"] { --f-display: "Space Grotesk", system-ui, sans-serif; --display-wt: 700; --display-track: -0.035em; }
@font-face { font-family: "Chakra Petch"; src: url(/fonts/chakra-petch-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
:root[data-font="chakra"] { --f-display: "Chakra Petch", system-ui, sans-serif; --display-wt: 700; --display-track: -0.02em; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.mono { font-family: var(--f-mono); }
.pixel { font-family: var(--f-pixel); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.up { color: var(--up); } .down { color: var(--down); } .warn { color: var(--warn); }

/* notched block corners */
.notch { clip-path: polygon(var(--notch) 0, calc(100% - var(--notch)) 0, 100% var(--notch), 100% calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, var(--notch) 100%, 0 calc(100% - var(--notch)), 0 var(--notch)); }

/* ── header ── */
.hdr { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.hdr-row { display: flex; align-items: center; gap: 18px; height: 64px; padding: 0 var(--gut); max-width: var(--max); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { width: auto; height: 34px; filter: var(--mark-filter, none); } /* head only, no tile: white on dark, flips to black on light */
.brand b { font: 700 21px/1 var(--f-pixel); letter-spacing: .06em; }
.ca { display: flex; align-items: stretch; border: 1px solid var(--line-2); background: var(--bg-2); height: 34px; min-width: 0; flex: none; }
.ca .lab { display: grid; place-items: center; padding: 0 9px; font: 600 11px/1 var(--f-pixel); letter-spacing: .12em; color: var(--accent); border-right: 1px solid var(--line-2); }
.ca .addr { display: flex; align-items: center; padding: 0 10px; font: 500 12px/1 var(--f-mono); white-space: nowrap; user-select: all; color: var(--ink-2); }
.ca .addr.pending { color: var(--muted); user-select: none; font-family: var(--f-body); font-size: 12px; }
.ca button { border: 0; border-left: 1px solid var(--line-2); background: transparent; padding: 0 10px; cursor: pointer; font: 600 11px/1 var(--f-pixel); letter-spacing: .1em; color: var(--ink); }
.ca button:hover { background: var(--accent); color: var(--accent-ink); }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav > a, .nav .dd > button { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border: 0; background: transparent; font-size: 14px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.nav > a:hover, .nav .dd > button:hover, .nav > a[aria-current="page"] { color: var(--ink); }
.nav > a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
.dd { position: relative; }
.dd > button svg { width: 10px; height: 10px; transition: transform .2s var(--ease); }
.dd[open] > button svg, .dd:hover > button svg { transform: rotate(180deg); }
.dd-menu { position: absolute; top: 100%; left: -8px; min-width: 268px; padding: 8px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 18px 50px rgba(0,0,0,.35); opacity: 0; visibility: hidden; transform: translateY(6px); transition: .18s var(--ease); }
.dd:hover .dd-menu, .dd:focus-within .dd-menu { opacity: 1; visibility: visible; transform: none; }
.dd-menu a { display: block; padding: 10px 12px; }
.dd-menu a:hover { background: var(--bg-3); }
.dd-menu a b { display: block; font-weight: 600; font-size: 14px; }
.dd-menu a span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.hdr-right { display: flex; align-items: center; gap: 8px; flex: none; }
.live { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--line); font: 500 11.5px/1 var(--f-mono); color: var(--muted); white-space: nowrap; }
.live i { width: 7px; height: 7px; background: var(--faint); box-shadow: 0 0 0 3px color-mix(in srgb, var(--faint) 25%, transparent); }
.live.on i { background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 25%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.icon-btn:hover { border-color: var(--line-2); background: var(--bg-3); }
.icon-btn svg { width: 15px; height: 15px; }
.burger { display: none; }
.sub { border-top: 1px solid var(--line); }
.sub-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; height: 34px; padding: 0 var(--gut); max-width: var(--max); margin: 0 auto; font-size: 12.5px; color: var(--muted); }
.sub-row a { color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.sub-row a:hover { color: var(--accent); }
.sub-row a svg { width: 12px; height: 12px; flex: none; }
.ca-strip { display: none; }

/* ── buttons: each one is a block ── */
.btn { --b: var(--surface-2); --t: var(--ink); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 44px; padding: 0 18px; border: 0; background: var(--b); color: var(--t); font: 600 14px/1 var(--f-body); letter-spacing: .005em; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); transition: transform .12s var(--ease), filter .12s; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 0 rgba(0,0,0,.25) inset; }
.btn.primary { --b: var(--accent); --t: var(--accent-ink); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 -4px 0 rgba(0,0,0,.22) inset, 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.ghost { --b: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink-2); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 52px; padding: 0 24px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.btn svg { width: 14px; height: 14px; }
.link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); padding-bottom: 2px; font-size: 14px; }
.link:hover { color: var(--accent); border-color: var(--accent); }
.link svg { width: 12px; height: 12px; }

/* ── section frame: floors of a tower ── */
section { position: relative; }
.floor { padding: clamp(72px, 9vw, 132px) 0; border-top: 1px solid var(--line); }
.floor.tight { padding: clamp(48px, 6vw, 80px) 0; }
.fl-head { display: grid; grid-template-columns: minmax(220px, 1fr) 3fr; gap: 32px; align-items: end; margin-bottom: clamp(36px, 4vw, 56px); }
.fl-tag { display: flex; align-items: center; gap: 12px; font: 600 13px/1 var(--f-pixel); letter-spacing: .14em; color: var(--accent); text-transform: uppercase; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.fl-tag .cube { width: 18px; height: 18px; flex: none; }
.fl-title { font: var(--display-wt) clamp(34px, 4.6vw, 64px)/1.02 var(--f-display); letter-spacing: var(--display-track); margin: 0; text-wrap: balance; }
.fl-title em { font-style: normal; color: var(--accent); }
.fl-lede { color: var(--muted); max-width: 62ch; margin: 14px 0 0; font-size: 17px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 600 12.5px/1 var(--f-pixel); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.eyebrow i { width: 8px; height: 8px; background: var(--accent); box-shadow: 4px 4px 0 var(--accent-2); }
h1, h2, h3 { text-wrap: balance; }

/* ── generic surfaces ── */
.card { background: var(--surface); border: 1px solid var(--line); padding: 24px; position: relative; }
.card.notch { border: 0; }
.panel { background: var(--bg-2); border: 1px solid var(--line); }
.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid > * { background: var(--bg); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; font: 600 11px/1 var(--f-pixel); letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.acc { border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--accent); }
.pill.up { border-color: color-mix(in srgb, var(--up) 55%, transparent); color: var(--up); }
.pill.down { border-color: color-mix(in srgb, var(--down) 55%, transparent); color: var(--down); }
.pill i { width: 6px; height: 6px; background: currentColor; }

/* stats row */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 28px 24px 26px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat .k { font: 600 11.5px/1 var(--f-pixel); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat .v { font: 800 clamp(30px, 3.6vw, 52px)/1 var(--f-display); letter-spacing: -.03em; margin-top: 16px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 13px; color: var(--muted); margin-top: 10px; }
.stat .v.acc { color: var(--accent); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 600 11px/1 var(--f-pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 14px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.tbl .r { text-align: right; }
.tbl .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* forms */
.field { display: grid; gap: 7px; }
.field label { font: 600 11.5px/1 var(--f-pixel); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.input { height: 46px; padding: 0 14px; background: var(--bg); border: 1px solid var(--line-2); color: var(--ink); width: 100%; min-width: 0; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input-row { display: flex; gap: 8px; }
.note { font-size: 13px; color: var(--muted); }
.hint { font-size: 12.5px; color: var(--faint); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 90; background: var(--ink); color: var(--bg); padding: 12px 18px; font-size: 14px; font-weight: 600; transition: .25s var(--ease); pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; background: rgba(4, 5, 12, .62); backdrop-filter: blur(6px); padding: 16px; }
.modal.open { display: grid; }
.modal-box { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line-2); padding: 26px; max-height: calc(100vh - 32px); overflow: auto; }
.modal-box h3 { margin: 0 0 6px; font-size: 20px; }
.wallets { display: grid; gap: 8px; margin: 18px 0 10px; }
.wallets button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; text-align: left; }
.wallets button:hover { border-color: var(--accent); }
.wallets img { width: 28px; height: 28px; }

/* footer */
.ftr { border-top: 1px solid var(--line); padding: 64px 0 28px; background: var(--bg-2); position: relative; overflow: hidden; }
.ftr-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.ftr h4 { font: 600 12px/1 var(--f-pixel); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.ftr ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; color: var(--ink-2); }
.ftr ul a:hover { color: var(--accent); }
.ftr .about { color: var(--muted); font-size: 14px; max-width: 42ch; }
.ftr-word { font: 700 clamp(80px, 17vw, 260px)/.8 var(--f-pixel); letter-spacing: .04em; color: transparent; -webkit-text-stroke: 1px var(--line-2); margin: 56px 0 18px; user-select: none; white-space: nowrap; }
.ftr-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--faint); border-top: 1px solid var(--line); padding-top: 18px; }
.ftr .ca { margin-top: 18px; max-width: 100%; }

/* page hero (inner pages) */
.phero { padding: clamp(56px, 7vw, 104px) 0 clamp(40px, 5vw, 72px); position: relative; overflow: hidden; }
.phero h1 { font: var(--display-wt) clamp(42px, 6.4vw, 96px)/.98 var(--f-display); letter-spacing: var(--display-track); margin: 22px 0 0; max-width: 16ch; }
.phero h1 em { font-style: normal; color: var(--accent); }
.phero p.lede { font-size: clamp(17px, 1.4vw, 20px); color: var(--muted); max-width: 60ch; margin: 22px 0 0; }
.phero .cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }

/* block glyph decorations */
.cubes { position: absolute; pointer-events: none; opacity: .9; }

/* responsive */
@media (max-width: 1360px) { .live .bn { display: none; } }
/* a full 42-character CA takes room: drop the live chip first, then fold the nav earlier */
@media (max-width: 1720px) { .has-ca .live { display: none; } }
@media (max-width: 1440px) { .has-ca .nav > a, .has-ca .nav .dd > button { padding: 0 8px; } .has-ca .hdr-row { gap: 12px; } }
@media (max-width: 1380px) and (min-width: 1241px) {
  .has-ca .nav { display: none; }
  .has-ca .burger { display: grid; }
  .has-ca .hdr-right { margin-left: auto; }
  .has-ca .nav.open { display: flex; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; flex-direction: column; align-items: stretch; background: var(--bg); padding: 16px var(--gut) 40px; overflow: auto; gap: 0; }
  .has-ca .nav.open > a, .has-ca .nav.open .dd > button { height: 54px; font-size: 18px; border-bottom: 1px solid var(--line); padding: 0; }
  .has-ca .nav.open .dd-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 8px 12px; }
}
@media (max-width: 1240px) {
  .nav { display: none; }
  .burger { display: grid; }
  .hdr-right { margin-left: auto; }
  .nav.open { display: flex; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; flex-direction: column; align-items: stretch; background: var(--bg); padding: 16px var(--gut) 40px; overflow: auto; gap: 0; }
  .nav.open > a, .nav.open .dd > button { height: 54px; font-size: 18px; border-bottom: 1px solid var(--line); padding: 0; }
  .nav.open .dd-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 8px 12px; }
}
@media (max-width: 900px) {
  .hdr .ca { display: none; }
  .ca-strip { display: block; border-top: 1px solid var(--line); padding: 8px var(--gut); }
  .ca-strip .ca { display: flex; width: 100%; height: auto; min-height: 34px; }
  .ca-strip .ca .addr { flex: 1; min-width: 0; font-size: clamp(9px, 2.55vw, 12px); padding: 8px; white-space: nowrap; overflow: hidden; }
  .sub { display: none; }
  .live { display: none; }
  .fl-head { grid-template-columns: 1fr; gap: 18px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ftr-grid { grid-template-columns: 1fr 1fr; }
  .ftr-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  main .ca { flex-wrap: wrap; height: auto !important; width: 100% !important; }
  main .ca .addr { flex: 1 1 100%; min-width: 0; font-size: clamp(9px, 2.5vw, 13px); padding: 10px; white-space: nowrap; overflow: hidden; }
  main .ca button, main .ca .btn { flex: 1; min-height: 36px; border-top: 1px solid var(--line-2); }
}
@media (max-width: 520px) {
  .hdr-row { gap: 10px; }
  .hdr-right .btn.start { display: none; }
  .stat { padding: 20px 14px; }
  .stat:nth-child(odd) { padding-left: 0; }
  .btn.lg { height: 48px; padding: 0 18px; }
}
/* light/dark switch: soft cross-fade (view transition), or a colour fade where view transitions are missing */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .55s; animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
:root.theme-fade, :root.theme-fade *, :root.theme-fade *::before, :root.theme-fade *::after { transition: background-color .45s ease, border-color .45s ease, color .45s ease, fill .45s ease, stroke .45s ease, filter .45s ease !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* stock logo chips — square blocks to match the city */
.tk { display: inline-flex; align-items: center; gap: 12px; }
.tk-logo { --s: 32px; position: relative; width: var(--s); height: var(--s); flex: none; display: inline-grid; place-items: center; border-radius: calc(var(--s) * .22); overflow: hidden; background: var(--surface-2, #1b1f36); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent); }
.tk-logo::before { content: attr(data-sym); font: 700 calc(var(--s) * .3)/1 var(--f-mono, ui-monospace, monospace); color: var(--ink-2); letter-spacing: -.02em; }
.tk-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tk-select { position: relative; }
.tk-select #stkLogo { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; display: flex; }
.tk-select #stkLogo:empty { display: none; }
.tk-select select { padding-left: 46px; }

/* light/dark switch only applies to palette A */
:root:not([data-palet="A"]) .theme-btn { display: none; }
