/* Lumarium waitlist.
   Palette is deliberately colourless: the wallpapers carry the colour, the
   page only frames them. Type is the Mac's own (SF Pro / New York) so the page
   reads as native to the platform it's selling to, with no webfont to load. */

:root {
  --bg: #0a0a0b;
  --surface: #121214;
  --line: rgba(237, 237, 234, 0.09);
  --line-strong: rgba(237, 237, 234, 0.18);
  --ink: #ededea;
  --ink-2: #a3a39e;   /* ~7.9:1 on --bg */
  --ink-3: #85857f;   /* ~5.1:1 on --bg, the floor for small text */
  --warm: #e7b46c;    /* lantern amber, used for one dot and nothing else */

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Apple Garamond", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);     /* long, soft settle */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Layered shadows: a tight contact shadow plus a wide soft one. A single
     big dark shadow is what makes things look pasted on. */
  --shadow-soft: 0 1px 1px rgba(0,0,0,0.35), 0 8px 24px -8px rgba(0,0,0,0.55), 0 40px 80px -24px rgba(0,0,0,0.6);
  --shadow-card: 0 1px 1px rgba(0,0,0,0.3), 0 14px 36px -14px rgba(0,0,0,0.65);

  --radius: 14px;
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* Fine static grain over everything, matching the wallpapers' own finish.
   Static on purpose: an animated grain would cost GPU on a page selling
   something that already asks the GPU for a lot. */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.055;
  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.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h1, h2 { margin: 0; font-weight: 600; }
em { font-style: italic; }
.mono { font-family: var(--mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: fixed; top: 12px; left: 12px; z-index: 200;
  padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--bg);
  font-weight: 600; font-size: 14px; text-decoration: none;
  transform: translateY(-160%); transition: transform .2s var(--ease);
}
.skip:focus { transform: none; }

/* ───────────── Nav: one small pill, centred ───────────── */
.nav {
  position: fixed; top: 16px; left: 50%; z-index: 50;
  transform: translate(-50%, -8px);
  opacity: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 6px 6px 6px 12px;
  border-radius: 999px;
  background: rgba(18, 18, 20, 0.62);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.6);
  transition: opacity .8s var(--ease) .1s, transform .8s var(--ease) .1s, background .3s;
}
.is-ready .nav { opacity: 1; transform: translate(-50%, 0); }
.nav.is-scrolled { background: rgba(18, 18, 20, 0.82); }
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; text-decoration: none;
}
.nav-brand img { width: 22px; height: 22px; border-radius: 6px; }
.nav-rule { width: 1px; height: 18px; background: var(--line-strong); }
.nav-cta {
  font-size: 13.5px; font-weight: 600; text-decoration: none;
  padding: 8px 14px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  white-space: nowrap; /* it wrapped to two lines on phones */
  transition: background .2s, transform .2s var(--ease);
}
.nav-cta:hover { background: #fff; }
.nav-cta:active { transform: scale(0.97); }

/* ───────────── Hero ───────────── */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(128px, 20vh, 196px) var(--gutter) 0;
  text-align: center;
}
.hero-title {
  font-family: var(--display);
  /* 13.6vw floor keeps "Your wallpaper," inside a 320 px phone's line box,
     which clips rather than wraps because of the reveal mask. */
  font-size: clamp(42px, max(9.4vw, min(13.6vw, 50px)), 116px);
  line-height: 0.96;
  letter-spacing: -0.038em;
  font-weight: 600;
}
.hero-title em {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  /* New York italic sits a touch small beside SF at the same size. */
  font-size: 1.06em;
}
/* Each line rises out of its own mask. The padding keeps descenders and the
   italic overhang from being clipped by the mask. */
.hero-title .line { display: block; overflow: hidden; padding: 0 0.06em 0.08em; margin-bottom: -0.08em; }
.hero-title .line > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1.1s var(--ease);
}
.hero-title .line:nth-child(2) > span { transition-delay: 110ms; }
.is-ready .hero-title .line > span { transform: none; }

.hero-sub {
  max-width: 34em; margin: 28px auto 0;
  font-size: clamp(17px, 1.9vw, 19.5px); color: var(--ink-2);
  text-wrap: pretty;
}

/* ───────────── Waitlist form ───────────── */
.join {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  max-width: 470px; margin: 34px auto 0;
  padding: 6px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  text-align: left;
  transition: border-color .25s;
}
.join:focus-within { border-color: var(--line-strong); }
.join input[type="email"] {
  min-width: 0;
  font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
  color: var(--ink); background: transparent;
  border: 0; outline: 0; padding: 10px 12px;
}
.join input[type="email"]::placeholder { color: var(--ink-3); }
.join button {
  font: 600 15px/1 var(--sans);
  color: var(--bg); background: var(--ink);
  border: 0; border-radius: 11px; padding: 0 18px; min-height: 44px;
  cursor: pointer;
  transition: background .2s, transform .15s var(--ease), opacity .2s;
}
.join button:hover { background: #fff; }
.join button:active { transform: scale(0.97); }
.join button:disabled { opacity: .55; cursor: progress; }
.join .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.join-note, .join-status {
  grid-column: 1 / -1;
  padding: 2px 12px 6px;
  font-size: 13px; color: var(--ink-3);
}
.join-note a { color: var(--ink-2); text-underline-offset: 2px; }
.join-status:empty { display: none; }
.join-status[data-tone="error"] { color: #f0a58f; }
.join.is-done { grid-template-columns: 1fr; }
.join.is-done input, .join.is-done button, .join.is-done .join-note { display: none; }
.join.is-done .join-status {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; font-size: 15px; color: var(--ink);
}
.join.is-done .join-status::before {
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.4l2.6 2.5L13 6.5' fill='none' stroke='%230a0a0b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat;
}

/* ───────────── Hero stage ───────────── */
.hero-stage {
  margin: clamp(56px, 9vh, 88px) auto 0;
  max-width: 1040px;
  perspective: 1600px;
}
.tilt {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transform-style: preserve-3d;
  will-change: transform;
}
/* Hairline inner edge, so the frame reads as glass rather than a cut-out. */
.tilt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
  pointer-events: none;
}
.drift {
  position: absolute; inset: 0;
  cursor: crosshair;
  touch-action: pan-y; /* a horizontal drag steers the sky, a vertical one still scrolls */
}
.drift-canvas, .drift-fallback { width: 100%; height: 100%; object-fit: cover; }
.sheen {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px circle at var(--sx, 50%) var(--sy, 0%), rgba(255,255,255,0.07), transparent 60%);
  opacity: var(--so, 0);
  transition: opacity .6s var(--ease);
}
.hero-caption {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 16px; text-align: left;
}
.hero-hint { font-size: 12px; color: var(--ink-3); letter-spacing: 0.02em; }
.hero-note { margin-top: 10px; font-size: 13px; color: var(--ink-3); text-align: left; }

/* Drift's five themes. Colour is the only label a swatch has on screen, so the
   selected name is spelled out beside them. */
.swatches { display: flex; align-items: center; gap: 10px; }
.swatch-name { font-size: 12px; color: var(--ink-2); margin-right: 4px; min-width: 7.5em; text-align: right; }
.swatch {
  width: 18px; height: 18px; padding: 0; border-radius: 50%;
  background: var(--c); border: 0; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5) inset;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.swatch:hover { transform: scale(1.12); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink); }
/* A bigger invisible hit area than the dot itself. */
.swatch { position: relative; }
.swatch::after { content: ""; position: absolute; inset: -8px; }

.live-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 10px 5px 9px; border-radius: 999px;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink); background: rgba(10,10,11,0.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  pointer-events: none;
}
.live-badge i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--warm);
  animation: breathe 2.8s var(--ease-in-out) infinite;
}
@keyframes breathe { 50% { opacity: .35; } }

/* ───────────── Sections ───────────── */
.section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(112px, 18vh, 176px) var(--gutter) 0;
}
.section-head { max-width: 620px; margin-bottom: clamp(40px, 6vh, 64px); }
.section-head h2, .closing-title {
  font-family: var(--display);
  font-size: clamp(36px, 5.2vw, 62px);
  line-height: 1.02; letter-spacing: -0.032em;
  text-wrap: balance;
}
.section-head > p:not(.label) { margin-top: 18px; color: var(--ink-2); font-size: 18px; text-wrap: pretty; }
.label {
  font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 18px;
}

/* ───────────── Wallpapers: cards settle from a scatter as you scroll ───────────── */
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: clamp(28px, 4vw, 48px) clamp(20px, 3vw, 36px);
}
.card {
  /* --p runs 0 → 1 as the section scrolls in (set by main.js). */
  transform:
    translate3d(calc(var(--dx) * (1 - var(--p, 1))), calc(var(--dy) * (1 - var(--p, 1))), 0)
    rotate(calc(var(--rot) * (1 - var(--p, 1))))
    scale(calc(0.94 + 0.06 * var(--p, 1)));
  opacity: calc(0.35 + 0.65 * var(--p, 1));
  will-change: transform;
}
.card-img {
  border-radius: 12px; overflow: hidden;
  aspect-ratio: 16 / 10; background: var(--surface);
  box-shadow: var(--shadow-card);
  position: relative;
}
.card-img::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); pointer-events: none;
}
/* Absolutely placed so the media can never size the 16:10 box: a <video>
   reports a 300x150 intrinsic size until its metadata loads, and that was
   stretching its card taller than the others. */
.card-img img, .card-img video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.card:hover .card-img img, .card:hover .card-img video { transform: scale(1.025); }
.card-img { transform-style: preserve-3d; will-change: transform; }
/* A highlight that follows the pointer across the card (main.js sets --sx,
   --sy and fades it in with --so). */
.card-sheen {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(420px circle at var(--sx, 50%) var(--sy, 50%), rgba(255,255,255,0.10), transparent 60%);
  opacity: var(--so, 0); mix-blend-mode: screen;
}
.card-name { margin-top: 16px; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.card-name span { margin-left: 6px; font-weight: 400; color: var(--ink-3); }
.card-desc { margin-top: 4px; color: var(--ink-2); font-size: 15px; max-width: 34em; }

/* ───────────── Facts ───────────── */
.facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
}
.fact {
  padding: 28px 28px 8px 0;
  border-top: 1px solid var(--line);
}
.fact + .fact { padding-left: 28px; border-left: 1px solid var(--line); }
.fact .label { margin-bottom: 12px; }
.fact p:not(.label) { color: var(--ink-2); font-size: 16px; text-wrap: pretty; }

/* ───────────── Closing ───────────── */
.closing { text-align: center; padding-bottom: clamp(96px, 16vh, 160px); }
.closing-title { font-size: clamp(40px, 6.4vw, 78px); }
.closing-sub { max-width: 30em; margin: 20px auto 0; color: var(--ink-2); font-size: 18px; }

.foot {
  max-width: var(--max); margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  display: flex; gap: 22px; flex-wrap: wrap;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-3);
}
.foot a { text-decoration: none; transition: color .2s; }
.foot a:hover { color: var(--ink); }
.foot span { margin-right: auto; }

/* ───────────── Scroll reveals ───────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease) var(--d, 0ms), transform 1s var(--ease) var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }
/* Without JS nothing is hidden. */
.no-js .reveal, .no-js .hero-title .line > span { opacity: 1; transform: none; }
.no-js .nav { opacity: 1; transform: translate(-50%, 0); }

/* ───────────── Small screens ───────────── */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav { top: 12px; gap: 10px; }
  .hero-sub { font-size: 17px; }
  .join { grid-template-columns: 1fr; }
  .join button { min-height: 46px; }
  .cards { grid-template-columns: 1fr; }
  .card { --dx: 0px !important; }
  .facts { grid-template-columns: 1fr; }
  .fact, .fact + .fact { padding: 24px 0 4px; border-left: 0; }
  .hero-caption { flex-direction: column; align-items: flex-start; gap: 12px; }
  .swatch-name { text-align: left; min-width: 0; margin-right: 6px; }
  .section-head > p:not(.label) { font-size: 17px; }
}

/* ───────────── Reduced motion: nothing moves on its own ───────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .hero-title .line > span, .nav { transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-title .line > span { transform: none; }
  .card { transform: none !important; opacity: 1 !important; }
  .live-badge i { animation: none; }
  .card-img img, .card-img video { transition: none; }
}
