:root {
  --amber: #ffb000;
  --amber-bright: #ffc832;
  --amber-dim: #b37800;
  --amber-ghost: rgba(255, 176, 0, 0.06);
  --amber-glow: rgba(255, 176, 0, 0.15);
  --bg: #0a0a08;
  --bg-raised: #111110;
  --bg-input: #0e0e0c;
  --border: #2a2518;
  --border-bright: #3d3222;
  --text: #ffb000;
  --text-bright: #ffe0a0;
  --text-dim: #8a7040;
  --text-off: #4a3a20;
  --green: #40ff90;
  --red: #ff6640;
  --pink: #ff6b9d;
  --font: "IBM Plex Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* ── CRT ── */

.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0, 0, 0, 0.04) 2px, rgba(0, 0, 0, 0.04) 4px
  );
}

.crt-overlay::after {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.4) 100%);
}

/* ── App shell ── */

.app {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh;
  max-height: 100vh;
  padding: 12px;
  gap: 10px;
}

/* ── Topbar ── */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
}

.logo {
  margin: 0;
  color: var(--amber);
  font-size: 0.6rem;
  line-height: 1.15;
  white-space: pre;
  text-shadow: 0 0 10px var(--amber-glow);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
  font-size: 0.8rem;
}

.topbar-nav a {
  color: var(--amber-dim);
  text-decoration: none;
  transition: color 120ms;
}

.topbar-nav a:hover { color: var(--amber); }
.topbar-sep { color: var(--text-off); }

/* ── Main split ── */

.main-area {
  display: grid;
  grid-template-columns: minmax(380px, 48%) 1fr;
  gap: 10px;
  min-height: 0;
}

/* ── Left: Terminal panel ── */

.panel-terminal {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.terminal {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.terminal-dots {
  display: flex;
  gap: 5px;
}

.terminal-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--border-bright);
}

.terminal-title { margin-left: 6px; }

.terminal-context {
  margin-left: auto;
  color: var(--green);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.terminal-status {
  margin-left: 10px;
  color: var(--text-off);
  font-size: 0.7rem;
}

.terminal-body {
  flex: 1;
  padding: 16px 20px;
  background: var(--bg);
  overflow-y: auto;
  min-height: 0;
}

.prompt-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.prompt-user { color: var(--amber-bright); }
.prompt-sep, .prompt-host { color: var(--amber-dim); }
.prompt-path { color: var(--amber); margin-right: 8px; }
.typed-command { color: var(--text-bright); }

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  background: var(--amber);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

.output-log { margin-top: 4px; }

.log-line {
  display: flex;
  gap: 8px;
  padding: 1px 0;
  opacity: 0;
  animation: fadein 180ms ease forwards;
  font-size: 0.82rem;
}

.log-tag {
  color: var(--amber-dim);
  flex-shrink: 0;
  min-width: 12ch;
}

.log-text { color: var(--amber); min-width: 0; word-break: break-word; }

.log-line[data-phase="discovery"] .log-tag { color: var(--amber-dim); }
.log-line[data-phase="discovery"] .log-text { color: var(--amber); }
.log-line[data-phase="decision"] .log-tag { color: var(--amber); }
.log-line[data-phase="decision"] .log-text { color: var(--amber-bright); }
.log-line[data-phase="money"] .log-tag { color: var(--green); }
.log-line[data-phase="money"] .log-text { color: var(--green); }
.log-line[data-phase="ads"] .log-tag { color: var(--text-dim); }
.log-line[data-phase="ads"] .log-text { color: var(--text-dim); font-style: italic; }
.log-line[data-phase="done"] .log-tag { color: var(--text-dim); }
.log-line[data-phase="done"] .log-text { color: var(--text-dim); }
.log-line[data-phase="love"] .log-tag { color: var(--pink); }
.log-line[data-phase="love"] .log-text { color: var(--pink); }

.log-table {
  margin: 2px 0;
  color: var(--amber-dim);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre;
  overflow-x: auto;
}

.replay-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 14px;
  border: 1px solid var(--text-off);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 120ms, border-color 120ms;
}

.replay-btn:hover {
  color: var(--amber);
  border-color: var(--amber-dim);
}

/* Scenario bar */

.scenario-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  flex-shrink: 0;
}

.scenario-label {
  color: var(--text-off);
  font-size: 0.72rem;
  margin-right: 4px;
  white-space: nowrap;
}

.scenario-btn {
  padding: 5px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 120ms, border-color 120ms, background 120ms;
}

.scenario-btn:hover {
  color: var(--amber);
  border-color: var(--border);
  background: var(--amber-ghost);
}

.scenario-btn.active {
  color: var(--amber-bright);
  border-color: var(--amber-dim);
  background: var(--amber-ghost);
}

/* ── Right: Website panel ── */

.panel-website {
  overflow-y: auto;
  padding: 28px 32px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  min-height: 0;
}

.hero-section {
  position: relative;
  margin-bottom: 32px;
  min-height: 320px;
  display: flex;
  align-items: flex-start;
  padding-top: 24px;
}

.network-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 50%;
}

.hero-content h1 {
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.3;
  text-shadow: 0 0 20px rgba(255, 176, 0, 0.35), 0 0 60px rgba(255, 176, 0, 0.08);
}

.hero-sub {
  margin-top: 12px;
  color: var(--amber-dim);
  font-size: 0.85rem;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.cta-btn {
  padding: 10px 24px;
  border: 1px solid var(--amber);
  background: var(--amber);
  color: var(--bg);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
  white-space: nowrap;
}

.cta-btn:hover {
  background: var(--amber-bright);
  border-color: var(--amber-bright);
}

.cta-btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.cta-stat {
  color: var(--text-off);
  font-size: 0.72rem;
}

.hero-vision {
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-style: italic;
  border-left: 2px solid var(--border-bright);
  padding-left: 12px;
}

/* How it works */

.how-section {
  margin-bottom: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.how-section h2 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-bright);
  text-shadow: 0 0 10px var(--amber-glow);
  margin-bottom: 24px;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.step {
  padding-bottom: 16px;
}

.step-num {
  display: block;
  color: var(--text-off);
  font-size: 0.7rem;
  margin-bottom: 4px;
}

.step-ascii {
  margin: 0 0 8px;
  color: var(--amber-dim);
  font-size: 0.7rem;
  line-height: 1.35;
  white-space: pre;
  min-height: 8.2em;
  height: 8.2em;
  overflow: hidden;
  text-shadow: 0 0 8px rgba(255, 176, 0, 0.15);
}

.step h3 {
  color: var(--amber);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.step p {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.6;
}

/* Trust section */

.trust-section {
  margin-bottom: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.trust-section h2 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-bright);
  text-shadow: 0 0 10px var(--amber-glow);
  margin-bottom: 8px;
}

.trust-desc {
  color: var(--amber-dim);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.trust-ledger {
  margin: 0;
  color: var(--amber-dim);
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre;
  overflow-x: auto;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
}

/* ── Bottom bar ── */

.bottombar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  gap: 16px;
}

.waitlist-form {
  display: flex;
  align-items: center;
  gap: 0;
}

.waitlist-label {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 500;
  margin-right: 10px;
  white-space: nowrap;
}

.waitlist-form input {
  padding: 5px 10px;
  border: 1px solid var(--border-bright);
  border-right: none;
  background: var(--bg-input);
  color: var(--amber-bright);
  font: inherit;
  font-size: 0.78rem;
  outline: none;
  width: 180px;
}

.waitlist-form input::placeholder { color: var(--text-off); }
.waitlist-form input:focus { border-color: var(--amber-dim); }

.waitlist-form button {
  padding: 5px 14px;
  border: 1px solid var(--amber-dim);
  background: var(--amber);
  color: var(--bg);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms;
}

.waitlist-form button:hover { background: var(--amber-bright); }

.bottombar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--text-off);
}

.bottombar-right strong { color: var(--amber-dim); }
.bottombar-sep { color: var(--border-bright); }

.confirmation {
  color: var(--green);
  font-size: 0.78rem;
  white-space: nowrap;
}

/* ── Focus ── */

.scenario-btn:focus-visible,
.replay-btn:focus-visible,
.waitlist-form button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.topbar-nav a:focus-visible,
#waitlist-link:focus-visible {
  outline: 1px solid var(--amber-dim);
  outline-offset: 2px;
}

.waitlist-form input:focus-visible {
  border-color: var(--amber);
}

/* ── Keyframes ── */

@keyframes blink { 50% { opacity: 0; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ── Scrollbars ── */

.terminal-body::-webkit-scrollbar,
.panel-website::-webkit-scrollbar {
  width: 4px;
}

.terminal-body::-webkit-scrollbar-track,
.panel-website::-webkit-scrollbar-track {
  background: var(--bg);
}

.terminal-body::-webkit-scrollbar-thumb,
.panel-website::-webkit-scrollbar-thumb {
  background: var(--text-off);
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; opacity: 1; }
  .log-line { animation: none; opacity: 1; }
}

/* ── Mobile ── */

@media (max-width: 768px) {
  html, body { overflow: auto; height: auto; }

  .crt-overlay { background: none; }

  .app {
    height: auto;
    max-height: none;
    padding: 8px;
    gap: 8px;
  }

  .main-area {
    grid-template-columns: 1fr;
  }

  .panel-terminal {
    height: 55vh;
    min-height: 300px;
    max-height: 55vh;
  }

  .scenario-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .panel-website {
    overflow-y: visible;
    overflow-x: hidden;
    padding: 20px 16px;
  }

  .hero-content { max-width: 100%; }

  .hero-cta { flex-wrap: wrap; }

  .hero-section { min-height: auto; padding-top: 16px; }

  .hero-content h1 { font-size: 1.2rem; }

  .network-canvas { display: none; }

  .trust-ledger { font-size: 0.65rem; }

  .steps-grid { grid-template-columns: 1fr; gap: 16px; }

  .bottombar {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .waitlist-form input { width: 140px; }

  .topbar { flex-direction: column; gap: 6px; }

  .scenario-bar { flex-wrap: wrap; }
}
