/* KapricornX — site styles. One palette, two modes; the hero, closing card
   and footer stay in night blue in both. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/Fraunces-latin.woff2") format("woff2");
  font-weight: 400 700;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-201D, U+2022, U+2026, U+2190-2193;
  font-display: swap;
}

:root {
  --night: #0f1a31;
  --night-2: #16233f;
  --night-3: #1e2d50;
  --gold: #c9a227;
  --gold-hi: #e8cf7a;
  --gold-lo: #8a6c12;
  --cream: #efe8dc;
  --vermilion: #b03a1d;

  --bg: #f7f1e5;
  --bg-2: #efe6d3;
  --surface: #fbf7ef;
  --ink: #14213d;
  --ink-2: #33405e;
  --muted: #5d6579;
  --line: rgba(20, 33, 61, 0.12);
  --accent: #785e0f;
  --shadow: 0 30px 60px -30px rgba(20, 33, 61, 0.35);

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1527;
    --bg-2: #111d35;
    --surface: #152340;
    --ink: #efe8dc;
    --ink-2: #d6cfc2;
    --muted: #a9a394;
    --line: rgba(239, 232, 220, 0.12);
    --accent: #d8b443;
    --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
  }
}

* { 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(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--night); padding: 10px 14px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 16px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.04; font-variation-settings: "opsz" 144; }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.1; font-variation-settings: "opsz" 120; }
h3 { font-size: 1.2rem; line-height: 1.3; }
h1 em, h2 em { font-style: italic; color: var(--gold); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 36em; }

.eyebrow {
  margin: 0 0 18px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
}

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem; text-decoration: none;
  transition: transform 0.4s var(--ease), background 0.3s, box-shadow 0.4s var(--ease);
}
.btn--gold {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: var(--night);
  box-shadow: 0 10px 30px -12px rgba(201, 162, 39, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -12px rgba(201, 162, 39, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.btn--ghost { color: var(--cream); border: 1px solid rgba(239, 232, 220, 0.28); }
.btn--ghost:hover { background: rgba(239, 232, 220, 0.08); transform: translateY(-2px); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background 0.4s, backdrop-filter 0.4s, box-shadow 0.4s;
}
.nav.is-scrolled {
  background: rgba(15, 26, 49, 0.94);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(239, 232, 220, 0.08);
}
.nav__row { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.nav__brand img { height: 34px; width: auto; }
.nav__links { display: flex; gap: clamp(14px, 2.4vw, 32px); }
.nav__links a {
  color: rgba(239, 232, 220, 0.78); text-decoration: none; font-size: 0.93rem; font-weight: 500;
  position: relative; padding: 6px 0;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease);
}
.nav__links a:hover { color: var(--cream); }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__toggle { display: none; }
@media (max-width: 720px) {
  .nav__toggle {
    display: grid; place-items: center; width: 44px; height: 44px; margin-right: -8px;
    border: 0; background: none; cursor: pointer; border-radius: 10px;
  }
  .nav__toggle span, .nav__toggle span::before, .nav__toggle span::after {
    display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--cream);
    transition: transform 0.35s var(--ease), opacity 0.2s;
  }
  .nav__toggle span { position: relative; }
  .nav__toggle span::before, .nav__toggle span::after { content: ""; position: absolute; left: 0; }
  .nav__toggle span::before { top: -7px; }
  .nav__toggle span::after { top: 7px; }
  .nav.is-open .nav__toggle span { background: transparent; }
  .nav.is-open .nav__toggle span::before { transform: translateY(7px) rotate(45deg); }
  .nav.is-open .nav__toggle span::after { transform: translateY(-7px) rotate(-45deg); }

  .nav__links {
    position: absolute; left: 0; right: 0; top: 76px;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 18px;
    background: var(--night); box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.6);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0s 0.3s;
  }
  .nav__links a { padding: 14px 0; font-size: 1.05rem; border-bottom: 1px solid rgba(239, 232, 220, 0.08); }
  .nav__links a::after { display: none; }
  .nav.is-open { background: var(--night); }
  .nav.is-open .nav__links { visibility: visible; opacity: 1; transform: none; transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: 120px 0 90px;
  background:
    radial-gradient(1200px 600px at 75% 40%, rgba(201, 162, 39, 0.10), transparent 60%),
    radial-gradient(900px 700px at 10% 110%, rgba(176, 58, 29, 0.10), transparent 60%),
    linear-gradient(180deg, #0b1427 0%, var(--night) 55%, var(--night-2) 100%);
  color: var(--cream);
}
.hero::before {
  /* faint paper grain so the dark has texture */
  content: ""; position: absolute; inset: 0; opacity: 0.07; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}
.hero__glow {
  position: absolute; width: 640px; height: 640px; right: -80px; top: 50%; transform: translateY(-50%);
  background: radial-gradient(circle, rgba(232, 207, 122, 0.22), transparent 62%);
  filter: blur(10px); pointer-events: none;
}
.hero__grid {
  position: relative; width: 100%;
  display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 40px;
}
.hero .lead { color: rgba(239, 232, 220, 0.72); margin: 26px 0 36px; }
.hero .eyebrow { color: var(--gold); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__stage {
  position: relative; height: min(520px, 60vw);
  display: grid; place-items: center;
  perspective: 1100px;
}
.hero__shadow {
  position: absolute; bottom: 4%; left: 50%; width: 52%; height: 28px; transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 70%);
  filter: blur(6px);
}

/* The medal: a thick gold-edged tile with the mark standing proud of it.
   Layers are built by site.js; this sets the frame they live in. */
.medal {
  --rx: 8deg; --ry: -18deg; --size: min(340px, 62vw);
  width: var(--size); height: var(--size);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  animation: float 7s ease-in-out infinite;
}
.medal__body { position: absolute; inset: 0; transform-style: preserve-3d; }
.medal__edge, .medal__face, .medal__horns {
  position: absolute; inset: 0; border-radius: 22%;
  backface-visibility: hidden;
}
.medal__edge {
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 40%, var(--gold-lo));
}
.medal__face {
  background:
    radial-gradient(120% 90% at 30% 20%, #23365f 0%, #14213d 55%, #0d1730 100%);
  box-shadow: inset 0 0 0 2px rgba(232, 207, 122, 0.55), inset 0 0 0 9px #14213d, inset 0 0 0 10px rgba(232, 207, 122, 0.25);
}
.medal__face::after {
  /* moving sheen, driven by --ry */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.10) 45%, transparent 60%);
  background-size: 250% 100%;
  background-position: calc(50% + var(--sheen, 0) * 1%) 0;
}
.medal__horns { border-radius: 0; }
.medal__horns svg { width: 100%; height: 100%; display: block; }
.medal__back { transform: rotateY(180deg) translateZ(var(--half)); }

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

.hero__scroll {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  width: 26px; height: 42px; border: 1px solid rgba(239, 232, 220, 0.35); border-radius: 14px;
}
.hero__scroll span {
  position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px;
  background: var(--gold); border-radius: 2px; animation: scrollcue 2s ease-in-out infinite;
}
@keyframes scrollcue { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

@media (max-width: 860px) {
  .hero { padding-top: 110px; text-align: left; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__stage { order: -1; height: 300px; }
  .medal { --size: 220px; }
  .hero__scroll { display: none; }
  .hero__glow { right: auto; left: 50%; top: 200px; transform: translate(-50%, -50%); width: 420px; height: 420px; }
  /* Home on a phone: a smaller mark, so the title and the first button show sooner */
  .hero--home { min-height: 0; padding: 92px 0 64px; }
  .hero--home .hero__grid { gap: 8px; }
  .hero--home .hero__stage { height: 150px; justify-items: start; }
  .hero--home .medal { --size: 118px; margin-left: 8px; }
  .hero--home .hero__shadow { left: 68px; width: 110px; }
  .hero--home .hero__glow { left: 70px; top: 150px; width: 300px; height: 300px; }
  .hero--home .lead { margin: 18px 0 26px; }
}

/* ---------- Journal ---------- */
section { position: relative; }
.journal { padding: clamp(90px, 12vw, 160px) 0; }
.journal__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(40px, 6vw, 90px); align-items: center; }
.journal h2 { margin-bottom: 18px; }
.journal .lead { margin: 0 0 34px; }

.journal__stage {
  position: sticky; top: 120px;
  height: 520px; display: grid; place-items: center;
  perspective: 1400px;
}
.book {
  --w: 260px; --h: 367px; --d: 42px;
  --rx: 6deg; --ry: -32deg; --spin: 0deg;
  --spine: #1e3f73;
  position: relative; width: var(--w); height: var(--h);
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--spin)));
  transition: --spin 0s;
}
.book__face { position: absolute; backface-visibility: hidden; }
.book__front, .book__back { inset: 0; border-radius: 3px 6px 6px 3px; overflow: hidden; }
.book__front { transform: translateZ(calc(var(--d) / 2)); box-shadow: inset 4px 0 8px -4px rgba(0, 0, 0, 0.5); }
.book__front img { width: 100%; height: 100%; object-fit: cover; }
.book__front::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(0, 0, 0, 0.28) 0%, transparent 6%, rgba(255, 255, 255, 0.10) 9%, transparent 14%, transparent 70%, rgba(255, 255, 255, 0.06) 100%);
}
.book__back { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); background: var(--spine); }
.book__spine {
  width: var(--d); height: var(--h); left: calc(50% - var(--d) / 2);
  transform: rotateY(-90deg) translateZ(calc(var(--w) / 2));
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(255, 255, 255, 0.12) 30%, rgba(0, 0, 0, 0.1) 70%, rgba(0, 0, 0, 0.4)),
    var(--spine);
}
.book__pages {
  background:
    repeating-linear-gradient(90deg, #f3ecdc 0 2px, #e2d7bf 2px 3px);
}
.book__pages--side {
  width: calc(var(--d) - 6px); height: calc(var(--h) - 8px); top: 4px; left: calc(50% - (var(--d) - 6px) / 2);
  transform: rotateY(90deg) translateZ(calc(var(--w) / 2 - 4px));
}
.book__pages--top, .book__pages--bottom {
  width: calc(var(--w) - 6px); height: calc(var(--d) - 6px); left: 2px; top: calc(50% - (var(--d) - 6px) / 2);
  background: repeating-linear-gradient(0deg, #f3ecdc 0 2px, #e2d7bf 2px 3px);
}
.book__pages--top { transform: rotateX(90deg) translateZ(calc(var(--h) / 2 - 4px)); }
.book__pages--bottom { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2 - 4px)); }
.book__shadow {
  position: absolute; bottom: 40px; left: 50%; width: 300px; height: 40px; transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(20, 33, 61, 0.35), transparent 70%); filter: blur(8px);
}
.book.is-flipping { animation: flip 0.9s var(--ease); }
@keyframes flip {
  0% { transform: rotateX(var(--rx)) rotateY(var(--ry)); }
  100% { transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + 360deg)); }
}

.steps { list-style: none; padding: 0; margin: 0 0 34px; display: grid; gap: 4px; }
.steps li {
  display: grid; grid-template-columns: 56px 1fr; gap: 6px; padding: 22px 0;
  border-top: 1px solid var(--line);
}
.steps__n { font-family: var(--serif); font-size: 1.05rem; color: var(--accent); padding-top: 2px; }
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); }

.soon {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 0.92rem; font-weight: 600; color: var(--ink-2);
}
.soon__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(201, 162, 39, 0); } 100% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0); } }

@media (max-width: 860px) {
  .journal__grid { grid-template-columns: 1fr; }
  .journal__stage { position: relative; top: 0; height: 440px; }
  .book { --w: 220px; --h: 310px; --d: 36px; }
}

/* ---------- Covers ---------- */
.covers { padding: clamp(80px, 10vw, 140px) 0; background: var(--bg-2); }
.section-head { max-width: 760px; margin-bottom: clamp(40px, 6vw, 70px); }
.section-head h2 { margin-bottom: 16px; }
.section-head .lead { margin: 0; }

.families { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.family h3 { font-size: 1.35rem; margin-bottom: 18px; }
.family h3 span { display: block; font-family: var(--sans); font-size: 0.85rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; perspective: 900px; }
.cover {
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer; color: inherit; font: inherit;
  text-align: left; align-self: start;
  display: flex; flex-direction: column; justify-content: flex-start;
}
.cover img {
  aspect-ratio: 340 / 480; width: 100%; border-radius: 3px 6px 6px 3px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 14px 24px -14px rgba(20, 33, 61, 0.55);
  transform-origin: left center;
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.cover span { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 10px; line-height: 1.3; }
.cover:hover img, .cover:focus-visible img { transform: rotateY(-16deg) translateZ(18px); box-shadow: 18px 22px 30px -16px rgba(20, 33, 61, 0.6); }
.cover.is-active img { box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--gold), 0 18px 30px -16px rgba(20, 33, 61, 0.6); }
.cover.is-active span { color: var(--ink); font-weight: 600; }
.covers__hint { margin: 36px 0 0; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 860px) { .families { grid-template-columns: 1fr; } }

/* ---------- Screens ---------- */
.screens { padding: clamp(80px, 10vw, 140px) 0 clamp(60px, 8vw, 110px); overflow: hidden; }
.phones {
  display: flex; justify-content: center; align-items: center; gap: clamp(14px, 2.4vw, 34px);
  padding: 20px var(--gutter) 40px;
  perspective: 1600px;
}
/* Every phone is the same size: a 360x800 app screen scaled by --k. */
.phones { --k: 0.62; }
@media (max-width: 1180px) { .phones { --k: 0.54; } }
.phone {
  margin: 0; flex: 0 0 auto;
  transform: rotateY(var(--turn, 0deg)) translateY(var(--lift, 0));
  transition: transform 0.8s var(--ease);
}
.phone:nth-child(1) { --turn: 16deg; --lift: 22px; }
.phone:nth-child(2) { --turn: 8deg; }
.phone:nth-child(4) { --turn: -8deg; }
.phone:nth-child(5) { --turn: -16deg; --lift: 22px; }
.phone__frame {
  position: relative; overflow: hidden;
  width: calc(360px * var(--k) + 18px); height: calc(800px * var(--k) + 18px);
  border: 9px solid #0b1222; border-radius: calc(46px * var(--k) + 9px);
  background: #0b1222;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), var(--shadow), 0 50px 80px -40px rgba(20, 33, 61, 0.5);
}
/* Real app screens (412x915 points, the same 9:20 shape as the frame) */
.phone__frame img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(46px * var(--k)); }
.phone figcaption { text-align: center; font-size: 0.85rem; color: var(--muted); margin: 16px auto 0; max-width: calc(360px * var(--k) + 18px); }
.phones:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
@media (max-width: 1240px) { .phones { --k: 0.5; } }
@media (max-width: 1100px) {
  .phones { --k: 0.6; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; perspective: none; padding-bottom: 30px; }
  .phone { scroll-snap-align: center; --turn: 0deg !important; --lift: 0 !important; }
}
@media (max-width: 860px) { .phones { --k: 0.56; } }

/* ---------- Principles ---------- */
.principles { padding: clamp(80px, 10vw, 140px) 0; border-top: 1px solid var(--line); }
.principles__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.4vw, 28px); }
.principle {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 30px 28px 32px;
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.principle:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.principle svg { width: 44px; height: 44px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 22px; }
.principle h3 { margin-bottom: 8px; }
.principle p { margin: 0; color: var(--muted); }
@media (max-width: 860px) { .principles__grid { grid-template-columns: 1fr; } }

/* ---------- Closing ---------- */
.closing { padding: 0 0 clamp(80px, 10vw, 130px); }
.closing__card {
  position: relative; overflow: hidden;
  width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--max) - 2 * var(--gutter));
  padding: clamp(50px, 7vw, 90px) clamp(24px, 6vw, 80px);
  border-radius: 28px; text-align: center; color: var(--cream);
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(201, 162, 39, 0.18), transparent 70%),
    linear-gradient(180deg, var(--night-2), var(--night));
}
.closing__mark { margin: 0 auto 26px; border-radius: 16px; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.7); }
.closing h2 { margin-bottom: 12px; }
.closing p { color: rgba(239, 232, 220, 0.7); margin: 0 0 30px; }

/* ---------- Footer ---------- */
.footer { background: var(--night); color: rgba(239, 232, 220, 0.7); padding: 46px 0; font-size: 0.9rem; }
.footer__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--cream); }
.footer p { margin: 0; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .medal, .hero__scroll span, .soon__dot { animation: none; }
  .book.is-flipping, .book--hero { animation: none; }
}

/* ================= Inner pages ================= */
.nav--solid { background: var(--night); box-shadow: 0 1px 0 rgba(239, 232, 220, 0.08); }
.nav__links a[aria-current="page"] { color: var(--cream); }
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }

.hero--page { min-height: 0; padding: 150px 0 110px; }
.hero__stage--book { perspective: 1400px; height: 460px; }
.book--hero { --rx: 6deg; --ry: -30deg; animation: bookidle 9s ease-in-out infinite; }
@keyframes bookidle {
  0%, 100% { transform: rotateX(6deg) rotateY(-34deg) translateY(0); }
  50% { transform: rotateX(4deg) rotateY(-22deg) translateY(-10px); }
}
.book--hero .book__shadow { display: none; }
.soon--dark { color: var(--cream); border-color: rgba(239, 232, 220, 0.25); margin-top: 8px; }
.hero__note { margin: 14px 0 0; font-size: 0.9rem; color: rgba(239, 232, 220, 0.6); }
@media (max-width: 860px) {
  .hero--page { padding: 104px 0 56px; }
  /* Product page on a phone: name and button first, the book after them */
  .hero__stage--book { order: 0; height: 330px; }
}

.feature { padding: clamp(70px, 9vw, 120px) 0; }
.feature--alt { background: var(--bg-2); }
.feature__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 90px); align-items: center; }
.feature--alt .feature__media { order: 2; }
.feature__media { margin: 0; }
.feature__media img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 22px;
  box-shadow: var(--shadow);
}
.feature__copy h2 { margin-bottom: 22px; }
.feature__copy .eyebrow { font-family: var(--serif); font-size: 1rem; letter-spacing: 0.1em; }
.ticks { list-style: none; margin: 0 0 20px; padding: 0; }
.ticks li { position: relative; padding: 12px 0 12px 34px; border-top: 1px solid var(--line); color: var(--ink-2); }
.ticks li::before {
  content: ""; position: absolute; left: 4px; top: 21px; width: 12px; height: 7px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.textlink { color: var(--accent); font-weight: 600; text-underline-offset: 4px; }

.feature__fan { position: relative; aspect-ratio: 4 / 3; perspective: 1200px; }
.feature__fan img {
  position: absolute; top: 8%; width: 42%; aspect-ratio: 340 / 480; border-radius: 3px 7px 7px 3px;
  box-shadow: 0 30px 40px -24px rgba(20, 33, 61, 0.6);
  transition: transform 0.8s var(--ease);
}
.feature__fan img:nth-child(1) { left: 6%; transform: rotate(-9deg) translateY(16px); }
.feature__fan img:nth-child(2) { left: 29%; z-index: 2; transform: translateY(-6px); }
.feature__fan img:nth-child(3) { left: 52%; transform: rotate(9deg) translateY(16px); }
.feature__fan:hover img:nth-child(1) { transform: rotate(-14deg) translate(-14px, 20px); }
.feature__fan:hover img:nth-child(3) { transform: rotate(14deg) translate(14px, 20px); }

@media (max-width: 860px) {
  .feature__grid { grid-template-columns: 1fr; }
  .feature--alt .feature__media { order: 0; }
}

.pricing { padding: clamp(70px, 9vw, 120px) 0; }
.principle p:only-of-type { color: var(--ink-2); }

/* Long-form pages (support, privacy, 404): the text stays as written. */
.doc { padding: 140px 0 100px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 18px; }
.doc h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin: 2.6rem 0 0.8rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.doc p, .doc li { color: var(--ink-2); }
.doc .lead { color: var(--muted); }
.doc .note { color: var(--muted); font-size: 0.92rem; margin-top: 0; }
.doc ul { padding-left: 1.2rem; }
.doc li { margin: 0.5rem 0; }
.doc li::marker { color: var(--accent); }
.doc a { color: var(--accent); text-underline-offset: 3px; }
.doc--center { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.doc--center .closing__mark { margin-bottom: 28px; }

/* Rubai Journal app icon (same geometry as the launcher icon) */
.app-icon { width: 88px; height: 88px; border-radius: 22px; margin-bottom: 26px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(232, 207, 122, 0.25); }
.title-icon { display: flex; align-items: center; gap: 16px; }
.title-icon img { width: 52px; height: 52px; border-radius: 13px; box-shadow: 0 10px 24px -12px rgba(20, 33, 61, 0.6); flex: none; }

/* ---------- Home: the product in short ---------- */
.cover-strip { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; max-width: 520px; margin: 0 0 12px; text-decoration: none; }
.cover-strip img { width: 100%; aspect-ratio: 340 / 480; border-radius: 2px 4px 4px 2px; box-shadow: 0 10px 18px -12px rgba(20, 33, 61, 0.6); transition: transform 0.5s var(--ease); }
.cover-strip:hover img { transform: translateY(-4px); }
.cover-strip__caption { margin: 0 0 30px; color: var(--muted); font-size: 0.9rem; }
.journal__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }

/* ---------- Product page ---------- */
.steps--wide { max-width: 820px; }
.sample { padding: clamp(70px, 9vw, 120px) 0; }
.sample__pages { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 2vw, 24px); margin: 0 0 30px; }
.sample__pages figure { margin: 0; }
.sample__pages img { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 20px 34px -20px rgba(20, 33, 61, 0.55); background: #e9e4d2; }
.sample__pages figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 10px; }
@media (max-width: 860px) { .sample__pages { grid-template-columns: repeat(2, 1fr); } }

.feature__media--phone { display: grid; place-items: center; --k: 0.62; }
@media (max-width: 860px) { .feature__media--phone { --k: 0.56; } }

.faq { padding: clamp(70px, 9vw, 120px) 0 clamp(80px, 10vw, 130px); border-top: 1px solid var(--line); }
.faq__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px clamp(24px, 4vw, 56px); }
.faq__grid > div { padding: 22px 0; border-top: 1px solid var(--line); }
.faq__grid h3 { margin-bottom: 8px; }
.faq__grid p { margin: 0; color: var(--muted); }
@media (max-width: 860px) { .faq__grid { grid-template-columns: 1fr; } }

/* ---------- About ---------- */
.about__mark { margin-bottom: 26px; border-radius: 16px; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.5); }
.feature--line { border-top: 1px solid var(--line); }

/* ================= Home: our apps ================= */
.apps { padding: clamp(90px, 12vw, 160px) 0 0; }
.apps .section-head { margin-bottom: 0; }
.apps .journal { padding: clamp(50px, 7vw, 100px) 0; }
.journal--next { border-top: 1px solid var(--line); }
.app-title { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.1; font-variation-settings: "opsz" 120; margin-bottom: 18px; }
.journal__grid--flip { grid-template-columns: 1.1fr 0.9fr; }
.journal__grid--flip .journal__stage { order: 2; }
.dial-stage { width: min(380px, 82%); }
.dial-stage img { display: block; width: 100%; height: auto; filter: drop-shadow(0 30px 40px rgba(20, 33, 61, 0.45)); animation: dialrock 12s ease-in-out infinite; }
@keyframes dialrock { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.app-facts { list-style: none; padding: 0; margin: 0 0 34px; display: flex; flex-wrap: wrap; gap: 8px; }
.app-facts li { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 0.9rem; font-weight: 600; color: var(--ink-2); }
@media (max-width: 860px) {
  .journal__grid--flip { grid-template-columns: 1fr; }
  .journal__grid--flip .journal__stage { order: 0; height: 360px; }
}
@media (prefers-reduced-motion: reduce) { .dial-stage img { animation: none; } }
