/* ============================================
   Magic Cursor — Landing
   ============================================ */

:root {
  --bg:        oklch(0.135 0.012 250);
  --bg-2:      oklch(0.17  0.013 250);
  --surface:   oklch(0.195 0.014 250);
  --surface-2: oklch(0.225 0.015 250);
  --border:    oklch(0.30  0.018 250);
  --border-2:  oklch(0.40  0.020 250);
  --fg:        oklch(0.975 0.006 250);
  --fg-muted:  oklch(0.68  0.013 250);
  --fg-dim:    oklch(0.48  0.012 250);
  --accent-h:  205;
  --accent:    oklch(0.82 0.155 var(--accent-h));
  --accent-2:  oklch(0.72 0.180 var(--accent-h));
  --accent-soft: oklch(0.82 0.155 var(--accent-h) / 0.18);
  --accent-glow: oklch(0.82 0.155 var(--accent-h) / 0.35);
  --warn:      oklch(0.82 0.16  85);
  --danger:    oklch(0.72 0.20  25);
  --ok:        oklch(0.80 0.17 150);

  --maxw: 1240px;
  --pad-x: clamp(20px, 4vw, 56px);
  --section-y: clamp(80px, 11vw, 140px);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 1200px 600px at 50% -10%, oklch(0.82 0.155 var(--accent-h) / 0.10), transparent 60%),
    radial-gradient(ellipse 800px 500px at 10% 30%, oklch(0.72 0.18 var(--accent-h) / 0.05), transparent 60%),
    var(--bg);
}

/* Backdrop pattern (toggleable via data-bg) */
body[data-bg="dots"]::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, oklch(1 0 0 / 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
  z-index: 0;
}
body[data-bg="grid"]::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(oklch(1 0 0 / 0.035) 1px, transparent 1px),
    linear-gradient(90deg, oklch(1 0 0 / 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 90%);
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  position: relative;
  z-index: 1;
}

/* ============================================
   Type
   ============================================ */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }

.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
  letter-spacing: 0.01em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px; height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* ============================================
   Nav
   ============================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(1.4);
  background: oklch(0.135 0.012 250 / 0.7);
  border-bottom: 1px solid oklch(1 0 0 / 0.06);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.08), 0 0 0 1px oklch(0 0 0 / 0.4);
}
.brand-mark svg { width: 14px; height: 14px; color: var(--accent); }
.brand-text { font-size: 15px; }
.brand-text small {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-dim);
  margin-left: 8px;
  letter-spacing: 0.1em;
}

.nav-links {
  display: flex; gap: 28px;
  font-size: 13px;
  color: var(--fg-muted);
}
.nav-links a { color: inherit; text-decoration: none; transition: color .15s; }
.nav-links a:hover { color: var(--fg); }
@media (max-width: 720px) { .nav-links { display: none; } }

.nav-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  text-decoration: none;
  transition: all .15s;
}
.nav-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ============================================
   Hero
   ============================================ */

.hero {
  padding: clamp(60px, 9vw, 110px) 0 var(--section-y);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.hero h1 {
  font-size: clamp(48px, 7.5vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  font-weight: 500;
  margin-top: 22px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
}

.hero-sub {
  margin-top: 28px;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 52ch;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 38px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all .18s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--fg);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 12px 32px -8px var(--accent-glow);
}
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-2);
}
.btn-ghost:hover {
  border-color: var(--fg-muted);
  background: oklch(1 0 0 / 0.03);
}
.btn .arrow {
  transition: transform .18s;
}
.btn:hover .arrow { transform: translateX(3px); }

.hero-meta {
  margin-top: 40px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}

/* ============================================
   Hero demo (right side)
   ============================================ */

.demo-stage {
  position: relative;
  aspect-ratio: 4 / 3.2;
  min-height: 380px;
}

.demo-frame {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, oklch(0.22 0.013 250), oklch(0.16 0.012 250));
  border: 1px solid var(--border);
  box-shadow:
    0 30px 80px -20px oklch(0 0 0 / 0.6),
    inset 0 1px 0 oklch(1 0 0 / 0.05);
  overflow: hidden;
}

/* Fake desktop inside the frame */
.desktop {
  position: absolute;
  inset: 14px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, oklch(0.21 0.02 240) 0%, oklch(0.17 0.018 280) 100%);
  overflow: hidden;
}
.desktop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, oklch(0.82 0.155 var(--accent-h) / 0.18), transparent 40%),
    radial-gradient(circle at 80% 80%, oklch(0.72 0.18 var(--accent-h) / 0.15), transparent 45%);
  pointer-events: none;
}

/* Document mock inside desktop */
.doc {
  position: absolute;
  top: 30px; left: 32px;
  width: 58%;
  background: oklch(0.97 0.005 250);
  color: oklch(0.2 0.01 250);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 18px 40px -10px oklch(0 0 0 / 0.6);
  font-size: 11px;
  line-height: 1.6;
}
.doc-title {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(0.5 0.01 250);
  margin-bottom: 10px;
}
.doc-body { color: oklch(0.3 0.01 250); }
.doc-body .hl {
  background: oklch(0.82 0.155 var(--accent-h) / 0.45);
  color: oklch(0.15 0.01 250);
  padding: 1px 3px;
  border-radius: 3px;
}

.taskbar {
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  height: 28px;
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px;
  background: oklch(0.12 0.012 250 / 0.75);
  border: 1px solid oklch(1 0 0 / 0.06);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}
.taskbar i {
  width: 14px; height: 14px;
  background: oklch(1 0 0 / 0.15);
  border-radius: 3px;
  display: inline-block;
}
.taskbar i:nth-child(2) { background: var(--accent); }

/* Fake cursor */
.cursor {
  position: absolute;
  width: 22px; height: 22px;
  top: 38%; left: 48%;
  transform-origin: 0 0;
  z-index: 5;
  pointer-events: none;
}
.cursor svg {
  width: 100%; height: 100%;
  filter: drop-shadow(0 4px 8px oklch(0 0 0 / 0.6));
}
.cursor::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  opacity: 0;
  z-index: -1;
  transition: opacity .3s;
}
.cursor.shaking::after { opacity: 1; }

/* AI overlay panel */
.ai-overlay {
  position: absolute;
  top: 24%; right: 22px;
  width: 220px;
  background: oklch(0.16 0.013 250 / 0.92);
  backdrop-filter: blur(18px);
  border: 1px solid oklch(1 0 0 / 0.1);
  border-radius: 12px;
  padding: 14px;
  font-size: 11px;
  color: var(--fg);
  box-shadow:
    0 20px 50px -10px oklch(0 0 0 / 0.7),
    0 0 0 1px var(--accent-soft),
    0 0 32px -4px var(--accent-glow);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: all .35s cubic-bezier(.2,.9,.3,1);
  z-index: 6;
}
.ai-overlay.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.ai-overlay-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 10px;
}
.ai-overlay-head .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.7); }
}
.ai-overlay-ctx {
  background: oklch(0.13 0.012 250);
  border: 1px solid oklch(1 0 0 / 0.06);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 10px;
  color: var(--fg-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}
.ai-overlay-ctx::before {
  content: "context";
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--fg-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.ai-overlay-resp {
  line-height: 1.5;
  font-size: 11px;
  color: var(--fg);
  min-height: 56px;
}
.ai-overlay-resp .typed::after {
  content: "▌";
  color: var(--accent);
  margin-left: 1px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.ai-overlay-chips {
  display: flex; gap: 5px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.ai-overlay-chips span {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 3px 7px;
  border-radius: 999px;
  background: oklch(1 0 0 / 0.06);
  color: var(--fg-muted);
  border: 1px solid oklch(1 0 0 / 0.05);
}

/* Motion path indicator (shake trail) */
.shake-trail {
  position: absolute;
  top: 38%; left: 38%;
  width: 90px; height: 4px;
  pointer-events: none;
  opacity: 0;
  z-index: 4;
}
.shake-trail.visible { opacity: 1; }
.shake-trail svg { width: 100%; height: 100%; overflow: visible; }

/* HUD on demo */
.demo-hud {
  position: absolute;
  top: 14px; left: 14px;
  display: flex; gap: 8px;
  z-index: 8;
}
.demo-hud .tl {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: oklch(0.35 0.02 30);
}
.demo-hud .tl:nth-child(2) { background: oklch(0.35 0.02 80); }
.demo-hud .tl:nth-child(3) { background: oklch(0.35 0.02 150); }

.demo-caption {
  position: absolute;
  bottom: 14px; left: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: flex; gap: 10px; align-items: center;
  z-index: 8;
}
.demo-caption .step {
  padding: 3px 8px;
  border-radius: 4px;
  background: oklch(0 0 0 / 0.4);
  border: 1px solid oklch(1 0 0 / 0.07);
}
.demo-caption .step.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.demo-replay {
  position: absolute;
  bottom: 14px; right: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: oklch(0 0 0 / 0.4);
  border: 1px solid oklch(1 0 0 / 0.08);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  z-index: 8;
  transition: all .15s;
}
.demo-replay:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================
   Spec strip
   ============================================ */

.spec-strip {
  border-block: 1px solid oklch(1 0 0 / 0.06);
  padding: 22px 0;
  background: oklch(0 0 0 / 0.2);
}
.spec-strip-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
@media (max-width: 720px) {
  .spec-strip-inner { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
.spec {
  display: flex; flex-direction: column;
  gap: 4px;
}
.spec-k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.spec-v {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.spec-v small {
  font-size: 12px; color: var(--fg-muted);
  margin-left: 4px;
  font-family: var(--font-mono);
}

/* ============================================
   Section heading
   ============================================ */

section { padding: var(--section-y) 0; position: relative; }

.sect-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}
.sect-head h2 {
  font-size: clamp(34px, 4.5vw, 56px);
  line-height: 1;
  letter-spacing: -0.025em;
  max-width: 16ch;
}
.sect-head p {
  color: var(--fg-muted);
  max-width: 40ch;
  font-size: 16px;
  line-height: 1.55;
}

/* ============================================
   Modes section
   ============================================ */

.modes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1000px) { .modes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .modes-grid { grid-template-columns: 1fr; } }

.mode {
  position: relative;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border-radius: var(--radius-lg);
  padding: 24px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  transition: all .25s;
  overflow: hidden;
}
.mode::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% -10%, var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity .25s;
}
.mode:hover {
  border-color: var(--border-2);
  transform: translateY(-3px);
}
.mode:hover::before { opacity: 1; }

.mode-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--fg-dim);
  margin-bottom: 8px;
}
.mode h3 {
  font-size: 22px;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.mode p {
  color: var(--fg-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.mode-vis {
  margin-top: auto;
  padding-top: 20px;
  height: 110px;
  display: flex;
  align-items: flex-end;
  position: relative;
  z-index: 1;
}

/* Mode-specific tiny visuals */
.mv-ask {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  display: flex; align-items: center; gap: 8px;
}
.mv-ask::before {
  content: "›";
  color: var(--accent);
}
.mv-act {
  width: 100%; display: flex; flex-direction: column; gap: 5px;
  font-family: var(--font-mono); font-size: 10px;
}
.mv-act .row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.mv-act .row .ok { color: var(--ok); }
.mv-act .row .wait { color: var(--warn); }
.mv-act .row .pad { flex: 1; }
.mv-bub {
  width: 100%; display: flex; justify-content: center; align-items: center;
}
.mv-bub .pill {
  background: oklch(0.16 0.013 250 / 0.9);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 11px;
  color: var(--fg);
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 0 20px var(--accent-glow);
}
.mv-bub .pill::before {
  content: ""; width: 6px; height: 6px;
  background: var(--accent); border-radius: 50%;
  box-shadow: 0 0 6px var(--accent);
}
.mv-chip {
  width: 100%; display: flex; gap: 5px; flex-wrap: wrap;
}
.mv-chip .c {
  font-family: var(--font-mono); font-size: 10px;
  padding: 5px 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-muted);
}
.mv-chip .c.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================
   Tools section
   ============================================ */

.tools-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}
@media (max-width: 960px) { .tools-wrap { grid-template-columns: 1fr; } }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.tool {
  background: var(--bg-2);
  padding: 22px 22px;
  position: relative;
  transition: background .2s;
}
.tool:hover { background: var(--surface); }
.tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.tool-name {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg);
}
.tool-risk {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
}
.tool-risk[data-risk="safe"]  { color: var(--ok); background: oklch(0.80 0.17 150 / 0.12); }
.tool-risk[data-risk="ask"]   { color: var(--warn); background: oklch(0.82 0.16 85 / 0.12); }
.tool-risk[data-risk="audit"] { color: var(--danger); background: oklch(0.72 0.20 25 / 0.12); }

.tool h4 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.tool p {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
}
.tool ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex; flex-wrap: wrap; gap: 4px 8px;
}
.tool ul li {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-dim);
}
.tool ul li::before { content: "·"; margin-right: 6px; color: var(--fg-dim); }

.tools-side h3 {
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.tools-side p {
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 18px;
}
.tools-side .legend {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}
.tools-side .legend .lg {
  display: flex; align-items: center; gap: 10px;
}
.tools-side .legend .sw {
  font-size: 8px; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px;
}

/* ============================================
   Local section
   ============================================ */

.local {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 600px 300px at 80% 50%, var(--accent-soft), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--surface));
  padding: clamp(40px, 6vw, 70px);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
  overflow: hidden;
  position: relative;
}
@media (max-width: 880px) { .local { grid-template-columns: 1fr; } }

.local h2 {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.local h2 em {
  font-style: normal;
  color: var(--accent);
}
.local p {
  margin-top: 22px;
  color: var(--fg-muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 50ch;
}

.local-stats {
  display: grid;
  gap: 18px;
}
.local-stat {
  border: 1px solid var(--border-2);
  background: oklch(0 0 0 / 0.3);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex; align-items: center; gap: 18px;
}
.local-stat .icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  display: grid; place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.local-stat .icon svg { width: 18px; height: 18px; }
.local-stat .lbl {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-dim);
}
.local-stat .val {
  font-size: 17px; margin-top: 2px;
  color: var(--fg);
}

/* ============================================
   How it works
   ============================================ */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  position: relative;
}
@media (max-width: 880px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

.step-card {
  padding: 28px 24px 32px;
  border-right: 1px dashed var(--border);
  position: relative;
}
.step-card:last-child { border-right: none; }
@media (max-width: 880px) {
  .step-card:nth-child(2) { border-right: none; }
}

.step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.step-num::after {
  content: "";
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.step-card h3 {
  font-size: 24px;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.step-card p {
  color: var(--fg-muted);
  font-size: 14px;
  line-height: 1.55;
}
.step-card .meta {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

/* ============================================
   Session history
   ============================================ */

.hist-wrap {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 60px;
  align-items: start;
}
@media (max-width: 960px) { .hist-wrap { grid-template-columns: 1fr; } }

.hist-side h3 {
  font-size: 26px;
  letter-spacing: -0.018em;
  margin-bottom: 18px;
}
.hist-side p {
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.hist-side .keys {
  margin-top: 26px;
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}
.hist-side .keys .row {
  display: flex; align-items: center; gap: 12px;
}
.hist-side .keys kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--fg);
  min-width: 24px;
  text-align: center;
}

.hist-panel {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 30px 80px -20px oklch(0 0 0 / 0.55),
    inset 0 1px 0 oklch(1 0 0 / 0.05);
}
.hist-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: oklch(0 0 0 / 0.25);
}
.hist-panel-head .h-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg);
  display: flex; align-items: center; gap: 10px;
}
.hist-panel-head .h-title .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.hist-panel-head .h-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 0.14em;
}

.hist-list { display: flex; flex-direction: column; }
.hist-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid oklch(1 0 0 / 0.04);
  align-items: center;
  transition: background .15s;
  cursor: pointer;
}
.hist-item:last-child { border-bottom: none; }
.hist-item:hover { background: oklch(1 0 0 / 0.025); }
.hist-item.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.hist-thumb {
  width: 56px; height: 42px;
  border-radius: 6px;
  background: linear-gradient(135deg, oklch(0.22 0.02 240), oklch(0.16 0.018 280));
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.hist-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, transparent 49%, oklch(1 0 0 / 0.05) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, oklch(1 0 0 / 0.05) 50%, transparent 51%);
  background-size: 8px 8px;
}
.hist-thumb.code  { background: linear-gradient(135deg, oklch(0.22 0.05 280), oklch(0.18 0.04 250)); }
.hist-thumb.text  { background: linear-gradient(135deg, oklch(0.95 0.005 250), oklch(0.85 0.01 250)); color: oklch(0.3 0.01 250);}
.hist-thumb.image { background: linear-gradient(135deg, oklch(0.4 0.1 60), oklch(0.3 0.12 30)); }
.hist-thumb.url   { background: linear-gradient(135deg, oklch(0.4 0.13 200), oklch(0.28 0.08 240)); }

.hist-body {
  min-width: 0;
}
.hist-tags {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 5px;
}
.hist-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: oklch(1 0 0 / 0.06);
  color: var(--fg-muted);
}
.hist-tag.t-code  { color: var(--accent); background: var(--accent-soft); }
.hist-tag.t-image { color: var(--warn); background: oklch(0.82 0.16 85 / 0.14); }
.hist-tag.t-url   { color: var(--ok); background: oklch(0.80 0.17 150 / 0.14); }
.hist-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 0.08em;
}
.hist-q {
  font-size: 14px;
  color: var(--fg);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hist-r {
  font-size: 12px;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.hist-side-actions {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
}
.hist-side-actions .tools-mini {
  display: flex; gap: 3px;
}
.hist-side-actions .tools-mini i {
  width: 5px; height: 5px;
  border-radius: 1px;
  background: var(--accent);
  display: inline-block;
}

.hist-panel-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: oklch(0 0 0 / 0.25);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.hist-panel-foot .clear {
  color: var(--danger);
  cursor: pointer;
  background: none; border: none;
  font: inherit;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 10px;
}
.hist-panel-foot .clear:hover { text-decoration: underline; }

/* ============================================
   Form
   ============================================ */

.form-section {
  padding-bottom: calc(var(--section-y) + 20px);
}

.form-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, var(--surface), var(--bg-2));
  padding: clamp(36px, 5vw, 64px);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.form-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), transparent 40%, transparent 60%, var(--accent-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.5;
}
@media (max-width: 880px) {
  .form-card { grid-template-columns: 1fr; gap: 36px; }
}

.form-left h2 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.025em;
}
.form-left p {
  margin-top: 18px;
  color: var(--fg-muted);
  line-height: 1.6;
  font-size: 15px;
  max-width: 40ch;
}
.form-perks {
  margin-top: 28px;
  display: flex; flex-direction: column; gap: 10px;
}
.form-perks li {
  list-style: none;
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px;
  color: var(--fg);
}
.form-perks li svg {
  width: 14px; height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}
.form-perks li small {
  color: var(--fg-dim);
  margin-left: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form {
  display: flex; flex-direction: column; gap: 18px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.field input, .field select {
  font: inherit;
  font-size: 15px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--fg);
  outline: none;
  transition: all .15s;
  width: 100%;
}
.field input:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field input::placeholder { color: var(--fg-dim); }

.field-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

.form .submit {
  margin-top: 6px;
  height: 52px;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: oklch(0.13 0.012 250);
  border: 1px solid var(--accent);
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  overflow: hidden;
}
.form .submit:hover:not(:disabled) {
  box-shadow: 0 0 0 4px var(--accent-soft), 0 12px 32px -10px var(--accent-glow);
  transform: translateY(-1px);
}
.form .submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-error {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--danger);
  margin-top: -4px;
}
.field input[aria-invalid="true"] { border-color: var(--danger); }

.form-disclaimer {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  line-height: 1.6;
  text-transform: uppercase;
}

.form-success {
  display: flex; flex-direction: column; gap: 14px;
  padding: 28px;
  text-align: center;
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
}
.form-success .check {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: grid; place-items: center;
  margin: 0 auto;
}
.form-success h3 {
  font-size: 22px;
}
.form-success .your-place {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  letter-spacing: 0.12em;
}
.form-success .your-place strong {
  color: var(--accent);
  font-size: 16px;
  margin-left: 6px;
  letter-spacing: 0;
}

/* ============================================
   Footer
   ============================================ */

footer {
  border-top: 1px solid oklch(1 0 0 / 0.06);
  padding: 30px 0 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}
footer .crumbs { display: flex; gap: 18px; }

/* ============================================
   Utility
   ============================================ */

.flicker {
  animation: flicker 4s linear infinite;
}
@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: 0.7; }
  94% { opacity: 1; }
  96% { opacity: 0.55; }
  97% { opacity: 1; }
}
