/* ==========================================================================
   index.php — Home page. Restored v2 «سماء الحدوتة» landing content, ported
   onto the v3 token system. Shared v3 components (.btn, .card, .poster,
   .modal-*, .offer-*/.pay-*, .mobile-cta, .toast, .eyebrow, .field/.input,
   .stack, .muted/.center/.hidden, .linklike/.back-step…) already live in
   site.css — do not restyle them here. This file adds ONLY the landing-only
   families the restored markup needs that v3 dropped: .lp-hero and friends,
   .sky/.moon/.star decorative sky, .hero-wave, .hero-points/.hero-posters/
   .hero-preview, .carousel (old auto-loop showcase), .testi/.testi-grid/
   .testi-stars (old testimonial cards — distinct from v3 .testi-card),
   .lp-steps, .lp-features/.feat, .nofriction/.nf-*/.lib-*, .sky-band/.sb-*.

   Flat CSS only (no nesting/:has()) — old-browser / smart-TV safe, matching
   the rest of the v3 stylesheet.
   ========================================================================== */

/* ── Token aliases ─────────────────────────────────────────────────────────
   The ported rules below use the OLD (v2) variable names: --orange/-dark/-soft,
   --cream/-2, --brown/-soft, --card, --gold, --shadow/-sm. site.css ALREADY
   defines every one of those as a legacy alias onto the live v3 tokens (see
   its own :root, "Legacy aliases still referenced by ported component rules
   below"), so nothing needs re-declaring here — the landing inherits the
   current brand/theme automatically. --line and --radius* also already match.

   The closing band keeps its deep-indigo palette as LITERALS inside its own
   rules (see .sky-band below) so it renders identically in both themes. */

/* ==========================================================================
   ✦ Landing hero — warm daylight version: cream/gold wash + golden sparks.
   (The v2 night-sky motif was retired here; the owner prefers the light hero.)
   ========================================================================== */
.lp-hero {
  position: relative; overflow: hidden;
  padding: clamp(30px, 5vw, 66px) 0 clamp(84px, 10vw, 130px);
  background:
    radial-gradient(120% 90% at 50% 108%, rgba(245, 168, 28, .20) 0%, rgba(245, 168, 28, .07) 34%, transparent 60%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
}

/* Hand-placed decorative golden ✦ sparks (aria-hidden markup). */
.lp-hero .sky { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 0; }
.lp-hero .sky .star { position: absolute; color: var(--brand); text-shadow: 0 0 12px rgba(245, 168, 28, .45); line-height: 1; }
.lp-hero .sky .s1 { top: 18%; left: 20%; font-size: 1.1rem; }
.lp-hero .sky .s2 { top: 9%; right: 12%; font-size: 1.35rem; }
.lp-hero .sky .s3 { top: 42%; right: 5%; font-size: .9rem; opacity: .8; }
.lp-hero .sky .s4 { top: 55%; left: 3.5%; font-size: .85rem; opacity: .75; }
@media (prefers-reduced-motion: no-preference) {
  .lp-hero .sky .star { animation: homeTwinkle 2.8s ease-in-out infinite; }
  .lp-hero .sky .s2 { animation-delay: .9s; }
  .lp-hero .sky .s3 { animation-delay: 1.6s; }
  .lp-hero .sky .s4 { animation-delay: 2.2s; }
}
@keyframes homeTwinkle { 0%, 100% { opacity: 1; transform: scale(1) rotate(0); } 50% { opacity: .35; transform: scale(.72) rotate(24deg); } }

/* The cream wave that tucks the sky into the reading room. Theme-safe: the
   inline SVG `fill="#FFF8F0"` presentation attribute is overridden here with
   var(--bg) so dark mode doesn't show a hardcoded cream seam. */
.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(38px, 7vw, 88px); display: block; pointer-events: none; }
.hero-wave path { fill: var(--bg); }

.lp-hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 60px); align-items: center; }
.lp-hero-copy { max-width: 600px; }
.lp-title { font-size: clamp(2.15rem, 5.4vw, 3.7rem); line-height: 1.26; margin: 18px 0 16px; color: var(--ink); }
/* Highlighted word: brand gold, no underline swash (owner request). */
.lp-title .hl { color: var(--brand-strong); }

/* Hero feature checklist — tidy card rows: icon chip + label. */
.hero-points { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 9px; max-width: 52ch; }
.hero-points li {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 9px 12px; box-shadow: 0 4px 14px rgba(43, 33, 19, .05);
  color: var(--ink); font-weight: 700; font-size: clamp(.85rem, 1.5vw, .95rem); line-height: 1.5;
}
.hero-points .hp-ic {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(245, 168, 28, .13); border: 1px solid rgba(245, 168, 28, .38);
  font-size: 1.05rem;
}
.hero-points li { transition: transform .18s ease, box-shadow .18s ease; }
.hero-points li:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(43, 33, 19, .1); }

.lp-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.lp-freenote { margin: 12px 0 0; font-size: .92rem; color: var(--muted); font-weight: 600; }
.lp-trust { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.lp-trust li { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: .92rem; color: var(--ink-soft); }
.lp-trust svg { color: #1f9d5b; flex: 0 0 auto; }

/* Hero preview — a moonlit shelf of real covers. */
.lp-hero-auth { position: relative; display: flex; justify-content: center; }
.nur-glow { position: absolute; top: -10%; right: -8%; bottom: -14%; left: -8%; z-index: 0; pointer-events: none;
  background: radial-gradient(58% 52% at 50% 40%, rgba(246, 190, 79, .38), rgba(255, 140, 66, .12) 46%, transparent 72%); }
@media (prefers-reduced-motion: no-preference) { .nur-glow { animation: homeGlowBreath 7s ease-in-out infinite; } }
@keyframes homeGlowBreath { 0%, 100% { opacity: .82; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }

.hero-preview { position: relative; z-index: 1; width: 100%; max-width: 440px; text-align: center; border: 1px solid rgba(246, 190, 79, .5); box-shadow: 0 0 0 6px rgba(246, 190, 79, .1), 0 24px 60px rgba(0, 0, 0, .4); margin: 0 auto; }
/* Inside the white preview card, the eyebrow goes back to its warm light look. */
.lp-hero .hero-preview .eyebrow { margin-bottom: 16px; background: var(--orange-soft); color: var(--orange-dark); border: 0; box-shadow: none; }
.hero-posters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.hero-posters .poster h3 { margin-top: 8px; font-size: .82rem; }

@media (max-width: 860px) {
  .lp-hero-inner { grid-template-columns: 1fr; }
  /* Mobile portrait: show the «نماذج من القصص» covers card FIRST (owner
     request) — the copy/offer/CTAs follow it. */
  .lp-hero-auth { order: -1; }
}

/* ── Sections ──────────────────────────────────────────────────────────────*/
.lp-section { padding: clamp(36px, 6vw, 70px) 20px; max-width: var(--maxw); margin: 0 auto; width: 100%; }
.lp-sec-head { text-align: center; margin-bottom: clamp(22px, 4vw, 42px); }
.lp-sec-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); margin: 12px 0 0; }

/* Steps — a real bedtime sequence: numbered lanterns on a dotted path. */
.lp-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.lp-steps li { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 24px 26px; box-shadow: var(--shadow-sm); text-align: center; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.lp-steps li:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--orange); }
.lp-steps .num { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 18px; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--brand-ink); background: linear-gradient(160deg, var(--gold), var(--orange) 55%, var(--orange-dark)); box-shadow: 0 8px 18px rgba(242, 116, 31, .35), inset 0 1.5px 0 rgba(255, 255, 255, .4); }
.lp-steps h3 { margin: 0 0 6px; }
.lp-steps p { margin: 0; color: var(--brown-soft); font-size: .96rem; }
@media (prefers-reduced-motion: no-preference) {
  .lp-steps > li:hover .num { animation: homeNumFloat 1.6s ease-in-out infinite; }
}
@keyframes homeNumFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

@media (max-width: 760px) {
  .lp-steps { grid-template-columns: 1fr; }
}

/* Features — the library shelf. */
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.feat:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--orange); }
.feat .ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(160deg, var(--cream-2), var(--orange-soft)); border: 1px solid rgba(242, 116, 31, .16); font-size: 1.65rem; margin-bottom: 12px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8); }
.feat h3 { margin: 0 0 5px; font-size: 1.08rem; line-height: 1.6; }
.feat p { margin: 0; color: var(--brown-soft); font-size: .94rem; }

@media (max-width: 760px) {
  .lp-features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .lp-features { grid-template-columns: 1fr; }
}

/* Card top-accent sweep on hover (shared: steps + features + testimonials). */
.feat::after, .lp-steps > li::after, .testi::after {
  content: ""; position: absolute; top: 0; right: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--gold));
  transform: scaleX(0); transform-origin: right; transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.feat:hover::after, .lp-steps > li:hover::after, .testi:hover::after { transform: scaleX(1); }

/* Benefits section — no-friction hook + library note */
.nofriction { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 14px; }
.nf-pill { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 9px 18px; font-weight: 800; color: var(--brown); box-shadow: var(--shadow-sm); font-size: .98rem; }
.nf-line { text-align: center; max-width: 720px; margin: 0 auto clamp(26px, 4vw, 40px); color: var(--brown-soft); font-weight: 600; font-size: 1.04rem; line-height: 1.85; }
.lib-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; margin: 0 0 30px; }
.lib-head-eyebrow { display: inline-block; font-size: .8rem; font-weight: 800; letter-spacing: .5px; color: var(--orange-dark); background: var(--orange-soft); border: 1px solid rgba(242, 116, 31, .3); border-radius: var(--radius-pill); padding: 5px 16px; }
.lib-head-title { position: relative; font-family: var(--font-display); font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 800; line-height: 1.25; color: var(--brown); padding-bottom: 14px; }
.lib-head-title em { font-style: normal; color: var(--orange-dark); }
.lib-head-title::after { content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 70px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--orange), var(--gold)); }
.lib-note { max-width: 760px; margin: clamp(20px, 3vw, 30px) auto 0; text-align: center; background: var(--cream-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; font-weight: 600; color: var(--brown); line-height: 1.9; }

/* Story carousel — auto-loop + drag-to-scroll (transform-driven via JS). Uses
   the v3 .poster/.poster-img as its card base; only the track/viewport rules
   are landing-specific. */
.carousel { position: relative; direction: ltr; overflow: hidden; max-width: var(--maxw); margin: 0 auto; padding: 8px 0 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.carousel-track { display: flex; width: max-content; will-change: transform; touch-action: pan-y; cursor: grab; }
.carousel-track.dragging { cursor: grabbing; user-select: none; }
.carousel.static .carousel-track { width: 100%; justify-content: center; transform: none !important; cursor: default; }
.carousel-track .poster { flex: 0 0 auto; width: clamp(150px, 30vw, 215px); margin-right: clamp(14px, 3vw, 28px); direction: rtl; }
.carousel-track .poster.car-item { background: none; border: 0; padding: 0; cursor: inherit; font: inherit; color: inherit; }
.carousel-track .poster img { -webkit-user-drag: none; user-select: none; }
.carousel-track .poster h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }

/* Testimonials — warm speech bubbles from real parents (old .testi family —
   distinct from v3's .testi-card, which is unused on this page). */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; grid-auto-rows: 1fr; }
.testi { position: relative; overflow: hidden; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); border-end-start-radius: 6px; padding: 26px 24px 22px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.testi:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--orange); }
.testi::before { content: "\201D"; position: absolute; top: 2px; inset-inline-start: 18px; font-family: var(--font-display); font-size: 3.4rem; line-height: 1; color: var(--orange-soft); pointer-events: none; }
.testi-stars { color: var(--gold); font-size: 1.1rem; letter-spacing: 3px; margin-bottom: 10px; text-shadow: 0 1px 0 rgba(242, 116, 31, .25); }
.testi blockquote { margin: 0; color: var(--brown); font-weight: 600; line-height: 1.95; font-size: 1.02rem; }

@media (max-width: 980px) {
  .testi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .testi-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   ✦ Closing night band — «تصبحوا على حكاية» goodnight CTA (bookends the sky).
   ========================================================================== */
.sky-band { padding: 0 20px clamp(20px, 4vw, 40px); max-width: var(--maxw); margin: 0 auto; width: 100%; }
.sb-inner {
  position: relative; overflow: hidden; text-align: center;
  border-radius: 28px; padding: clamp(36px, 6vw, 64px) clamp(20px, 5vw, 60px);
  background:
    radial-gradient(120% 100% at 50% 118%, rgba(245, 168, 28, .38) 0%, rgba(245, 168, 28, .1) 40%, transparent 64%),
    linear-gradient(180deg, #241a0c 0%, #2e2210 55%, #3a2b12 100%);
  border: 1px solid rgba(245, 168, 28, .35);
  box-shadow: 0 24px 60px rgba(43, 33, 19, .35);
  color: #fbf2e2;
}
.sb-inner::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 70%; pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 14% 30%, rgba(245, 190, 92, .55), transparent 60%),
    radial-gradient(1.2px 1.2px at 30% 14%, rgba(245, 190, 92, .4), transparent 60%),
    radial-gradient(2px 2px at 50% 26%, rgba(246, 190, 79, .7), transparent 60%),
    radial-gradient(1.3px 1.3px at 70% 12%, rgba(245, 190, 92, .45), transparent 60%),
    radial-gradient(1.7px 1.7px at 87% 32%, rgba(246, 190, 79, .6), transparent 60%);
}
@media (prefers-reduced-motion: no-preference) { .sb-inner::before { animation: homeStarBreath 6s ease-in-out infinite; } }
@keyframes homeStarBreath { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.sb-moon { position: relative; display: inline-block; width: 46px; height: 46px; border-radius: 50%; margin-bottom: 10px;
  box-shadow: inset 12px -8px 0 0 var(--gold), 0 0 30px rgba(246, 190, 79, .4); transform: rotate(-16deg); }
.sb-inner h2 { position: relative; color: #fbf2e2; font-size: clamp(1.55rem, 4.4vw, 2.4rem); margin: 0 0 8px; text-shadow: 0 2px 16px rgba(0, 0, 0, .3); }
.sb-inner p { position: relative; color: #d9c9a8; font-weight: 600; margin: 0 auto 20px; max-width: 52ch; }
.sb-price { position: relative; display: inline-flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 0 0 20px; padding: 10px 22px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, .07); border: 1px solid rgba(246, 190, 79, .4); }
.sb-price strong { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--gold); line-height: 1; }
.sb-price s { color: #d9c9a8; font-weight: 700; }
.sb-price em { font-style: normal; background: var(--orange); color: #fff; font-weight: 800; border-radius: var(--radius-pill); padding: 3px 11px; font-size: .78rem; }
.sb-actions { position: relative; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ── Old-browser fallback (LG WebOS / smart-TV Chromium < 88) ─────────────
   The carousel/hero posters rely on .poster-img's aspect-ratio (site.css
   already carries a matching @supports fallback for .poster-img) — nothing
   additional needed here since no NEW aspect-ratio-only box is introduced. */
