/* Lullsong site. One line unit (28px) sets every gap; three type sizes share it:
   small 14/28, body 18/28, display 44/56. Colours mirror the app's Theme.swift. */
:root {
  --line: 28px;
  --sky-top: #575aad;
  --sky-bottom: #1c1c42;
  --text: #faf5eb;
  --dim: rgba(250, 245, 235, .74);
  --moon: #ffe09e;
  --ink: #29295c;
  --card: rgba(255, 255, 255, .07);
  --card-line: rgba(255, 255, 255, .12);
  --mint: #b3e6cc;
  --peach: #ffd1b3;
  --rose: #ffc2d1;
  --sky: #c7d4ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--sky-bottom); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 400 18px/var(--line) ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Night sky in three fixed layers, back to front: the painted sky, a scrim that
   deepens as you read on, and a field of small stars. Scroll-driven animations
   move them at different speeds for parallax; browsers without
   animation-timeline simply show the still sky. */
html::before, html::after, body::before {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  pointer-events: none;
}
html::before {
  height: 140vh;
  background: url(/img/sky.jpg) center top / cover no-repeat, var(--sky-top);
  z-index: -3;
}
body::before {
  height: 100vh;
  /* Tint the painting into the app's own sky (Theme.skyTop to skyBottom). */
  background: linear-gradient(180deg, rgba(87, 90, 173, .78) 0, rgba(44, 44, 102, .84) 55%, rgba(28, 28, 66, .92) 100%);
  z-index: -2;
}
html::after {
  height: 220vh;
  background-image:
    radial-gradient(1.6px 1.6px at 24px 40px, rgba(255, 240, 210, .95), transparent 70%),
    radial-gradient(1px 1px at 140px 110px, rgba(255, 255, 255, .8), transparent 70%),
    radial-gradient(1.2px 1.2px at 230px 260px, rgba(255, 224, 158, .9), transparent 70%),
    radial-gradient(1px 1px at 80px 300px, rgba(255, 255, 255, .7), transparent 70%),
    radial-gradient(2px 2px at 300px 180px, rgba(255, 240, 210, .6), transparent 70%);
  background-size: 340px 360px;
  opacity: .8;
  z-index: -1;
}

/* The moon: a cream disc with a sky-sized hole slid across it (mask), so the
   crescent thins as you scroll, like the moon waning. A soft glow sits behind. */
.moon {
  position: fixed;
  top: 0;
  right: 16px;
  width: 200px;
  height: 200px;
  scale: .62;
  transform-origin: 100% 0;
  translate: 0 40px;
  pointer-events: none;
  z-index: -2;
  /* Eased falloff that reaches zero inside the box, so the glow never shows an edge. */
  background: radial-gradient(closest-side at 60% 60%, rgba(255, 224, 158, .2) 30%, rgba(255, 224, 158, .15) 44%, rgba(255, 224, 158, .11) 60%, rgba(255, 224, 158, .05) 74%, rgba(255, 224, 158, .015) 88%, rgba(255, 224, 158, 0) 100%);
}
.moon i {
  position: absolute;
  inset: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff6dc, #ffd682);
  -webkit-mask: radial-gradient(circle 68px at 50% 50%, transparent 67px, #000 68px) -165px -160px / 408px 408px no-repeat;
  mask: radial-gradient(circle 68px at 50% 50%, transparent 67px, #000 68px) -165px -160px / 408px 408px no-repeat;
}

@supports (animation-timeline: scroll()) {
  html::before { animation: drift-far linear both; animation-timeline: scroll(root); }
  html::after { animation: drift-near linear both; animation-timeline: scroll(root); }
  /* Darkening shares the moon's range and easing, so the night deepens as the moon wanes. */
  body::before { animation: deepen ease-in both; animation-timeline: scroll(root); animation-range: 0 110vh; }
  .moon { animation: drift-mid linear both; animation-timeline: scroll(root); }
  .moon i { animation: wane ease-in both; animation-timeline: scroll(root); animation-range: 0 110vh; }
}
@keyframes drift-far { to { transform: translateY(-40vh); } }
@keyframes drift-mid { to { transform: translateY(-60vh); } }
@keyframes wane { to { -webkit-mask-position: -142px -141px; mask-position: -142px -141px; } }
@keyframes drift-near { to { transform: translateY(-120vh); } }
/* Inset shadow paints over the layer's own gradient (background-color would sit under it and barely show). */
@keyframes deepen { from { box-shadow: inset 0 0 0 100vmax rgba(10, 10, 28, 0); } to { box-shadow: inset 0 0 0 100vmax rgba(10, 10, 28, .66); } }

@media (prefers-reduced-motion: reduce) {
  html::before, html::after, body::before, .moon, .moon i { animation: none; }
}

a { color: var(--moon); text-underline-offset: 3px; }

h1, h2, h3, p, ul, ol { margin: 0; }

h1 { font-size: 44px; line-height: calc(var(--line) * 2); font-weight: 700; letter-spacing: -.5px; }
h2 { font-size: 18px; line-height: var(--line); font-weight: 700; }
h3 { font-size: 18px; line-height: var(--line); font-weight: 600; }

.label {
  font-size: 14px;
  line-height: var(--line);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--moon);
}

.dim { color: var(--dim); }

/* Type area: unequal margins, a little wider on the right, deeper at the foot. */
.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px 0 24px;
}

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--line) * 3);
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}
.mark img { width: 28px; height: 28px; border-radius: 7px; }
.nav { display: flex; gap: 24px; }
.nav a {
  color: rgba(250, 245, 235, .86);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav a:hover, .nav a[aria-current] { color: var(--text); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: calc(var(--line) * 2);
  padding: calc(var(--line) * 2) 0 calc(var(--line) * 3);
}
.hero h1 { margin: var(--line) 0; max-width: 12em; }
.hero p.lead { max-width: 30em; color: var(--dim); }
.hero .cta { margin-top: calc(var(--line) * 2); display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

.button {
  display: inline-flex;
  align-items: center;
  height: calc(var(--line) * 2);
  padding: 0 28px;
  border-radius: 28px;
  background: var(--moon);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
}
.button:hover { background: #fff0c8; }
.cta .note { font-size: 14px; color: var(--dim); }

.phone {
  justify-self: center;
  width: 280px;
  padding: 10px;
  border-radius: 48px;
  background: #0f0f26;
  box-shadow: 0 0 0 1px var(--card-line), 0 28px 84px rgba(10, 10, 40, .55);
}
.phone img { display: block; width: 100%; height: auto; border-radius: 38px; }

/* Sections */
section { padding: calc(var(--line) * 3) 0 0; }
section > .label { display: block; }
section > h2.big { font-size: 44px; line-height: calc(var(--line) * 2); letter-spacing: -.5px; margin-bottom: var(--line); max-width: 16em; }
section > p.intro { max-width: 34em; color: var(--dim); margin-bottom: calc(var(--line) * 2); }

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--line) 24px;
}
.card {
  padding: var(--line) 24px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--card-line);
}
.card h3 { margin-bottom: var(--line); }
.card p { color: var(--dim); }
.card .cite { margin-top: var(--line); font-size: 14px; color: var(--dim); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 5px; margin-right: 10px; vertical-align: 1px; }
.dot.mint { background: var(--mint); }
.dot.peach { background: var(--peach); }
.dot.rose { background: var(--rose); }
.dot.sky { background: var(--sky); }

.sounds { display: grid; grid-template-columns: 1fr; gap: var(--line) 24px; }
.sounds h3 { margin-bottom: 0; }
.sounds p { color: var(--dim); }

.plans { display: grid; grid-template-columns: 1fr; gap: var(--line) 24px; }
.plan { padding: var(--line) 28px; }
.plan .label.dim { color: var(--dim); }
.plan .figure { color: var(--text); font-size: 44px; line-height: calc(var(--line) * 2); font-weight: 700; letter-spacing: -.5px; }
.plan .figure span { font-size: 18px; font-weight: 600; letter-spacing: 0; color: var(--dim); }
.plan .sub { color: var(--dim); margin-bottom: var(--line); }
/* Feature rows: label left, value right, hairline between; each row is two lines tall. */
.plan ul { list-style: none; padding: 0; }
.plan li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--card-line);
  margin-top: -1px;
}
.plan li span { color: var(--dim); }
.plan li b { font-weight: 600; text-align: right; }
.plan.pro {
  background: linear-gradient(180deg, rgba(255, 224, 158, .16), rgba(255, 224, 158, .04));
  box-shadow: inset 0 0 0 1px rgba(255, 224, 158, .45), 0 28px 84px rgba(10, 10, 40, .35);
}
.plan.pro li b { color: var(--moon); }
.plan .price { margin-top: var(--line); font-size: 14px; color: var(--dim); }

/* Long-form pages: support, privacy */
.doc { max-width: 680px; padding: calc(var(--line) * 2) 0 0; }
.doc h1 { margin-bottom: var(--line); }
.doc h2 { margin-top: calc(var(--line) * 2); }
.doc h3 { margin-top: var(--line); }
.doc p, .doc ul, .doc ol { color: var(--dim); }
.doc p + p { margin-top: var(--line); }
.doc ul, .doc ol { padding-left: 24px; }
.doc ol li + li { margin-top: calc(var(--line) / 2); }
.doc ol a { word-break: break-all; }
.doc .updated, .doc .lang { font-size: 14px; }
.doc .lang a { margin-right: 16px; }
.doc section { padding: 0; }

/* Footer: deeper than the header, per the type-area ratio. */
footer {
  margin-top: calc(var(--line) * 5);
  padding: var(--line) 0 calc(var(--line) * 3);
  border-top: 1px solid var(--card-line);
  font-size: 14px;
  color: var(--dim);
}
footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 24px; }
footer address { font-style: normal; }
footer a { color: var(--dim); }
footer a:hover { color: var(--text); }

/* Listen: five preview tiles. Buttons are wired by /listen.js; without
   script the native audio controls stay visible. */
.tracks { display: grid; grid-template-columns: 1fr; gap: var(--line) 24px; }
.track { display: grid; grid-template-columns: 56px 1fr; gap: 0 16px; align-items: center; }
.track h3 { margin: 0; }
.track p { color: var(--dim); font-size: 14px; }
.track audio { grid-column: 1 / -1; width: 100%; margin-top: var(--line); }
.track.js audio { display: none; }
.play {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 28px;
  background: var(--moon);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.play:hover { background: #fff0c8; }
.play:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.play svg { width: 20px; height: 20px; fill: currentColor; }
.play .i-pause, .play[aria-pressed="true"] .i-play { display: none; }
.play[aria-pressed="true"] .i-pause { display: block; }
.bar { grid-column: 2; height: 2px; margin-top: 12px; background: var(--card-line); border-radius: 1px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--moon); }

@media (min-width: 760px) {
  .wrap { padding: 0 56px 0 40px; }
  .tracks { grid-template-columns: repeat(2, 1fr); }
    /* Moon sits near the centre line, between the headline and the phone (phone left = 50% + 164px in the 1080 type area). */
  .moon { right: auto; left: min(calc(50% - 150px), calc(100% - 690px)); scale: 1.3; transform-origin: 0 0; translate: 0 84px; }
  .hero { grid-template-columns: 1fr 320px; align-items: center; padding-top: calc(var(--line) * 3); }
  .phone { width: 320px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .sounds { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .sounds { grid-template-columns: repeat(4, 1fr); }
  .tracks { grid-template-columns: repeat(3, 1fr); }
}

[hidden] { display: none !important; }

/* FAQ: question and answer pairs, two columns on wide screens. */
.faq { display: grid; grid-template-columns: 1fr; gap: var(--line) 48px; }
.faq h3 { margin-bottom: calc(var(--line) / 2); }
.faq p { color: var(--dim); }
@media (min-width: 760px) { .faq { grid-template-columns: repeat(2, 1fr); } }
