/* ==========================================================================
   Qasas — public site design system
   Hand-authored, no build step. RTL-first: use logical properties only
   (margin-inline / padding-block / inset-inline), never left/right.
   Brand tokens mirror the Flutter app (app/lib/core/theme.dart) so the web
   and the app read as one product.
   ========================================================================== */

@font-face {
  font-family: 'Tajawal';
  src: url('/fonts/Tajawal-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Tajawal';
  src: url('/fonts/Tajawal-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light dark;

  /* Brand: --brand is the app's light seed; --ink comes from the logo mark's
     book gradient, used for headings and the hero wash. */
  --brand: #3a7bd5;
  --brand-strong: #2c62b0;
  --ink: #073873;
  --ink-2: #086a9b;
  --accent: #e0a458;

  /* The CTA band is a deliberately dark panel in BOTH themes, so its gradient
     must not be built from --ink (which inverts to near-white in dark mode and
     would leave white text unreadable). These two stay fixed. */
  --band-from: #086a9b;
  --band-to: #073873;

  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --text: #16181d;
  --text-muted: #5b6172;
  --border: #e3e6ef;
  --shadow: 0 1px 2px rgb(7 56 115 / 6%), 0 12px 32px -12px rgb(7 56 115 / 18%);
  --shadow-lg: 0 2px 4px rgb(7 56 115 / 6%), 0 28px 56px -20px rgb(7 56 115 / 28%);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 26px;
  --container: 1120px;

  /* Fluid type scale */
  --fs-display: clamp(2.1rem, 1.35rem + 3.3vw, 3.6rem);
  --fs-h2: clamp(1.55rem, 1.2rem + 1.5vw, 2.25rem);
  --fs-h3: clamp(1.12rem, 1rem + 0.5vw, 1.35rem);
  --fs-body: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --fs-sm: 0.9rem;

  --pad: clamp(1.15rem, 4vw, 2rem);
  --section: clamp(3.5rem, 7vw, 6rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #6ea8fe;
    --brand-strong: #8bbcff;
    --ink: #dce8fb;
    --ink-2: #9cc6ea;
    --accent: #e0a458;

    --bg: #12141a;
    --surface: #191c24;
    --surface-2: #212530;
    --text: #edf0f6;
    --text-muted: #a2a9bb;
    --border: #2b3040;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 12px 32px -12px rgb(0 0 0 / 60%);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 40%), 0 28px 56px -20px rgb(0 0 0 / 70%);
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Tajawal', system-ui, 'Segoe UI', Tahoma, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  line-height: 1.35;
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 {
  font-size: var(--fs-display);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
}
p {
  margin: 0;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

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

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section {
  padding-block: var(--section);
}

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

.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: 1rem;
  z-index: 100;
  background: var(--surface);
  color: var(--text);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.skip-link:focus {
  inset-block-start: 1rem;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-block-end: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover {
  text-decoration: none;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-inline-start: auto;
}
.site-nav a {
  color: var(--text-muted);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.site-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.site-nav a[aria-current='page'] {
  color: var(--brand);
}
.site-nav .btn {
  padding: 0.5rem 1rem;
  font-size: var(--fs-sm);
}

@media (max-width: 620px) {
  .site-nav .nav-link {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .btn:hover {
    transform: none;
  }
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--brand) 75%, transparent);
}
.btn-primary:hover {
  background: var(--brand-strong);
}
@media (prefers-color-scheme: dark) {
  .btn-primary {
    color: #0d1017;
  }
}

.btn-ghost {
  background: transparent;
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
}
.btn-ghost:hover {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}

/* Store badges */
.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1.25rem;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  box-shadow: var(--shadow);
}
.btn-store:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
@media (prefers-reduced-motion: reduce) {
  .btn-store:hover {
    transform: none;
  }
}
@media (prefers-color-scheme: dark) {
  .btn-store {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
  }
}
.btn-store svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
.btn-store span {
  display: block;
  text-align: start;
  line-height: 1.25;
}
.btn-store .store-kicker {
  font-size: 0.68rem;
  opacity: 0.75;
}
.btn-store .store-name {
  font-size: 1.02rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--section);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset-block-start: -35%;
  inset-inline-end: -10%;
  width: min(760px, 85vw);
  aspect-ratio: 1;
  background: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--brand) 26%, transparent),
    transparent 62%
  );
  pointer-events: none;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  inset-block-end: -30%;
  inset-inline-start: -15%;
  width: min(560px, 70vw);
  aspect-ratio: 1;
  background: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--accent) 20%, transparent),
    transparent 65%
  );
  pointer-events: none;
  z-index: 0;
}
.hero > .container {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 920px) {
  .hero > .container {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

.hero-copy > * + * {
  margin-block-start: 1.15rem;
}
.hero-copy h1 {
  text-wrap: balance;
}
.hero-lead {
  font-size: clamp(1.05rem, 0.98rem + 0.45vw, 1.25rem);
  color: var(--text-muted);
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-block-start: 1.75rem !important;
}
.hero-note {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  font-size: var(--fs-sm);
  font-weight: 700;
}

/* Cover collage — three real covers, fanned */
.hero-art {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.6rem, 2vw, 1.1rem);
  align-items: end;
}
.hero-art figure {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--surface-2);
  aspect-ratio: 3 / 4;
}
.hero-art figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-art figure:nth-child(1) {
  transform: rotate(-3deg) translateY(10px);
}
.hero-art figure:nth-child(2) {
  transform: translateY(-14px) scale(1.06);
  z-index: 2;
}
.hero-art figure:nth-child(3) {
  transform: rotate(3deg) translateY(10px);
}
@media (prefers-reduced-motion: reduce) {
  .hero-art figure {
    transform: none !important;
  }
}

/* --------------------------------------------------------------------------
   Stat strip
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stats div {
  background: var(--surface);
  padding: 1.4rem 1rem;
  text-align: center;
}
.stats b {
  display: block;
  font-size: 1.7rem;
  color: var(--ink);
  line-height: 1.2;
}
.stats span {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Section heads
   -------------------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-block-end: 2rem;
}
.section-head p {
  color: var(--text-muted);
  max-width: 58ch;
  margin-block-start: 0.5rem;
}
.section-head a {
  font-weight: 700;
  font-size: var(--fs-sm);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Feature grid
   -------------------------------------------------------------------------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1.1rem;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.feature .ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--brand) 13%, transparent);
  color: var(--brand);
  margin-block-end: 1rem;
}
.feature .ico svg {
  width: 24px;
  height: 24px;
}
.feature h3 {
  margin-block-end: 0.4rem;
}
.feature p {
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* --------------------------------------------------------------------------
   Category chips / cards
   -------------------------------------------------------------------------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
}
.cat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.cat-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 50%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .cat-card:hover {
    transform: none;
  }
}
.cat-card em {
  font-style: normal;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Filter chips (catalog) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
}
a.chip:hover {
  text-decoration: none;
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
}
.chip[aria-current='true'] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}
@media (prefers-color-scheme: dark) {
  .chip[aria-current='true'] {
    color: #0d1017;
  }
}

/* Search bar (catalog) */
.searchbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block-end: 1.25rem;
}
.searchbar label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.55rem 0.35rem 0.55rem;
  padding-inline-start: 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.searchbar label:focus-within {
  border-color: color-mix(in srgb, var(--brand) 60%, transparent);
}
.searchbar input {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  inline-size: 12ch;
  outline: none;
  padding-block: 0.25rem;
}
.searchbar button {
  cursor: pointer;
}

.result-count {
  margin-block-end: 1.25rem;
}

.filters {
  margin-block-end: 2rem;
}

/* --------------------------------------------------------------------------
   Story grid
   -------------------------------------------------------------------------- */
/* Explicit column counts rather than auto-fill: a minmax() large enough to look
   right on desktop collapses to a single column on a 390px phone, which wastes
   the whole viewport on one cover. */
.story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.6rem);
  list-style: none;
  padding: 0;
  margin: 0;
}
@media (min-width: 560px) {
  .story-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 880px) {
  .story-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.story-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: inherit;
}
.story-card:hover {
  text-decoration: none;
}
.story-card .thumb {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 3 / 4;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.story-card:hover .thumb {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
@media (prefers-reduced-motion: reduce) {
  .story-card:hover .thumb {
    transform: none;
  }
}
.story-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-card h3 {
  font-size: 1.02rem;
  line-height: 1.5;
}
.story-card .meta {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* --------------------------------------------------------------------------
   Steps
   -------------------------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  counter-reset: step;
}
.step {
  counter-increment: step;
  padding-block-start: 0.4rem;
}
.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  margin-block-end: 0.9rem;
}
@media (prefers-color-scheme: dark) {
  .step::before {
    color: #0d1017;
  }
}
.step p {
  color: var(--text-muted);
  margin-block-start: 0.35rem;
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.faq {
  display: grid;
  gap: 0.75rem;
  max-width: 820px;
}
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 1.3rem;
  box-shadow: var(--shadow);
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  padding-block: 1rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--brand);
  line-height: 1;
  flex-shrink: 0;
}
.faq details[open] summary::after {
  content: '\2212';
}
.faq details > p {
  color: var(--text-muted);
  padding-block-end: 1.1rem;
}

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  background: linear-gradient(135deg, var(--band-from), var(--band-to));
  border-radius: var(--radius-lg);
  padding: clamp(2.2rem, 5vw, 3.4rem);
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.cta-band h1,
.cta-band h2 {
  color: #fff;
  font-size: var(--fs-h2);
}
.cta-band p {
  color: rgb(255 255 255 / 82%);
  max-width: 52ch;
  margin-inline: auto;
  margin-block-start: 0.75rem;
}
.cta-band .store-row {
  justify-content: center;
  margin-block-start: 1.9rem;
}
.cta-band .btn-store {
  background: #fff;
  color: var(--band-to);
  border: 0;
}
.cta-band .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: center;
  margin-block-start: 1.9rem;
}
.cta-band .actions .store-row {
  margin-block-start: 0;
}
.cta-band .btn-ghost {
  color: #fff;
  border-color: rgb(255 255 255 / 45%);
}
.cta-band .btn-ghost:hover {
  background: rgb(255 255 255 / 12%);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-block-start: 1px solid var(--border);
  margin-block-start: var(--section);
  padding-block: 2.5rem 3rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
}
.site-footer a {
  color: var(--text-muted);
}
.site-footer a:hover {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */
.crumbs {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  padding-block: 1.25rem 0;
}
.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.crumbs li + li::before {
  content: '/';
  margin-inline-end: 0.5rem;
  opacity: 0.5;
}
.crumbs a {
  color: var(--text-muted);
}
.crumbs a:hover {
  color: var(--brand);
}

/* --------------------------------------------------------------------------
   Story page
   -------------------------------------------------------------------------- */
.story-hero {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: 1fr;
  align-items: start;
  padding-block: clamp(1.5rem, 4vw, 2.5rem) 0;
}
@media (min-width: 780px) {
  .story-hero {
    grid-template-columns: minmax(0, 300px) 1fr;
  }
}
.story-cover {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--surface-2);
  aspect-ratio: 3 / 4;
  /* Capped against the viewport too, so on a phone the cover doesn't push the
     title and CTAs below the fold. */
  max-width: min(320px, 62vw);
  margin-inline: auto;
  width: 100%;
}
.story-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-info > * + * {
  margin-block-start: 1rem;
}
.story-info .summary {
  color: var(--text-muted);
  font-size: 1.06rem;
  max-width: 60ch;
}
.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-block-start: 1.6rem !important;
}

/* Teaser: real page content, fading into the install CTA */
.teaser {
  margin-block-start: var(--section);
}
.teaser-inner {
  position: relative;
  display: grid;
  gap: 1.5rem;
  max-width: 900px;
  margin-inline: auto;
}
.teaser-page {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 1.1rem;
  align-items: center;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.1rem, 3vw, 1.8rem);
  box-shadow: var(--shadow);
}
/* Decorative "there is more" fade over the last shown page. The text stays in
   the DOM — this only signals that the story continues in the app. */
.teaser-page.is-last::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  block-size: 38%;
  background: linear-gradient(to bottom, transparent, var(--surface));
  pointer-events: none;
}
@media (min-width: 700px) {
  .teaser-page {
    grid-template-columns: minmax(0, 300px) 1fr;
  }
}
/* Story illustrations are authored 3:4. The ratio is reserved to avoid layout
   shift, and object-fit is `contain` so an off-spec image letterboxes rather
   than losing part of the artwork. */
.teaser-page img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.teaser-page p {
  font-size: clamp(1.08rem, 1rem + 0.5vw, 1.35rem);
  line-height: 2;
  color: var(--text);
}

.teaser-cta {
  text-align: center;
  display: grid;
  gap: 1rem;
  justify-items: center;
  margin-block-start: 2rem;
}
.teaser-cta .remaining {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.teaser-cta .store-row {
  justify-content: center;
}

.related {
  margin-block-start: var(--section);
}

/* --------------------------------------------------------------------------
   Reveal on scroll (progressive enhancement — .js is set by inline script)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .js .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}
