/* ─────────────────────────────────────────────────────────────────────────────
   Ghazal Talari — Endless Patience
   Palette: warm ember/coral light from the portraits, cool violet/sky from the cover.
   Layout uses logical properties (inline-start/end) so it mirrors for RTL (Farsi).
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --night-0: #07061a;
  --night-1: #0b0922;
  --night-2: #16123a;
  --violet: #7a5cf0;
  --violet-soft: #a794f7;
  --lavender: #d9cfff;
  --sky: #a9bdff;
  --ember: #ff4f45;
  --coral: #ff8a6a;
  --peach: #ffc9a8;
  --ink: #f7f3ff;
  --ink-dim: #cfc8ea;
  --ink-mute: #938cb8;
  --page-ink: #1c1542; /* text on the light "cover" card */

  --font-en-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-en-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-fa: "Vazirmatn", "Tahoma", ui-sans-serif, system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --dir: 1; /* +1 LTR, -1 RTL: flips directional motion */

  color-scheme: dark;
}

html[dir="rtl"] { --dir: -1; }

/* ── Language switching: every string exists in both languages ─────────────── */
html:not([lang="en"]) body [lang="en"],
html:not([lang="fa"]) body [lang="fa"],
html:not([lang="tr"]) body [lang="tr"] { display: none !important; }

/* The toggle's own labels must always show. */
html body .lang-toggle [lang] { display: inline-flex !important; }

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--night-0);
}

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: clip;
  color: var(--ink);
  font-family: var(--font-en-body);
  font-weight: 300;
  line-height: 1.7;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgb(255 79 69 / 0.16), transparent 60%),
    radial-gradient(50rem 40rem at 0% 40%, rgb(122 92 240 / 0.18), transparent 60%),
    linear-gradient(180deg, var(--night-1), var(--night-0));
  -webkit-font-smoothing: antialiased;
}

html[lang="fa"] body {
  font-family: var(--font-fa);
  line-height: 1.95;
}

img { display: block; max-width: 100%; }
em { font-style: italic; }
html[lang="fa"] em { font-style: normal; }

::selection { background: rgb(255 138 106 / 0.35); color: #fff; }

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

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Smooth language swap: fade + soften, swap, fade back. */
.page, .brand {
  transition: opacity 0.28s ease, filter 0.28s ease;
}
body.is-switching .page,
body.is-switching .brand {
  opacity: 0;
  filter: blur(6px);
}

/* ── Shared type ──────────────────────────────────────────────────────────── */

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--peach);
}
html[lang="fa"] .eyebrow {
  font-size: 0.95rem;
  letter-spacing: 0;
  font-weight: 500;
}
.eyebrow--ink { color: #6a47d6; }

.gradient-text,
.hero__name,
.book__title {
  background: linear-gradient(100deg, var(--peach) 0%, var(--coral) 30%, var(--lavender) 70%, var(--sky) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Scroll reveal (only hidden when JS is running) ───────────────────────── */

.js .reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  filter: blur(6px);
  transition:
    opacity 1.1s var(--ease) var(--delay, 0ms),
    transform 1.2s var(--ease) var(--delay, 0ms),
    filter 1.1s var(--ease) var(--delay, 0ms);
}
.js .reveal--slide { transform: translate3d(calc(var(--dir) * -64px), 0, 0) scale(0.97); }
.js .reveal.is-in {
  opacity: 1;
  transform: none;
  filter: none;
}
.d-1 { --delay: 120ms; }
.d-2 { --delay: 240ms; }
.d-3 { --delay: 360ms; }
.d-4 { --delay: 480ms; }
.d-5 { --delay: 600ms; }
.d-6 { --delay: 760ms; }

/* ── Top bar ──────────────────────────────────────────────────────────────── */

.topbar {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: max(0.9rem, env(safe-area-inset-top)) 0.9rem;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}
.topbar.is-scrolled {
  background: rgb(11 9 34 / 0.62);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 rgb(217 207 255 / 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-en-display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
html[lang="fa"] .brand { font-family: var(--font-fa); font-size: 1rem; }

/* Language selector: an opaque-enough dark glass pill so it stays legible over any part
   of the photo, in either corner (it sits top-right in LTR, top-left in RTL). */
.lang-toggle {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.3rem;
  border-radius: 999px;
  background: rgb(11 9 34 / 0.8);
  border: 1px solid rgb(255 201 168 / 0.35);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow:
    0 10px 28px -6px rgb(0 0 0 / 0.6),
    0 2px 6px rgb(0 0 0 / 0.35),
    inset 0 1px 0 rgb(255 255 255 / 0.08);
  direction: ltr; /* fixed order EN · FA · TR, whatever the page direction */
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .lang-toggle { background: rgb(11 9 34 / 0.94); }
}
.lang-toggle button {
  appearance: none;
  border: 0;
  cursor: pointer;
  min-width: 2.9rem;
  min-height: 2.25rem; /* with the pill padding: a comfortable ~44px touch target */
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  font: 700 0.8rem/1 var(--font-en-body);
  letter-spacing: 0.14em;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
  transition: color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}
.lang-toggle button:hover { background: rgb(255 255 255 / 0.1); color: var(--peach); }
.lang-toggle button[aria-pressed="true"] {
  color: var(--night-1);
  text-shadow: none;
  background: linear-gradient(120deg, #ffd9bf, var(--peach) 45%, var(--lavender));
  box-shadow: 0 4px 16px rgb(255 138 106 / 0.45), inset 0 0 0 1px rgb(255 255 255 / 0.5);
}
.lang-toggle button:focus-visible { outline: 2px solid var(--peach); outline-offset: 2px; }
.lang-toggle__sep { width: 1px; height: 1rem; background: rgb(255 255 255 / 0.28); }

/* ── Signature tree (shared) ──────────────────────────────────────────────── */

.tree { display: block; overflow: visible; }
.tree__branch { fill: none; stroke: url(#bark); stroke-linecap: round; }
.tree__root { fill: none; stroke: url(#root); stroke-linecap: round; opacity: 0.75; }
.tree__ground { stroke: url(#ground); stroke-width: 1.2; }

.tree--mark { width: 1.7rem; height: 1.7rem; }
.tree--mark .tree__root { opacity: 0.55; }

.tree--watermark {
  position: absolute;
  inset-block-start: -1.5rem;
  inset-inline-end: -1.5rem;
  width: clamp(9rem, 26vw, 15rem);
  height: auto;
  aspect-ratio: 1;
  opacity: 0.2;
  pointer-events: none;
}

/* Growing tree: branches draw in, leaves bloom, then the tree breathes and glows. */
.tree--grow { width: min(100%, 30rem); height: auto; margin-inline: auto; }
.js .tree--grow .tree__branch,
.js .tree--grow .tree__root,
.js .tree--grow .tree__ground {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.3s var(--ease) var(--d, 0ms);
}
.js .tree--grow .tree__leaf {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
  opacity: 0;
  transition:
    transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) var(--d, 0ms),
    opacity 0.6s ease var(--d, 0ms);
}
.js .tree--grow.is-in .tree__branch,
.js .tree--grow.is-in .tree__root,
.js .tree--grow.is-in .tree__ground { stroke-dashoffset: 0; }
.js .tree--grow.is-in .tree__leaf { transform: scale(1); opacity: 1; }

.tree--grow.is-grown .tree__canopy {
  transform-box: view-box;
  transform-origin: 50% 70%;
  animation: sway 9s ease-in-out infinite;
}

@keyframes sway {
  0%, 100% { transform: rotate(-0.7deg); }
  50%      { transform: rotate(0.7deg); }
}

.halo {
  position: absolute;
  inset: 8% 12% 28%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(255 138 106 / 0.42), rgb(167 148 247 / 0.22) 55%, transparent 100%);
  filter: blur(18px);
  opacity: 0;
  transition: opacity 2s ease 0.6s;
}
.book__tree.is-in .halo {
  opacity: 1;
  animation: glow 5.5s ease-in-out 2.6s infinite;
}
@keyframes glow {
  0%, 100% { opacity: 0.55; transform: scale(0.96); }
  50%      { opacity: 1;    transform: scale(1.06); }
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: clip;
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(40rem 30rem at 60% 35%, rgb(255 79 69 / 0.55), transparent 65%),
    radial-gradient(40rem 40rem at 30% 0%, rgb(169 189 255 / 0.4), transparent 60%),
    linear-gradient(160deg, #3b2d7a, #1a1240 55%, #3a0f1d);
}

.hero__img,
.book__portrait img {
  --depth: 70px;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate3d(0, calc(var(--p, 0) * var(--depth) * -1), 0) scale(1.12);
  will-change: transform;
}
.hero__img { object-position: 52% 22%; }

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(0deg, var(--night-0) 0%, rgb(11 9 34 / 0.78) 30%, rgb(11 9 34 / 0.1) 62%, rgb(11 9 34 / 0.35) 100%);
}

.hero__content {
  width: 100%;
  max-width: 44rem;
  padding: 7rem var(--gutter) clamp(3rem, 9vh, 6rem);
}

.hero__name {
  margin: 0;
  font-family: var(--font-en-display);
  font-weight: 500;
  font-size: clamp(3rem, 9vw, 6.8rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  padding-block-end: 0.08em;
}
html[lang="fa"] .hero__name {
  font-family: var(--font-fa);
  font-weight: 800;
  font-size: clamp(2.5rem, 8vw, 5.4rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.hero__role {
  margin: 1rem 0 0;
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.hero__role i {
  font-style: normal;
  margin-inline: 0.8em;
  color: var(--coral);
  opacity: 0.8;
}
html[lang="fa"] .hero__role { letter-spacing: 0; text-transform: none; font-size: clamp(1.1rem, 2.6vw, 1.45rem); }

.hero__lead {
  margin: 1.25rem 0 0;
  max-width: 32rem;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--ink-mute);
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 2.5rem;
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
html[lang="fa"] .scroll-cue { letter-spacing: 0; font-size: 0.95rem; }
.scroll-cue__line {
  position: relative;
  width: 3.5rem;
  height: 1px;
  overflow: hidden;
  background: rgb(217 207 255 / 0.25);
}
.scroll-cue__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--peach), transparent);
  animation: travel 2.6s var(--ease) infinite;
}
@keyframes travel {
  from { transform: translateX(calc(var(--dir) * -100%)); }
  to   { transform: translateX(calc(var(--dir) * 100%)); }
}

/* Phones and tablets in portrait: photo on top, fading into the text below. */
@media (max-width: 59.99rem) and (orientation: portrait) {
  .hero__media {
    inset-block-end: 22%;
    -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent);
    mask-image: linear-gradient(180deg, #000 72%, transparent);
  }
  .hero__img { object-position: 50% 20%; }
  .hero__veil {
    background: linear-gradient(0deg, var(--night-0) 0%, rgb(11 9 34 / 0.85) 24%, rgb(11 9 34 / 0) 50%, rgb(11 9 34 / 0.35) 100%);
  }
  .hero__content { padding-block: 6rem clamp(2rem, 6vh, 4rem); }
}

/* Phones held sideways: side by side, compact. */
@media (max-height: 540px) and (orientation: landscape) {
  .hero { align-items: center; min-height: 100svh; }
  .hero__media { inset-inline-start: 48%; }
  .hero__img { object-position: 50% 22%; }
  .hero__veil {
    background: linear-gradient(to right, var(--night-0) 0%, rgb(11 9 34 / 0.92) 44%, rgb(11 9 34 / 0) 66%);
  }
  html[dir="rtl"] .hero__veil {
    background: linear-gradient(to left, var(--night-0) 0%, rgb(11 9 34 / 0.92) 44%, rgb(11 9 34 / 0) 66%);
  }
  .hero__content { max-width: 52%; padding-block: 4.5rem 1.5rem; }
  .hero__name, html[lang="fa"] .hero__name { font-size: clamp(2rem, 6.5vw, 3rem); }
  html[lang="fa"] .hero__name { font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.35; }
  html[lang="fa"] .hero__lead { line-height: 1.8; }
  .hero__role { margin-top: 0.5rem; font-size: 0.9rem; }
  .hero__lead { margin-top: 0.6rem; font-size: 0.9rem; }
  .scroll-cue { display: none; }
  .eyebrow { margin-bottom: 0.5rem; }
}

@media (min-width: 60rem) {
  .hero { align-items: center; }
  .hero__media { inset-inline-start: 38%; }
  .hero__veil {
    background:
      linear-gradient(to right, var(--night-0) 0%, rgb(11 9 34 / 0.94) 34%, rgb(11 9 34 / 0.35) 52%, rgb(11 9 34 / 0) 70%),
      linear-gradient(0deg, var(--night-0) 0%, transparent 25%);
  }
  html[dir="rtl"] .hero__veil {
    background:
      linear-gradient(to left, var(--night-0) 0%, rgb(11 9 34 / 0.94) 34%, rgb(11 9 34 / 0.35) 52%, rgb(11 9 34 / 0) 70%),
      linear-gradient(0deg, var(--night-0) 0%, transparent 25%);
  }
  .hero__content { padding-block: 8rem; }
}

/* ── Book ─────────────────────────────────────────────────────────────────── */

.book {
  display: grid;
  gap: clamp(3rem, 7vw, 6rem);
  align-items: center;
  max-width: 74rem;
  margin-inline: auto;
  padding: clamp(5rem, 12vw, 9rem) var(--gutter);
}

.book__portrait {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 2rem;
  overflow: hidden;
  background: linear-gradient(150deg, #ff6a55, #7b3aa8 55%, #2a1c66);
  box-shadow:
    0 0 0 1px rgb(255 201 168 / 0.18),
    0 40px 90px -30px rgb(255 79 69 / 0.55),
    0 30px 80px -40px rgb(122 92 240 / 0.7);
}
.book__portrait img { object-position: 50% 30%; --depth: 40px; }
.book__portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08);
  background: linear-gradient(180deg, transparent 60%, rgb(11 9 34 / 0.45));
  pointer-events: none;
}

.book__text { text-align: center; }
.book__tree { position: relative; margin-bottom: 1.5rem; }

.book__title {
  margin: 0;
  font-family: var(--font-en-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(3.2rem, 8vw, 5.8rem);
  line-height: 1;
  padding-block-end: 0.1em;
}
html[lang="fa"] .book__title {
  font-family: var(--font-fa);
  font-style: normal;
  font-weight: 800;
  font-size: clamp(2.8rem, 7.5vw, 5rem);
  line-height: 1.3;
}

.book__by { margin: 0.9rem 0 0; color: var(--ink-dim); font-size: 1.05rem; }

.themes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
.themes li {
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lavender);
  background: rgb(167 148 247 / 0.08);
  border: 1px solid rgb(167 148 247 / 0.22);
}
html[lang="fa"] .themes li { letter-spacing: 0; font-size: 0.95rem; }

@media (min-width: 56rem) {
  .book { grid-template-columns: 5fr 6fr; }
}

/* ── Prologue ─────────────────────────────────────────────────────────────── */

.prologue {
  position: relative;
  overflow: clip;
  isolation: isolate;
  padding: clamp(5rem, 12vw, 9rem) var(--gutter);
}

.prologue__bg {
  --depth: 90px;
  position: absolute;
  inset: -12% 0;
  z-index: -1;
  background-color: #7d6ee0;
  background-image:
    url("../img/sky.webp"),
    radial-gradient(30rem 18rem at 20% 25%, rgb(255 255 255 / 0.55), transparent 70%),
    radial-gradient(34rem 20rem at 80% 60%, rgb(236 200 255 / 0.6), transparent 70%),
    radial-gradient(40rem 26rem at 50% 100%, rgb(88 70 200 / 0.9), transparent 70%),
    linear-gradient(170deg, #6e63d9, #a58cf0 45%, #6b55cf);
  background-size: cover;
  background-position: center;
  transform: translate3d(0, calc(var(--p, 0) * var(--depth) * -1), 0);
  will-change: transform;
}
.prologue::after {
  /* soft fade into the dark sections above and below */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, var(--night-0), transparent 14%, transparent 86%, #121114);
}

.prologue__card {
  position: relative;
  max-width: 44rem;
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 3.5rem);
  border-radius: 1.75rem;
  color: var(--page-ink);
  background: rgb(255 255 255 / 0.42);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow:
    0 0 0 1px rgb(255 255 255 / 0.45) inset,
    0 40px 100px -40px rgb(40 20 110 / 0.7);
  overflow: hidden;
}

.prologue__body p {
  margin: 0 0 1.1rem;
  font-size: clamp(1.02rem, 1.9vw, 1.18rem);
  font-weight: 400;
  line-height: 1.85;
}
.prologue__body:is([lang="en"], [lang="tr"]) p { font-family: var(--font-en-display); font-size: clamp(1.2rem, 2.2vw, 1.4rem); line-height: 1.6; }
.prologue__body[lang="fa"] p { line-height: 2.15; }
.prologue__body strong { font-weight: 700; color: #5a33c9; }

.signature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.8rem 0 0;
  font-family: var(--font-en-display);
  font-style: italic;
  font-size: 1.6rem;
  color: #3b2a8a;
}
html[lang="fa"] .signature { font-family: var(--font-fa); font-style: normal; font-weight: 700; font-size: 1.35rem; }
.feather { width: 1.5rem; height: 1.5rem; fill: #3b2a8a; }
.feather__vein { fill: none; stroke: rgb(255 255 255 / 0.7); stroke-width: 0.8; }
html[dir="rtl"] .feather { transform: scaleX(-1); }

/* ── Quote ────────────────────────────────────────────────────────────────── */

.quote {
  position: relative;
  overflow: clip;
  isolation: isolate;
  padding: clamp(6rem, 14vw, 11rem) var(--gutter);
  color: #eeebe6;
  background-color: #121114;
}
.quote__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: #1a191c;
  background-image:
    radial-gradient(38rem 26rem at 50% 45%, rgb(255 201 168 / 0.07), transparent 70%),
    url("../img/felt.webp"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  background-size: auto, 800px 380px, 220px;
  background-position: center;
  background-repeat: no-repeat, repeat, repeat;
}
.quote__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgb(0 0 0 / 0.7) 100%);
}

.quote__inner {
  position: relative;
  max-width: 50rem;
  margin-inline: auto;
  text-align: center;
}

.quote__mark {
  width: 3.2rem;
  height: 3.2rem;
  margin: 0 auto 0.5rem;
  opacity: 0.8;
  filter: drop-shadow(0 0 14px rgb(255 138 106 / 0.45));
}

.quote__text {
  margin: 1rem 0 0;
  font-size: clamp(1.25rem, 3vw, 1.9rem);
  line-height: 1.75;
}
.quote__text:is([lang="en"], [lang="tr"]) {
  font-family: var(--font-en-display);
  font-style: italic;
  font-size: clamp(1.4rem, 3.3vw, 2.2rem);
  line-height: 1.5;
}
.quote__text[lang="fa"] { font-weight: 300; line-height: 2.1; }

.quote__text .line { display: block; }
.js .quote__text .line {
  opacity: 0;
  transform: translate3d(0, 0.6em, 0);
  filter: blur(8px);
  transition:
    opacity 1.2s var(--ease) var(--delay),
    transform 1.3s var(--ease) var(--delay),
    filter 1.2s var(--ease) var(--delay),
    color 1.2s ease var(--delay);
}
.js .quote__text.is-in .line { opacity: 1; transform: none; filter: none; }
.quote__text .line:nth-child(1) { --delay: 0ms; }
.quote__text .line:nth-child(2) { --delay: 380ms; }
.quote__text .line:nth-child(3) { --delay: 760ms; }
.quote__text .line:nth-child(4) { --delay: 1300ms; color: var(--peach); }
.quote__text .line:nth-child(5) { --delay: 1680ms; }
.quote__text .line:nth-child(6) { --delay: 2060ms; }
.quote__text .line:nth-child(7) { --delay: 2440ms; }

.quote__cite {
  margin: 2.5rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgb(238 235 230 / 0.5);
}
html[lang="fa"] .quote__cite { letter-spacing: 0; font-size: 1rem; }

/* ── QR ───────────────────────────────────────────────────────────────────── */

.qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(5rem, 12vw, 8rem) var(--gutter);
  text-align: center;
}

.qr__frame {
  position: relative;
  -webkit-tap-highlight-color: transparent;
  display: grid;
  place-items: center;
  padding: 1.1rem;
  border-radius: 1.6rem;
  background: #fff;
  box-shadow:
    0 0 0 1px rgb(217 207 255 / 0.4),
    0 0 0 10px rgb(167 148 247 / 0.08),
    0 30px 80px -20px rgb(122 92 240 / 0.6);
}
.qr__frame.is-in { animation: qr-glow 5s ease-in-out 1.2s infinite; }
@keyframes qr-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgb(217 207 255 / 0.4), 0 0 0 10px rgb(167 148 247 / 0.08), 0 30px 80px -20px rgb(122 92 240 / 0.55); }
  50%      { box-shadow: 0 0 0 1px rgb(255 201 168 / 0.6), 0 0 0 14px rgb(255 138 106 / 0.12), 0 30px 90px -18px rgb(255 138 106 / 0.55); }
}
.qr__img {
  width: clamp(11rem, 42vw, 15rem);
  height: auto;
  aspect-ratio: 1;
}
.qr__missing { display: none !important; }
.qr__frame.is-missing .qr__img { display: none; }
.qr__frame.is-missing {
  width: clamp(11rem, 42vw, 15rem);
  aspect-ratio: 1;
  background: rgb(255 255 255 / 0.06);
  border: 1px dashed rgb(217 207 255 / 0.35);
}
html[lang="en"] .qr__frame.is-missing .qr__missing[lang="en"],
html[lang="tr"] .qr__frame.is-missing .qr__missing[lang="tr"],
html[lang="fa"] .qr__frame.is-missing .qr__missing[lang="fa"] { display: block !important; color: var(--ink-mute); }

.qr__title {
  margin: 2.25rem 0 0;
  font-family: var(--font-en-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
}
html[lang="fa"] .qr__title { font-family: var(--font-fa); font-weight: 700; font-size: clamp(1.5rem, 3.6vw, 2.1rem); line-height: 1.6; }
.qr__note { margin: 0.6rem 0 0; max-width: 28rem; color: var(--ink-mute); }

/* ── Footer ───────────────────────────────────────────────────────────────── */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 3rem var(--gutter) max(2.5rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgb(217 207 255 / 0.08);
  color: var(--ink-mute);
  font-size: 0.85rem;
  text-align: center;
}
.footer p { margin: 0; }
.footer .tree--mark { width: 2.4rem; height: 2.4rem; opacity: 0.85; }

/* Missing image: keep the gradient fallback, hide the broken image. */
.is-missing > img { visibility: hidden; }

/* ── Reduced motion ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .hero__img, .book__portrait img, .prologue__bg { transform: none !important; }
}
