/* ============================================================
   Autolearnify — styles.css
   Warm "index card" aesthetic · light & dark · responsive
   ============================================================ */

:root {
  --bg: #faf6ef;
  --bg-alt: #f3ecdf;
  --surface: #fffdf8;
  --ink: #2b2620;
  --ink-soft: #6b6257;
  --line: #e5dccb;
  --accent: #e0653a;          /* warm coral-orange */
  --accent-soft: #fbe3d8;
  --accent-contrast: #fff8f4;
  --green: #3d8168;
  --green-soft: #ddeee6;
  --gold: #d9a13b;
  --gold-soft: #f6ead0;
  --card-rule: #d9e4f0;       /* index-card blue rule */
  --card-margin: #f0b9b0;     /* index-card red margin */
  --shadow: 0 2px 6px rgba(60, 45, 25, 0.08), 0 12px 32px rgba(60, 45, 25, 0.10);
  --shadow-sm: 0 1px 3px rgba(60, 45, 25, 0.10);
  --radius: 14px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1a16;
    --bg-alt: #26211c;
    --surface: #2c2620;
    --ink: #f0e9de;
    --ink-soft: #a89c8c;
    --line: #3c342b;
    --accent: #ec7548;
    --accent-soft: #47301f;
    --accent-contrast: #fff4ec;
    --green: #6cbf9d;
    --green-soft: #24382f;
    --gold: #e0b25c;
    --gold-soft: #3d3320;
    --card-rule: #3a4656;
    --card-margin: #6e4038;
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }

.eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 34em; }

.underline-accent {
  background: linear-gradient(transparent 62%, var(--accent-soft) 62%);
  padding: 0 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: 0 6px 18px rgba(224, 101, 58, 0.35); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-light { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.btn-sm { padding: 9px 20px; font-size: 0.92rem; }
.btn-block { display: block; text-align: center; }

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 32px; height: 32px; display: inline-flex; }
.logo-mark svg { width: 100%; height: 100%; }
.logo-text { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.logo-text em { font-style: normal; color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links .btn { color: var(--accent-contrast); }
.nav-links .btn:hover { color: var(--accent-contrast); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ============ HERO ============ */
.hero { padding: 72px 0 96px; overflow: hidden; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-copy h1 { margin-bottom: 20px; }
.hero-cta { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.hero-note { margin-top: 16px; font-size: 0.88rem; color: var(--ink-soft); }
.lede { margin-top: 4px; }

/* card stack visual */
.hero-visual { display: flex; justify-content: center; }
.card-stack { position: relative; width: min(400px, 100%); aspect-ratio: 4 / 3; }
.index-card {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.stack-2 { transform: rotate(-4deg) translate(-10px, 10px); }
.stack-3 { transform: rotate(5deg) translate(14px, 18px); }

/* ---------- Flashcard (flip) ---------- */
.flashcard {
  position: absolute;
  inset: 0;
  perspective: 1200px;
  cursor: pointer;
  outline-offset: 4px;
}
.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.1, 0.2, 1);
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(var(--surface) 0 0) padding-box,
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 32px 36px;
  gap: 14px;
  /* index-card ruled lines */
  background-image:
    linear-gradient(to bottom, transparent 0, transparent calc(100% - 1px), var(--card-rule) calc(100% - 1px));
  background-size: 100% 28px;
  background-position: 0 56px;
  background-repeat: repeat-y;
}
.flashcard-face::before {
  /* red margin line like a real index card */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 34px;
  width: 2px;
  background: var(--card-margin);
  opacity: 0.55;
  border-radius: 2px;
}
.flashcard-back { transform: rotateY(180deg); }
.flashcard-back { background-color: var(--surface); }
.card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 999px;
}
.card-q { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; line-height: 1.35; }
.card-a { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--green); }
.card-hint { font-size: 0.78rem; color: var(--ink-soft); }

/* floating chips */
.ai-chip {
  position: absolute;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  animation: float 5s ease-in-out infinite;
}
.chip-1 { top: -18px; right: -8px; color: var(--accent); }
.chip-2 { bottom: -34px; left: 4px; color: var(--green); animation-delay: 2.5s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* ============ STATS ============ */
.stats { border-block: 1px solid var(--line); background: var(--bg-alt); }
.stats-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 30px 24px;
  text-align: center;
}
.stat strong { display: block; font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--ink); }
.stat span { font-size: 0.85rem; color: var(--ink-soft); }

/* ============ SECTIONS ============ */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-sub { margin-top: 14px; color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- Features ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-icon {
  font-size: 1.6rem;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border-radius: 14px;
  margin-bottom: 18px;
}
.feature h3 { margin-bottom: 10px; }
.feature p { color: var(--ink-soft); font-size: 0.97rem; }

/* ---------- Steps ---------- */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  counter-reset: step;
}
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.step-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  margin-bottom: 18px;
}
.step h3 { margin-bottom: 10px; }
.step p { color: var(--ink-soft); font-size: 0.97rem; flex: 1; }
.step-visual { margin-top: 22px; }

.mock-drop, .mock-cards, .mock-review {
  background: var(--bg-alt);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mock-file { font-size: 0.82rem; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; }
.mock-progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.mock-progress span { display: block; height: 100%; width: 70%; border-radius: 3px; background: var(--accent); }
.mock-card {
  font-size: 0.82rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.mock-card em { font-style: normal; color: var(--accent); font-weight: 600; font-size: 0.75rem; }
.mock-review { flex-direction: row; justify-content: center; gap: 10px; }
.mock-pill {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.pill-hard { color: var(--accent); }
.pill-good { color: var(--gold); }
.pill-easy { color: var(--green); }

/* ---------- Demo ---------- */
.demo {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.demo-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--ink-soft);
  font-weight: 500;
}
.demo-flash {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 240px;
}
.demo-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.rate {
  border: 2px solid var(--line);
  background: var(--surface);
  font-size: 0.95rem;
  padding: 11px 22px;
}
.rate-hard:hover { border-color: var(--accent); color: var(--accent); }
.rate-good:hover { border-color: var(--gold); color: var(--gold); }
.rate-easy:hover { border-color: var(--green); color: var(--green); }
.demo-feedback { min-height: 1.4em; font-size: 0.92rem; color: var(--ink-soft); font-weight: 500; }

/* ---------- Testimonials ---------- */
.quote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.quote {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.quote p { font-size: 0.98rem; flex: 1; }
.quote footer { display: flex; align-items: center; gap: 12px; }
.quote footer div { display: flex; flex-direction: column; line-height: 1.3; }
.quote footer strong { font-size: 0.95rem; }
.quote footer span:not(.avatar) { font-size: 0.82rem; color: var(--ink-soft); }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--av, var(--accent));
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  flex-shrink: 0;
}

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 22px;
  box-shadow: var(--shadow-sm);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
  padding: 18px 0;
  position: relative;
  padding-right: 36px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--accent);
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item p { padding: 0 0 20px; color: var(--ink-soft); font-size: 0.96rem; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--accent), #c94f2a);
  color: var(--accent-contrast);
  text-align: center;
}
.cta-banner h2 { color: inherit; margin-bottom: 14px; }
.cta-banner p { opacity: 0.9; margin-bottom: 30px; font-size: 1.08rem; }

/* ---------- Footer ---------- */
.footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 56px 0 0; }
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
}
.footer-brand p { margin-top: 12px; color: var(--ink-soft); font-size: 0.92rem; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); margin-bottom: 4px; }
.footer-col a { text-decoration: none; color: var(--ink); font-size: 0.93rem; }
.footer-col a:hover { color: var(--accent); }
.footer-base {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  padding-bottom: 24px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .ai-chip { animation: none; }
  .flashcard-inner { transition: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy .lede { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .hero-visual { margin-top: 24px; }
  .feature-grid, .steps, .quote-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 20px 24px;
    gap: 18px;
    display: none;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
}

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .hero { padding: 48px 0 72px; }
  .feature-grid, .steps, .quote-grid { grid-template-columns: 1fr; }
  .stats-inner { grid-template-columns: 1fr 1fr; }
}
