/* ─── Tokens: light ─── */
:root {
  --ink:        #0B1733;
  --ink-2:      #1a2547;
  --paper:      #FBFAF7;
  --paper-2:    #F2EFE8;
  --rule:       #D8D3C7;
  --signal:     #E63946;
  --muted:      #5a6377;
  --demo-bg:    #0B1733;
  --demo-user:  #8fb4ff;
  --demo-label: #5a6996;
  --demo-text:  #FBFAF7;
  --shadow:     0 30px 60px -20px rgba(11,23,51,0.25);
  --cta-bg:     #1a2547;
  --cta-h2:     #FBFAF7;
  --cta-lede:   #a8b3cc;
}

/* ─── Tokens: dark ─── */
@media (prefers-color-scheme: dark) {
  :root {
    --ink:        #E8E4DC;
    --ink-2:      #C8C2B5;
    --paper:      #0E1220;
    --paper-2:    #161B2C;
    --rule:       #2A3148;
    --muted:      #7A849A;
    --demo-bg:    #070C18;
    --demo-user:  #6fa0f5;
    --demo-label: #3d4a6a;
    --demo-text:  #E8E4DC;
    --shadow:     0 30px 60px -20px rgba(0,0,0,0.6);
    --cta-bg:     #161B2C;
    --cta-h2:     #E8E4DC;
    --cta-lede:   #7A849A;
  }
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: light dark; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 32px; }

@media (max-width: 480px) {
  .container { padding: 0 20px; }
}

/* ─── Nav ─── */
nav {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky; top: 0; z-index: 10;
}
nav .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.logo {
  font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: baseline; flex-shrink: 0;
}
.logo .dot {
  display: inline-block; width: 8px; height: 3px; background: var(--signal);
  margin-left: 2px; transform: translateY(-4px);
}
.nav-links { display: flex; gap: 28px; align-items: center; font-size: 14px; }
.nav-links a { color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav-links a:hover { color: var(--signal); }
.nav-links a.btn-primary { color: var(--paper) !important; }
.nav-links a.btn-primary:hover { color: var(--paper) !important; }

.nav-hamburger {
  display: none; background: none; border: none;
  cursor: pointer; color: var(--ink); padding: 4px;
}
.mobile-menu {
  display: none; flex-direction: column;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 68px; z-index: 9;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 16px 20px;
  color: var(--ink); text-decoration: none; font-size: 15px;
  border-bottom: 1px solid var(--rule);
}
.mobile-menu a:last-child { border-bottom: none; }

@media (max-width: 680px) {
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
}

/* ─── Buttons ─── */
.btn {
  display: inline-block; padding: 10px 18px;
  border-radius: 6px; font-weight: 500; font-size: 14px;
  text-decoration: none; transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: 'Inter', sans-serif;
  border: none; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--paper) !important; }
.btn-primary:hover { background: var(--signal) !important; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-lg { padding: 14px 24px; font-size: 15px; }

/* ─── Hero ─── */
.hero { padding: 96px 0 80px; border-bottom: 1px solid var(--rule); }

@media (max-width: 480px) {
  .hero { padding: 56px 0 48px; }
}

.eyebrow {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--signal); font-weight: 600; margin-bottom: 24px;
}
h1.headline {
  font-family: 'Fraunces', serif; font-weight: 500;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05; letter-spacing: -0.02em;
  max-width: 880px; margin-bottom: 24px;
}
h1.headline em { font-style: italic; color: var(--ink-2); }
.lede {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--muted); max-width: 620px; margin-bottom: 40px;
}
.hero-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero-meta { font-size: 13px; color: var(--muted); margin-top: 16px; }
.hero-meta strong { color: var(--ink); font-weight: 500; }

/* ─── Demo ─── */
.demo {
  margin-top: 72px;
  background: var(--demo-bg);
  border-radius: 12px; padding: 28px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: clamp(12px, 1.5vw, 14px); line-height: 1.7;
  box-shadow: var(--shadow);
  max-width: 880px;
  overflow-x: auto;
}
.demo .user      { color: var(--demo-user); }
.demo .assistant { color: var(--demo-text); }
.demo .cite {
  color: var(--signal); text-decoration: underline;
  text-decoration-color: rgba(230,57,70,0.4);
}
.demo .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--demo-label); margin-top: 16px;
}
.demo .label:first-child { margin-top: 0; }

@media (max-width: 480px) {
  .demo { padding: 20px; margin-top: 48px; }
}

/* ─── Sections ─── */
section { padding: 96px 0; border-bottom: 1px solid var(--rule); }

@media (max-width: 480px) {
  section { padding: 64px 0; }
}

h2 {
  font-family: 'Fraunces', serif; font-weight: 500;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.15; letter-spacing: -0.015em;
  margin-bottom: 16px;
}
.section-lede {
  font-size: clamp(15px, 2vw, 17px); color: var(--muted);
  max-width: 600px; margin-bottom: 56px;
}

@media (max-width: 480px) {
  .section-lede { margin-bottom: 40px; }
}

/* ─── Features ─── */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }

@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, 1fr); gap: 36px; }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; gap: 32px; }
}

.feature h3 {
  font-family: 'Fraunces', serif; font-weight: 500;
  font-size: 21px; margin-bottom: 12px; letter-spacing: -0.01em;
}
.feature .num {
  font-family: 'Fraunces', serif; font-style: italic;
  color: var(--signal); font-size: 14px; margin-bottom: 16px;
}
.feature p { color: var(--muted); font-size: 15px; }

/* ─── How it works ─── */
.how-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start;
}

@media (max-width: 760px) {
  .how-grid { grid-template-columns: 1fr; gap: 40px; }
}

.steps { list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  padding: 24px 0 24px 56px;
  border-top: 1px solid var(--rule);
  position: relative;
}
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 26px;
  font-family: 'Fraunces', serif; font-style: italic;
  color: var(--signal); font-size: 18px;
}
.steps h4 {
  font-family: 'Fraunces', serif; font-weight: 500;
  font-size: 19px; margin-bottom: 6px;
}
.steps p { color: var(--muted); font-size: 14px; }

.compat { background: var(--paper-2); padding: 32px; border-radius: 10px; }
.compat h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted); margin-bottom: 20px;
}
.compat ul { list-style: none; }
.compat li {
  padding: 14px 0; border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 15px;
}
.compat li:last-child { border-bottom: none; }
.compat .ok { color: var(--ink-2); font-size: 13px; font-weight: 500; }

/* ─── Pricing ─── */
.pricing {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  max-width: 880px;
}

@media (max-width: 640px) {
  .pricing { grid-template-columns: 1fr; }
}

.plan {
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 12px; padding: 40px;
}

@media (max-width: 640px) {
  .plan { padding: 28px; }
}

.plan.featured {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
  position: relative;
}
.plan.featured::before {
  content: 'Most chosen';
  position: absolute; top: -12px; right: 24px;
  background: var(--signal); color: white;
  padding: 4px 12px; border-radius: 20px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 600;
}
.plan-name {
  font-family: 'Fraunces', serif; font-size: 22px; font-weight: 500;
  margin-bottom: 8px;
}
.plan-tag    { font-size: 13px; color: var(--muted); margin-bottom: 32px; }
.plan-price  {
  font-family: 'Fraunces', serif; font-size: 48px; font-weight: 500;
  letter-spacing: -0.02em; margin-bottom: 4px;
}
.plan-price span { font-size: 16px; color: var(--muted); font-weight: 400; }
.plan-billing { font-size: 12px; color: var(--muted); margin-bottom: 32px; }
.plan ul { list-style: none; margin-bottom: 32px; }
.plan li {
  padding: 10px 0; font-size: 14px;
  display: flex; align-items: start; gap: 10px;
}
.plan li::before {
  content: '→'; color: var(--signal); flex-shrink: 0; font-size: 13px; margin-top: 2px;
}
.plan .btn { width: 100%; text-align: center; }

.plan.featured .plan-tag    { color: #a8b3cc; }
.plan.featured .plan-price span { color: #a8b3cc; }
.plan.featured .plan-billing { color: #a8b3cc; }
.plan.featured .btn-primary { background: var(--signal); }
.plan.featured .btn-primary:hover { background: white; color: var(--ink); }

/* ─── FAQ ─── */
.faq { max-width: 760px; }
.faq details { border-top: 1px solid var(--rule); padding: 24px 0; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
  font-family: 'Fraunces', serif;
  font-size: clamp(16px, 2.5vw, 19px); font-weight: 500;
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; color: var(--signal); font-size: 24px; font-weight: 300; flex-shrink: 0;
}
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--muted); font-size: 15px; margin-top: 12px; }

/* ─── CTA ─── */
.cta-section { background: var(--cta-bg); border-bottom: none; }
.cta-section h2 { color: var(--cta-h2); }
.cta-section .section-lede {
  color: var(--cta-lede); margin-left: auto; margin-right: auto; text-align: center;
}
.cta-inner { text-align: center; padding: 16px 0; }

/* ─── Footer ─── */
footer { padding: 64px 0 48px; }
.footer-grid {
  display: flex; justify-content: space-between; align-items: end;
  flex-wrap: wrap; gap: 24px;
}
.footer-meta { font-size: 13px; color: var(--muted); }
.footer-meta a {
  color: var(--ink); text-decoration: none;
  margin-right: 16px; display: inline-block; margin-bottom: 4px;
}
.footer-meta a:hover { color: var(--signal); }
.footer-copy { margin-top: 12px; line-height: 1.6; }

@media (max-width: 560px) {
  .footer-grid { flex-direction: column; align-items: start; }
}

/* ─── Language switcher ─── */
.lang-switcher { position: relative; }
.lang-switcher__btn {
  background: none; border: none; cursor: pointer;
  color: var(--ink); font-size: 14px; font-family: 'Inter', sans-serif;
  padding: 4px 8px; border-radius: 4px;
  transition: color 0.15s;
}
.lang-switcher__btn:hover { color: var(--signal); }
.lang-switcher__dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 6px; min-width: 72px; z-index: 20;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  overflow: hidden;
}
.lang-switcher.open .lang-switcher__dropdown { display: block; }
.lang-switcher__dropdown a {
  display: block; padding: 10px 14px; font-size: 13px;
  color: var(--ink); text-decoration: none;
}
.lang-switcher__dropdown a:hover { color: var(--signal); background: var(--paper-2); }

.mobile-menu__lang-divider {
  height: 1px; background: var(--rule);
  margin: 4px 0;
}

/* ─── LP (landing page) nav variant ─── */
.lp-nav .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
