/* JustAsk live demo — self-contained dark + single cyan accent.
   Design goal: SIMPLE + CLEAR. A visitor should understand the work, not be wowed.
   Derived from the picked "dark-neon" direction but deliberately stripped of glow /
   gradient / grid flourishes. Flat surfaces, 1px borders, one accent, legible type. */

:root {
  --bg: #0d0e12;          /* flat page */
  --surface: #15171c;     /* panels / cards */
  --surface-2: #1b1e25;   /* nested (round bodies, code) */
  --fg: #e9e9ec;
  --muted: #9498a3;
  --muted-2: #6a6e79;
  --border: #262932;
  --border-2: #323641;

  --accent: #38e8ff;      /* the one accent */
  --accent-deep: #0fb8d4;
  --accent-ink: #04212a;  /* text on accent */
  --accent-soft: rgba(56, 232, 255, 0.10);

  --alert: #ff5b7f;       /* breach only */
  --alert-soft: rgba(255, 91, 127, 0.12);

  --sans: 'Space Grotesk', -apple-system, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --r: 10px;              /* one radius */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);            /* flat — no radial gradients, no grid overlay */
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 28px; }
[hidden] { display: none !important; }

/* ---- buttons ---- */
button { font: inherit; cursor: pointer; border-radius: 8px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid var(--accent); padding: 11px 20px; font-weight: 600;
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-primary:disabled { opacity: 0.55; cursor: default; }
.btn-secondary {
  background: transparent; color: var(--fg);
  border: 1px solid var(--border-2); padding: 10px 18px; font-weight: 500;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ---- top nav ---- */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; border-bottom: 1px solid var(--border);
}
.logo { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 9px; }
.logo .mk { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.topnav nav a { color: var(--muted); font-size: 14px; margin-left: 22px; }
.topnav nav a:hover { color: var(--fg); text-decoration: none; }

/* ---- hero ---- */
.hero { padding: 64px 0 40px; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 16px;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 66px); line-height: 1.05; letter-spacing: -0.02em;
  margin: 0 0 20px; max-width: 18ch;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: 18px; color: var(--muted); max-width: 60ch; margin: 0 0 26px; }
.hero .cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 26px; }
.badges { display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px;
}
.badge b { color: var(--fg); font-weight: 600; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---- how-it-works (comprehension scaffold) ---- */
.how { border-top: 1px solid var(--border); padding: 36px 0 8px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step-card { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 20px; }
.step-card .n {
  font-family: var(--mono); font-size: 12px; color: var(--accent-ink);
  background: var(--accent); width: 24px; height: 24px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 12px;
}
.step-card h3 { font-size: 16px; margin: 0 0 6px; }
.step-card p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.5; }

/* ---- section heads ---- */
.section { padding: 52px 0; }
.section + .section { border-top: 1px solid var(--border); }
.shead { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.stitle { font-size: 32px; letter-spacing: -0.02em; margin: 0 0 10px; line-height: 1.1; }
.slede { color: var(--muted); margin: 0 0 28px; max-width: 64ch; font-size: 15.5px; }
.snote { color: var(--muted-2); margin: 16px 0 0; max-width: 64ch; font-size: 13px; }

/* ---- panel (terminal look, no traffic-dots flourish) ---- */
.panel { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.panel-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.panel-bar .ptitle { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.03em; }
.panel-body { padding: 18px; }

/* ---- replay / live console grid ---- */
.console-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .console-grid, .how-grid { grid-template-columns: 1fr; } }

.fld-row { margin-bottom: 16px; }
label.fld { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 7px; }
select, textarea {
  width: 100%; background: var(--surface-2); color: var(--fg);
  border: 1px solid var(--border-2); border-radius: 8px; padding: 10px 12px;
  font: 14px/1.5 var(--mono); resize: vertical;
}
select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 96px; }
.fire-row { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.fire-row .hint { font-family: var(--mono); font-size: 12px; color: var(--muted-2); }

/* ---- replay picker ---- */
.replay-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.replay-pick select { width: auto; min-width: 320px; flex: 1; }

/* ---- gauge (flat, no glow) ---- */
.gauge { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 16px 18px; margin-bottom: 16px; }
.gauge-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.gauge .lab { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.gauge-score { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--accent); }
.gauge-score small { font-size: 14px; color: var(--muted-2); font-weight: 400; }
.gauge-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.gauge-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.25s ease; }
.gauge[data-tier="full"] .gauge-fill, .gauge[data-tier="partial"] .gauge-fill { background: var(--alert); }
.gauge[data-tier="full"] .gauge-score, .gauge[data-tier="partial"] .gauge-score { color: var(--alert); }
.tiers-mini { display: flex; gap: 14px; margin-top: 10px; font-family: var(--mono); font-size: 11px; color: var(--muted-2); }
.tiers-mini .on { color: var(--alert); font-weight: 600; }

/* ---- trajectory + rounds (the multi-turn core) ---- */
.traj-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.traj-head .lab { font-family: var(--mono); font-size: 12px; color: var(--fg); }
.traj-head .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.traj-rounds { display: flex; flex-direction: column; gap: 10px; }

.round {
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
  padding: 12px 14px; transition: border-color 0.2s ease, opacity 0.2s ease;
}
.round.is-pending { opacity: 0.5; }                 /* unrevealed */
.round.is-live { opacity: 1; border-color: var(--border-2); }
.round.is-breach { border-color: var(--alert); background: var(--alert-soft); }
.round-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.round-no { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent); padding: 2px 7px; border-radius: 5px; }
.round.is-breach .round-no { background: var(--alert); }
.round-skill { font-family: var(--mono); font-size: 12.5px; color: var(--muted); flex: 1; }
.round-sim { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--muted); }
.round.is-breach .round-sim { color: var(--alert); }
/* self-evolution annotation — what the agent is doing this round */
.round-note { font-family: var(--mono); font-size: 11px; color: var(--muted-2); margin-bottom: 9px; letter-spacing: 0.02em; }
.round.is-breach .round-note { color: var(--alert); }
.round.is-custom .round-note { color: var(--accent); }
.round.is-custom .round-no { background: var(--accent-deep); }
/* high-level (multi-turn) skill round — flag it, since its inner turns are collapsed here */
.round.is-highlevel { border-left: 2px solid var(--accent); }
.round.is-highlevel .round-note { color: var(--accent); }
.hl-chip { display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 600; color: var(--accent-ink); background: var(--accent); padding: 1px 6px; border-radius: 4px; letter-spacing: 0.03em; vertical-align: middle; }
.round-bar { height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.round-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.4s ease; }
.round.is-breach .round-bar i { background: var(--alert); }
.round .line { display: flex; gap: 8px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; margin-top: 5px; }
.round .line .who { color: var(--muted-2); flex-shrink: 0; }
.round .line.you .txt { color: var(--fg); }
.round .line.them .txt { color: var(--muted); }
.round .leak { margin-top: 8px; background: var(--surface-2); border: 1px solid var(--alert); border-radius: 7px; padding: 9px 11px; font-family: var(--mono); font-size: 12px; color: var(--alert); white-space: pre-wrap; word-break: break-word; }
/* active-round cursor (subtle, not a glow) */
.round.typing .round-skill::after { content: "▋"; color: var(--accent); margin-left: 4px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- stats ---- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 26px; }
.stat { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 18px 20px; }
.stat .num { font-family: var(--mono); font-size: 30px; font-weight: 700; }
.stat .num.hot { color: var(--alert); }
.stat .lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 180px 1fr 46px; align-items: center; gap: 12px; }
.bar-row .nm { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.bar-row .fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bar-row .val { font-family: var(--mono); font-size: 12.5px; color: var(--fg); text-align: right; }

/* ---- single-shot breadth (CLI agents) ---- */
.breadth-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .breadth-grid { grid-template-columns: 1fr 1fr; } }
.breadth-card { border: 1px dashed var(--border-2); border-radius: var(--r); background: var(--surface); padding: 14px 16px; }
.breadth-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.breadth-agent { font-family: var(--mono); font-size: 13.5px; color: var(--fg); }
.breadth-sim { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--accent); }
.breadth-skill { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; line-height: 1.4; }
.breadth-tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-2); }

/* ---- gallery ---- */
.trace-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 720px) { .trace-grid, .stat-grid { grid-template-columns: 1fr; } }
.case { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 16px 18px; cursor: pointer; display: block; transition: border-color 0.2s ease; }
.case:hover { border-color: var(--accent); text-decoration: none; }
.case-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.case-model { font-family: var(--mono); font-size: 14px; color: var(--fg); }
.case-sim { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.case-sim b { color: var(--accent); }
.case-skill { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }
.case-skill .q { color: var(--fg); }
.case-traj { display: flex; align-items: center; gap: 5px; }
.case-traj .step { width: 22px; height: 5px; border-radius: 999px; background: var(--border-2); }
.case-traj .step.lit { background: var(--accent); }
.case-traj .step.breach { background: var(--alert); }
.case-traj .lbl { font-family: var(--mono); font-size: 11px; color: var(--muted-2); margin-left: 8px; }
.case-open { font-family: var(--mono); font-size: 12px; color: var(--accent); display: inline-block; margin-top: 12px; }

/* ---- modal ---- */
.modal { position: fixed; inset: 0; background: rgba(5, 6, 8, 0.78); display: flex; align-items: flex-start; justify-content: center; padding: 48px 20px; z-index: 50; overflow-y: auto; }
.modal__panel { background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; max-width: 760px; width: 100%; }
.modal__bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal__bar .t { font-family: var(--mono); font-size: 14px; }
.modal__close { background: transparent; border: 1px solid var(--border-2); color: var(--muted); width: 30px; height: 30px; border-radius: 7px; }
.modal__close:hover { border-color: var(--accent); color: var(--accent); }
.modal__body { padding: 18px; }
.modal__meta { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.modal__meta strong { color: var(--fg); }

/* ---- closing + footer (no git-clone flourish) ---- */
.closing { border-top: 1px solid var(--border); padding: 56px 0; text-align: center; }
.closing h2 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 12px; }
.closing h2 .hl { color: var(--accent); }
.closing p { color: var(--muted); max-width: 56ch; margin: 0 auto 22px; }
.foot { display: flex; align-items: center; justify-content: space-between; padding: 26px 0 40px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 13px; color: var(--muted-2); flex-wrap: wrap; gap: 10px; }
.foot a { margin-left: 18px; }

/* reduced motion: drop transitions */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
