/* Nuvink landing page.
   One designed look, on purpose: night sections for the product's mood, paper
   sections where the page talks about reading and writing. No theme toggle. */
:root {
  --night: #070b1f;
  --night-2: #0d1433;
  --night-line: rgba(170, 190, 255, 0.13);
  --moon: #eef2ff;
  --moon-2: #a9b4d6;
  --moon-3: #6f7ba3;

  --paper: #f2f4f9;
  --paper-2: #ffffff;
  --paper-line: #dde3ef;
  --ink: #0b1437;
  --ink-2: #4a5677;
  --ink-3: #8590ad;

  --cyan: #4fd1f5;
  --blue: #2f6bff;
  --blue-deep: #1b3fae;
  --lilac: #c38bfa;
  --pen: #1d4ed8;
  --marker: rgba(255, 214, 92, 0.62);

  --r-lg: 28px;
  --r-md: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --f-ui: "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --f-book: "Noto Naskh Arabic", "Iowan Old Style", Georgia, serif;
  --f-hand: "Aref Ruqaa", "Noto Naskh Arabic", serif;

  color-scheme: dark;
}
:root:lang(en) { --f-hand: "Caveat", "Segoe Print", cursive; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--night);
  color: var(--moon);
  font: 400 17px/1.7 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

/* Latin gets Apple-style tight tracking; Arabic must never be letter-spaced. */
:lang(en) h1, :lang(en) h2 { letter-spacing: -0.035em; }
:lang(en) .verb, :lang(en) .eyebrow { letter-spacing: 0.08em; text-transform: uppercase; }

/* Film grain on the night sections — flat digital black reads as a template. */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky canvas { width: 100%; height: 100%; display: block; }
.shoot {
  position: absolute; height: 1.5px; width: 150px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(220, 235, 255, 0.95));
  transform-origin: right center; opacity: 0;
  animation: shoot 1.2s ease-out forwards;
}
@keyframes shoot {
  0% { opacity: 0; transform: rotate(var(--a)) translateX(0) scaleX(0.3); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(460px) scaleX(1); }
}
.night { position: relative; background: transparent; color: var(--moon); isolation: isolate; }
.night::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.paper { position: relative; z-index: 1; background: var(--paper); color: var(--ink); color-scheme: light; }

/* ───────── Nav: a floating glass pill ───────── */
.nav {
  position: fixed; z-index: 50;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  inset-inline: 0; margin-inline: auto;
  width: min(760px, calc(100% - 24px));
  display: flex; align-items: center; gap: 12px;
  padding: 7px 8px 7px 14px;
  padding-inline-start: 14px; padding-inline-end: 8px;
  border-radius: 999px;
  background: rgba(16, 22, 52, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 40px rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  transition: width 0.5s var(--ease), background 0.3s;
}
.nav.scrolled { width: min(680px, calc(100% - 24px)); background: rgba(16, 22, 52, 0.7); }
.nav-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 17px; color: var(--moon); }
.nav-brand img { width: 28px; height: 28px; object-fit: contain; }
.nav-links { display: flex; gap: 4px; margin-inline: auto; }
.nav-links a {
  text-decoration: none; font-size: 14.5px; color: var(--moon-2);
  padding: 6px 12px; border-radius: 999px; transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--moon); background: rgba(255, 255, 255, 0.07); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.nav-lang {
  font: 500 13.5px var(--f-ui); color: var(--moon-2);
  background: none; border: 0; padding: 7px 10px; border-radius: 999px; cursor: pointer;
}
.nav-lang:hover { color: var(--moon); background: rgba(255, 255, 255, 0.07); }
.nav-get {
  text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 7px 16px; border-radius: 999px; white-space: nowrap;
  background: var(--moon); color: var(--night);
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-actions { margin-inline-start: auto; }
}

/* ───────── Hero ───────── */
.hero { padding-block: calc(env(safe-area-inset-top, 0px) + 112px) 72px; overflow: hidden; }
.hero::before {
  /* A pool of studio light under the ribbon, not a gradient wash. */
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 900px; height: 700px; inset-inline-end: -180px; top: 40px;
  background: radial-gradient(closest-side, rgba(47, 107, 255, 0.2), rgba(47, 107, 255, 0));
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center; gap: clamp(8px, 3vw, 48px);
}
.eyebrow { margin: 0 0 18px; font-size: 14px; font-weight: 500; color: var(--cyan); }
h1 {
  margin: 0; font-weight: 700; line-height: 1.12;
  font-size: clamp(2.5rem, 4.8vw, 4.3rem);
  text-wrap: balance;
}
.lede { margin: 22px 0 0; max-width: 34ch; font-size: clamp(1.06rem, 1.5vw, 1.24rem); color: var(--moon-2); font-weight: 300; line-height: 1.8; }

.stage { position: relative; width: 100%; display: grid; place-items: center; perspective: 1100px; }
/* The copy is taller than the mark, so centring the two drops the mark to the
   middle of the copy. Pin it beside the headline instead. */
@media (min-width: 901px) {
  .hero-grid { align-items: start; }
  .stage { position: sticky; top: 120px; margin-top: clamp(24px, 4vw, 72px); }
}

/* The mark: ribbon and pen are two layers of the original artwork. */
.logo {
  position: relative; width: min(100%, 560px); aspect-ratio: 932 / 648;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease);
  direction: ltr;
}
.logo img, .logo .pen-float, .logo-sheen { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo img { display: block; user-select: none; -webkit-user-drag: none; }
.logo-ribbon { filter: drop-shadow(0 30px 40px rgba(20, 60, 200, 0.35)); }
.logo-pen { filter: drop-shadow(0 18px 24px rgba(40, 20, 120, 0.4)); }
.logo-pool {
  /* Light the mark throws on the floor under it. */
  position: absolute; left: 8%; right: 12%; bottom: -12%; height: 22%;
  background: radial-gradient(closest-side, rgba(79, 160, 245, 0.32), transparent);
  filter: blur(8px);
}
/* Gloss: a band of light that runs across the ribbon and the pen, clipped
   to their shapes by using the artwork itself as the mask. */
.logo-sheen {
  pointer-events: none; mix-blend-mode: overlay; opacity: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.95) 50%, transparent 62%) no-repeat;
  background-size: 250% 100%; background-position: 150% 0;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
}
.sheen-ribbon { -webkit-mask-image: url("logo-ribbon.webp"); mask-image: url("logo-ribbon.webp"); }
.sheen-pen { -webkit-mask-image: url("logo-pen.webp"); mask-image: url("logo-pen.webp"); }

@media all {
  /* 1. The ribbon is revealed left to right, like ink leaving a nib. */
  .logo-ribbon {
    -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
    mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
    -webkit-mask-size: 260% 100%; mask-size: 260% 100%;
    -webkit-mask-position: 100% 0; mask-position: 100% 0;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    animation: ink-write 2.6s 0.3s linear forwards;
  }
  /* 2. The pen rides the stroke's leading edge (the keyframes trace the N),
        lifts off at the hook and settles where it sits in the logo. */
  .logo-pen { transform-origin: 67.5% 84.6%; animation: pen-write 2.6s 0.3s linear both; }
  /* 3. Afterwards the pen breathes, and the gloss passes over now and then. */
  .pen-float { animation: pen-float 5s 3.2s ease-in-out infinite; }
  .logo-sheen { animation: sheen 7s 3s ease-in-out infinite; }
  .sheen-pen { animation-delay: 3.25s; }
}
@keyframes ink-write { to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
@keyframes pen-write {
  0%     { transform: translate(-61.5%, 10.4%) rotate(-8deg); opacity: 0; }
  18%    { opacity: 1; }
  22.5%  { transform: translate(-61.5%, 10.4%) rotate(-8deg); }
  28.1%  { transform: translate(-52.5%, -6.6%) rotate(-7deg); }
  33.75% { transform: translate(-43.5%, -24.6%) rotate(-6deg); }
  37.5%  { transform: translate(-37.5%, -46.6%) rotate(-5deg); }
  42.5%  { transform: translate(-29.5%, -62.6%) rotate(-3deg); }
  46.9%  { transform: translate(-22.5%, -56.6%) rotate(-2deg); }
  49.4%  { transform: translate(-18.5%, -34.6%) rotate(-2deg); }
  51.9%  { transform: translate(-14.5%, -12.6%) rotate(-2deg); }
  55%    { transform: translate(-9.5%, 5.4%) rotate(-3deg); }
  60%    { transform: translate(-1.5%, 7.4%) rotate(-3deg); }
  63.1%  { transform: translate(3.5%, 1.4%) rotate(-1deg); }
  76%    { transform: translate(5%, -8%) rotate(3deg); }
  100%   { transform: none; opacity: 1; }
}
@keyframes pen-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2.2%) rotate(1.2deg); }
}
@keyframes sheen {
  0% { opacity: 0; background-position: 150% 0; }
  8% { opacity: 1; }
  40% { opacity: 1; background-position: -50% 0; }
  46%, 100% { opacity: 0; background-position: -50% 0; }
}

/* Hero copy arrives just ahead of the pen. */
@media all {
  .hero-copy > * { animation: rise 0.9s var(--ease) both; }
  .hero-copy > :nth-child(1) { animation-delay: 0.05s; }
  .hero-copy > :nth-child(2) { animation-delay: 0.15s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.3s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.45s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(26px); filter: blur(6px); } }

/* ───────── Download block ───────── */
.get { margin-top: 38px; display: grid; gap: 12px; width: min(100%, 440px); }
.stores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.store {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 10px;
  height: 58px; padding-inline: 14px;
  border-radius: 15px;
  background: #000; color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  text-decoration: none;
}
.store::before {
  /* Gloss: the top half catches the light. */
  content: ""; position: absolute; inset: 0 0 50% 0; pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02));
}
.store[aria-disabled="true"] { cursor: default; }
.store[aria-disabled="true"] .store-ico { opacity: 0.8; }
a.store { transition: transform 0.25s var(--ease); }
a.store:hover { transform: translateY(-2px); }
.store-ico { width: 24px; height: 24px; flex: none; }
.store-txt { display: grid; line-height: 1.15; text-align: start; }
.store-txt small { font-size: 11.5px; color: rgba(255, 255, 255, 0.72); }
.store-txt b { font-size: 17px; font-weight: 600; direction: ltr; text-align: start; }
:lang(ar) .store-txt b { text-align: right; }

.apk {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 18px;
  text-decoration: none; color: var(--moon);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  transition: border-color 0.3s, background 0.3s;
}
.apk::after {
  /* A sheen that crosses the glass on hover. */
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: skewX(-18deg); transition: left 0.8s var(--ease);
}
.apk:hover { border-color: rgba(79, 209, 245, 0.55); background: rgba(255, 255, 255, 0.1); }
.apk:hover::after { left: 120%; }
.apk-ico {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 12px; background: var(--moon); color: var(--night);
}
.apk-ico svg { width: 21px; height: 21px; }
.apk-txt { display: grid; line-height: 1.35; text-align: start; }
.apk-txt b { font-weight: 600; font-size: 16px; }
.apk-txt small { font-size: 13px; color: var(--moon-2); }

/* ───────── Chapters ───────── */
.chapter { padding-block: clamp(80px, 11vw, 150px); }
.chapter-head { max-width: 620px; }
.verb { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: var(--cyan); }
.paper .verb { color: var(--pen); }
h2 {
  margin: 0; font-weight: 700; line-height: 1.15;
  font-size: clamp(2.1rem, 4.4vw, 3.7rem); text-wrap: balance;
}
.chapter-head > p:not(.verb) { margin: 20px 0 0; font-size: 1.12rem; color: var(--moon-2); font-weight: 300; line-height: 1.85; max-width: 52ch; }
.paper .chapter-head > p:not(.verb) { color: var(--ink-2); }

/* Read: a shelf of glossy covers. */
.read { border-top: 1px solid var(--night-line); }
.shelf {
  margin-top: 64px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 28px);
  perspective: 1400px;
}
.book {
  position: relative; margin: 0;
  aspect-ratio: 3 / 4.1; border-radius: 6px 16px 16px 6px;
  padding: 18px 18px 16px 24px; padding-inline-start: 24px; padding-inline-end: 18px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  box-shadow: 0 30px 50px -20px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: rotateY(var(--tilt, 14deg)) translateZ(0);
  transform-origin: center;
  transition: transform 0.7s var(--ease);
  overflow: hidden;
}
:lang(en) .book { --tilt: -14deg; }
.book::before {
  /* Spine crease on the binding edge + a gloss sweep across the cover. */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(var(--spine-dir, to left), rgba(0, 0, 0, 0.32), rgba(255, 255, 255, 0.14) 3.5%, transparent 8%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 42%);
}
/* Arabic books bind on the right, English on the left. */
:lang(en) .book { --spine-dir: to right; border-radius: 6px 16px 16px 6px; }
:lang(ar) .book { --spine-dir: to left; border-radius: 16px 6px 6px 16px; }
.book:hover { transform: rotateY(0deg) translateY(-8px); }
.book b { position: relative; font-size: clamp(0.95rem, 1.6vw, 1.2rem); font-weight: 600; line-height: 1.35; }
.book small { position: relative; font-size: 12.5px; opacity: 0.72; }
.book-tag {
  position: absolute; top: 14px; inset-inline-end: 14px;
  font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.b1 { background: #1f4fd8; color: #fff; }
.b2 { background: #0f6e6a; color: #eafffb; }
.b3 { background: #e9e4d8; color: #2a2418; }
.b3 .book-tag { background: rgba(0, 0, 0, 0.08); border-color: rgba(0, 0, 0, 0.14); }
.b4 {
  background: transparent; color: var(--moon-2);
  border: 1.5px dashed rgba(170, 190, 255, 0.35); box-shadow: none;
}
.b4::before { display: none; }
.b4 b { font-weight: 500; font-size: clamp(0.85rem, 1.3vw, 1rem); word-break: break-all; color: var(--moon); }

/* Teachers: three points as cards, above the shelf. */
.read .glass-row { margin-top: 44px; }
.read .glass p { color: var(--moon); font-size: 1.02rem; }
.read .glass p { margin-top: 16px; }
.shelf-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 760px; }

/* Students: the ways to pay, read at a glance. */
.students { border-top: 1px solid var(--paper-line); }
.pay { margin-top: 36px; }
.pay p { margin: 0 0 14px; color: var(--ink-2); }
.pay ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.pay li {
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--paper-line); color: var(--ink); font-weight: 500; font-size: 0.95rem;
}

/* The hero's second line and its call to download. */
.hero-copy .lede + .lede { margin-top: 14px; }
.hero-cta { margin: 26px 0 0; font-weight: 600; color: var(--moon); }

/* A bullet that is one sentence reads as the item itself, not a caption. */
.facts-plain span { color: var(--ink); font-size: 1rem; }

/* Write: the page with a student's marks. */
.write-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 90px); align-items: center; }
.facts { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 26px 28px; }
.facts li { display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--paper-line); }
.facts b { font-weight: 600; font-size: 1rem; }
.facts span { font-size: 0.94rem; color: var(--ink-2); line-height: 1.7; }

.page {
  margin: 0; position: relative;
  display: grid; grid-template-columns: 150px minmax(0, 1fr);
  background: var(--paper-2);
  border-radius: 6px;
  padding: 40px 38px 26px 18px; padding-inline: 18px 38px;
  box-shadow: 0 1px 0 var(--paper-line), 0 40px 80px -30px rgba(11, 20, 55, 0.35), 0 12px 24px -12px rgba(11, 20, 55, 0.12);
  transform: rotate(-1.2deg);
}
:lang(ar) .page { grid-template-columns: minmax(0, 1fr) 150px; padding-inline: 38px 18px; }
:lang(ar) .page-margin { order: 2; }
.page::before {
  /* The next sheet peeking from under this one. */
  content: ""; position: absolute; inset: 8px -8px -8px 8px; z-index: -1;
  background: #fbfbfd; border-radius: 6px; box-shadow: 0 10px 30px -12px rgba(11, 20, 55, 0.25);
  transform: rotate(2.2deg);
}
.page-margin { position: relative; display: grid; align-content: start; justify-items: center; gap: 10px; }
.note { width: 100%; height: auto; overflow: visible; }
.note-txt {
  font-family: var(--f-hand); font-size: 30px; font-weight: 700;
  fill: var(--pen); stroke: var(--pen); stroke-width: 0.6;
  direction: rtl; text-anchor: start;
}
:lang(en) .note-txt { font-size: 32px; direction: ltr; text-anchor: end; }
.arrow { fill: none; stroke: var(--pen); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.star { width: 36px; height: 36px; margin-top: 40px; }
.star path { fill: none; stroke: #e0569b; stroke-width: 2.2; stroke-linejoin: round; }

.printed {
  margin: 0; font-family: var(--f-book); font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 2.25; color: #23283a; text-align: justify;
}
:lang(en) .printed { line-height: 1.95; hyphens: auto; }
.printed mark {
  color: inherit; padding: 0 2px;
  background: linear-gradient(var(--marker), var(--marker)) no-repeat right 60% / 100% 62%;
  border-radius: 3px;
  transition: background-size 1.1s var(--ease) 0.2s;
}
:lang(en) .printed mark { background-position: left 60%; }
.ring { position: relative; white-space: nowrap; }
.ring svg { position: absolute; inset: -14px -16px -12px; width: calc(100% + 32px); height: calc(100% + 26px); overflow: visible; pointer-events: none; }
.ring path { fill: none; stroke: #d0342c; stroke-width: 2.2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.folio { margin: 26px 0 0; text-align: center; font-family: var(--f-book); font-size: 13px; color: var(--ink-3); }

/* Pen strokes: drawn at rest. The script parks them only when the page starts
   below the fold, then lets them draw when the page scrolls in. */
.ink-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.note-txt.ink-draw { stroke-dasharray: 700; stroke-dashoffset: 0; fill-opacity: 1; }
.page .ink-draw { transition: stroke-dashoffset 1.4s var(--ease), fill-opacity 0.6s ease; }
.page .arrow { transition-delay: 1.1s; }
.page .arrow + .arrow { transition-delay: 1.5s; }
.page .ring path { transition-delay: 0.5s; }
.page .star path { transition-delay: 1.8s; }
.page .note-txt { transition: stroke-dashoffset 2.2s ease-out, fill-opacity 0.9s ease 1.4s; }
.page.pending .ink-draw { stroke-dashoffset: 1; }
.page.pending .note-txt.ink-draw { stroke-dashoffset: 700; fill-opacity: 0; }
.page.pending mark { background-size: 0% 62%; }

/* Keep: glass over the mark, blurred into light. */
.keep { overflow: hidden; }
.keep-bg {
  position: absolute; z-index: -1; pointer-events: none;
  width: min(1100px, 130%); max-width: none; height: auto;
  inset-inline-start: 50%; top: 52%;
  transform: translate(-50%, -30%) rotate(-8deg);
  filter: blur(70px) saturate(140%); opacity: 0.55;
}
@media all {
  .keep-bg { animation: drift 18s ease-in-out infinite alternate; }
  :lang(ar) .keep-bg { animation-name: drift-rtl; }
}
@keyframes drift { to { transform: translate(-42%, -38%) rotate(4deg) scale(1.12); } }
@keyframes drift-rtl { to { transform: translate(42%, -38%) rotate(-4deg) scale(1.12); } }
:lang(ar) .keep-bg { transform: translate(50%, -30%) rotate(8deg); }
.glass-row { margin-top: 56px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.glass {
  padding: 28px 26px 30px; border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
}
.glass svg { width: 30px; height: 30px; fill: none; stroke: var(--cyan); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.glass h3 { margin: 18px 0 8px; font-size: 1.22rem; font-weight: 600; }
.glass p { margin: 0; color: var(--moon-2); font-size: 0.98rem; line-height: 1.8; }
.glass a { color: var(--cyan); text-underline-offset: 4px; }

/* Specs: Apple-style big figures. */
.specs-title { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
.spec-grid { margin: 44px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--paper-line); }
.spec-grid > div { padding: 26px 22px 6px 0; padding-inline: 0 22px; border-inline-end: 1px solid var(--paper-line); margin-inline-end: 22px; }
.spec-grid > div:last-child { border-inline-end: 0; margin-inline-end: 0; }
.spec-grid dt { font-size: 14px; color: var(--ink-3); font-weight: 500; }
.spec-grid dd { margin: 6px 0 4px; font-size: clamp(2.2rem, 4vw, 3.3rem); font-weight: 600; line-height: 1.35; font-variant-numeric: tabular-nums; }
.spec-grid dd small { font-size: 0.4em; font-weight: 500; margin-inline-start: 6px; color: var(--ink-2); }
.spec-grid dd i { font-style: normal; color: var(--ink-3); font-weight: 300; }
.spec-grid p { margin: 0; font-size: 14px; color: var(--ink-2); }
.specs-foot { margin: 40px 0 0; color: var(--ink-2); max-width: 60ch; }

/* Final call. */
.final { padding-block: clamp(90px, 12vw, 160px) clamp(70px, 9vw, 110px); text-align: center; overflow: hidden; }
.final::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset-inline: 0; margin-inline: auto; width: 820px; max-width: 100%; height: 520px; top: 0;
  background: radial-gradient(closest-side, rgba(47, 107, 255, 0.18), transparent);
}
.final-inner { display: grid; justify-items: center; }
.final h2 { font-size: clamp(2.2rem, 5vw, 4.2rem); }
.howto { margin-top: 30px; max-width: 460px; text-align: start; color: var(--moon-2); font-size: 15px; }
.howto summary { cursor: pointer; text-align: center; color: var(--moon); font-weight: 500; list-style: none; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::after { content: " ▾"; color: var(--moon-3); }
.howto[open] summary::after { content: " ▴"; }
.howto ol { margin: 16px 0 0; padding-inline-start: 22px; display: grid; gap: 8px; line-height: 1.75; }

.foot { border-top: 1px solid var(--night-line); padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); font-size: 14px; color: var(--moon-3); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--moon); }

/* ───────── Tablet & phone ───────── */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .stage { order: -1; margin-block: 4px 34px; }
  .logo { width: min(84%, 420px); }
  .hero { padding-block-start: calc(env(safe-area-inset-top, 0px) + 84px); }
  .lede { max-width: 44ch; }
  .write-grid { grid-template-columns: 1fr; }
  .glass-row { grid-template-columns: 1fr; max-width: 560px; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .spec-grid > div:nth-child(2n) { border-inline-end: 0; margin-inline-end: 0; }
  .spec-grid > div:nth-child(n + 3) { border-top: 1px solid var(--paper-line); }
}
@media (max-width: 640px) {
  .shelf { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr; }
  /* No room for a margin column: the note moves above the text, where a
     phone reader would scribble it anyway. */
  .page, :lang(ar) .page { grid-template-columns: minmax(0, 1fr); padding: 22px 22px 18px; }
  :lang(ar) .page-margin, .page-margin { order: 0; justify-items: end; margin-bottom: -6px; }
  :lang(ar) .page-margin { justify-items: start; }
  .note { width: 190px; }
  .star { display: none; }
  .printed { text-align: start; }
  .stores { grid-template-columns: 1fr 1fr; gap: 10px; }
  .store { padding-inline: 10px; gap: 8px; }
  .store-txt b { font-size: 15px; }
}
@media (max-width: 380px) {
  .stores { grid-template-columns: 1fr; }
}

/* ───────── Scroll reveals ─────────
   Everything rests visible. The script parks only what starts below the fold
   (.rv-wait) and releases it when it scrolls in (.rv-go carries the stagger). */
[data-reveal] { transition: opacity 0.9s var(--ease), transform 1.1s var(--ease), filter 0.9s var(--ease); }
.book[data-reveal] { transition: transform 1.1s var(--ease), opacity 0.8s var(--ease); }
.rv-go { transition-delay: calc(var(--i, 0) * 110ms) !important; }
.rv-wait[data-reveal="up"] { opacity: 0; transform: translateY(40px); }
.rv-wait[data-reveal="glass"] { opacity: 0; transform: translateY(46px) scale(0.96); filter: blur(12px); }
.rv-wait[data-reveal="book"] { opacity: 0; transform: rotateY(75deg) translateY(50px); }
:lang(en) .rv-wait[data-reveal="book"] { transform: rotateY(-75deg) translateY(50px); }
.rv-wait[data-reveal="page"] { opacity: 0; transform: translateY(80px) rotate(5deg); }
/* Specs: a rule draws across the top, then the figures count up. */
.spec-grid { position: relative; }
.spec-grid::before {
  content: ""; position: absolute; top: -1px; inset-inline: 0; height: 1px; background: var(--ink);
  transform-origin: var(--rule-from, right); transition: transform 1.4s var(--ease) 0.2s; opacity: 0.35;
}
:lang(en) .spec-grid { --rule-from: left; }
.spec-grid.rv-wait::before { transform: scaleX(0); }
