/* ---------- Reset + tokens ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --brand:        #0ea5e9;   /* icy sky blue */
  --brand-2:      #38bdf8;   /* lighter cyan */
  --brand-3:      #0369a1;   /* deeper steel blue */
  --bg:           #f3f7fb;
  --bg-elev:      #ffffff;
  --bg-alt:       #e9eff6;
  --text:         #0b1424;
  --text-2:       #475569;
  --text-3:       #94a3b8;
  --border:       rgba(15, 23, 42, 0.08);
  --shadow:       0 18px 60px -20px rgba(14, 116, 165, 0.28);
  --radius-lg:    18px;
  --radius-md:    12px;
  --radius-sm:    8px;
  --maxw:         1140px;
  --pad:          clamp(20px, 5vw, 56px);
  --font:         -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui,
                  "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:         ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --term-bg:        #0b1424;
  --term-bg-2:      #0f1b30;
  --term-text:      #e2e8f0;
  --term-dim:       #64748b;
  --term-ok:        #34d399;
  --term-hl:        #38bdf8;
  --term-prompt:    #facc15;
}

:root[data-theme="dark"],
:root[data-theme="auto"] {
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg:        #06101e;
    --bg-elev:   #0d1a2d;
    --bg-alt:    #0a1424;
    --text:      #eef4fb;
    --text-2:    #b8c4d4;
    --text-3:    #6b7a8e;
    --border:    rgba(255,255,255,0.07);
    --shadow:    0 24px 80px -20px rgba(0,0,0,0.7);
  }
}
:root[data-theme="dark"] {
  --bg:        #06101e;
  --bg-elev:   #0d1a2d;
  --bg-alt:    #0a1424;
  --text:      #eef4fb;
  --text-2:    #b8c4d4;
  --text-3:    #6b7a8e;
  --border:    rgba(255,255,255,0.07);
  --shadow:    0 24px 80px -20px rgba(0,0,0,0.7);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
a:hover { color: var(--brand); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

img { max-width: 100%; display: block; }

code, pre { font-family: var(--mono); font-size: 0.92em; }
code {
  background: var(--bg-alt);
  padding: 0.12em 0.42em;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.88em;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex; gap: 10px; align-items: center;
  text-decoration: none; color: var(--text);
}
.brand strong { font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  overflow: hidden;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 60%, transparent);
}
.brand-mark img { width: 22px; height: 22px; object-fit: contain; }

.nav-right {
  display: flex; align-items: center; gap: 18px;
}
.nav-right a {
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
}
.nav-right a:hover { color: var(--text); }
.nav-github { color: var(--brand) !important; font-weight: 600 !important; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-2);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all .15s;
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .theme-toggle .sun { display: none; }
  :root[data-theme="auto"] .theme-toggle .moon { display: inline; }
}

@media (max-width: 740px) {
  .nav-right a { display: none; }
  .nav-right .nav-github { display: inline; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(60px, 9vw, 110px) 0 clamp(70px, 10vw, 130px);
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px circle at 80% -10%, rgba(56, 189, 248, 0.22), transparent 60%),
    radial-gradient(700px circle at 10% 110%, rgba(14, 165, 233, 0.18), transparent 60%),
    radial-gradient(500px circle at 50% 50%, rgba(125, 211, 252, 0.08), transparent 70%);
  z-index: 0;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent);
}

.hero h1 {
  font-size: clamp(40px, 6.2vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 16px 0 18px;
}
.grad {
  background: linear-gradient(135deg, var(--brand-2), var(--brand) 55%, var(--brand-3));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--text-2);
  margin: 0 0 28px;
  max-width: 36em;
}
.lede strong { color: var(--text); font-weight: 700; }
.lede em { color: var(--text); font-style: normal; font-weight: 600; }

.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 600; font-size: 15px;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .15s, background .15s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  color: white;
  box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--brand) 55%, transparent);
}
.btn-primary:hover { transform: translateY(-1px); color: white; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.hero-bullets {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 10px;
}
.hero-bullets li {
  font-size: 14px;
  color: var(--text-2);
  padding-left: 22px;
  position: relative;
}
.hero-bullets li::before {
  content: "❄";
  position: absolute; left: 0; top: 0;
  color: var(--brand);
  font-size: 13px;
}

/* ---------- Hero visual: terminal ---------- */
.hero-visual {
  position: relative;
  display: flex; flex-direction: column; align-items: stretch;
}
.terminal {
  width: 100%;
  background: linear-gradient(165deg, var(--term-bg), var(--term-bg-2));
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    0 30px 80px -25px rgba(2, 12, 28, 0.45),
    0 4px 14px -4px rgba(14, 116, 165, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
  color: var(--term-text);
}
.term-chrome {
  display: flex; align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.term-chrome .dot {
  width: 12px; height: 12px; border-radius: 50%;
}
.term-chrome .dot.red    { background: #ff5f57; }
.term-chrome .dot.yellow { background: #febc2e; }
.term-chrome .dot.green  { background: #28c840; }
.term-chrome .term-title {
  flex: 1; text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
}
.term-body {
  padding: 18px 20px 20px;
}
.term-body pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--term-text);
  white-space: pre;
  overflow-x: auto;
}
.term-body .p      { color: var(--term-prompt); font-weight: 700; }
.term-body .cmd    { color: var(--term-text); font-weight: 600; }
.term-body .ok     { color: var(--term-ok); font-weight: 700; }
.term-body .dim    { color: var(--term-dim); }
.term-body .hl     { color: var(--term-hl); font-weight: 600; }
.term-body .caret  {
  color: var(--term-hl);
  animation: blink 1.1s steps(2, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 520px) {
  .term-body pre { font-size: 11.5px; }
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(70px, 10vw, 120px) 0;
  position: relative;
}
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.kicker {
  text-transform: uppercase;
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--brand);
  margin: 0 0 14px;
}
.section h2 {
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  max-width: 22ch;
  line-height: 1.1;
}
.section-lede {
  font-size: 17px;
  color: var(--text-2);
  max-width: 62ch;
  margin: 0 0 56px;
}
.section-lede strong { color: var(--text); font-weight: 700; }
.section-lede em { color: var(--text); font-style: normal; font-weight: 600; }

/* ---------- Features ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }
.card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--brand) 35%, transparent);
}
.card-num {
  position: absolute; top: 18px; right: 22px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  font-feature-settings: "tnum" 1;
}
.card h3 {
  margin: 8px 0 8px;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.card p { margin: 0; color: var(--text-2); font-size: 14.5px; }

/* ---------- Demo ---------- */
.demo-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 30px 80px -30px rgba(14, 116, 165, 0.25);
}
.demo-link {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-decoration: none; color: inherit;
  transition: transform .15s;
}
.demo-link:hover { transform: translateY(-2px); color: inherit; }
.demo-link img {
  max-width: 100%;
  border-radius: 10px;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,0.18));
}
.demo-play {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
}

/* ---------- Architecture ---------- */
.arch {
  margin: 0 0 36px;
  padding: 28px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.arch img {
  max-width: min(100%, 920px);
  height: auto;
  border-radius: 6px;
}
.arch figcaption {
  font-size: 14.5px;
  color: var(--text-2);
  text-align: center;
  max-width: 70ch;
}

.arch-bullets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 800px) { .arch-bullets { grid-template-columns: 1fr; } }
.arch-bullets > div {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}
.arch-bullets h4 {
  margin: 0 0 6px;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--brand);
}
.arch-bullets p { margin: 0; font-size: 14.5px; color: var(--text-2); }

/* ---------- UI section ---------- */
.ui-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
@media (max-width: 700px) { .ui-grid { grid-template-columns: 1fr; } }
.ui-feat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex; gap: 12px; align-items: flex-start;
}
.ui-feat .check {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: var(--brand);
  border-radius: 50%;
  font-weight: 800;
  font-size: 14px;
}
.ui-feat p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.ui-feat strong { color: var(--text); }
.ui-note {
  font-size: 14px; color: var(--text-3);
  margin: 0;
}

.ui-shot {
  margin: 0 0 28px;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
}
.ui-shot img {
  max-width: min(100%, 1000px);
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.ui-shot figcaption {
  font-size: 14px;
  color: var(--text-3);
  text-align: center;
  max-width: 60ch;
}

.ui-subhead {
  margin: 8px 0 14px;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--brand);
  font-weight: 700;
}

.ui-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 22px;
}
@media (max-width: 800px) { .ui-gallery { grid-template-columns: 1fr; } }
.ui-shot-sm {
  margin: 0;
  padding: 10px 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: 10px;
}
.ui-shot-sm img {
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.ui-shot-sm figcaption {
  font-size: 13.5px;
  color: var(--text-2);
  text-align: center;
  margin: 0 4px;
}
.ui-shot-sm strong { color: var(--text); }

/* ---------- Install ---------- */
.install-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: stretch;
}
@media (max-width: 900px) { .install-grid { grid-template-columns: 1fr; } }
.install-cmd {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 24px 22px;
}
.install-cmd pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}
.install-cmd .prompt { color: var(--brand); margin-right: 8px; }
.copy-btn {
  position: absolute; top: 16px; right: 16px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-2);
  font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
}
.copy-btn:hover { color: var(--text); border-color: var(--brand); }
.copy-btn.copied { background: var(--brand); color: white; border-color: var(--brand); }

.install-notes {
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
}
.install-notes p { margin: 0 0 8px; font-size: 15px; }
.install-notes ul { padding-left: 18px; margin: 8px 0 0; color: var(--text-2); font-size: 14px; }
.install-notes ul li { margin: 4px 0; }

.quickstart {
  margin-top: 32px;
}
.quickstart h3 {
  margin: 0 0 14px;
  font-size: 17px;
  color: var(--text-2);
  font-weight: 600;
}
.quickstart-pre {
  margin: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.85;
  overflow-x: auto;
  color: var(--text);
}
.quickstart-pre .prompt { color: var(--brand); margin-right: 8px; }
.quickstart-pre .dim    { color: var(--text-3); }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 10px; max-width: 820px; }
.faq-list details {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  transition: border-color .12s;
}
.faq-list details[open] {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--brand) 35%, transparent);
}
.faq-list summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  font-weight: 400;
  color: var(--text-3);
  font-size: 22px;
  transition: transform .15s;
}
.faq-list details[open] summary::after { content: "−"; color: var(--brand); }
.faq-list details p {
  margin: 12px 0 4px;
  color: var(--text-2);
  font-size: 15px;
}

/* ---------- Footer ---------- */
.footer { padding: 56px 0 32px; background: var(--bg-alt); border-top: 1px solid var(--border); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 40px;
  margin-bottom: 32px;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { margin: 0 0 10px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.footer ul a { color: inherit; text-decoration: none; }
.footer ul a:hover { color: var(--brand); }
.footer-tag { font-size: 14px; color: var(--text-2); margin: 14px 0 0; line-height: 1.55; }
.copy {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.copy a { color: var(--text-2); }

/* ---------- Misc ---------- */
::selection { background: var(--brand); color: white; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
