/* QrAI — Era III redesign */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}
body {
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: clip;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  touch-action: manipulation;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

:root {
  --bg: #070912;
  --surface: #0c0e16;
  --surface-2: #12151f;
  --text: #f4f6fb;
  --text-soft: #d4dbe8;
  --muted: #b0bbcc;
  --primary: #7c6cff;
  --primary-glow: rgba(124, 108, 255, .45);
  --secondary: #22d3ee;
  --accent: #f472b6;
  --accent-2: #a78bfa;
  --success: #34d399;
  --danger: #fb7185;
  --card: rgba(12, 14, 22, .94);
  --panel: rgba(10, 12, 20, .88);
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .14);
  --shadow: 0 24px 80px rgba(0, 0, 0, .55);
  --radius: 20px;
  --radius-sm: 12px;
  --ring: 0 0 0 3px rgba(124, 108, 255, .28);
  --font-display: "Syne", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #0a0d14;
  --text-soft: #2d3548;
  --muted: #4a5568;
  --primary: #5b4fe8;
  --primary-glow: rgba(91, 79, 232, .25);
  --secondary: #0891b2;
  --accent: #db2777;
  --accent-2: #7c3aed;
  --card: rgba(255, 255, 255, .94);
  --panel: rgba(255, 255, 255, .92);
  --border: rgba(10, 13, 20, .08);
  --border-strong: rgba(10, 13, 20, .14);
  --shadow: 0 24px 80px rgba(31, 39, 55, .12);
}

body { background: var(--bg); color: var(--text); font-size: 1rem; line-height: 1.7; }

/* Ambient background — animated */
.page-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }

.page-bg-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: .78;
}

.page-bg-scrim {
  position: absolute; inset: 0; z-index: 2;
  background: radial-gradient(
    ellipse 130% 90% at 50% 35%,
    rgba(7, 9, 18, .08) 0%,
    rgba(7, 9, 18, .28) 55%,
    rgba(7, 9, 18, .42) 100%
  );
}
[data-theme="light"] .page-bg-scrim {
  background: radial-gradient(
    ellipse 130% 90% at 50% 35%,
    rgba(244, 246, 251, .12) 0%,
    rgba(244, 246, 251, .38) 55%,
    rgba(244, 246, 251, .52) 100%
  );
}

.page-bg-floats { position: absolute; inset: 0; overflow: hidden; z-index: 1; }
.bg-float-word {
  position: absolute;
  font-family: var(--font-mono);
  font-size: clamp(.75rem, 1.2vw, .95rem);
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(124, 108, 255, .18);
  white-space: nowrap;
  animation: float-drift var(--dur, 22s) linear infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform;
}
[data-theme="light"] .bg-float-word { color: rgba(91, 79, 232, .14); }

@keyframes float-drift {
  0% { transform: translate(110vw, 0) rotate(-5deg); opacity: 0; }
  8% { opacity: .55; }
  92% { opacity: .55; }
  100% { transform: translate(-30vw, var(--lift, -80px)) rotate(5deg); opacity: 0; }
}

.page-bg-grid {
  position: absolute; inset: 0; z-index: 1;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 100% 90% at 50% 30%, black, transparent);
  animation: grid-scroll 24s linear infinite;
  opacity: .85;
}
@keyframes grid-scroll {
  from { background-position: 0 0; }
  to { background-position: 48px 48px; }
}
[data-theme="light"] .page-bg-grid {
  background-image:
    linear-gradient(rgba(10,13,20,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,13,20,.05) 1px, transparent 1px);
}

.page-bg-noise {
  position: absolute; inset: 0; opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

@media (max-width: 879px) {
  .page-bg-canvas { opacity: .62; }
  .bg-float-word { font-size: .7rem; }
}

.container { width: min(1180px, 92%); margin-inline: auto; }
.small { font-size: .875rem; color: var(--muted); }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(16px);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
  overflow: visible;
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 12px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em;
  flex-wrap: nowrap;
  min-width: 0;
  line-height: 1;
}
.brand img { border-radius: 10px; flex-shrink: 0; }
.brand > span:not(.brand-tag) {
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
}
.brand-tag {
  font-family: var(--font-mono); font-size: .65rem; font-weight: 500;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--secondary); letter-spacing: .06em; text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.2;
}
.nav-links { display: none; gap: 8px; }
.nav-links a {
  position: relative;
  padding: 8px 12px;
  color: var(--muted); font-size: .9rem; font-weight: 500;
  transition: color .2s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 4px;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}
.nav-links a:hover,
.nav-links a.is-active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.is-active::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Account menu */
.account-menu { position: relative; flex: 0 0 auto; }
.account-menu[hidden] { display: none !important; }
.account-menu-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px 0 10px;
  border-radius: 999px; border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 75%, transparent);
  color: var(--text); font-weight: 600; font-size: .875rem; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
  overflow: visible;
}
.account-menu-trigger:hover { background: var(--surface); border-color: var(--border-strong); }
.account-menu-trigger[aria-expanded="true"] { border-color: var(--primary); box-shadow: var(--ring); }
.account-menu-trigger-icon {
  width: 28px; height: 28px;
  flex-shrink: 0;
  display: grid; place-items: center;
  overflow: visible;
  color: color-mix(in oklab, var(--secondary) 75%, var(--primary));
}
.cpu-avatar {
  width: 28px; height: 28px;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 0 4px rgba(124, 108, 255, .35));
}
.account-menu-chevron {
  width: 14px; height: 14px; opacity: .75; background-color: var(--muted);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M7 10l5 5 5-5z"/></svg>') no-repeat center / contain;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M7 10l5 5 5-5z"/></svg>') no-repeat center / contain;
  transition: transform .2s;
}
.account-menu-trigger[aria-expanded="true"] .account-menu-chevron { transform: rotate(180deg); }
.account-menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 228px; padding: 6px; border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: color-mix(in oklab, var(--surface) 95%, var(--bg));
  backdrop-filter: blur(16px); box-shadow: var(--shadow); z-index: 120;
}
.account-menu-panel[hidden] { display: none !important; }
.account-menu-item {
  display: flex; width: 100%; padding: 11px 14px;
  border: none; border-radius: 10px; background: transparent;
  color: var(--text); font: inherit; font-weight: 500; font-size: .9rem;
  text-align: left; cursor: pointer; transition: background .12s;
}
.account-menu-item:hover { background: color-mix(in oklab, var(--primary) 14%, var(--surface)); }
.account-menu-item-primary { font-weight: 600; }
.account-menu-item:not(.account-menu-item-primary) { color: var(--muted); }

.burger {
  display: inline-flex; flex-direction: column; gap: 5px;
  background: transparent; border: 0; padding: 8px; border-radius: 10px; cursor: pointer;
}
.burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s; }
.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 10px;
  right: 10px;
  z-index: 60;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  max-height: none;
  overflow: visible;
}
.mobile-menu:not([hidden]) { display: block; }
.mobile-menu-panel {
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: color-mix(in oklab, var(--surface) 96%, var(--bg));
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 2px;
}
.mobile-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 11px 14px 11px 18px;
  border-radius: 10px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 500;
  transition: color .15s, background .15s;
}
.mobile-nav-link::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  transform: translateY(-50%);
  transition: height .2s cubic-bezier(.22, 1, .36, 1);
}
.mobile-nav-link:hover { color: var(--text); background: color-mix(in oklab, var(--primary) 8%, transparent); }
.mobile-nav-link.is-active {
  color: var(--text);
  background: color-mix(in oklab, var(--primary) 12%, var(--surface));
  font-weight: 600;
}
.mobile-nav-link.is-active::before { height: 18px; }
.mobile-nav-link-cta {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  padding-top: 14px;
  color: var(--primary);
  font-weight: 600;
}
.mobile-nav-link-cta.is-active { color: var(--text); }

/* CPU avatar (account icon) */
.cpu-wave {
  transform-box: fill-box;
  transform-origin: center;
  animation: cpu-wave-pulse 2.8s ease-out infinite;
}
.cpu-wave-2 { animation-delay: .93s; }
.cpu-wave-3 { animation-delay: 1.86s; }

@keyframes cpu-wave-pulse {
  0% { transform: scale(1); opacity: .8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.cpu-trace {
  stroke: url(#cpuWaveGrad);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  animation: cpu-trace-flow 1.6s ease-in-out infinite;
}
.cpu-trace-2 { animation-delay: .4s; }
.cpu-trace-3 { animation-delay: .8s; }
.cpu-trace-4 { animation-delay: 1.2s; }

@keyframes cpu-trace-flow {
  0% { stroke-dashoffset: 22; opacity: .2; }
  40% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -22; opacity: .2; }
}

.cpu-body {
  fill: color-mix(in oklab, var(--surface) 90%, transparent);
  stroke: var(--border-strong);
  stroke-width: 1.5;
}
.cpu-die {
  fill: color-mix(in oklab, var(--primary) 18%, var(--surface));
  stroke: color-mix(in oklab, var(--primary) 50%, var(--border));
  stroke-width: 1;
  animation: cpu-die-pulse 2s ease-in-out infinite;
}
.cpu-core {
  fill: url(#cpuCoreGrad);
  animation: cpu-core-glow 1.4s ease-in-out infinite alternate;
}
@keyframes cpu-die-pulse {
  0%, 100% { stroke: color-mix(in oklab, var(--primary) 50%, var(--border)); }
  50% { stroke: color-mix(in oklab, var(--secondary) 60%, var(--primary)); }
}
@keyframes cpu-core-glow {
  from { opacity: .75; }
  to { opacity: 1; }
}

.cpu-pins rect { opacity: .7; animation: cpu-pin-blink 2.4s ease-in-out infinite; }
.cpu-pins rect:nth-child(odd) { animation-delay: .3s; }
.cpu-pins rect:nth-child(3n) { animation-delay: .6s; }
@keyframes cpu-pin-blink {
  0%, 100% { opacity: .45; }
  50% { opacity: .95; }
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  font-weight: 600; font-size: .9rem;
  transition: transform .12s, filter .15s, box-shadow .15s, background .15s;
  position: relative; overflow: hidden;
}
.btn-lg { height: 48px; padding: 0 24px; font-size: .95rem; }
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-2) 100%);
  color: #fff; box-shadow: 0 8px 32px var(--primary-glow);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 12px 40px var(--primary-glow); }
.btn-secondary {
  background: color-mix(in oklab, var(--secondary) 18%, var(--surface));
  color: var(--text); border-color: color-mix(in oklab, var(--secondary) 35%, var(--border));
}
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--primary); }
.btn-outline {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); width: 42px; height: 42px; padding: 0;
}

/* ── Hero ── */
.hero { position: relative; padding: 48px 0 0; min-height: min(92vh, 900px); display: flex; flex-direction: column; }
.hero-grid {
  display: grid; grid-template-columns: 1fr; gap: 40px;
  align-items: center; flex: 1; padding-bottom: 48px;
}

.hero-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 20px; padding: 8px 16px 8px 12px;
  border-radius: 999px; border: 1px solid var(--border-strong);
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  font-family: var(--font-mono); font-size: .78rem; font-weight: 500;
  color: var(--secondary); letter-spacing: .04em; text-transform: uppercase;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 12px var(--secondary);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.85); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.04em;
  margin: 0 0 24px;
}
.hero-line { display: block; }
.hero-line-accent {
  background: linear-gradient(120deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-line-muted { color: var(--muted); font-weight: 700; }
.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-soft); max-width: 48ch; margin: 0 0 28px; line-height: 1.75;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 60%, transparent);
  font-size: .82rem; color: var(--muted); font-weight: 500;
}

/* Terminal */
.hero-terminal { position: relative; perspective: 800px; }
.terminal-window {
  position: relative; z-index: 2;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: color-mix(in oklab, var(--surface) 92%, #000);
  box-shadow: var(--shadow), 0 0 0 1px rgba(124,108,255,.08);
  overflow: hidden;
  transform: rotateY(-4deg) rotateX(2deg);
  transition: transform .4s ease;
}
.hero-terminal:hover .terminal-window { transform: rotateY(0) rotateX(0); }
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 60%, var(--surface));
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot:nth-child(1) { background: #ff5f57; }
.terminal-dot:nth-child(2) { background: #febc2e; }
.terminal-dot:nth-child(3) { background: #28c840; }
.terminal-title {
  margin-left: auto; font-family: var(--font-mono);
  font-size: .72rem; color: var(--muted);
}
.terminal-body { padding: 20px; font-family: var(--font-mono); font-size: .82rem; line-height: 1.7; min-height: 220px; }
.terminal-line { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.terminal-prompt { color: var(--accent); font-weight: 500; }
.terminal-input { color: var(--text); }
.terminal-cursor {
  display: inline-block; width: 8px; height: 1.1em;
  background: var(--secondary); vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.terminal-output { margin-bottom: 12px; }
.terminal-comment { color: var(--muted); font-style: italic; }
.terminal-code {
  margin: 0; padding: 14px; border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  border: 1px solid var(--border);
  color: var(--secondary); white-space: pre-wrap; word-break: break-word;
  min-height: 60px;
}

/* Python playground */
.section-playground .playground { margin-top: 8px; }
.playground-window { transform: none; }
.playground-window:hover { transform: none; }
.playground-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 50%, var(--surface));
}
.playground-status {
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--muted);
}
.playground-toolbar #playgroundRun { flex-shrink: 0; min-width: 132px; }
.playground-panes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.playground-pane {
  display: flex; flex-direction: column; min-height: 0;
  border-bottom: 1px solid var(--border);
}
.playground-pane:last-child { border-bottom: 0; }
.playground-pane-label {
  padding: 10px 16px 0;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.playground-editor {
  padding: 0 8px 12px;
  min-height: 240px;
}
.playground-editor .CodeMirror {
  height: auto;
  min-height: 220px;
  font-family: var(--font-mono);
  font-size: .82rem;
  line-height: 1.65;
  background: transparent;
  color: var(--text);
  border-radius: var(--radius-sm);
}
.playground-editor .CodeMirror-scroll {
  min-height: 220px;
}
.playground-editor .CodeMirror-gutters {
  background: color-mix(in oklab, var(--bg) 40%, transparent);
  border-right: 1px solid var(--border);
}
.playground-editor .CodeMirror-linenumber {
  color: var(--muted);
  padding: 0 8px 0 4px;
}
.playground-editor .CodeMirror-cursor { border-left-color: var(--secondary); }
.playground-editor .CodeMirror-selected { background: color-mix(in oklab, var(--accent) 28%, transparent) !important; }
.playground-editor .CodeMirror-activeline-background {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}
.cm-s-qrai .cm-keyword { color: #c792ea; font-weight: 500; }
.cm-s-qrai .cm-builtin { color: #82aaff; }
.cm-s-qrai .cm-def { color: #82aaff; }
.cm-s-qrai .cm-string { color: #22d3ee; }
.cm-s-qrai .cm-string-2 { color: #22d3ee; }
.cm-s-qrai .cm-number { color: #f9c859; }
.cm-s-qrai .cm-comment { color: var(--muted); font-style: italic; }
.cm-s-qrai .cm-operator { color: #89ddff; }
.cm-s-qrai .cm-variable { color: var(--text); }
.cm-s-qrai .cm-variable-2 { color: #e2e8f0; }
.cm-s-qrai .cm-property { color: #f9c859; }
[data-theme="light"] .cm-s-qrai .cm-keyword { color: #7c3aed; }
[data-theme="light"] .cm-s-qrai .cm-string { color: #0891b2; }
[data-theme="light"] .cm-s-qrai .cm-builtin,
[data-theme="light"] .cm-s-qrai .cm-def { color: #2563eb; }
.playground-output {
  margin: 8px 16px 16px; padding: 14px;
  min-height: 120px; max-height: 280px; overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  font-family: var(--font-mono); font-size: .82rem; line-height: 1.65;
  color: var(--secondary); white-space: pre; overflow-x: auto;
}
.playground-output--error { color: #f87171; border-color: color-mix(in oklab, #f87171 40%, var(--border)); }
.playground-note { margin-top: 14px; color: var(--muted); text-align: center; }

/* Python standalone page */
body.playground-page {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
}
/* Link with animated underline bar */
.link-bar {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 2px;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s;
}
.link-bar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}
.link-bar:hover,
.link-bar:focus-visible { color: var(--text); outline: none; }
.link-bar:hover::after,
.link-bar:focus-visible::after { transform: scaleX(1); }

.playground-page-header {
  position: sticky;
  top: 0;
  z-index: 300;
  isolation: isolate;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 94%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
}
.playground-page-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
}
.playground-page-start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
.playground-page-brand {
  font-size: .95rem;
  min-width: 0;
  flex-shrink: 1;
}
.playground-page-tag {
  font-family: var(--font-mono);
  font-size: .65rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--secondary);
  letter-spacing: .06em;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
}
.pg-menu { position: relative; flex-shrink: 0; z-index: 301; }
.pg-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 60%, transparent);
  color: var(--text);
  font: inherit;
  font-size: .84rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pg-menu-trigger:hover { border-color: var(--border-strong); background: var(--surface); }
.pg-menu-trigger[aria-expanded="true"] { border-color: var(--primary); box-shadow: var(--ring); }
.pg-menu-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
}
.pg-menu-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-soft);
}
.pg-menu-chevron {
  width: 14px;
  height: 14px;
  opacity: .6;
  background-color: var(--muted);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M7 10l5 5 5-5z"/></svg>') no-repeat center / contain;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M7 10l5 5 5-5z"/></svg>') no-repeat center / contain;
  transition: transform .2s;
}
.pg-menu-trigger[aria-expanded="true"] .pg-menu-chevron { transform: rotate(180deg); }
.pg-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: color-mix(in oklab, var(--surface) 96%, var(--bg));
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  z-index: 302;
}
.pg-menu-panel[hidden] { display: none !important; }
.pg-menu-item {
  display: flex;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.pg-menu-item:hover { background: color-mix(in oklab, var(--primary) 12%, var(--surface)); }
.pg-menu-item-muted { color: var(--muted); }
.pg-menu-item-muted:hover { color: var(--text); }
.pg-menu-item-theme {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pg-theme-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background-color: var(--muted);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M21 12.79A9 9 0 1 1 11.21 3A7 7 0 0 0 21 12.79z"/></svg>') no-repeat center / contain;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M21 12.79A9 9 0 1 1 11.21 3A7 7 0 0 0 21 12.79z"/></svg>') no-repeat center / contain;
  transition: background-color .15s;
}
.pg-menu-item-theme:hover .pg-theme-icon { background-color: var(--text); }
[data-theme="light"] .pg-theme-icon {
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="%23000"><circle cx="12" cy="12" r="5"/><rect x="11" y="1" width="2" height="4" rx="1"/><rect x="11" y="19" width="2" height="4" rx="1"/><rect x="1" y="11" width="4" height="2" rx="1"/><rect x="19" y="11" width="4" height="2" rx="1"/></g></svg>') no-repeat center / contain;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="%23000"><circle cx="12" cy="12" r="5"/><rect x="11" y="1" width="2" height="4" rx="1"/><rect x="11" y="19" width="2" height="4" rx="1"/><rect x="1" y="11" width="4" height="2" rx="1"/><rect x="19" y="11" width="4" height="2" rx="1"/></g></svg>') no-repeat center / contain;
}
.pg-theme-label { flex: 1; text-align: left; }
.playground-page-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.playground-standalone {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.playground-page .playground-window {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.playground-page .playground-panes {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
}
.playground-page .playground-pane {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.playground-page .playground-pane-label {
  flex-shrink: 0;
}
.playground-page .playground-editor {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 8px;
  overflow: hidden;
}
.playground-page .playground-editor .CodeMirror {
  flex: 1;
  height: 100% !important;
  min-height: 0 !important;
}
.playground-page .playground-editor .CodeMirror-scroll {
  min-height: 0 !important;
  max-height: 100%;
  overflow-y: auto !important;
}
.playground-page .playground-output-wrap {
  flex: 1;
  min-height: 0;
  margin: 8px 12px 12px;
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  -webkit-overflow-scrolling: touch;
}
.playground-page .playground-output-wrap .playground-output {
  margin: 0;
  min-height: 0;
  max-height: none;
  border: none;
  background: transparent;
  overflow: visible;
}
.playground-page .playground-output-wrap:has(.playground-output--error) {
  border-color: color-mix(in oklab, #f87171 40%, var(--border));
}
.playground-page .playground-output-wrap:has(.playground-output--error) .playground-output {
  color: #f87171;
}

/* Python CTA on landing */
.python-cta { margin-top: 28px; }
.section-python-cta .section-head { margin-bottom: 0; }

.modal-lead {
  margin: 0 0 16px;
  color: var(--text-soft);
  font-size: .92rem;
  line-height: 1.5;
}
.modal-switch {
  margin: 12px 0 0;
  text-align: center;
  font-size: .88rem;
  color: var(--muted);
}
.link-btn {
  border: 0;
  padding: 0;
  background: none;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--secondary); }

.hero-orbit {
  position: absolute; border-radius: 50%; pointer-events: none;
  border: 1px solid color-mix(in oklab, var(--primary) 25%, transparent);
}
.hero-orbit-1 { width: 120%; height: 120%; top: -10%; left: -10%; animation: orbit 20s linear infinite; }
.hero-orbit-2 { width: 140%; height: 140%; top: -20%; left: -20%; border-color: color-mix(in oklab, var(--secondary) 15%, transparent); animation: orbit 30s linear infinite reverse; }
@keyframes orbit { to { transform: rotate(360deg); } }

/* Marquee */
.marquee {
  border-block: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 50%, transparent);
  padding: 14px 0; overflow: hidden;
}
.marquee-track {
  display: flex; gap: 24px; width: max-content;
  animation: marquee 35s linear infinite;
  font-family: var(--font-display); font-weight: 700;
  font-size: .95rem; letter-spacing: .08em; text-transform: uppercase;
  color: color-mix(in oklab, var(--muted) 70%, var(--text));
}
.marquee-track span:nth-child(odd) { color: var(--text); opacity: .5; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── Sections ── */
.section { padding: clamp(64px, 10vw, 100px) 0; position: relative; }
.section-head {
  display: grid; gap: 20px; margin-bottom: 48px;
}
.section-index {
  font-family: var(--font-mono); font-size: .8rem; font-weight: 500;
  color: var(--primary); letter-spacing: .1em;
}
.section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800; letter-spacing: -.03em;
  line-height: 1.05; margin: 0 0 12px;
}
.section-lead { color: var(--text-soft); margin: 0; max-width: 52ch; line-height: 1.75; font-size: 1.05rem; }

.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }

/* Era timeline */
.era-timeline { position: relative; display: grid; gap: 0; }
.era-track {
  position: absolute; left: 0; top: 22px; bottom: 22px; width: 2px;
  background: var(--border); display: none;
}
.era-track-fill {
  width: 100%; height: 0; background: linear-gradient(180deg, var(--primary), var(--secondary));
  transition: height .6s ease;
}
.era-step {
  display: grid; grid-template-columns: auto 1fr; gap: 24px;
  padding: 32px 0; border-bottom: 1px solid var(--border);
  opacity: .55; transition: opacity .4s;
}
.era-step:last-child { border-bottom: none; }
.era-step-active, .era-step.is-visible { opacity: 1; }
.era-num {
  position: relative; z-index: 1;
  font-family: var(--font-mono); font-size: .85rem; font-weight: 600;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 12px; flex-shrink: 0;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted); letter-spacing: .02em;
  transition: color .4s, border-color .4s, background .4s;
}
.era-step-active .era-num {
  border-color: color-mix(in oklab, var(--primary) 45%, var(--border));
  background: color-mix(in oklab, var(--primary) 14%, var(--surface));
  color: var(--secondary);
}
.era-tag {
  display: inline-block; margin-bottom: 8px;
  font-family: var(--font-mono); font-size: .72rem;
  color: var(--muted); letter-spacing: .06em; text-transform: uppercase;
}
.era-tag-now { color: var(--secondary); }
.era-content h3 {
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700;
  margin: 0 0 8px; letter-spacing: -.02em;
}
.era-content p { margin: 0; color: var(--text-soft); max-width: 52ch; line-height: 1.75; font-size: 1rem; }
.era-link {
  display: inline-flex; margin-top: 16px;
  color: var(--primary); font-weight: 600; font-size: .9rem;
  transition: gap .2s;
}
.era-link:hover { text-decoration: underline; }

/* Manifesto */
.manifesto {
  padding: clamp(48px, 8vw, 80px) 0;
  border-block: 1px solid var(--border);
  background: color-mix(in oklab, var(--primary) 6%, var(--bg));
}
.manifesto blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 700; line-height: 1.25; letter-spacing: -.02em;
  text-align: center; max-width: 24ch; margin-inline: auto;
}
.manifesto em {
  font-style: normal;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Course grid */
.course-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
.course-card {
  display: flex; flex-direction: column;
  padding: 28px 28px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: color-mix(in oklab, var(--surface) 88%, var(--card));
  backdrop-filter: blur(12px);
  transition: transform .22s ease, border-color .22s, box-shadow .22s;
}
.course-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border-strong));
  box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
}
.course-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.course-index {
  display: inline-grid; place-items: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 10px;
  font-family: var(--font-mono); font-size: .8rem; font-weight: 600;
  color: var(--secondary);
  background: color-mix(in oklab, var(--secondary) 10%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--secondary) 25%, var(--border));
}
.course-tag {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 500;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted); letter-spacing: .04em; text-transform: uppercase;
}
.course-card h3 {
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 700;
  margin: 0 0 12px; letter-spacing: -.02em; line-height: 1.3;
  color: var(--text);
}
.course-card p {
  margin: 0; flex: 1;
  color: var(--text-soft); line-height: 1.75; font-size: 1rem;
}
.course-cta {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border);
  font-weight: 600; font-size: .95rem; color: var(--primary);
  transition: gap .2s, color .2s;
}
.course-cta:hover { gap: 10px; color: var(--secondary); }

.course-card:nth-child(1) { border-top: 3px solid var(--primary); }
.course-card:nth-child(2) { border-top: 3px solid var(--secondary); }
.course-card:nth-child(3) { border-top: 3px solid var(--accent-2); }
.course-card:nth-child(4) { border-top: 3px solid var(--accent); }

/* Services split */
.split-layout { display: grid; gap: 48px; align-items: start; }
.split-aside {
  padding: 32px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(12px);
}
.split-aside .section-index { display: block; margin-bottom: 12px; }
.split-aside h2 { margin-bottom: 16px; }
.split-aside .section-lead { margin-bottom: 24px; }
.service-stack { display: grid; gap: 12px; }
.service-item {
  display: grid; grid-template-columns: auto 1fr; gap: 20px;
  padding: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  backdrop-filter: blur(10px);
  transition: border-color .2s, transform .2s;
}
.service-item:hover {
  border-color: color-mix(in oklab, var(--primary) 35%, var(--border));
  transform: translateX(4px);
}
.service-num {
  font-family: var(--font-mono); font-size: .75rem; font-weight: 500;
  color: var(--primary); padding-top: 4px;
}
.service-item h3 {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  margin: 0 0 6px; letter-spacing: -.01em;
}
.service-item p { margin: 0; color: var(--text-soft); font-size: 1rem; line-height: 1.75; }

/* Approach */
.approach-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.approach-card {
  padding: 28px; border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  transition: transform .25s, border-color .25s;
}
.approach-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.approach-card-accent {
  background: linear-gradient(160deg, color-mix(in oklab, var(--accent) 12%, var(--card)), var(--card));
  border-color: color-mix(in oklab, var(--accent) 25%, var(--border));
}
.approach-icon {
  font-family: var(--font-mono); font-size: .75rem; font-weight: 500;
  color: var(--secondary); margin-bottom: 16px;
}
.approach-card h3 {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 700;
  margin: 0 0 8px;
}
.approach-card p { margin: 0; color: var(--text-soft); font-size: .98rem; line-height: 1.75; }

/* Pricing */
.pricing-layout {
  display: grid; gap: 24px;
  grid-template-columns: 1fr;
}
.pricing-highlight {
  padding: 36px; border-radius: var(--radius);
  border: 1px solid color-mix(in oklab, var(--primary) 35%, var(--border));
  background: linear-gradient(160deg, color-mix(in oklab, var(--primary) 12%, var(--card)), var(--card));
}
.pricing-badge {
  display: inline-block; margin-bottom: 20px;
  padding: 6px 12px; border-radius: 999px;
  background: color-mix(in oklab, var(--primary) 20%, transparent);
  border: 1px solid color-mix(in oklab, var(--primary) 30%, var(--border));
  font-size: .78rem; font-weight: 600; color: var(--primary);
  letter-spacing: .04em; text-transform: uppercase;
}
.pricing-amount { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pricing-from { font-size: .9rem; color: var(--muted); }
.pricing-value {
  font-family: var(--font-display); font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800; letter-spacing: -.04em; line-height: 1;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pricing-unit { font-size: .95rem; color: var(--muted); }
.pricing-note { margin: 0 0 24px; color: var(--muted); font-size: .9rem; }
.pricing-perks {
  margin: 0; padding: 0; list-style: none; display: grid; gap: 10px;
}
.pricing-perks li {
  display: flex; align-items: center; gap: 10px;
  font-size: .92rem; color: var(--muted);
}
.pricing-perks li::before {
  content: "→"; color: var(--secondary); font-weight: 700;
}
.pricing-courses {
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--card); overflow: hidden;
}
.pricing-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  transition: background .15s, padding-left .2s;
}
.pricing-row:last-child { border-bottom: none; }
.pricing-row:hover { background: color-mix(in oklab, var(--primary) 8%, var(--surface)); padding-left: 28px; }
.pricing-row-name { font-weight: 600; font-size: .95rem; }
.pricing-row-price {
  font-family: var(--font-mono); font-size: .85rem; color: var(--muted); white-space: nowrap;
}
.pricing-row-dev .pricing-row-price { color: var(--secondary); }

/* FAQ */
.faq-list {
  display: grid; gap: 10px;
  max-width: 780px;
}
.faq-item {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  backdrop-filter: blur(10px);
  transition: border-color .2s, box-shadow .2s;
}
.faq-item[open] {
  border-color: color-mix(in oklab, var(--primary) 38%, var(--border));
  box-shadow: 0 8px 28px rgba(0, 0, 0, .2);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 52px 18px 20px;
  font-weight: 600;
  font-size: .98rem;
  line-height: 1.4;
  position: relative;
  user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { content: ""; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 20px; top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: color-mix(in oklab, var(--primary) 12%, var(--surface));
  color: var(--secondary);
  font-size: 1.1rem; font-weight: 600;
  line-height: 1;
  transition: background .15s, transform .2s;
}
.faq-item[open] summary::after {
  content: "−";
  background: color-mix(in oklab, var(--primary) 22%, var(--surface));
}
.faq-item summary:hover::after {
  background: color-mix(in oklab, var(--primary) 20%, var(--surface));
}
.faq-answer {
  padding: 0 20px 20px;
  color: var(--text-soft);
  line-height: 1.75;
  font-size: .98rem;
}
.faq-answer p { margin: 0 0 12px; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer ul {
  margin: 8px 0 12px;
  padding-left: 20px;
  display: grid; gap: 6px;
}
.faq-answer li { color: var(--text-soft); }
.faq-answer strong { color: var(--text); font-weight: 600; }
.faq-answer em { font-style: normal; color: var(--secondary); font-weight: 500; }
.faq-link {
  display: inline-flex;
  font-weight: 600;
  color: var(--primary);
}
.faq-link:hover { text-decoration: underline; }

/* Contact */
.contact-layout { display: grid; gap: 48px; align-items: start; }
.contact-copy .section-index { display: block; margin-bottom: 12px; }
.contact-copy h2 { margin-bottom: 16px; }
.contact-copy .section-lead { margin-bottom: 32px; }
.contact-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.contact-stats div {
  padding: 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--card);
}
.contact-stats strong {
  display: block; font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px;
}
.contact-stats span { font-size: .85rem; color: var(--muted); }

.contact-form {
  padding: 32px; border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--card); backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.form-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 8px; font-weight: 500; font-size: .9rem; }
input[type="text"], input[type="email"], select, textarea {
  background: color-mix(in oklab, var(--bg) 60%, var(--surface));
  color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; box-shadow: var(--ring);
  border-color: color-mix(in oklab, var(--primary) 55%, var(--border));
}
.agree { align-items: center; grid-template-columns: auto 1fr; font-weight: 400; font-size: .85rem; color: var(--muted); }
.form-actions { display: flex; align-items: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.form-status { color: var(--muted); font-size: .9rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 80%, var(--bg));
  margin-top: 0;
}
.footer-inner {
  display: grid; gap: 32px; padding: 48px 0 32px;
}
.footer-tagline { margin: 12px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.footer-links, .socials { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a, .socials a { color: var(--muted); font-weight: 500; font-size: .9rem; transition: color .15s; }
.footer-links a:hover, .socials a:hover { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 0; border-top: 1px solid var(--border); flex-wrap: wrap;
}
.footer-era { font-family: var(--font-mono); letter-spacing: .04em; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 90; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.modal-dialog {
  position: relative; z-index: 1; width: min(520px, 92%);
  margin: 8vh auto; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-title { margin: 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.modal-close {
  background: transparent; border: 1px solid var(--border);
  border-radius: 10px; color: var(--muted); width: 36px; height: 36px; cursor: pointer; font-size: 1.2rem;
}
.modal-close:hover { color: var(--text); background: var(--surface-2); }
.modal-body { display: grid; gap: 14px; padding: 20px; }
.modal-body label { display: grid; gap: 8px; }
.modal-body input {
  background: color-mix(in oklab, var(--bg) 60%, var(--surface));
  color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.modal-body input:focus { outline: none; box-shadow: var(--ring); border-color: var(--primary); }
.modal-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }

.requests { display: grid; gap: 8px; margin-top: 10px; }
.request-item {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 12px 14px;
}
.request-left { display: grid; gap: 4px; }
.request-topic { font-weight: 600; }
.request-date { font-size: .85rem; color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--border);
  font-size: .8rem; font-weight: 600;
}
.badge.success { background: color-mix(in oklab, var(--success) 18%, var(--surface)); border-color: color-mix(in oklab, var(--success) 35%, var(--border)); color: var(--success); }
.badge.progress { background: color-mix(in oklab, var(--primary) 18%, var(--surface)); border-color: color-mix(in oklab, var(--primary) 35%, var(--border)); color: var(--primary); }

.avatar {
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: grid; place-items: center;
  font-weight: 700; cursor: pointer;
}
.avatar[hidden] { display: none !important; }

/* Theme toggle (header icon button only) */
.nav-actions #themeToggle { position: relative; }
.nav-actions #themeToggle::before {
  content: ""; display: inline-block; width: 18px; height: 18px;
  background-color: var(--text);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M21 12.79A9 9 0 1 1 11.21 3A7 7 0 0 0 21 12.79z"/></svg>') no-repeat center / contain;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M21 12.79A9 9 0 1 1 11.21 3A7 7 0 0 0 21 12.79z"/></svg>') no-repeat center / contain;
}
[data-theme="light"] .nav-actions #themeToggle::before {
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="%23000"><circle cx="12" cy="12" r="5"/><rect x="11" y="1" width="2" height="4" rx="1"/><rect x="11" y="19" width="2" height="4" rx="1"/><rect x="1" y="11" width="4" height="2" rx="1"/><rect x="19" y="11" width="4" height="2" rx="1"/></g></svg>') no-repeat center / contain;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="%23000"><circle cx="12" cy="12" r="5"/><rect x="11" y="1" width="2" height="4" rx="1"/><rect x="11" y="19" width="2" height="4" rx="1"/><rect x="1" y="11" width="4" height="2" rx="1"/><rect x="19" y="11" width="4" height="2" rx="1"/></g></svg>') no-repeat center / contain;
}

:where(a, button, input, select, textarea):focus-visible { outline: none; box-shadow: var(--ring); }

/* ── Desktop ── */
@media (min-width: 880px) {
  .nav-links { display: flex; }
  .burger { display: none; }
  .mobile-menu { display: none !important; }
  .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 56px; padding-bottom: 64px; }
  .section-head { grid-template-columns: auto 1fr; align-items: end; gap: 48px; }
  .section-index { padding-bottom: 6px; }
  .era-track { display: block; }
  .era-timeline { padding-left: 28px; }
  .era-step { grid-template-columns: auto 1fr; align-items: start; }
  .course-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .split-layout { grid-template-columns: .85fr 1.15fr; gap: 64px; }
  .split-aside { position: sticky; top: 100px; }
  .pricing-layout { grid-template-columns: .9fr 1.1fr; gap: 24px; align-items: stretch; }
  .contact-layout { grid-template-columns: .85fr 1.15fr; gap: 64px; align-items: start; }
  .contact-copy { position: sticky; top: 100px; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .playground-panes { grid-template-columns: 1fr 1fr; }
  .playground-pane { border-bottom: 0; border-right: 1px solid var(--border); }
  .playground-pane:last-child { border-right: 0; }
  .playground-page .playground-panes {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr);
  }
  .footer-inner { grid-template-columns: 1.2fr 1fr 1fr; align-items: start; }
}


@media (max-width: 879px) {
  .nav-actions .nav-cta-consult { display: none; }
  .terminal-window { transform: none; }
  .site-header .nav { gap: 8px; }
  .site-header .brand { gap: 8px; max-width: calc(100% - 132px); }
  .brand-tag { font-size: .58rem; padding: 2px 6px; }
}

@media (max-width: 640px) {
  .pg-menu-name { display: none; }
  .pg-menu-trigger { padding-right: 8px; }
  .playground-page-bar { padding: 0 12px; gap: 10px; }
  .playground-page-brand > span { display: none; }
  .playground-page-start { gap: 8px; max-width: calc(100% - 52px); }
}

@media (max-width: 420px) {
  .account-menu-trigger-text {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
  }
  .hero-cta .btn { width: 100%; }
  .site-header .brand-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .nav-links a::after,
  .link-bar::after {
    transition: none;
  }
  .nav-links a.is-active::after,
  .nav-links a:hover::after,
  .link-bar:hover::after,
  .link-bar:focus-visible::after {
    transform: scaleX(1);
  }
  .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
  .page-bg-floats { display: none; }
  .page-bg-grid { animation: none; }
  .cpu-wave, .cpu-trace, .cpu-die, .cpu-core, .cpu-pins rect { animation: none; }
}
