/* EchoCount — paper & ink with a dark instrument stage. shadcn-style primitives, motion-site patterns. */
@property --ang {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
:root {
  --paper: #eeede9;
  --card: #fff;
  --soft: #f5f4f1;
  --ink: #0c0c0e;
  --ink2: #17171b;
  --line: rgba(12, 12, 14, 0.1);
  --line2: rgba(12, 12, 14, 0.2);
  --mute: #6a6964;
  --o: #ff5a1f;
  --v: #8b5cf6;
  --l: #c8f04a;
  --p: #ff3d8b;
  --t: #12b5a6;
  --a: #ffb800;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 24px;
  --r2: 16px;
  --r3: 11px;
  --nav: 84px;
  --shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 14px 34px -16px rgba(12, 12, 14, 0.22), 0 2px 6px rgba(12, 12, 14, 0.05);
  --deep: #0c0c0e;
  --inv: #0c0c0e;
  --inv2: #17171b;
  --inv-fg: #fff;
  --mute2: #44433f;
  --hover: #e9e8e3;
  --code-bg: rgba(12, 12, 14, 0.07);
  --dot: rgba(12, 12, 14, 0.16);
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-bg2: rgba(255, 255, 255, 0.88);
  --dz-hover: #fff3ec;
  --err: #b3185a;
  --n-bg: #fff6db;
  --n-line: #f0d98b;
  --n-ink: #5c4700;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: clamp(15px, 0.3vw + 14px, 18px);
}
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100svh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(var(--dot) 1px, transparent 1.2px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size:
    26px 26px,
    160px 160px;
  mask-image: linear-gradient(#000, transparent 70%);
  -webkit-mask-image: linear-gradient(#000, transparent 70%);
}
main {
  flex: 1;
  padding-top: calc(var(--nav) + env(safe-area-inset-top));
}
img,
svg,
canvas {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--o);
  outline-offset: 3px;
  border-radius: 8px;
}
.hidden {
  display: none !important;
}
.ic {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}
.wrap {
  width: min(100% - clamp(28px, 6vw, 80px), 1280px);
  margin-inline: auto;
}
h1,
h2,
h3,
h4 {
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
}
h1,
h2 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.045em;
}
h1 {
  font-size: clamp(2.3rem, 6.4vw, 6rem);
  font-weight: 800;
}
h2 {
  font-size: clamp(1.6rem, 3.6vw, 3.1rem);
}
h3 {
  font-size: 1.2rem;
}
p {
  color: var(--mute);
  max-width: 62ch;
}
p code,
li code,
.notice code {
  font: 0.85em var(--mono);
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--ink);
}
.lead {
  font-size: clamp(1.05rem, 1.35vw, 1.3rem);
  color: var(--mute2);
}
.section {
  padding-block: clamp(56px, 9vw, 128px);
}
.section-head {
  display: grid;
  gap: 14px;
  margin-bottom: clamp(28px, 4vw, 56px);
}
.scrollbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--o), var(--p), var(--v));
  z-index: 90;
}
.kbd {
  font: 500 0.72rem var(--mono);
  padding: 2px 7px;
  border-radius: 7px;
  border: 1px solid var(--line2);
  background: var(--card);
  color: var(--mute);
  box-shadow: 0 1px 0 var(--line2);
}

/* floating nav */
.nav {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 99px;
  max-width: calc(100vw - 24px);
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(1.7);
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition:
    box-shadow 0.3s,
    background 0.3s;
}
.nav.scrolled {
  background: var(--nav-bg2);
  box-shadow: 0 20px 40px -18px rgba(12, 12, 14, 0.3);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 14px 2px 2px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.04em;
}
.mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--deep);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.mark i {
  width: 3px;
  border-radius: 2px;
  height: 10px;
  animation: eq 1.1s ease-in-out infinite;
}
.mark i:nth-child(1) {
  background: var(--o);
}
.mark i:nth-child(2) {
  background: var(--l);
  animation-delay: 0.2s;
}
.mark i:nth-child(3) {
  background: var(--v);
  animation-delay: 0.4s;
}
@keyframes eq {
  0%,
  100% {
    height: 6px;
  }
  50% {
    height: 18px;
  }
}
.links {
  position: relative;
  display: flex;
}
.links a {
  position: relative;
  z-index: 1;
  padding: 9px 16px;
  border-radius: 99px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--mute);
  transition: color 0.2s;
}
.links a:hover,
.links a.active {
  color: var(--ink);
}
.ind {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  border-radius: 99px;
  background: var(--code-bg);
  transition:
    left 0.4s cubic-bezier(0.3, 1.3, 0.4, 1),
    width 0.4s cubic-bezier(0.3, 1.3, 0.4, 1),
    opacity 0.2s;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding-left: 6px;
  border-left: 1px solid var(--line);
}
.cmd-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-radius: 99px;
  border: 0;
  background: var(--soft);
  font-size: 0.88rem;
  color: var(--mute);
  transition: background 0.2s;
}
.cmd-btn:hover {
  background: var(--hover);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 99px;
  background: var(--deep);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}
.pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--a);
  animation: ping 2.2s infinite;
  color: var(--a);
}
.pill[data-state="ready"] i {
  background: var(--l);
  color: var(--l);
}
.pill[data-state="offline"] i {
  background: var(--p);
  color: var(--p);
  animation: none;
}
@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px transparent;
  }
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  display: inline-grid;
  place-items: center;
  transition:
    transform 0.2s,
    background 0.2s;
}
.icon-btn:hover {
  background: var(--soft);
  transform: scale(1.06);
}
.burger {
  display: none;
}
.sheet {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: var(--deep);
  color: #fff;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 100px 28px 40px;
  clip-path: circle(0 at calc(100% - 44px) 40px);
  transition: clip-path 0.7s var(--ease);
  pointer-events: none;
}
.sheet.open {
  clip-path: circle(150% at calc(100% - 44px) 40px);
  pointer-events: auto;
}
.sheet a {
  font-family: var(--display);
  font-size: clamp(2rem, 9vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  text-decoration: none;
  padding: 6px 0;
  opacity: 0;
  transform: translateY(20px);
  transition: 0.5s var(--ease);
}
.sheet.open a {
  opacity: 1;
  transform: none;
  transition-delay: calc(0.12s + var(--i) * 60ms);
}
.sheet a.active {
  color: var(--o);
}

/* command menu */
.cmdk {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: start center;
  padding: 14vh 16px 16px;
  background: rgba(12, 12, 14, 0.45);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.cmdk.open {
  opacity: 1;
  pointer-events: auto;
}
.cmdk-box {
  width: min(560px, 100%);
  background: var(--card);
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 40px 80px -20px rgba(12, 12, 14, 0.5);
  overflow: hidden;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.3s var(--ease);
}
.cmdk.open .cmdk-box {
  transform: none;
}
.cmdk input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
  font-size: 1.05rem;
  background: transparent;
  outline: none;
}
.cmdk ul {
  list-style: none;
  padding: 8px;
  max-height: min(50vh, 360px);
  overflow: auto;
}
.cmdk li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 500;
}
.cmdk li small {
  margin-left: auto;
  color: var(--mute);
  font-weight: 400;
}
.cmdk li[aria-selected="true"] {
  background: var(--soft);
}
.cmdk li b {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--inv);
  color: var(--inv-fg);
  font-size: 0.8rem;
}
.cmdk-foot {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--mute);
}

/* buttons, badges */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  min-height: 48px;
  border-radius: 99px;
  border: 1px solid var(--line2);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition:
    transform 0.25s var(--ease),
    background 0.2s,
    box-shadow 0.25s,
    opacity 0.2s;
  will-change: transform;
}
.btn:hover {
  background: var(--soft);
}
.btn.primary {
  background: var(--inv);
  color: var(--inv-fg);
  border-color: var(--inv);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 14px 30px -12px rgba(12, 12, 14, 0.55);
}
.btn.primary:hover {
  background: var(--inv2);
}
.btn:active {
  transform: scale(0.98);
}
.btn.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.28) 50%,
    transparent 65%
  );
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease);
}
.btn.primary:hover::after {
  transform: translateX(120%);
}
.btn.danger:hover {
  background: rgba(255, 61, 139, 0.1);
  border-color: var(--p);
  color: var(--err);
}
.btn.sm {
  padding: 8px 16px;
  min-height: 38px;
  font-size: 0.9rem;
}
.btn.block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.seg {
  display: inline-flex;
  padding: 4px;
  border-radius: 99px;
  background: var(--soft);
  border: 1px solid var(--line);
  gap: 2px;
  flex-wrap: wrap;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--mute);
  transition: 0.2s;
}
.seg button:hover {
  color: var(--ink);
  background: var(--card);
}

/* hero */
.hero {
  display: grid;
  gap: clamp(24px, 3.4vw, 44px);
  padding-block: clamp(20px, 4vw, 56px) clamp(32px, 5vw, 72px);
}
.hero h1 {
  max-width: 15ch;
}
.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.hero-row p {
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  max-width: 46ch;
  color: var(--mute2);
}
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.08em;
}
.w > span {
  display: inline-block;
  animation: wordIn 1s var(--ease) both;
  animation-delay: calc(var(--i) * 80ms + 0.1s);
}
@keyframes wordIn {
  from {
    opacity: 0;
    transform: translateY(105%) rotate(4deg);
    filter: blur(10px);
  }
}
.inline-wave {
  display: inline-flex;
  align-items: center;
  gap: 0.08em;
  height: 0.78em;
  padding: 0 0.22em;
  margin: 0 0.04em;
  border-radius: 99px;
  background: var(--deep);
  vertical-align: -0.02em;
}
.inline-wave i {
  width: 0.07em;
  min-width: 3px;
  border-radius: 9px;
  height: 30%;
  animation: iw 1.2s ease-in-out infinite;
  animation-delay: calc(var(--k) * 0.11s);
}
.inline-wave i:nth-child(4n + 1) {
  background: var(--o);
}
.inline-wave i:nth-child(4n + 2) {
  background: var(--l);
}
.inline-wave i:nth-child(4n + 3) {
  background: var(--p);
}
.inline-wave i:nth-child(4n) {
  background: var(--v);
}
@keyframes iw {
  50% {
    height: 90%;
  }
}
.stage {
  position: relative;
  border-radius: 34px;
  background: var(--deep);
  color: #fff;
  aspect-ratio: 2.35/1;
  min-height: 340px;
  overflow: hidden;
  box-shadow: 0 50px 90px -40px rgba(12, 12, 14, 0.7);
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out;
  animation: stageIn 1.2s var(--ease) 0.5s both;
}
@keyframes stageIn {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.96);
  }
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0/100%
      48px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0
      0/48px 100%;
  mask-image: radial-gradient(ellipse at 50% 40%, #000, transparent 80%);
  -webkit-mask-image: radial-gradient(
    ellipse at 50% 40%,
    #000,
    transparent 80%
  );
}
.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.beam::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  pointer-events: none;
  background: conic-gradient(
    from var(--ang),
    transparent 0 62%,
    var(--o) 74%,
    var(--p) 84%,
    var(--l) 92%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
  animation: ang 7s linear infinite;
}
@keyframes ang {
  to {
    --ang: 360deg;
  }
}
.lanes {
  position: absolute;
  left: clamp(14px, 2.4vw, 30px);
  top: clamp(14px, 2.4vw, 28px);
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  max-width: 60%;
}
.lanes i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c);
  opacity: 0.18;
  transform: scale(0.7);
  transition: 0.4s var(--ease);
}
.lanes i.on {
  opacity: 1;
  transform: none;
  box-shadow: 0 0 14px var(--c);
}
.stage-count {
  position: absolute;
  right: clamp(16px, 3vw, 40px);
  top: clamp(6px, 1.4vw, 18px);
  text-align: right;
  line-height: 0.9;
  pointer-events: none;
}
.stage-count b {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(4.4rem, 13vw, 11rem);
  letter-spacing: -0.08em;
}
.stage-count span {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  margin-top: 6px;
}
.stage-count.bump b {
  animation: bump 0.6s cubic-bezier(0.3, 1.7, 0.5, 1);
}
@keyframes bump {
  from {
    transform: scale(0.6);
    opacity: 0.1;
    filter: blur(8px);
  }
}
.stage-sum {
  position: absolute;
  left: clamp(14px, 2.4vw, 30px);
  bottom: clamp(12px, 2vw, 22px);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

/* marquee */
.marquee {
  overflow: hidden;
  padding-block: 20px;
  border-block: 1px solid var(--line);
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 8%,
    #000 92%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent,
    #000 8%,
    #000 92%,
    transparent
  );
}
.marquee-track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: mq 46s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
@keyframes mq {
  to {
    transform: translateX(-50%);
  }
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 99px;
  background: var(--card);
  border: 1px solid var(--line);
  font-weight: 550;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.tag i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
}

/* bento with cursor spotlight */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.span3 {
  grid-column: span 3;
}
.span2 {
  grid-column: span 2;
}
.card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(20px, 2.4vw, 30px);
  box-shadow: var(--shadow);
  transition: transform 0.4s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
}
.card h3 {
  font-size: 1.3rem;
}
.card p {
  font-size: 0.96rem;
}
[data-spot]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 0%),
    rgba(255, 90, 31, 0.12),
    transparent 60%
  );
}
[data-spot]:hover::before {
  opacity: 1;
}
[data-spot]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 0%),
    var(--o),
    transparent 65%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
}
[data-spot]:hover::after {
  opacity: 1;
}
.viz {
  margin-top: auto;
  min-height: 92px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding-top: 12px;
}
.viz.bars i {
  flex: 1;
  border-radius: 4px;
  background: var(--inv);
  height: calc(18% + 70% * abs(sin(var(--i))));
  animation: vb 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.06s);
}
.viz.bars i:nth-child(5n) {
  background: var(--o);
}
@keyframes vb {
  50% {
    transform: scaleY(0.4);
  }
}
.viz.votes {
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.vc {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font: 700 1.1rem var(--display);
  background: var(--soft);
  border: 1px solid var(--line);
  animation: vcp 5.6s infinite;
  animation-delay: calc(var(--k) * 0.7s);
}
@keyframes vcp {
  0%,
  12% {
    background: var(--inv);
    color: var(--inv-fg);
    transform: translateY(-6px);
  }
  18%,
  100% {
    background: var(--soft);
    color: var(--ink);
    transform: none;
  }
}
.mini-ring {
  margin: auto 0 0;
  width: 104px;
  height: 104px;
  position: relative;
}
.mini-ring svg {
  transform: rotate(-90deg);
}
.mini-ring circle {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
}
.mini-ring .a {
  stroke: var(--line);
}
.mini-ring .b {
  stroke: var(--o);
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  animation: mr 3.4s var(--ease) infinite alternate;
}
@keyframes mr {
  to {
    stroke-dashoffset: 34;
  }
}
.mini-ring b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 800 1.2rem var(--display);
  letter-spacing: -0.05em;
}
.term {
  margin-top: auto;
  font: 0.85rem var(--mono);
  background: var(--deep);
  color: #e9e7e1;
  border-radius: 14px;
  padding: 14px 16px;
  line-height: 1.8;
}
.term em {
  color: var(--l);
  font-style: normal;
}
.term u {
  text-decoration: none;
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--o);
  vertical-align: -2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.mini-rows {
  margin-top: auto;
  display: grid;
  gap: 8px;
}
.mini-rows div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 0.85rem;
}
.mini-rows b {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--inv);
  color: var(--inv-fg);
  font-size: 0.85rem;
}
.mini-rows span {
  margin-left: auto;
  color: var(--mute);
}

/* dark stats band */
.dark {
  background: var(--deep);
  color: #fff;
  border-radius: clamp(26px, 4vw, 48px);
  padding: clamp(28px, 5vw, 72px);
  position: relative;
  overflow: hidden;
}
.dark::before {
  content: "";
  position: absolute;
  width: 60%;
  aspect-ratio: 1;
  right: -15%;
  top: -45%;
  background: radial-gradient(circle, rgba(255, 90, 31, 0.5), transparent 65%);
  filter: blur(40px);
}
.dark p {
  color: rgba(255, 255, 255, 0.65);
}
.dark > * {
  position: relative;
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 24px 28px;
  margin-top: clamp(24px, 4vw, 48px);
}
.facts b {
  display: block;
  font: 800 clamp(1.75rem, 3.4vw, 3rem)/1.08 var(--display);
  letter-spacing: -0.04em;
  margin-bottom: 6px;
}
.facts span {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.92rem;
  line-height: 1.4;
}
.facts > div {
  min-width: 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.doc .facts {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px 32px;
}
.doc .facts b {
  font-size: clamp(1.55rem, 2.4vw, 2.35rem);
}

/* ledger, sequence */
.ledger > div {
  display: grid;
  grid-template-columns: minmax(200px, 0.8fr) 2fr;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line2);
  transition: padding 0.35s var(--ease);
}
.ledger > div:last-child {
  border-bottom: 1px solid var(--line2);
}
.ledger > div:hover {
  padding-left: 14px;
}
.seq {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  counter-reset: s;
}
.seq li {
  counter-increment: s;
  position: relative;
  padding: 22px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.seq li::before {
  content: counter(s);
  display: block;
  font: 800 3.4rem/1 var(--display);
  letter-spacing: -0.08em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  margin-bottom: 26px;
  transition: color 0.3s;
}
.seq li:hover::before {
  color: var(--o);
  -webkit-text-stroke-color: var(--o);
}
.seq h3 {
  margin-bottom: 6px;
}
.seq p {
  font-size: 0.93rem;
}

/* FAQ accordion */
.acc {
  display: grid;
  gap: 10px;
  max-width: 880px;
}
.acc details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 0 22px;
  transition: box-shadow 0.3s;
}
.acc details[open] {
  box-shadow: var(--shadow);
}
.acc summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  font-weight: 600;
  font-size: 1.05rem;
}
.acc summary::-webkit-details-marker {
  display: none;
}
.acc summary::after {
  content: "+";
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--soft);
  font-size: 1.2rem;
  transition:
    transform 0.35s var(--ease),
    background 0.2s;
}
.acc details[open] summary::after {
  transform: rotate(135deg);
  background: var(--o);
  color: #fff;
}
.acc details p {
  padding-bottom: 20px;
  animation: rise 0.45s var(--ease);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* CTA */
.cta {
  display: grid;
  gap: 22px;
  justify-items: start;
  padding: clamp(28px, 6vw, 80px);
  border-radius: clamp(26px, 4vw, 48px);
  background: var(--o);
  color: var(--ink);
  position: relative;
  overflow: hidden;
}
.cta,
.cta h2 {
  color: #0c0c0e;
}
.cta p {
  color: rgba(12, 12, 14, 0.75);
}
.cta h2 {
  font-size: clamp(2rem, 6vw, 5rem);
  max-width: 14ch;
}
.cta .btn.primary {
  background: #0c0c0e;
  color: #fff;
  border-color: #0c0c0e;
}

/* scroll reveal (motion only where it helps orientation) */
.js .rv {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js .rv.in {
  opacity: 1;
  transform: none;
}

/* app pages */
.page-head {
  padding-block: clamp(20px, 4vw, 56px) clamp(16px, 2.6vw, 32px);
  display: grid;
  gap: 14px;
}
.page-head h1 {
  font-size: clamp(2rem, 5vw, 4.2rem);
  max-width: 16ch;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(18px, 2.4vw, 30px);
  box-shadow: var(--shadow);
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: clamp(16px, 2.2vw, 28px);
  align-items: start;
  padding-bottom: clamp(40px, 7vw, 96px);
}
.split > .panel,
#sRes {
  min-width: 0;
  max-width: 100%;
}
.stack {
  display: grid;
  gap: 18px;
}
.fine {
  font-size: 0.85rem;
  color: var(--mute);
}
.dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: clamp(28px, 5vw, 52px) 20px;
  border-radius: var(--r2);
  cursor: pointer;
  background: var(--soft);
  transition:
    background 0.25s,
    transform 0.3s var(--ease);
  background-image:
    linear-gradient(90deg, var(--line2) 50%, transparent 0),
    linear-gradient(90deg, var(--line2) 50%, transparent 0),
    linear-gradient(0deg, var(--line2) 50%, transparent 0),
    linear-gradient(0deg, var(--line2) 50%, transparent 0);
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  background-size:
    14px 1.5px,
    14px 1.5px,
    1.5px 14px,
    1.5px 14px;
  background-position:
    0 0,
    0 100%,
    0 0,
    100% 0;
  animation: march 1.4s linear infinite;
}
@keyframes march {
  to {
    background-position:
      14px 0,
      -14px 100%,
      0 -14px,
      100% 14px;
  }
}
.dropzone:hover,
.dropzone.over {
  background: var(--dz-hover);
}
.dropzone:focus-visible {
  outline-offset: 4px;
  border-radius: var(--r2);
}
.dropzone.over {
  transform: scale(1.02);
}
.dz-ico {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--deep);
  color: #fff;
  position: relative;
}
.dz-ico::before,
.dz-ico::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--o);
  opacity: 0;
  animation: ring 3s infinite;
}
.dz-ico::after {
  animation-delay: 1.5s;
}
@keyframes ring {
  from {
    transform: scale(1);
    opacity: 0.7;
  }
  to {
    transform: scale(1.8);
    opacity: 0;
  }
}
.dz-ico .ic {
  width: 26px;
  height: 26px;
}
.dropzone strong {
  font-size: 1.15rem;
}
.dropzone span {
  color: var(--mute);
  font-size: 0.9rem;
}
.filecard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 18px;
  border-radius: var(--r2);
  background: var(--soft);
  border: 1px solid var(--line);
  animation: rise 0.5s var(--ease);
}
.filecard > div {
  min-width: 0;
  flex: 1;
}
.filecard strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filecard small {
  color: var(--mute);
}
.player {
  display: grid;
  gap: 12px;
  animation: rise 0.5s var(--ease);
}
.wave-box {
  border-radius: var(--r2);
  background: var(--deep);
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
#wave {
  width: 100%;
  height: clamp(96px, 16vw, 132px);
  cursor: pointer;
  touch-action: none;
}
.player-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.time {
  color: var(--mute);
  font: 0.85rem var(--mono);
}
.legend {
  display: flex;
  gap: 14px;
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--mute);
  flex-wrap: wrap;
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}
.state {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  padding: clamp(28px, 6vw, 64px) 12px;
}
.orbit {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 1.5px dashed var(--line2);
  display: grid;
  place-items: center;
  position: relative;
  animation: spin 16s linear infinite;
}
.orbit::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--o);
  box-shadow: 0 0 14px var(--o);
}
.orbit .ic {
  width: 30px;
  height: 30px;
  animation: spin 16s linear infinite reverse;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.eq {
  display: flex;
  gap: 5px;
  align-items: flex-end;
  height: 44px;
}
.eq i {
  width: 7px;
  border-radius: 4px;
  background: var(--inv);
  animation: eqb 1s ease-in-out infinite;
}
.eq i:nth-child(2) {
  animation-delay: 0.12s;
  background: var(--o);
}
.eq i:nth-child(3) {
  animation-delay: 0.24s;
}
.eq i:nth-child(4) {
  animation-delay: 0.36s;
  background: var(--p);
}
.eq i:nth-child(5) {
  animation-delay: 0.48s;
}
.eq i:nth-child(6) {
  animation-delay: 0.6s;
  background: var(--v);
}
@keyframes eqb {
  0%,
  100% {
    height: 8px;
  }
  50% {
    height: 44px;
  }
}
.progress {
  width: min(320px, 100%);
  height: 6px;
  border-radius: 9px;
  background: var(--line);
  overflow: hidden;
}
.progress div {
  height: 100%;
  width: 0;
  background: var(--inv);
  border-radius: 9px;
  transition: width 0.2s;
}
.progress div.indet {
  width: 40% !important;
  background: linear-gradient(90deg, var(--o), var(--p));
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide {
  from {
    margin-left: -40%;
  }
  to {
    margin-left: 100%;
  }
}
.state.err h4 {
  color: var(--err);
}
.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 22px;
  animation: rise 0.6s var(--ease);
}
.result > * {
  min-width: 0;
  max-width: 100%;
}
.result pre.term {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.result-top {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  flex-wrap: wrap;
}
.ring {
  position: relative;
  width: clamp(130px, 22vw, 172px);
  aspect-ratio: 1;
  flex: none;
}
.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring circle {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
}
.ring .bg-c {
  stroke: var(--line);
}
.ring .fg-c {
  stroke: url(#ringGrad);
  stroke-dasharray: 339.3;
  stroke-dashoffset: 339.3;
  transition: stroke-dashoffset 1.3s var(--ease);
}
.ring div {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1;
}
.ring b {
  font: 800 clamp(2.6rem, 6vw, 3.8rem) var(--display);
  letter-spacing: -0.08em;
}
.ring span {
  color: var(--mute);
  font-size: 0.85rem;
  margin-top: 6px;
}
.result-top h3 {
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  letter-spacing: -0.04em;
  margin-bottom: 6px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
}
.metric {
  padding: 14px 16px;
  border-radius: var(--r2);
  background: var(--soft);
  border: 1px solid var(--line);
}
.metric small {
  display: block;
  color: var(--mute);
  font-size: 0.8rem;
}
.metric b {
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}
.sub {
  font-weight: 650;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sub small {
  color: var(--mute);
  font-weight: 400;
}
.tl {
  display: flex;
  align-items: flex-end;
  gap: clamp(4px, 1vw, 10px);
  height: 160px;
  padding: 14px 12px 0;
  border-radius: var(--r2);
  background: var(--deep);
}
.tl-bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  min-width: 0;
  color: #fff;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  text-align: center;
}
.tl-bar i {
  display: block;
  width: 100%;
  height: var(--h);
  border-radius: 9px 9px 3px 3px;
  background: linear-gradient(var(--o), var(--p));
  opacity: var(--o2, 1);
  transform-origin: bottom;
  animation: grow 0.9s var(--ease) both;
  animation-delay: var(--d);
  transition: filter 0.2s;
}
.tl-bar b {
  font-size: 0.85rem;
  line-height: 1;
  padding-bottom: 6px;
}
.tl-bar:hover i,
.tl-bar:focus-visible i {
  filter: brightness(1.25) saturate(1.2);
  outline: 0;
}
.tl-bar[aria-pressed="true"] i {
  box-shadow:
    0 0 0 2px var(--l),
    0 0 18px rgba(200, 240, 74, 0.5);
}
@keyframes grow {
  from {
    transform: scaleY(0);
  }
}
.tl-axis {
  display: flex;
  justify-content: space-between;
  color: var(--mute);
  font-size: 0.8rem;
  margin-top: 6px;
}
.votes {
  display: grid;
  gap: 8px;
}
.vote {
  display: grid;
  grid-template-columns: 76px 1fr 44px;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
}
.vote div {
  height: 10px;
  border-radius: 9px;
  background: var(--line);
  overflow: hidden;
}
.vote i {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: 9px;
  background: var(--inv);
  animation: fill 1s var(--ease) both;
}
.vote.top i {
  background: linear-gradient(90deg, var(--o), var(--p));
}
@keyframes fill {
  from {
    width: 0;
  }
}
.notice {
  padding: 14px 16px;
  border-radius: var(--r2);
  background: var(--n-bg);
  border: 1px solid var(--n-line);
  color: var(--n-ink);
  font-size: 0.92rem;
  max-width: none;
}
.notice.info {
  background: var(--soft);
  border-color: var(--line2);
  color: var(--ink);
}
.notice a {
  font-weight: 600;
}

/* history */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.search {
  flex: 1 1 220px;
  padding: 12px 20px;
  border-radius: 99px;
  border: 1px solid var(--line2);
  background: var(--card);
  color: var(--ink);
  min-height: 46px;
  outline: none;
  transition: box-shadow 0.2s;
}
.search:focus {
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.25);
}
.hstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.hlist {
  display: grid;
  gap: 12px;
  padding-bottom: clamp(40px, 7vw, 96px);
}
.hrow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: clamp(12px, 2vw, 24px);
  align-items: center;
  padding: 14px clamp(14px, 2vw, 22px);
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise 0.5s var(--ease) both;
  transition: transform 0.3s var(--ease);
}
.hrow:hover {
  transform: translateX(6px);
}
.badge {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font: 800 1.5rem var(--display);
  letter-spacing: -0.07em;
  background: var(--inv);
  color: var(--inv-fg);
}
.hinfo {
  min-width: 0;
}
.hinfo strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hinfo small {
  color: var(--mute);
}
.spark {
  width: clamp(80px, 12vw, 140px);
  height: 34px;
}

/* how it works */
.arch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.layer {
  padding: 20px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow);
  transition:
    transform 0.35s var(--ease),
    background 0.3s,
    color 0.3s;
}
.layer:hover {
  transform: translateY(-6px);
  background: var(--deep);
  color: #fff;
}
.layer small {
  color: var(--mute);
}
.layer:hover small {
  color: rgba(255, 255, 255, 0.65);
}
.layer .bar {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--o), var(--p));
  width: var(--w);
}
.demo {
  display: grid;
  gap: 16px;
}
.strip {
  position: relative;
  height: 150px;
  border-radius: var(--r2);
  background: var(--deep);
  overflow: hidden;
}
.strip canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.win {
  position: absolute;
  top: 8px;
  bottom: 8px;
  border-radius: 14px;
  border: 2px solid var(--l);
  background: rgba(200, 240, 74, 0.14);
  box-shadow: 0 0 40px rgba(200, 240, 74, 0.35);
  transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.ticks {
  display: flex;
  justify-content: space-between;
  color: var(--mute);
  font-size: 0.8rem;
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid var(--line2);
  background: var(--soft);
  font-size: 0.9rem;
  opacity: 0.4;
  transition: 0.35s var(--ease);
}
.chip.on {
  opacity: 1;
  background: var(--card);
  transform: translateY(-3px);
}
.chip.win-mode {
  background: var(--o);
  color: #fff;
  border-color: var(--o);
}
.spec {
  width: 100%;
  height: clamp(150px, 22vw, 230px);
  border-radius: var(--r);
  background: var(--deep);
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 44px);
  align-items: center;
}

/* docs + tabs */
.docs {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  padding-bottom: clamp(40px, 7vw, 96px);
}
.toc {
  position: sticky;
  top: calc(var(--nav) + 20px);
  align-self: start;
  display: grid;
  gap: 4px;
}
.toc a {
  padding: 9px 16px;
  text-decoration: none;
  font-weight: 550;
  color: var(--mute);
  border-left: 2px solid var(--line);
  transition: 0.2s;
}
.toc a:hover,
.toc a.on {
  color: var(--ink);
  border-color: var(--o);
  background: rgba(255, 90, 31, 0.07);
}
.doc {
  display: grid;
  gap: 48px;
}
.doc section {
  display: grid;
  gap: 14px;
  scroll-margin-top: calc(var(--nav) + 20px);
}
.doc ul {
  color: var(--mute);
  padding-left: 1.2em;
  display: grid;
  gap: 6px;
}
.code {
  position: relative;
}
.code pre {
  background: var(--deep);
  border-radius: var(--r2);
  padding: 20px;
  overflow-x: auto;
  font: 0.85rem/1.7 var(--mono);
  color: #ece9e2;
  -webkit-overflow-scrolling: touch;
}
.code .btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.code .btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.tabs {
  display: grid;
  gap: 12px;
}
.tab-list {
  display: inline-flex;
  padding: 4px;
  border-radius: 99px;
  background: var(--soft);
  border: 1px solid var(--line);
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}
.tab-list button {
  border: 0;
  background: transparent;
  padding: 8px 18px;
  border-radius: 99px;
  font-weight: 550;
  font-size: 0.9rem;
  color: var(--mute);
  white-space: nowrap;
  transition: 0.25s;
}
.tab-list button[aria-selected="true"] {
  background: var(--inv);
  color: var(--inv-fg);
}
.tab-panel[hidden] {
  display: none;
}
.tab-panel {
  animation: rise 0.4s var(--ease);
}
.kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.kv td,
.kv th {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.kv th {
  color: var(--mute);
  font-weight: 550;
}
.kv code {
  font: 0.85em var(--mono);
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 6px;
}
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 4px 10px;
}

/* footer, toast */
.foot {
  display: grid;
  gap: 28px;
  padding-block: 48px 0;
  margin-top: clamp(40px, 6vw, 80px);
  border-top: 1px solid var(--line2);
  overflow: hidden;
}
.foot-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.foot p {
  font-size: 0.9rem;
  margin-top: 6px;
}
.foot nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.foot nav a {
  text-decoration: none;
  color: var(--mute);
  font-weight: 500;
}
.foot nav a:hover {
  color: var(--ink);
}
.foot-word {
  font: 800 clamp(3.4rem, 17vw, 15rem)/0.9 var(--display);
  letter-spacing: -0.05em;
  color: var(--line);
  white-space: nowrap;
  padding-bottom: 0.08em;
  user-select: none;
  overflow: visible;
}
.toasts {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
  z-index: 120;
  width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 24px 50px -20px rgba(12, 12, 14, 0.4);
  animation: toastIn 0.5s cubic-bezier(0.3, 1.5, 0.5, 1);
  font-weight: 500;
}
.toast::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--l);
  flex: none;
  box-shadow: 0 0 0 4px rgba(200, 240, 74, 0.3);
}
.toast.err::before {
  background: var(--p);
  box-shadow: 0 0 0 4px rgba(255, 61, 139, 0.25);
}
.toast.out {
  opacity: 0;
  transform: translateX(30px);
  transition: 0.35s;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.9);
  }
}

/* responsive: phones, tablets, laptops, ultrawide */
@media (max-width: 1000px) {
  .split,
  .two,
  .docs {
    grid-template-columns: 1fr;
  }
  .toc {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 8px;
  }
  .toc a {
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 99px;
  }
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }
  .span3 {
    grid-column: span 2;
  }
  .span2 {
    grid-column: span 1;
  }
  .span2:last-child {
    grid-column: span 2;
  }
  .stage {
    aspect-ratio: 1.6/1;
  }
}
@media (max-width: 1024px) {
  .burger {
    display: inline-grid;
  }
  .links,
  .cmd-btn {
    display: none;
  }
  .nav {
    width: calc(100vw - 24px);
    justify-content: space-between;
  }
  .nav-right {
    border: 0;
    margin: 0;
    padding: 0;
  }
  .ledger > div {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
@media (max-width: 620px) {
  .bento {
    grid-template-columns: 1fr;
  }
  .span3,
  .span2,
  .span2:last-child {
    grid-column: auto;
  }
  .stage {
    aspect-ratio: 1.05/1;
    border-radius: 26px;
  }
  .lanes {
    max-width: 46%;
  }
  .hrow {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .hrow .spark {
    display: none;
  }
  .vote {
    grid-template-columns: 62px 1fr 40px;
  }
  .btn {
    width: 100%;
  }
  .actions .btn {
    flex: 1 1 100%;
  }
  .btn.sm,
  .code .btn {
    width: auto;
  }
  .pill .t {
    display: none;
  }
  .pill {
    padding: 12px;
  }
  .legend {
    margin-left: 0;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .stage {
    aspect-ratio: 3/1;
  }
}
@media (min-width: 1800px) {
  .wrap {
    width: min(100% - 200px, 1520px);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js .rv {
    opacity: 1;
    transform: none;
  }
}

/* ===== theme: dark tokens (data-theme is set before first paint by an inline script in base.html) ===== */
:root[data-theme="dark"] {
  --paper: #121214;
  --card: #1b1b1f;
  --soft: #242429;
  --ink: #f2f0eb;
  --ink2: #fff;
  --line: rgba(242, 240, 235, 0.11);
  --line2: rgba(242, 240, 235, 0.22);
  --mute: #a3a19a;
  --deep: #08080a;
  --inv: #f2f0eb;
  --inv2: #fff;
  --inv-fg: #0c0c0e;
  --mute2: #c1bfb8;
  --hover: #2d2d33;
  --code-bg: rgba(242, 240, 235, 0.1);
  --dot: rgba(242, 240, 235, 0.14);
  --nav-bg: rgba(27, 27, 31, 0.74);
  --nav-bg2: rgba(27, 27, 31, 0.92);
  --dz-hover: rgba(255, 90, 31, 0.1);
  --err: #ff7ab0;
  --n-bg: rgba(255, 184, 0, 0.12);
  --n-line: rgba(255, 184, 0, 0.38);
  --n-ink: #f3d27a;
  --shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 14px 34px -16px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}
[data-theme="dark"] .stage,
[data-theme="dark"] .wave-box,
[data-theme="dark"] .strip,
[data-theme="dark"] .spec,
[data-theme="dark"] .tl,
[data-theme="dark"] .code pre,
[data-theme="dark"] .term,
[data-theme="dark"] .dark,
[data-theme="dark"] .mark,
[data-theme="dark"] .pill,
[data-theme="dark"] .layer:hover {
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}
[data-theme="dark"] .btn.primary {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 14px 30px -12px rgba(0, 0, 0, 0.8);
}
[data-theme="dark"] .btn.primary::after {
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(12, 12, 14, 0.18) 50%,
    transparent 65%
  );
}
[data-theme="dark"] .cmdk {
  background: rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .toc a:hover,
[data-theme="dark"] .toc a.on {
  background: rgba(255, 90, 31, 0.12);
}
[data-theme="dark"] .acc details[open] summary::after {
  color: #fff;
}

/* theme switch: crossfade colours for a moment only while toggling */
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    fill 0.35s ease,
    stroke 0.35s ease,
    box-shadow 0.35s ease !important;
}
.theme-btn .ic {
  width: 1.2em;
  height: 1.2em;
}
.theme-btn .sun {
  display: none;
}
[data-theme="dark"] .theme-btn .sun {
  display: block;
}
[data-theme="dark"] .theme-btn .moon {
  display: none;
}
.sheet .theme-btn {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* labels that mark illustrative (non-model) visuals */
.eg {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--line2);
  background: var(--soft);
  color: var(--mute);
  font: 500 0.7rem/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.eg::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--a);
}
.stage .eg {
  position: absolute;
  right: clamp(16px, 3vw, 40px);
  bottom: clamp(12px, 2vw, 22px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
}
.demo .eg,
.two .eg {
  margin-bottom: -6px;
}

/* small-screen and detail polish */
.cmd-btn,
.pill,
.icon-btn {
  flex: none;
}
@media (max-width: 380px) {
  .brand span:last-child {
    display: none;
  }
  .brand {
    padding-right: 4px;
  }
}
.progress {
  overflow: hidden;
}
.dropzone.has-file {
  animation: none;
}
.fine a {
  font-weight: 600;
}

/* overflow fixes: let grid tracks shrink below their content (code blocks scroll inside their own box) */
.doc,
.doc section,
.docs > * {
  min-width: 0;
}
.doc {
  grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 1000px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
  }
}
.hero > * {
  min-width: 0;
}
@media (max-width: 620px) {
  .stage {
    aspect-ratio: auto;
    height: 340px;
    width: 100%;
  }
}
.doc section {
  grid-template-columns: minmax(0, 1fr);
}
.code pre {
  max-width: 100%;
}
.tabs {
  grid-template-columns: minmax(0, 1fr);
}
.links a {
  white-space: nowrap;
}
@media (max-width: 1360px) {
  .links a {
    padding: 8px 12px;
    font-size: 0.88rem;
  }
  .cmd-btn .kbd {
    display: none;
  }
}
@media (max-width: 1160px) {
  .cmd-btn {
    display: none;
  }
}

/* ---- count-conditioned separation + evaluation ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.stages {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: center;
}
.stages li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--line2);
  font-size: 0.85rem;
  color: var(--mute);
}
.stages li i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line2);
}
.stages li[data-state="active"] {
  color: var(--ink);
  border-color: var(--o);
}
.stages li[data-state="active"] i {
  background: var(--o);
  animation: ping 1.4s infinite;
  color: var(--o);
}
.stages li[data-state="done"] {
  color: var(--ink);
}
.stages li[data-state="done"] i {
  background: var(--l);
}
.count-card {
  padding: 22px;
  border-radius: var(--r);
  background: var(--deep);
  color: #fff;
  display: grid;
  gap: 10px;
}
.count-card p {
  color: #c9c7c0;
  font-size: 0.9rem;
}
.count-card code {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.count-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.count-main b {
  font: 800 clamp(2.8rem, 7vw, 4.2rem) var(--display);
  letter-spacing: -0.06em;
}
.count-pm {
  font: 600 1.5rem var(--display);
  color: var(--o);
}
.count-unit {
  color: #c9c7c0;
}
.state-inline {
  padding: 14px 16px;
  border-radius: var(--r2);
  background: var(--soft);
  border: 1px solid var(--line2);
  margin-bottom: 10px;
}
.state-inline.err strong {
  color: var(--err);
}
.stem-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}
.stem {
  padding: 12px 14px;
  border-radius: var(--r2);
  background: var(--soft);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.stem-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.stem-head small {
  color: var(--mute);
}
.stem-wave {
  min-height: 56px;
}
.stem-wave audio {
  width: 100%;
}
.stem-ctl,
.stem-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.stem-ctl [aria-pressed="true"] {
  background: var(--inv);
  color: var(--inv-fg);
  border-color: var(--inv);
}
.stem-ctl .btn:focus-visible,
.stem-actions .btn:focus-visible {
  outline: 2px solid var(--o);
  outline-offset: 3px;
}
.scatter-wrap {
  height: min(60vw, 380px);
  min-height: 260px;
}
.scatter-wrap canvas {
  width: 100%;
  height: 100%;
}
#evTable th,
#evTable td {
  white-space: nowrap;
}
.res-stages {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.banner-untrained {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 12px 16px;
  border-radius: var(--r2);
  font-weight: 600;
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.banner-quality-fail {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 12px 16px;
  border-radius: var(--r2);
  font-weight: 600;
  margin: 12px 0;
  display: grid;
  gap: 4px;
}
[data-theme="dark"] .banner-quality-fail {
  color: #fbbf24;
}
.gt-row {
  padding: 14px 16px;
  border-radius: var(--r2);
  background: rgba(18, 181, 166, 0.1);
  border: 1px solid rgba(18, 181, 166, 0.35);
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}
.gt-row strong {
  color: var(--t);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag-section {
  display: grid;
  gap: 10px;
}
.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--card);
  border: 1px solid var(--line2);
  font-size: 0.88rem;
  font-weight: 550;
}
.tag-chip small {
  font: 0.78rem var(--mono);
  color: var(--mute);
}
.tag-chip.above {
  border-color: var(--o);
  background: rgba(255, 90, 31, 0.09);
}
.tag-chip.uncertain {
  opacity: 0.58;
  border-style: dashed;
  background: var(--soft);
}

/* ---- expo-ready stats cards & how-it-works ---- */
.k-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(32px, 1fr));
  gap: 8px;
  align-items: end;
  margin-top: auto;
  padding-top: 8px;
}
.k-bar {
  display: grid;
  justify-items: center;
  gap: 5px;
  font-size: 0.72rem;
}
.k-bar span,
.k-bar small {
  font-family: var(--mono);
  color: var(--mute);
}
.k-bar b {
  font-family: var(--mono);
  font-size: 0.74rem;
}
.k-bar-track {
  width: 100%;
  height: 76px;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  display: flex;
  align-items: flex-end;
  padding: 3px;
}
.k-bars-lg .k-bar-track {
  height: 120px;
}
.k-bar-track i {
  display: block;
  width: 100%;
  height: var(--h, 4%);
  border-radius: 5px;
  background: linear-gradient(180deg, var(--o), var(--l));
}
.stat-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.stat-mini-grid > div {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  display: grid;
  gap: 2px;
}
.stat-mini-grid b {
  font: 800 1.25rem/1.1 var(--display);
  letter-spacing: -0.04em;
}
.stat-mini-grid span {
  font-size: 0.76rem;
  color: var(--mute);
}
.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 0.76rem;
  font-weight: 550;
}
.mini-chip.open {
  border-color: var(--o);
}
.mini-chip small {
  font: 0.68rem var(--mono);
  color: var(--o);
}
.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}
.card-links a {
  color: var(--o);
  text-decoration: none;
}
.card-links a:hover {
  text-decoration: underline;
}
.term-date {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.76rem;
}
.how-grid,
.pipe-grid,
.fact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.fact-cards b {
  font: 800 clamp(1.4rem, 2.6vw, 2rem) / 1.05 var(--display);
  letter-spacing: -0.05em;
  color: var(--o);
}
.fact-cards span {
  font-size: 0.88rem;
  color: var(--mute2);
}
.cm-table th,
.cm-table td {
  text-align: center;
  font-family: var(--mono);
  font-size: 0.84rem;
}
.cm-cell {
  background: rgba(255, 90, 31, var(--a, 0));
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- navbar auth & account dropdown ---- */
.brand,
.nav-right {
  flex-shrink: 0;
}
.links {
  min-width: 0;
}
.nav-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-auth .btn {
  white-space: nowrap;
}
.acct-wrap {
  position: relative;
}
.acct-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  max-width: 230px;
  padding: 5px 10px 5px 8px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: 550 0.84rem var(--sans);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.acct-btn:hover {
  background: var(--soft);
  border-color: var(--line2);
}
.acct-btn:focus-visible {
  outline: 2px solid var(--o);
  outline-offset: 2px;
}
.acct-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--deep);
  color: #fff;
  font: 650 0.72rem var(--mono);
  flex-shrink: 0;
}
.acct-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--l);
}
.acct-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.acct-chev {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--mute);
  transition: transform 0.15s var(--ease);
}
.acct-btn[aria-expanded="true"] .acct-chev {
  transform: rotate(180deg);
}
.acct-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(290px, calc(100vw - 32px));
  padding: 10px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 24px 50px -16px rgba(12, 12, 14, 0.35);
  z-index: 95;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.14s var(--ease), transform 0.14s var(--ease);
}
.acct-menu.open {
  opacity: 1;
  transform: translateY(0);
}
.acct-meta {
  padding: 8px 10px;
  display: grid;
  gap: 3px;
}
.acct-full-email {
  font: 600 0.86rem var(--mono);
  color: var(--ink);
  word-break: break-all;
}
.acct-role {
  font-size: 0.78rem;
  color: var(--mute);
}
.acct-sep {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 6px 0;
}
.acct-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: 600 0.88rem var(--sans);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.acct-item:hover,
.acct-item:focus-visible {
  background: var(--soft);
  outline: none;
}
.acct-item.danger:hover,
.acct-item.danger:focus-visible {
  background: rgba(239, 68, 68, 0.12);
  color: var(--err);
}
.sheet-acct {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.sheet-acct-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 500 0.88rem var(--mono);
  color: rgba(255, 255, 255, 0.9);
  word-break: break-all;
}
@media (max-width: 1024px) {
  .nav-auth {
    display: none;
  }
  .acct-btn {
    max-width: 175px;
  }
}
@media (max-width: 480px) {
  .acct-label {
    display: none;
  }
}

/* ---- authentication experience & signature audio wave ---- */
.auth-wrap {
  padding-block: clamp(24px, 4vw, 56px);
}
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  animation: authEnter 0.55s var(--ease) both;
}
@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
  }
}
@keyframes authEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}
.auth-visual {
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--deep);
  color: #fff;
  padding: clamp(24px, 3.4vw, 44px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 440px;
}
.auth-wave-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
}
.auth-visual-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
}
.auth-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.92rem;
}
.auth-visual h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.1rem);
  max-width: 18ch;
}
.auth-visual p {
  color: rgba(255, 255, 255, 0.72);
  max-width: 38ch;
}
.auth-eq-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 42px;
  margin-top: 12px;
}
.auth-eq-bars i {
  flex: 1;
  border-radius: 4px;
  background: var(--o);
  height: calc(25% + 65% * abs(sin(var(--i))));
  animation: iw 1.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.08s);
}
.auth-eq-bars i:nth-child(3n) {
  background: var(--l);
}
.auth-card {
  display: grid;
  gap: 18px;
  align-content: start;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
}
.auth-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--mute);
  font: 650 0.95rem var(--sans);
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, color 0.2s;
}
.auth-tabs button[aria-selected="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.auth-form {
  display: grid;
  gap: 16px;
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-size: 0.88rem;
  font-weight: 600;
}
.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--o);
  font: 600 0.84rem var(--sans);
  cursor: pointer;
}
.link-btn:hover {
  text-decoration: underline;
}
.field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line2);
  background: var(--soft);
  color: var(--ink);
  font: inherit;
  font-size: max(1rem, 1em);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input:focus-visible {
  outline: none;
  border-color: var(--o);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.22);
  background: var(--card);
}
.field input:user-invalid {
  border-color: var(--err);
}
.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrap input {
  padding-right: 48px;
}
.pw-toggle {
  position: absolute;
  right: 6px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--mute);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.pw-toggle:hover {
  color: var(--ink);
  background: var(--line);
}
.pw-toggle:focus-visible {
  outline: 2px solid var(--o);
  outline-offset: 2px;
}
.pw-toggle .eye-off {
  display: none;
}
.pw-toggle[aria-pressed="true"] .eye-open {
  display: none;
}
.pw-toggle[aria-pressed="true"] .eye-off {
  display: block;
}
.pw-meter {
  height: 5px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.pw-meter i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: var(--err);
  transition: width 0.25s var(--ease), background 0.25s;
}
.pw-meter i[data-level="2"] {
  background: #f59e0b;
}
.pw-meter i[data-level="3"],
.pw-meter i[data-level="4"] {
  background: var(--l);
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--mute);
  font-size: 0.82rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.oauth-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 500px) {
  .oauth-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.oauth-btn {
  justify-content: center;
  gap: 8px;
  min-height: 46px;
}
.oauth-btn.is-unconfigured {
  opacity: 0.68;
}

/* ---- ground truth comparison panel & staggered analysis reveals ---- */
.result > * {
  animation: resItemIn 0.42s var(--ease) both;
}
.result > *:nth-child(2) { animation-delay: 40ms; }
.result > *:nth-child(3) { animation-delay: 80ms; }
.result > *:nth-child(4) { animation-delay: 120ms; }
@keyframes resItemIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.gt-panel {
  border-radius: var(--r2);
  border: 1px solid var(--line2);
  background: var(--soft);
  padding: 14px 16px;
  transition: border-color 0.25s;
}
.gt-panel[open] {
  border-color: rgba(18, 181, 166, 0.45);
}
.gt-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  cursor: pointer;
  list-style: none;
}
.gt-summary small {
  color: var(--mute);
  margin-left: 6px;
}
.gt-badge {
  padding: 4px 10px;
  border-radius: 99px;
  font: 700 0.78rem var(--mono);
}
.gt-badge.ok {
  background: rgba(18, 181, 166, 0.16);
  color: #12b5a6;
}
.gt-badge.diff {
  background: rgba(245, 158, 11, 0.16);
  color: #d97706;
}
.gt-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 720px) {
  .gt-compare-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.gt-col {
  padding: 12px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
  align-content: start;
}
.gt-col-head {
  font: 700 0.74rem var(--mono);
  letter-spacing: 0.06em;
  color: #12b5a6;
}
.gt-col-head.pred {
  color: var(--o);
}
.gt-stat {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
}
.gt-stat-block {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
}

@media (prefers-reduced-motion: reduce) {
  .auth-shell,
  .auth-eq-bars i,
  .result > *,
  .acct-menu,
  .acct-chev {
    animation: none !important;
    transition: none !important;
  }
}

/* ---- admin dashboard ---- */
a.acct-item {
  text-decoration: none;
}
.admin {
  padding-bottom: clamp(48px, 7vw, 96px);
}
.admin-tabs .tab-list {
  margin-bottom: 20px;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
@media (max-width: 860px) {
  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.adm-bars {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.adm-bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 40px;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
}
.adm-bar-lbl {
  font-family: var(--mono);
  color: var(--mute);
  font-size: 0.78rem;
  white-space: nowrap;
}
.adm-bar-track {
  height: 10px;
  border-radius: 99px;
  background: var(--soft);
  border: 1px solid var(--line);
  overflow: hidden;
}
.adm-bar-track i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--o), var(--l));
}
.adm-bar-row b {
  text-align: right;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.adm-invite {
  margin-bottom: 18px;
}
.adm-invite .toolbar {
  margin-bottom: 8px;
}
.adm-select {
  flex: 0 1 200px;
  cursor: pointer;
}
.adm-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.adm-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--soft);
  border: 1px solid var(--line);
  font: 550 0.78rem var(--mono);
}
.adm-pill.ok {
  background: rgba(18, 181, 166, 0.14);
  border-color: rgba(18, 181, 166, 0.35);
  color: #12b5a6;
}
.adm-pill.warn {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--err);
}
.adm-pill.admin {
  background: var(--deep);
  border-color: transparent;
  color: #fff;
}
.adm-x {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}
.adm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.adm-actions .btn.sm {
  padding: 5px 11px;
  min-height: 30px;
  font-size: 0.78rem;
}
.adm-mini {
  margin-top: 14px;
}
.adm-table th {
  white-space: nowrap;
}

/* ---- analyze view toggle & live 2D architecture view ---- */
.an-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.view-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 99px;
  background: var(--card);
  border: 1px solid var(--line2);
  gap: 4px;
  box-shadow: var(--shadow);
}
.view-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--mute);
  font: 600 0.86rem var(--font);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.view-toggle button:hover {
  color: var(--ink);
}
.view-toggle button[aria-selected="true"] {
  background: var(--inv);
  color: var(--inv-fg);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--o);
  box-shadow: 0 0 0 0 rgba(255, 90, 31, 0.55);
  animation: archPulse 1.8s infinite;
}
@keyframes archPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(255, 90, 31, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 90, 31, 0); }
}
.arch-shell {
  display: grid;
  gap: 16px;
  padding-bottom: clamp(40px, 7vw, 96px);
}
.arch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 20px;
}
.arch-bar-left,
.arch-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.arch-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 99px;
  background: var(--soft);
  border: 1px solid var(--line2);
  font: 650 0.78rem var(--mono);
}
.arch-status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mute);
}
.arch-status-pill[data-state="live"] i {
  background: var(--o);
  animation: archPulse 1.2s infinite;
}
.arch-status-pill[data-state="done"] i,
.arch-status-pill[data-state="ready"] i {
  background: #12b5a6;
}
.arch-speed {
  display: inline-flex;
  border: 1px solid var(--line2);
  border-radius: 99px;
  overflow: hidden;
  background: var(--soft);
}
.arch-speed button {
  border: 0;
  background: transparent;
  color: var(--mute);
  padding: 7px 12px;
  font: 600 0.8rem var(--mono);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.arch-speed button:hover {
  color: var(--ink);
}
.arch-speed button.active {
  background: var(--inv);
  color: var(--inv-fg);
}
.arch-canvas-panel {
  padding: 16px;
}
.arch-canvas-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}
#archCanvas {
  display: block;
  width: 100%;
  min-width: 860px;
  height: auto;
  aspect-ratio: 1200 / 620;
  cursor: pointer;
}
#archCanvas.arch-portrait {
  min-width: 0;
  aspect-ratio: 440 / 1272;
}
.arch-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--mute);
}
.arch-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.arch-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}
.arch-insp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.arch-insp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* ---- comprehensive phone & tablet optimization ---- */
html,
body {
  overflow-x: clip;
}
.sheet {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.toc {
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.toc::-webkit-scrollbar {
  display: none;
}

@media (max-width: 760px) {
  .an-head-row {
    align-items: stretch;
  }
  .view-toggle {
    width: 100%;
  }
  .view-toggle button {
    flex: 1 1 0;
    justify-content: center;
    padding: 10px 12px;
    font-size: 0.85rem;
  }
  .arch-bar {
    padding: 14px;
    gap: 10px;
  }
  .arch-bar-left {
    width: 100%;
  }
  .arch-bar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .arch-bar-actions .btn.sm {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    padding: 8px 10px;
  }
  .arch-speed {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }
  .arch-speed button {
    padding: 9px 10px;
    min-height: 38px;
  }
  .arch-canvas-panel {
    padding: 10px;
  }
  .arch-canvas-wrap {
    overflow-x: hidden;
  }
  .arch-legend {
    gap: 8px 14px;
    font-size: 0.76rem;
  }
  .arch-legend > .fine {
    margin-left: 0 !important;
    width: 100%;
  }
  .arch-insp-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-tabs .tab-list,
  .tab-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }
  .admin-tabs .tab-list::-webkit-scrollbar,
  .tab-list::-webkit-scrollbar {
    display: none;
  }
  .tab-list button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .adm-select {
    flex: 1 1 100%;
  }
  .adm-bar-row {
    grid-template-columns: 70px 1fr 34px;
    gap: 8px;
    font-size: 0.78rem;
  }
  .adm-actions .btn.sm {
    min-height: 34px;
    padding: 6px 11px;
  }
  .table-wrap {
    padding: 2px 6px;
  }
  .kv td,
  .kv th {
    padding: 9px 8px;
    font-size: 0.83rem;
  }
  .auth-visual {
    padding: 22px 18px;
  }
  .auth-card {
    padding: 20px 16px;
  }
}

@media (max-width: 520px) {
  .wrap {
    width: min(100% - 24px, 1340px);
  }
  .page-head {
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .page-head h1 {
    font-size: clamp(1.75rem, 8.5vw, 2.5rem);
  }
  .panel {
    padding: 15px;
    border-radius: 18px;
  }
  .dark {
    padding: 22px 16px;
    border-radius: 22px;
  }
  .facts,
  .doc .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 14px;
  }
  .facts b,
  .doc .facts b {
    font-size: clamp(1.3rem, 6vw, 1.85rem);
    letter-spacing: -0.03em;
  }
  .facts span {
    font-size: 0.8rem;
  }
  .how-grid,
  .pipe-grid,
  .fact-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .seg {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    border-radius: 14px;
  }
  .seg button {
    width: 100%;
    padding: 9px 8px;
    font-size: 0.82rem;
  }
  .count-card {
    padding: 16px;
  }
  .count-main b {
    font-size: clamp(2.3rem, 11vw, 3.2rem);
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .metric {
    padding: 11px 12px;
  }
  .metric b {
    font-size: 1.15rem;
  }
  .stages li {
    padding: 5px 9px;
    font-size: 0.76rem;
  }
  .gt-summary {
    flex-wrap: wrap;
    gap: 6px;
  }
  .player-bar {
    gap: 8px;
  }
  .player-bar .legend {
    width: 100%;
    margin-left: 0;
    font-size: 0.75rem;
  }
  .toolbar .search {
    flex: 1 1 100%;
    width: 100%;
  }
  .toolbar > .btn.sm,
  .toolbar > a.btn.sm {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
  }
  .hstats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .hrow {
    padding: 12px;
    gap: 10px;
  }
  .badge {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    font-size: 1.2rem;
  }
  .acct-btn {
    max-width: 146px;
    padding: 4px 8px;
    gap: 5px;
  }
  .acct-label {
    display: inline;
    max-width: 82px;
    font-size: 0.75rem;
  }
  .acct-badge {
    padding: 2px 6px;
    font-size: 0.66rem;
  }
  .foot-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .foot-top nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
  }
}
