/* ============================================================
   LEDGER — Marketing site
   Design tokens derived from the actual product screenshots.
   ============================================================ */

:root {
  /* Dark theme (default) */
  --bg: #0a0c13;
  --bg-elevated: #10131d;
  --surface: #141824;
  --surface-hover: #191e2c;
  --surface-border: #232838;
  --text-primary: #f4f5f8;
  --text-secondary: #aab0c2;
  --text-tertiary: #6b7285;

  --indigo: #6366f1;
  --indigo-light: #818cf8;
  --indigo-dim: rgba(99, 102, 241, 0.14);
  --teal: #34d399;
  --teal-dim: rgba(52, 211, 153, 0.14);
  --amber: #fbbf24;
  --amber-dim: rgba(251, 191, 36, 0.14);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.12);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  --shadow-card: 0 1px 2px rgba(0,0,0,0.3), 0 12px 32px -12px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 0 1px rgba(99,102,241,0.15), 0 20px 60px -20px rgba(99,102,241,0.35);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="light"] {
  --bg: #f3f4f8;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f8f9fc;
  --surface-border: #e4e6ee;
  --text-primary: #14161f;
  --text-secondary: #565c72;
  --text-tertiary: #8a90a5;

  --indigo-dim: rgba(99, 102, 241, 0.09);
  --teal-dim: rgba(16, 185, 129, 0.1);
  --amber-dim: rgba(217, 119, 6, 0.1);
  --red-dim: rgba(239, 68, 68, 0.08);

  --shadow-card: 0 1px 2px rgba(20,22,31,0.05), 0 12px 32px -16px rgba(20,22,31,0.15);
  --shadow-glow: 0 0 0 1px rgba(99,102,241,0.12), 0 20px 60px -24px rgba(99,102,241,0.25);
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

button { font-family: inherit; cursor: pointer; }

input, select, textarea { font-family: inherit; }

::selection { background: var(--indigo); color: white; }

:focus-visible {
  outline: 2px solid var(--indigo-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   Layout helpers
   ============================================================ */

.section { padding: 128px 32px; position: relative; }
.section-inner { max-width: 1180px; margin: 0 auto; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--indigo-light);
  margin-bottom: 18px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 820px;
  color: var(--text-primary);
}

.section-sub {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 620px;
  margin-top: 18px;
  line-height: 1.6;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--indigo);
  color: white;
  box-shadow: 0 1px 0 rgba(255,255,255,0.1) inset, 0 8px 20px -8px rgba(99,102,241,0.6);
}
.btn-primary:hover { background: var(--indigo-light); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
}
.btn-ghost:hover { border-color: var(--indigo-light); background: var(--indigo-dim); }

.btn-sm { padding: 9px 16px; font-size: 13.5px; border-radius: 8px; }
.btn-lg { padding: 15px 26px; font-size: 15.5px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ============================================================
   Nav
   ============================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--surface-border);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.brand-mark {
  display: inline-flex;
  color: var(--indigo-light);
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--text-primary); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theme-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  padding: 3px;
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  transition: all 0.2s var(--ease);
}

html[data-theme="light"] .theme-btn[data-theme-set="light"],
html[data-theme="dark"] .theme-btn[data-theme-set="dark"] {
  background: var(--indigo-dim);
  color: var(--indigo-light);
}

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
}
.nav-burger span {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px 32px 20px;
  border-top: 1px solid var(--surface-border);
}
.nav-mobile a {
  padding: 12px 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--surface-border);
}
.theme-toggle-mobile { margin-top: 12px; border-radius: var(--radius-md); }
.theme-toggle-mobile .theme-btn { width: auto; flex: 1; padding: 10px; font-size: 13px; font-weight: 600; }

.nav.mobile-open .nav-mobile { display: flex; }
.nav.mobile-open .nav-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.mobile-open .nav-burger span:nth-child(2) { opacity: 0; }
.nav.mobile-open .nav-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  padding: 88px 32px 100px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -280px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 560px;
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.28), transparent 65%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 0.05s forwards;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 0.15s forwards;
}

.hero-title-accent {
  background: linear-gradient(100deg, var(--indigo-light), #a5b4fc 60%, var(--indigo-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 26px auto 0;
  max-width: 600px;
  font-size: 17.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 0.25s forwards;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 38px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 0.35s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Activation demo (signature element) */
.activation-demo {
  margin-top: 64px;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) 0.45s forwards;
}

.activation-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-glow);
  text-align: left;
}

.activation-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

.activation-input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.activation-input {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: border-color 0.3s var(--ease);
}

.activation-input.is-activating {
  border-color: var(--indigo-light);
}

#activationText {
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: 0.03em;
}

.activation-hint {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

/* ============================================================
   Honesty strip
   ============================================================ */

.honesty-strip {
  border-top: 1px solid var(--surface-border);
  border-bottom: 1px solid var(--surface-border);
  background: var(--bg-elevated);
  padding: 22px 32px;
}

.honesty-inner {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.honesty-inner p {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.honesty-inner strong { color: var(--text-primary); }

/* ============================================================
   Problem section
   ============================================================ */

.problem-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.problem-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.problem-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--indigo) 40%, var(--surface-border)); }

.problem-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.problem-icon-red { background: var(--red-dim); color: var(--red); }
.problem-icon-amber { background: var(--amber-dim); color: var(--amber); }
.problem-icon-indigo { background: var(--indigo-dim); color: var(--indigo-light); }

.problem-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.problem-card p {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   Features
   ============================================================ */

.features { background: var(--bg-elevated); }

.feature-row {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: center;
  padding: 72px 0;
  border-bottom: 1px solid var(--surface-border);
}
.feature-row:first-of-type { padding-top: 60px; }
.feature-row:last-of-type { border-bottom: none; padding-bottom: 0; }

.feature-row-reverse { direction: rtl; }
.feature-row-reverse > * { direction: ltr; }

.feature-index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--indigo-light);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.feature-copy h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.feature-copy > p {
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 22px;
}

.feature-list li {
  position: relative;
  padding-left: 24px;
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-bottom: 11px;
  line-height: 1.5;
}
.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--indigo);
  opacity: 0.7;
}

.feature-visual { position: relative; }

.browser-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-card);
  background: var(--surface);
  transition: transform 0.4s var(--ease);
}
.feature-visual:hover .browser-frame { transform: translateY(-4px); }

.browser-frame img { width: 100%; }

/* ============================================================
   Platforms
   ============================================================ */

.platform-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.platform-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.platform-card:hover { transform: translateY(-3px); }

.platform-active {
  border-color: color-mix(in srgb, var(--indigo) 45%, var(--surface-border));
  background: linear-gradient(160deg, var(--indigo-dim), var(--surface) 60%);
}

.platform-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.platform-active .platform-icon { color: var(--indigo-light); border-color: transparent; background: rgba(99,102,241,0.16); }

.platform-card h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
}

.platform-status {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}
.platform-status-active { background: var(--teal-dim); color: var(--teal); }
.platform-status-planned { background: var(--surface-hover); color: var(--text-tertiary); }

.platform-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.platform-note {
  margin-top: 32px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--indigo-dim);
  border: 1px solid color-mix(in srgb, var(--indigo) 30%, transparent);
  border-radius: var(--radius-md);
  color: var(--indigo-light);
}
.platform-note svg { flex-shrink: 0; margin-top: 2px; }
.platform-note p { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }
.platform-note a { color: var(--indigo-light); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ============================================================
   Security
   ============================================================ */

.security-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: start;
}

.security-list {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.security-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.security-item-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--indigo-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.security-item h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.security-item p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   Early access form
   ============================================================ */

.early-access { background: var(--bg-elevated); }

.early-access-inner { max-width: 640px; text-align: center; }
.early-access-inner .eyebrow,
.early-access-inner .section-title,
.early-access-inner .section-sub { margin-left: auto; margin-right: auto; }
.early-access-inner .section-title { max-width: 100%; }

.access-form {
  margin-top: 44px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-card);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-field { margin-bottom: 20px; }
.form-row .form-field { margin-bottom: 0; }

.form-field label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.optional { font-weight: 400; color: var(--text-tertiary); }

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14.5px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--text-tertiary); }

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--indigo-light);
  box-shadow: 0 0 0 3px var(--indigo-dim);
}

.form-field textarea { resize: vertical; min-height: 80px; }

.form-row { margin-bottom: 20px; }

.access-form .btn-block { margin-top: 6px; position: relative; }

.btn-spinner { display: none; animation: spin 0.8s linear infinite; }

.access-form.is-submitting .btn-label { opacity: 0; }
.access-form.is-submitting .btn-spinner { display: block; position: absolute; }

@keyframes spin { to { transform: rotate(360deg); } }

.form-note {
  margin-top: 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-tertiary);
}

.form-note.is-success { color: var(--teal); font-weight: 600; }
.form-note.is-error { color: var(--red); font-weight: 600; }

/* ============================================================
   Footer
   ============================================================ */

.footer {
  border-top: 1px solid var(--surface-border);
  padding: 48px 32px;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}

.footer-note {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.footer-copyright {
  font-size: 12.5px;
  color: var(--text-tertiary);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-actions .btn { display: none; }

  .problem-grid { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: repeat(2, 1fr); }

  .feature-row,
  .feature-row-reverse {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 32px;
    padding: 48px 0;
  }
  .feature-row-reverse .feature-visual { order: -1; }

  .security-grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 640px) {
  .section { padding: 80px 20px; }
  .hero { padding: 64px 20px 72px; }
  .nav-inner { padding: 14px 20px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-row .form-field { margin-bottom: 20px; }
  .access-form { padding: 24px; }
  .platform-grid { grid-template-columns: 1fr; }
  .activation-input-row { flex-direction: column; }
  .activation-input-row .btn { width: 100%; }
}
