/* ============ Tokens ============ */
:root {
  --bg: #060709;
  --bg-1: #0b0e13;
  --bg-2: #11151c;
  --bg-3: #171c25;
  --line: #232a36;
  --line-soft: #1a1f28;
  --text: #e8edf4;
  --text-dim: #9aa7b8;
  --text-faint: #5f6b7d;

  --green: #3cff9c;
  --green-dim: #1f8f5c;
  --violet: #9b7bff;
  --violet-dim: #5f47a8;
  --amber: #ffb648;
  --red: #ff4d6a;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --space-1: 0.4rem;
  --space-2: 0.8rem;
  --space-3: 1.2rem;
  --space-4: 1.8rem;
  --space-5: 2.6rem;
  --space-6: 4rem;
  --space-7: 6rem;

  --radius: 10px;
  --radius-lg: 16px;
  --max-w: 1180px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #060709; --bg-1: #0b0e13; --bg-2: #11151c;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(60,255,156,0.08), transparent 60%),
    radial-gradient(ellipse 800px 600px at 100% 10%, rgba(155,123,255,0.07), transparent 60%);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--space-4); }

.scanline-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: repeating-linear-gradient(
    to bottom, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px,
    transparent 1px, transparent 3px
  );
  mix-blend-mode: overlay;
}

h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 var(--space-2); }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { color: var(--text-dim); margin: 0 0 var(--space-3); }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.glow-text {
  background: linear-gradient(90deg, var(--green), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(60,255,156,0.25));
}

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

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(6,7,9,0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding-top: var(--space-3); padding-bottom: var(--space-3); gap: var(--space-3); }
.brand { display: flex; align-items: center; gap: var(--space-2); color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  font-size: 1.4rem; filter: drop-shadow(0 0 10px rgba(60,255,156,0.8));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-mono); font-weight: 700; font-size: 0.92rem; letter-spacing: 0.04em; color: var(--text); }
.brand-sub { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; color: var(--green); }

.main-nav { display: flex; gap: var(--space-4); }
.main-nav a { color: var(--text-dim); font-size: 0.92rem; font-weight: 600; padding: var(--space-1) 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a:focus-visible { color: var(--text); text-decoration: none; border-color: var(--green); }

.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); }

/* ============ Buttons & Inputs ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--font-sans); font-weight: 700; font-size: 0.95rem;
  padding: 0.85em 1.5em; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.btn-primary { background: linear-gradient(135deg, var(--green), #1fdc84); color: #04160d; box-shadow: 0 0 0 1px rgba(60,255,156,0.3), 0 8px 24px -8px rgba(60,255,156,0.5); }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(60,255,156,0.5), 0 10px 30px -6px rgba(60,255,156,0.65); }
.btn-secondary { background: linear-gradient(135deg, var(--violet), #7657e0); color: #0c0620; box-shadow: 0 0 0 1px rgba(155,123,255,0.3), 0 8px 24px -8px rgba(155,123,255,0.5); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; }

label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-dim); margin-bottom: 0.4em; }
input[type="text"], input[type="email"], textarea, select {
  width: 100%; background: var(--bg-1); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 0.75em 0.9em; font-family: var(--font-sans); font-size: 0.98rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(60,255,156,0.15);
}
.field { margin-bottom: var(--space-3); }

/* ============ Layout helpers ============ */
section { padding: var(--space-6) 0; }
.section-tight { padding: var(--space-5) 0; }
.eyebrow { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); margin-bottom: var(--space-2); }
.grid { display: grid; gap: var(--space-4); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-4); transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: rgba(60,255,156,0.4); box-shadow: 0 0 0 1px rgba(60,255,156,0.15), 0 20px 40px -24px rgba(0,0,0,0.6); }
a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; }

/* ============ Explainer (plain-words teaching) ============ */
.explainer {
  margin-top: 0.5em; font-size: 0.86rem; color: var(--text-dim);
  border-left: 2px solid var(--green-dim); padding-left: 0.8em;
}
.explainer strong { color: var(--text); }
.stat-block { display: flex; flex-direction: column; gap: 0.15em; margin-bottom: var(--space-3); }
.stat-label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.stat-value { font-family: var(--font-mono); font-weight: 700; font-size: 1.5rem; color: var(--text); }
.stat-value.accent { color: var(--green); }
.stat-value.violet { color: var(--violet); }

/* ============ Hero ============ */
.hero { padding: var(--space-7) 0 var(--space-6); text-align: center; }
.hero p.lede { max-width: 640px; margin: 0 auto var(--space-4); font-size: 1.1rem; }
.hero-actions { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; margin-top: var(--space-4); }
.hero-stats { display: flex; justify-content: center; gap: var(--space-6); flex-wrap: wrap; margin-top: var(--space-6); }
.hero-stat { text-align: center; }
.hero-stat .stat-value { font-size: 2.1rem; }

/* ============ Power / memory meters (signature visual) ============ */
.meter {
  position: relative; height: 34px; border-radius: 8px; background: var(--bg-1);
  border: 1px solid var(--line); overflow: hidden; margin: 0.6em 0;
}
.meter-fill {
  position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 8px 0 0 8px;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  box-shadow: 0 0 18px rgba(60,255,156,0.5);
  transition: width 1.1s cubic-bezier(.16,.9,.35,1.1);
}
.meter-fill.overflow {
  background: linear-gradient(90deg, #7a0f24, var(--red));
  box-shadow: 0 0 18px rgba(255,77,106,0.6);
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.12) 0 8px, transparent 8px 16px), linear-gradient(90deg, #7a0f24, var(--red));
}
.meter-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 0.9em; font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700; color: var(--text);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.meter-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em;
  padding: 0.2em 0.6em; border-radius: 999px; margin-left: 0.6em; vertical-align: middle;
}
.meter-tag.ok { background: rgba(60,255,156,0.15); color: var(--green); border: 1px solid rgba(60,255,156,0.35); }
.meter-tag.bad { background: rgba(255,77,106,0.15); color: var(--red); border: 1px solid rgba(255,77,106,0.4); }

.memory-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); background: var(--bg-1); margin-bottom: var(--space-3); }
.memory-panel h4 { margin-bottom: 0.3em; font-size: 1rem; }
.memory-panel .caption { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 0.8em; }

/* ============ Tables ============ */
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.7em 0.9em; border-bottom: 1px solid var(--line-soft); }
th { color: var(--text-faint); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
td.num { font-family: var(--font-mono); }
tr:hover td { background: rgba(255,255,255,0.015); }

/* ============ Badges ============ */
.badge { display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; padding: 0.25em 0.7em; border-radius: 999px; border: 1px solid var(--line); color: var(--text-dim); }
.badge.license { border-color: rgba(60,255,156,0.4); color: var(--green); }

/* ============ Guide picker ============ */
.picker-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); cursor: pointer; background: var(--bg-2); transition: all 0.15s ease; }
.picker-card:hover, .picker-card:focus-visible { border-color: var(--violet); box-shadow: 0 0 0 1px rgba(155,123,255,0.35); }
.picker-card.chosen { border-color: var(--green); box-shadow: 0 0 0 1px rgba(60,255,156,0.4); }

.step-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step-list li { counter-increment: step; position: relative; padding: 0.6em 0 0.6em 2.4em; margin-bottom: 0.4em; }
.step-list li::before {
  content: counter(step); position: absolute; left: 0; top: 0.5em; width: 1.7em; height: 1.7em;
  border-radius: 50%; background: var(--bg-3); border: 1px solid var(--green-dim); color: var(--green);
  font-family: var(--font-mono); font-weight: 700; font-size: 0.82rem; display: flex; align-items: center; justify-content: center;
}

/* ============ Flash ============ */
.flash-wrap { margin-top: var(--space-3); }
.flash { padding: 0.8em 1.1em; border-radius: 8px; margin-bottom: 0.6em; font-size: 0.9rem; }
.flash-error { background: rgba(255,77,106,0.1); border: 1px solid rgba(255,77,106,0.4); color: #ffb3c0; }
.flash-success { background: rgba(60,255,156,0.1); border: 1px solid rgba(60,255,156,0.4); color: var(--green); }

/* ============ Request number ============ */
.request-number {
  font-family: var(--font-mono); font-size: 3rem; font-weight: 800; letter-spacing: 0.02em;
  color: var(--green); text-shadow: 0 0 30px rgba(60,255,156,0.5);
}

/* ============ Footer ============ */
.site-footer { border-top: 1px solid var(--line-soft); padding: var(--space-5) 0; margin-top: var(--space-7); }
.footer-inner { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; font-size: 0.85rem; color: var(--text-dim); }
.footer-note { max-width: 420px; color: var(--text-faint); }

/* ============ Cart ============ */
.cart-nav-link { display: inline-flex; align-items: center; gap: 0.4em; }
.cart-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.4em; height: 1.4em; padding: 0 0.35em; border-radius: 999px;
  background: var(--green); color: #04160d; font-family: var(--font-mono); font-weight: 700; font-size: 0.72rem;
  box-shadow: 0 0 12px rgba(60,255,156,0.5);
}

.qty-stepper {
  display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--bg-1);
}
.qty-btn {
  background: var(--bg-2); border: none; color: var(--text); width: 2.2em; font-family: var(--font-mono);
  font-size: 1rem; cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.qty-btn:hover { background: var(--bg-3); color: var(--green); }
.qty-btn:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.qty-input {
  width: 3em; border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  background: transparent; color: var(--text); text-align: center; font-family: var(--font-mono);
  font-size: 0.95rem; padding: 0.4em 0.2em; -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { outline: none; box-shadow: none; border-color: var(--green); }

.add-to-cart-row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-top: 1rem; }
.btn-sm { padding: 0.6em 1.1em; font-size: 0.85rem; }

.cart-line {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 1.2rem; align-items: center;
  padding: 1rem 0; border-bottom: 1px solid var(--line-soft);
}
.cart-line:last-child { border-bottom: none; }
.cart-line-name { font-weight: 700; }
.cart-line-meta { font-size: 0.78rem; color: var(--text-faint); font-family: var(--font-mono); }
.cart-line-subtotal { font-family: var(--font-mono); font-weight: 700; color: var(--green); text-align: right; min-width: 6.5em; }
@media (max-width: 720px) {
  .cart-line { grid-template-columns: 1fr; gap: 0.6rem; }
  .cart-line-subtotal { text-align: left; }
}

.cart-summary-grid { display: flex; gap: 2.2rem; flex-wrap: wrap; }
.empty-cart { text-align: center; padding: var(--space-6) 0; color: var(--text-dim); }

/* ============ Responsive nav ============ */
@media (max-width: 860px) {
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-1); border-bottom: 1px solid var(--line-soft); flex-direction: column; gap: 0; padding: var(--space-2) var(--space-4); display: none; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 0.9em 0; border-bottom: 1px solid var(--line-soft); }
  .nav-toggle { display: flex; }
}

@media (max-width: 640px) {
  .hero-stats { gap: var(--space-4); }
  .footer-inner { flex-direction: column; }
}
