:root {
  --bg: #14100a;
  --bg2: #1b150d;
  --surface: #211a10;
  --surface-2: #2a2114;
  --border: #463821;
  --primary: #f5a623;
  --accent: #ffb300;
  --text: #fdf6e8;
  --muted: #b6a482;
  --text-soft: #e6d9bd;
  --grad1: #ffffff;
  --grad2: #ffd98a;
  --glow1: rgba(245, 166, 35, 0.16);
  --glow2: rgba(255, 179, 0, 0.22);
  --shadow: rgba(0, 0, 0, 0.55);
  --shadow-sm: rgba(0, 0, 0, 0.4);
  --nav-bg: rgba(20, 16, 10, 0.6);
  --ok: #6fcf6f;
  --radius: 16px;
  --maxw: 1120px;
  --font:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter,
    Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Light theme — the inline head script sets data-theme before first paint
   (System resolves via prefers-color-scheme), so there is no flash. */
:root[data-theme="light"] {
  --bg: #fffaf0;
  --bg2: #fff3da;
  --surface: #ffffff;
  --surface-2: #fff6e4;
  --border: #f0e0bf;
  --primary: #c97f04;
  --accent: #e08a00;
  --text: #2a1f0c;
  --muted: #7a6a48;
  --text-soft: #4a3c20;
  --grad1: #3a2c0e;
  --grad2: #b5781a;
  --glow1: rgba(245, 166, 35, 0.14);
  --glow2: rgba(224, 138, 0, 0.14);
  --shadow: rgba(80, 60, 20, 0.16);
  --shadow-sm: rgba(80, 60, 20, 0.12);
  --nav-bg: rgba(255, 250, 240, 0.74);
  --ok: #2e9e2e;
}

:root {
  color-scheme: dark light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--glow1), transparent 60%),
    var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 100;
}

/* ---------------- Nav ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--text);
  font-size: 18px;
}
.brand:hover {
  text-decoration: none;
}
.brand .logo {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px var(--shadow-sm));
}
img.logo {
  width: 1em;
  height: 1em;
  vertical-align: middle;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Theme switcher — 3-state segmented control (System / Light / Dark) */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.ts-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    transform 0.1s ease;
}
.ts-opt:hover {
  color: var(--text);
}
.ts-opt:active {
  transform: scale(0.92);
}
.ts-opt[aria-checked="true"] {
  background: var(--primary);
  color: #1a1206;
}
.ts-opt:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 22px 24px;
}
.glow {
  position: absolute;
  inset: -120px 0 auto 0;
  height: 420px;
  background: radial-gradient(
    600px 280px at 30% 20%,
    var(--glow2),
    transparent 70%
  );
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 44px;
  align-items: center;
}
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.brand-lockup .logo {
  font-size: 60px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px var(--shadow));
}
.brand-lockup .wordmark {
  font-size: 34px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  margin: 14px 0 10px;
}
.hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 800;
  margin: 0 0 16px;
  background: linear-gradient(180deg, var(--grad1), var(--grad2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hl {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  font-size: 18px;
  color: var(--text-soft);
  max-width: 38ch;
}
.cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 18px;
}
.cta.center {
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    border 0.15s ease,
    background 0.15s ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #1a1206;
  box-shadow: 0 8px 24px var(--glow2);
}
.btn.ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn.ghost:hover {
  border-color: var(--primary);
}
.hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.hero-meta li {
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
}

/* Browser/side-panel mockup */
.hero-media {
  position: relative;
  z-index: 1;
}
.window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px var(--shadow);
  overflow: hidden;
}
.window-bar {
  display: flex;
  gap: 7px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.window-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #d9a441;
  opacity: 0.5;
}
.window-bar span:first-child {
  opacity: 0.85;
}

/* Demo video */
.demo-frame {
  max-width: 960px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 30px 80px var(--shadow);
  overflow: hidden;
}
.demo-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1466 / 824;
  background: #14100a;
}
.demo-fallback {
  padding: 18px;
  color: var(--muted);
}
.panel {
  padding: 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 14px;
}
.panel-head .logo {
  font-size: 20px;
}
.mock-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 12px;
}
.mock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 9px;
}
.mock-row .t {
  font-size: 13.5px;
  font-weight: 600;
}
.mock-row .s {
  font-size: 11.5px;
  color: var(--muted);
}
.pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill.score {
  background: rgba(111, 207, 111, 0.16);
  color: var(--ok);
}
.pill.stage {
  background: var(--glow2);
  color: var(--primary);
}
.mock-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--bg2);
  overflow: hidden;
  margin: 2px 0 0;
}
.mock-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* ---------------- Sections ---------------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 22px;
}
.section h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 800;
  margin: 0 0 10px;
  text-align: center;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  max-width: 60ch;
  margin: 0 auto 32px;
  font-size: 16.5px;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.cards.two {
  grid-template-columns: repeat(2, 1fr);
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition:
    transform 0.18s ease,
    border 0.18s ease,
    box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 16px 40px var(--shadow-sm);
}
.card.accent {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}
.card .ic {
  font-size: 26px;
  margin-bottom: 10px;
}
.card h3 {
  font-size: 18px;
  margin: 0 0 8px;
}
.card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14.5px;
}
.card code {
  font-family: var(--mono);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12.5px;
}

/* Showcase */
.showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: center;
}
.showcase-copy h2 {
  text-align: left;
}
.ticks {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}
.ticks li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 12px;
  color: var(--text-soft);
}
.ticks li::before {
  content: "🐝";
  position: absolute;
  left: 0;
  top: 0;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  counter-reset: step;
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  position: relative;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #1a1206;
  margin-bottom: 12px;
}
.step h3 {
  font-size: 16px;
  margin: 0 0 6px;
}
.step p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 760px;
  margin: 0 auto;
}
.chips code {
  font-family: var(--mono);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-soft);
}
.chips.muted-chips code {
  background: var(--bg2);
  color: var(--muted);
}
.chips + .chips {
  margin-top: 14px;
}

/* Privacy band */
.privacy {
  text-align: center;
}

/* Creator */
.creator-card {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 760px;
  margin: 0 auto;
}
.creator-card .avatar {
  border-radius: 16px;
  flex-shrink: 0;
}
.creator-card h2 {
  text-align: left;
  font-size: 22px;
  margin: 0 0 4px;
}
.creator-card .role {
  color: var(--primary);
  font-weight: 600;
  margin: 0 0 10px;
}
.creator-card p {
  color: var(--text-soft);
  margin: 0 0 14px;
}
.creator-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Footer */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 22px 56px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.footer .brand {
  justify-content: center;
  font-size: 16px;
  margin-bottom: 10px;
}
.footer a {
  color: var(--muted);
}
.footer a:hover {
  color: var(--text);
}

/* ---------------- Inner pages ---------------- */
.page-hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 22px 8px;
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 800;
  margin: 6px 0 14px;
}
.page-hero .lede {
  max-width: none;
  margin: 0 auto;
}
.cards.three {
  grid-template-columns: repeat(3, 1fr);
}
.prose {
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 22px 24px;
}
.prose h2 {
  text-align: left;
  font-size: 24px;
  margin: 34px 0 10px;
}
.prose h3 {
  font-size: 18px;
  margin: 22px 0 6px;
}
.prose p,
.prose li {
  color: var(--text-soft);
  font-size: 15.5px;
}
.prose code {
  font-family: var(--mono);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 13px;
}
.prose .muted {
  color: var(--muted);
  font-size: 14px;
}

/* Security item list */
.seclist {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 880px;
  margin: 0 auto;
}
.seclist li {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.seclist .badge {
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1.4;
}
.seclist h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.seclist p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14.5px;
}

/* Architecture diagram (CSS-drawn) */
.arch {
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}
.arch .layer {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  background: var(--surface);
  position: relative;
}
.arch .layer.trusted {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--border));
  background: linear-gradient(
    180deg,
    rgba(111, 207, 111, 0.08),
    var(--surface)
  );
}
.arch .layer.sandbox {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
}
.arch .layer .tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.arch .layer.trusted .tag {
  background: rgba(111, 207, 111, 0.16);
  color: var(--ok);
}
.arch .layer.sandbox .tag {
  background: var(--glow2);
  color: var(--primary);
}
.arch .layer h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.arch .layer p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-soft);
}
.arch .nest {
  margin-top: 14px;
}
.arch .arrow {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--mono);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 880px) {
  .hero-grid,
  .showcase-grid {
    grid-template-columns: 1fr;
  }
  .hero-media {
    order: -1;
  }
  .cards,
  .cards.three,
  .cards.two {
    grid-template-columns: 1fr;
  }
  .steps {
    grid-template-columns: 1fr 1fr;
  }
  .creator-card {
    flex-direction: column;
  }
}
@media (max-width: 480px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

/* Mobile header: stack the brand above a centered, wrapping nav row. */
@media (max-width: 640px) {
  .nav {
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
  }
  .nav-links {
    width: 100%;
    justify-content: center;
    gap: 12px 16px;
  }
  .nav-links a {
    font-size: 13.5px;
  }
}

/* iOS/iPadOS safe-area insets (notch, rounded corners, home indicator). */
@supports (padding: max(0px)) {
  .nav {
    padding-left: max(22px, env(safe-area-inset-left));
    padding-right: max(22px, env(safe-area-inset-right));
  }
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
