/* =========================================================================
   Aether IDE — Frontier Dark (α)
   Obsidian base, near-black surfaces, emerald success, cobalt execution.
   Razor-sharp 1px hairlines. Space Grotesk display + JetBrains Mono UI.
   ========================================================================= */

/* ---- Tokens ------------------------------------------------------------- */
:root {
  /* base surfaces */
  --bg:            #080809;   /* obsidian */
  --surface-0:     #0b0b0d;   /* near-black panel */
  --surface-1:     #0e0e11;   /* raised panel */
  --surface-2:     #131317;   /* controls / rows */
  --surface-hi:    #17171c;   /* hover row */

  /* hairlines */
  --line:          #1f1f24;
  --line-soft:     #17171b;
  --line-strong:   #2a2a31;

  /* text */
  --text:          #e6e7ea;   /* primary */
  --text-dim:      #a2a4ac;   /* secondary — AA on near-black */
  --text-faint:    #6c6e77;   /* tertiary labels */
  --text-ghost:    #45464e;   /* gutters / disabled */

  /* accents (semantic — do not reuse) */
  --exec:          #3b82f6;   /* cobalt: active agent execution paths */
  --exec-dim:      #2b5fb0;
  --exec-wash:     rgba(59,130,246,0.10);
  --success:       #00f5a0;   /* emerald: success / completion only */
  --success-dim:   #0b9c6b;
  --success-wash:  rgba(0,245,160,0.09);
  --warn:          #e2a24a;   /* muted amber: test failure / correction only */
  --warn-wash:     rgba(226,162,74,0.10);
  --danger:        #e2564a;   /* desaturated: hard errors only */

  /* diff */
  --add:           #00f5a0;
  --add-wash:      rgba(0,245,160,0.07);
  --del:           #e2564a;
  --del-wash:      rgba(226,86,74,0.06);

  /* typography */
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  --grotesque: 'Space Grotesk', 'Archivo', system-ui, sans-serif;

  /* rhythm */
  --gutter: 24px;
  --maxw: 1240px;
  --radius: 4px;

  --step: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  font-feature-settings: 'tnum' 1, 'zero' 1; /* tabular figures for metrics */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--grotesque); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; color: inherit; cursor: pointer; }
::selection { background: rgba(0,245,160,0.22); color: #fff; }

svg { display: block; }
.ico { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- Focus ring (keyboard) ---------------------------------------------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--exec);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Layout scaffold ---------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.eyebrow {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-faint); display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow .dot { width: 5px; height: 5px; background: var(--exec); border-radius: 50%; }
.eyebrow--ok .dot { background: var(--success); }

.section { padding-block: clamp(64px, 9vw, 120px); border-top: 1px solid var(--line); }
.section__head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; max-width: 62ch; }
.section__head h2 { font-size: clamp(26px, 3.4vw, 40px); line-height: 1.08; }
.section__lead { color: var(--text-dim); font-size: 14px; max-width: 60ch; }
.section__idx { font-family: var(--mono); color: var(--text-ghost); font-size: 12px; letter-spacing: 0.1em; }

/* =========================================================================
   Top bar
   ========================================================================= */
.topbar {
  position: sticky; top: 0; z-index: 60;
  border-bottom: 1px solid var(--line);
  background: rgba(8,8,9,0.82);
  backdrop-filter: blur(10px);
}
.topbar__in { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--grotesque); font-weight: 600; letter-spacing: -0.02em; font-size: 15px; }
.brand__mark { width: 26px; height: 26px; border: 1px solid var(--line-strong); border-radius: var(--radius); display: grid; place-items: center; color: var(--success); }
.brand__mark svg { width: 15px; height: 15px; }
.brand small { color: var(--text-faint); font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; padding: 2px 6px; border: 1px solid var(--line); border-radius: 3px; margin-left: 2px; }
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a { font-size: 12.5px; color: var(--text-dim); padding: 7px 12px; border-radius: var(--radius); }
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topbar__cta { display: flex; align-items: center; gap: 10px; }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 15px; font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text);
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--text-ghost); background: var(--surface-hi); }
.btn--ghost { background: transparent; }
.btn--primary { background: var(--success); color: #04160f; border-color: var(--success); font-weight: 600; }
.btn--primary:hover { background: #2affb4; border-color: #2affb4; }
.btn--exec { background: var(--exec); color: #061225; border-color: var(--exec); font-weight: 600; }
.btn--exec:hover { background: #5091f7; border-color: #5091f7; }
.kbd {
  font-family: var(--mono); font-size: 10.5px; line-height: 1;
  padding: 3px 6px; border: 1px solid currentColor; border-radius: 3px;
  opacity: .75; letter-spacing: 0;
}

/* =========================================================================
   HERO
   ========================================================================= */
.hero { position: relative; padding-top: clamp(28px, 3.5vw, 48px); padding-bottom: clamp(32px, 4vw, 56px); overflow: hidden; }
/* faint technical grid — not a mesh gradient, a blueprint rule */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 30% 0%, #000 0%, transparent 72%);
          mask-image: radial-gradient(ellipse 90% 60% at 30% 0%, #000 0%, transparent 72%);
  opacity: .5;
}
.hero__in { position: relative; z-index: 1; }
.hero__lead { max-width: 68ch; }
.hero h1 {
  font-size: clamp(28px, 4.4vw, 50px);
  line-height: 1.03; letter-spacing: -0.03em; margin-top: 16px;
  max-width: 20ch;
}
.hero h1 .em { color: var(--success); }
.hero h1 .ex { color: var(--exec); }
.hero__sub { margin-top: 18px; color: var(--text-dim); font-size: 14.5px; max-width: 54ch; line-height: 1.6; }
.hero__authorize { margin-top: 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero__authhint { color: var(--text-faint); font-size: 12px; display: inline-flex; align-items: center; gap: 8px; }

.hero__meta { margin-top: 24px; display: flex; gap: 26px; flex-wrap: wrap; }
.hero__meta div { display: flex; flex-direction: column; gap: 2px; }
.hero__meta .n { font-family: var(--grotesque); font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.hero__meta .n.em { color: var(--success); }
.hero__meta .l { font-size: 11px; color: var(--text-faint); letter-spacing: 0.06em; }

/* two-column hero on wide screens: headline beside the runner (both above fold) */
@media (min-width: 1081px) {
  .hero__in { display: grid; grid-template-columns: minmax(340px, 420px) 1fr; gap: 44px; align-items: start; }
  .hero h1 { font-size: clamp(28px, 2.9vw, 42px); max-width: 16ch; }
  .runner { margin-top: 6px; }
}

/* =========================================================================
   RUNNER (mock terminal / editor) — the focal element
   ========================================================================= */
.runner {
  margin-top: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-0);
  overflow: hidden;
}
/* window chrome bar */
.runner__chrome {
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-1);
}
.runner__dots { display: flex; gap: 7px; }
.runner__dots i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line-strong); display: block; }
.runner__path { font-size: 11.5px; color: var(--text-faint); letter-spacing: 0.02em; }
.runner__path b { color: var(--text-dim); font-weight: 400; }
.runner__state {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 9px; border: 1px solid var(--line); border-radius: 3px;
  color: var(--text-faint);
}
.runner__state .led { width: 6px; height: 6px; border-radius: 50%; background: var(--text-ghost); }
.runner__state[data-phase="running"] { color: var(--exec); border-color: rgba(59,130,246,0.4); }
.runner__state[data-phase="running"] .led { background: var(--exec); animation: pulse 1.1s var(--step) infinite; }
.runner__state[data-phase="fail"]    { color: var(--warn); border-color: rgba(226,162,74,0.4); }
.runner__state[data-phase="fail"] .led { background: var(--warn); }
.runner__state[data-phase="success"] { color: var(--success); border-color: rgba(0,245,160,0.4); }
.runner__state[data-phase="success"] .led { background: var(--success); box-shadow: 0 0 8px rgba(0,245,160,0.55); }
.runner__state[data-phase="interrupted"] { color: var(--danger); border-color: rgba(226,86,74,0.4); }
.runner__state[data-phase="interrupted"] .led { background: var(--danger); }

/* task tabs */
.tasks {
  display: flex; gap: 0; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  background: var(--surface-0);
}
.tasks::-webkit-scrollbar { display: none; }
.task {
  flex: none; display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 16px; font-size: 12.5px; color: var(--text-dim);
  background: transparent; border: none; border-right: 1px solid var(--line);
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color .15s, background .15s;
}
.task .ico { width: 14px; height: 14px; opacity: .7; }
.task:hover { color: var(--text); background: var(--surface-1); }
.task[aria-selected="true"] { color: var(--text); background: var(--surface-1); border-bottom-color: var(--exec); }
.task[aria-selected="true"] .ico { opacity: 1; color: var(--exec); }
.task .task__lang { font-size: 10px; color: var(--text-ghost); border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; }

/* runner body: file tree | terminal */
.runner__body { display: grid; grid-template-columns: 248px 1fr; min-height: 420px; }
.tree {
  border-right: 1px solid var(--line);
  background: var(--surface-0);
  padding: 12px 0; overflow-y: auto; max-height: 460px;
}
.tree__label {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint); padding: 4px 16px 10px;
}
.tree__row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 16px; font-size: 12.5px; color: var(--text-dim);
  position: relative; transition: background .2s, color .2s;
}
.tree__row[data-depth="1"] { padding-left: 30px; }
.tree__row[data-depth="2"] { padding-left: 44px; }
.tree__row .ico { width: 13px; height: 13px; opacity: .6; }
.tree__row .fname { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.tree__row .badge {
  font-size: 10px; width: 15px; height: 15px; display: grid; place-items: center;
  border-radius: 3px; border: 1px solid transparent; opacity: 0; transform: scale(.7);
  transition: opacity .25s var(--step), transform .25s var(--step);
}
.tree__row[data-status]:not([data-status=""]) .badge { opacity: 1; transform: scale(1); }
.tree__row[data-status="modified"] { color: var(--text); }
.tree__row[data-status="modified"] .badge { color: var(--warn); border-color: rgba(226,162,74,0.35); background: var(--warn-wash); }
.tree__row[data-status="added"] { color: var(--text); }
.tree__row[data-status="added"] .badge { color: var(--success); border-color: rgba(0,245,160,0.35); background: var(--success-wash); }
.tree__row[data-status="deleted"] { color: var(--text-faint); }
.tree__row[data-status="deleted"] .badge { color: var(--del); border-color: rgba(226,86,74,0.35); background: var(--del-wash); }
.tree__row[data-status="added"] .fname,
.tree__row[data-status="deleted"] .fname { }
.tree__row.is-active { background: var(--surface-2); color: var(--text); }
.tree__row.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--exec); }

/* terminal */
.term {
  background: var(--surface-0);
  padding: 14px 18px 18px;
  overflow-y: auto; max-height: 460px;
  font-size: 13px; line-height: 1.7;
  scroll-behavior: smooth;
}
.term__idle {
  height: 100%; min-height: 380px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; text-align: center; color: var(--text-faint);
}
.term__idle .ring { width: 46px; height: 46px; color: var(--text-ghost); }
.term__idle b { color: var(--text-dim); font-weight: 500; font-size: 13px; }
.term__idle span { font-size: 12px; max-width: 34ch; }
.term__idle .hintkeys { display: inline-flex; gap: 6px; margin-top: 4px; }

/* a single line in the reasoning chain */
.line { display: flex; gap: 10px; padding: 2px 0; opacity: 0; transform: translateY(4px); }
.line.in { opacity: 1; transform: none; transition: opacity .28s var(--step), transform .28s var(--step); }
.line__gutter { flex: none; width: 18px; text-align: center; color: var(--text-ghost); font-size: 11px; padding-top: 2px; }
.line__body { flex: 1 1 auto; min-width: 0; }

/* reasoning step */
.step { }
.step__head { display: flex; align-items: center; gap: 9px; color: var(--text); }
.step__num { font-size: 10px; color: var(--exec); border: 1px solid rgba(59,130,246,0.35); background: var(--exec-wash); border-radius: 3px; padding: 1px 6px; letter-spacing: 0.05em; }
.step__title { font-weight: 500; }
.step__note { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; }

/* command */
.cmd { }
.cmd__line { display: flex; align-items: baseline; gap: 8px; }
.cmd__prompt { color: var(--exec); font-weight: 600; flex: none; }
.cmd__text { color: var(--text); word-break: break-word; }
.cmd__spin { color: var(--exec); }
.cmd__out { color: var(--text-dim); font-size: 12.5px; white-space: pre-wrap; margin-top: 3px; padding-left: 18px; border-left: 1px solid var(--line); }
.cmd__out .ok { color: var(--success); }
.cmd__out .bad { color: var(--warn); }
.cmd[data-status="pass"] .cmd__prompt { color: var(--success); }

/* diff block */
.diff { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 6px 0; background: #060607; }
.diff__head { display: flex; align-items: center; gap: 8px; padding: 6px 11px; border-bottom: 1px solid var(--line); background: var(--surface-1); font-size: 11.5px; color: var(--text-dim); }
.diff__head .ico { width: 12px; height: 12px; }
.diff__head .stat { margin-left: auto; font-size: 11px; }
.diff__head .stat .p { color: var(--add); } .diff__head .stat .m { color: var(--del); }
.diff__body { font-size: 12px; line-height: 1.65; padding: 6px 0; overflow-x: auto; }
.dl { display: flex; padding: 0 12px; white-space: pre; }
.dl__sign { width: 14px; flex: none; color: var(--text-ghost); }
.dl__code { flex: 1 1 auto; }
.dl--add { background: var(--add-wash); } .dl--add .dl__sign { color: var(--add); } .dl--add .dl__code { color: #bdf5df; }
.dl--del { background: var(--del-wash); } .dl--del .dl__sign { color: var(--del); } .dl--del .dl__code { color: #f0b6b0; }
.dl--ctx .dl__code { color: var(--text-faint); }

/* test panel */
.test { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 6px 0; }
.test__head { display: flex; align-items: center; gap: 8px; padding: 7px 11px; font-size: 12px; }
.test--fail .test__head { background: var(--warn-wash); color: var(--warn); border-bottom: 1px solid rgba(226,162,74,0.25); }
.test--pass .test__head { background: var(--success-wash); color: var(--success); border-bottom: 1px solid rgba(0,245,160,0.25); }
.test__head .ico { width: 14px; height: 14px; }
.test__head .count { margin-left: auto; font-size: 11px; opacity: .85; }
.test__body { padding: 8px 12px; font-size: 12px; color: var(--text-dim); }
.test__case { display: flex; gap: 8px; padding: 2px 0; }
.test__case .mark { flex: none; width: 14px; text-align: center; }
.test--fail .test__case .mark { color: var(--warn); }
.test__trace { color: var(--text-faint); font-size: 11.5px; margin-top: 4px; padding: 7px 10px; border-left: 1px solid var(--warn); background: rgba(226,162,74,0.05); white-space: pre-wrap; }

/* correction banner */
.correct { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; margin: 6px 0; border: 1px solid rgba(59,130,246,0.3); background: var(--exec-wash); border-radius: var(--radius); color: var(--text); }
.correct .ico { width: 15px; height: 15px; color: var(--exec); margin-top: 1px; }
.correct b { color: var(--exec); font-weight: 600; }
.correct span { color: var(--text-dim); font-size: 12.5px; }

/* success banner */
.done { display: flex; align-items: center; gap: 12px; padding: 13px 15px; margin: 10px 0 2px; border: 1px solid rgba(0,245,160,0.4); background: var(--success-wash); border-radius: var(--radius); }
.done .ico { width: 20px; height: 20px; color: var(--success); }
.done__txt b { color: var(--success); font-family: var(--grotesque); font-weight: 600; letter-spacing: -0.01em; }
.done__txt span { display: block; color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.done__stats { margin-left: auto; display: flex; gap: 18px; text-align: right; }
.done__stats div .v { color: var(--success); font-weight: 600; }
.done__stats div .k { display: block; color: var(--text-faint); font-size: 10px; letter-spacing: 0.05em; }

/* interrupted banner */
.interrupt { display: flex; align-items: center; gap: 10px; padding: 10px 13px; margin: 8px 0; border: 1px solid rgba(226,86,74,0.4); background: rgba(226,86,74,0.06); border-radius: var(--radius); color: var(--danger); font-size: 12.5px; }
.interrupt .ico { width: 15px; height: 15px; }

/* runner footer status bar */
.runner__foot {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 9px 16px; border-top: 1px solid var(--line); background: var(--surface-1);
  font-size: 11.5px; color: var(--text-faint);
}
.runner__foot .stat { display: inline-flex; align-items: center; gap: 7px; }
.runner__foot .stat b { color: var(--text-dim); font-weight: 500; }
.runner__foot .stat .v { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.runner__foot .stat .v.exec { color: var(--exec); }
.runner__foot .stat .v.ok { color: var(--success); }
.runner__foot .spacer { margin-left: auto; }

/* spinner */
.spin { display: inline-block; width: 12px; height: 12px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.caret { display: inline-block; width: 7px; height: 14px; background: var(--exec); margin-left: 3px; vertical-align: text-bottom; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================================
   CONTEXT ENGINE
   ========================================================================= */
.ctx { display: grid; grid-template-columns: 300px 1fr 260px; gap: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface-0); }
.ctx__col { padding: 0; }
.ctx__col + .ctx__col { border-left: 1px solid var(--line); }
.ctx__colhead { display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-1); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.ctx__colhead .ico { width: 14px; height: 14px; }

.wtree { padding: 10px 0; max-height: 460px; overflow-y: auto; }
.wfile {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 16px; font-size: 12.5px; color: var(--text-dim);
  cursor: default; position: relative; transition: background .16s, color .16s;
}
.wfile[data-depth="1"] { padding-left: 28px; }
.wfile[data-depth="2"] { padding-left: 40px; }
.wfile .ico { width: 13px; height: 13px; opacity: .55; }
.wfile.dir { color: var(--text-faint); text-transform: none; }
.wfile:hover, .wfile.is-focus { background: var(--surface-2); color: var(--text); }
.wfile.is-active { background: var(--exec-wash); color: var(--text); }
.wfile.is-active::before { content:""; position:absolute; left:0; top:0; bottom:0; width:2px; background: var(--exec); }
.wfile.is-linked { color: var(--success); background: var(--success-wash); }
.wfile.is-dim { opacity: .34; }
.wfile .tok { margin-left: auto; font-size: 10.5px; color: var(--text-ghost); font-variant-numeric: tabular-nums; }
.wfile.is-active .tok { color: var(--exec); }
.wfile.is-linked .tok { color: var(--success); }

/* graph column */
.ctx__graph { position: relative; min-height: 460px; background:
  radial-gradient(circle at 50% 40%, rgba(59,130,246,0.05), transparent 60%); }
.ctx__graph svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gnode circle { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1; transition: all .25s var(--step); }
.gnode text { fill: var(--text-faint); font-family: var(--mono); font-size: 10px; transition: fill .25s; }
.gnode.is-active circle { fill: rgba(59,130,246,0.15); stroke: var(--exec); stroke-width: 1.5; }
.gnode.is-active text { fill: var(--text); }
.gnode.is-linked circle { fill: rgba(0,245,160,0.12); stroke: var(--success); }
.gnode.is-linked text { fill: var(--success); }
.gnode.is-dim { opacity: .25; }
.gedge { stroke: var(--line-strong); stroke-width: 1; fill: none; opacity: .5; transition: all .25s var(--step); }
.gedge.is-hot { stroke: var(--exec); stroke-width: 1.6; opacity: 1; stroke-dasharray: 4 3; animation: dash 14s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -120; } }
.ctx__graphhint { position: absolute; left: 16px; bottom: 14px; font-size: 11px; color: var(--text-ghost); z-index: 2; }

/* readout column */
.ctx__read { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.readout__file { font-size: 12.5px; color: var(--text); word-break: break-all; }
.readout__file .p { color: var(--text-faint); }
.gauge { }
.gauge__top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.gauge__val { font-family: var(--grotesque); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; color: var(--exec); font-variant-numeric: tabular-nums; }
.gauge__unit { font-size: 11px; color: var(--text-faint); }
.gauge__bar { height: 7px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--surface-0); }
.gauge__fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--exec-dim), var(--exec)); transition: width .35s var(--step); }
.gauge__cap { font-size: 10.5px; color: var(--text-faint); margin-top: 6px; display: flex; justify-content: space-between; }
.readout__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.readout__cell { background: var(--surface-0); padding: 10px 12px; }
.readout__cell .k { font-size: 10px; color: var(--text-faint); letter-spacing: 0.06em; text-transform: uppercase; }
.readout__cell .v { font-size: 16px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.readout__cell .v.ex { color: var(--exec); } .readout__cell .v.ok { color: var(--success); }
.readout__note { font-size: 11.5px; color: var(--text-faint); line-height: 1.55; padding-top: 4px; border-top: 1px solid var(--line); }

/* =========================================================================
   SWE-BENCH MATRIX
   ========================================================================= */
.matrix-wrap { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface-0); }
.matrix__bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface-1); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { padding: 8px 14px; font-size: 12px; background: transparent; color: var(--text-dim); border: none; border-right: 1px solid var(--line-strong); transition: background .15s, color .15s; white-space: nowrap; }
.seg button:last-child { border-right: none; }
.seg button:hover { color: var(--text); background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--exec); color: #061225; font-weight: 600; }
.matrix__legend { margin-left: auto; display: flex; gap: 16px; font-size: 11px; color: var(--text-faint); }
.matrix__legend span { display: inline-flex; align-items: center; gap: 6px; }
.matrix__legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.matrix__metricnote { padding: 10px 16px; font-size: 12px; color: var(--text-dim); border-bottom: 1px solid var(--line); background: var(--surface-0); }
.matrix__metricnote b { color: var(--text); font-weight: 500; }

.matrix { width: 100%; }
.mrow { display: grid; grid-template-columns: 190px 1fr 96px; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); transition: background .15s; }
.mrow:last-child { border-bottom: none; }
.mrow.is-best { background: rgba(0,245,160,0.045); }
.mrow.is-head { background: var(--surface-1); border-bottom: 1px solid var(--line); padding-block: 9px; }
.mrow.is-head span { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.mmodel { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mmodel .avatar { width: 26px; height: 26px; border: 1px solid var(--line-strong); border-radius: var(--radius); display: grid; place-items: center; color: var(--text-dim); flex: none; }
.mmodel.is-us .avatar { color: var(--success); border-color: rgba(0,245,160,0.4); background: var(--success-wash); }
.mmodel__name { font-size: 13px; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mmodel__tag { font-size: 10px; color: var(--text-faint); }
.mmodel.is-us .mmodel__name { color: var(--success); }
.mbar { position: relative; height: 22px; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--surface-0); }
.mbar__fill { position: absolute; inset: 1px auto 1px 1px; width: 0; border-radius: 2px; background: var(--exec); transition: width .5s var(--step), background .3s; }
.mrow.is-best .mbar__fill { background: var(--success); }
.mval { text-align: right; font-family: var(--grotesque); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--text); }
.mrow.is-best .mval { color: var(--success); }
.mval small { font-size: 10px; color: var(--text-faint); font-weight: 400; font-family: var(--mono); }
.mbest-flag { font-size: 9px; letter-spacing: 0.1em; color: var(--success); border: 1px solid rgba(0,245,160,0.4); border-radius: 3px; padding: 1px 5px; margin-left: 8px; vertical-align: middle; }
.matrix__foot { padding: 11px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--text-ghost); background: var(--surface-1); display: flex; gap: 8px; align-items: center; }
.matrix__foot .ico { width: 13px; height: 13px; }

/* =========================================================================
   PRICING CALCULATOR
   ========================================================================= */
.price { display: grid; grid-template-columns: 1fr 380px; gap: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface-0); }
.price__controls { padding: 24px; display: flex; flex-direction: column; gap: 26px; }
.price__summary { border-left: 1px solid var(--line); background: var(--surface-1); padding: 24px; display: flex; flex-direction: column; }

.plan-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; align-self: flex-start; }
.plan-toggle button { padding: 7px 14px; font-size: 12px; background: transparent; color: var(--text-dim); border: none; border-right: 1px solid var(--line-strong); }
.plan-toggle button:last-child { border-right: none; }
.plan-toggle button[aria-pressed="true"] { background: var(--surface-hi); color: var(--text); }
.plan-toggle button[aria-pressed="true"] .save { color: var(--success); }
.plan-toggle .save { font-size: 10px; color: var(--text-faint); margin-left: 6px; }

.field { display: flex; flex-direction: column; gap: 12px; }
.field__top { display: flex; align-items: baseline; justify-content: space-between; }
.field__top label { font-size: 13px; color: var(--text); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.field__top .ico { width: 15px; height: 15px; color: var(--text-faint); }
.field__top .unit { font-size: 11px; color: var(--text-faint); }
.field__ctl { display: flex; align-items: center; gap: 12px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.stepper button { width: 34px; height: 38px; background: var(--surface-2); border: none; color: var(--text-dim); font-size: 16px; display: grid; place-items: center; }
.stepper button:hover { background: var(--surface-hi); color: var(--text); }
.stepper input {
  width: 66px; height: 38px; text-align: center; background: var(--surface-0);
  border: none; border-inline: 1px solid var(--line-strong); color: var(--text);
  font-family: var(--mono); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: 1 1 auto; height: 3px;
  background: var(--line-strong); border-radius: 3px; outline-offset: 6px;
}
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--exec); border: 2px solid #0a0a0c; cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--exec); border: 2px solid #0a0a0c; cursor: pointer; }
.field__meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); }
.field__meta .rate { color: var(--text-dim); }
.field.has-error .stepper { border-color: var(--danger); }
.field__err { font-size: 11px; color: var(--danger); display: none; align-items: center; gap: 6px; }
.field.has-error .field__err { display: flex; }
.field__err .ico { width: 12px; height: 12px; }

/* summary */
.sum__label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.sum__lines { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.sum__line { display: flex; justify-content: space-between; font-size: 12.5px; }
.sum__line .k { color: var(--text-dim); }
.sum__line .k small { color: var(--text-ghost); }
.sum__line .v { color: var(--text); font-variant-numeric: tabular-nums; }
.sum__line.discount .v { color: var(--success); }
.sum__total { margin-top: 18px; }
.sum__total .k { font-size: 12px; color: var(--text-faint); letter-spacing: 0.06em; }
.sum__total .big { font-family: var(--grotesque); font-size: 42px; font-weight: 600; letter-spacing: -0.03em; margin-top: 4px; color: var(--text); font-variant-numeric: tabular-nums; }
.sum__total .big .cur { color: var(--text-faint); font-size: 22px; vertical-align: top; }
.sum__total .per { font-size: 12px; color: var(--text-faint); }
.sum__annual { margin-top: 6px; font-size: 11.5px; color: var(--success); display: flex; align-items: center; gap: 7px; min-height: 16px; }
.sum__annual .ico { width: 12px; height: 12px; }
.sum__cta { margin-top: auto; padding-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.sum__fine { font-size: 10.5px; color: var(--text-ghost); line-height: 1.5; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.foot { border-top: 1px solid var(--line); padding-block: 40px; }
.foot__in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.foot__brand { max-width: 40ch; }
.foot__brand p { color: var(--text-faint); font-size: 12px; margin-top: 12px; line-height: 1.6; }
.foot__cols { display: flex; gap: 56px; flex-wrap: wrap; }
.foot__col h5 { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; font-family: var(--mono); font-weight: 500; }
.foot__col a { display: block; font-size: 12.5px; color: var(--text-dim); padding: 4px 0; }
.foot__col a:hover { color: var(--text); }
.foot__legal { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 11px; color: var(--text-ghost); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1080px) {
  .ctx { grid-template-columns: 1fr 1fr; }
  .ctx__col--graph { grid-column: 1 / -1; border-left: none; border-top: 1px solid var(--line); }
  .price { grid-template-columns: 1fr 320px; }
}
@media (max-width: 860px) {
  .topnav { display: none; }
  .hero__meta { gap: 20px; }
  .runner__body { grid-template-columns: 1fr; }
  .tree { border-right: none; border-bottom: 1px solid var(--line); max-height: 200px; display: grid; grid-template-columns: repeat(2, 1fr); align-content: start; }
  .tree__label { grid-column: 1 / -1; }
  .term { max-height: none; }
  .ctx { grid-template-columns: 1fr; }
  .ctx__col + .ctx__col { border-left: none; border-top: 1px solid var(--line); }
  .ctx__graph { min-height: 300px; }
  .price { grid-template-columns: 1fr; }
  .price__summary { border-left: none; border-top: 1px solid var(--line); }
  .mrow { grid-template-columns: 130px 1fr 78px; gap: 10px; }
  .matrix__legend { display: none; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .hero h1 { font-size: clamp(26px, 8vw, 38px); }
  .topbar__cta .btn--ghost { display: none; }
  .runner__body { grid-template-columns: 1fr; }
  .tree { grid-template-columns: 1fr; max-height: 160px; }
  .mrow { grid-template-columns: 104px 1fr 66px; gap: 8px; padding: 11px; }
  .mmodel .avatar { display: none; }
  .mval { font-size: 13px; }
  .done__stats { display: none; }
  .price__controls, .price__summary { padding: 18px; }
  .sum__total .big { font-size: 34px; }
  .field__ctl { flex-wrap: wrap; }
  input[type="range"] { flex-basis: 100%; order: 3; }
}

/* =========================================================================
   Reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .line { opacity: 1 !important; transform: none !important; }
  .gedge.is-hot { stroke-dasharray: none; }
  .caret { animation: none; }
}
