/* Chameleon colours: the page background and Claudius's body change over time (see app.js).
   Registered so the browser can animate them smoothly. */
@property --orange { syntax: "<color>"; inherits: true; initial-value: #fd6e23; }
@property --claudius { syntax: "<color>"; inherits: true; initial-value: #0b0b0b; }

:root {
  --orange: #fd6e23;
  --claudius: #0b0b0b;
  --orange-deep: color-mix(in srgb, var(--orange) 86%, black);
  transition: --orange 3s ease-in-out;
  --ink: #0b0b0b;
  --ink-2: #1c1a18;
  --cream: #fbf3e4;
  --cream-2: #f1e3c9;
  --paper: #fffaf1;
  --muted: #7a6450;
  --gold: #f4c04a;
  --ok: #2e8b57;
  --bad: #c0302a;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
html { background: var(--ink); scroll-behavior: smooth; }
body {
  background: var(--orange);
  color: var(--ink);
  font: 400 16px/1.5 var(--display);
  overflow-x: hidden;
}
h2, h3 { font-family: var(--display); letter-spacing: -.02em; margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono, code { font-family: var(--mono); font-size: .8em; word-break: break-all; }
.link { border: 0; background: none; cursor: pointer; text-decoration: underline; padding: 0; }

/* ---------------------------------------------------------------- header */
.top {
  position: relative; z-index: 5;
  display: flex; align-items: center; gap: 24px;
  padding: 16px clamp(16px, 4vw, 40px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav button, .nav a {
  border: 0; background: none; cursor: pointer; text-decoration: none;
  font-weight: 500; padding: 8px 12px; border-radius: 999px;
}
.nav button:hover, .nav a:hover { background: rgba(255, 255, 255, .28); }
.pill {
  border: 0; cursor: pointer; border-radius: 999px;
  padding: 10px 18px; font-weight: 700;
  background: rgba(255, 255, 255, .3);
  transition: background .2s, transform .15s;
}
.pill:active { transform: scale(.97); }
.pill.solid { background: var(--ink); color: var(--cream); }
.pill.solid:hover { background: var(--ink-2); }
.pill.connected { background: var(--cream); color: var(--ink); }
.pill.connected::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 8px; vertical-align: 1px; }

/* ---------------------------------------------------------------- layout */
.app {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: clamp(16px, 3vw, 40px); align-items: center;
  max-width: 1280px; margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 40px) 24px;
}

/* ---------------------------------------------------------------- stage */
.stage { display: flex; flex-direction: column; align-items: center; }
.network { position: relative; width: 100%; max-width: 680px; aspect-ratio: 680 / 540; }
.wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wires line { stroke: rgba(11, 11, 11, .25); stroke-width: 1.5; stroke-dasharray: 4 6; animation: dash 18s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -200; } }
.hero { position: absolute; left: 50%; top: 50%; width: 52%; aspect-ratio: 1; transform: translate(-50%, -50%); cursor: pointer; }
.tagline { margin: 4px 0 0; font-weight: 500; font-size: 1.05rem; text-align: center; min-height: 1.5em; }

.mascot { width: 100%; height: 100%; overflow: visible; display: block; }
.mascot .body { fill: var(--claudius); }
.mascot .sclera { fill: var(--cream); }
.mascot .pupil { fill: var(--ink); }
.mascot .lid { fill: var(--claudius); transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); }
.mascot.blink .lid { animation: blink .18s ease-in-out; }
@keyframes blink { 50% { transform: scaleY(1); } }
.hero .body-wrap { transform-origin: 500px 490px; animation: breathe 5.5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: rotate(4deg) scale(1.025); } }
.hero.thinking .body-wrap { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero.no .mascot { animation: shake .5s ease-in-out; }
@keyframes shake {
  20% { transform: translateX(-14px) rotate(-4deg); }
  40% { transform: translateX(12px) rotate(3deg); }
  60% { transform: translateX(-8px) rotate(-2deg); }
  80% { transform: translateX(5px); }
}
.hero.won .body { fill: var(--gold); }
/* Per-form idle animations. Swirl: fast spins now and then. Virus: coughs (see app.js). */
.hero[data-form="swirl"] .body-wrap { animation: spinburst 3.2s cubic-bezier(.6, 0, .3, 1) infinite; }
@keyframes spinburst { 0%, 55% { transform: rotate(0); } 85%, 100% { transform: rotate(-720deg); } }
.hero.cough .mascot { animation: cough .7s ease-out; }
@keyframes cough {
  0% { scale: 1; } 15% { scale: .9 1.07; translate: -6px 4px; } 30% { scale: 1.1 .9; translate: 8px -2px; }
  45% { scale: .95 1.04; translate: -3px 2px; } 60% { scale: 1.05 .96; translate: 4px 0; } 100% { scale: 1; translate: 0; }
}
.hero.mutating .mascot { animation: wobble 1.3s ease-in-out; }
@keyframes wobble { 30% { scale: 1.05 .95; } 60% { scale: .97 1.04; } }
.mascot .craters { fill: rgba(11, 11, 11, .22); transition: opacity .6s; }
.mascot .floors { fill: var(--claudius); transition: opacity .6s; }

/* Holographic sweep across the page when the background changes colour. */
.holo-sweep { position: fixed; inset: 0; z-index: 3; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(115deg, transparent 20%, #ff3d7f 32%, #ffc93c 40%, #3ccf9a 48%, #4fb3ff 56%, #8f7bff 64%, transparent 76%);
  background-size: 250% 100%; animation: holosweep 1.6s ease-in-out forwards; }
@keyframes holosweep { 0% { background-position: 120% 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { background-position: -40% 0; opacity: 0; } }

/* ---- scenes: day sky, starry night, toxic swamp ---- */
:root { --on-bg: var(--ink); }
:root[data-scene="night"] { --on-bg: #fbf3e4; }
:root[data-scene="day"] .hero .mascot { filter: drop-shadow(0 0 30px rgba(255, 179, 0, .75)) drop-shadow(0 0 70px rgba(255, 140, 0, .45)); }
:root[data-scene="night"] .hero .mascot { filter: drop-shadow(0 0 26px rgba(255, 227, 154, .55)); }
.hero .mascot { transition: filter 1.4s; }
.mascot .body { transition: fill 1.4s; }
.top, .app, .explain, .foot { position: relative; z-index: 1; }
.brand, .nav a, .nav button, .tagline, .explain > h2, .explain > .lead, .swipe { color: var(--on-bg); transition: color 1.2s; }
.scenes { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.sc { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; overflow: hidden; }
.sc.on { opacity: 1; }
.sc-day { background: linear-gradient(180deg, #4fb6ff 0%, #8fd3ff 55%, #dff3ff 100%); }
.sunglow { position: absolute; left: 50%; top: -30vh; width: 120vh; height: 120vh; translate: -50% 0; border-radius: 50%; background: radial-gradient(circle, rgba(255, 236, 160, .55), rgba(255, 236, 160, 0) 60%); }
.cloud { position: absolute; height: 46px; border-radius: 999px; background: #fff; opacity: .9; animation: drift 60s linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 60px; height: 60px; left: 22px; top: -30px; }
.cloud::after { width: 80px; height: 80px; left: 64px; top: -44px; }
.cloud.c1 { width: 180px; top: 16%; left: -15%; }
.cloud.c2 { width: 240px; top: 34%; left: -30%; animation-duration: 85s; animation-delay: -30s; opacity: .75; }
.cloud.c3 { width: 150px; top: 62%; left: -20%; animation-duration: 70s; animation-delay: -50s; opacity: .6; }
@keyframes drift { to { translate: 140vw 0; } }
.sc-night { background: radial-gradient(ellipse at 50% 120%, #2a2f6b 0%, #141737 45%, #070815 100%); }
.mini-star { position: absolute; color: #f6e7b8; overflow: visible; animation: twinkle var(--d) ease-in-out var(--delay) infinite alternate; filter: drop-shadow(0 0 6px rgba(255, 236, 170, .55)); }
@keyframes twinkle { from { opacity: .35; scale: .8; } to { opacity: 1; scale: 1.08; } }
.dot { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; animation: twinkle 3s ease-in-out var(--delay) infinite alternate; }
.sc-toxic { background: radial-gradient(ellipse at 50% 30%, #c6ff4a 0%, #7fdc2b 40%, #2e8b3a 100%); }
.mini-virus { position: absolute; color: #128a2e; filter: drop-shadow(0 0 6px rgba(200, 255, 80, .7)); overflow: visible; animation: virusfloat var(--d) ease-in-out var(--delay) infinite alternate; }
@keyframes virusfloat { from { translate: 0 0; rotate: 0deg; } to { translate: var(--dx) var(--dy); rotate: 160deg; } }
.tox-bubble { position: absolute; bottom: -30px; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .15); animation: bubbleup var(--d) linear var(--delay) infinite; }
@keyframes bubbleup { to { translate: 0 -110vh; } }
.germs { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.spray { position: absolute; color: #128a2e; filter: drop-shadow(0 0 6px rgba(200, 255, 80, .7)); opacity: 0; translate: -50% -50%; animation: spray 2.2s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes spray { 0% { opacity: 1; transform: translate(0, 0) scale(.3) rotate(0); } 75% { opacity: .95; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1) rotate(300deg); } }
.germ { position: absolute; left: 66%; top: 46%; width: 12px; height: 12px; border-radius: 50%; background: var(--claudius); opacity: 0; pointer-events: none; animation: germ 1s ease-out forwards; }
.germ::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
@keyframes germ { 0% { opacity: 1; transform: translate(0, 0) scale(.4); } 70% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.1); } }

/* Colour effects for Claudius (see FX in app.js). */
.hero.fx-glitch .mascot { animation: glitch .12s steps(2) infinite; filter: drop-shadow(6px 0 0 rgba(255, 0, 80, .7)) drop-shadow(-6px 0 0 rgba(0, 220, 255, .7)); }
@keyframes glitch { 0% { translate: -6px 3px; } 50% { translate: 5px -4px; } 100% { translate: -3px 0; } }
.hero.fx-pop .mascot { animation: fxpop .085s ease-out; }
@keyframes fxpop { 0% { scale: 1.07; } 100% { scale: 1; } }


.hero.won .body-wrap { animation: spin 1.1s cubic-bezier(.3, 1.4, .5, 1) 3, breathe 5.5s ease-in-out 3.3s infinite; }

.sat { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 6px; transform: translate(-50%, -50%); animation: float 6s ease-in-out infinite; }
.sat:nth-of-type(2n) { animation-delay: -3s; }
@keyframes float { 50% { margin-top: -8px; } }
.sat-dot {
  width: clamp(74px, 9vw, 100px); aspect-ratio: 1; border-radius: 50%;
  background: var(--ink); color: var(--cream);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(110, 40, 0, .22);
}
.sat-dot b { font-family: var(--mono); font-size: clamp(.82rem, 1.2vw, 1.05rem); }
.sat-dot i { font-style: normal; font-size: .7rem; opacity: .7; }
.sat-dot.gold { background: var(--cream); color: var(--ink); outline: 3px solid var(--ink); }
.sat-dot.gold b { font-size: clamp(.95rem, 1.5vw, 1.25rem); }
.sat-label { font-size: .78rem; font-weight: 700; background: rgba(255, 255, 255, .3); padding: 3px 10px; border-radius: 999px; }

/* ---------------------------------------------------------------- chat */
.chat {
  display: flex; flex-direction: column;
  height: min(680px, calc(100vh - 110px)); min-height: 520px;
  background: var(--paper);
  border-radius: 28px;
  box-shadow: 0 30px 60px rgba(90, 30, 0, .25), 0 0 0 1px rgba(11, 11, 11, .06);
  overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--cream-2); background: var(--paper); }
.chat-av { width: 42px; height: 42px; flex: none; background: var(--orange); border-radius: 50%; padding: 5px; }
.chat-id { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.chat-id b { font-weight: 800; font-size: 1.05rem; }
.presence { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.dot.busy { background: var(--orange); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.chip { margin-left: auto; font-size: .75rem; font-weight: 700; background: var(--cream); border: 1px solid var(--cream-2); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }

.thread { list-style: none; margin: 0; padding: 18px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 88%; animation: msg-in .3s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.msg .av { width: 28px; height: 28px; flex: none; background: var(--orange); border-radius: 50%; padding: 3px; }
.msg .mbody { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.msg .bubble { padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; word-break: break-word; }
.msg .meta { font-size: .72rem; color: var(--muted); font-family: var(--mono); }
.msg.claudius .bubble { background: var(--cream); border-bottom-left-radius: 6px; }
.msg.player { align-self: flex-end; flex-direction: row-reverse; }
.msg.player .bubble { background: var(--ink); color: var(--cream); border-bottom-right-radius: 6px; }
.msg.player .meta { text-align: right; }
.msg.player.mine .bubble { background: var(--orange-deep); color: #fff; }
.msg.system { align-self: center; max-width: 92%; }
.msg.system .bubble { background: #fff1c9; font-size: .9rem; border-radius: 14px; text-align: center; }
.msg.won .bubble { background: var(--gold); }
.verdict { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.verdict.no { color: var(--bad); }
.verdict.yes { color: #8a5d00; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px !important; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 30% { transform: translateY(-4px); opacity: .5; } }

.composer { border-top: 1px solid var(--cream-2); padding: 12px 14px 12px; background: var(--paper); }
.cost-row { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; margin-bottom: 8px; }
.cost-row #cost-line { font-weight: 700; }
.input-row { display: flex; align-items: flex-end; gap: 8px; background: #fff; border: 1.5px solid var(--cream-2); border-radius: 22px; padding: 6px 6px 6px 14px; transition: border-color .2s; }
.input-row:focus-within { border-color: var(--orange); }
textarea { flex: 1; resize: none; border: 0; outline: 0; padding: 8px 0; font: 400 1rem/1.4 var(--display); background: none; color: var(--ink); max-height: 160px; }
.send { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; cursor: pointer; background: var(--ink); display: grid; place-items: center; transition: transform .15s, opacity .2s; }
.send:hover { transform: scale(1.06); }
.send:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.send svg { width: 20px; height: 20px; fill: none; stroke: var(--cream); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fine { display: flex; justify-content: space-between; gap: 8px; margin: 8px 4px 0; font-size: .75rem; color: var(--muted); }
.fine #tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fine #tx.err { color: var(--bad); }

/* ---------------------------------------------------------------- imperial decree panel */
.decree { width: min(560px, 100%); margin: 14px auto 0; background: var(--paper); border-radius: 22px; padding: 14px 16px 12px; box-shadow: 0 14px 34px rgba(60, 20, 0, .16); text-align: left; }
.decree-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.decree-kicker { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.decree-time { font-size: .75rem; color: var(--muted); font-family: var(--mono); }
.decree-title { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 1.15rem; }
.decree-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; background: conic-gradient(#fd6e23, #ffc93c, #3ccf9a, #4fb3ff, #8f7bff, #ff7eb3, #fd6e23); animation: spin 6s linear infinite; }
.decree.locked .decree-dot { animation: none; background: var(--orange); outline: 2px solid var(--ink); outline-offset: 1px; }
.decree-reason { margin: 4px 0 10px; font-size: .9rem; color: #3a2e24; font-style: italic; }
.decree-dg { display: block; width: 100%; height: auto; margin: 2px 0 2px; }
.mini-label { font: 600 12px var(--display); fill: #8b7b6b; }
.mini-pct { font: 800 15px var(--display); fill: var(--ink); }
.mini-name { font: 800 13px var(--display); fill: var(--ink); }
.mini-sub { font: 500 10.5px var(--display); fill: #8b7b6b; }
.ic.thin { stroke-width: 2.4; }
.split { display: flex; height: 26px; border-radius: 10px; overflow: hidden; font-size: .72rem; font-weight: 800; }
.split span { display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; transition: flex-grow .8s ease; }
.split .s-t { background: var(--ink); color: var(--cream); }
.split .s-b { background: #c0302a; color: #fff; }
.split .s-h { background: #f4c04a; color: var(--ink); }
.modes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mode { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--cream); border: 1.5px solid transparent; color: #5c4a3a; }
.mode i { width: 12px; height: 12px; border-radius: 50%; }
.mode.on { border-color: var(--ink); color: var(--ink); background: #fff; }
.decree-note { margin: 8px 0 0; font-size: .7rem; color: var(--muted); }

/* ---------------------------------------------------------------- how it works + roadmap */
.explain { max-width: 1180px; margin: 64px auto 0; padding: 0 clamp(16px, 4vw, 40px); }
.explain h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 800; }
.lead { margin: 6px 0 22px; font-size: 1.05rem; max-width: 40em; }
.diagram { background: var(--paper); border-radius: 28px; padding: clamp(12px, 3vw, 32px); overflow-x: auto; box-shadow: 0 20px 50px rgba(90, 30, 0, .18); }
.swipe { display: none; margin: -12px 0 8px; font-size: .85rem; font-weight: 700; }
.dg { display: block; width: 100%; min-width: 720px; height: auto; }
.dg-line { fill: none; stroke: #8b7b6b; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dg-label { font: 500 15px var(--display); fill: #6e5d4d; }
.dg-label.soft { fill: #a8968a; font-size: 13px; }
.dg-name { font: 800 18px var(--display); fill: var(--ink); }
.dg-sub { font: 500 13px var(--display); fill: #8b7b6b; }
.tile.cream { fill: #efe3cc; }
.tile.orange { fill: var(--orange); }
.tile.ink { fill: var(--ink); }
.ic { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.ic.light { stroke: var(--cream); }
.steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.steps li { display: flex; gap: 10px; background: rgba(255, 250, 241, .9); border-radius: 18px; padding: 14px; }
.steps b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--cream); display: grid; place-items: center; font-size: .85rem; }
.steps h3 { font-size: 1rem; margin-bottom: 2px; }
.steps p { margin: 0; font-size: .88rem; color: #3a2e24; }

.phases { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; position: relative; }
.phases > li { position: relative; background: var(--paper); border-radius: 22px; padding: 20px 18px 18px; border-top: 6px solid #e8d6b6; }
.phases > li.done { border-top-color: var(--ok); }
.phases > li.next { border-top-color: var(--ink); box-shadow: 0 18px 40px rgba(90, 30, 0, .2); }
.phase { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.phases .done .phase::after { content: " ✓"; color: var(--ok); }
.phases .next .phase::after { content: " · next"; color: var(--orange-deep); }
.phases h3 { font-size: 1.15rem; margin: 6px 0 8px; }
.phases ul { margin: 0; padding-left: 18px; color: #3a2e24; font-size: .92rem; }
.phases ul li { margin: 4px 0; }

/* ---------------------------------------------------------------- footer */
.foot { margin-top: 40px; background: var(--orange-deep); color: rgba(11, 11, 11, .78); padding: 22px clamp(16px, 4vw, 40px) 40px; font-size: .82rem; position: relative; }
.foot-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.foot-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 800; font-size: 1.05rem; margin-top: 0; }
.ca { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-content: start; }
.ca span { font-weight: 700; color: var(--ink); }
.ca code { color: var(--ink); }

/* ---------------------------------------------------------------- tabs + buy */
.tabs { display: flex; gap: 6px; padding: 10px 14px 0; background: var(--paper); }
.tab { flex: 1; border: 0; cursor: pointer; padding: 9px 12px; border-radius: 12px; font-weight: 700; background: none; color: var(--muted); }
.tab:hover { background: var(--cream); }
.tab.active { background: var(--ink); color: var(--cream); }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pane[hidden] { display: none; }
.pane-buy { padding: 16px; overflow-y: auto; }
.swap { display: flex; flex-direction: column; gap: 10px; }
.swap-box { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1.5px solid var(--cream-2); border-radius: 20px; padding: 14px 16px; }
.swap-box:focus-within { border-color: var(--orange); }
.swap-top { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 700; color: var(--muted); }
.swap-row { display: flex; align-items: center; gap: 10px; }
.swap-row input, .swap-row output { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 700 1.9rem/1.1 var(--display); color: var(--ink); padding: 0; }
.swap-row output { overflow: hidden; text-overflow: ellipsis; }
.asset { display: inline-flex; align-items: center; gap: 8px; background: var(--cream); border-radius: 999px; padding: 6px 12px 6px 6px; font-weight: 800; font-size: .9rem; white-space: nowrap; }
.eth-ic, .tok-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.eth-ic { background: var(--ink); color: var(--cream); font-size: .85rem; }
.tok-ic { background: var(--orange); padding: 3px; }
.presets { display: flex; gap: 6px; }
.presets button { border: 1px solid var(--cream-2); background: var(--paper); border-radius: 999px; padding: 4px 10px; font-size: .78rem; font-weight: 700; cursor: pointer; }
.presets button:hover { border-color: var(--orange); }
.swap-arrow { align-self: center; width: 36px; height: 36px; margin: -18px 0; z-index: 1; border-radius: 12px; background: var(--ink); display: grid; place-items: center; border: 3px solid var(--paper); }
.swap-arrow svg { width: 18px; height: 18px; fill: none; stroke: var(--cream); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.swap-info { margin: 4px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: .82rem; }
.swap-info div { display: flex; justify-content: space-between; }
.swap-info dt { color: var(--muted); }
.swap-info dd { margin: 0; font-weight: 700; }
.pill.big { padding: 15px 22px; font-size: 1.05rem; margin-top: 4px; }
.pill:disabled { opacity: .45; cursor: not-allowed; }
#buy-tx.err { color: var(--bad); }

/* ---------------------------------------------------------------- sheets */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(60, 20, 0, .35); backdrop-filter: blur(3px); }
/* Centered dialog on desktop, bottom sheet on phones. No transforms, so nothing can push it off-center. */
.sheet {
  position: fixed; z-index: 21; inset: 0; margin: auto;
  width: min(760px, calc(100% - 32px)); height: fit-content; max-height: 86vh; overflow: auto;
  background: var(--paper); border-radius: 28px;
  padding: 24px clamp(18px, 3vw, 32px) 28px;
  box-shadow: 0 40px 80px rgba(60, 20, 0, .35);
  animation: rise .3s cubic-bezier(.2, 1.1, .4, 1);
}
.small-sheet { width: min(440px, calc(100% - 32px)); }
@keyframes rise { from { opacity: 0; translate: 0 24px; } }
.sheet header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet h2 { font-size: 1.5rem; font-weight: 800; }
.close { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--cream); cursor: pointer; font-size: 1.4rem; line-height: 1; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cards article { background: #fff; border-radius: 18px; padding: 16px; border: 1px solid var(--cream-2); }
.cards article b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--orange); font-weight: 800; }
.cards h3 { margin: 8px 0 4px; font-size: 1.05rem; }
.cards p, .files p { margin: 0; color: #3a2e24; }
.files { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; counter-reset: f; }
.files li { background: #fff; border-radius: 18px; padding: 14px 16px; border: 1px solid var(--cream-2); counter-increment: f; }
.files li::before { content: "Exhibit " counter(f, upper-roman); font-size: .7rem; font-weight: 800; letter-spacing: .12em; color: var(--orange-deep); text-transform: uppercase; }
.files h3 { font-size: 1rem; margin: 4px 0; }
.tribute { display: flex; gap: 14px; align-items: flex-start; margin: 18px 0 6px; padding: 16px 18px; border-radius: 18px; background: #fff3cf; border: 1px solid #ecd9a6; }
.tribute img { flex: none; background: var(--orange); border-radius: 50%; padding: 5px; }
.tribute h3 { font-size: 1.05rem; margin: 2px 0 6px; }
.tribute p { margin: 0 0 8px; color: #3a2e24; font-size: .95rem; }
.tribute p:last-child { margin-bottom: 0; }
.account { background: #fff; border-radius: 18px; padding: 16px; border: 1px solid var(--cream-2); }
.claim-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--cream-2); flex-wrap: wrap; }
.claim-row:last-child { border-bottom: 0; }
pre { white-space: pre-wrap; word-break: break-word; background: #fff; padding: 12px; border-radius: 14px; font-size: .78rem; max-height: 40vh; overflow: auto; }
.wallet-list { display: flex; flex-direction: column; gap: 10px; }
.wallet-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--cream-2); background: #fff; cursor: pointer; text-align: left; font-weight: 700; }
.wallet-opt:hover { border-color: var(--orange); }
.wallet-opt small { display: block; font-weight: 400; color: var(--muted); }
.wallet-opt .wi { width: 36px; height: 36px; border-radius: 10px; background: var(--orange); display: grid; place-items: center; flex: none; padding: 4px; }
.wallet-opt[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .phases { grid-template-columns: 1fr 1fr; }
  .app { grid-template-columns: 1fr; }
  .nav { display: none; }
  .top { justify-content: space-between; }
  .network { max-width: 560px; }
  .chat { height: 620px; }
}
@media (max-width: 600px) {
  .sheet, .small-sheet { inset: auto 0 0 0; width: 100%; border-radius: 24px 24px 0 0; max-height: 88vh; }
  .network { aspect-ratio: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .wires { display: none; }
  .hero { position: relative; left: auto; top: auto; transform: none; width: 64%; margin: 0 auto 6px; grid-column: 1 / -1; }
  .sat { position: static; transform: none; animation: none; }
  .sat-dot { width: 68px; }
  .sat-label { font-size: .66rem; padding: 2px 6px; text-align: center; }
  .chat { height: 70vh; min-height: 480px; border-radius: 22px; }
  .chip { display: none; }
  .cost-row { flex-direction: column; gap: 2px; }
  .cards, .files, .foot-grid, .steps, .phases { grid-template-columns: 1fr; }
  .explain { margin-top: 44px; }
  .swipe { display: block; }
}
/* ── LP Transparency section ─────────────────────────────────────────── */
.lp-transparency { margin-top: 80px; }
.lp-transparency h2 { margin-bottom: 28px; }
.lp-policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.lp-card {
  background: var(--surface, #111);
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 16px;
  padding: 22px 24px;
}
.lp-card h3 { font-size: 1rem; font-weight: 700; margin: 0 0 10px; }
.lp-card p  { font-size: .9rem; line-height: 1.55; margin: 0; opacity: .85; }
.lp-card code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 4px; font-size: .82em; }
.lp-card a { color: inherit; text-decoration: underline; }
.lp-note { font-size: .78rem; opacity: .55; margin-top: 8px; }
.lp-note a { color: inherit; }

/* Reduced motion: Claudius is the brand, so he keeps moving, just gentler. */
@media (prefers-reduced-motion: reduce) {
  .wires line, .sat { animation: none; }
  .hero.won .body-wrap, .hero.thinking .body-wrap { animation-duration: 4s; }
}
