/* ==========================================================================
   Millionaire Privé — design tokens
   ========================================================================== */
:root {
  --bg: #070605;
  --bg-raised: rgba(18, 14, 10, 0.62);
  --ink: #f4ede1;
  --muted: #b3a995;
  --faint: #6f6759;
  --gold: #d8b46c;
  --gold-hi: #f3dda6;
  --gold-lo: #9c7a3a;
  --on-gold: #140f08;
  --line: rgba(216, 180, 108, 0.2);
  --line-strong: rgba(216, 180, 108, 0.55);
  --error: #f2a48f;

  --font-display: "Cormorant", "Cormorant Garamond", Georgia, serif;
  --font-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.83, 0, 0.17, 1);
  --dur-fast: 180ms;
  --dur-med: 450ms;
  --dur-slow: 1100ms;

  --gutter: clamp(16px, 4.4vw, 64px);
  --z-scene: 1;
  --z-grain: 2;
  --z-content: 10;
  --z-veil: 50;
  --z-loader: 100;
  --z-cursor: 200;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
em { font-style: italic; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--gold); color: var(--on-gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

/* ==========================================================================
   Ambient layers
   ========================================================================== */
.backdrop {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 55% at 72% 46%, rgba(170, 120, 45, 0.20), transparent 70%),
    radial-gradient(40% 40% at 12% 90%, rgba(120, 80, 30, 0.12), transparent 70%),
    radial-gradient(120% 90% at 50% 0%, #120e0a 0%, var(--bg) 60%);
}
.scene {
  position: fixed; inset: 0; z-index: var(--z-scene);
  width: 100%; height: 100%;
  display: block;
  touch-action: pan-y;
  opacity: 0;
  transition: opacity 1200ms var(--ease-out);
}
.scene-ready .scene { opacity: 1; }
.scene-ready.is-scrolled .scene { opacity: 0; }
.no-webgl .scene { display: none; }
.no-webgl .backdrop::after {
  content: ""; position: absolute;
  width: min(46vw, 420px); aspect-ratio: 85.6 / 54; border-radius: 18px;
  right: 12vw; top: 50%; transform: translateY(-50%) rotate(-8deg);
  background: linear-gradient(135deg, #f1d9a0, #c9a052 45%, #e2c07a 70%, #9c7a3a);
  box-shadow: 0 40px 120px rgba(200, 150, 60, 0.25);
}
.grain {
  position: fixed; inset: -50%; z-index: var(--z-grain); pointer-events: none;
  opacity: 0.07;
  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='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.veil {
  position: fixed; inset: 0; z-index: var(--z-veil); pointer-events: none;
  background: var(--bg); opacity: 0;
  transition: opacity 600ms var(--ease-in-out) 500ms;
}
.is-entering .veil { opacity: 1; }

/* ==========================================================================
   Loader
   ========================================================================== */
.loader {
  position: fixed; inset: 0; z-index: var(--z-loader);
  display: grid; place-items: center;
  background: var(--bg);
  clip-path: inset(0 0 0 0);
  transition: clip-path var(--dur-slow) var(--ease-in-out) 150ms, visibility 0s linear 1400ms;
}
.is-loaded .loader { clip-path: inset(0 0 100% 0); visibility: hidden; }
.loader__inner { display: grid; justify-items: center; gap: 18px; }
.loader__brand {
  font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.02em; color: var(--muted);
}
.loader__brand em, .wordmark em { color: var(--gold); }
.loader__count {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(4rem, 14vw, 9rem); line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.loader__bar { width: min(240px, 60vw); height: 1px; background: var(--line); overflow: hidden; }
.loader__bar > span {
  display: block; height: 100%; background: var(--gold);
  transform: scaleX(0); transform-origin: left center;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.topbar, main, .smallprint, .hint { position: relative; z-index: var(--z-content); }

.page-entry {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
}
/* Let drags fall through to the 3D card everywhere except real controls. */
.page-entry .topbar, .page-entry .hero, .page-entry .smallprint { pointer-events: none; }
.page-entry a, .page-entry button { pointer-events: auto; }
.page-entry .smallprint, .page-entry .hero__lede, .page-entry .hero__title { user-select: none; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: clamp(18px, 3vw, 36px) var(--gutter);
}
.wordmark {
  font-family: var(--font-display); font-size: 1.45rem; font-weight: 500;
  letter-spacing: 0.01em; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; min-height: 44px; gap: 0.3em;
}
.topbar__meta {
  margin: 0; display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted);
}
.dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 0 rgba(216, 180, 108, 0.6);
  animation: pulse 2.6s var(--ease-out) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(216, 180, 108, 0.55); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(216, 180, 108, 0); }
}

/* Hero ------------------------------------------------------------------ */
.hero {
  align-self: end;
  padding: 0 var(--gutter);
  padding-top: 46dvh;
  max-width: 640px;
}
@media (min-width: 960px) {
  .hero { align-self: center; padding-top: 0; }
}
.eyebrow {
  margin: 0 0 22px;
  font-size: 0.75rem; font-weight: 400; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--muted);
}
.hero__title {
  margin: 0 0 26px;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(3.2rem, 8.4vw, 7.6rem);
  line-height: 0.9; letter-spacing: -0.02em;
}
.line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.line > span { display: block; }
.hero__title em, .gold-text {
  background: linear-gradient(100deg, var(--gold-hi) 0%, var(--gold) 45%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: 0.06em;
}
.hero__lede {
  margin: 0 0 36px; max-width: 42ch;
  font-size: 1rem; color: var(--muted); line-height: 1.7;
}

/* Entry ----------------------------------------------------------------- */
.entry {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px;
}
.entry__price { display: grid; gap: 2px; }
.label {
  font-size: 0.75rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted);
}
.price {
  font-family: var(--font-display); font-size: clamp(2.1rem, 3.6vw, 2.8rem); line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, var(--gold-lo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[hidden] { display: none !important; }
.status { margin: 12px 0 0; min-height: 1.6em; font-size: 0.875rem; color: var(--gold-hi); }
.status.is-error { color: var(--error); }

/* Button ---------------------------------------------------------------- */
.btn {
  --btn-pad: 30px;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 18px;
  min-height: 60px; padding: 0 12px 0 var(--btn-pad);
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(216, 180, 108, 0.06);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase;
  cursor: pointer; touch-action: manipulation;
  transition: transform var(--dur-med) var(--ease-out), color var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, var(--gold-hi), var(--gold) 50%, #b8913f);
  transform: translateY(101%); border-radius: inherit;
  transition: transform var(--dur-med) var(--ease-out);
}
.btn:hover, .btn:focus-visible { color: var(--on-gold); border-color: var(--gold); }
.btn:hover::before, .btn:focus-visible::before { transform: translateY(0); }
.btn:active { transform: scale(0.97); }
.btn[disabled] { cursor: progress; }
.btn[disabled]::before { transform: translateY(0); opacity: 0.75; }
.btn[disabled] { color: var(--on-gold); }
.btn__arrow {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid currentColor;
  transition: transform var(--dur-med) var(--ease-out);
}
.btn:hover .btn__arrow { transform: translateX(3px); }

/* Before launch: the door is visible but shut. */
.btn.is-closed[disabled], .btn.is-closed[disabled]:hover {
  cursor: default; color: var(--muted); border-color: var(--line);
  background: rgba(216, 180, 108, 0.03);
}
.btn.is-closed[disabled]::before { transform: translateY(101%); }
.btn.is-closed .btn__arrow { opacity: 0.4; transform: none; }

.link {
  background: none; border: 0; padding: 10px 0; min-height: 44px;
  color: var(--gold); text-decoration: underline; text-underline-offset: 4px;
  font-size: 0.875rem; cursor: pointer;
}

/* Small print & hint ---------------------------------------------------- */
.smallprint {
  padding: 40px var(--gutter) clamp(20px, 3vw, 32px);
  max-width: 640px;
  font-size: 0.8125rem; line-height: 1.6; color: var(--muted);
}
.smallprint p { margin: 0 0 6px; }
.smallprint__joke { font-family: var(--font-display); font-style: italic; font-size: 1.125rem; color: var(--ink); }
.hint {
  display: none;
  position: fixed; right: var(--gutter); bottom: clamp(20px, 3vw, 32px); margin: 0;
  align-items: center; gap: 12px;
  font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted);
}
.hint span { width: 40px; height: 1px; background: var(--line-strong); }
@media (min-width: 960px) and (pointer: fine) { .hint { display: inline-flex; } }

/* ==========================================================================
   Reveal choreography (runs once the loader lifts)
   ========================================================================== */
.line > span { transform: translateY(105%); transition: transform 1200ms var(--ease-out); }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1000ms var(--ease-out), transform 1000ms var(--ease-out); }
.is-loaded .line > span, .is-loaded .reveal { transform: none; opacity: 1; }
.is-loaded .line:nth-child(1) > span { transition-delay: 700ms; }
.is-loaded .line:nth-child(2) > span { transition-delay: 800ms; }
.is-loaded .line:nth-child(3) > span { transition-delay: 900ms; }
.is-loaded .eyebrow.reveal { transition-delay: 600ms; }
.is-loaded .hero__lede.reveal { transition-delay: 1000ms; }
.is-loaded .entry.reveal, .is-loaded .panel.reveal { transition-delay: 1120ms; }
.is-loaded .smallprint.reveal, .is-loaded .hint.reveal { transition-delay: 1400ms; }

.is-entering .hero, .is-entering .smallprint, .is-entering .topbar, .is-entering .hint {
  opacity: 0; filter: blur(6px);
  transition: opacity 500ms var(--ease-in-out), filter 500ms var(--ease-in-out);
}

/* ==========================================================================
   Custom cursor (fine pointers only)
   ========================================================================== */
.cursor { position: fixed; inset: 0 auto auto 0; z-index: var(--z-cursor); pointer-events: none; opacity: 0; transition: opacity var(--dur-med) var(--ease-out); }
.has-cursor .cursor.is-visible { opacity: 1; }
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor__dot, .cursor__ring { position: absolute; top: 0; left: 0; will-change: transform; }
.cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--gold-hi); }
.cursor__ring { width: 0; height: 0; }
.cursor__circle {
  position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  transition: transform var(--dur-med) var(--ease-out), background var(--dur-med) var(--ease-out), border-color var(--dur-med);
}
.cursor__label {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 0.625rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-hi);
  opacity: 0; transition: opacity var(--dur-fast);
  padding-left: 0.3em;
}
.cursor.is-link .cursor__circle { transform: scale(1.7); background: rgba(216, 180, 108, 0.1); border-color: var(--gold); }
.cursor.is-drag .cursor__circle { transform: scale(2); border-color: var(--gold); }
.cursor.is-drag .cursor__label { opacity: 1; }
.cursor.is-down .cursor__circle { transform: scale(1.5); }

/* ==========================================================================
   Members page
   ========================================================================== */
.page-members { display: flex; flex-direction: column; min-height: 100dvh; }
.members {
  flex: 1;
  display: grid; gap: 40px;
  padding: 34dvh var(--gutter) 24px;
  max-width: 1440px; width: 100%;
}
@media (min-width: 960px) {
  .members {
    grid-template-columns: minmax(0, 560px);
    padding-top: clamp(40px, 8vh, 96px);
    align-content: start;
  }
}
.members .hero__title { font-size: clamp(3rem, 7vw, 6.4rem); }
.members .hero__lede { margin-bottom: 0; }

.panel {
  background: var(--bg-raised);
  -webkit-backdrop-filter: blur(18px) saturate(120%); backdrop-filter: blur(18px) saturate(120%);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: clamp(24px, 4vw, 44px);
}
.panel__title { margin: 0 0 8px; font-family: var(--font-display); font-weight: 400; font-size: 2.2rem; line-height: 1.1; }
.panel__lede { margin: 0 0 28px; color: var(--muted); }

.form { display: grid; gap: 22px; }
.form__row { display: grid; gap: 22px; }
@media (min-width: 600px) { .form__row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field label {
  font-size: 0.75rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted);
}
.field label .opt { letter-spacing: 0.08em; text-transform: none; color: var(--faint); }
.field input, .field textarea {
  width: 100%; min-height: 48px;
  padding: 10px 0;
  background: transparent; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0;
  font-size: 1.0625rem; font-weight: 400; color: var(--ink);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 1px 0 0 var(--gold); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 1px 0 0 var(--error); }
.field__hint { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.field__error { margin: 0; min-height: 0; font-size: 0.8125rem; color: var(--error); }
.field__error:empty { display: none; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 6px; }

.done { outline: none; }
.done .eyebrow { margin-bottom: 14px; }
.done p { color: var(--muted); }

.page-members .smallprint { padding-top: 24px; }

/* Pending page --------------------------------------------------------- */
.page-plain { display: grid; grid-template-rows: auto 1fr auto; min-height: 100dvh; }
.plain { align-self: center; padding: 0 var(--gutter); max-width: 640px; }
.plain .hero__title { font-size: clamp(2.8rem, 7vw, 5.6rem); }

/* Legal pages ----------------------------------------------------------- */
.page-legal { display: flex; flex-direction: column; min-height: 100dvh; }
.legal {
  position: relative; z-index: var(--z-content);
  flex: 1; width: 100%; max-width: 760px;
  padding: clamp(24px, 6vh, 72px) var(--gutter) 48px;
}
.legal__title {
  margin: 0 0 20px;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.8rem, 7vw, 5rem); line-height: 0.95; letter-spacing: -0.02em;
}
.legal__title em {
  background: linear-gradient(100deg, var(--gold-hi), var(--gold) 45%, var(--gold-lo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.legal__lede { margin: 0 0 36px; font-size: 1.0625rem; color: var(--muted); max-width: 60ch; }
.legal__toc {
  margin: 0 0 48px; padding: 22px 26px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg-raised);
}
.legal__toc ol { margin: 0; padding-left: 1.3em; columns: 2 220px; column-gap: 32px; }
.legal__toc li { padding: 3px 0; break-inside: avoid; color: var(--muted); }
.legal section { margin: 0 0 40px; scroll-margin-top: 24px; }
.legal h2 {
  margin: 0 0 14px; font-family: var(--font-display); font-weight: 500;
  font-size: 1.75rem; line-height: 1.2; color: var(--gold-hi);
}
.legal h3 {
  margin: 22px 0 8px; font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted);
}
.legal p, .legal li { color: #d9d1c3; line-height: 1.75; }
.legal p { margin: 0 0 14px; max-width: 68ch; }
.legal ul { margin: 0 0 14px; padding-left: 1.2em; max-width: 68ch; }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--ink); font-weight: 500; }
.legal a, .sitefoot a, .sitefoot__links a {
  color: var(--gold); text-decoration: underline; text-decoration-color: var(--line-strong);
  text-underline-offset: 4px; transition: color var(--dur-fast), text-decoration-color var(--dur-fast);
}
.legal a:hover, .sitefoot a:hover, .sitefoot__links a:hover { color: var(--gold-hi); text-decoration-color: var(--gold-hi); }
.legal code { font-size: 0.9em; color: var(--gold-hi); }
.legal__table { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 6px; }
.legal__table:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.legal th, .legal td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.legal tr:last-child td { border-bottom: 0; }
.legal th { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); background: rgba(216, 180, 108, 0.05); }
.legal td { color: #d9d1c3; }

/* Site footer (company details) ---------------------------------------- */
.sitefoot {
  position: relative; z-index: var(--z-content);
  padding: 20px var(--gutter) clamp(20px, 3vw, 32px);
  border-top: 1px solid var(--line);
  font-size: 0.75rem; line-height: 1.6; color: var(--muted);
}
.sitefoot__links { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-bottom: 6px; }
.sitefoot__links a { display: inline-flex; align-items: center; min-height: 28px; font-size: 0.8125rem; }
.sitefoot__links a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.sitefoot__company { margin: 0; max-width: 90ch; }
/* On the entry page the company line sits inside the small print. */
.smallprint .sitefoot__links { margin-top: 14px; }
.smallprint .sitefoot__company { font-size: 0.75rem; color: #8f8677; }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .line > span, .reveal { transform: none; opacity: 1; }
}
