/* Circuit theme (Matt picked this one, option 2 of round 2, for the full site).
   Command-center look: a rotating 3D particle globe with data arcs behind the hero, a moving
   perspective grid floor, an animated "how the work moves" flow diagram, and a live terminal
   feed in the proof section.

   Round 4: ten color palettes (Matt felt the original cyan + green clashed). Every color in
   the stylesheets goes through the variables below.
   Round 5: Matt liked Arctic and Emerald best, so all ten sat in that cool cyan-to-green
   family, each pairing its accent with a lighter tint of the same hue (no cross-hue pairs).
   Round 6: Matt called out Arctic, Glacier, Jade and Evergreen by name as his favorites and
   asked for more like those plus a Forest option. Those four are unchanged; Aqua, Lagoon,
   Seafoam, Emerald, Mint and Spring (the ones furthest from his picks) were swapped for Frost,
   Crystal, Tundra, Forest, Pine and Alpine - closer icy-blue and deep-green variants, including
   a true muted pine Forest. The palette switcher (script.js) sets html[data-palette]; the choice
   is kept in localStorage and can be forced with ?palette=<id>.
   Round 7: Matt set Glacier as the site color, so :root holds Glacier.
   Round 8: Matt said to move forward with Glacier, so the switcher and the other nine palettes
   were removed (they are in git history). Glacier is the only look. */

:root {
  --accent: #7dd3fc;
  --good: #e0f2fe;
  --a-rgb: 125 211 252;
  --g-rgb: 224 242 254;
  --t-rgb: 150 210 255;
  --hi: #f0f9ff;
  --term: #c4e7ff;
  --bg: #04070b;
  --bg-2: #080c13;
  --bg-3: #0e1520;
  --deep: #03050a;
  --bg-rgb: 4 7 11;
  --s1-rgb: 14 21 32;
  --s2-rgb: 8 12 19;
  --accent-ink: #021220;
  --ink: #eef5fb;
  --ink-2: #a3b0bf;
  --ink-3: #84919f;
  --hairline: rgb(var(--t-rgb) / 0.09);
  --hairline-2: rgb(var(--t-rgb) / 0.18);
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}
html { background: var(--bg); transition: background-color var(--dur-slow) var(--ease); }

.theme-circuit .eyebrow { font-family: var(--font-mono); letter-spacing: 0.12em; }
.theme-circuit .eyebrow::before { content: "// "; opacity: 0.6; }
.theme-circuit .btn-primary { box-shadow: 0 0 0 1px rgb(var(--a-rgb) / 0.5), 0 10px 40px rgb(var(--a-rgb) / 0.35); }
.theme-circuit .display .w:last-child { color: var(--accent); text-shadow: 0 0 40px rgb(var(--a-rgb) / 0.45); }

/* hero: globe + floor */
.globe {
  position: absolute;
  top: 0; right: -8%;
  width: 70%;
  height: 100%;
  display: block;
}
.floor-wrap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 42%;
  perspective: 420px;
  perspective-origin: 50% 0%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 40%);
  mask-image: linear-gradient(transparent, #000 40%);
  pointer-events: none;
}
.floor {
  position: absolute;
  left: -50%; right: -50%;
  top: 0; height: 200%;
  background-image:
    linear-gradient(rgb(var(--a-rgb) / 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--a-rgb) / 0.35) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: rotateX(72deg);
  transform-origin: 50% 0;
  animation: floor 3s linear infinite;
}
@keyframes floor { to { background-position: 0 64px; } }
.theme-circuit .hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 42%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(var(--a-rgb) / 0.6), transparent);
  box-shadow: 0 0 24px rgb(var(--a-rgb) / 0.8);
  pointer-events: none;
}
.theme-circuit .panel {
  background: rgb(var(--s2-rgb) / 0.72);
  border-color: rgb(var(--a-rgb) / 0.28);
  box-shadow: 0 0 0 1px rgb(var(--a-rgb) / 0.06), 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgb(var(--a-rgb) / 0.12);
}
.theme-circuit .panel-foot { background: rgb(var(--a-rgb) / 0.08); }
.theme-circuit .runlist em { font-family: var(--font-mono); }

/* stack strip */
.stack-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-5) 0 var(--space-5) var(--space-5);
  border-top: 1px solid var(--hairline-2);
  border-bottom: 1px solid var(--hairline-2);
  background: linear-gradient(90deg, rgb(var(--a-rgb) / 0.06), transparent 40%);
}
.stack-label { flex: none; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.marquee-sm {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--ink-2);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-sm .mq-sep { color: var(--accent); }

/* before/after stage: grid floor under the cards */
.theme-circuit .shift-sticky { background: radial-gradient(ellipse 60% 50% at 50% 100%, rgb(var(--a-rgb) / 0.14), transparent 70%), var(--bg); }
.floor-wrap-shift { height: 50%; opacity: 0.6; }
.theme-circuit .shift-sticky > .container { position: relative; z-index: 1; }
.theme-circuit .card { background: rgb(var(--s2-rgb) / 0.88); }
.theme-circuit .card.after.lift { box-shadow: 0 0 0 1px rgb(var(--g-rgb) / 0.4), 0 0 60px rgb(var(--g-rgb) / 0.2); border-color: rgb(var(--g-rgb) / 0.5); }
.theme-circuit .saved-num { color: var(--good); text-shadow: 0 0 30px rgb(var(--g-rgb) / 0.5); }

/* flow diagram */
.flow {
  margin: 0 0 var(--space-8);
  padding: var(--space-5);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 40% 60% at 50% 50%, rgb(var(--a-rgb) / 0.1), transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 31px, rgb(var(--t-rgb) / 0.04) 31px 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgb(var(--t-rgb) / 0.04) 31px 32px),
    var(--bg-2);
}
.flow svg { width: 100%; height: auto; overflow: visible; }
.flow figcaption { margin-top: var(--space-3); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-3); text-align: center; letter-spacing: 0.06em; }
.flow .wire { fill: none; stroke: rgb(var(--a-rgb) / 0.22); stroke-width: 1.5; }
.flow .wire-out { stroke: rgb(var(--g-rgb) / 0.22); }
.flow .node rect { fill: var(--bg-3); stroke: rgb(var(--a-rgb) / 0.4); stroke-width: 1; }
.flow .node-out rect { fill: #0a1622; stroke: rgb(var(--a-rgb) / 0.7); }
.flow .node text { fill: #f8fafc; font-family: var(--font-sans); font-weight: 600; }
.flow .core circle.core-ring { fill: none; stroke: rgb(var(--a-rgb) / 0.5); stroke-width: 1.5; stroke-dasharray: 4 6; }
.flow .core circle.core-fill { fill: #e0f2fe; }
.flow .core text { fill: #020c16; font-family: var(--font-display); font-weight: 800; font-size: 18px; text-anchor: middle; }
.flow .core text.core-sub { font-family: var(--font-sans); font-weight: 700; font-size: 12px; fill: #0c3a5c; }
.flow .packet { fill: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.flow .packet-out { fill: var(--good); filter: drop-shadow(0 0 6px var(--good)); }
.flow .spin { transform-origin: center; transform-box: fill-box; animation: corespin 14s linear infinite; }
@keyframes corespin { to { transform: rotate(360deg); } }

/* bento */
.theme-circuit .bcard { background: linear-gradient(180deg, rgb(var(--s1-rgb) / 0.9), rgb(var(--s2-rgb) / 0.9)); border-color: var(--hairline-2); }
.theme-circuit .bcard::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.6;
}
.theme-circuit .bicon { font-family: var(--font-mono); }
.theme-circuit .viz { --vz-surface: rgb(var(--a-rgb) / 0.04); --vz-line: rgb(var(--t-rgb) / 0.14); }

/* proof + terminal */
.theme-circuit .proof { background: radial-gradient(ellipse 50% 40% at 0% 30%, rgb(var(--a-rgb) / 0.1), transparent 70%), var(--bg-2); }
.term {
  margin-top: var(--space-6);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-md);
  background: var(--deep);
  overflow: hidden;
  box-shadow: 0 0 40px rgb(var(--a-rgb) / 0.08);
}
.term-head { display: flex; align-items: center; gap: 6px; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--hairline); }
.term-head span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); }
.term-head b { margin-left: var(--space-2); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; color: var(--ink-3); }
.term-log {
  height: 188px;
  margin: 0;
  padding: var(--space-3);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--term);
  white-space: pre-wrap;
}
.term-log .ok { color: var(--good); }
.term-log .tm { color: var(--ink-3); }
.term-log .cur { display: inline-block; width: 7px; height: 14px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term-note { padding: 0 var(--space-3) var(--space-2); font-size: var(--text-xs); color: var(--ink-3); }

.theme-circuit .step-num { font-family: var(--font-mono); box-shadow: 0 0 24px rgb(var(--a-rgb) / 0.5); }
.theme-circuit .contact-bg {
  background:
    radial-gradient(ellipse 50% 60% at 20% 50%, rgb(var(--a-rgb) / 0.14), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 63px, rgb(var(--t-rgb) / 0.05) 63px 64px);
}

@media (max-width: 960px) {
  .globe { right: -30%; width: 120%; opacity: 0.55; }
}
@media (max-width: 720px) {
  .stack-strip { flex-direction: column; align-items: flex-start; gap: var(--space-3); padding-right: 0; }
  .marquee-sm { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .floor, .flow .spin, .term-log .cur { animation: none !important; }
}

/* Same rules when the visitor pressed "Pause animations" (html.rm, set before first paint). */
  html.rm .floor, html.rm .flow .spin, html.rm .term-log .cur { animation: none !important; }

