/* ── StoryTrackr Marketing Site ─── */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --text: #0f172a;
  --text-muted: #64748b;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --white: #ffffff;
  --dark-bg: #0f172a;
  --dark-surface: #1e293b;
  --dark-text: #f1f5f9;
  --dark-muted: #94a3b8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.08);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ─── */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
h3 { font-size: 1.25rem; font-weight: 600; }
p  { color: var(--text-muted); }
.lead { font-size: 1.2rem; line-height: 1.7; }

/* ── Layout ─── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: .75rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }
.mt-2 { margin-top: .75rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* ── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 600;
  cursor: pointer; border: 2px solid transparent;
  transition: all .2s; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--primary); color: var(--white);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  background: transparent; color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-demo {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: var(--white);
}
.btn-demo:hover { opacity: .9; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-lg { padding: .9rem 2rem; font-size: 1.05rem; border-radius: var(--radius); }
.btn-sm { padding: .4rem 1rem; font-size: .85rem; }

/* ── Navigation ─── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; max-width: 1120px; margin: 0 auto;
}
.nav-logo {
  font-size: 1.25rem; font-weight: 800;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-decoration: none;
}
.nav-logo:hover { text-decoration: none; }
.nav-links {
  display: flex; align-items: center; gap: .25rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-muted); font-weight: 500; font-size: .95rem;
  padding: .4rem .75rem; border-radius: var(--radius-sm);
  transition: all .15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--primary); }
.nav-cta { display: flex; align-items: center; gap: .5rem; }
.nav-hamburger {
  display: none; background: none; border: none;
  cursor: pointer; padding: .5rem;
  flex-direction: column; gap: 5px;
}
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .2s; }

/* Mobile nav */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--border); padding: 1rem; gap: .25rem; }
  .nav-links.open { display: flex; }
  .nav-hamburger { display: flex; }
  .nav-cta .btn:not(.btn-demo) { display: none; }
}

/* ── Hero ─── */
.hero {
  padding: 6rem 0 5rem;
  background: linear-gradient(160deg, var(--white) 0%, #f0eeff 100%);
  text-align: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--primary-light); color: var(--primary-dark);
  padding: .3rem .9rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
  margin-bottom: 1.5rem;
}
.hero h1 { margin-bottom: 1.25rem; }
.hero .lead { max-width: 600px; margin: 0 auto 2rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.hero-demo-note { margin-top: .75rem; font-size: .85rem; color: var(--text-muted); }

/* ── Social proof ─── */
.social-proof { padding: 2.5rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.social-proof-inner { display: flex; align-items: center; justify-content: center; gap: 3rem; flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-number { font-size: 2rem; font-weight: 800; color: var(--primary); display: block; }
.stat-label { font-size: .85rem; color: var(--text-muted); }

/* ── Features ─── */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem;
}
.feature-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem; transition: box-shadow .2s, transform .2s;
}
.feature-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.feature-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: var(--primary-light); display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 1rem;
}
.feature-card h3 { margin-bottom: .5rem; color: var(--text); }
.feature-card p { font-size: .95rem; }

/* ── How It Works ─── */
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 2rem; counter-reset: steps; }
.step { text-align: center; }
.step-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: var(--white);
  font-weight: 700; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem;
}
.step h3 { margin-bottom: .4rem; }

/* ── Pricing ─── */
.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 1.5rem;
  align-items: start;
}
.pricing-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2rem; background: var(--white);
}
.pricing-card.featured {
  border-color: var(--primary); background: linear-gradient(160deg, #f5f3ff 0%, var(--white) 100%);
  position: relative;
}
.pricing-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: var(--white);
  font-size: .8rem; font-weight: 700; padding: .2rem .9rem; border-radius: 999px;
}
.plan-name { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: .25rem; }
.plan-price { font-size: 2.5rem; font-weight: 800; color: var(--text); line-height: 1; margin: .75rem 0 .25rem; }
.plan-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.plan-desc { font-size: .9rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.75rem; }
.plan-features li { display: flex; align-items: flex-start; gap: .5rem; font-size: .9rem; }
.plan-features li::before { content: '✓'; color: var(--primary); font-weight: 700; flex-shrink: 0; }
.plan-features li.no::before { content: '–'; color: var(--text-muted); }
.plan-features li.no { color: var(--text-muted); }

/* ── Testimonials ─── */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1.5rem; }
.testimonial-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.testimonial-text { font-style: italic; color: var(--text); line-height: 1.7; margin-bottom: 1rem; }
.testimonial-author { font-weight: 600; font-size: .9rem; }
.testimonial-role { color: var(--text-muted); font-size: .85rem; }

/* ── CTA Banner ─── */
.cta-banner {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  border-radius: var(--radius); padding: 3rem 2rem; text-align: center; color: var(--white);
}
.cta-banner h2 { color: var(--white); margin-bottom: .75rem; }
.cta-banner p { color: rgba(255,255,255,.8); margin-bottom: 2rem; }
.cta-banner .btn { background: var(--white); color: var(--primary); }
.cta-banner .btn:hover { background: var(--primary-light); }
.cta-banner .btn-outline { border-color: rgba(255,255,255,.5); color: var(--white); }
.cta-banner .btn-outline:hover { background: rgba(255,255,255,.1); }

/* ── Security page ─── */
.security-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1.5rem; }
.security-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; background: var(--white); }
.security-icon { font-size: 2rem; margin-bottom: .75rem; }

/* ── Support page ─── */
.faq { display: flex; flex-direction: column; gap: 1rem; max-width: 720px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.faq-q {
  padding: 1rem 1.25rem; font-weight: 600; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface);
}
.faq-q:hover { background: var(--surface-2); }
.faq-a { padding: 0 1.25rem; max-height: 0; overflow: hidden; transition: all .3s; }
.faq-a.open { padding: 1rem 1.25rem; max-height: 500px; }
.faq-a p { margin: 0; }

/* ── Legal pages ─── */
.legal-content { max-width: 720px; margin: 0 auto; }
.legal-content h2 { font-size: 1.4rem; margin: 2rem 0 .5rem; color: var(--text); }
.legal-content p { margin-bottom: 1rem; }
.legal-content ul { margin: .75rem 0 1rem 1.5rem; }
.legal-content li { margin-bottom: .4rem; }

/* ── Footer ─── */
.footer {
  background: var(--dark-bg); color: var(--dark-muted);
  padding: 3rem 0 2rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand { font-size: 1.2rem; font-weight: 800; color: var(--dark-text); margin-bottom: .75rem; }
.footer-tagline { font-size: .9rem; line-height: 1.6; }
.footer-col h4 { color: var(--dark-text); font-size: .9rem; font-weight: 600; margin-bottom: 1rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.footer-col a { color: var(--dark-muted); font-size: .9rem; }
.footer-col a:hover { color: var(--dark-text); }
.footer-bottom {
  border-top: 1px solid #1e293b; padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  font-size: .85rem;
}
.footer-bottom-links { display: flex; gap: 1.5rem; }
.footer-bottom-links a { color: var(--dark-muted); }
.footer-bottom-links a:hover { color: var(--dark-text); }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-ctas { flex-direction: column; align-items: center; }
  .section { padding: 3rem 0; }
}

/* ── Demo button loading state ─── */
.btn-demo.loading { opacity: .7; pointer-events: none; }
.btn-demo.loading::after { content: '...'; }

/* ── Page hero for inner pages ─── */
.page-hero { padding: 4rem 0 3rem; background: linear-gradient(160deg, var(--white) 0%, #f0eeff 100%); }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: .75rem; }
.breadcrumb { font-size: .9rem; color: var(--text-muted); margin-bottom: .5rem; }
.breadcrumb a { color: var(--primary); }

/* ── Table ─── */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; padding: .75rem 1rem; background: var(--surface); font-weight: 600; border-bottom: 1px solid var(--border); }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

/* ── Badge ─── */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .7rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-blue  { background: #dbeafe; color: #1d4ed8; }
.badge-gray  { background: var(--surface-2); color: var(--text-muted); }
