/* ── page ──────────────────────────────────────────────────────────────── */
:root {
  --accent: #00e676;
  --page: #07090d;
  --surface: #0d1117;
  --surface-2: #111722;
  --line: #1b2330;
  --text: #d5dae1;
  --muted: #8a93a0;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
code { font-family: var(--mono); font-size: 0.88em; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0.05em 0.35em; }
kbd {
  font: 600 0.8em/1 var(--mono);
  display: inline-block; min-width: 1.8em; text-align: center;
  padding: 0.3em 0.45em; border-radius: 6px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-bottom-width: 2px;
}
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #000; padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.dim { color: var(--muted); }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--page) 78%, transparent);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 28px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 17px var(--mono); letter-spacing: -0.02em; }
.nav nav { display: flex; gap: 22px; margin-left: auto; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 14.5px; transition: color .15s; }
.nav nav a:hover { color: var(--text); }
.gh-btn {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 7px 8px 7px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .15s;
}
.gh-btn:hover { border-color: var(--accent); }
.gh-count { font: 600 12.5px var(--mono); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; color: var(--accent); }

/* hero */
.hero { padding: 88px 0 36px; text-align: center; position: relative; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -80px 0 auto; height: 620px; z-index: -1;
  background:
    radial-gradient(600px 300px at 50% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 30%, transparent 75%);
  opacity: .55;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 13px var(--mono); color: var(--muted);
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; margin: 0 0 26px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
h1 { font-size: clamp(40px, 7vw, 78px); line-height: 1.02; letter-spacing: -0.045em; margin: 0 0 22px; font-weight: 700; }
.grad { background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #fff)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { max-width: 680px; margin: 0 auto 34px; color: var(--muted); font-size: 18.5px; }
.lede code { color: var(--text); }
.cta { display: grid; grid-template-columns: minmax(0, auto); gap: 18px; justify-content: center; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 11px 20px; border-radius: 11px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--line); background: var(--surface); transition: transform .15s, border-color .15s, background .15s;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: #061009; border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.pill { font: 600 12.5px var(--mono); background: rgb(0 0 0 / .2); border-radius: 6px; padding: 1px 7px; }

.cmd {
  display: flex; align-items: center; gap: 12px; max-width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 10px 10px 16px; text-align: left;
}
.cmd code { background: none; border: 0; padding: 0; font-size: 14px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; flex: 1; min-width: 0; }
.cmd.multi { align-items: flex-start; }
.cmd.multi code { white-space: pre; line-height: 1.7; }
.prompt { font-family: var(--mono); color: var(--accent); user-select: none; }
.copy {
  flex: none; font: 600 12.5px var(--mono); cursor: pointer;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px;
  transition: border-color .15s, color .15s;
}
.copy:hover { border-color: var(--accent); }
.copy.done { color: var(--accent); border-color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; max-width: 760px; margin: 48px auto 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stats > div { background: var(--surface); padding: 16px 12px; position: relative; }
.stats dt { font: 500 12px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stats dd { margin: 4px 0 0; font: 700 28px var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stats .ico { color: var(--accent); margin-right: 8px; font-size: 0.8em; }
.stats .sub { display: block; font: 11px var(--mono); color: var(--muted); margin-top: 2px; min-height: 1.4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* demo */
.demo { padding: 28px 0 40px; }
.window {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  background: var(--t-bg, #0a0e14);
  box-shadow: 0 40px 120px -30px color-mix(in srgb, var(--accent) 28%, transparent), 0 30px 60px -20px rgb(0 0 0 / .8);
}
.win-bar { display: flex; align-items: center; gap: 14px; height: 38px; padding: 0 14px; background: #10141b; border-bottom: 1px solid var(--line); font: 12.5px var(--mono); color: var(--muted); }
.lights { display: flex; gap: 7px; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.win-title { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.autoplay { color: var(--accent); animation: pulse 2s infinite; white-space: nowrap; }
@keyframes pulse { 50% { opacity: .45; } }
.demo-hint { text-align: center; color: var(--muted); font-size: 14.5px; margin: 20px auto 0; max-width: 820px; line-height: 2.1; }
.demo-hint kbd { margin: 0 1px; }
.pad-keys { display: none; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.pad-keys button {
  font: 600 15px var(--mono); color: var(--text); min-width: 46px; height: 42px; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-bottom-width: 3px;
}
.pad-keys button:active { transform: translateY(1px); border-bottom-width: 2px; }
@media (hover: none), (max-width: 720px) { .pad-keys { display: flex; } }

/* how */
.how { padding: 30px 0 20px; }
.flow { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; justify-content: center; gap: 10px; flex-wrap: wrap; }
.flow li:not(.arrow) { display: grid; gap: 2px; padding: 12px 18px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; min-width: 160px; }
.flow li.accent { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.flow-k { font: 700 14px var(--mono); }
.accent .flow-k { color: var(--accent); }
.flow-v { font-size: 13px; color: var(--muted); }
.arrow { align-self: center; color: var(--muted); font-family: var(--mono); }

/* sections */
section.features, section.themes, section.keys, section.install, section.faq { padding: 96px 0 20px; }
.sec-head { max-width: 680px; margin-bottom: 40px; }
.kicker { font: 500 13px var(--mono); color: var(--accent); margin: 0 0 10px; }
h2 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.08; letter-spacing: -0.035em; margin: 0 0 14px; }
.sec-head p:not(.kicker) { color: var(--muted); font-size: 17px; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card {
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 70%, var(--page)));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 20px; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-2px); }
.card.wide { grid-column: span 2; }
.card h3 { font-size: 17.5px; margin: 0 0 8px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.card h3 .k { font: 700 12px var(--mono); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card strong { color: var(--text); font-weight: 600; }
.tabs-list { list-style: none; padding: 0; margin: 6px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.tabs-list li { font: 500 12.5px var(--mono); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }

/* themes */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.theme-card {
  all: unset; cursor: pointer; display: block; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.theme-card:hover { transform: translateY(-2px); }
.theme-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-card[aria-pressed="true"] { border-color: var(--tc-accent); box-shadow: 0 0 0 1px var(--tc-accent), 0 12px 40px -16px var(--tc-accent); }
.tc-screen { background: var(--tc-bg); padding: 10px; font: 11px/1.7 var(--mono); color: var(--tc-fg); }
.tc-head { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.tc-badge { background: var(--tc-accent); color: var(--tc-bg); font-weight: 700; padding: 0 5px; }
.tc-row { display: grid; grid-template-columns: 10px 30px 1fr auto; gap: 4px; padding: 0 2px; white-space: nowrap; overflow: hidden; }
.tc-row.sel { background: var(--tc-sel); font-weight: 700; }
.tc-row .bar { color: var(--tc-accent); }
.tc-row .id { color: #18ffff; }
.tc-row .st { color: #00e676; }
.tc-row .st.r { color: #ff5252; }
.tc-row .st.m { color: #ff4081; }
.tc-name { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--surface); font-weight: 600; font-size: 14px; }
.tc-name .sw { display: flex; gap: 3px; }
.tc-name .sw i { width: 10px; height: 10px; border-radius: 3px; }

/* keys */
.key-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.key-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.key-col h3 { font: 600 13px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }
.key-col h3:not(:first-child) { margin-top: 22px; }
.key-col h3 small { color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; }
.key-col dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; align-items: center; }
.key-col dt { white-space: nowrap; }
.key-col dd { margin: 0; color: var(--muted); font-size: 14.5px; }

/* install */
.install-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; }
.install-box, .install-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--page); border: 1px solid var(--line); border-radius: 11px; margin-bottom: 16px; }
.seg button { all: unset; cursor: pointer; font: 600 13.5px var(--mono); padding: 7px 14px; border-radius: 8px; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.seg button:focus-visible { outline: 2px solid var(--accent); }
.seg-panel p { color: var(--muted); margin: 0 0 14px; }
.seg-panel .note { margin: 14px 0 0; font-size: 14px; }
.install-side h3 { font: 600 13px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
.install-side h3:not(:first-child) { margin-top: 22px; }
.install-side p { color: var(--muted); font-size: 15px; margin: 12px 0 0; }
.reqs, .plats { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; color: var(--muted); font-size: 15px; }
.reqs a { text-decoration: none; }
.plats { display: flex; flex-wrap: wrap; gap: 6px; }
.plats li { font: 500 12.5px var(--mono); color: var(--text); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }

/* faq */
.faq-list { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 20px; transition: border-color .15s; }
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; font-size: 16.5px; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 18px; color: var(--muted); }
.faq details p code { overflow-wrap: anywhere; }

/* final + footer */
.final { padding: 110px 0 100px; text-align: center; }
.final p { color: var(--muted); font-size: 17px; margin: 0 0 28px; }
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; }
.foot-in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--text); }

@media (max-width: 920px) {
  .grid, .key-cols { grid-template-columns: 1fr 1fr; }
  .install-grid { grid-template-columns: 1fr; }
  .nav nav { display: none; }
  .gh-btn { margin-left: auto; }
}
@media (max-width: 620px) {
  .grid, .key-cols { grid-template-columns: 1fr; }
  .card.wide { grid-column: auto; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero { padding-top: 56px; }
  .lede { font-size: 16.5px; }
  .flow { flex-direction: column; }
  .flow .arrow { transform: rotate(90deg); }
  .autoplay { display: none; }
  section.features, section.themes, section.keys, section.install { padding-top: 72px; }
}

/* ── terminal replica ──────────────────────────────────────────────────── */
.term {
  --lh: 20px;
  --rows: 27;
  --green: #00e676; --red: #ff5252; --yellow: #ffab40; --magenta: #ff4081; --cyan: #18ffff; --blue: #82aaff;
  height: calc(var(--rows) * var(--lh));
  display: flex; flex-direction: column;
  font: 13px/var(--lh) var(--mono);
  font-variant-ligatures: none;
  background: var(--t-bg); color: var(--t-fg);
  overflow: hidden; outline: none; cursor: default; user-select: none;
  transition: background .2s;
}
.term:focus-visible { box-shadow: inset 0 0 0 1px var(--t-accent); }
.term > div { flex: none; }
.term .t-head, .term .t-tabs, .term .t-status { height: var(--lh); white-space: nowrap; overflow: hidden; background: var(--t-bg-alt); }
.term .t-head { display: flex; }
.term .brand { background: var(--t-accent); color: var(--t-bg); font-weight: 700; white-space: pre; }
.term .repo { color: var(--t-fg-bright); font-weight: 700; padding: 0 2ch; white-space: pre; }
.term .keys { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; height: var(--lh); overflow: hidden; }
.term .chip { white-space: pre; color: var(--t-fg-dim); padding-right: 2ch; }
.term .chip b { background: var(--t-bg-sel); color: var(--t-fg-bright); padding: 0 1ch; margin-right: 1ch; }
.term .t-tabs { color: var(--t-fg-dim); }
.term .tab { white-space: pre; cursor: pointer; }
.term .tab:hover { color: var(--t-fg); }
.term .tab.on { color: var(--t-accent); font-weight: 700; }
.term .div { color: var(--t-border); }
.term .t-body { flex: 1; position: relative; min-height: 0; }
.term .t-status { color: var(--t-fg-dim); padding: 0 1ch; }

.term .ov.box {
  position: absolute; inset: 0;
  margin: calc(var(--lh) / 2) 0;
  padding: calc(var(--lh) / 2 - 1px) 1ch;
  border: 1px solid var(--t-border); border-radius: 7px;
  background: var(--t-bg);
}
.term .ov.full, .term .ov.pop { border-color: var(--t-accent); }
.term .ov-title {
  position: absolute; left: 1ch; top: calc(var(--lh) / -2 - 0.5px);
  max-width: calc(100% - 2ch); white-space: pre; overflow: hidden; text-overflow: ellipsis;
  background: var(--t-bg);
}
.term .popwrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0 1ch; }
.term .ov.box.pop { position: relative; inset: auto; max-height: calc(100% - var(--lh)); box-shadow: 0 20px 60px rgb(0 0 0 / .55); display: flex; flex-direction: column; }
.term .ov.box.pop .pad { min-height: 0; }
.term .pad, .term .tbl { height: 100%; overflow: hidden; }
.term .ln { height: var(--lh); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.term .tr { display: grid; column-gap: 1ch; height: var(--lh); cursor: pointer; }
.term .tr > span { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.term .th { background: var(--t-bg-alt); color: var(--t-fg-dim); font-weight: 700; cursor: default; }
.term .sel { background: var(--t-bg-sel); font-weight: 700; }
.term .bar { color: var(--t-accent); display: inline-block; width: 2ch; }

.term .fg { color: var(--t-fg); }
.term .fgb { color: var(--t-fg-bright); }
.term .dim { color: var(--t-fg-dim); }
.term .acc { color: var(--t-accent); }
.term .b { font-weight: 700; }
.term .c-green { color: var(--green); }
.term .c-red { color: var(--red); }
.term .c-yellow { color: var(--yellow); }
.term .c-magenta { color: var(--magenta); }
.term .c-cyan { color: var(--cyan); }
.term .c-blue { color: var(--blue); }
.term .lbl { background: var(--t-bg-sel); color: var(--t-fg-bright); padding: 0 1ch; }
.term .kbd { color: var(--t-accent); }
.term .caret { color: var(--t-accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.term .sw i { display: inline-block; width: 2ch; height: calc(var(--lh) * .55); vertical-align: middle; margin-left: 2px; border-radius: 2px; }

.term .job { display: grid; grid-template-columns: 2ch 2ch minmax(0, 26ch) 12ch auto; cursor: pointer; }
.term .job > span { overflow: hidden; text-overflow: ellipsis; }

.term .l-cmd { color: var(--t-accent); font-weight: 700; }
.term .l-info { color: var(--t-fg-dim); }

.term .diff { display: grid; grid-template-columns: 32ch minmax(0, 1fr); gap: 1ch; height: 100%; }
.term .dfiles { border-right: 1px solid var(--t-border); overflow: hidden; }
.term .dmain { overflow: hidden; min-width: 0; }
.term .dsticky { background: var(--t-bg-alt); }
.term .dfile { background: var(--t-bg-alt); }
.term .drow { display: grid; grid-template-columns: 5ch minmax(0, 1fr) 5ch minmax(0, 1fr); }
.term .dno { color: var(--t-fg-dim); text-align: right; padding-right: 1ch; }
.term .dcode { white-space: pre; overflow: hidden; color: var(--t-fg); padding-right: 1ch; }
.term .dcode.add { background: var(--t-add-bg); }
.term .dcode.del { background: var(--t-del-bg); }
.term .dcode.empty { background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--t-border) 35%, transparent) 4px 5px); }
.term .hl-k { color: #c792ea; }
.term .hl-s { color: #c3e88d; }
.term .hl-n { color: #f78c6c; }
.term .hl-c { color: var(--t-fg-dim); font-style: italic; }
.term .hl-ty { color: #ffcb6b; }
.term .hl-fn { color: #82aaff; }

@media (max-width: 860px) {
  .term .diff { grid-template-columns: minmax(0, 1fr); }
  .term .dfiles { display: none; }
}
@media (max-width: 720px) {
  .window { overflow-x: auto; }
  .term { --lh: 16px; --rows: 26; font-size: 10px; min-width: 600px; }
}

/* 404 */
.nf { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.nf-term { font: 15px/1.8 var(--mono); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 34px; margin: 0; white-space: pre-wrap; }
.nf-err, .nf-x { color: #ff5252; }
.nf-term a { color: var(--accent); font-weight: 700; }
