/* Two Percent v2: a Lisbon street at night, in the look of the owner's X avatar and banner.
   One sky, one facade (the wall of 200 tiles between windows), one surface system for every card and table:
   dark cobalt glass with a pale hairline and a top highlight. Glaze plaques only ON the facade (its signs).
   Layout: container 1680, gutter clamp(16, 3vw, 40), spacing 8/16/24/32/48/64/96. */

@font-face { font-family: "Mona Sans"; font-style: italic; font-weight: 700 900; font-stretch: 112% 125%; font-display: swap; src: url(../fonts/mona-sans-italic-wide.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/manrope.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/jetbrains-mono-500.woff2) format("woff2"); }

:root {
  --night0: #0a1b6e; --night1: #1736b8; --deep: #061245; --ink: #1b3fa6; --glaze: #f2f5ff;
  --glow: #4d7dff; --warm: #ffc84a; --warm2: #ffb02e; --text: #e6ecff; --muted: #b8c5f2; --dim: #8f9fd8;
  --glass: rgba(9, 24, 96, 0.78); --glass-2: rgba(14, 36, 130, 0.62); --edge: rgba(184, 200, 255, 0.3);
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px;
  --wrap: 1680px; --gut: clamp(16px, 3vw, 40px); --bar: 64px;
  --display: "Mona Sans", "Manrope", system-ui, sans-serif;
  --face: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --neon: 0 0 2px rgba(255, 255, 255, 0.9), 0 0 14px rgba(77, 125, 255, 0.95), 0 0 34px rgba(46, 92, 255, 0.75);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--deep); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--text); font: 500 18px/1.55 var(--face); font-variant-numeric: tabular-nums; background: var(--deep); overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--text); }
:focus-visible { outline: 3px solid var(--warm); outline-offset: 3px; border-radius: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.disp { font-family: var(--display); font-style: italic; font-stretch: 125%; font-weight: 900; letter-spacing: -0.005em; }
.mono { font-family: var(--mono); font-weight: 500; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gut); top: -80px; z-index: 80; background: var(--glaze); color: var(--ink); padding: 12px 20px; border-radius: 12px; font-weight: 800; }
.skip:focus { top: 8px; }
.gold { color: var(--warm); }

/* ---------- the night: sky picture, stars, drifting clouds, the moon's halo ---------- */
.night { position: relative; isolation: isolate; }
.sky { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(180deg, var(--night0), var(--night1)); }
.sky > picture img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.sky .clouds { position: absolute; left: 0; top: 0; width: 200%; height: 70%; background: url(../img/v2/clouds.webp) 0 0 / 50% auto repeat-x; mix-blend-mode: screen; opacity: 0.5; animation: drift 180s linear infinite; }
@keyframes drift { to { transform: translateX(-50%); } }
.sky canvas.stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.moon-halo { position: absolute; z-index: 0; width: 16vmin; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, rgba(220, 232, 255, 0.5), rgba(140, 170, 255, 0.16) 60%, rgba(120, 150, 255, 0)); transform: translate(-50%, -50%); animation: halo 7s ease-in-out infinite; pointer-events: none; }
@keyframes halo { 50% { opacity: 0.55; transform: translate(-50%, -50%) scale(1.12); } }
.moon-halo.flare { animation: flare 1.6s ease-out; }
@keyframes flare { 30% { transform: translate(-50%, -50%) scale(1.7); opacity: 1; } }

/* ---------- the bar ---------- */
.bar { display: flex; align-items: center; gap: var(--s4); height: var(--bar); position: relative; z-index: 20; }
.bar .home { white-space: nowrap; display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; font-weight: 800; font-size: 17px; }
.bar .home img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(120, 150, 255, 0.55), 0 0 18px rgba(77, 125, 255, 0.9); }
.bar nav { display: flex; gap: var(--s3); }
.bar nav a { white-space: nowrap; color: var(--text); font-weight: 700; font-size: 17px; padding: 8px 0; text-decoration: underline 2px transparent; text-underline-offset: 10px; }
.bar nav a:hover { text-decoration-color: rgba(184, 200, 255, 0.6); }
.bar nav a[aria-current="page"] { color: #fff; text-decoration-color: var(--warm); text-shadow: 0 0 12px rgba(77, 125, 255, 0.9); }
.badge { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 22px; border-radius: 999px; background: var(--glass); border: 1px solid var(--edge); color: var(--text); font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap; }
.badge i { width: 10px; height: 10px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 10px var(--warm); }
.badge.live i { background: #7dffb0; box-shadow: 0 0 10px #7dffb0; }
.menu { display: none; }

/* ---------- the one surface: cobalt glass ---------- */
.glass { background: var(--glass); border: 1px solid var(--edge); border-radius: 20px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 30px rgba(2, 8, 40, 0.45); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 1.4em; border-radius: 999px; font: 800 17px/1 var(--face); text-decoration: none; cursor: pointer; border: 1px solid var(--edge); transition: transform 0.12s ease-out, background-color 0.15s, box-shadow 0.2s; }
.btn:active { transform: translateY(1px) scale(0.985); }
.btn-primary { background: #fff; color: var(--ink); border-color: #fff; box-shadow: 0 0 0 2px rgba(120, 150, 255, 0.45), 0 0 26px rgba(77, 125, 255, 0.85); }
.btn-primary:hover { box-shadow: 0 0 0 2px rgba(150, 175, 255, 0.7), 0 0 36px rgba(77, 125, 255, 1); }
.btn-ghost { background: var(--glass); color: #fff; }
.btn-ghost:hover { background: var(--glass-2); }
.btn[aria-pressed="true"] { background: var(--warm); border-color: var(--warm); color: #2a1a00; box-shadow: 0 0 26px rgba(255, 176, 46, 0.8); }
.btn[aria-disabled="true"], .lk[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }

/* ---------- the first screen: the sky part ---------- */
.first { position: relative; min-height: 100svh; display: flex; flex-direction: column; }
.top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: var(--s5); align-items: end; padding-top: var(--s1); padding-bottom: var(--s3); position: relative; z-index: 5; }
.lead { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.name { margin: 0; font-size: clamp(52px, 6vw, 112px); line-height: 0.95; color: #fff; text-shadow: var(--neon); white-space: nowrap; }
.name.flash { animation: nameflash 1.6s ease-out; }
@keyframes nameflash { 25% { text-shadow: 0 0 4px #fff, 0 0 30px #9fb8ff, 0 0 80px #4d7dff, 0 0 120px #ffc84a; } }
.tick { font-size: 0.4em; vertical-align: 0.55em; margin-left: 0.3em; color: #fff; }
.headline { margin: 0; font-family: var(--display); font-style: italic; font-stretch: 112%; font-weight: 800; font-size: clamp(22px, 1.85vw, 32px); line-height: 1.18; color: var(--text); max-width: 26em; }
.headline em { font-style: inherit; color: var(--warm); text-shadow: 0 0 16px rgba(255, 176, 46, 0.55); }
.copy { margin: 0; color: var(--muted); font-size: 18px; max-width: 40em; }
.copy b { color: #fff; font-weight: 800; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: 4px; }

/* the board over the roof: three numbers, the counters, the contract */
.board { display: grid; gap: 12px; min-width: 0; }
.board .glass { background: rgba(8, 21, 88, 0.88); }
.nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 30px 16px 24px; }
.num { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 0 12px; position: relative; text-align: center; }
.num + .num::before { content: ""; position: absolute; left: 0; top: 10%; bottom: 10%; width: 1px; background: var(--edge); }
.num strong { font-family: var(--display); font-style: italic; font-stretch: 118%; font-weight: 900; color: #fff; font-size: clamp(28px, 2.5vw, 46px); line-height: 1.05; text-shadow: 0 0 14px rgba(77, 125, 255, 0.85); }
.num.gold strong { color: var(--warm); text-shadow: 0 0 16px rgba(255, 176, 46, 0.6); }
.num span { font-size: 16px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.num span b { color: var(--warm); font-weight: 800; }
.flip { display: inline-block; }
.flip.go { animation: flipnum 0.45s ease-out; }
@keyframes flipnum { 0% { transform: translateY(-40%) rotateX(80deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.counters { grid-column: 1 / -1; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px var(--s4); font-size: 16px; color: var(--muted); margin-top: 16px; padding: 14px 16px 10px; border-top: 1px solid rgba(184, 200, 255, 0.18); line-height: 1.6; }
.counters b { color: #fff; font-weight: 800; }
.ca { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 10px 10px 20px; }
.ca-label { font-weight: 800; font-size: 16px; color: #fff; white-space: nowrap; }
.ca-field { min-height: 48px; display: flex; align-items: center; padding: 0 var(--s2); border-radius: 12px; background: rgba(4, 12, 52, 0.85); border: 1px solid var(--edge); color: var(--muted); font-size: 16px; min-width: 0; }
.ca-field.set { font-family: var(--mono); color: #fff; cursor: pointer; }
.ca-field span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copybtn { min-height: 48px; padding: 0 22px; }
.links { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lk { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 14px; background: #10297f; border: 1px solid var(--edge); color: #fff; font-weight: 800; font-size: 16px; text-decoration: none; transition: transform 0.12s ease-out, background-color 0.15s; }
.lk img { width: 22px; height: 22px; object-fit: contain; border-radius: 4px; background: #fff; padding: 2px; }
.lk:hover { background: #163aa8; }
.lk:active { transform: translateY(1px) scale(0.985); }

/* ---------- the house: roof, facade, the panel of 200 tiles ---------- */
.house { --t: 40px; --g: 3px; --plq: 200px; position: relative; z-index: 4; margin-top: auto; }
.roof { position: relative; height: calc(var(--t) * 1.5); background: url(../img/v2/roof-strip.webp) 0 100% / auto 100% repeat-x; filter: drop-shadow(0 -6px 16px rgba(77, 125, 255, 0.35)); }
.chimney { position: absolute; left: 7%; bottom: 50%; height: calc(var(--t) * 1.9); aspect-ratio: 190 / 150; background: url(../img/v2/chimney.webp) center bottom / contain no-repeat; }
.facade { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; background: #dfe6fb url(../img/v2/wall.webp) 0 0 / calc(var(--t) * 5.6) repeat; padding: calc(var(--t) * 0.5) 0 calc(var(--t) * 1.15); }
.facade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 50, 170, 0.22), rgba(10, 27, 110, 0.42)); pointer-events: none; }
.bay-l { padding-right: var(--plq, 0px) !important; }
.bay-r { padding-left: var(--plq, 0px) !important; }
.bay { display: grid; grid-template-rows: 1fr 1fr; align-items: end; gap: calc(var(--t) * 0.3); padding: 0 calc(var(--t) * 0.4); position: relative; z-index: 1; min-width: 0; overflow: hidden; }
.bay .floor { display: flex; justify-content: space-evenly; align-items: flex-end; width: 100%; gap: calc(var(--t) * 0.2); }
.win { position: relative; height: calc(var(--t) * 4.4); aspect-ratio: 832 / 1264; flex: none; cursor: help; }
.win img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; transition: opacity 0.5s ease-out; }
.win .lit, .win .lit2 { opacity: 0; }
.win.on .lit { opacity: 1; }
.win.on .lit2 { animation: curtain 7s steps(1) infinite; }
@keyframes curtain { 0%, 60% { opacity: 0; } 61%, 100% { opacity: 1; } }
.win .lamp { position: absolute; left: 50%; bottom: 14%; width: 80%; aspect-ratio: 1; transform: translate(-50%, 50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 214, 120, 0.95), rgba(255, 176, 46, 0.35) 45%, rgba(255, 176, 46, 0)); opacity: 0; pointer-events: none; }
.win .lamp.on { animation: lamp 1.6s ease-out; }
@keyframes lamp { 20% { opacity: 1; } 100% { opacity: 0; } }
.win.flash .lit { animation: winflash 0.9s ease-out; }
@keyframes winflash { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
.lily { width: calc(var(--t) * 1.2); aspect-ratio: 1; background: url(../img/v2/tile-lily.webp) center / cover; border-radius: 3px; box-shadow: 0 1px 4px rgba(6, 18, 69, 0.5); flex: none; align-self: center; }

.panel-wrap { position: relative; z-index: 2; padding: calc(var(--t) * 0.28); border-radius: 6px; background: linear-gradient(180deg, #efe6d2, #d6c8aa); box-shadow: 0 0 0 2px #b9a888, 0 10px 26px rgba(4, 10, 40, 0.55); align-self: center; }
.panel { display: grid; grid-template-columns: repeat(var(--cols, 20), var(--t)); grid-auto-rows: var(--t); gap: var(--g); background: #c4b898; padding: var(--g); border-radius: 3px; }
.t { position: relative; border-radius: 2px; background: url(../img/v2/tile-lily.webp) center / cover; }
.t::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: url(../img/v2/tile-gold.webp) center / cover; opacity: 0; transition: opacity 0.35s ease-out; }
.t.on::before { opacity: 1; box-shadow: 0 0 calc(var(--t) * 0.35) rgba(255, 186, 60, 0.7); }
.t.lighting::before { animation: lightup 0.6s ease-out; }
@keyframes lightup { 0% { opacity: 0; } 40% { opacity: 1; filter: brightness(1.7); } 100% { opacity: 1; } }
.t.dimming::before { animation: dimdown 0.6s ease-in; }
@keyframes dimdown { 0% { opacity: 1; filter: brightness(1.5); } 100% { opacity: 0; } }
.t.glint::after { content: ""; position: absolute; inset: -40%; background: url(../img/glint.webp) center / contain no-repeat; animation: spark 0.8s ease-out forwards; z-index: 3; pointer-events: none; }
@keyframes spark { 0% { transform: scale(0) rotate(0); opacity: 0; } 35% { transform: scale(1) rotate(20deg); opacity: 1; } 100% { transform: scale(0.2) rotate(45deg); opacity: 0; } }
.t.chill { animation: chill 0.7s ease-out; }
@keyframes chill { 40% { filter: brightness(0.6) saturate(1.6); } }
.t:hover { filter: brightness(1.18); }
.panel-wrap.wave .t::before { animation: wave 1.4s ease-in-out both; animation-delay: calc(var(--i) * 6ms); }
@keyframes wave { 0% { opacity: 0; } 60% { opacity: 1; filter: brightness(1.7); } 100% { opacity: 1; } }

/* the two lines: a glowing step on the tile boundary, with a glaze plaque at the panel's edge */
.line { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.line i { position: absolute; box-sizing: border-box; background: #fff; box-shadow: 0 0 0 1.5px currentColor, 0 0 10px 2px currentColor, 0 0 24px 4px currentColor; border-radius: 3px; transition: left 0.9s ease-in-out, top 0.9s ease-in-out, width 0.9s ease-in-out, height 0.9s ease-in-out; }
.line i.fr { background: transparent; border: 3px solid #fff; border-radius: 4px; box-shadow: 0 0 0 1.5px currentColor, 0 0 12px 3px currentColor, inset 0 0 10px currentColor; }
.line-climb { color: #3f74ff; }
.line-low { color: #ff9f1c; }
.line.flash i { animation: linef 1.4s ease-out; }
.line.hot i { box-shadow: 0 0 10px #fff, 0 0 26px currentColor; }
@keyframes linef { 20% { box-shadow: 0 0 14px #fff, 0 0 40px currentColor; background: #fff; } }
.plaque { position: absolute; z-index: 6; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 16px; border-radius: 10px; background: linear-gradient(180deg, #ffffff, #e3e9ff); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 0 0 2px #fff inset, 0 6px 16px rgba(4, 10, 40, 0.5); font-weight: 800; font-size: 16px; white-space: nowrap; transition: top 0.9s ease-in-out; cursor: help; }
.plaque b { font-family: var(--display); font-style: italic; font-stretch: 112%; font-weight: 900; }
.plaque .dots { display: inline-flex; gap: 4px; }
.plaque .dots i { width: 9px; height: 9px; border-radius: 50%; background: #c9d3f5; box-shadow: inset 0 0 0 1px #8fa2e0; transition: background 0.25s, box-shadow 0.25s; }
.plaque .dots i.on { background: var(--glow); box-shadow: 0 0 8px var(--glow); }
.plaque-low .dots i.on { background: var(--warm2); box-shadow: 0 0 8px var(--warm2); }
.plaque-climb { left: 100%; margin-left: calc(var(--t) * 0.35); transform: translateY(-50%); }
.plaque-low { right: 100%; margin-right: calc(var(--t) * 0.35); transform: translateY(-50%); }
.sign { position: absolute; z-index: 7; left: 50%; bottom: calc(var(--t) * 0.18); transform: translateX(-50%); padding: 8px 20px; border-radius: 10px; background: linear-gradient(180deg, #ffffff, #e3e9ff); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 0 0 2px #fff inset, 0 8px 20px rgba(4, 10, 40, 0.55); font-weight: 800; font-size: 16px; white-space: nowrap; }
.sign .sep { color: #7f93d6; margin: 0 8px; }
.trial { position: absolute; z-index: 8; left: 50%; bottom: calc(var(--t) * 0.15); transform: translateX(-50%); width: min(780px, 94%); display: none; grid-template-columns: auto minmax(120px, 1fr) auto; align-items: center; gap: 10px 14px; padding: 12px 20px; }
.trial.on { display: grid; }
.trial label { font-weight: 800; color: #fff; font-size: 16px; }
.trial input[type="range"] { accent-color: var(--warm); height: 32px; width: 100%; }
.trial output { font-weight: 800; color: var(--warm); min-width: 4em; }
.trial .rule { grid-column: 1 / -1; margin: 0; font-size: 16px; color: var(--text); }
.trial .rule b { color: #fff; }
canvas.fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 9; pointer-events: none; }

/* the hover card (tiles, lines, windows): placed by js, flips and shifts to stay whole */
.tip { position: fixed; z-index: 60; max-width: 320px; padding: 12px 16px; font-size: 16px; line-height: 1.4; color: var(--text); pointer-events: none; opacity: 0; transition: opacity 0.12s; border-radius: 14px; }
.tip.on { opacity: 1; }
.tip b { color: #fff; }

/* ---------- sections below the first screen ---------- */
.below { background: linear-gradient(180deg, #0b1d70 0%, var(--deep) 40%); }
.sec { position: relative; padding: var(--s6) 0; }
.sec-head { display: grid; gap: var(--s1); margin-bottom: var(--s4); }
.sec-head h2 { margin: 0; color: #fff; text-shadow: var(--neon); font-size: clamp(32px, 3.2vw, 48px); line-height: 1.05; }
.sec-head p { margin: 0; color: var(--muted); max-width: 46em; }
.feed { list-style: none; margin: 0; padding: 8px 0; }
.feed li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: var(--s2); min-height: 56px; padding: 12px 24px; position: relative; }
.feed li + li::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 1px; background: var(--edge); opacity: 0.6; }
.feed li.new { animation: rowin 0.45s ease-out; }
@keyframes rowin { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.feed li.big { background: rgba(255, 200, 74, 0.12); }
.feed li.big.lowrow { background: rgba(77, 125, 255, 0.2); }
.feed .chip { width: 32px; height: 32px; border-radius: 4px; background: url(../img/v2/tile-lily.webp) center / cover; }
.feed .chip.g { background-image: url(../img/v2/tile-gold.webp); box-shadow: 0 0 10px rgba(255, 186, 60, 0.6); }
.feed .t1 { font-weight: 700; color: #fff; }
.feed .t2 { color: var(--muted); font-size: 16px; }
.feed .amt { font-weight: 800; color: #fff; text-align: right; white-space: nowrap; }
.feed .up { color: var(--warm); }
.feed .down { color: #a9c6ff; }
.feed-foot { display: flex; justify-content: center; padding: 8px 0 16px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.card { padding: var(--s4); display: grid; gap: var(--s2); align-content: start; }
.card h3 { margin: 0; color: #fff; text-shadow: var(--neon); font-size: 34px; line-height: 1; }
.card p { margin: 0; color: var(--text); }
.card .big { font-family: var(--display); font-style: italic; font-stretch: 118%; font-weight: 900; font-size: 44px; color: var(--warm); line-height: 1; text-shadow: 0 0 16px rgba(255, 176, 46, 0.5); }
.mini { --t: 12px; --g: 2px; position: relative; justify-self: start; padding: 0 calc(var(--t) * 0.5); }
.mini .panel-wrap { padding: 5px; }
.mini .line i { box-shadow: 0 0 5px currentColor; }

/* ---------- inner pages ---------- */
.page-top { position: relative; padding-bottom: var(--s4); }
.page-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s5); align-items: end; padding: var(--s5) 0 var(--s3); }
.page-head h1 { margin: 0; color: #fff; text-shadow: var(--neon); font-size: clamp(48px, 5.6vw, 104px); line-height: 0.95; }
.page-head p { margin: var(--s2) 0 0; color: var(--muted); max-width: 44em; }
.table-box { padding: 8px 0; overflow: hidden; }
.note { margin: 0 0 12px; font-size: 16px; color: var(--muted); }
.note b { color: var(--warm); }
.table { width: 100%; border-collapse: collapse; font-size: 17px; }
.table th { text-align: left; font-size: 16px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; padding: 14px 24px; }
.table td { padding: 0 24px; height: 54px; border-top: 1px solid rgba(184, 200, 255, 0.16); vertical-align: middle; }
.table td.r, .table th.r { text-align: right; }
.table tr.row-in { animation: rowin 0.5s ease-out both; }
.table tbody tr:hover td { background: rgba(77, 125, 255, 0.16); }
.table .kind { font-weight: 800; color: #a9c6ff; }
.table .kind.climb, .table .kind.goal { color: var(--warm); }
.share { display: flex; align-items: center; gap: var(--s2); justify-content: flex-end; }
.bar-share { position: relative; height: 10px; width: 160px; border-radius: 6px; background: rgba(184, 200, 255, 0.18); overflow: hidden; }
.bar-share i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--warm2), var(--warm)); border-radius: inherit; transition: width 0.9s ease-out; box-shadow: 0 0 10px rgba(255, 176, 46, 0.6); }
.addr { font-family: var(--mono); font-size: 16px; color: #fff; text-decoration: underline 1px rgba(184, 200, 255, 0.45); text-underline-offset: 4px; white-space: nowrap; }
button.addr { background: none; border: 0; padding: 0; cursor: pointer; }
.empty { color: var(--muted); padding: var(--s3) 24px; }
/* text sections: the title, then the text under it in one 720 px column (no empty left half) */
.split .sec-head { margin-bottom: var(--s3); }
.prose { max-width: 720px; display: grid; gap: var(--s2); }
.prose p { margin: 0; }
.prose b { color: #fff; }
.memo { display: block; font-family: var(--mono); font-size: 16px; padding: var(--s2) var(--s3); color: #fff; overflow-wrap: anywhere; }
.calc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.calc .card { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s3); }
.calc .card > * { grid-column: 1; }
.calc .card .aside { grid-column: 2; grid-row: 1 / span 6; align-self: start; display: grid; gap: 10px; justify-items: center; }
.calc .aside span { font-size: 16px; color: var(--muted); }
.calc label { display: grid; gap: 6px; font-weight: 700; color: #fff; font-size: 16px; }
.calc input { min-height: 52px; border-radius: 12px; border: 1px solid var(--edge); padding: 0 var(--s2); font: 700 18px var(--face); color: #fff; background: rgba(4, 12, 52, 0.85); width: 100%; font-variant-numeric: tabular-nums; }
.calc .out { overflow-wrap: anywhere; font-family: var(--display); font-style: italic; font-stretch: 118%; font-weight: 900; font-size: clamp(28px, 2.6vw, 40px); color: var(--warm); line-height: 1.05; text-shadow: 0 0 16px rgba(255, 176, 46, 0.5); }
.calc .formula { font-size: 16px; color: var(--muted); background: rgba(4, 12, 52, 0.55); border: 1px solid var(--edge); border-radius: 12px; padding: 10px 18px; margin: 0; }
.calc .hint { font-size: 16px; color: var(--muted); margin: 0; }
.wins { display: grid; grid-template-columns: repeat(5, 24px); gap: 6px; }
.wins i { width: 24px; height: 38px; border-radius: 12px 12px 3px 3px; background: #0b1f73; border: 1px solid var(--edge); transition: background 0.4s, box-shadow 0.4s; }
.wins i.on { background: linear-gradient(180deg, var(--warm), var(--warm2)); box-shadow: 0 0 12px rgba(255, 176, 46, 0.7); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--glaze); color: var(--ink); padding: 14px 24px; border-radius: 999px; font-weight: 800; font-size: 16px; transition: transform 0.25s ease-out; z-index: 70; }
.toast.on { transform: translate(-50%, 0); }
.fetch-err { font-size: 16px; color: var(--muted); margin: 0; text-align: center; }

/* ---------- 404 ---------- */
.lost { min-height: calc(100svh - var(--bar)); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s5); align-items: center; padding: var(--s5) 0; }
.lost .pic { border-radius: 24px; overflow: hidden; box-shadow: 0 0 0 1px var(--edge), 0 0 40px rgba(77, 125, 255, 0.45); }
.lost .pic img { width: 100%; animation: push 24s ease-in-out infinite alternate; }
@keyframes push { from { transform: scale(1); } to { transform: scale(1.06) translateY(-1%); } }
.lost .lead { gap: var(--s3); }
.lost .name { white-space: normal; }

/* ---------- narrow desktop ---------- */
@media (max-width: 1240px) {
  .top { grid-template-columns: minmax(0, 1fr); row-gap: var(--s3); }
  .calc { grid-template-columns: minmax(0, 1fr); }
}
/* tablets: the plaques sit on the panel's own edges, the bays give up their room for them */
@media (max-width: 1100px) {
  .house { --plq: 0px; }
  .plaque-climb { left: auto; right: 0; margin: 0; transform: translateY(-50%); }
  .plaque-low { right: auto; left: 0; margin: 0; transform: translateY(-50%); }
  .badge .long, .bar .home span { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split .sec-head { position: static; margin-bottom: var(--s3); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .cards .card { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s4); }
  .cards .card > :not(.mini) { grid-column: 2; }
  .cards .card .mini { grid-row: 1 / span 3; align-self: center; }
}
/* ---------- phone ---------- */
@media (max-width: 760px) {
  .bar { gap: var(--s2); }
  .bar nav { display: none; position: absolute; left: 0; right: 0; top: var(--bar); z-index: 40; flex-direction: column; gap: 0; padding: var(--s1) var(--gut) var(--s2); border-radius: 0 0 18px 18px; background: rgba(6, 18, 69, 0.97); border-bottom: 1px solid var(--edge); }
  .bar nav.open { display: flex; }
  .bar nav a { padding: 14px 0; font-size: 18px; }
  .menu { display: inline-flex; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--edge); background: var(--glass); color: #fff; font: 800 16px var(--face); align-items: center; cursor: pointer; }
  .badge { padding: 0 16px; }
  .badge .long { display: none; }
  .bar .home span { display: none; }
  .name { white-space: normal; font-size: clamp(46px, 14vw, 64px); }
  .nums { padding: 12px 0; }
  .num { padding: 0 6px; }
  .num span { white-space: normal; }
  .ca { grid-template-columns: minmax(0, 1fr) auto; padding: 12px; }
  .ca-label { grid-column: 1 / -1; }
  .links { grid-template-columns: minmax(0, 1fr); }
  .facade { grid-template-columns: minmax(0, 1fr); padding-top: calc(var(--t) * 0.4); padding-bottom: calc(var(--t) * 2.6); }
  .house { --plq: 0px; }
  .bay-l { grid-template-rows: auto; }
  .bay-l .floor + .floor, .bay-r { display: none; }
  .panel-wrap { justify-self: center; margin: calc(var(--t) * 1.6) 0 calc(var(--t) * 1.4); }
  .plaque-climb { left: auto; right: 0; margin: 0; transform: translateY(-50%); }
  .plaque-low { right: auto; left: 0; margin: 0; transform: translateY(-50%); }
  .sign { white-space: normal; text-align: center; width: max-content; max-width: 92%; }
  .trial { grid-template-columns: minmax(0, 1fr) auto; }
  .trial label { grid-column: 1 / -1; }
  .cards, .calc, .split, .lost, .page-head { grid-template-columns: minmax(0, 1fr); }
  .cards .card { grid-template-columns: minmax(0, 1fr); }
  .cards .card > :not(.mini), .cards .card .mini { grid-column: 1; grid-row: auto; }
  #sum { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  #sum .num + .num::before { left: 10%; right: 10%; top: -6px; bottom: auto; width: auto; height: 1px; }
  .split .sec-head { position: static; margin-bottom: var(--s3); }
  .calc .card { grid-template-columns: minmax(0, 1fr); }
  .calc .card .aside { grid-column: 1; grid-row: auto; justify-items: start; }
  .feed li { grid-template-columns: 32px minmax(0, 1fr); padding: 10px 16px; }
  .feed .amt { grid-column: 2; text-align: left; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 20px; border-top: 1px solid rgba(184, 200, 255, 0.16); }
  .table td { border: 0; height: auto; min-height: 32px; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: var(--s2); text-align: right; }
  .table td::before { content: attr(data-k); font-weight: 700; color: var(--muted); text-align: left; }
  .bar-share { width: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 420px) {
  .ca { grid-template-columns: minmax(0, 1fr); }
  .copybtn { width: 100%; }
}
