/* Nightjar landing page. The compliance pages keep using styles.css. */

@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-opsz.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-opsz-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #0c0f1a;
  --well: #070912;
  --raised: #141826;
  --indigo: #191b2c; /* the lightest the night background ever gets */
  --firefly: #e2c296;
  --glow: #f7dda8;
  --moon: #eceef4;
  --mist: #b9bdcb;
  --dusk: #7c839c;
  --paper: #ae9f89;
  --paper-ink: #2a241d;
  --hair: rgba(255, 255, 255, 0.1);

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;

  --gutter: clamp(24px, 4vw, 56px);
  --phone-h: min(70vh, 720px);
  --phone-w: calc(var(--phone-h) * 0.46);
  --flank-gap: clamp(28px, 5vw, 88px);
  --nav-h: 72px;
}

@supports (height: 1svh) {
  :root { --phone-h: min(70svh, 720px); }
}

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

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--nav-h);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  color: var(--mist);
  background: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
::selection { background: rgba(226, 194, 150, 0.32); color: var(--moon); }

:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--firefly);
  font: 600 0.875rem/1 var(--ui);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* Display type: light serif, two-tone lines like the App Store gallery. */
.display {
  color: var(--moon);
  font-weight: 300;
  font-size: clamp(2.35rem, 4.5vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.display > span { display: block; }
.display .dim { color: rgba(214, 219, 235, 0.5); }
.display--step { font-size: clamp(2rem, 3.5vw, 3.5rem); }
.display--xl { font-size: clamp(2.6rem, 6.2vw, 6rem); }
.display--shift {
  font-size: clamp(1.75rem, 3vw, 2.85rem);
  line-height: 1.1;
  max-width: 19ch;
}

.eyebrow {
  margin-bottom: 30px;
  color: var(--firefly);
  font: 600 0.75rem/1.2 var(--ui);
  letter-spacing: 0.26em;
  text-indent: 0.26em; /* balances the trailing letter-space when centred */
  text-transform: uppercase;
}
.eyebrow--quiet { color: var(--dusk); }

/* Translucent glass pill, as on the app's chips. */
.glass {
  display: inline-block;
  padding: 17px 30px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: var(--moon);
  background: rgba(14, 18, 32, 0.46);
  font: 600 0.8125rem/1 var(--ui);
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.glass:hover {
  border-color: rgba(226, 194, 150, 0.8);
  color: var(--glow);
  background: rgba(226, 194, 150, 0.14);
}

.textlink {
  padding: 8px 4px;
  border: 0;
  color: var(--moon);
  background: none;
  font: 500 0.9375rem/1 var(--ui);
  text-decoration: underline;
  text-decoration-color: rgba(236, 238, 244, 0.35);
  text-underline-offset: 5px;
  cursor: pointer;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.textlink:hover { color: var(--glow); text-decoration-color: currentColor; }
.textlink[hidden] { display: none; }

/* ───────── Nav ───────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}
.nav.is-stuck {
  background: rgba(12, 15, 26, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}
.nav__brand img { width: 118px; }
.nav__links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font: 500 0.875rem/1 var(--ui);
}
.nav__links a {
  color: var(--dusk);
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav__links a:hover { color: var(--moon); }
.nav__cta {
  padding: 11px 18px;
  border: 1px solid rgba(226, 194, 150, 0.45);
  border-radius: 999px;
  color: var(--firefly);
  font: 600 0.875rem/1 var(--ui);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav__cta:hover { background: var(--firefly); color: var(--ink); }

/* ───────── Hero + ritual stage ───────── */
.ritual { position: relative; }
/* Where "The ritual" links land: the first step, not the top of the hero. */
.ritual__anchor {
  position: absolute;
  top: 100vh;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.scrolly .ritual__anchor { top: calc(82vh + var(--nav-h)); }
.stage {
  position: relative;
  isolation: isolate;
}
.stage__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(38vh 38vh at 50% 46%, rgba(226, 194, 150, 0.1), transparent 70%),
    radial-gradient(75vw 62vh at 50% 58%, var(--indigo), rgba(25, 27, 44, 0) 72%);
  pointer-events: none;
}
.fireflies {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: none;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
@keyframes bloom-half {
  from { opacity: 0; }
  to { opacity: 0.5; }
}
.scrolly .fireflies { display: block; opacity: 0.5; animation: bloom-half 3s ease 0.8s both; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: 100vh;
  padding: var(--nav-h) var(--gutter) 40px;
}
.hero__side--a { justify-self: end; padding-right: var(--flank-gap); text-align: right; }
.hero__side--b { justify-self: start; padding-left: var(--flank-gap); }
.hero__inner { position: relative; max-width: 440px; }
/* Hung below the headline so both halves of it sit on one line across the phone. */
.hero__lede {
  position: absolute;
  top: 100%;
  right: 0;
  width: min(34ch, 100%);
  margin-top: 28px;
  color: var(--mist);
  font-size: 1.0625rem;
  text-wrap: balance;
}
/* Says what Nightjar is, above the headline, without moving the headline. */
.display > .hero__kicker {
  position: absolute;
  right: 0;
  bottom: 100%;
  margin-bottom: 26px;
  color: var(--firefly);
  font: 600 0.75rem/1.2 var(--ui);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero .get {
  position: absolute;
  top: 100%;
  left: 0;
  width: max-content;
}

.phone-wrap { perspective: 1600px; }
.phone {
  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  padding: 5px;
  border-radius: calc(var(--phone-w) * 0.165);
  background: linear-gradient(160deg, #3a3f52, #171a26 38%, #0b0d15);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 50px 120px -20px rgba(0, 0, 0, 0.85),
    0 0 140px rgba(25, 27, 44, 0.9);
  transform-style: preserve-3d;
  will-change: transform;
}
.phone__glass {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--phone-w) * 0.148);
  background: var(--well);
}
.phone__screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.phone__screen + .phone__screen { opacity: 0; visibility: hidden; }

.get {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 34px;
}
.get--center { justify-content: center; margin-top: 40px; }
/* App Store badge with the Product Hunt badge under it, both the same width. */
.get__badges {
  display: grid;
  gap: 12px;
}
.get__badges .store { justify-content: center; }
.ph {
  display: block;
  width: 0; /* take the App Store badge's width instead of the image's own */
  min-width: 100%;
  border-radius: 10px;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.ph img { display: block; width: 100%; height: auto; }
.ph:hover { box-shadow: 0 0 44px rgba(226, 194, 150, 0.28); transform: translateY(-1px); }

.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px 11px 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  color: #fff;
  background: #000;
  font-family: var(--ui);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, box-shadow 0.3s ease, transform 0.2s ease;
}
.store svg { width: 30px; height: 30px; fill: currentColor; }
.store small {
  display: block;
  margin-bottom: 2px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.store:hover {
  border-color: var(--firefly);
  box-shadow: 0 0 44px rgba(226, 194, 150, 0.28);
  transform: translateY(-1px);
}

.qr {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--dusk);
  font: 500 0.8125rem/1.3 var(--ui);
  text-decoration: none;
}
.qr img {
  width: 64px;
  height: 64px;
  padding: 7px;
  border-radius: 10px;
  background: #ece3d3;
}
.qr span { max-width: 9ch; }

/* Steps: plain alternating list by default (no JS / reduced motion). */
.beats {
  display: grid;
  gap: clamp(72px, 12vh, 140px);
  max-width: 1040px;
  margin: 0 auto;
  padding: 10vh var(--gutter) 14vh;
}
.beat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 96px);
}
.beat__shot {
  justify-self: center;
  width: min(100%, 280px);
  padding: 5px;
  border-radius: 46px;
  background: linear-gradient(160deg, #3a3f52, #171a26 38%, #0b0d15);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 40px 90px -20px rgba(0, 0, 0, 0.8);
}
.beat__shot img { border-radius: 41px; }
.beat--left .beat__shot { order: 2; }
.beat__copy p {
  max-width: 34ch;
  margin-top: 20px;
  color: var(--mist);
  text-wrap: balance;
}

.rail, .scroll-cue { display: none; }

/* Pinned mode: the phone stays centred and the steps play around it. */
.scrolly .ritual { height: calc(7 * 82vh + 100vh); }
.scrolly .stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
@supports (height: 1svh) {
  .scrolly .stage { height: 100svh; }
  .scrolly .hero { min-height: 100svh; }
}
/* dvh tracks the browser toolbars as they collapse, so the stage always fills
   the visible screen and its contents stay centred in it. */
@supports (height: 1dvh) {
  .scrolly .stage { height: 100dvh; }
  .scrolly .hero { min-height: 100dvh; }
}
.scrolly .hero { height: 100%; padding-bottom: 56px; }
.scrolly .beats {
  position: absolute;
  inset: 0;
  display: block;
  max-width: none;
  margin: 0;
  padding: 0;
  pointer-events: none;
}
.scrolly .beat {
  position: absolute;
  top: 50%;
  display: block;
  width: min(31vw, 440px);
  transform: translateY(-50%);
}
.scrolly .beat--right { left: calc(50% + var(--phone-w) / 2 + var(--flank-gap)); }
.scrolly .beat--left {
  right: calc(50% + var(--phone-w) / 2 + var(--flank-gap));
  text-align: right;
}
.scrolly .beat--left .beat__copy p { margin-left: auto; }
.scrolly .beat__shot { display: none; }
.scrolly .beat__copy { opacity: 0; visibility: hidden; }

.scrolly .rail {
  position: absolute;
  bottom: 26px;
  left: 50%;
  display: flex;
  gap: 9px;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.scrolly .rail.is-on { opacity: 1; }
.rail i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  transition: width 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease;
}
.rail i.is-active {
  width: 22px;
  background: var(--glow);
  box-shadow: 0 0 14px rgba(247, 221, 168, 0.8);
}
.scrolly .scroll-cue {
  position: absolute;
  bottom: 22px;
  left: 50%;
  display: block;
  color: var(--dusk);
  font: 500 0.8125rem/1 var(--ui);
  transform: translateX(-50%);
  transition: opacity 0.4s ease;
}
.scrolly .scroll-cue.is-off { opacity: 0; }

/* One load sequence: glow, phone, then the two halves of the headline. */
@keyframes rise {
  from { opacity: 0; transform: translateY(46px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes drift-in-a {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: none; }
}
@keyframes drift-in-b {
  from { opacity: 0; transform: translateX(-28px); }
  to { opacity: 1; transform: none; }
}
@keyframes bloom {
  from { opacity: 0; }
  to { opacity: 1; }
}
.scrolly .stage__glow { animation: bloom 2.2s ease both; }
.scrolly .phone-wrap { animation: rise 1.3s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both; }
.scrolly .hero__side--a .hero__inner { animation: drift-in-a 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.55s both; }
.scrolly .hero__side--b .hero__inner { animation: drift-in-b 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.7s both; }

/* ───────── Worlds ───────── */
.worlds {
  --cover-w: clamp(112px, 11.5vw, 196px);
  --wall-gap: clamp(10px, 1.2vw, 18px);
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: max(118vh, 760px);
  padding: 16vh var(--gutter);
  overflow: hidden;
  text-align: center;
}
.wall {
  --wall-x: -50%;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -2;
  display: flex;
  flex-direction: column;
  gap: var(--wall-gap);
  transform: translate(var(--wall-x), -50%) perspective(var(--wall-persp, 1500px)) rotateX(24deg) rotateZ(-9deg) scale(var(--wall-zoom, 1.08));
  transform-origin: 50% 50%;
  will-change: transform;
}
/* Once rows are doubled for looping, the first half sits over the viewport. */
.wall.is-live {
  --wall-x: -25%;
  transform-origin: 25% 50%;
}
.wall__row {
  display: flex;
  gap: var(--wall-gap);
  width: max-content;
}
.wall__row img {
  flex: none;
  width: var(--cover-w);
  aspect-ratio: 1232 / 1520;
  border-radius: clamp(8px, 1vw, 14px);
  object-fit: cover;
  background: var(--raised);
}
@keyframes wall-drift {
  to { transform: translateX(calc(-50% - var(--wall-gap) / 2)); }
}
.wall.is-live .wall__row { animation: wall-drift 214s linear infinite; }
.wall.is-live .wall__row:nth-child(even) { animation-direction: reverse; animation-duration: 271s; }
.wall.is-live .wall__row:nth-child(3n) { animation-duration: 171s; }
.wall.is-paused .wall__row { animation-play-state: paused; }

.worlds__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(8, 10, 20, 0.6), rgba(8, 10, 20, 0.6)),
    linear-gradient(to bottom, var(--ink) 0%, rgba(12, 15, 26, 0) 24%, rgba(12, 15, 26, 0) 76%, var(--ink) 100%);
  pointer-events: none;
}
.worlds__copy { max-width: 860px; }
.worlds .display .dim { color: rgba(214, 219, 235, 0.64); }
.worlds__lede {
  max-width: 46ch;
  margin: 28px auto 0;
  color: var(--moon);
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  text-wrap: balance;
}
.worlds__premium {
  margin: 12px auto 0;
  color: var(--firefly);
  font-style: italic;
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
}
.worlds__actions {
  display: grid;
  justify-items: center;
  gap: 18px;
  margin-top: 34px;
}

/* ───────── Science ───────── */
.science {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(96px, 16vh, 168px) var(--gutter) clamp(72px, 10vh, 120px);
}
.science__intro {
  max-width: 940px;
  margin: 0 auto;
  text-align: center;
}
.science__intro p:not(.eyebrow) {
  max-width: 44ch;
  margin: 28px auto 0;
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  text-wrap: balance;
}

/* Each shift is its own chapter: a rule, a short label, the claim, then the facts. */
.shift {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(32px, 7vw, 112px);
  margin-top: clamp(72px, 12vh, 128px);
  padding-top: clamp(40px, 7vh, 72px);
  border-top: 1px solid transparent;
}
.shift__head { grid-column: 1; }
.shift__count {
  margin-bottom: 12px;
  color: var(--firefly);
  font-style: italic;
  font-size: 1.0625rem;
}
.shift__body { display: contents; }
.shift .facts {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}
.shift .sealed {
  grid-column: 1;
  justify-self: start;
  margin-top: clamp(36px, 6vh, 64px);
}
.shift--two .facts { grid-row: 1; align-self: start; padding-top: 6px; }
.shift .curve { grid-column: 1 / -1; }

.sealed { text-align: center; }
.jar { width: clamp(190px, 21vw, 270px); overflow: visible; }
.jar__lid-shade { fill: #49555d; opacity: 0.4; }
.jar__lid { fill: none; stroke: var(--firefly); stroke-width: 5; stroke-miterlimit: 10; }
.jar__body {
  fill: url(#jar-glass);
  stroke: var(--firefly);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.jar__shine { fill: none; stroke: #7c8a94; stroke-width: 12; stroke-linecap: round; opacity: 0.4; }
.jar__fly { fill: var(--glow); filter: drop-shadow(0 0 30px rgba(247, 221, 168, 0.95)); }
/* The label the app puts on a sealed jar: italic serif on a faint glass plate. */
.jar__label rect {
  fill: rgba(9, 11, 20, 0.5);
  stroke: rgba(236, 238, 244, 0.16);
  stroke-width: 3;
}
.jar__label text {
  fill: rgba(236, 238, 244, 0.88);
  font: italic 400 56px var(--serif);
}
@keyframes hover-fly {
  0%, 100% { transform: translate(0, 0); }
  30% { transform: translate(34px, -30px); }
  62% { transform: translate(-38px, 22px); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}
.scrolly .jar__fly { animation: hover-fly 9s ease-in-out infinite; }
.scrolly .jar__halo { animation: hover-fly 9s ease-in-out infinite, breathe 4.5s ease-in-out infinite; }
.facts { display: grid; }
.facts > .fact + .fact {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--hair);
}
.fact h4 {
  color: var(--moon);
  font-weight: 400;
  font-size: clamp(1.25rem, 1.7vw, 1.5rem);
  line-height: 1.28;
  letter-spacing: -0.005em;
  max-width: 40ch;
  text-wrap: balance;
}
.fact p {
  max-width: 50ch;
  margin-top: 10px;
  font-size: 1.125rem;
}
.more { margin-top: 10px; }
.more summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--firefly);
  padding: 4px 0;
  font: 500 0.8125rem/1 var(--ui);
  letter-spacing: 0.02em;
  list-style: none;
  cursor: pointer;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after {
  content: "+";
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 0.8;
  transition: transform 0.25s ease;
}
.more[open] summary::after { transform: rotate(45deg); }
.more summary:hover { color: var(--glow); }
.more__close,
.more[open] .more__open { display: none; }
.more[open] .more__close { display: inline; }
@keyframes unfold {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.more[open] > p { animation: unfold 0.35s ease both; }
.more > p:first-of-type { margin-top: 14px; }

.fact .fact__figure {
  margin: 0 0 18px;
  color: var(--firefly);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1;
}
.fact__figure b {
  margin-right: 0.08em;
  color: var(--glow);
  font-style: normal;
  font-weight: 200;
  font-size: clamp(5rem, 9vw, 8rem);
  letter-spacing: -0.04em;
  vertical-align: -0.06em;
}
.fact .fact__source {
  margin-top: 12px;
  font: 500 0.8125rem/1.4 var(--ui);
}
.fact__source a {
  color: var(--dusk);
  text-decoration-color: rgba(124, 131, 156, 0.5);
  text-underline-offset: 3px;
}
.fact__source a:hover { color: var(--firefly); }

.curve { margin-top: clamp(56px, 9vh, 96px); }
.curve .eyebrow { margin: 0 0 10px 3.3%; text-indent: 0; }
.curve svg { width: 100%; height: auto; overflow: visible; }
.curve__grid line {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
  stroke-dasharray: 2 6;
}
.curve__grid line:first-child { stroke-dasharray: none; }
.curve__line {
  fill: none;
  stroke: var(--firefly);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 10px rgba(226, 194, 150, 0.45));
}
.curve.is-armed .curve__line { stroke-dashoffset: 1; }
.curve.is-armed .curve__drift circle { opacity: 0; }
.curve.is-armed.is-drawn .curve__line {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 2.4s cubic-bezier(0.45, 0, 0.2, 1);
}
.curve.is-armed.is-drawn .curve__drift circle {
  opacity: var(--o, 1);
  transition: opacity 0.5s ease calc(2.1s + var(--i, 0) * 0.09s);
}
.curve__drift circle {
  fill: var(--glow);
  filter: drop-shadow(0 0 7px rgba(247, 221, 168, 0.8));
}
.curve__label--narrow { display: none; }
.curve__labels text {
  fill: var(--dusk);
  font: 500 15px var(--ui);
}
.curve__notes {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.18fr);
  gap: clamp(28px, 4vw, 56px);
  margin-top: 36px;
}
.curve__notes .fact:first-child { padding-left: 3.3%; }
.science__foot {
  max-width: 34ch;
  margin: clamp(80px, 13vh, 140px) auto 0;
  color: var(--moon);
  font-weight: 300;
  font-size: clamp(1.4rem, 2.3vw, 2rem);
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
}
.science__fine {
  max-width: 62ch;
  margin: 28px auto 0;
  color: var(--dusk);
  font: 400 0.8125rem/1.55 var(--ui);
  text-align: center;
  text-wrap: balance;
}

.science__fine svg {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  vertical-align: -2.5px;
}
.science__fine strong { color: var(--mist); font-weight: 600; }

/* Each part of the science section gets its own pool of light, so the
   chapters separate without boxes. */
.science__intro,
.shift,
.science__foot {
  position: relative;
  isolation: isolate;
}
.science__intro::before,
.shift::before,
.science__foot::before {
  content: "";
  position: absolute;
  left: 50%;
  z-index: -1;
  width: 100vw;
  transform: translateX(-50%);
  pointer-events: none;
}
.science__intro::before {
  top: -45%;
  bottom: -35%;
  background: radial-gradient(ellipse 46% 50% at 50% 50%, var(--indigo), rgba(25, 27, 44, 0) 72%);
}
.shift::before {
  top: 0;
  bottom: -6%;
  background:
    linear-gradient(to bottom, var(--indigo), rgba(25, 27, 44, 0) 58%),
    radial-gradient(ellipse 30% 52% at 26% 64%, rgba(226, 194, 150, 0.075), transparent 72%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}
.shift--two::before {
  background:
    linear-gradient(to bottom, var(--indigo), rgba(25, 27, 44, 0) 46%),
    radial-gradient(ellipse 44% 40% at 50% 70%, rgba(25, 27, 44, 0.9), rgba(25, 27, 44, 0) 72%),
    radial-gradient(ellipse 22% 30% at 78% 70%, rgba(226, 194, 150, 0.06), transparent 72%);
}
/* The rule that opens each shift: warm in the middle, gone at the edges. */
.shift::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: 100vw;
  height: 1px;
  background: linear-gradient(90deg, transparent 8%, rgba(226, 194, 150, 0.38) 34%, rgba(226, 194, 150, 0.38) 66%, transparent 92%);
  transform: translateX(-50%);
  pointer-events: none;
}
.science__foot::before {
  top: -70%;
  bottom: -70%;
  background: radial-gradient(ellipse 36% 50% at 50% 50%, rgba(226, 194, 150, 0.07), transparent 72%);
}

/* ───────── Maker note: the one sheet of paper on the page ───────── */
.maker { padding: 12vh var(--gutter) 6vh; }
.letter {
  position: relative;
  max-width: 580px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px);
  border-radius: 6px;
  color: var(--paper-ink);
  background:
    linear-gradient(175deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.1)),
    var(--paper);
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.8), 0 0 90px rgba(226, 194, 150, 0.06);
}
.letter__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px dotted rgba(42, 36, 29, 0.4);
}
.letter__head img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
}
.letter__head h2 {
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.letter__head p { color: rgba(42, 36, 29, 0.74); font-size: 0.9375rem; }
.letter__body {
  padding-top: 22px;
  font-size: 1rem;
  line-height: 1.64;
}
.letter__body p + p { margin-top: 1em; }
.letter__body a { text-underline-offset: 3px; }
.letter__sign {
  font-style: italic;
  font-size: 1.4rem;
}
.letter__body.is-clipped {
  max-height: 17.5rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 52%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 52%, transparent 100%);
}
.letter__more {
  display: block;
  margin: 18px auto 0;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  color: var(--paper);
  background: var(--paper-ink);
  font: italic 400 1rem/1 var(--serif);
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.letter__more:hover { background: #000; }
.letter__more[hidden] { display: none; }

/* ───────── Questions ───────── */
.faq {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(72px, 12vh, 130px) var(--gutter) clamp(24px, 4vh, 48px);
}
.faq > h2 {
  max-width: none;
  margin-bottom: clamp(28px, 5vh, 48px);
  text-align: center;
}
.qa { border-top: 1px solid var(--hair); }
.qa:last-child { border-bottom: 1px solid var(--hair); }
.qa summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  list-style: none;
  cursor: pointer;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary h3 {
  color: var(--moon);
  font-weight: 400;
  font-size: clamp(1.125rem, 1.5vw, 1.3125rem);
  line-height: 1.3;
}
.qa summary::after {
  content: "+";
  flex: none;
  color: var(--firefly);
  font: 400 1.5rem/1 var(--ui);
  transition: transform 0.25s ease;
}
.qa[open] summary::after { transform: rotate(45deg); }
.qa summary:hover h3 { color: var(--glow); }
.qa > p {
  max-width: 62ch;
  padding: 0 0 26px;
}
.qa[open] > p { animation: unfold 0.35s ease both; }

/* ───────── Closing ───────── */
.closing {
  position: relative;
  isolation: isolate;
  padding: 18vh var(--gutter) 14vh;
  text-align: center;
  overflow: hidden;
}
.closing__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(40vh 40vh at 50% 20%, rgba(226, 194, 150, 0.07), transparent 72%),
    radial-gradient(ellipse 62% 44% at 50% 56%, var(--indigo), rgba(25, 27, 44, 0) 74%);
}
.closing__icon {
  width: 92px;
  margin: 0 auto 40px;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 80px rgba(226, 194, 150, 0.25);
}
.closing__lede {
  margin-top: 26px;
  color: var(--moon);
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
}

.closing__follow { margin-top: 34px; }
.subscribe {
  max-width: 480px;
  margin: clamp(44px, 7vh, 72px) auto 0;
  padding-top: clamp(40px, 6vh, 56px);
  border-top: 1px solid var(--hair);
}
.subscribe > label {
  display: block;
  color: var(--moon);
  font-size: 1.25rem;
}
.subscribe__row {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(20, 24, 38, 0.8);
  transition: border-color 0.2s ease;
}
.subscribe__row:focus-within { border-color: rgba(226, 194, 150, 0.7); }
.subscribe input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 0 0 0 18px;
  border: 0;
  outline: 0;
  color: var(--moon);
  background: transparent;
  font: 400 1rem/1 var(--ui);
}
.subscribe input::placeholder { color: var(--dusk); }
.subscribe button {
  padding: 14px 24px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: var(--firefly);
  font: italic 500 1.0625rem/1 var(--serif);
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.3s ease;
}
.subscribe button:hover { background: var(--glow); box-shadow: 0 0 36px rgba(226, 194, 150, 0.35); }
.subscribe button[disabled] { opacity: 0.6; cursor: default; }
.subscribe__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.subscribe__status {
  min-height: 1.5em;
  margin-top: 14px;
  color: var(--firefly);
  font: 500 0.9375rem/1.5 var(--ui);
}
.subscribe__status.is-error { color: #f0a48f; }
.subscribe__fine {
  margin-top: 2px;
  color: var(--dusk);
  font: 400 0.8125rem/1.5 var(--ui);
}
.subscribe.is-done .subscribe__row,
.subscribe.is-done .subscribe__fine { display: none; }

/* ───────── Footer ───────── */
.foot {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px 40px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px var(--gutter) 56px;
  border-top: 1px solid var(--hair);
  color: var(--dusk);
  font: 400 0.8125rem/1.5 var(--ui);
}
.foot__brand img { width: 104px; }
.foot__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 28px;
}
.foot__links a {
  color: var(--mist);
  text-decoration: none;
}
.foot__links a:hover { color: var(--firefly); }
.foot > p { grid-column: 1 / -1; }

/* ───────── Cover artwork gallery (opens from the Worlds section) ───────── */
.gallery {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--moon);
  background: rgba(8, 10, 20, 0.9);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@supports (height: 1dvh) {
  .gallery { height: 100dvh; }
}
.gallery::backdrop { background: rgba(8, 10, 20, 0.5); }
@keyframes gallery-in {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: none; }
}
.gallery[open] { animation: gallery-in 0.3s ease both; }
.gallery__bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
  background: linear-gradient(to bottom, rgba(8, 10, 20, 0.95) 40%, rgba(8, 10, 20, 0));
}
.gallery__bar h2 {
  font-weight: 300;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: -0.01em;
}
.gallery__close,
.gallery__nav {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: var(--moon);
  background: rgba(14, 18, 32, 0.6);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.gallery__close:hover,
.gallery__nav:hover { border-color: var(--firefly); color: var(--glow); }
.gallery__close svg,
.gallery__nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(40vw, 210px), 1fr));
  gap: clamp(10px, 1.4vw, 18px);
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px var(--gutter) 72px;
}
.gallery__grid button {
  padding: 0;
  border: 0;
  border-radius: clamp(8px, 1vw, 14px);
  background: var(--raised);
  overflow: hidden;
  cursor: zoom-in;
}
.gallery__grid img {
  width: 100%;
  aspect-ratio: 1232 / 1520;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gallery__grid button:hover img { transform: scale(1.04); }
.gallery__zoom {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 2vw, 28px);
  padding: 20px clamp(10px, 3vw, 40px);
  background: rgba(6, 8, 16, 0.96);
}
.gallery__zoom[hidden] { display: none; }
.gallery__zoom img {
  justify-self: center;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  border-radius: 16px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
  cursor: zoom-out;
}
html.is-locked { overflow: hidden; }

@media (max-width: 1180px) {
  .hero .qr span { display: none; }
}

/* ───────── Small screens ───────── */
@media (max-width: 900px) {
  :root {
    --nav-h: 60px;
    --phone-h: min(35vh, 360px);
  }
  @supports (height: 1svh) {
    :root { --phone-h: min(35svh, 360px); }
  }

  .nav__links { display: none; }
  .nav__cta { margin-left: auto; padding: 10px 16px; }
  .nav__brand img { width: 100px; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    justify-items: center;
    align-content: center;
    gap: 22px;
    padding-top: calc(var(--nav-h) + 8px);
    text-align: center;
  }
  .hero__side--a,
  .hero__side--b {
    justify-self: center;
    padding: 0;
    text-align: center;
  }
  .hero__lede { display: none; position: static; width: auto; }
  .hero .display { font-size: clamp(1.9rem, 8.4vw, 2.6rem); }
  .display > .hero__kicker {
    position: static;
    margin-bottom: 14px;
    font-size: 0.6875rem;
    letter-spacing: 0.2em;
    text-indent: 0.2em;
  }
  .hero .get { position: static; width: auto; }
  .get { justify-content: center; margin-top: 18px; }
  .qr { display: none; }
  .store { font-size: 1.15rem; padding: 9px 20px 9px 16px; }
  .store svg { width: 26px; height: 26px; }

  .beat { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .beat--left .beat__shot { order: 0; }
  .beat__copy p { margin-inline: auto; }

  .scrolly .hero { gap: 18px; padding-bottom: 52px; }
  /* home.js centres caption + phone as one group and sets --beat-bottom. */
  .scrolly .phone { transform-origin: 50% 0; }
  /* The phone is scaled up on small screens, so its bezel starts thinner. */
  .phone { padding: 2px; }
  .phone__glass { border-radius: calc(var(--phone-w) * 0.152); }
  .scrolly .beat,
  .scrolly .beat--left,
  .scrolly .beat--right {
    top: auto;
    bottom: var(--beat-bottom, 64%);
    right: var(--gutter);
    left: var(--gutter);
    width: auto;
    text-align: center;
    transform: none;
  }
  .scrolly .beat .display--step { font-size: clamp(1.7rem, 7.4vw, 2.3rem); }
  .scrolly .beat__copy p,
  .scrolly .beat--left .beat__copy p {
    max-width: 32ch;
    margin: 10px auto 0;
    font-size: 0.9375rem;
    line-height: 1.45;
  }
  .scrolly .rail { bottom: 20px; }
  .scrolly .scroll-cue { display: none; }

  .worlds { min-height: max(100vh, 680px); }
  .gallery__zoom {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 16px 84px;
  }
  .gallery__zoom img { max-height: calc(100vh - 110px); }
  .gallery__nav { position: absolute; bottom: 22px; }
  .gallery__nav[data-gallery-step="-1"] { left: calc(50% - 54px); }
  .gallery__nav[data-gallery-step="1"] { left: calc(50% + 10px); }
  .wall { --wall-persp: 900px; }

  .display--xl { font-size: clamp(2.15rem, 9.6vw, 2.9rem); }
  .eyebrow { margin-bottom: 20px; font-size: 0.6875rem; }
  .science { padding-top: 88px; padding-bottom: 64px; }
  .science__intro p:not(.eyebrow) { margin-top: 26px; }
  .shift,
  .curve__notes { grid-template-columns: minmax(0, 1fr); }
  .shift { margin-top: 96px; padding-top: 64px; }
  .shift__head { text-align: center; }
  .shift__head .display--shift { margin-inline: auto; font-size: clamp(1.6rem, 7vw, 2rem); }
  .shift .facts,
  .shift .sealed,
  .shift .curve { grid-column: 1; grid-row: auto; }
  .shift .facts { margin-top: 60px; padding-top: 0; }
  .facts > .fact + .fact { margin-top: 38px; padding-top: 38px; }
  .more { margin-top: 14px; }
  .shift .sealed { justify-self: center; margin-top: 32px; }
  .jar { width: 168px; }
  .fact h4 { max-width: none; }
  .curve { margin-top: 92px; }
  .curve__notes { gap: 0; margin-top: 56px; }
  .curve__notes .fact:first-child { padding-left: 0; }
  .curve__notes .fact + .fact {
    margin-top: 38px;
    padding-top: 38px;
    border-top: 1px solid var(--hair);
  }
  .curve .eyebrow { margin: 0 0 28px; text-align: center; letter-spacing: 0.16em; }
  .science__foot { margin-top: 104px; }
  .curve__labels text { font-size: 40px; }
  .curve__labels { transform: translateY(20px); }
  .curve__label--wide { display: none; }
  .curve__label--narrow { display: inline; }
  .curve svg { margin-bottom: 22px; }

  .foot { grid-template-columns: minmax(0, 1fr); }
  .foot__links { justify-content: flex-start; }
}

@media (max-width: 900px) and (min-height: 770px) {
  .hero__lede {
    display: block;
    max-width: 30ch;
    margin: 12px auto 0;
    font-size: 0.9375rem;
    line-height: 1.45;
  }
}

/* Short phones: a smaller mockup keeps both badges on the first screen. */
@media (max-width: 900px) and (max-height: 700px) {
  :root { --phone-h: min(31vh, 360px); }
  @supports (height: 1svh) {
    :root { --phone-h: min(31svh, 360px); }
  }
  .get__badges { gap: 8px; }
}

@media (max-width: 420px) {
  .subscribe__row { flex-direction: column; padding: 8px; border-radius: 22px; }
  .subscribe input[type="email"] { padding: 12px 14px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
