/* Lune waitlist landing: LUNE_WEBSITELANDING V02, page 3, "mockup 01".
   As in 02/styles.css, every desktop number is a coordinate on the mockup's
   1920×1080 artboard and --u is one artboard pixel. */

/* One brand font for the whole page: SP Blunt, for the statements, the
   button, the name and email fields and the messages (the mockup set the
   fields in Tobias; dropped by request, Nov 2026). For now it is the
   handover's copy (a desktop licence; see README). When the studio's
   licensed web file arrives, point this rule, and the preload in index.html,
   at it. One file: trying other names first cost phones a second or more of
   statements in the wrong font. It waits up to 3 s rather than show in
   another face first. Without it, Rubik stands in. */
@font-face {
  font-family: "SP Blunt";
  src: url("fonts/licensed/SPBLUNT-Regular.otf") format("opentype");
  font-display: block;
}
@font-face {
  font-family: "Rubik";
  src: url("fonts/rubik-500.woff") format("woff");
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #513343;          /* artboard fill */
  --dot: #85afc3;         /* dots, placeholders, the button */
  --cream: #f1ebe3;       /* revealed dots and their labels */
  --pill: #ededed;        /* pill, wordmark, button text */
  --typed: #262626;       /* text she types: After Dark */
  --highlight: #e4b936;   /* Vitamin D, for text selection */

  --font-display: "SP Blunt", "Rubik", system-ui, sans-serif;

  --u: min(100vw / 1920, 100svh / 1080);
  --f: max(var(--u), 0.8px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-display);
  overflow-x: hidden;
}

::selection { background: var(--highlight); color: var(--typed); }

/* ---- layers behind the form ---------------------------------------------- */

/* The same paper grain as mockup 02, here Overlay at 45%. */
.grain {
  position: fixed;
  inset: 0;
  background: url("assets/grain.jpg") center / cover no-repeat;
  mix-blend-mode: overlay;
  opacity: 0.45;
  pointer-events: none;
}

.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Statements: SP Blunt 25.16, cream. main.js places each one beside its dot
   and keeps it there as the dot drifts. */
.labels {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  /* The mockup sets 25.16; 2 smaller by request (Nov 2026). */
  font: 400 max(23.16 * var(--u), 11px) / 1 var(--font-display);
  color: var(--cream);
}

.label {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform, opacity;
}
.label.on { opacity: 1; }
.labels.instant .label { transition: none; }

/* ---- artboard ------------------------------------------------------------ */

.stage {
  position: relative;
  min-height: 100svh;
}

.board {
  position: absolute;
  left: calc(50% - 960 * var(--u));
  top: calc(50% - 540 * var(--u));
  width: calc(1920 * var(--u));
  height: calc(1080 * var(--u));
}

/* "Lune." at (745.03, 458.85), 431.51 wide. */
.wordmark-wrap {
  position: absolute;
  left: calc(745.03 * var(--u));
  top: calc(458.85 * var(--u));
  width: calc(431.51 * var(--u));
  margin: 0;
  line-height: 0;
}

.wordmark {
  display: block;
  width: 100%;
  height: auto;
  -webkit-user-drag: none;
  user-select: none;
}

/* ---- sign-up: pill at (690.2, 967.85), 539.6 × 53.74 --------------------- */

.signup {
  position: absolute;
  left: calc(960 * var(--u) - 269.8 * var(--f));
  top: calc(967.85 * var(--u));
  width: calc(539.6 * var(--f));
}

.pill {
  position: relative;
  height: calc(53.74 * var(--f));
  border-radius: calc(26.87 * var(--f));
  background: var(--pill);
}

.pill input {
  position: absolute;
  top: 0;
  height: 100%;
  margin: 0;
  padding: calc(1.5 * var(--f)) 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--typed);
  /* The button's size, so the fields and the button read as one line. */
  font: 400 calc(15 * var(--f)) / 1 var(--font-display);
  text-align: left;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
/* Placeholders in the page's plum (the mockup has them Morning Blue). */
.pill input::placeholder { color: var(--bg); opacity: 1; }
.pill input:disabled { color: var(--dot); -webkit-text-fill-color: var(--dot); }

/* Placeholders start at x = 722.04 and 853.80 on the artboard. */
#name { left: calc(31.84 * var(--f)); width: calc(118 * var(--f)); }
#email { left: calc(163.6 * var(--f)); width: calc(192 * var(--f)); }

/* The button at (1054.0, 975.34), 164 × 37.72, inside the pill's right end.
   The file's label reads "JOIN THE WAILIST"; the typo is fixed here. */
.join {
  position: absolute;
  left: calc(363.8 * var(--f));
  top: calc(7.49 * var(--f));
  width: calc(164 * var(--f));
  height: calc(37.72 * var(--f));
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: calc(18.86 * var(--f));
  background: var(--dot);
  color: var(--pill);
  font: 400 calc(15 * var(--f)) / 1 var(--font-display);
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
/* Not in the mockup: the button turns cream like a revealed dot. */
.join:hover:not(:disabled) { background: var(--cream); color: var(--bg); }
.join:disabled { cursor: default; }

/* Not in the mockup: validation and confirmation messages. */
.status {
  position: absolute;
  left: -20%;
  top: calc(66 * var(--f));
  width: 140%;
  margin: 0;
  font: 400 calc(14 * var(--f)) / 1.4 var(--font-display);
  text-align: center;
  color: var(--cream);
}

.signup.is-busy .join { animation: pulse 1s ease-in-out infinite; }
.signup.is-done .pill { opacity: 0.8; }

@keyframes pulse { 50% { opacity: 0.55; } }

.kbd .pill:focus-within { outline: 1.5px solid var(--cream); outline-offset: 3px; }
.kbd .join:focus-visible { outline: 1.5px solid var(--cream); outline-offset: 3px; }
.join:focus:not(:focus-visible) { outline: none; }

/* Dots can be picked up and thrown (main.js): a hand over one, a closed
   hand while dragging, and no text selection on the way. */
.over-dot body { cursor: grab; }
.dragging body {
  cursor: grabbing;
  -webkit-user-select: none;
  user-select: none;
}

/* SP Blunt draws lowercase as capitals. If it fails to load, keep the caps
   (only how the fields look: what she typed is sent as typed). */
.no-blunt .labels,
.no-blunt .status,
.no-blunt .pill input { text-transform: uppercase; }

/* ---- utilities ----------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- phones and portrait screens: the artboard is landscape, so main.js
   turns the dot field on its side and the form stacks under it. Keep this
   query in step with PORTRAIT in main.js. --------------------------------- */

@media (max-width: 600px), (max-aspect-ratio: 4/5) {
  /* The page is the screen: it doesn't scroll or bounce, and the layers
     behind the form have a fixed height (the tallest the screen gets), so
     they don't stretch as the browser's toolbars come and go. Only the dots
     move. */
  html,
  body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  .grain,
  .field,
  .labels { bottom: auto; height: 100lvh; }
  .stage { min-height: 0; height: 100svh; }

  .labels { font-size: 12px; }

  .board {
    position: static;
    width: auto;
    height: 100svh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  }

  /* The wordmark's width. The form below is exactly as wide (the SVG's box
     is the letters' own, "L" to full stop). */
  .board { --mark-w: min(60vw, 360px); }

  .wordmark-wrap { position: static; width: var(--mark-w); margin: auto 0; }

  /* The bottom padding keeps two lines free for the status message, so the
     page doesn't shift when one appears. */
  .signup {
    position: relative;
    left: auto;
    top: auto;
    width: var(--mark-w);
    padding-bottom: 44px;
  }

  /* Side by side leaves no room for a real email address. */
  .pill {
    display: flex;
    flex-direction: column;
    height: auto;
    padding: 2px 16px;
    border-radius: 27px;
  }
  .pill input,
  #name,
  #email { position: static; width: 100%; height: 48px; padding: 0; font-size: 16px; text-align: center; }
  #email { border-top: 1px solid rgb(133 175 195 / 0.35); }
  /* Typed text stays at 16px, below which iPhones zoom in on the field;
     the placeholders match the button. */
  .pill input::placeholder { font-size: 15px; }

  .join {
    position: static;
    display: block;
    width: 100%;
    height: 46px;
    margin-top: 10px;
    border-radius: 23px;
    font-size: 15px;
  }

  /* Under the button, as wide as the screen allows rather than the form, so
     "Thanks, Maya. We'll email you…" takes two lines, not four. */
  .status {
    left: 50%;
    top: calc(100% - 38px);
    width: min(100vw - 32px, 400px);
    transform: translateX(-50%);
    font-size: 13px;
  }
}

/* Under 354px wide (the first iPhone SE, 320) the email placeholder doesn't
   fit at 15px. */
@media (max-width: 353px) {
  .pill input::placeholder { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .label, .join { transition: none; }
  .signup.is-busy .join { animation: none; opacity: 0.6; }
}
