/* Signal Floor university layer. Themes, chrome, motion. Offline, no CDN. */

[data-theme="futuristic"] {
  --cc-bg: #070b16;
  --cc-bg-2: #10182c;
  --cc-surface: rgba(16, 26, 48, 0.82);
  --cc-surface-2: #18243f;
  --cc-ink: #eef4ff;
  --cc-muted: #b7c6e6;
  --cc-line: rgba(143, 212, 255, 0.28);
  --cc-accent-1: #3ee0ff;
  --cc-accent-2: #f5c16c;
  --cc-accent-3: #c9a6ff;
  --cc-accent-4: #7dffa8;
  --cc-ok: #7dffa8;
  --cc-warn: #ffc14d;
  --cc-danger: #ff8b9a;
  --cc-on-accent: #041018;
  --cc-link: #b8f3ff;
  --cc-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --svg-a: #10203a;
  --svg-b: #1a1030;
  color-scheme: dark;
}
[data-theme="gaming"] {
  --cc-bg: #14081c;
  --cc-bg-2: #241033;
  --cc-surface: #2a1240;
  --cc-surface-2: #3a1856;
  --cc-ink: #fff6ea;
  --cc-muted: #f0c8ff;
  --cc-line: rgba(214, 255, 92, 0.45);
  --cc-accent-1: #d6ff3c;
  --cc-accent-2: #ff3d8a;
  --cc-accent-3: #7af0ff;
  --cc-accent-4: #ffd15c;
  --cc-ok: #d6ff3c;
  --cc-warn: #ffd15c;
  --cc-danger: #ff6b8a;
  --cc-on-accent: #1a0a12;
  --cc-link: #e8ff9a;
  --cc-shadow: 0 16px 0 #3a1856;
  --svg-a: #3a1458;
  --svg-b: #123;
  color-scheme: dark;
}
[data-theme="neon"] {
  --cc-bg: #05060a;
  --cc-bg-2: #0c1020;
  --cc-surface: #0e1324;
  --cc-surface-2: #141a30;
  --cc-ink: #f4fbff;
  --cc-muted: #9ad7ff;
  --cc-line: rgba(255, 47, 179, 0.55);
  --cc-accent-1: #ff2fb3;
  --cc-accent-2: #2ff7ff;
  --cc-accent-3: #d6ff3c;
  --cc-accent-4: #b388ff;
  --cc-ok: #2ff7ff;
  --cc-warn: #ffe14a;
  --cc-danger: #ff5a7a;
  --cc-on-accent: #140010;
  --cc-link: #7af6ff;
  --cc-shadow: 0 0 24px rgba(255, 47, 179, 0.25);
  --svg-a: #160018;
  --svg-b: #001820;
  color-scheme: dark;
}
[data-theme="light"] {
  --cc-bg: #f4f7ff;
  --cc-bg-2: #ffffff;
  --cc-surface: rgba(255, 255, 255, 0.82);
  --cc-surface-2: #e7f6ff;
  --cc-ink: #14182a;
  --cc-muted: #3d4668;
  --cc-line: rgba(20, 24, 42, 0.16);
  --cc-accent-1: #e23b8b;
  --cc-accent-2: #0077d6;
  --cc-accent-3: #6a3cff;
  --cc-accent-4: #0c9a6a;
  --cc-ok: #0c9a6a;
  --cc-warn: #c45a00;
  --cc-danger: #c4123a;
  --cc-on-accent: #ffffff;
  --cc-link: #0b4db5;
  --cc-shadow: 0 16px 36px rgba(20, 40, 90, 0.12);
  --svg-a: #16324a;
  --svg-b: #3a1d4a;
  color-scheme: light;
}
[data-theme="holographic"] {
  --cc-bg: #07061a;
  --cc-bg-2: #120828;
  --cc-surface: rgba(18, 10, 40, 0.72);
  --cc-surface-2: #1a1040;
  --cc-ink: #f7f2ff;
  --cc-muted: #d2c4ff;
  --cc-line: rgba(122, 246, 255, 0.45);
  --cc-accent-1: #7af6ff;
  --cc-accent-2: #ff7ad9;
  --cc-accent-3: #ffe27a;
  --cc-accent-4: #b8ff6a;
  --cc-ok: #b8ff6a;
  --cc-warn: #ffe27a;
  --cc-danger: #ff7ad9;
  --cc-on-accent: #140818;
  --cc-link: #c8fbff;
  --cc-shadow: 0 0 28px rgba(122, 246, 255, 0.25);
  --svg-a: #102040;
  --svg-b: #301040;
  color-scheme: dark;
}
[data-theme="cyberpunk"] {
  --cc-bg: #070709;
  --cc-bg-2: #101014;
  --cc-surface: rgba(12, 12, 16, 0.8);
  --cc-surface-2: #18181f;
  --cc-ink: #f6f6f0;
  --cc-muted: #d6d2a8;
  --cc-line: rgba(252, 238, 10, 0.55);
  --cc-accent-1: #fcee0a;
  --cc-accent-2: #ff003c;
  --cc-accent-3: #00f0ff;
  --cc-accent-4: #ff7ad9;
  --cc-ok: #00f0ff;
  --cc-warn: #fcee0a;
  --cc-danger: #ff003c;
  --cc-on-accent: #111;
  --cc-link: #fcee0a;
  --cc-shadow: 0 0 0 1px #fcee0a, 8px 8px 0 #ff003c;
  --svg-a: #1a1200;
  --svg-b: #200010;
  color-scheme: dark;
}
[data-theme="sunset"] {
  --cc-bg: #1a0b2e;
  --cc-bg-2: #3a1458;
  --cc-surface: rgba(42, 16, 58, 0.78);
  --cc-surface-2: #4a1860;
  --cc-ink: #fff4ea;
  --cc-muted: #ffd0c2;
  --cc-line: rgba(255, 107, 61, 0.5);
  --cc-accent-1: #ff6b3d;
  --cc-accent-2: #ff4d8d;
  --cc-accent-3: #ffd36e;
  --cc-accent-4: #7a5cff;
  --cc-ok: #ffd36e;
  --cc-warn: #ff6b3d;
  --cc-danger: #ff4d8d;
  --cc-on-accent: #2a0a14;
  --cc-link: #ffd0c4;
  --cc-shadow: 0 18px 40px rgba(80, 10, 40, 0.45);
  --svg-a: #4a1860;
  --svg-b: #2a1040;
  color-scheme: dark;
}

body {
  background:
    radial-gradient(900px 420px at 100% -10%, color-mix(in srgb, var(--cc-accent-1) 32%, transparent), transparent 60%),
    radial-gradient(700px 380px at -10% 10%, color-mix(in srgb, var(--cc-accent-3) 26%, transparent), transparent 55%),
    linear-gradient(180deg, var(--cc-bg), var(--cc-bg-2) 40%, var(--cc-bg));
}
[data-theme="gaming"] body { background-image: linear-gradient(180deg, rgba(214,255,60,.08), transparent 30%), repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,.12) 4px), radial-gradient(800px 400px at 90% 0, rgba(255,61,138,.35), transparent 50%), var(--cc-bg); }
[data-theme="neon"] .brand b, [data-theme="neon"] h1 { text-shadow: 0 0 18px color-mix(in srgb, var(--cc-accent-2) 70%, transparent); }
[data-theme="contrast"] body { background: #000; }

.sky {
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
  padding: 8px 16px; border-bottom: 1px solid var(--cc-line);
  background: color-mix(in srgb, var(--cc-bg) 78%, transparent);
  font-size: 0.82rem;
}
.sky a, .sky button {
  color: var(--cc-ink); text-decoration: none; background: transparent; border: 0;
  font: inherit; cursor: pointer; min-height: 36px; padding: 4px 2px;
}
.sky a:hover, .sky button:hover { color: var(--cc-accent-1); }
.sky .spacer { flex: 1; }

.hero { position: relative; }
.stage { min-height: 180px; perspective: 900px; }
.float-card {
  position: absolute; width: 128px; padding: 8px; border-radius: 14px;
  background: color-mix(in srgb, var(--cc-surface) 88%, transparent);
  border: 1px solid var(--cc-line);
  animation: floaty 7s ease-in-out infinite; font-size: 0.75rem;
  pointer-events: none;
}
.float-card { z-index: 2; }
.float-card.a { top: 8px; right: 18px; animation-delay: -2s; }
.float-card.b { top: 92px; right: 48px; animation-delay: -4s; }
@keyframes floaty { 50% { transform: translateY(-10px) rotate(-2deg); } }
[data-reduce="1"] .float-card, [data-reduce="1"] .spin, [data-reduce="1"] .pulse-dot { animation: none; }

.mascot { margin: 0; text-align: center; }
.mascot svg { width: min(220px, 46vw); height: auto; filter: drop-shadow(0 12px 16px rgba(0,0,0,.28)); }
.mascot figcaption { color: var(--cc-muted); font-size: 0.8rem; }
.mascot .eye { transform-origin: center; animation: blink 5.5s infinite; }
[data-pose="point"] .arm.right { d: path("M152 140 Q200 120 190 86"); }
[data-pose="think"] .mouth { d: path("M100 116 H120"); }
[data-pose="cheer"] .arm.left { transform: translateY(-16px); }
[data-pose="listen"] .eye { cy: 92; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.15); } }

.ring {
  --p: 0;
  width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--cc-accent-1) calc(var(--p) * 1%), var(--cc-line) 0);
}
.ring span { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: var(--cc-bg); font-family: var(--cc-display); }

.read-layout { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 18px; align-items: start; }
.onpage { position: sticky; top: 88px; display: grid; gap: 6px; }
.onpage a { text-decoration: none; color: var(--cc-ink); padding: 4px 0; }
.dash { animation: march 1.1s linear infinite; }
@keyframes march { to { stroke-dashoffset: -28; } }
.spin { transform-origin: 360px 150px; animation: spin 22s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse-dot { transform-origin: 250px 145px; animation: pulse 2.4s ease-in-out infinite; }
.diagram { width: 100%; height: auto; border-radius: 18px; }
.chip-pop { transform-box: fill-box; }
[data-reduce="1"] .dash, [data-reduce="1"] animate { display: none; }

#view, #home { animation: rise .4s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
[data-reduce="1"] #view, [data-reduce="1"] #home { animation: none; }

a.card, .card { transition: transform .2s ease, border-color .2s ease; }
a.card:hover { transform: translateY(-4px); }
[data-reduce="1"] a.card:hover { transform: none; }
[data-theme="gaming"] a.card { border-width: 2px; box-shadow: 4px 4px 0 #000; }

.site-footer { margin: 28px 16px 88px; padding: 18px; border-top: 1px solid var(--cc-line); color: var(--cc-muted); }
.site-footer a { color: var(--cc-link); }
.next-labs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.next-labs a { border: 1px solid var(--cc-line); border-radius: 999px; padding: 6px 10px; text-decoration: none; color: var(--cc-ink); background: var(--cc-surface); }

.egg {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center;
  background: rgba(0,0,0,.62); padding: 20px;
}
.egg[hidden] { display: none; }
.egg .panel { max-width: 420px; text-align: center; }

.choice-grid { display: grid; gap: 8px; }
.badge { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.badge em { font-style: normal; color: var(--cc-accent-2); }

.map-node { cursor: pointer; }
.sandbox-list { display: grid; gap: 8px; }
.sandbox-list .action { display: block; }

@media (max-width: 900px) {
  .read-layout { grid-template-columns: 1fr; }
  .onpage { position: static; grid-auto-flow: column; overflow-x: auto; }
  .float-card { display: none; }
}
.topbar { flex-wrap: wrap; }
.primary-nav {
  order: 5;
  flex: 1 1 100%;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 2px;
}
.primary-nav a {
  flex: 0 0 auto;
  white-space: nowrap;
  text-decoration: none;
  color: var(--cc-ink);
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  min-height: 44px;
}
.primary-nav a[aria-current="page"] {
  background: var(--cc-accent-1);
  color: var(--cc-on-accent);
  border-color: transparent;
}
.theme-label { display: flex; align-items: center; gap: 6px; color: var(--cc-muted); font-size: 0.78rem; }
.theme-switch { width: auto; min-width: 8.2rem; }
.hero-fold { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; align-items: center; }
.hero-fold h1 { font-size: clamp(1.7rem, 3vw, 2.55rem); }
.hero-stage {
  position: relative; min-height: 200px; border-radius: 18px; overflow: hidden;
  background: #05080d; border: 1px solid var(--cc-line);
}
.hero-fold .lede { margin: 0 0 8px; font-size: 1rem; }
.hero-fold .statrow { flex-wrap: nowrap; overflow-x: auto; }
.hero-fold .stat { min-width: 84px; padding: 6px 8px; flex: 0 0 auto; }
.hero-fold .stat b { font-size: 1.25rem; }
.hero-fold .chips .btn { min-height: 36px; padding: 6px 10px; }
.hero-mascot { position: absolute; left: 8px; bottom: 0; z-index: 2; margin: 0; }
.hero-mascot svg, .hero-fold .mascot svg { width: 108px; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.hero-stage .constellation { display: block; width: 100%; height: 240px; }
.icon-parade {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
  perspective: 900px;
}
.icon-tile {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 16px;
  padding: 10px;
  min-height: 112px;
  transform-style: preserve-3d;
  animation: tilt3d 7s ease-in-out infinite;
}
.icon-tile:nth-child(2n) { animation-delay: -2s; }
.icon-tile:nth-child(3n) { animation-delay: -3.5s; }
.icon-tile svg { width: 34px; height: 34px; display: block; margin-bottom: 4px; }
.icon-tile b { display: block; font-family: var(--cc-display); font-size: 1.65rem; line-height: 1; }
.icon-tile span { color: var(--cc-muted); font-size: 0.78rem; }
@keyframes tilt3d {
  0%, 100% { transform: rotateX(8deg) rotateY(-12deg); }
  50% { transform: rotateX(-6deg) rotateY(12deg) translateY(-4px); }
}
[data-reduce="1"] .icon-tile { animation: none; }
.flow-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#home-flows .card svg { max-height: 168px; }
#track-chart-root .chart-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#track-chart-root .chart-card svg { max-height: 190px; }
.cheat-banner {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 2px solid var(--cc-accent-1);
  background: color-mix(in srgb, var(--cc-accent-1) 16%, var(--cc-surface));
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.cheat-banner h2 { margin: 0; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
#view .chart-card:has(.radial-chart) { grid-column: 1 / -1; }
#track-chart-root .chart-card:has(.radial-chart) { grid-column: auto; }
.chart-card svg { background: transparent; border: 0; }
.mermaid-svg img, .mermaid-svg svg { width: 100%; height: auto; background: #0c1824; border-radius: 16px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--cc-muted); font-size: 0.9rem; margin: 0 0 8px; }
.crumbs a { color: var(--cc-link); }
.markmap-host {
  width: 100%;
  height: 460px;
  background: var(--cc-bg-2);
  border-radius: 16px;
  border: 1px solid var(--cc-line);
  overflow: hidden;
}
.markmap-host svg { width: 100%; height: 100%; }
.markmap-foreign { font-family: var(--cc-ui); font-size: 14px; }
.spot-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }

@media (max-width: 900px) {
  .hero-fold, .flow-strip { grid-template-columns: 1fr; }
  .icon-parade { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .search { display: flex !important; flex: 1 1 120px; max-width: 46vw; }
  .topbar { flex-wrap: wrap; }
  .sky { font-size: 0.78rem; }
  .primary-nav a { padding: 6px 8px; font-size: 0.78rem; }
  .icon-parade { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stage, .hero-stage .constellation { min-height: 112px; height: 112px; }
  .mascot svg, .hero-mascot svg { width: 84px; }
  .hero-fold h1 { font-size: 1.45rem; }
  .hero-fold .lede { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

@media print {
  .sky, .topbar, .rail, .bottom-nav, .site-footer, .onpage { display: none !important; }
  body { background: #fff; color: #000; }
}

/* Round 4: full-bleed hero, glass, themes, lightbox. */
html { scroll-padding-top: var(--chrome-h, 168px); scroll-padding-bottom: calc(var(--bar-h, 0px) + 16px); scroll-behavior: smooth; overflow-x: clip; }
body { overflow-x: clip; }
.chrome {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--cc-bg) 88%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--cc-line);
}
.topbar { position: static; background: transparent; border-bottom: 0; backdrop-filter: none; }
.sky { flex-wrap: nowrap; overflow-x: auto; background: transparent; border-bottom: 0; }
.sky a, .sky button { white-space: nowrap; flex: 0 0 auto; }
.bar-tools { display: flex; align-items: center; gap: 8px; overflow-x: auto; flex: 1 1 auto; min-width: 0; }
.bar-tools > * { flex: 0 0 auto; }
.bar-tools .search { flex: 1 1 220px; width: auto; min-width: 140px; max-width: 480px; }
.theme-switch, #lang-switch { width: auto; max-width: 9rem; }
.rail { top: var(--chrome-h, 168px); max-height: calc(100vh - var(--chrome-h, 168px)); }
h1, h2, h3 { scroll-margin-top: calc(var(--chrome-h, 168px) + 12px); }
[data-theme="holographic"] body {
  background:
    radial-gradient(800px 420px at 80% 0%, rgba(255, 122, 217, 0.35), transparent 55%),
    radial-gradient(700px 380px at 0% 20%, rgba(122, 246, 255, 0.28), transparent 50%),
    linear-gradient(160deg, #07061a, #1a0840 50%, #07061a);
}
[data-theme="cyberpunk"] body {
  background:
    linear-gradient(180deg, rgba(252, 238, 10, 0.08), transparent 24%),
    repeating-linear-gradient(90deg, transparent, transparent 80px, rgba(255, 0, 60, 0.05) 81px),
    #070709;
}
[data-theme="cyberpunk"] body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 5;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.16) 3px);
}
[data-theme="sunset"] body {
  background:
    radial-gradient(900px 480px at 70% -10%, #ff6b3d, transparent 55%),
    radial-gradient(700px 420px at 10% 0%, #ff4d8d, transparent 50%),
    linear-gradient(180deg, #2a0a3a, #1a0b2e 40%, #120818);
}
[data-theme="neon"] .brand b, [data-theme="neon"] .hero-copy h1,
[data-theme="holographic"] .hero-copy h1, [data-theme="cyberpunk"] .hero-copy h1, [data-theme="sunset"] .hero-copy h1 {
  text-shadow: 0 0 18px color-mix(in srgb, var(--cc-accent-2) 80%, transparent);
}
body[data-home="1"] .rail { display: none; }
body[data-home="1"] .shell { grid-template-columns: 1fr; }
body[data-home="1"] main { max-width: none; min-width: 0; padding: 0 0 96px; }
body[data-home="1"] #home > :not(.hero-bleed) { margin-left: 22px; margin-right: 22px; }
.hero-bleed {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: calc(100svh - var(--chrome-h, 168px) - var(--bar-h, 0px));
  min-height: calc(100svh - var(--chrome-h, 168px) - var(--bar-h, 0px));
  max-height: calc(100svh - var(--chrome-h, 168px) - var(--bar-h, 0px));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: radial-gradient(600px 280px at 72% 42%, color-mix(in srgb, var(--cc-accent-1) 28%, transparent), transparent 70%);
}
.hero-bleed .hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
.hero-canvas.is-fallback { visibility: hidden; }
.shell, .shell > main, #home, .hero-bleed, .hero-scrim, .ticker, .icon-parade { min-width: 0; }
.hero-fallback { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-fallback[hidden] { display: none !important; }
.hero-scrim {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  align-items: end;
  min-width: 0;
  padding: 12px 28px 4px;
  background: none;
}
.hero-copy {
  max-width: 640px;
  padding: 12px 16px;
  border-radius: 20px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cc-bg) 84%, transparent), color-mix(in srgb, var(--cc-bg) 28%, transparent));
}
.hero-copy h1 { font-size: clamp(2.1rem, 4vw, 3.3rem); max-width: 14ch; }
.hero-copy .lede { max-width: 46ch; }
.greet { margin: 0 0 8px; color: var(--cc-accent-2); font-weight: 700; }
.hero-side { position: relative; min-height: 220px; }
.hero-bleed .hero-mascot {
  position: absolute;
  right: 8px;
  bottom: 0;
  z-index: 2;
  pointer-events: none;
  width: 168px;
}
.hero-bleed .hero-mascot svg { width: 168px; }
.hero-bleed .float-card { pointer-events: none; }
.hero-icons {
  position: relative;
  z-index: 2;
  padding: 0 18px 12px;
}
.ticker {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--cc-line);
  background: color-mix(in srgb, var(--cc-bg) 55%, transparent);
  color: var(--cc-accent-2);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.ticker-line { display: inline-block; padding: 8px 1.25rem 8px 0; white-space: nowrap; animation: ticker 28s linear infinite; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.audio-dock {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid var(--cc-line);
  background: color-mix(in srgb, var(--cc-bg) 70%, transparent);
  backdrop-filter: blur(10px);
}
.audio-dock audio { width: min(100%, 280px); height: 32px; vertical-align: middle; }
.audio-dock p { margin: 6px 0 0; }
.card, a.card, .panel, .stat, .icon-tile, .cheat-banner {
  background: color-mix(in srgb, var(--cc-surface) 76%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid color-mix(in srgb, var(--cc-accent-2) 42%, var(--cc-line));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 color-mix(in srgb, #fff 16%, transparent);
}
a.card, .icon-tile, .cheat-banner { position: relative; }
a.card::after, .icon-tile::after, .cheat-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, var(--cc-accent-1), var(--cc-accent-2), var(--cc-accent-3), var(--cc-accent-1));
  background-size: 280% 280%;
  animation: hue-shift 7s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
@keyframes hue-shift { to { background-position: 280% 50%; } }
a.card:hover, .icon-tile:hover {
  transform: translateY(-10px) rotateX(4deg) rotateY(-6deg);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--cc-accent-1) 35%, transparent);
}
.iso-stage { width: 168px; height: 150px; max-width: 100%; margin: 0 auto 8px; perspective: 700px; }
.icon-tile .iso-stage { width: 176px; height: 158px; }
.iso-card .iso-stage { width: 280px; height: 248px; }
.icon-tile svg.iso, .iso-stage svg.iso {
  width: 128px;
  height: 120px;
  display: block;
  margin: 0 auto 4px;
  animation: iso-tilt 7s ease-in-out infinite;
  filter: drop-shadow(0 16px 12px rgba(0, 0, 0, 0.35));
}
.icon-tile { min-height: 168px; text-align: center; }
.icon-tile b { font-size: 1.8rem; display: block; }
.icon-tile .tile-label,
.icon-tile .tile-note { display: block; line-height: 1.25; }
.icon-tile .tile-label { color: var(--cc-ink); font-weight: 700; }
.icon-tile .tile-note { margin-top: 2px; }
@keyframes iso-tilt {
  0%, 100% { transform: rotateY(-16deg) rotateX(8deg); }
  50% { transform: rotateY(16deg) rotateX(-4deg) translateY(-8px); }
}
.atlas-grid { grid-template-columns: 1fr; }
@media (min-width: 1100px) {
  .atlas-grid { grid-template-columns: 1fr 1fr; }
}
#view .diagram, #view .mermaid-svg img { width: 100%; height: auto; max-height: none; min-height: 280px; background: radial-gradient(circle at 30% 30%, #24365c, #070b16 70%); border: 1px solid color-mix(in srgb, var(--cc-accent-2) 45%, transparent); }
.lx-open { margin-right: 8px; }
.lx {
  width: min(1100px, 94vw);
  max-height: 92vh;
  border: 1px solid var(--cc-line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--cc-bg) 92%, transparent);
  color: var(--cc-ink);
  padding: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.lx::backdrop { background: rgba(0, 0, 0, 0.62); }
.lx-bar { display: flex; gap: 8px; margin-bottom: 8px; }
.lx-frame { position: relative; }
.lx-frame svg, .lx-frame img { width: 100%; height: auto; min-height: 320px; }
.lx-packet {
  position: absolute;
  top: 46%;
  left: 8%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: var(--cc-accent-2);
  box-shadow: 0 0 12px var(--cc-accent-1), 0 0 28px var(--cc-accent-2);
}
.lx-packet.is-on { animation: lx-run 3.2s ease-in-out infinite; }
@keyframes lx-run { 0% { left: 8%; } 100% { left: 86%; } }
.chart-card { position: relative; overflow: visible; }
.chart-tip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  background: var(--cc-bg);
  color: var(--cc-ink);
  border: 1px solid var(--cc-accent-2);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 0.82rem;
}
.region-map { width: 100%; height: auto; }
.region-num { font-family: var(--cc-display); font-size: 1.8rem; color: var(--cc-accent-2); margin: 0; }
[data-look="neon"] .visor { stroke: #2ff7ff; }
[data-look="holo"] .visor { stroke: #ff7ad9; }
[data-look="punk"] .visor { stroke: #fcee0a; }
[data-look="sunset"] .visor { stroke: #ff6b3d; }
[data-look="day"] .visor { stroke: #0077d6; }
[data-pose="wave"] .arm.right { transform: rotate(-48deg); transform-origin: 152px 150px; }
[data-pose="wave"] .hand { transform: translate(-28px, -36px); }
html[lang="ar"] body, html[lang="hi"] body, html[lang="te"] body, html[lang="ja"] body {
  font-family: "Noto Sans", "Noto Sans Arabic", "Noto Sans Devanagari", "Noto Sans Telugu", "Noto Sans JP", var(--cc-ui);
}
[data-reduce="1"] .ticker-line, [data-reduce="1"] .iso, [data-reduce="1"] a.card::after, [data-reduce="1"] .lx-packet.is-on { animation: none; }
@media (max-width: 900px) {
  .hero-scrim { grid-template-columns: 1fr; }
  .hero-side { min-height: 0; }
  .hero-bleed .hero-mascot { position: absolute; right: 4px; bottom: 8px; }
  .hero-bleed .hero-mascot, .hero-bleed .hero-mascot svg { width: 96px; }
  .hero-bleed .float-card { display: none; }
  .brand { min-width: 0; }
  .brand span span { display: none; }
  .theme-switch, #lang-switch { min-width: 0; width: 6.2rem; }
  .icon-btn { min-height: 36px; padding: 6px 8px; }
  .topbar, .sky { padding-top: 4px; padding-bottom: 4px; }
  .primary-nav { flex-wrap: nowrap; }
}
@media (max-width: 640px) {
  .hero-copy h1 { font-size: 2rem; }
  .hero-scrim { padding: 12px; }
  .hero-icons { padding: 0 8px 8px; }
  .audio-dock audio { width: 100%; }
  .hero-bleed {
    height: calc(100svh - var(--chrome-h, 56px) - var(--bar-h, 64px));
    min-height: calc(100svh - var(--chrome-h, 56px) - var(--bar-h, 64px));
    max-height: calc(100svh - var(--chrome-h, 56px) - var(--bar-h, 64px));
  }
  .icon-tile { min-height: 0; padding: 6px; }
  .icon-tile svg.iso { width: 120px; height: 108px; }
  .iso-stage, .iso-card .iso-stage { width: 168px; height: 150px; }
}

.iso-stage { position: relative; }
.iso-stage .live-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.iso-stage.has-live svg.iso { opacity: 0; }
.diagram .packet { filter: drop-shadow(0 0 8px #2ff7ff) drop-shadow(0 0 14px #ff2fb3); }
#view .diagram, #view .mermaid-svg img { min-height: 460px; background: radial-gradient(circle at 18% 0%, #9fd8ff, #3d4f9a 58%, #6a3d86); }
.atlas-grid, #view .atlas-grid { grid-template-columns: 1fr; }
#home-flows .card svg { max-height: 340px; }
.chart-card svg { width: 100%; height: auto; min-height: 280px; }
.chart-card .radial-bar, .chart-card .rose, .chart-card .plot-dot, .chart-card .lolli, .chart-card .lolli-dot { cursor: crosshair; }

[data-look="comet"] .cape { fill: #2ff7ff; opacity: 0.85; }
[data-look="aurora"] .cape { fill: #b388ff; opacity: 0.9; }
[data-look="punk"] .cape { fill: #fcee0a; opacity: 0.75; }
[data-look="holo"] .cape { fill: #ff7ad9; opacity: 0.8; }
[data-look="sunset"] .cape { fill: #ff6b3d; opacity: 0.8; }
[data-look="day"] .cape { fill: #0077d6; opacity: 0.55; }
[data-look="neon"] .cape { fill: #ff2fb3; opacity: 0.55; }
.cape { stroke: none; }
[data-look="comet"] .body { fill: #7ee7ff; }
[data-look="aurora"] .body { fill: #d7c4ff; }
[data-look="punk"] .body { fill: #ffe14a; }
[data-look="holo"] .body { fill: #ffb3ea; }
[data-look="sunset"] .body { fill: #ffb199; }
[data-look="day"] .body { fill: #f0b56a; }
.badge { fill: #2ff7ff; }
[data-look="punk"] .badge { fill: #ff2fb3; }
[data-look="sunset"] .badge { fill: #ff6b3d; }
[data-look="day"] .badge { fill: #0077d6; }
[data-look="aurora"] .badge { fill: #b388ff; }
[data-look="comet"] .badge { fill: #d6ff3c; }
.badge-mark { fill: #120814; }
[data-look="comet"] .visor { stroke: #d6ff3c; }
[data-look="aurora"] .visor { stroke: #b388ff; }
.eye { transform-box: fill-box; transform-origin: center; animation: blink 4.6s infinite; }
.mascot svg { animation: bob 3.2s ease-in-out infinite; transform-origin: 110px 210px; }
@keyframes blink { 0%, 88%, 100% { transform: scaleY(1); } 93% { transform: scaleY(0.08); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
[data-reduce="1"] .eye, [data-reduce="1"] .mascot svg, [data-reduce="1"] .diagram .packet { animation: none; }

.menu-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  min-width: 48px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--cc-line);
  background: var(--cc-surface);
  color: var(--cc-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.menu-glyph {
  width: 18px;
  height: 12px;
  background:
    linear-gradient(var(--cc-ink), var(--cc-ink)) 0 0 / 100% 2px,
    linear-gradient(var(--cc-ink), var(--cc-ink)) 0 5px / 100% 2px,
    linear-gradient(var(--cc-ink), var(--cc-ink)) 0 10px / 100% 2px;
  background-repeat: no-repeat;
}
.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.45);
}
.menu-backdrop[hidden], .floor-menu[hidden] { display: none !important; }
.floor-menu {
  position: fixed;
  z-index: 80;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  left: auto;
  width: min(440px, calc(100% - 24px));
  max-height: calc(100svh - var(--chrome-h, 72px) - 24px - env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--cc-line);
  background: var(--cc-bg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}
.menu-head, .menu-prefs { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.menu-head p { margin: 0; font-weight: 800; }
.menu-close, .menu-nav a, .menu-else a, .bottom-nav a, .bottom-nav button, .menu-search input, .menu-prefs select {
  min-height: 48px;
}
.menu-close {
  border: 1px solid var(--cc-line);
  background: var(--cc-surface);
  color: var(--cc-ink);
  border-radius: 999px;
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.menu-search, .menu-prefs label { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: 0.82rem; color: var(--cc-muted); }
.menu-prefs { align-items: stretch; }
.menu-prefs label { flex: 1; }
.menu-search input, .menu-prefs select { width: 100%; border-radius: 12px; border: 1px solid var(--cc-line); background: var(--cc-surface); color: var(--cc-ink); padding: 0 12px; font: inherit; }
.menu-nav, .menu-else { display: flex; flex-direction: column; gap: 8px; }
.menu-nav a, .menu-else a {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--cc-ink);
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 14px;
  padding: 8px 12px;
  min-height: 64px;
  font-weight: 700;
}
.menu-else a { grid-template-columns: 1fr; min-height: 44px; }
.nav-glyph {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--cc-line);
  background: color-mix(in srgb, var(--cc-accent-2) 14%, var(--cc-bg));
  color: var(--cc-accent-2);
}
.nav-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nav-copy b { font-size: 0.98rem; line-height: 1.2; }
.nav-copy small {
  color: var(--cc-muted);
  font-size: 0.78rem;
  font-weight: 550;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-nav a[aria-current="page"], .primary-nav a[aria-current="page"], .bottom-nav a[aria-current="page"] {
  background: color-mix(in srgb, var(--cc-accent-2) 22%, var(--cc-surface));
  border-color: var(--cc-accent-2);
  box-shadow: inset 3px 0 0 var(--cc-accent-2);
}
.menu-nav a[aria-current="page"] .nav-glyph {
  background: var(--cc-accent-2);
  color: #102018;
  border-color: transparent;
}
.menu-note { color: var(--cc-muted); font-size: 0.85rem; }
.menu-else { margin-top: 8px; }
:focus-visible { outline: 3px solid var(--cc-accent-2); outline-offset: 2px; }
body.menu-open { overflow: hidden; }
.bottom-nav button {
  border: 0;
  background: transparent;
  color: var(--cc-ink);
  font: inherit;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.45s ease, transform 0.45s ease; }
  .reveal.is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
[data-reduce="1"] .reveal { opacity: 1; transform: none; transition: none; }

@media (max-width: 700px) {
  .sky { display: none; }
  .chrome { padding-top: env(safe-area-inset-top); }
  .topbar { height: 56px; max-height: 56px; padding: 0 10px; align-items: center; flex-wrap: nowrap; overflow: hidden; }
  .bar-tools { height: 56px; gap: 8px; padding: 0; overflow: visible; }
  .bar-tools > :not(.brand):not(.menu-open) { display: none !important; }
  .primary-nav { display: none; }
  .brand { min-width: 0; min-height: 48px; gap: 8px; }
  .brand .mark { width: 36px; height: 36px; }
  .brand > span:not(.mark) span { display: none; }
  .menu-open { margin-left: auto; }
  .floor-menu {
    inset: 0;
    top: 0;
    right: 0;
    width: auto;
    max-height: none;
    height: 100%;
    border: 0;
    border-radius: 0;
    padding: calc(12px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  }
  .menu-backdrop { display: none !important; }
  .bottom-nav {
    display: block;
    z-index: 45;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    min-height: 48px;
    min-width: 44px;
    font-size: 0.68rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1px solid transparent;
    padding: 4px 2px;
  }
  .bottom-nav svg { display: block; }
  .bottom-nav a[aria-current="page"] { box-shadow: inset 0 3px 0 var(--cc-accent-2); }
  .hero-bleed {
    height: auto;
    min-height: calc(100svh - var(--chrome-h, 56px) - var(--bar-h, 64px));
    max-height: none;
    overflow: visible;
    justify-content: flex-start;
  }
  main, body[data-home="1"] main { padding-bottom: calc(var(--bar-h, 64px) + 16px) !important; }
  .site-footer { margin-bottom: 12px; }
  .icon-tile svg.iso { width: 96px; height: 88px; }
  .icon-parade { flex: 0 0 auto; }
  .ticker { overflow: hidden; white-space: normal; }
  .ticker-line { display: block; white-space: normal; animation: none; padding: 8px 12px; line-height: 1.35; }
  .ticker-line + .ticker-line { display: none; }
  .iso-stage, .iso-card .iso-stage { width: 148px; height: 132px; }
  #settings-form select, #settings-form button, #settings-form .choice { min-height: 48px; }
}

.chart-hold { min-height: 220px; }
.who-band {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--cc-line);
  border-radius: 16px;
  background: var(--cc-surface);
}
.brand-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.brand-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--cc-line);
  border-radius: 999px;
  background: var(--cc-surface);
  color: var(--cc-ink);
  text-decoration: none;
  font-weight: 750;
}
.brand-links a:hover { border-color: var(--cc-accent-2); }
.brand-links svg { flex: 0 0 auto; }
.copy { font-weight: 750; color: var(--cc-ink); }

.guide { position: fixed; right: 16px; bottom: calc(var(--bar-h, 0px) + 16px); z-index: 60; }
.guide-launch, .guide-form button, .guide-chips button, .guide-close {
  min-height: 44px;
  min-width: 44px;
}
.guide-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--cc-accent-2);
  background: var(--cc-accent-1);
  color: var(--cc-on-accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--cc-shadow);
}
.guide-panel {
  position: absolute;
  right: 0;
  bottom: 56px;
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--cc-line);
  background: var(--cc-bg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}
.guide-panel[hidden] { display: none !important; }
.guide-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.guide-head .kicker { margin: 0; }
.guide-sub { margin: 4px 0 0; color: var(--cc-muted); font-size: 0.82rem; }
.guide-log {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
  max-height: 320px;
  padding-right: 2px;
}
.bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--cc-line);
  line-height: 1.4;
}
.bubble p { margin: 0; }
.bubble.bot { align-self: flex-start; background: var(--cc-surface); border-bottom-left-radius: 4px; }
.bubble.user { align-self: flex-end; background: color-mix(in srgb, var(--cc-accent-2) 24%, var(--cc-surface)); border-bottom-right-radius: 4px; }
.bubble a { font-weight: 750; }
.bubble .typing { display: inline-flex; gap: 4px; }
.bubble .typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--cc-muted);
  animation: guide-dot 1s infinite;
}
.bubble .typing i:nth-child(2) { animation-delay: .15s; }
.bubble .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes guide-dot { 50% { opacity: .25; transform: translateY(-2px); } }
[data-reduce="1"] .bubble .typing i { animation: none; }
.guide-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-chips button {
  border: 1px solid var(--cc-line);
  background: var(--cc-surface);
  color: var(--cc-ink);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}
.guide-form { display: flex; gap: 8px; }
.guide-form input { flex: 1; min-height: 44px; }
@media (max-width: 700px) {
  .guide { right: 10px; left: 10px; bottom: calc(var(--bar-h, 64px) + 8px); }
  .guide-launch span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .guide-launch { width: 48px; height: 48px; padding: 0; justify-content: center; border-radius: 50%; }
  .guide-panel { left: 0; right: 0; width: auto; bottom: 58px; }
}
