/* portage-ng.ai — landing page styles */

:root {
  --bg0: #0b0d13;
  --bg1: #10131c;
  --bg2: #161a26;
  --bg3: #1c2130;
  --border: #232939;
  --border-strong: #303850;
  --text: #e8ebf4;
  --text-2: #a6aec2;
  --text-3: #717a92;
  --violet: #a78bfa;
  --violet-deep: #7c5cf0;
  --green: #4ade80;
  --magenta: #f472b6;
  --blue: #7db3fa;
  --amber: #fbbf24;
  --orange: #fb923c;
  --nav-bg: rgba(11, 13, 19, 0.72);
  --nav-bg-scrolled: rgba(11, 13, 19, 0.85);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --nav-h: 64px;
}

/* ---------- light theme ---------- */

html[data-theme="light"] {
  --bg0: #f6f7fb;
  --bg1: #ffffff;
  --bg2: #edeff7;
  --bg3: #e2e6f2;
  --border: #dfe3ee;
  --border-strong: #c7cfe2;
  --text: #1a1e2c;
  --text-2: #4a536d;
  --text-3: #6f7a96;
  --violet: #6d4de0;
  --violet-deep: #6742e6;
  --green: #0e8a4d;
  --magenta: #cf2f8c;
  --blue: #2d6bd0;
  --amber: #9a7305;
  --orange: #c2570b;
  --nav-bg: rgba(247, 248, 252, 0.75);
  --nav-bg-scrolled: rgba(247, 248, 252, 0.9);
}

/* the lightbox backdrop keeps the dark palette in light mode — restore the
   dark variable values inside that scope. Terminals, code blocks and the
   literal diagram follow the active theme. */
html[data-theme="light"] .lightbox {
  --bg0: #0b0d13;
  --bg1: #10131c;
  --bg2: #161a26;
  --bg3: #1c2130;
  --border: #232939;
  --border-strong: #303850;
  --text: #e8ebf4;
  --text-2: #a6aec2;
  --text-3: #717a92;
  --violet: #a78bfa;
  --green: #4ade80;
  --magenta: #f472b6;
  --blue: #7db3fa;
  --amber: #fbbf24;
  --orange: #fb923c;
}

/* light terminal windows: white ground, theme variables supply the darker
   light-mode syntax colors */
html[data-theme="light"] .term,
html[data-theme="light"] .shot-frame,
html[data-theme="light"] .codeblock {
  background: #ffffff;
}

html[data-theme="light"] .hero-bg {
  background:
    radial-gradient(ellipse 720px 420px at 18% 8%, rgba(124, 92, 240, 0.10), transparent 60%),
    radial-gradient(ellipse 640px 420px at 85% 68%, rgba(14, 138, 77, 0.06), transparent 60%);
}

html[data-theme="light"] .hero-grid {
  background-image:
    linear-gradient(rgba(84, 63, 190, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 63, 190, 0.06) 1px, transparent 1px);
}

html[data-theme="light"] .term {
  box-shadow:
    0 24px 70px rgba(24, 22, 60, 0.22),
    0 0 0 1px rgba(109, 77, 224, 0.07),
    0 0 90px rgba(124, 92, 240, 0.10);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg0);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(167, 139, 250, 0.35); }

a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code, pre { font-family: var(--mono); }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.nav.scrolled {
  border-bottom-color: var(--border);
  background: var(--nav-bg-scrolled);
}

.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text) !important;
  background: var(--bg2);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-github:hover { border-color: var(--violet); background: var(--bg3); }
.nav-github svg { width: 16px; height: 16px; fill: currentColor; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  width: 40px; height: 40px;
  font-size: 18px;
  cursor: pointer;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px; height: 36px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover { border-color: var(--violet); color: var(--text); }
.theme-toggle svg {
  width: 17px; height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: calc(var(--nav-h) + 72px) 0 88px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 720px 420px at 18% 8%, rgba(124, 92, 240, 0.16), transparent 60%),
    radial-gradient(ellipse 640px 420px at 85% 68%, rgba(74, 222, 128, 0.07), transparent 60%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, black 35%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 0%, black 35%, transparent 78%);
}

.hero-inner {
  position: relative;
  display: grid;
  /* terminal column sized so the longest animation line fits without
     horizontal scrolling at every two-column width */
  grid-template-columns: minmax(0, 5fr) minmax(0, 6.5fr);
  gap: 48px;
  align-items: center;
}

h1 {
  font-family: var(--mono);
  font-size: clamp(32px, 4.8vw, 52px);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.hero-tag {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--violet);
  margin: 0 0 20px;
}
.hero-tag-mid { font-size: 15px; margin: 0 0 8px; color: var(--green); }
h1 .glyph,
.hero-tag .glyph {
  background: linear-gradient(90deg, var(--violet), var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* pull the mono glyphs together to match the logo's tight dot spacing */
  letter-spacing: -0.14em;
  margin-right: 0.14em; /* restore the word gap eaten by the last char's spacing */
}
h1.nobr { white-space: nowrap; }
h1 .h1-mark {
  width: 1.18em;
  height: 1.18em;
  display: inline-block;
  vertical-align: -0.2em;
  margin-right: 0.12em;
}

.hero-sub {
  color: var(--text-2);
  font-size: 18.5px;
  max-width: 34em;
  margin: 0 0 18px;
}
.hero-sub strong { color: var(--text); font-weight: 600; }

.hero-prolog {
  color: var(--text-3);
  font-size: 15px;
  line-height: 1.65;
  max-width: 38em;
  margin: 0 0 32px;
  text-wrap: pretty;
}
.hero-prolog strong { color: var(--text-2); font-weight: 600; }

.cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.cta-row .btn { padding: 12px 16px; font-size: 15px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--violet-deep), #9d7bfa);
  color: #fff;
  box-shadow: 0 4px 24px rgba(124, 92, 240, 0.35);
}
.btn-primary:hover { box-shadow: 0 6px 32px rgba(124, 92, 240, 0.5); }

.btn-ghost {
  border-color: var(--border-strong);
  background: var(--bg2);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--violet); }
.btn-ghost svg { width: 17px; height: 17px; fill: currentColor; }

.qs-info p.qs-vm { margin: 18px 0 0; }

/* ---------- terminal ---------- */

.term {
  background: #0d0f16;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(167, 139, 250, 0.06),
    0 0 90px rgba(124, 92, 240, 0.10);
  overflow: hidden;
  font-size: 12px;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.term-dot { width: 11px; height: 11px; border-radius: 50%; }
.term-dot.r { background: #ff5f57; }
.term-dot.y { background: #febc2e; }
.term-dot.g { background: #28c840; }
.term-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
}

.term-body {
  padding: 16px 18px 18px;
  font-family: var(--mono);
  line-height: 1.55;
  min-height: 375px;
  white-space: pre;
  overflow-x: auto;
  /* resolve within the terminal scope so plain text follows the theme */
  color: var(--text);
}

.term-body .t-prompt { color: var(--green); font-weight: 700; }
.term-body .t-cmd { color: var(--text); }
.term-body .t-hdr { color: var(--green); font-weight: 700; }
.term-body .t-atom { color: var(--violet); }
.term-body .t-dl { color: var(--blue); }
.term-body .t-inst { color: var(--green); }
.term-body .t-run { color: var(--magenta); }
.term-body .t-conf { color: var(--amber); }
.term-body .t-act { color: var(--orange); }
.term-body .t-dim { color: var(--text-3); }

/* powerline-style bubbles, as rendered by portage-ng's message:bubble/2 —
   0.5ch padding each side stands in for the half-circle caps, keeping the
   pill exactly one character wider than its text so columns stay aligned */
.term-body .bbl {
  padding: 1.5px 0.5ch;
  border-radius: 999px;
  font-weight: 600;
}
.term-body .bbl-dark   { background: #333b52; color: #ced6ea; }
.term-body .bbl-green  { background: #4ade80; color: #0a1410; }
.term-body .bbl-orange { background: #fbbf24; color: #1a1204; }

html[data-theme="light"] .term-body .bbl-dark { background: #e2e6f2; color: #333b52; }

.t-cursor {
  display: inline-block;
  width: 7px; height: 14px;
  background: var(--green);
  vertical-align: -2px;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- stats strip ---------- */

.stats {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg1);
}

.stats-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
}

.stat {
  padding: 30px 22px;
  text-align: center;
}
.stat + .stat { border-left: 1px solid var(--border); }

.stat-num {
  font-family: var(--mono);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.stat-num .accent { color: var(--violet); }

.stat-label {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--text-3);
}

.stats-note {
  text-align: center;
  padding: 0 24px 18px;
  font-size: 12.5px;
  color: var(--text-3);
}
.stats-note a { color: var(--text-2); }

/* ---------- sections ---------- */

section { padding: 92px 0; }
section.tight { padding: 72px 0; }

.sec-head { margin-bottom: 52px; }

.sec-eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 12px;
}

h2 {
  font-family: var(--mono);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 14px;
  text-wrap: balance;
}

.sec-sub { color: var(--text-2); font-size: 16.5px; margin: 0; text-wrap: balance; }
.sec-sub code { color: var(--magenta); font-size: 0.9em; }

/* ---------- why cards ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.pillar {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg2), var(--bg1));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  position: relative;
  overflow: hidden;
}

.pillar::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), transparent 70%);
  opacity: 0.7;
}

.pillar-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--violet);
  margin-bottom: 14px;
}

.pillar h3 {
  font-size: 18.5px;
  font-weight: 650;
  margin: 0 0 10px;
}

.pillar p { color: var(--text-2); font-size: 14.5px; margin: 0; }
.pillar p strong { color: var(--text); font-weight: 600; }
/* the "so what" line: bold, violet, pinned to the card bottom */
.pillar p.pillar-gain {
  margin-top: auto;
  padding-top: 14px;
  color: var(--violet);
  font-weight: 650;
  font-size: 14px;
}
.pillar code {
  font-size: 12.5px;
  color: var(--magenta);
  background: rgba(244, 114, 182, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- features grid ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.feature:hover {
  border-color: var(--border-strong);
  background: var(--bg2);
  transform: translateY(-2px);
}

.feature-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: rgba(167, 139, 250, 0.10);
  border: 1px solid rgba(167, 139, 250, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.feature-icon svg { width: 19px; height: 19px; stroke: var(--violet); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.feature h3 { font-size: 16px; font-weight: 650; margin: 0 0 8px; }
.feature p { color: var(--text-2); font-size: 14px; margin: 0; }
.feature code { font-size: 12px; color: var(--blue); }

a.feature { display: block; color: inherit; }
a.feature:hover { text-decoration: none; }
.feature-more {
  margin-top: 12px !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--violet) !important;
}
a.feature:hover .feature-more { text-decoration: underline; text-underline-offset: 3px; }

.feature-wide { grid-column: 1 / -1; padding: 28px 26px; }
.fw-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 32px;
  align-items: center;
}
.fw-literal {
  font-family: var(--mono);
  background: var(--bg0);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  row-gap: 12px;
  overflow-x: auto;
}
.fw-seg { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.fw-seg code { font-size: 13.5px; line-height: 1.4; }
.fw-seg small {
  font-size: 9.5px;
  font-family: var(--sans);
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.fw-sep { font-size: 13.5px; line-height: 1.4; color: var(--text-3); padding: 0 3px; }
.fw-literal .fw-repo { color: var(--blue); }
.fw-literal .fw-entry { color: var(--violet); }
.fw-literal .fw-action { color: var(--green); }
.fw-literal .fw-ctx { color: var(--amber); }

@media (max-width: 1000px) {
  .fw-grid { grid-template-columns: 1fr; gap: 22px; }
}

/* ---------- toolbox page ---------- */

.page-head {
  position: relative;
  padding: calc(var(--nav-h) + 72px) 0 48px;
  overflow: hidden;
}
.page-head h1 { font-size: clamp(28px, 3.8vw, 40px); margin-bottom: 16px; }
.page-head .sec-sub { max-width: 640px; }

.tb-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tb-toc a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg1);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 6px 12px;
}
.tb-toc a:hover { color: var(--text); border-color: var(--violet); text-decoration: none; }

.tb-item { padding: 60px 0; border-top: 1px solid var(--border); }
.tb-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 52px;
  align-items: start;
}
.tb-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.tb-back {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-3);
  white-space: nowrap;
  align-self: flex-start;
  padding-top: 6px;
}
.tb-back:hover { color: var(--green); }
.tb-head .feature-icon { margin-bottom: 0; flex: none; }
.tb-head h2 { margin: 0; font-size: clamp(20px, 2.3vw, 25px); }
.tb-lede { color: var(--text); font-size: 17px; font-weight: 600; margin: 0 0 14px; }
.tb-info > p { color: var(--text-2); font-size: 15px; margin: 0 0 14px; }
.tb-info code { color: var(--blue); font-size: 0.88em; overflow-wrap: anywhere; }
.tb-more { font-size: 14px; margin-bottom: 0 !important; }
.tb-example .term-body { min-height: 0; font-size: 12px; }
.tb-note { color: var(--text-3); font-size: 12.5px; margin: 10px 2px 0; }

@media (max-width: 900px) {
  .tb-grid { grid-template-columns: 1fr; gap: 28px; }
  .tb-item { padding: 44px 0; }
}

/* ---------- screenshots ---------- */

.shots-tabsets {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.shots-group {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.shots-group-label {
  flex: 0 0 150px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
  padding-top: 10px;
}

.shots-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.shot-tab {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg1);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.shot-tab:hover { border-color: var(--border-strong); color: var(--text); }
.shot-tab.active {
  border-color: var(--violet);
  color: var(--violet);
  background: rgba(167, 139, 250, 0.08);
}

.shot-stage {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.shot-frame {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  background: #0d0f16;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 640px;
  cursor: zoom-in;
}
.shot-frame img {
  max-width: 100%;
  max-height: 640px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}
.shot-frame.tall img {
  width: 100%;
  height: 640px;
  max-height: none;
  object-fit: cover;
  object-position: top center;
}

.shot-frame.termmode { max-height: none; cursor: default; }
.shot-frame.graphmode { max-height: none; cursor: default; }
.shot-frame img[hidden] { display: none; }
.shot-term { width: 100%; }
.shot-term .term-body { font-size: 12px; min-height: 0; }
/* the frame is the window chrome — strip the nested terminal's own */
.shot-frame.termmode .term {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.shot-graph {
  width: 100%;
  height: 640px;
  border: 0;
  display: block;
  background: #0d0f16;
}
.shot-graph[hidden] { display: none; }

.shot-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 0 4px;
}
.shot-caption p { margin: 0; color: var(--text-2); font-size: 14px; }
.shot-caption .hint { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 6, 10, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 26px;
  font-size: 30px;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
}

/* ---------- performance ---------- */

.perf-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px;
  align-items: start;
}

.perf-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14.5px;
}
.perf-table th, .perf-table td {
  padding: 13px 18px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.perf-table th:first-child, .perf-table td:first-child { text-align: left; }
.perf-table thead th {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: var(--bg2);
  font-weight: 600;
}
.perf-table tbody tr:last-child td { border-bottom: none; }
.perf-table td { color: var(--text-2); font-variant-numeric: tabular-nums; }
.perf-table td:first-child { color: var(--text); font-weight: 500; }
.perf-table .speedup {
  font-family: var(--mono);
  color: var(--green);
  font-weight: 700;
}
.perf-table tr.total td {
  background: rgba(167, 139, 250, 0.05);
  color: var(--text);
  font-weight: 600;
}
.perf-table tr.total td.speedup { color: var(--green); }
.perf-table thead th code { text-transform: none; font-size: inherit; }

.perf-note { font-size: 13px; color: var(--text-3); margin-top: 14px; }

.perf-why { display: flex; flex-direction: column; gap: 14px; }

.why-item {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.why-item .dot {
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-top: 7px;
}
.why-item h4 { margin: 0 0 3px; font-size: 14.5px; font-weight: 650; }
.why-item p { margin: 0; font-size: 13.5px; color: var(--text-2); }

/* ---------- architecture ---------- */

.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin-bottom: 36px;
  position: relative;
}

.stage {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 20px 16px 18px;
  text-align: center;
  margin: 0 14px;
}
.stage::after {
  content: "→";
  position: absolute;
  right: -24px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--violet);
  font-size: 18px;
  font-family: var(--mono);
}
.stage:last-child::after { content: none; }

.stage-name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  color: var(--violet);
}
.stage-desc { font-size: 12.5px; color: var(--text-3); margin-top: 6px; line-height: 1.45; }

.arch-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.arch-note {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-left: 3px solid var(--violet);
  border-radius: 10px;
  padding: 20px 22px;
}
.arch-note h4 { margin: 0 0 8px; font-size: 15.5px; }
.arch-note p { margin: 0; font-size: 14px; color: var(--text-2); }
.arch-note code { font-size: 12.5px; color: var(--magenta); }

/* ---------- quick start ---------- */

.qs-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 44px;
  align-items: start;
}

.qs-info h3 { font-size: 16px; margin: 26px 0 8px; font-weight: 650; }
.qs-info p { color: var(--text-2); font-size: 14.5px; margin: 0 0 6px; }
.qs-info ul { color: var(--text-2); font-size: 14.5px; margin: 6px 0; padding-left: 20px; }
.qs-info li { margin: 4px 0; }
.qs-info code { color: var(--magenta); font-size: 0.9em; }

.codeblock {
  position: relative;
  background: #0d0f16;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
}
.codeblock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
}
.copy-btn {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--bg3);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.copy-btn:hover { color: var(--text); border-color: var(--violet); }
.codeblock pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
}
.codeblock .c { color: var(--text-3); }
.codeblock .p { color: var(--green); font-weight: 700; }
.codeblock .cmd { color: var(--text); }

/* ---------- handbook ---------- */

.handbook-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.parts-lead {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0 0 14px;
}

.parts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.part {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
  display: block;
}
.part:hover {
  text-decoration: none;
  border-color: var(--violet);
  background: var(--bg2);
  transform: translateY(-2px);
}
.part-num {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--green);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.part h3 { font-size: 15.5px; margin: 10px 0 8px; font-weight: 650; line-height: 1.3; }
.part p { font-size: 12.5px; color: var(--text-3); margin: 0; line-height: 1.5; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--border);
  background: var(--bg1);
  padding: 48px 0 40px;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
}
.footer-brand svg { width: 22px; height: 22px; }

.footer-meta { font-size: 13px; color: var(--text-3); margin-top: 10px; max-width: 44em; }
.footer-meta a { color: var(--text-2); }

.footer-links {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-links h4 {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin: 0 0 12px;
}
.footer-links ul { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin: 7px 0; }
.footer-links a { color: var(--text-2); font-size: 13.5px; }
.footer-links a:hover { color: var(--text); }

/* ---------- reveal animation ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .t-cursor { animation: none; }
  .btn:hover, .feature:hover, .part:hover { transform: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 1190px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero { padding-top: calc(var(--nav-h) + 48px); padding-bottom: 64px; }
}

@media (max-width: 1000px) {
  .pillars, .features { grid-template-columns: 1fr 1fr; }
  .perf-grid { grid-template-columns: 1fr; }
  .qs-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .parts { grid-template-columns: repeat(3, 1fr); }
  .pipeline { grid-template-columns: 1fr; gap: 26px; }
  .stage { margin: 0; }
  .stage::after {
    content: "↓";
    right: auto;
    left: 50%;
    top: auto;
    bottom: -24px;
    transform: translateX(-50%);
  }
  .arch-notes { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  section { padding: 64px 0; }
  .nav-inner { gap: 12px; }
  .theme-toggle { width: 40px; height: 40px; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg0);
    border-bottom: 1px solid var(--border-strong);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    padding: 8px 24px 18px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 4px; font-size: 15px; border-bottom: 1px solid var(--border); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-github { margin-top: 12px; justify-content: center; }
  .nav-toggle { display: block; }
  .stats-inner { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--border); }
  .pillars, .features { grid-template-columns: 1fr; }
  .parts { grid-template-columns: 1fr; }
  .shots-group { flex-direction: column; gap: 8px; }
  .shots-group-label { flex: none; padding-top: 0; }
  .perf-grid > .reveal { overflow-x: auto; }
  .perf-table { font-size: 13px; }
  .perf-table th, .perf-table td { padding: 11px 10px; }
  .term-body { font-size: 11px; min-height: 330px; }
  .footer-inner { flex-direction: column; }
}
