:root {
  --bg: #0b0e14;
  --bg-alt: #121724;
  --card: #171e2e;
  --text: #e8ecf4;
  --muted: #9aa5b8;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --border: #232c40;
  --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 14, 20, 0.9);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  z-index: 10;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo img { width: 21px; height: 21px; display: block; margin-right: 0.45rem; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% -10%, rgba(79, 140, 255, 0.18), transparent),
    var(--bg);
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  max-width: 640px;
  margin: 1.25rem auto 2rem;
  color: var(--muted);
  font-size: 1.15rem;
}
.cta-row { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn-primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: var(--card); }

/* Screenshot frame */
.shot {
  margin: 3.5rem auto 0;
  max-width: 900px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.shot img { display: block; width: 100%; height: auto; }
.shot-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: repeating-linear-gradient(45deg, var(--bg-alt), var(--bg-alt) 12px, var(--card) 12px, var(--card) 24px);
}

/* Features */
.section { padding: 4.5rem 0; }
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section h2 { font-size: 1.9rem; letter-spacing: -0.02em; margin-bottom: 2rem; text-align: center; }
.section-sub { text-align: center; color: var(--muted); max-width: 640px; margin: -1rem auto 2rem; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .icon { font-size: 1.6rem; margin-bottom: 0.75rem; display: block; }

/* Feature cards (One box section) */
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  border-color: #2e3a56;
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.feature-shot {
  height: 150px;
  background: #0d1220;
  border-bottom: 1px solid var(--border);
}
.feature-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.feature-shot img.mid { object-position: center 30%; }
.feature-card .body { padding: 1.25rem 1.5rem 1.5rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p { color: var(--muted); font-size: 0.95rem; }

.device-terminal { height: 100%; display: flex; flex-direction: column; background: #0a0e17; }
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #10141f;
  border-bottom: 1px solid var(--border);
}
.terminal-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: #39415a; }
.terminal-title {
  margin-left: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.68rem;
  color: var(--muted);
}
.device-terminal pre {
  flex: 1;
  margin: 0;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.73rem;
  line-height: 1.8;
  color: #c9d6ee;
  overflow: hidden;
}
.device-terminal .prompt { color: #3ddc84; }
.device-terminal .response { color: #9aa5b8; }

/* Feature rows (See it in action) */
.feature-rows { display: flex; flex-direction: column; gap: 5.5rem; margin-top: 3.5rem; }
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.eyebrow {
  display: block;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
}
.feature-copy h3 {
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0.6rem 0 1rem;
}
.feature-copy p { color: var(--muted); font-size: 1.08rem; line-height: 1.75; }
.feature-copy p + p { margin-top: 0.85rem; }
.feature-copy code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #0d1220;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}
.feature-media { display: flex; justify-content: center; }

/* Device mockup frames */
.device-phone {
  position: relative;
  width: min(260px, 100%);
  background: #05070d;
  border: 1px solid #2a3450;
  border-radius: 2rem;
  padding: 9px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.device-phone img { display: block; width: 100%; height: auto; border-radius: 1.45rem; }
.device-phone::before, .device-phone::after {
  content: "";
  position: absolute;
  right: -2px;
  width: 3px;
  border-radius: 2px;
  background: #2a3450;
}
.device-phone::before { top: 18%; height: 44px; }
.device-phone::after { top: calc(18% + 54px); height: 26px; }
.phone-pair { display: flex; gap: 1.25rem; align-items: flex-start; }
.phone-pair .device-phone { width: min(220px, 46%); }
.phone-pair .device-phone:last-child { margin-top: 2.5rem; }

.device-browser {
  width: 100%;
  background: #0d1220;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: #151b2b;
  border-bottom: 1px solid var(--border);
}
.browser-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.browser-bar .dot:nth-child(1) { background: #f5655b; }
.browser-bar .dot:nth-child(2) { background: #f6bd3b; }
.browser-bar .dot:nth-child(3) { background: #43c645; }
.browser-url {
  flex: 1;
  margin-left: 8px;
  background: #0b0f1a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 10px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}
.device-browser img { display: block; width: 100%; height: auto; }

.feature-finale { text-align: center; }
.feature-finale .feature-copy { max-width: 640px; margin: 0 auto 2.25rem; }
.device-tv {
  max-width: 760px;
  margin: 0 auto;
  background: #05070d;
  border: 1px solid #232a3a;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}
.device-tv img { display: block; width: 100%; height: auto; border-radius: 4px; }
.tv-stand { width: 220px; margin: 0 auto; }
.tv-stand::before {
  content: "";
  display: block;
  width: 120px;
  height: 20px;
  margin: 0 auto;
  background: linear-gradient(#1a2030, #10141f);
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
}
.tv-stand::after {
  content: "";
  display: block;
  height: 6px;
  background: #141927;
  border-radius: 4px;
}

/* Scroll reveal (JS adds .js to <html>; no-JS users see everything) */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .js .reveal.in-view { opacity: 1; transform: none; }
  .js .reveal.delay-1 { transition-delay: 0.12s; }
  .js .reveal.delay-2 { transition-delay: 0.24s; }
}

@media (max-width: 860px) {
  .feature-rows { gap: 3.5rem; }
  .feature-row { grid-template-columns: 1fr; gap: 1.75rem; }
  .feature-row .feature-media { order: 2; }
  .phone-pair .device-phone:last-child { margin-top: 1.5rem; }
}

/* Ecosystem cards (Made for the stack) */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.stack-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem 1.5rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.stack-card:hover {
  border-color: color-mix(in srgb, var(--tint, var(--accent)) 45%, var(--border));
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.card-media {
  height: 215px;
  margin: -1.75rem -1.5rem 1.25rem;
  padding: 1.25rem 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 100% at 50% 0%, color-mix(in srgb, var(--tint, var(--accent)) 10%, transparent), transparent),
    #0d1220;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-media .device-tv { max-width: 260px; padding: 6px; border-radius: 8px; }
.card-media .device-tv img { border-radius: 3px; }
.card-media .device-browser { max-width: 270px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); }
.card-media .browser-bar { padding: 6px 9px; }
.card-media .browser-bar .dot { width: 7px; height: 7px; }
.card-media .browser-url { font-size: 0.6rem; padding: 1px 8px; }
.card-media .device-phone {
  width: 175px;
  align-self: flex-start;
  margin-top: 1.25rem;
  margin-bottom: -220px;
  padding: 7px;
  border-radius: 1.6rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.card-media .device-phone img { border-radius: 1.15rem; }
.card-media .device-phone::before, .card-media .device-phone::after { display: none; }
.stack-card h3 { font-size: 1.1rem; margin-bottom: 0.15rem; }
.stack-card .role { color: var(--tint, var(--accent)); font-size: 0.82rem; font-weight: 600; margin-bottom: 0.75rem; }
.stack-card > p { color: var(--muted); font-size: 0.95rem; }
.badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.9rem 0 1.1rem; }
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: #0d1220;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  white-space: nowrap;
}
.stack-link {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.stack-link a { color: var(--text); }
.stack-link a:hover { color: var(--tint, var(--accent)); text-decoration: none; }
.stack-link .arrow { color: var(--tint, var(--accent)); transition: transform 0.2s; display: inline-block; }
.stack-card:hover .arrow { transform: translateX(3px); }

/* Hero clarifier + social proof */
.hero-note {
  max-width: 640px;
  margin: 0 auto 1.75rem;
  padding: 0.9rem 1.15rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  color: var(--muted);
  font-size: 1rem;
  text-align: left;
}
.hero-note strong { color: var(--text); }
.hero-note em { font-style: normal; color: var(--accent); font-weight: 600; }

.github-star-wrap { margin-top: 1.25rem; }
.github-star-tile {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 250px;
  padding: 0.65rem 0.7rem 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)), var(--card);
  color: var(--text);
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.github-star-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(79, 140, 255, 0.16), transparent 42%);
  pointer-events: none;
}
.github-star-tile:hover {
  text-decoration: none;
  border-color: #3b4a6b;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(79, 140, 255, 0.08);
}
.github-star-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.github-star-tile > * { position: relative; }
.github-mark { width: 25px; height: 25px; flex: 0 0 auto; }
.github-star-copy { display: flex; flex: 1; flex-direction: column; line-height: 1.25; }
.github-star-label { font-size: 0.9rem; font-weight: 700; }
.github-star-subtitle { margin-top: 0.1rem; color: var(--muted); font-size: 0.72rem; font-weight: 500; }
.github-star-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 58px;
  padding: 0.42rem 0.55rem;
  border: 1px solid rgba(245, 184, 61, 0.22);
  border-radius: 9px;
  background: rgba(245, 184, 61, 0.08);
  color: #f5b83d;
  font-size: 0.86rem;
}
.github-star-count svg { width: 14px; height: 14px; }
.github-star-count b { color: var(--text); font-variant-numeric: tabular-nums; }

.repo-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid rgba(245, 184, 61, 0.18);
  border-radius: 999px;
  background: rgba(245, 184, 61, 0.06);
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.repo-stars svg { width: 13px; height: 13px; color: #f5b83d; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 1.1rem 1.35rem;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1;
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  padding: 0 1.35rem 1.2rem;
  color: var(--muted);
  margin: 0;
}
.faq details p code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; color: #c9d6ee; }

/* Install command block */
.install-cmd {
  display: inline-block;
  background: #0d1220;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  font-size: 1rem;
  overflow-x: auto;
  max-width: 100%;
}
.install-cmd code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #c9d6ee; }
.install-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 100%;
}
.copy-btn {
  display: none; /* shown only when JS is available */
  align-items: center;
  gap: 0.35rem;
  background: #0d1220;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: 600 0.9rem/1 inherit;
  padding: 0 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.js .copy-btn { display: inline-flex; }
.copy-btn:hover { border-color: var(--accent); color: #fff; }
.copy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.copy-btn.copied { border-color: #3fb984; color: #6ee7b7; }

/* Docs layout */
.docs-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; padding: 3rem 0; }
.docs-nav { position: sticky; top: 88px; align-self: start; }
.docs-nav h4 { color: var(--muted); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.08em; margin: 1rem 0 0.5rem; }
.docs-nav a { display: block; color: var(--muted); padding: 0.3rem 0; font-size: 0.95rem; }
.docs-nav a:hover, .docs-nav a.active { color: var(--text); text-decoration: none; }
.docs-content h1 { font-size: 2.1rem; letter-spacing: -0.02em; margin-bottom: 1rem; }
.docs-content h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.docs-content p { color: var(--muted); margin-bottom: 1rem; }
.docs-content pre {
  background: #0d1220;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.docs-content code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #c9d6ee; }
.docs-content ul { color: var(--muted); margin: 0 0 1rem 1.25rem; }
.docs-content img { max-width: 100%; border: 1px solid var(--border); border-radius: 8px; }

@media (max-width: 760px) {
  .docs-wrap { grid-template-columns: 1fr; }
  .docs-nav { position: static; }
}

/* On phones, keep the header uncluttered: drop in-page anchors, keep
   the destinations that leave the page. */
@media (max-width: 600px) {
  .nav-links { gap: 1.1rem; }
  .nav-links a[href="/#features"],
  .nav-links a[href="/#apps"],
  .nav-links a[href="/#faq"] { display: none; }
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* 404 */
.error-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4rem 1.5rem; }
.error-page h1 { font-size: 5rem; letter-spacing: -0.04em; }
.error-page p { color: var(--muted); margin: 0.5rem 0 1.5rem; }
