/* ---------------------------------------------------------------------------
   MyDaddystories — shared site styles.

   One committed visual world: the app's own "Ciel magique" night palette, lit
   by a single source — the glowing book in the hero artwork. Gold is that
   light and is the only accent; everything else stays quiet purple. The page
   is deliberately single-theme (a light mode would betray the product's
   identity), so every colour is painted explicitly rather than inherited.

   Baloo2 is self-hosted rather than pulled from a font CDN: this site carries
   the privacy policy of a children's app, so it makes no third-party requests.
--------------------------------------------------------------------------- */

@font-face {
  font-family: "Baloo2";
  src: url("/fonts/Baloo2-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Baloo2";
  src: url("/fonts/Baloo2-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

:root {
  --night: #120c2b;
  --canvas: #1b1440;
  --paper: #241a54;
  --raised: #2a2060;
  --edge: rgba(207, 196, 242, 0.14);
  --edge-strong: rgba(207, 196, 242, 0.32);
  --ink: #fff7e8;
  --lavender: #cfc4f2;
  --muted: #9f8fe8;
  --gold: #ffc85c;
  --gold-hi: #ffd77a;
  --gold-ink: #2a1e05;

  --display: "Baloo2", "Segoe UI", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

/* Static starfield, drawn once on canvas behind everything. */
#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.page { position: relative; z-index: 1; }

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 2.5rem);
}

a { color: var(--gold-hi); }

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

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero-art {
  display: block;
  width: 100%;
  height: clamp(340px, 56vw, 620px);
  object-fit: cover;
  object-position: 72% center;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  background: linear-gradient(
    98deg,
    rgba(18, 12, 43, 0.96) 0%,
    rgba(18, 12, 43, 0.88) 34%,
    rgba(18, 12, 43, 0.2) 66%,
    rgba(18, 12, 43, 0) 100%
  );
}

.hero-text { max-width: 33rem; }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.9rem;
}

h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
  text-wrap: balance;
  /* The title sits in the lamplight of the artwork. */
  text-shadow: 0 0 42px rgba(255, 200, 92, 0.28);
}

.lede {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--lavender);
  margin: 0;
  text-wrap: pretty;
}

.hero-meta {
  margin: 1.4rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  .hero-art { object-position: 64% top; }
  .hero-scrim {
    align-items: flex-end;
    padding-bottom: 1.75rem;
    background: linear-gradient(
      180deg,
      rgba(18, 12, 43, 0.3) 0%,
      rgba(18, 12, 43, 0.86) 55%,
      rgba(18, 12, 43, 0.99) 100%
    );
  }
}

/* ---------- section rhythm ---------- */
section { padding: clamp(3rem, 7vw, 5.25rem) 0; }

.band {
  background: linear-gradient(180deg, var(--canvas) 0%, var(--night) 100%);
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
}

h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.1;
  margin: 0 0 0.5rem;
  text-wrap: balance;
}

.section-lede {
  color: var(--lavender);
  max-width: 56ch;
  margin: 0 0 2.5rem;
}

/* ---------- steps (a real sequence, hence the numbers) ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: clamp(1.5rem, 4vw, 2.75rem);
  counter-reset: step;
}

.step { position: relative; padding-top: 2.75rem; }

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--gold);
}

.step::after {
  content: "";
  position: absolute;
  top: 2.15rem;
  left: 0;
  width: 2.25rem;
  height: 2px;
  background: linear-gradient(90deg, var(--gold) 0%, transparent 100%);
}

.step h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
}

.step p { margin: 0; color: var(--lavender); font-size: 0.97rem; }

/* ---------- styles filmstrip ---------- */
.strip-scroll { overflow-x: auto; padding-bottom: 0.5rem; }

.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(9.5rem, 1fr);
  gap: clamp(0.75rem, 2vw, 1.1rem);
  min-width: min(100%, 46rem);
}

.style figure { margin: 0; }

.style img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--edge);
}

.style figcaption {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

/* ---------- feature list (editorial, not a card grid) ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 0 clamp(2rem, 5vw, 3.5rem);
  margin: 0;
}

.features div { padding: 1.15rem 0; border-top: 1px solid var(--edge); }

.features dt {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.08rem;
  margin-bottom: 0.2rem;
}

.features dd { margin: 0; color: var(--lavender); font-size: 0.95rem; }

/* ---------- plain lists ---------- */
ul.plain {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 62ch;
}

ul.plain li {
  color: var(--lavender);
  padding-left: 1.4rem;
  position: relative;
}

ul.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

ul.plain strong { color: var(--ink); }

/* ---------- language pills ---------- */
.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.langs li {
  border: 1px solid var(--edge-strong);
  border-radius: 999px;
  padding: 0.45rem 1.15rem;
  font-weight: 600;
  color: var(--lavender);
}

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-hi) 100%);
  color: var(--gold-ink);
  box-shadow: 0 6px 28px rgba(255, 200, 92, 0.18);
}

.btn-secondary {
  color: var(--lavender);
  border: 1px solid var(--edge-strong);
}

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

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:hover { transform: none; }
}

/* ---------- language switcher ---------- */
.langbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: 0.55rem clamp(1.25rem, 5vw, 2.5rem);
  background: rgba(18, 12, 43, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
}

.langbar button {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.langbar button:hover { color: var(--lavender); }

.langbar button.is-on {
  color: var(--gold-hi);
  border-color: var(--edge-strong);
}

/* ---------- store buttons ---------- */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.store {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 60px;
  padding: 0.6rem 1.35rem;
  border-radius: 14px;
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--edge-strong);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.store:hover { transform: translateY(-1px); border-color: var(--gold); }

.store svg { flex-shrink: 0; }

.store-text { display: flex; flex-direction: column; line-height: 1.15; }

.store-small {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
}

.store-big {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .store { transition: none; }
  .store:hover { transform: none; }
}

/* ---------- Arabic: mirror the directional pieces ---------- */
[dir="rtl"] .hero-scrim {
  background: linear-gradient(
    262deg,
    rgba(18, 12, 43, 0.96) 0%,
    rgba(18, 12, 43, 0.88) 34%,
    rgba(18, 12, 43, 0.2) 66%,
    rgba(18, 12, 43, 0) 100%
  );
}

[dir="rtl"] .hero-art { object-position: 28% center; }

[dir="rtl"] .step::before { left: auto; right: 0; }

[dir="rtl"] .step::after {
  left: auto;
  right: 0;
  background: linear-gradient(270deg, var(--gold) 0%, transparent 100%);
}

[dir="rtl"] .step { padding-right: 0; }

[dir="rtl"] ul.plain li { padding-left: 0; padding-right: 1.4rem; }
[dir="rtl"] ul.plain li::before { left: auto; right: 0; }

[dir="rtl"] .doc ul,
[dir="rtl"] .doc ol { padding-left: 0; padding-right: 1.25rem; }

[dir="rtl"] .langbar { justify-content: flex-start; }

@media (max-width: 760px) {
  [dir="rtl"] .hero-art { object-position: 38% top; }
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--edge);
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.87rem;
}

footer a { color: var(--lavender); }

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
}

/* ---------- legal documents (privacy, delete-account) ---------- */
.doc { max-width: 46rem; margin: 0 auto; padding: 3rem 0 4rem; }

.doc-back {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2rem;
}

.doc-back:hover { color: var(--gold-hi); }

.doc h1 {
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  text-shadow: none;
  margin-bottom: 0.35rem;
}

.doc .stamp {
  color: var(--muted);
  font-size: 0.87rem;
  margin: 0 0 2rem;
}

.doc h2 {
  font-size: 1.25rem;
  margin: 2.5rem 0 0.6rem;
  color: var(--gold);
}

.doc p, .doc li { color: var(--lavender); }
.doc p { max-width: 66ch; }
.doc ul, .doc ol { max-width: 66ch; padding-left: 1.25rem; }
.doc li { margin-bottom: 0.5rem; }

.doc .panel {
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.doc .panel p { margin: 0; }

.doc code {
  background: var(--raised);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.9em;
  color: var(--ink);
}
