/*
 * readsharedroots.com
 *
 * Art direction: "a fine edition under warm light". Deep espresso sections lit by ember and gold
 * (the app icon's colours) alternate with warm paper sections, like turning from a lamp-lit room
 * to the page. Headlines are set in a book serif; everything you tap uses the system font, as in
 * the app. The three scriptures always appear in the app's order with equal size and weight.
 *
 * Light and dark follow the device. The espresso sections stay dark in both.
 */

@font-face {
  font-family: 'Amiri';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/amiri-arabic-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Frank Ruhl Libre';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/frank-ruhl-libre-hebrew-700-normal.woff2') format('woff2');
}

:root {
  color-scheme: light dark;
  --sans:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --serif: 'New York', 'Iowan Old Style', ui-serif, 'Palatino Linotype', Palatino, Georgia, serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Paper sections */
  --paper: #faf6f0;
  --paper-2: #f3ece2;
  --card: #fffdfa;
  --ink: #1f1915;
  --ink-2: #5f544c;
  --ink-3: #8a7e75;
  --rule: rgba(60, 40, 25, 0.12);
  --shadow: 0 1px 1px rgba(60, 30, 10, 0.04), 0 10px 30px -8px rgba(60, 30, 10, 0.14);
  --shadow-lift: 0 2px 4px rgba(60, 30, 10, 0.05), 0 24px 48px -12px rgba(60, 30, 10, 0.22);

  /* Brand, from the app icon */
  --ember: #b4532a;
  --gold: #d4a24c;

  /* The espresso sections (dark in both themes) */
  --night: #15100c;
  --on-night: #f7efe6;
  --on-night-2: rgba(247, 239, 230, 0.7);
  --on-night-3: rgba(247, 239, 230, 0.46);
  --glass: rgba(30, 23, 18, 0.66);

  /* The three scriptures (the app's accents) */
  --bible: #8f5b2e;
  --quran: #0b7d92;
  --torah: #4f4cc9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d0a08;
    --paper-2: #14100d;
    --card: #1c1713;
    --ink: #f4ece3;
    --ink-2: rgba(244, 236, 227, 0.7);
    --ink-3: rgba(244, 236, 227, 0.48);
    --rule: rgba(244, 236, 227, 0.12);
    --shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 12px 32px -8px rgba(0, 0, 0, 0.6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.3), 0 28px 56px -12px rgba(0, 0, 0, 0.75);
    --ember: #e8875a;
    --bible: #d6a06a;
    --quran: #4cc6da;
    --torah: #9693ff;
  }
}

/* ---------------------------------------------------------------- Base */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--ember);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.wrap {
  width: min(1160px, 100% - 40px);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--card);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember);
}

.display {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-wrap: balance;
}

.display em {
  font-style: italic;
  color: var(--ember);
}

.h2 {
  font-size: clamp(34px, 4.6vw, 56px);
}

.lede {
  margin: 14px 0 0;
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    background 0.25s;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s var(--ease);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn-ember {
  color: #fff;
  background: linear-gradient(180deg, #c8653a, #a84a22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 8px 22px -8px rgba(180, 83, 42, 0.38);
}

.btn-ember:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 12px 28px -8px rgba(180, 83, 42, 0.5);
}

.btn-quiet {
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow);
}

.on-night .btn-quiet {
  color: var(--on-night);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.btn-small {
  min-height: 36px;
  padding: 0 16px;
  font-size: 15px;
}

/* Store buttons: our own design, shown as "Coming soon" until the links are added in site.js.
   Swap for the official App Store and Google Play badges at launch. */
.stores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

/* Official badges, unaltered. Apple's is 48px tall; Google's image includes its own clear space
   (41px of 250 on each side), so it is shown larger with that space pulled in. */
.store-badge {
  display: inline-flex;
  border-radius: 10px;
  transition: transform 0.25s var(--ease);
}

.store-badge:not([aria-disabled='true']):active {
  transform: scale(0.97);
}

.store-badge[aria-disabled='true'] {
  cursor: default;
}

.store-badge img {
  display: block;
  height: 48px;
  width: auto;
}

.store-badge.google img {
  height: 71.4px;
  margin: -11.7px;
}

.stores-note,
.hero-stores .stores-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--on-night-3);
}

/* ---------------------------------------------------------------- Header: a floating glass bar */

.header {
  position: fixed;
  inset: 14px 0 auto;
  z-index: 50;
  pointer-events: none;
}

.bar {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(1160px, 100% - 24px);
  margin-inline: auto;
  padding: 7px 7px 7px 14px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: saturate(160%) blur(22px);
  -webkit-backdrop-filter: saturate(160%) blur(22px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    0 10px 30px -10px rgba(0, 0, 0, 0.45);
  color: var(--on-night);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: inherit;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.links {
  display: flex;
  gap: 2px;
  margin: 0 8px 0 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-night-2);
  transition:
    color 0.2s,
    background 0.2s;
}

.links a:hover,
.links a[aria-current='true'] {
  color: var(--on-night);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  place-items: center;
}

.menu-btn svg {
  width: 20px;
  height: 20px;
}

.menu-btn path {
  transition: transform 0.35s var(--ease);
  transform-origin: center;
}

.header.open .menu-btn .l1 {
  transform: translateY(4px) rotate(45deg);
}

.header.open .menu-btn .l2 {
  transform: translateY(-4px) rotate(-45deg);
}

@media (max-width: 880px) {
  .links {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 10px;
    border-radius: 24px;
    background: rgba(26, 20, 16, 0.95);
    backdrop-filter: saturate(160%) blur(22px);
    -webkit-backdrop-filter: saturate(160%) blur(22px);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.09),
      0 24px 50px -12px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top center;
    visibility: hidden;
    transition:
      opacity 0.25s,
      transform 0.35s var(--ease),
      visibility 0s 0.35s;
  }

  .header.open .links {
    opacity: 1;
    transform: none;
    visibility: visible;
    transition:
      opacity 0.25s,
      transform 0.35s var(--ease);
  }

  .links a {
    padding: 14px 16px;
    font-size: 19px;
    font-weight: 600;
    color: var(--on-night);
    border-radius: 14px;
  }

  .menu-btn {
    display: grid;
  }
}

/* ---------------------------------------------------------------- Espresso sections */

.on-night {
  position: relative;
  color: var(--on-night);
  background: var(--night);
  isolation: isolate;
}

/* Film grain, so the dark reads as a material rather than flat black. */
.on-night::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.07;
  pointer-events: none;
  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='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.on-night .eyebrow,
.on-night .display em {
  color: var(--gold);
}

.on-night .lede {
  color: var(--on-night-2);
}

/* ---------------------------------------------------------------- Hero */

.hero {
  /* Book width and the gap between books; the tree below is sized from them */
  --book-w: clamp(92px, 19vw, 220px);
  --book-gap: clamp(22px, 5vw, 64px);
  overflow: hidden;
  padding: 116px 0 0;
  text-align: center;
}

.hero-light {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(38% 40% at 50% 66%, rgba(212, 162, 76, 0.32), transparent 70%),
    radial-gradient(60% 50% at 50% 72%, rgba(180, 83, 42, 0.34), transparent 75%),
    radial-gradient(90% 70% at 50% 0%, #241a13, transparent 70%);
}

.hero h1 {
  font-size: clamp(46px, 7vw, 92px);
  max-width: 13ch;
  margin-inline: auto;
}

.hero .lede {
  max-width: 600px;
  margin-inline: auto;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

/* The three books on a softly lit shelf, all at the same angle */
.shelf {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: var(--book-gap);
  margin: 52px auto 0;
  padding: 0 0 44px;
}

.shelf::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: min(900px, 110%);
  height: 70px;
  translate: -50% 0;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, 0.6), transparent 70%);
  filter: blur(6px);
  z-index: -1;
}

.book3d {
  --w: var(--book-w);
  /* Thickness of the book block */
  --t: calc(var(--w) * 0.22);
  position: relative;
  width: var(--w);
  /* Each book has the same view, seen from a little above */
  perspective: 1400px;
  perspective-origin: 50% -30%;
}

.book {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(calc(6deg + var(--tilt-x))) rotateY(calc(30deg + var(--tilt-y)));
  transition: transform 1s var(--ease-out);
}

.js .book3d {
  animation: rise 1.4s var(--ease-out) both;
}

.book3d:nth-child(2) {
  animation-delay: 0.12s;
}

.book3d:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 50px;
  }
}

.book3d .cover {
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.12),
    0 0 50px -12px rgba(212, 162, 76, 0.3);
}

/* The spine, the gilt page edges on top and the back board: a solid book, not a card */
.book-spine,
.book-top,
.book-back {
  position: absolute;
  pointer-events: none;
}

.book-spine {
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--t);
  transform-origin: left center;
  transform: rotateY(90deg);
  border-radius: 2px;
  background:
    linear-gradient(
      180deg,
      transparent 7%,
      var(--band) 7% 7.9%,
      transparent 7.9% 9.6%,
      var(--band) 9.6% 10.5%,
      transparent 10.5% 89.5%,
      var(--band) 89.5% 90.4%,
      transparent 90.4% 92.1%,
      var(--band) 92.1% 93%,
      transparent 93%
    ),
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.45),
      rgba(255, 255, 255, 0.12) 38%,
      rgba(0, 0, 0, 0.05) 60%,
      rgba(0, 0, 0, 0.5)
    ),
    var(--spine);
}

.book-top {
  top: 0;
  left: 1.5%;
  right: 2.5%;
  height: var(--t);
  transform-origin: center top;
  transform: rotateX(-90deg);
  background:
    linear-gradient(180deg, var(--spine) 0 5%, transparent 5% 95%, var(--spine) 95%),
    repeating-linear-gradient(180deg, rgba(120, 84, 40, 0.18) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, #c99a4a, #f3d895 30%, #e9c77a 70%, #b98a3e);
}

.book-back {
  inset: 0;
  transform: translateZ(calc(var(--t) * -1));
  border-radius: 5px 2px 2px 5px;
  background: var(--spine);
  box-shadow: 0 50px 70px -24px rgba(0, 0, 0, 0.85);
}

.book3d.bible {
  --spine: #3a2416;
  --band: #d4a24c;
}

.book3d.quran {
  --spine: #0f4f57;
  --band: #d4a24c;
}

.book3d.torah {
  --spine: #d9c69e;
  --band: #8a6a3a;
}

/* A gold tree under the shelf: one trunk, a branch reaching up to each book, three roots */
.tree {
  display: block;
  /* Branch tips (x 70 and 450 of 520) sit under the outer books' centres. */
  width: calc((var(--book-w) + var(--book-gap)) * 2 * 520 / 380);
  height: auto;
  margin: -24px auto 0;
  overflow: visible;
}

.tree-wood path {
  fill: none;
  stroke: url(#tree-gold);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.tree-wood .trunk {
  stroke-width: 3.2;
}

.tree-wood .branch {
  stroke-width: 2;
}

.tree-wood .twig,
.tree-wood .fine {
  stroke-width: 1.1;
}

.tree-leaves use {
  fill: #e2b562;
  opacity: 0.85;
}

.js .tree-wood path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.6s 0.6s var(--ease-out) forwards;
}

.js .tree-wood .root {
  animation-delay: 1s;
}

.js .tree-wood .branch {
  animation-delay: 1.1s;
}

.js .tree-wood .twig {
  animation-duration: 1s;
  animation-delay: 2s;
}

.js .tree-leaves use {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: left center;
  animation: leaf 0.9s var(--ease-out) forwards;
  animation-delay: calc(2.5s + var(--i, 0) * 0.05s);
}

@keyframes leaf {
  from {
    scale: 0.2;
  }

  to {
    opacity: 0.85;
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.hero-stores {
  padding: 20px 0 72px;
}

.hero-stores p {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--on-night-3);
}

/* ---------------------------------------------------------------- Covers (titles are real text) */

.cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 2px 5px 5px 2px;
  background: #2a2018;
}

.cover > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover::after {
  /* Spine shading and a soft sheen, as in the app */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.28) 0%,
      rgba(255, 255, 255, 0.14) 2.2%,
      rgba(0, 0, 0, 0.1) 4.2%,
      rgba(0, 0, 0, 0) 8%
    ),
    linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.1) 45%, transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.06));
}

/* The plain centre panel of each cover (measured from the art, as in the app). */
.cover-panel {
  position: absolute;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.cover.bible .cover-panel {
  inset: 14.13% 18.45% 14.21% 23.69%;
}

.cover.quran .cover-panel {
  inset: 16.67% 27.38% 16.67% 25.36%;
}

.cover.torah .cover-panel {
  inset: 13.19% 20.18% 19.44% 26.91%;
}

.cover.bible,
.cover.quran {
  --title: #f0d58c;
  --label: #d9bd72;
}

.cover.torah {
  --title: #3a2614;
  --label: #3b3a8f;
}

.cover-title {
  line-height: 1;
  white-space: nowrap;
  color: var(--title);
}

.cover.bible .cover-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28cqw;
  letter-spacing: 0.02em;
}

.cover.quran .cover-title {
  font-family: 'Amiri', 'Geeza Pro', serif;
  font-weight: 700;
  font-size: 34.5cqw;
}

.cover.torah .cover-title {
  font-family: 'Frank Ruhl Libre', 'Times New Roman', serif;
  font-weight: 700;
  font-size: 34.5cqw;
}

.cover.bible .cover-title,
.cover.quran .cover-title {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.cover-label {
  margin-top: 7cqw;
  margin-right: -0.22em;
  font-family: var(--sans);
  font-size: 9cqw;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--label);
}

.cover-sub {
  margin-top: 3cqw;
  font-family: var(--serif);
  font-size: 8cqw;
  font-style: italic;
  opacity: 0.9;
  white-space: nowrap;
  color: var(--label);
}

/* ---------------------------------------------------------------- Paper sections */

.section {
  position: relative;
  padding: 104px 0;
}

.section-tint {
  background: var(--paper-2);
}

.head {
  max-width: 760px;
  margin: 0 auto 44px;
  text-align: center;
}

@media (max-width: 760px) {
  .section {
    padding: 72px 0;
  }

  .head {
    margin-bottom: 32px;
  }
}

/* ---------------------------------------------------------------- One story, three tellings */

.story-tabs {
  display: flex;
  gap: 6px;
  margin: 0 auto 40px;
  padding: 6px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  scrollbar-width: none;
}

.story-tabs::-webkit-scrollbar {
  display: none;
}

.story-tabs button {
  flex: none;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition:
    background 0.3s var(--ease),
    color 0.3s;
}

.story-tabs button:hover {
  color: var(--ink);
}

.story-tabs button[aria-selected='true'] {
  color: #fff;
  background: var(--night);
}

@media (prefers-color-scheme: dark) {
  .story-tabs button[aria-selected='true'] {
    color: var(--night);
    background: var(--on-night);
  }
}

@media (max-width: 760px) {
  .story-tabs {
    width: auto;
    max-width: none;
    margin-inline: -20px;
    padding: 8px 20px 12px;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .story-tabs button:not([aria-selected='true']) {
    background: var(--card);
    box-shadow: var(--shadow);
  }
}

.tellings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.tellings[hidden] {
  display: none;
}

.tellings .telling {
  animation: telling-in 0.7s var(--ease-out) both;
}

.tellings .telling:nth-child(2) {
  animation-delay: 0.06s;
}

.tellings .telling:nth-child(3) {
  animation-delay: 0.12s;
}

@keyframes telling-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.telling {
  --accent: var(--ink);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 30px 28px 24px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--ink);
  overflow: hidden;
  transition:
    transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}

.telling::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
}

.telling:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  text-decoration: none;
}

.telling.bible {
  --accent: var(--bible);
}

.telling.quran {
  --accent: var(--quran);
}

.telling.torah {
  --accent: var(--torah);
}

.telling-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.telling-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.telling-ref {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}

.telling q {
  flex: 1;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.5;
  quotes: none;
  text-wrap: pretty;
}

.telling-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-3);
}

.read-more {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.read-more::after {
  content: ' →';
}

.story-note {
  margin: 28px auto 0;
  max-width: 640px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-3);
}

@media (max-width: 900px) {
  .tellings {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin-inline: auto;
  }
}

/* ---------------------------------------------------------------- The reading tour (sticky phone) */

.tour {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.tour-phone {
  position: sticky;
  top: 100px;
  display: grid;
  place-items: center;
  height: calc(100vh - 130px);
  max-height: 780px;
}

/* An iPhone drawn in CSS (titanium edge, black border, Dynamic Island, status bar, home bar,
   side buttons), sized from its own width so it stays in proportion at any size.
   Screenshots are 393 × 852 points with the iPhone's safe areas (status bar and home bar). */
.device {
  position: relative;
  --w: 330px;
  width: var(--w);
  padding: calc(var(--w) * 0.031);
  border: calc(var(--w) * 0.011) solid transparent;
  border-radius: calc(var(--w) * 0.17);
  background:
    linear-gradient(#0a0908, #0a0908) padding-box,
    linear-gradient(140deg, #d9c6aa, #9c8467 22%, #e8d8be 46%, #8e785e 70%, #c7b293) border-box;
  box-shadow:
    0 50px 90px -30px rgba(40, 20, 5, 0.55),
    0 18px 36px -18px rgba(0, 0, 0, 0.35);
}

/* Side buttons: action button and volume on the left, side button and camera control on the right */
.device::before,
.device::after {
  content: '';
  position: absolute;
  width: calc(var(--w) * 0.011);
  border-radius: calc(var(--w) * 0.01);
}

.device::before {
  left: calc(var(--w) * -0.02);
  top: 16%;
  height: 27%;
  background: linear-gradient(
    180deg,
    #a48c6e 0 13%,
    transparent 13% 27%,
    #a48c6e 27% 60%,
    transparent 60% 67%,
    #a48c6e 67%
  );
}

.device::after {
  right: calc(var(--w) * -0.02);
  top: 25%;
  height: 34%;
  background: linear-gradient(180deg, #a48c6e 0 38%, transparent 38% 64%, #8e785e 64%);
}

.tour-phone .device {
  /* As tall as the space allows (the phone is about 2.07 times as tall as it is wide). */
  --w: min(330px, calc(min(100vh - 130px, 780px) * 0.95 / 2.0698));
}

.screen {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--w) * 0.128);
  aspect-ratio: 393 / 852;
  background: #000;
}

/* Dynamic Island */
.screen::before {
  content: '';
  position: absolute;
  z-index: 3;
  top: calc(var(--w) * 0.026);
  left: 50%;
  width: calc(var(--w) * 0.297);
  height: calc(var(--w) * 0.087);
  translate: -50% 0;
  border-radius: 99px;
  background: #000;
}

.status {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  height: calc(var(--w) * 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--w) * 0.006) calc(var(--w) * 0.075) 0 calc(var(--w) * 0.105);
  color: #000;
  pointer-events: none;
}

.status-time {
  font-family: var(--sans);
  font-size: calc(var(--w) * 0.04);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: calc(var(--w) * 0.013);
}

.status-icons svg {
  height: calc(var(--w) * 0.029);
  width: auto;
  fill: currentColor;
}

.home-bar {
  position: absolute;
  z-index: 2;
  bottom: calc(var(--w) * 0.019);
  left: 50%;
  width: calc(var(--w) * 0.328);
  height: calc(var(--w) * 0.0125);
  translate: -50% 0;
  border-radius: 99px;
  background: #000;
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .status {
    color: #fff;
  }

  .home-bar {
    background: #fff;
  }
}

.screen picture,
.screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tour-phone .screen picture {
  opacity: 0;
  transform: scale(1.03);
  transition:
    opacity 0.6s var(--ease),
    transform 0.9s var(--ease-out);
}

.tour-phone .screen picture.on {
  opacity: 1;
  transform: none;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.step {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 62vh;
  max-width: 460px;
  opacity: 0.3;
  transition: opacity 0.5s var(--ease);
}

.step.on {
  opacity: 1;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 22px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  color: var(--ember);
  box-shadow: inset 0 0 0 1.5px currentColor;
}

.step h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(26px, 2.8vw, 34px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.step p {
  margin: 0;
  font-size: 18px;
  color: var(--ink-2);
}

.step .inline-phone {
  display: none;
}

@media (max-width: 900px) {
  .tour {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tour-phone {
    display: none;
  }

  .step {
    min-height: 0;
    max-width: none;
    padding: 20px 0 44px;
    opacity: 1;
    text-align: center;
    align-items: center;
  }

  .step p {
    max-width: 520px;
  }

  .step .inline-phone {
    display: block;
    --w: min(280px, 76vw);
    margin-top: 36px;
  }
}

/* ---------------------------------------------------------------- Ask */

.ask {
  overflow: hidden;
  padding: 112px 0;
}

.ask-light {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(45% 55% at 80% 40%, rgba(212, 162, 76, 0.24), transparent 70%),
    radial-gradient(50% 60% at 10% 100%, rgba(180, 83, 42, 0.3), transparent 70%);
}

.ask-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 72px;
  align-items: center;
}

.ask h2 {
  font-size: clamp(34px, 4.6vw, 56px);
}

.flow {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
}

.flow li {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 18px;
  padding-bottom: 26px;
}

.flow li:not(:last-child)::after {
  /* the gold thread joining the steps */
  content: '';
  position: absolute;
  left: 23px;
  top: 54px;
  bottom: 4px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--gold), rgba(212, 162, 76, 0.15));
}

.flow-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  color: var(--gold);
}

.flow-icon svg {
  width: 24px;
  height: 24px;
}

.flow h3 {
  margin: 2px 0 4px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.flow p {
  margin: 0;
  font-size: 16px;
  color: var(--on-night-2);
}

.ask-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  margin-top: 16px;
}

.ask-actions span {
  font-size: 14px;
  color: var(--on-night-3);
}

.ask-visual {
  position: relative;
  display: grid;
  place-items: center;
}

.ask-visual .device {
  --w: min(320px, 78vw);
  box-shadow:
    0 60px 120px -30px rgba(0, 0, 0, 0.8),
    0 0 80px -20px rgba(212, 162, 76, 0.25);
}

@media (max-width: 900px) {
  .ask {
    padding: 76px 0;
  }

  .ask-grid {
    grid-template-columns: 1fr;
    gap: 64px;
  }
}

/* ---------------------------------------------------------------- Details (bento) */

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.tile {
  position: relative;
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 30px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tile.wide {
  grid-column: span 3;
}

.tile h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.tile p {
  margin: 0;
  font-size: 16px;
  color: var(--ink-2);
  max-width: 36ch;
}

.tile .art {
  margin-top: auto;
  padding-top: 28px;
}

.art.row {
  display: flex;
  align-items: center;
  gap: 24px;
}

.lines.grow {
  flex: 1;
  margin: 0;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pills span {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-2);
}

.themes {
  display: flex;
  gap: 12px;
}

.theme {
  flex: 1;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 18px 8px 14px;
  border-radius: 16px;
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(128, 128, 128, 0.2);
}

.theme small {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
}

.theme.light {
  background: #fff;
  color: #1c1c1e;
}

.theme.sepia {
  background: #f8f1e3;
  color: #4f321c;
}

.theme.dark {
  background: #121212;
  color: #dcdcde;
}

.swatches {
  display: flex;
  gap: 12px;
}

.swatches span {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 6px 14px -6px rgba(0, 0, 0, 0.3);
}

.lines {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.lines i {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: var(--rule);
}

.lines i.hl {
  background: rgba(255, 204, 0, 0.5);
}

.lines i.hl2 {
  background: rgba(52, 199, 89, 0.4);
}

.wave {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 72px;
}

.wave i {
  flex: 1;
  height: var(--h);
  border-radius: 3px;
  background: linear-gradient(var(--gold), #b4532a);
  transform-origin: center;
  animation: wave 1.2s ease-in-out infinite alternate;
}

.wave i:nth-child(3n + 1) {
  animation-delay: -0.4s;
}

.wave i:nth-child(3n + 2) {
  animation-delay: -0.8s;
}

.wave i:nth-child(4n) {
  animation-duration: 1.6s;
}

@keyframes wave {
  from {
    transform: scaleY(0.3);
  }
}

.sizes {
  display: flex;
  align-items: baseline;
  gap: 18px;
  font-family: var(--serif);
}

.sizes span:nth-child(1) {
  font-size: 22px;
  opacity: 0.45;
}

.sizes span:nth-child(2) {
  font-size: 36px;
  opacity: 0.7;
}

.sizes span:nth-child(3) {
  font-size: 58px;
}

.lock {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(150deg, var(--gold), #b4532a);
  box-shadow: 0 18px 36px -12px rgba(180, 83, 42, 0.6);
}

.lock svg {
  width: 40px;
  height: 40px;
}

.minis {
  display: flex;
  gap: 14px;
}

.minis img {
  width: 31%;
  max-width: 180px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 16px 30px -12px rgba(0, 0, 0, 0.5);
}

@media (max-width: 900px) {
  .bento {
    grid-template-columns: 1fr 1fr;
  }

  .tile,
  .tile.wide {
    grid-column: span 1;
  }
}

@media (max-width: 600px) {
  .bento {
    grid-template-columns: 1fr;
  }

  .tile {
    min-height: 0;
  }
}

/* ---------------------------------------------------------------- Pricing */

.plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 920px;
  margin-inline: auto;
  text-align: left;
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 40px;
  border-radius: 32px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.plan.featured {
  color: var(--on-night);
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(212, 162, 76, 0.28), transparent 70%),
    radial-gradient(70% 60% at 0% 100%, rgba(180, 83, 42, 0.35), transparent 70%), var(--night);
  box-shadow: 0 40px 80px -30px rgba(40, 20, 5, 0.6);
}

.plan-name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
}

.plan.featured .plan-name {
  color: var(--gold);
}

.price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 6px;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.price {
  flex-wrap: wrap;
  row-gap: 2px;
}

/* The yearly price, right under the monthly one */
.price-alt {
  flex-basis: 100%;
  margin-top: 2px;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--on-night-2);
}

.price-alt b {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--on-night);
}

.price small {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-2);
}

.plan.featured .price small,
.plan.featured .per {
  color: var(--on-night-2);
}

.per {
  margin: 0 0 28px;
  min-height: 1.5em;
  font-size: 15px;
  color: var(--ink-2);
}

.plan ul {
  display: grid;
  gap: 12px;
  margin: 0 0 36px;
  padding: 28px 0 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.plan.featured ul {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.plan li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  font-size: 16px;
}

.plan li svg {
  width: 22px;
  height: 22px;
  color: var(--ember);
}

.plan.featured li svg {
  color: var(--gold);
}

.plan .btn {
  margin-top: auto;
}

.fine {
  margin: 32px auto 0;
  max-width: 640px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-3);
}

@media (max-width: 800px) {
  .plans {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .plan {
    padding: 32px 28px;
  }
}

/* ---------------------------------------------------------------- FAQ */

.faq-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 72px;
  align-items: start;
}

.faq-grid .head {
  position: sticky;
  top: 120px;
  margin: 0;
  text-align: left;
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq details:first-child {
  border-top: 1px solid var(--rule);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '';
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 12px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 2px 12px no-repeat,
    var(--paper-2);
  transition: transform 0.35s var(--ease);
}

.section-tint .faq summary::after {
  background:
    linear-gradient(var(--ink), var(--ink)) center / 12px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 2px 12px no-repeat,
    var(--card);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  margin: 0;
  padding: 0 48px 26px 0;
  font-size: 17px;
  color: var(--ink-2);
}

@media (max-width: 900px) {
  .faq-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .faq-grid .head {
    position: static;
    text-align: center;
  }
}

/* ---------------------------------------------------------------- Closing */

.closing {
  overflow: hidden;
  padding: 112px 0 96px;
  text-align: center;
}

.closing .app-icon {
  width: 128px;
  height: 128px;
  margin: 0 auto 32px;
  border-radius: 29px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 24px 48px -18px rgba(0, 0, 0, 0.6);
}

.closing h2 {
  font-size: clamp(40px, 5.6vw, 72px);
}

.closing .lede {
  max-width: 560px;
  margin-inline: auto;
}

.closing .hero-cta {
  margin-bottom: 28px;
}

/* ---------------------------------------------------------------- Footer */

.footer {
  padding: 56px 0 64px;
  color: var(--on-night-2);
  background: #0e0a08;
  font-size: 14px;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer .brand {
  color: var(--on-night);
  margin: 0;
}

.footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer a {
  color: var(--on-night-2);
}

.footer a:hover {
  color: var(--on-night);
}

.credits {
  margin: 24px 0 0;
  max-width: 820px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--on-night-3);
}

/* ---------------------------------------------------------------- Reveal on scroll */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1s var(--ease-out),
    transform 1s var(--ease-out);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .book,
  .tour-phone .screen picture {
    transition: none;
  }
}

/* ---------------------------------------------------------------- Text pages */

.page-hero {
  padding: 128px 0 56px;
  overflow: hidden;
}

.page-hero .hero-light {
  background:
    radial-gradient(50% 80% at 85% 0%, rgba(212, 162, 76, 0.24), transparent 70%),
    radial-gradient(50% 80% at 5% 100%, rgba(180, 83, 42, 0.28), transparent 70%);
}

.page-hero .wrap,
.page-body .wrap {
  max-width: 760px;
}

.page-hero h1 {
  font-size: clamp(40px, 6vw, 66px);
}

.page-hero p {
  margin: 16px 0 0;
  color: var(--on-night-2);
}

.page-body {
  padding: 52px 0 96px;
}

.page-body h2 {
  margin: 48px 0 12px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.page-body p,
.page-body li {
  color: var(--ink-2);
}

.page-body li {
  margin-bottom: 8px;
}

.page-body strong {
  color: var(--ink);
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cards a {
  display: block;
  padding: 28px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--ink);
  transition:
    transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}

.cards a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  text-decoration: none;
}

.cards strong {
  display: block;
  font-size: 19px;
}

.cards span {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  color: var(--ink-2);
}

.qa {
  margin: 0;
}

.qa dt {
  margin-top: 28px;
  font-weight: 600;
  color: var(--ink);
}

.qa dd {
  margin: 6px 0 0;
  color: var(--ink-2);
}

@media (max-width: 600px) {
  .cards {
    grid-template-columns: 1fr;
  }
}
