:root {
  --accent: #2A52D6;
  --accent-light: #ADBBFF;
  --accent-dark: #1B3AA0;
  /* Ember: the "special/delight" accent — reserved for premium/highlight
     moments (Pro badge, featured plan, the language-card flip reveal, the
     active carousel dot) so it reads as a deliberate second signal, not
     decoration sprinkled everywhere. --ember-deep is for text-bearing fills
     (needs ~4.5:1 contrast with white text); --ember is for borders/dots/
     accents where no text sits on top of it. */
  --ember: #FF6A39;
  --ember-deep: #C2410C;
  --ink: #14182A;
  --ink-soft: #4B5070;
  --bg: #FFFFFF;
  --bg-soft: #F4F6FC;
  --border: #E3E7F5;
  /* Always dark, regardless of page theme — phone bezels and store badges
     read as "device chrome", not page surface, in either mode. */
  --ink-fixed: #14182A;
  /* Fixed (not theme-swapped) brand-blue-to-navy gradient for the final CTA
     banner. --accent/--accent-dark deliberately turn pale in dark mode (so
     they stay legible as text/border accents on a dark page) — reusing them
     as a full-bleed banner fill made the banner wash out to a bright pastel
     block against the near-black page. This pair stays rich in both themes. */
  --cta-from: #2A52D6;
  --cta-to: #141B33;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --wrap: 1120px;
  --shadow-sm: 0 1px 2px rgba(20,24,42,.06), 0 1px 1px rgba(20,24,42,.04);
  --shadow-md: 0 16px 36px -18px rgba(20,24,42,.28);
  --shadow-lg: 0 30px 60px -20px rgba(20,24,42,.35);

  /* One sans family, weight does the work of hierarchy: IBM Plex Sans
     covers body copy and headings alike (headings just lean on heavier
     weights + tighter tracking), IBM Plex Mono carries anything systematic
     (language codes, eyebrow labels), echoing the app's own precise,
     data-driven SRS engine. Every var ends in the original system stack so
     non-Latin scripts (Arabic, CJK, Cyrillic) fall through to a font that
     actually has those glyphs. */
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Matches the app's own dark theme accent (AppColors.accentDark in
   lib/core/theme/app_colors.dart) so the landing page and the product feel
   like the same brand in dark mode, not just an inverted palette. */
:root[data-theme="dark"] {
  --accent: #7A96FF;
  --accent-light: #2A3B82;
  --accent-dark: #AEC0FF;
  --ember: #FF7F52;
  --ink: #F2F4FC;
  --ink-soft: #A6ACC6;
  --bg: #0B0E1A;
  --bg-soft: #12162A;
  --border: #262C46;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 16px 36px -16px rgba(0,0,0,.55);
  --shadow-lg: 0 30px 70px -20px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }

.feature-card, .plan-card, .faq__item, .lang-card__face,
.lang-switch, .theme-toggle, .store-badge, .btn, .carousel__slide, .carousel__nav {
  transition: background-color .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease, transform .25s ease;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  transition: background-color .25s ease, color .25s ease;
}

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

a { color: inherit; }

h1, h2, h3 {
  line-height: 1.12;
  margin: 0 0 .5em;
  font-weight: 700;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.3rem, 5.2vw, 3.6rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); text-align: center; }
h3 { font-size: 1.28rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; color: var(--ink-soft); }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 .9em;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.section-subheading {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.5em;
  font-size: 1.05rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  border-radius: 999px;
  padding: .75em 1.4em;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--small { padding: .55em 1.1em; font-size: .92rem; }

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  background: var(--ink-fixed);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: .7em 1.2em;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
}
.store-badge:hover { background: var(--accent-dark); transform: translateY(-1px); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background-color .25s ease, border-color .25s ease;
}
[data-theme="dark"] .site-header { background: rgba(11,14,26,.85); }
.site-header__row {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: .55em;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
}
.brand__icon { border-radius: 8px; }
.site-nav {
  display: flex;
  gap: 22px;
  margin-inline-start: auto;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .95rem;
}
.site-nav a:hover { color: var(--accent); }
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.lang-switch {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .4em 1.6em .4em .9em;
  background: var(--bg-soft);
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--ink);
  cursor: pointer;
  flex: none;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle__moon { display: block; }
.theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: block; }

/* Hero */
.hero { position: relative; padding: 88px 0 48px; overflow: hidden; }
/* Ambient gradient blob behind the copy — pure CSS, no image request, kept
   very low-opacity so it reads as depth rather than a background graphic. */
.hero::before {
  content: "";
  position: absolute;
  top: -220px;
  inset-inline-start: 50%;
  width: 1100px;
  height: 780px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--accent-light), transparent 70%);
  opacity: .35;
  pointer-events: none;
  z-index: 0;
}
[data-theme="dark"] .hero::before { opacity: .16; }
.hero__row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 48px;
  align-items: center;
}
.hero__title-line {
  display: block;
  opacity: 0;
  transform: translateY(.4em);
  animation: heroLineIn .8s cubic-bezier(.16,1,.3,1) forwards;
  animation-delay: calc(var(--i) * 130ms + 120ms);
}
@keyframes heroLineIn {
  to { opacity: 1; transform: translateY(0); }
}
.hero__subtitle { font-size: 1.1rem; max-width: 46ch; }
.hero__cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 1.6em 0 1em; }
.hero__secondary-link {
  display: inline-block;
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
  font-size: .95rem;
}
.hero__art { display: flex; justify-content: center; }

/* Phone mockup */
.phone-frame {
  position: relative;
  width: 260px;
  aspect-ratio: 9 / 19.5;
  border-radius: 46px;
  border: 10px solid var(--ink-fixed);
  background: linear-gradient(160deg, var(--accent-light), var(--accent));
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  flex: none;
}
.phone-frame--lg { width: 300px; }
/* Absolute + inset, not width/height:100%: when an ancestor's height comes
   from `aspect-ratio` rather than a literal length (true for every
   .phone-frame, especially the carousel's 9/12 box, which is far off the
   9/19.5 mockup ratio), percentage heights on a replaced element can fail to
   resolve in some engines and the element falls back to its intrinsic size —
   silently breaking object-fit and clipping the top/bottom of the frame.
   Sizing via the positioned containing block instead is unaffected by that. */
.phone-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* contain, not cover: the recordings' aspect ratio is close to but not
   exactly the mockup's, and unlike a screenshot, a few cropped pixels on a
   moving video reads as a bug (text clipped mid-word) rather than an
   intentional crop — so letterbox instead of cutting content off. */
.phone-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--ink-fixed); }
.phone-frame--empty { display: flex; align-items: center; justify-content: center; }

/* Each phone-frame ships a light + dark screenshot; CSS swaps them with the
   page theme instead of re-fetching an image on toggle. */
.theme-img--dark { display: none; }
[data-theme="dark"] .theme-img--light { display: none; }
[data-theme="dark"] .theme-img--dark { display: block; }

/* Scroll-reveal — see assets/js/reveal.js. Scoped under .js (added by the
   blocking inline theme script before paint) so content never depends on
   JavaScript to become visible: no .js class → no opacity:0 rule → the
   element just renders normally. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js [data-reveal].is-revealed { opacity: 1; transform: none; }

/* Features */
.features { padding: 88px 0; background: var(--bg-soft); }
.feature-card__icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}

/* Features carousel — a horizontal scroll-snap track (works with no JS at
   all via touch/trackpad scroll); carousel.js only adds the arrow buttons
   and dot indicators on top. */
.carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: var(--wrap);
  margin: 40px auto 0;
  padding: 0 8px;
}
.carousel__track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 4px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__slide {
  flex: 0 0 auto;
  width: 360px;
  scroll-snap-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px 22px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.carousel__slide:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.carousel__slide .phone-frame {
  /* Sits inside the card as its own floating object — full bezel, radius and
     shadow (just scaled down), rather than the edge-to-edge flattened frame
     this used to be. That flattening was what made the video and the copy
     below it read as one glued-together block instead of two things. */
  width: 280px;
  aspect-ratio: 9 / 19.5;
  border-width: 9px;
  border-radius: 42px;
  box-shadow: var(--shadow-md);
  margin-bottom: 22px;
}
.carousel__copy { padding: 0; align-self: stretch; }
.carousel__copy h3 { margin-bottom: .3em; font-size: 1.05rem; }
.carousel__copy p { margin: 0; font-size: .88rem; }

.carousel__nav {
  flex: none;
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}
.carousel__nav:hover { background: var(--bg-soft); border-color: var(--accent); color: var(--accent); }

.carousel__dots {
  display: flex; justify-content: center; gap: 8px;
  margin-top: 14px;
}
.carousel__dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  padding: 0;
  cursor: pointer;
}
.carousel__dots button.is-active {
  background: var(--ember);
  width: 22px;
  border-radius: 4px;
  transition: width .2s ease, background-color .2s ease;
}

/* Verb spotlight */
.verb-spotlight { padding: 88px 0; }
.verb-spotlight__row {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 56px;
  align-items: center;
}
.verb-spotlight .phone-frame { margin: 0 auto; }

.checklist { list-style: none; padding: 0; margin: 1em 0; }
.checklist li {
  position: relative;
  padding-inline-start: 1.7em;
  margin-bottom: .6em;
  color: var(--ink-soft);
}
.checklist li::before {
  content: "✓";
  position: absolute;
  inset-inline-start: 0;
  color: var(--accent);
  font-weight: 800;
}

/* Languages */
.languages { padding: 88px 0; background: var(--bg-soft); }
.languages__grid {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  max-width: 880px;
  margin-inline: auto;
  perspective: 1400px;
}
.lang-card { list-style: none; }
.lang-card__inner {
  position: relative;
  aspect-ratio: 2.3 / 1;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.2,.8,.2,1);
}
/* Hover/focus is a bonus flourish, not a content gate — the front face
   already carries the real content (the native language name), so nothing
   is ever hidden behind an interaction a touch/keyboard-only visitor can't
   trigger. */
.lang-card:hover .lang-card__inner,
.lang-card:focus-within .lang-card__inner { transform: rotateY(180deg); }
.lang-card__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: var(--radius-sm);
  padding: .9em 1em;
  font-weight: 700;
}
.lang-card__face--front {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
}
.lang-card__face--back {
  background: var(--ember-deep);
  color: #fff;
  transform: rotateY(180deg);
  font-family: var(--font-mono);
  letter-spacing: .08em;
  font-size: .85rem;
  text-transform: uppercase;
}

/* Pricing */
.pricing { padding: 88px 0; }
.pricing__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  max-width: 760px;
  margin: 0 auto;
}
.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
}
.plan-card--featured {
  border-color: var(--ember);
  background: linear-gradient(160deg, var(--bg), var(--bg-soft));
  box-shadow: 0 20px 50px -25px rgba(194,65,12,.35);
}
.plan-card__price { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 .6em; }
.plan-card__badge {
  position: absolute; top: -12px; right: 28px;
  background: var(--ember-deep); color: #fff;
  border-radius: 999px; padding: .3em .9em;
  font-size: .78rem; font-weight: 700;
}

/* FAQ */
.faq { padding: 88px 0; background: var(--bg-soft); }
.faq__list { max-width: 740px; margin: 0 auto; }
.faq__item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 22px;
  margin-bottom: 12px;
}
.faq__item:hover { border-color: var(--accent-light); }
.faq__item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-inline-end: 2px solid var(--accent);
  border-block-end: 2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform .25s ease;
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p { padding-bottom: 14px; }

/* Final CTA */
.final-cta {
  padding: 96px 0;
  text-align: center;
  background: linear-gradient(160deg, var(--cta-from), var(--cta-to));
  color: #fff;
}
.final-cta h2 { color: #fff; white-space: pre-line; }
.final-cta__icon { margin: 0 auto 20px; border-radius: 14px; }
.final-cta__row { display: flex; flex-direction: column; align-items: center; }
.final-cta .hero__cta-row { justify-content: center; }
/* Fixed (not theme-dependent): this badge sits on the always-colored accent
   banner, never on the page background, so it doesn't follow the page theme. */
.final-cta .store-badge { background: #fff; color: var(--ink-fixed); }
.final-cta .store-badge:hover { background: #EDEFF8; }

/* Footer */
.site-footer { padding: 28px 0; border-top: 1px solid var(--border); }
.site-footer__row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .88rem;
  color: var(--ink-soft);
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 880px) {
  .site-nav { display: none; }
  .hero__row, .verb-spotlight__row { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .pricing__grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .hero__cta-row { flex-direction: column; align-items: stretch; }
  /* Arrow buttons compete with the thumb for swipe space on a phone —
     the track is swipeable on its own, so drop them and keep just the dots. */
  .carousel__nav { display: none; }
  .carousel { padding: 0; }
}

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