/* =========================================================================
   PITCH — Coming soon
   The album opening: a closed leather cover that swings open on load into a
   two-page paper spread. Palette/paper-grain match client/css/album.css
   §8/§14 so this reads as a page from the same sticker album. Shared by
   every page on this site: the static ones in public/ and the
   server-rendered confirm page (functions/invite/confirm.js), all of which
   link this same /style.css by absolute path.
   ========================================================================= */

@font-face {
  font-family: 'Lilita One';
  src: url('/fonts/lilita-one-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  /* Variable font: one file covers the whole 200-1000 weight axis we use. */
  font-family: 'Nunito';
  src: url('/fonts/nunito-latin.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper-white: #FBF6EC;
  --page: #F3E9D4;
  --page-deep: #EADFC4;
  --rule: #CBBFA0;
  --ink: #2B2116;
  --ink-muted: #786A54;
  --gold: #F0B429;
  --red: #D6402E;
  --green: #2F7A4D;
  --wood: #6B4428;
  --wood-dark: #4A2E1B;
  --cover-spine: #7E1F17;
  --cover-edge: #96261C;

  --display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Nunito', 'Segoe UI', system-ui, sans-serif;

  --shadow-soft: 0 2px 4px rgba(60, 38, 16, .18), 0 6px 14px rgba(60, 38, 16, .12);
  --shadow-lift: 0 4px 8px rgba(60, 38, 16, .22), 0 10px 22px rgba(60, 38, 16, .16);

  --paper-grain: 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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .35 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

/* <button>/<input>/<select> do not inherit font/color from the page in the
   UA stylesheet — without this, form controls and button labels below render
   in the browser's default sans instead of Nunito. */
button, input, select { font: inherit; color: inherit; }

/* ---------- Changing-room backdrop: full-bleed, blurred, vignetted ----------
   One background, on `html`, covering the whole document height (not just the
   viewport). `html`'s own box is always exactly as tall as the page content,
   so this can never "run out" partway down a tall page the way a `position:
   fixed` backdrop can — Chromium's own full-page screenshot capture doesn't
   repaint fixed-position layers past the original viewport height, which
   leaves a flat band of the underlying color below the fold. The blur/desaturate
   that album.css normally applies with a CSS `filter` is baked into the image
   asset itself instead (`filter` on `html` would blur the real content too,
   since it applies to the whole box including descendants). No
   `background-attachment: fixed` anywhere — that trick is broken on iOS Safari. */
html {
  background:
    linear-gradient(180deg, rgba(20, 14, 8, .42) 0%, rgba(20, 14, 8, .3) 38%, rgba(20, 14, 8, .8) 100%),
    radial-gradient(ellipse at 50% 20%, rgba(20, 14, 8, .1), rgba(20, 14, 8, .62) 74%),
    url('/assets/changing-room.webp') center top / cover no-repeat,
    var(--wood-dark);
}

body {
  font-family: var(--body);
  color: var(--paper-white);
  font-size: 16px;
  line-height: 1.45;
  overflow-x: hidden;
  background: transparent;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* ---------- The album ---------- */
.album-stage { width: 100%; display: flex; justify-content: center; }

.album {
  position: relative;
  width: min(900px, 100%);
  /* Lets .album-cover's 3D rotation read as a real hinge on the left edge
     instead of a flat crossfade. */
  perspective: 2200px;
}

/* ---------- The closed cover ----------
   Sized purely by its absolute inset against .album (whatever height the
   spread underneath naturally takes), not by cover.webp's own 900:625 ratio —
   background-size:cover crops it to fit instead of dictating the box shape,
   same technique the old single-card cover used. */
.album-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 10px 20px 20px 10px;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .12), transparent 45%),
    url('/assets/cover.webp') center / cover no-repeat,
    linear-gradient(135deg, var(--cover-edge), var(--cover-spine));
  box-shadow: -8px 0 0 var(--cover-spine) inset, 0 22px 40px rgba(0, 0, 0, .5), 0 3px 0 #5E1510;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: left center;
  transform: rotateY(0deg);
  opacity: 1;
  transition: transform 1.2s cubic-bezier(.5, .05, .3, 1), opacity 1.2s cubic-bezier(.5, .05, .3, 1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.album-cover.is-open {
  transform: rotateY(-160deg);
  opacity: 0;
  pointer-events: none;
}
.album-cover-logo {
  width: min(280px, 45%);
  height: auto;
  transform: rotate(-4deg);
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .5));
}

/* prefers-reduced-motion: the cover starts (and stays) open — no JS timing
   dependency for this; see main.js, which still adds .is-open, harmlessly,
   after its usual delay. Placed after the base rules above so the `transition:
   none` here wins the specificity tie against them. */
@media (prefers-reduced-motion: reduce) {
  .album-cover {
    transform: rotateY(-160deg);
    opacity: 0;
    pointer-events: none;
    transition: none;
  }
}

/* ---------- The open spread: two paper pages + a spine ---------- */
.album-spread {
  display: flex;
  border-radius: 10px 20px 20px 10px;
  overflow: hidden;
  box-shadow: 0 22px 40px rgba(0, 0, 0, .4), 0 3px 0 rgba(0, 0, 0, .2);
}

.album-page {
  flex: 1 1 50%;
  min-width: 0;
  background: var(--page) var(--paper-grain);
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.album-page-left { box-shadow: inset -14px 0 20px -14px rgba(0, 0, 0, .35); }
.album-page-right { box-shadow: inset 14px 0 20px -14px rgba(0, 0, 0, .35); }

.album-spine {
  width: 20px;
  flex-shrink: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, .05) 35%, rgba(0, 0, 0, .05) 65%, rgba(0, 0, 0, .28));
}

/* Stacked on phones: the spine becomes a horizontal fold between two
   full-width pages, left page first. */
@media (max-width: 759px) {
  .album-spread { flex-direction: column; }
  .album-spine {
    width: 100%;
    height: 16px;
    background: linear-gradient(180deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, .05) 35%, rgba(0, 0, 0, .05) 65%, rgba(0, 0, 0, .28));
  }
  .album-page-left { box-shadow: inset 0 -14px 20px -14px rgba(0, 0, 0, .35); }
  .album-page-right { box-shadow: inset 0 14px 20px -14px rgba(0, 0, 0, .35); }
}

/* ---------- Left page: the title ---------- */
.page-logo-sticker {
  width: min(220px, 62%);
  height: auto;
  transform: rotate(-4deg);
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .35));
  margin-bottom: 6px;
}

.foil-text {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: .5px;
  margin: 2px 0 0;
  font-size: clamp(1.7rem, 7vw, 2.4rem);
  line-height: 1.05;
  /* Darker-gold gradient than a leather-cover version of this would use, plus
     a thin ink stroke: this now sits on pale paper (both here and on the
     confirm-page card), and a light gold-to-cream gradient with no outline
     nearly disappears against a cream page background. */
  background: linear-gradient(100deg, #8A5A0E, #C98F12 30%, var(--gold) 50%, #C98F12 70%, #8A5A0E);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(43, 33, 22, .45);
  filter: drop-shadow(0 2px 1px rgba(43, 33, 22, .35));
  animation: foil-shimmer 6s ease-in-out infinite;
}
@keyframes foil-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.page-line {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink);
  margin: 6px 0 2px;
}

.page-tagline {
  font-size: .92rem;
  color: var(--ink-muted);
  margin: 0 0 18px;
  max-width: 30ch;
}

/* Empty album slots, purely decorative — dashed like a page waiting for its
   next sticker, no text, no hints. */
.deco-slots {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
}
.deco-slot {
  width: 50px;
  aspect-ratio: 3 / 4;
  border: 2px dashed var(--rule);
  border-radius: 8px;
  background: var(--page-deep);
}

/* ---------- Right page: the invitation ---------- */
.invite-seal {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #E8593F, var(--red) 58%, #8C2216 100%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .4), inset 0 2px 3px rgba(255, 255, 255, .3);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.invite-seal img {
  width: 60%;
  height: auto;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5));
}

.invite-heading {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.2rem, 5vw, 1.5rem);
  color: var(--ink);
  margin: 0 0 4px;
}
.invite-line {
  color: var(--ink-muted);
  font-size: .92rem;
  margin: 0 0 18px;
  max-width: 32ch;
}

.invite-form {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---------- Buttons: a stitched-paper style shared by the invite form ---------- */
.label-btn {
  --c: var(--gold);
  position: relative;
  border: 0;
  cursor: pointer;
  padding: .75rem 1.2rem;
  border-radius: 8px;
  background: var(--c);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.02rem;
  letter-spacing: .4px;
  box-shadow: var(--shadow-soft);
  transition: transform .12s ease, box-shadow .12s ease;
}
.label-btn.red { --c: var(--red); color: var(--paper-white); }
.label-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.label-btn:active:not(:disabled) { transform: translateY(1px) scale(.98); box-shadow: 0 1px 2px rgba(60, 38, 16, .25); }
.label-btn:disabled { opacity: .6; cursor: not-allowed; }
.label-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: .82rem; font-weight: 700; color: var(--ink); }
.field input[type="email"] {
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 6px;
  border: 2px solid rgba(43, 33, 22, .25);
  background: var(--paper-white);
  color: var(--ink);
}
.field input[type="email"]:focus {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}
.field input[aria-invalid="true"] { border-color: var(--red); }
.field-error {
  display: block;
  min-height: 1.1em;
  font-size: .78rem;
  color: var(--red);
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .86rem;
  color: var(--ink);
  cursor: pointer;
}
.consent-label input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--red);
}
.consent-label a { color: var(--red); }

.invite-submit { width: 100%; margin-top: 2px; }

.form-status {
  min-height: 1.2em;
  font-size: .85rem;
  color: var(--red);
  text-align: center;
  margin: 0;
}

.invite-success { text-align: center; padding: 6px 4px 2px; }
.invite-success p {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--ink);
  margin: 0;
}

/* ---------- Invitation card (server-rendered confirm page) ---------- */
.invite-card {
  width: min(420px, 100%);
  background: var(--page) var(--paper-grain);
  border-radius: 14px;
  padding: 34px 26px 28px;
  text-align: center;
  box-shadow: var(--shadow-lift);
  color: var(--ink);
}
.invite-card-plain { padding-top: 40px; }
.invite-crest {
  width: 84px;
  height: auto;
  margin: 0 auto 12px;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .35));
}
/* No explicit color here on purpose: the sealed-card heading also carries
   .foil-text (gold gradient), and this rule must not fight that for `color` —
   the plain message-card heading has nothing else set, so it just inherits
   .invite-card's ink color instead. */
.invite-card-title {
  font-family: var(--display);
  font-weight: 400;
  margin: 0 0 10px;
  font-size: clamp(1.4rem, 6vw, 1.9rem);
}
.invite-founder-no {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--red);
  margin: 4px 0;
}
.invite-note {
  color: var(--ink-muted);
  font-size: .92rem;
  margin: 0;
}

/* ---------- Plain content pages (privacy) ---------- */
.doc-card {
  width: min(640px, 100%);
  background: var(--page) var(--paper-grain);
  border-radius: 12px;
  padding: 28px 24px 32px;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.doc-card h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  margin: 0 0 6px;
}
.doc-card h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.1rem;
  margin: 22px 0 6px;
}
.doc-card p, .doc-card li { font-size: .95rem; line-height: 1.55; }
.doc-card ul { padding-left: 1.2rem; margin: 6px 0 14px; }
.doc-card a { color: var(--red); }
.doc-meta { color: var(--ink-muted); font-size: .8rem; margin: 0 0 18px; }
.doc-back {
  display: inline-block;
  margin-top: 4px;
  color: var(--paper-white);
  font-size: .9rem;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 18px 16px 28px;
  font-size: .78rem;
  color: rgba(251, 246, 236, .68);
}
.site-footer p { margin: 0; }
.site-footer a { color: rgba(251, 246, 236, .85); }

/* ---------- Layout tweaks ---------- */
@media (min-width: 560px) {
  .page { padding-top: 44px; gap: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .foil-text { animation: none; background-position: 40% 50%; }
}
