/* ==========================================================================
   Spanish Stories — marketing landing page
   Vanilla CSS. No resets beyond box-sizing. No external requests.
   ========================================================================== */

:root {
  /* Always render in the light palette, regardless of OS appearance. */
  color-scheme: light;

  /* Core */
  --text: #11181c;
  --background: #ffffff;
  --tint: #007aff;
  --icon: #687076;

  /* Semantic surfaces */
  --surface: #f8f8f8;
  --grouped-background: #f2f2f7;
  --card: #ffffff;
  --card-border: #e5e5ea;
  --border: #e0e0e0;

  /* Text hierarchy */
  --text-secondary: #333333;
  --text-tertiary: #444444;
  --text-muted: #666666;

  /* Special backgrounds */
  --selected-background: #e3f2fd;
  --premium-background: #f0f7ff;
  --success-subtle: #e8f5e9;

  /* Gold / mastery */
  --gold: #e8b923;
  --gold-2: #c98a0a;
  --gold-tag-text: #8a6000;
  --gold-border: #d9b65a;
  --gold-bg-wash-start: #fff6de;

  /* Diamond / writing mastery */
  --diamond-start: #a8edff;
  --diamond-mid: #e4f5f9;
  --diamond-end: #a8edff;
  --diamond-border: #7ec8e3;
  --diamond-text: #3a6ea8;

  /* Brand constants (theme-independent) */
  --brand-blue: #007aff;
  --on-accent: #ffffff;
  --success: #4caf50;
  --star: #ffd700;
  --tts-blue: #2563eb;
  --tts-blue-dark: #1d4ed8;

  /* Hero gradient — darker end of the blue ramp so white text passes AA */
  --hero-gradient: linear-gradient(135deg, #1d4ed8 0%, #0a4da8 55%, #063a80 100%);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", Times, serif;

  /* Shape & depth */
  --radius-card: 16px;
  --radius-button: 12px;
  --radius-icon: 22%;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lifted: 0 8px 24px rgba(0, 0, 0, 0.1);

  /* Layout */
  --content-max: 1080px;
  --measure: 65ch;
  --gutter: 20px;

  /* Header */
  --header-bg: rgba(255, 255, 255, 0.78);
}

/* The site renders in the light palette only — no dark-mode override. */
* {
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.1875rem;
}

p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

a {
  color: var(--tint);
}

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

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

.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-button);
  z-index: 100;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 650;
  font-size: 1.0625rem;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-icon);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 550;
  padding: 8px 12px;
  border-radius: var(--radius-button);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background: var(--grouped-background);
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  text-decoration: none;
  padding: 11px 22px;
  border-radius: var(--radius-button);
  border: 1px solid transparent;
  font-weight: 600;
  line-height: 1.25;
  transition: transform 0.15s ease, background-color 0.15s ease,
    border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn .btn-kicker {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
}

.btn .btn-label {
  display: block;
  font-size: 1rem;
  font-weight: 650;
}

/* On the gradient bands */
.btn-on-gradient {
  background: var(--on-accent);
  color: #063a80;
}

.btn-on-gradient:hover {
  background: #f2f6ff;
}

.btn-on-gradient-outline {
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-accent);
  border-color: rgba(255, 255, 255, 0.65);
}

.btn-on-gradient-outline:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--on-accent);
}

/* --------------------------------------------------------------------------
   Gradient bands (hero + download CTA)
   -------------------------------------------------------------------------- */

.band-gradient {
  background: var(--hero-gradient);
  color: var(--on-accent);
}

.band-gradient h1,
.band-gradient h2,
.band-gradient p {
  color: var(--on-accent);
}

.hero {
  padding: 48px 0 64px;
  position: relative;
  overflow: hidden;
}

.hero .wrap {
  position: relative;
}

/* Interactive demo sentence — zero JS, driven by :hover / :focus */

.story {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2rem, 6.4vw, 4.25rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 13em;
}

.story .w {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
  padding: 0 0.04em;
  position: relative;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.story .w::after {
  content: attr(data-en);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: clamp(0.875rem, 1.8vw, 1.0625rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  background: var(--on-accent);
  color: #063a80;
  padding: 9px 13px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease;
  z-index: 2;
}

.story .w:hover,
.story .w:focus {
  color: #11181c;
  background: var(--gold);
  outline: none;
}

.story .w:hover::after,
.story .w:focus::after {
  opacity: 1;
  visibility: visible;
}

.story .w:focus-visible {
  outline: 3px solid var(--on-accent);
  outline-offset: 2px;
}

.hero-hint {
  color: var(--diamond-start);
  font-size: 0.9375rem;
  margin: 22px 0 0;
}

.hero-foot {
  display: grid;
  gap: 32px;
  align-items: center;
  margin-top: 48px;
}

.hero-copy h1 {
  font-size: clamp(1.375rem, 2.6vw, 1.875rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  max-width: 20ch;
}

.hero-note {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.86);
  margin: 0;
}

.hero-art {
  display: flex;
  justify-content: center;
}

.hero-logo {
  width: min(200px, 56vw);
  height: auto;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.3));
}

/* --------------------------------------------------------------------------
   Three ways — leer / escuchar / escribir
   -------------------------------------------------------------------------- */

.way {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.way:last-of-type {
  border-bottom: 1px solid var(--border);
}

.way .big {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.75rem, 9vw, 5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  transition: transform 0.3s ease;
}

.way:hover .big {
  transform: translateX(10px);
}

.way .en {
  display: block;
  margin-top: 8px;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.0625rem;
  letter-spacing: 0;
  color: var(--text-muted);
}

.way p {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 30ch;
}

.way-read .big {
  color: var(--tint);
}

.way-listen .big {
  color: var(--tts-blue);
}

.way-write .big {
  color: var(--diamond-text);
}

/* --------------------------------------------------------------------------
   Mastery climb
   -------------------------------------------------------------------------- */

.climb {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: end;
  min-height: 300px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rung {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.rung .rung-mark {
  font-size: 2rem;
  line-height: 1;
}

.rung b {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.375rem;
  line-height: 1.15;
}

.rung span {
  font-size: 0.9375rem;
}

.rung-read {
  height: 42%;
  background: var(--premium-background);
  border: 1px solid var(--border);
  border-bottom: 0;
  color: var(--text);
}

.rung-read span {
  color: var(--text-muted);
}

.rung-gold {
  height: 70%;
  background: linear-gradient(var(--gold-bg-wash-start), var(--gold));
  border: 1px solid var(--gold-border);
  border-bottom: 0;
  color: var(--gold-tag-text);
}

.rung-diamond {
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--diamond-start),
    var(--diamond-mid),
    var(--diamond-end)
  );
  border: 1px solid var(--diamond-border);
  border-bottom: 0;
  color: #11181c;
}

.rung-diamond span {
  color: var(--diamond-text);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

section {
  padding: 64px 0;
}

.section-head {
  margin-bottom: 36px;
}

.section-head p {
  color: var(--text-muted);
  margin-bottom: 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* How it works */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 24px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow);
}

.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--selected-background);
  color: var(--tts-blue-dark);
  font-weight: 700;
  font-size: 1rem;
}

.steps h3 {
  margin-bottom: 6px;
}

.steps p {
  margin: 0;
  color: var(--text-muted);
}

/* Features */

.feature-grid {
  display: grid;
  gap: 20px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow);
}

.feature-card .feature-icon {
  font-size: 1.75rem;
  line-height: 1;
  display: block;
  margin-bottom: 12px;
}

.feature-card h3 {
  margin-bottom: 6px;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Download CTA band */

.download {
  text-align: center;
  padding: 64px 0;
}

.download p {
  margin-left: auto;
  margin-right: auto;
}

.download .store-buttons {
  justify-content: center;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--grouped-background);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Breakpoints (mobile-first)
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
  :root {
    --gutter: 32px;
  }

  .hero {
    padding: 64px 0 88px;
  }

  .hero-foot {
    grid-template-columns: 1.3fr 0.7fr;
    gap: 48px;
  }

  .way {
    grid-template-columns: 1.1fr 1fr;
    gap: 24px 56px;
    padding: 36px 0;
  }

  section {
    padding: 80px 0;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (min-width: 1280px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }

  .btn:hover {
    transform: none;
  }

  .way:hover .big {
    transform: none;
  }

  .way .big,
  .story .w,
  .story .w::after {
    transition: none;
  }
}
