/* ==========================================================================
   Bitig — Design System
   "Ink & ConPTY": terminal grid geometry, hairline rules, phosphor amber.
   Light + dark themes, mirroring the theme engine the app itself ships.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Dark is the default surface, same as the app */
  --bg:            #0a0b0d;
  --bg-raised:     #101216;
  --bg-sunken:     #07080a;
  --bg-inset:      rgba(255, 255, 255, 0.025);
  --bg-hover:      rgba(255, 255, 255, 0.045);

  --line:          rgba(255, 255, 255, 0.09);
  --line-strong:   rgba(255, 255, 255, 0.16);
  --line-faint:    rgba(255, 255, 255, 0.05);

  --txt:           #e9ebee;
  --txt-strong:    #ffffff;
  --txt-muted:     #9aa2ad;
  --txt-dim:       #6a717c;

  --accent:        #f0a93b;
  --accent-hot:    #ffc061;
  --accent-ink:    #17130a;
  --accent-wash:   rgba(240, 169, 59, 0.12);
  --accent-line:   rgba(240, 169, 59, 0.38);

  --ok:            #6fcf8b;
  --info:          #7fb4f5;
  --bad:           #e8737d;

  --grid-dot:      rgba(255, 255, 255, 0.045);
  --shadow:        0 24px 60px -28px rgba(0, 0, 0, 0.9);
  --shadow-soft:   0 10px 30px -18px rgba(0, 0, 0, 0.8);

  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-head:  'Space Grotesk', 'Inter', sans-serif;
  --font-mono:  'JetBrains Mono', 'Cascadia Code', Consolas, ui-monospace, monospace;

  --wrap: 1180px;
  --gut: 1.5rem;
  --r-sm: 4px;
  --r:    8px;
  --r-lg: 14px;

  --t-fast: 0.14s ease;
  --t:      0.22s cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg:            #f6f4f0;
  --bg-raised:     #ffffff;
  --bg-sunken:     #ece8e1;
  --bg-inset:      rgba(20, 18, 14, 0.035);
  --bg-hover:      rgba(20, 18, 14, 0.055);

  --line:          rgba(24, 21, 16, 0.14);
  --line-strong:   rgba(24, 21, 16, 0.26);
  --line-faint:    rgba(24, 21, 16, 0.075);

  --txt:           #1d1f24;
  --txt-strong:    #0a0b0d;
  --txt-muted:     #5c626c;
  --txt-dim:       #858b95;

  --accent:        #b3711a;
  --accent-hot:    #915a10;
  --accent-ink:    #fffaf1;
  --accent-wash:   rgba(179, 113, 26, 0.1);
  --accent-line:   rgba(179, 113, 26, 0.4);

  --ok:            #2f8a4f;
  --info:          #2f6ab4;
  --bad:           #c0434f;

  --grid-dot:      rgba(24, 21, 16, 0.07);
  --shadow:        0 24px 60px -30px rgba(40, 34, 24, 0.35);
  --shadow-soft:   0 10px 26px -18px rgba(40, 34, 24, 0.3);

  color-scheme: light;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Dotted terminal grid, fixed behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 15%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 15%, transparent 80%);
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }

code, kbd, pre { font-family: var(--font-mono); font-size: 0.875em; }

code {
  display: inline;
  font-size: 0.85em;
  padding: 0.1em 0.38em;
  border-radius: 4px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  color: var(--txt-strong);
  white-space: nowrap;
  vertical-align: baseline;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gut);
  position: relative;
  z-index: 1;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  z-index: 200;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* --------------------------------------------------------------------------
   3. Shared primitives
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.68rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--txt);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.btn:hover { background: var(--bg-hover); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hot); border-color: var(--accent-hot); color: var(--accent-ink); }

.btn-lg { padding: 0.85rem 1.35rem; font-size: 0.97rem; }

.icon { width: 1em; height: 1em; flex: none; }

/* Section scaffolding */
.section { padding: 5.5rem 0; position: relative; }
.section + .section { border-top: 1px solid var(--line-faint); }

.sec-head { margin-bottom: 3rem; max-width: 62ch; }

.sec-tag {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.sec-tag::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--accent-line);
}

.sec-title {
  font-family: var(--font-head);
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--txt-strong);
}

.sec-desc {
  margin-top: 0.9rem;
  color: var(--txt-muted);
  font-size: 1.01rem;
  max-width: 58ch;
}

/* --------------------------------------------------------------------------
   4. Navigation
   -------------------------------------------------------------------------- */
.nav-shell {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), background var(--t);
}
.nav-shell.scrolled { border-bottom-color: var(--line); }

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 62px;
}

.brand { display: flex; align-items: center; gap: 0.6rem; flex: none; }
.brand img { width: 22px; height: 22px; border-radius: 4px; }
.brand-name {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 0.9rem;
  color: var(--txt-strong);
}
.brand-ver {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  line-height: 1.4;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}
.nav-link {
  font-size: 0.875rem;
  color: var(--txt-muted);
  padding: 0.4rem 0.7rem;
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-link:hover { color: var(--txt-strong); background: var(--bg-hover); }
.nav-link.current { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--txt-muted);
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.icon-btn:hover { color: var(--txt-strong); background: var(--bg-hover); border-color: var(--line-strong); }
.icon-btn svg { width: 16px; height: 16px; }

/* theme toggle swaps the two glyphs */
:root[data-theme='light'] .icon-moon { display: none; }
:root:not([data-theme='light']) .icon-sun { display: none; }

.burger { display: none; }

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */
.hero { padding: 4.5rem 0 4rem; position: relative; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 3.5rem;
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--txt-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.8rem 0.3rem 0.6rem;
  background: var(--bg-inset);
  margin-bottom: 1.6rem;
}
.dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.3rem, 5vw, 3.7rem);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--txt-strong);
}
.hero h1 .strike {
  color: var(--txt-dim);
  font-weight: 400;
  position: relative;
  white-space: nowrap;
}
.hero h1 .strike::after {
  content: '';
  position: absolute;
  left: -2px; right: -2px; top: 54%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  animation: strike 0.65s 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes strike { to { transform: scaleX(1); } }
.hero h1 .accent { color: var(--accent); }

.hero-sub {
  margin-top: 1.35rem;
  font-size: 1.05rem;
  color: var(--txt-muted);
  max-width: 52ch;
}
.hero-sub strong { color: var(--txt); font-weight: 600; }

.install-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding: 0.15rem 0.15rem 0.15rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-sunken);
  max-width: 430px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.install-line .sigil { color: var(--accent); flex: none; }
.install-line code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 6px 6px 0;
  background: transparent;
  color: var(--txt-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
}
.copy-btn:hover { color: var(--accent); background: var(--accent-wash); }
.copy-btn svg { width: 13px; height: 13px; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2.2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-faint);
}
.fact { display: flex; flex-direction: column; gap: 0.1rem; }
.fact-num {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--txt-strong);
  letter-spacing: -0.02em;
}
.fact-lbl {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-dim);
}

/* --------------------------------------------------------------------------
   6. Terminal mockup
   -------------------------------------------------------------------------- */
.term {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-sunken);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.72;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.7rem;
  height: 38px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--line);
}

.win-dots { display: flex; gap: 0.3rem; }
.win-dots i {
  width: 9px; height: 9px; border-radius: 50%;
  display: block;
  background: var(--line-strong);
}
.win-dots i:first-child { background: color-mix(in srgb, var(--bad) 70%, transparent); }
.win-dots i:nth-child(2) { background: color-mix(in srgb, var(--accent) 65%, transparent); }
.win-dots i:nth-child(3) { background: color-mix(in srgb, var(--ok) 60%, transparent); }

.term-tabs { display: flex; align-items: center; gap: 0.3rem; min-width: 0; }
.term-tab {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--txt-dim);
  font-size: 0.71rem;
  max-width: 190px;
  overflow: hidden;
  white-space: nowrap;
}
.term-tab.on {
  background: var(--bg-sunken);
  border-color: var(--line);
  color: var(--txt);
  position: relative;
}
.term-tab.on::before {
  content: '';
  position: absolute;
  left: 8px; right: 8px; top: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.term-tab .sigil { color: var(--accent); }
.tab-add { color: var(--txt-dim); padding: 0 0.4rem; font-size: 0.85rem; }

.term-pills { margin-left: auto; display: flex; gap: 0.35rem; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.65rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--txt-muted);
  white-space: nowrap;
}
.pill .bead { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }
.pill.shield { color: var(--accent); border-color: var(--accent-line); }
.pill.shield .bead { background: var(--accent); }

.term-screen {
  height: 316px;
  overflow-y: auto;
  padding: 0.9rem 1rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.term-screen::-webkit-scrollbar { width: 8px; }
.term-screen::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

.tline { white-space: pre-wrap; word-break: break-word; color: var(--txt-muted); }
.t-dim   { color: var(--txt-dim); }
.t-txt   { color: var(--txt); }
.t-str   { color: var(--txt-strong); font-weight: 600; }
.t-acc   { color: var(--accent); }
.t-ok    { color: var(--ok); }
.t-info  { color: var(--info); }
.t-bad   { color: var(--bad); }
.t-rule  { color: var(--line-strong); }

.term-prompt-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.4rem 1rem 0.8rem;
}
.term-prompt-row .ps { color: var(--ok); flex: none; }
.term-input-wrap { position: relative; flex: 1; min-width: 0; }
.term-input,
.term-ghost {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.72;
}
.term-input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--txt-strong);
  caret-color: var(--accent);
  position: relative;
  z-index: 2;
}
.term-input::placeholder { color: var(--txt-dim); }
.term-ghost {
  position: absolute;
  inset: 0;
  color: var(--txt-dim);
  opacity: 0.6;
  pointer-events: none;
  white-space: pre;
  overflow: hidden;
  z-index: 1;
}
.ghost-hint {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--txt-dim);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 0.3rem;
  background: var(--bg-sunken);
  opacity: 0;
  transition: opacity var(--t-fast);
  z-index: 3;
}
.ghost-hint.on { opacity: 1; }

.term-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--line-faint);
  background: var(--bg-inset);
}
.term-actions .lbl {
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-dim);
  margin-right: 0.2rem;
}
.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--txt-muted);
  border-radius: 999px;
  padding: 0.16rem 0.62rem;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.chip:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-wash); }

.term-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.35rem 0.85rem;
  border-top: 1px solid var(--line-faint);
  background: var(--bg-raised);
  font-size: 0.67rem;
  color: var(--txt-dim);
}
.term-status .right { margin-left: auto; display: flex; gap: 1rem; }
.term-status code { color: var(--txt-muted); }
.term-status .link { color: var(--info); }

/* --------------------------------------------------------------------------
   7. Principles — bordered spec grid
   -------------------------------------------------------------------------- */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-inset);
}
.spec {
  padding: 1.85rem 1.5rem;
  border-right: 1px solid var(--line-faint);
  position: relative;
  transition: background var(--t-fast);
  min-width: 0;
}
.spec:last-child { border-right: 0; }
.spec:hover { background: var(--bg-hover); }
.spec::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t);
}
.spec:hover::after { transform: scaleX(1); }

.spec-no {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--txt-dim);
  letter-spacing: 0.1em;
}
.spec-ico {
  margin: 0.9rem 0 1rem;
  width: 30px; height: 30px;
  color: var(--accent);
}
.spec-ico svg { width: 100%; height: 100%; }
.spec h3 {
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--txt-strong);
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.spec p { font-size: 0.885rem; color: var(--txt-muted); line-height: 1.6; }
.spec code { color: var(--accent); font-size: 0.8em; }

/* --------------------------------------------------------------------------
   8. Features — bento
   -------------------------------------------------------------------------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-faint);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.cell {
  background: var(--bg);
  padding: 1.9rem 1.75rem;
  grid-column: span 2;
  position: relative;
  transition: background var(--t-fast);
  min-width: 0;
}
.cell:hover { background: var(--bg-raised); }
.cell.wide { grid-column: span 3; }
.cell.lead {
  grid-column: span 6;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 2.25rem;
  align-items: center;
}
.cell.lead > div:first-child {
  min-width: 0;
  width: 100%;
}

.cell-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: 3px;
  padding: 0.1rem 0.42rem;
  margin-bottom: 1rem;
}
.cell h3 {
  font-family: var(--font-head);
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--txt-strong);
  margin-bottom: 0.6rem;
}
.cell.lead h3 { font-size: 1.55rem; }
.cell p { color: var(--txt-muted); font-size: 0.92rem; }
.cell code {
  display: inline;
  color: var(--txt-strong);
  background: var(--bg-inset);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0.08em 0.38em;
  font-size: 0.85em;
  white-space: nowrap;
  vertical-align: baseline;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.pt-list {
  list-style: none;
  margin-top: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}
.pt-list li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: var(--txt-muted);
  line-height: 1.6;
  min-width: 0;
  width: 100%;
  word-break: normal;
  overflow-wrap: break-word;
}
.pt-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px; height: 5px;
  border-radius: 1px;
  background: var(--accent);
  transform: rotate(45deg);
}
.pt-list strong { color: var(--txt); font-weight: 600; }

/* Ghost-text mini demo inside the lead cell */
.mini-term {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-sunken);
  padding: 1rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.85;
  box-shadow: var(--shadow-soft);
}
.mini-term .row { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-term .ps { color: var(--ok); }
.mini-term .typed { color: var(--txt-strong); }
.mini-term .ghost { color: var(--txt-dim); opacity: 0.6; }
.mini-term .caret {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--accent);
  vertical-align: -0.15em;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.mini-term .meta { color: var(--txt-dim); font-size: 0.72rem; margin-top: 0.5rem; }
.mini-term kbd {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 0.28rem;
  color: var(--txt-muted);
  font-size: 0.9em;
}

/* --------------------------------------------------------------------------
   9. Gallery
   -------------------------------------------------------------------------- */
.gal-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.75rem; }
.gal-tab {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--txt-muted);
  border-radius: var(--r-sm);
  padding: 0.36rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.gal-tab:hover { color: var(--txt-strong); border-color: var(--line-strong); }
.gal-tab.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

.gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }

.shot {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-raised);
  cursor: zoom-in;
  transition: border-color var(--t-fast), transform var(--t), box-shadow var(--t);
}
.shot:hover {
  border-color: var(--accent-line);
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}
.shot-img { position: relative; background: var(--bg-sunken); border-bottom: 1px solid var(--line-faint); }
.shot-img img { width: 100%; height: auto; display: block; }
.shot-img::after {
  content: 'EXPAND';
  position: absolute;
  right: 0.6rem; bottom: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 3px;
  padding: 0.12rem 0.42rem;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.shot:hover .shot-img::after { opacity: 1; }
.shot-cap { padding: 0.9rem 1rem 1.05rem; }
.shot-cap h4 {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--txt-strong);
  margin-bottom: 0.2rem;
}
.shot-cap p { font-size: 0.82rem; color: var(--txt-muted); }

/* --------------------------------------------------------------------------
   10. Comparison table
   -------------------------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-inset);
}
table.cmp { width: 100%; border-collapse: collapse; min-width: 780px; font-size: 0.875rem; }
table.cmp th, table.cmp td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line-faint);
  vertical-align: middle;
}
table.cmp thead th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--txt-dim);
  font-weight: 500;
  background: var(--bg-raised);
  white-space: nowrap;
}
table.cmp tbody tr:last-child td { border-bottom: 0; }
table.cmp tbody tr:hover td { background: var(--bg-hover); }
table.cmp td:first-child { color: var(--txt); font-weight: 500; }
table.cmp .col-us { background: var(--accent-wash); border-left: 1px solid var(--accent-line); border-right: 1px solid var(--accent-line); }
table.cmp thead .col-us { color: var(--accent); background: var(--accent-wash); }
table.cmp tbody tr:last-child .col-us { border-bottom: 1px solid var(--accent-line); }

.mark { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--txt-muted); }
.mark::before {
  font-family: var(--font-mono);
  font-size: 0.95em;
  width: 1em;
  text-align: center;
}
.mark.yes { color: var(--txt); }
.mark.yes::before { content: '+'; color: var(--ok); }
.mark.no::before { content: '-'; color: var(--bad); }
.mark.mid::before { content: '~'; color: var(--accent); }

/* --------------------------------------------------------------------------
   11. Shortcuts
   -------------------------------------------------------------------------- */
.keys-search {
  position: relative;
  max-width: 420px;
  margin-bottom: 1.75rem;
}
.keys-search input {
  width: 100%;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.62rem 0.85rem 0.62rem 2.2rem;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--txt);
  outline: 0;
  transition: border-color var(--t-fast);
}
.keys-search input:focus { border-color: var(--accent-line); }
.keys-search input::placeholder { color: var(--txt-dim); }
.keys-search svg {
  position: absolute;
  left: 0.75rem; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--txt-dim);
}

.keys-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-faint);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg);
  padding: 0.85rem 1.1rem;
  transition: background var(--t-fast);
  min-width: 0;
}
.key-row:hover { background: var(--bg-raised); }
.key-row .what { font-size: 0.875rem; color: var(--txt-muted); }
.key-row .combo { display: flex; align-items: center; gap: 0.22rem; flex: none; }
.keys-empty {
  grid-column: 1 / -1;
  background: var(--bg);
  padding: 2rem;
  text-align: center;
  color: var(--txt-dim);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

kbd {
  display: inline-block;
  min-width: 1.75em;
  text-align: center;
  padding: 0.14rem 0.4rem;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-raised);
  color: var(--txt);
  font-size: 0.72rem;
  line-height: 1.4;
}
.combo .plus { color: var(--txt-dim); font-size: 0.7rem; }

/* --------------------------------------------------------------------------
   12. Download
   -------------------------------------------------------------------------- */
.dl-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 1.1rem; }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-inset);
  padding: 1.6rem;
}
.panel.hi { border-color: var(--accent-line); background: var(--accent-wash); }

.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.panel-head h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--txt-strong);
}
.panel-head p { font-size: 0.84rem; color: var(--txt-muted); margin-top: 0.15rem; }
.panel-head .os {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--txt-dim);
  white-space: nowrap;
}

.dl-opt {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  margin-bottom: 0.6rem;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.dl-opt:hover { border-color: var(--accent-line); transform: translateX(2px); }
.dl-opt:last-child { margin-bottom: 0; }
.dl-opt strong { display: block; font-family: var(--font-mono); font-size: 0.83rem; color: var(--txt-strong); }
.dl-opt span { display: block; font-size: 0.8rem; color: var(--txt-muted); margin-top: 0.1rem; }
.dl-opt .tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  flex: none;
}

.pkg { margin-bottom: 1rem; }
.pkg:last-child { margin-bottom: 0; }
.pkg-name {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--txt-dim);
  display: block;
  margin-bottom: 0.35rem;
}
.pkg-cmd {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
}
.pkg-cmd code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--txt);
  font-size: 0.78rem;
  scrollbar-width: none;
}
.pkg-cmd code::-webkit-scrollbar { display: none; }
.mini-copy {
  flex: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--txt-dim);
  border-radius: 3px;
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.mini-copy:hover { color: var(--accent); border-color: var(--accent-line); }
.mini-copy svg { width: 13px; height: 13px; }

.note {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-top: 1.1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--bg-inset);
  font-size: 0.875rem;
  color: var(--txt-muted);
}
.note strong { color: var(--txt); }
.note code { color: var(--accent); }
.note svg { width: 17px; height: 17px; color: var(--accent); flex: none; margin-top: 0.15rem; }

/* --------------------------------------------------------------------------
   13. Lightbox + toast
   -------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox.on { display: flex; }
.lb-veil { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.82); backdrop-filter: blur(4px); }
.lb-body {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-raised);
  animation: pop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes pop { from { opacity: 0; transform: scale(0.98); } }
.lb-body img { width: 100%; height: auto; }
.lb-cap {
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--line-faint);
  font-size: 0.85rem;
  color: var(--txt-muted);
}
.lb-cap strong { color: var(--txt-strong); }
.lb-x {
  position: absolute;
  top: 0.6rem; right: 0.6rem;
  z-index: 2;
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-sunken);
  color: var(--txt-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.lb-x:hover { color: var(--txt-strong); border-color: var(--accent-line); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 150%);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--bg-raised);
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--txt);
  transition: transform var(--t);
  max-width: min(90vw, 520px);
}
.toast.on { transform: translate(-50%, 0); }
.toast .ok { color: var(--ok); }
.toast .msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding: 3.5rem 0 2.5rem; background: var(--bg-sunken); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2.5rem; }
.footer-brand .brand { margin-bottom: 0.9rem; }
.footer-brand p { font-size: 0.875rem; color: var(--txt-muted); max-width: 34ch; }
.footer-mean {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--txt-dim);
  border-left: 2px solid var(--accent-line);
  padding-left: 0.75rem;
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-dim);
  font-weight: 500;
  margin-bottom: 0.9rem;
}
.footer-col a {
  display: block;
  font-size: 0.875rem;
  color: var(--txt-muted);
  padding: 0.22rem 0;
  transition: color var(--t-fast);
}
.footer-col a:hover { color: var(--accent); }
.footer-base {
  margin-top: 3rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line-faint);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--txt-dim);
}
.footer-base a { color: var(--txt-muted); }
.footer-base a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   15. Reveal on scroll
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   16. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.75rem; }
  .spec-grid { grid-template-columns: repeat(2, 1fr); }
  .spec:nth-child(2n) { border-right: 0; }
  .spec:nth-child(-n+2) { border-bottom: 1px solid var(--line-faint); }
  .gal-grid { grid-template-columns: repeat(2, 1fr); }
  .keys-grid { grid-template-columns: repeat(2, 1fr); }
  .cell.wide { grid-column: span 6; }
  .cell { grid-column: span 3; }
  .cell:last-child { grid-column: span 6; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 860px) {
  .nav-links {
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gut) 1rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 0.6rem 0.25rem; border-bottom: 1px solid var(--line-faint); border-radius: 0; }
  .burger { display: grid; }
  .nav { position: relative; }
  .cell.lead { grid-template-columns: 1fr; gap: 1.5rem; }
  .dl-grid { grid-template-columns: 1fr; }
  .section { padding: 4rem 0; }
}

@media (max-width: 620px) {
  :root { --gut: 1.15rem; }
  .spec-grid { grid-template-columns: 1fr; }
  .spec { border-right: 0; border-bottom: 1px solid var(--line-faint); }
  .spec:last-child { border-bottom: 0; }
  .gal-grid { grid-template-columns: 1fr; }
  .keys-grid { grid-template-columns: 1fr; }
  .cell, .cell.wide { grid-column: span 6; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-facts { gap: 1.25rem 1.75rem; }
  .term-screen { height: 260px; }
  .hero { padding: 3rem 0; }
  .nav-actions .btn-github span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero h1 .strike::after { transform: scaleX(1); }
}

/* Visually hidden, still announced */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
