:root {
  --bg: #000000;
  --ink: #f5f3ef;
  --muted: #a4a09a;
  --faint: #6a6763;
  --gold: #c9b78f;
  --gold-soft: rgba(201,183,143,0.55);
  --line: rgba(255,255,255,0.08);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
  --wide: 0.42em;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }

/* ---------- SPACE CANVAS + CURSOR GLOW ---------- */
#space { position: fixed; inset: 0; z-index: 0; display: block; }
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 540px; height: 540px;
  margin: -270px 0 0 -270px; border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(circle, rgba(201,183,143,0.07), transparent 60%);
  opacity: 0; transition: opacity .6s ease; mix-blend-mode: screen; will-change: transform;
}

/* ---------- TEXTURE / DEPTH ---------- */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.05;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0,0,0,0.55) 100%),
    radial-gradient(60% 50% at 50% 42%, rgba(201,183,143,0.05) 0%, transparent 70%);
}
.header, .hero, .footer { position: relative; z-index: 2; }

/* ---------- HEADER ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.9rem clamp(1.5rem, 5vw, 4rem);
}
.header__brand { font-family: var(--serif); font-size: 1.35rem; letter-spacing: 0.5em; padding-left: 0.5em; font-weight: 400; }
.header__mark { display: inline-flex; align-items: center; line-height: 0; }
.header__mark img {
  height: 1.5rem; width: auto; display: block;
  opacity: 0.9; transition: opacity .35s ease;
}
.header__mark:hover img { opacity: 0.6; }

/* ---------- HERO ---------- */
.hero {
  flex: 1; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 7rem 1.5rem;
}
.hero__inner { max-width: 680px; }
.hero__lockup {
  width: min(380px, 78vw); height: auto; display: block;
  margin: 0 auto 1.5rem; animation: fade-up 1.4s ease both;
}
.hero__eyebrow {
  display: block; font-size: 0.68rem; letter-spacing: var(--wide);
  text-transform: uppercase; color: var(--gold); margin-bottom: 1.4rem;
}
.hero__tag {
  font-family: var(--serif); font-size: clamp(1.55rem, 3.6vw, 2.5rem);
  line-height: 1.4; font-weight: 300; letter-spacing: 0.01em;
  margin: 0 auto; text-wrap: balance;
}
.hero__sub {
  color: var(--muted); max-width: 500px; margin: 0 auto;
  font-size: 0.98rem; letter-spacing: 0.03em; line-height: 1.75;
}
.hero__sub-mark {
  display: block; margin-top: 1rem;
  font-family: var(--serif); font-style: italic; font-size: 1.25rem;
  color: var(--ink); letter-spacing: 0.01em;
}

/* ---------- BUTTON ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 0.72rem; letter-spacing: var(--wide);
  text-transform: uppercase; padding: 1.05rem 2.6rem; border-radius: 2px;
  transition: all .4s ease; cursor: pointer;
}
.btn--outline {
  margin-top: 2.6rem; border: 1px solid var(--gold-soft); color: var(--ink);
  background: transparent; animation: fade-up 1.4s .65s ease both;
}
.btn--outline:hover { background: var(--gold); border-color: var(--gold); color: #000; }

/* ornament divider */
.ornament {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  margin: 2.2rem auto;
}
.ornament span { display: block; width: clamp(48px, 12vw, 90px); height: 1px; background: linear-gradient(to var(--dir, right), transparent, var(--gold-soft)); }
.ornament span:first-child { --dir: left; }
.ornament i {
  width: 6px; height: 6px; transform: rotate(45deg);
  border: 1px solid var(--gold-soft); background: transparent;
}

@keyframes fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- PORTAL ORB (hold to enter) ---------- */
.portal-orb-wrap {
  margin-top: 3rem; display: flex; flex-direction: column; align-items: center; gap: 1.2rem;
}
.portal-orb {
  position: relative; width: 120px; height: 120px; padding: 0; border: 0;
  background: transparent; cursor: pointer; border-radius: 50%;
  -webkit-tap-highlight-color: transparent; touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.orb-label { user-select: none; -webkit-user-select: none; }
.portal-orb::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,183,143,0.14), transparent 62%);
  opacity: 0; transition: opacity .5s ease;
}
.portal-orb:hover::before { opacity: 1; }
.orb-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.orb-ring__track { fill: none; stroke: transparent; }
.orb-ring__prog {
  fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round;
  stroke-dasharray: 339.29; stroke-dashoffset: 339.29;
  filter: drop-shadow(0 0 6px rgba(201,183,143,0.75));
  transition: stroke-dashoffset .06s linear;
}
.orb-core {
  position: absolute; top: 50%; left: 50%; width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold); transform: translate(-50%, -50%);
  box-shadow: 0 0 18px 4px rgba(201,183,143,0.5); animation: orb-pulse 3.2s ease-in-out infinite;
}
.orb-glyph {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -54%);
  font-size: 1.5rem; color: var(--ink); opacity: 0; transition: opacity .5s ease; pointer-events: none;
}
.portal-orb:hover .orb-glyph { opacity: .0; }
@keyframes orb-pulse {
  0%,100% { box-shadow: 0 0 16px 3px rgba(201,183,143,0.38); opacity: .85; }
  50%     { box-shadow: 0 0 28px 8px rgba(201,183,143,0.7); opacity: 1; }
}
.portal-orb.is-complete .orb-core {
  animation: none; box-shadow: 0 0 46px 16px rgba(201,183,143,0.95); background: #fff;
}
.orb-label {
  font-size: 0.66rem; letter-spacing: var(--wide); text-transform: uppercase; color: var(--muted);
  transition: color .3s ease;
}
.portal-orb-wrap:hover .orb-label { color: var(--ink); }

/* ---------- WARP TRANSITION ---------- */
.warp {
  position: fixed; inset: 0; z-index: 99; pointer-events: none; opacity: 0;
  transform: scale(.2); transform-origin: 50% 40%;
  background: radial-gradient(circle at 50% 40%, #fff 0%, rgba(201,183,143,0.5) 26%, #000 72%);
}
.warp.go { animation: warp-go .75s ease-in forwards; }
@keyframes warp-go {
  0%   { opacity: 0; transform: scale(.2); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: scale(3.2); }
}

/* ---------- COUNTER STRIP (above footer) ---------- */
.stats-strip {
  position: relative; z-index: 2;
  padding: clamp(3rem, 7vw, 4.4rem) 1.5rem;
}
.hero__stats {
  margin: 0 auto; display: flex; align-items: center; justify-content: center;
  gap: 1.6rem; flex-wrap: wrap;
  font-size: 0.72rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted);
}
.hero__stats > span { display: inline-flex; align-items: center; gap: 0.5em; }
.hero__stats b {
  font-weight: 400; font-style: normal; color: var(--ink);
  text-transform: none; margin: 0 0.12em;
  display: inline-flex; align-items: center; gap: 0.06em;
  perspective: 320px;
}
.hero__stats-div { color: var(--faint); }
.odo-fix {
  font-family: var(--serif); font-size: 2rem; line-height: 1; display: inline-block;
  margin: 0 0.04em;
}

/* ---- split-flap card ---- */
.flap {
  position: relative; display: inline-block;
  width: 0.86em; height: 1.34em; font-size: 2rem; line-height: 1.34em;
  margin: 0 0.05em; color: var(--ink);
  font-family: var(--sans); font-weight: 400; font-variant-numeric: tabular-nums;
  background: #1a1712; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(201,183,143,0.10), 0 2px 5px rgba(0,0,0,0.55);
  overflow: hidden;
}
.flap::after {  /* seam */
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  transform: translateY(-1px); background: #000; z-index: 6;
}
.flap__half, .flap__fold {
  position: absolute; left: 0; right: 0; height: 50%; overflow: hidden;
}
.flap__half--top, .flap__fold--top { top: 0; }
.flap__half--bottom, .flap__fold--bottom { bottom: 0; }
.flap__half span, .flap__fold span {
  position: absolute; left: 0; right: 0; height: 1.34em; line-height: 1.34em;
  text-align: center;
}
.flap__half--top span, .flap__fold--top span { top: 0; }
.flap__half--bottom span, .flap__fold--bottom span { bottom: 0; }
.flap__half--top, .flap__fold--top {
  background: linear-gradient(180deg, #201c15, #191510);
  border-radius: 3px 3px 0 0;
}
.flap__half--bottom, .flap__fold--bottom {
  background: linear-gradient(180deg, #17130e, #120f0a);
  border-radius: 0 0 3px 3px;
}
.flap__fold { z-index: 4; backface-visibility: hidden; }
.flap__fold--top { transform-origin: 50% 100%; }
.flap__fold--bottom { transform-origin: 50% 0%; transform: rotateX(90deg); }
.flap.go .flap__fold--top { animation: fold-top .14s ease-in forwards; }
.flap.go .flap__fold--bottom { animation: fold-bottom .14s ease-out .14s forwards; }
@keyframes fold-top { to { transform: rotateX(-90deg); } }
@keyframes fold-bottom { to { transform: rotateX(0deg); } }

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 1.5rem; text-align: center;
}
.footer__mark { width: 90px; max-width: 34%; height: auto; display: block; margin: 0 auto 0.4rem; opacity: 0.9; }
.footer__legal { font-size: 0.66rem; color: var(--faint); letter-spacing: 0.14em; text-transform: uppercase; margin-top: 0; }

/* ---------- PRELOADER ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 300; background: #000;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 1.1s ease, visibility 1.1s ease;
}
.preloader.done { opacity: 0; visibility: hidden; }
.preloader__logo {
  height: min(66px, 12vh); width: auto; opacity: .9;
  animation: pre-pulse 1.8s ease-in-out infinite;
}
@keyframes pre-pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .preloader__logo { animation: none; }
}

/* ---------- PORTAL MODAL ---------- */
.modal-body { display: flex; }
.modal-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.5rem; position: relative; z-index: 2;
}
.modal {
  width: min(400px, 92vw);
  background: rgba(18,17,16,0.72);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3rem 2.4rem 2.4rem;
  text-align: center;
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.04);
  animation: modal-in 0.9s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

.modal__eyebrow {
  display: block; font-size: 0.68rem; letter-spacing: var(--wide);
  text-transform: uppercase; color: var(--gold); margin-bottom: 2rem;
}
.gate { display: flex; flex-direction: column; gap: 1rem; }
.gate input {
  width: 100%; text-align: center;
  background: rgba(255,255,255,0.02); border: 1px solid var(--line); color: var(--ink);
  padding: 1rem 1.2rem; font-family: var(--sans); font-weight: 300;
  font-size: 0.9rem; letter-spacing: 0.28em; border-radius: 2px;
  transition: border-color .3s ease;
}
.gate input::placeholder { color: var(--faint); letter-spacing: 0.28em; text-transform: uppercase; font-size: 0.72rem; }
.gate input:focus { outline: none; border-color: var(--gold-soft); }
.gate .btn { margin: 0; width: 100%; }
.gate__error { color: #c98f8f; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; margin-top: 0.2rem; }

.modal__mark { width: 200px; max-width: 70%; display: block; margin: 0 auto 0.5rem; }
.modal__welcome { font-family: var(--serif); font-size: 1.8rem; margin-bottom: 1.6rem; }
.modal #member .btn { width: 100%; margin: 0; }

.modal__back {
  display: inline-block; margin-top: 1.6rem;
  font-size: 0.64rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--faint); transition: color .3s ease;
}
.modal__back:hover { color: var(--muted); }

.shake { animation: shake .45s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-7px)} 40%,80%{transform:translateX(7px)} }

/* ---------- MOBILE ---------- */
@media (max-width: 640px) {
  .header {
    padding: calc(1.3rem + env(safe-area-inset-top)) calc(1.4rem + env(safe-area-inset-right)) 1.3rem calc(1.4rem + env(safe-area-inset-left));
  }
  .header__brand { font-size: 1.15rem; letter-spacing: 0.38em; padding-left: 0.38em; }
  .header__mark img { height: 1.3rem; }
  .hero {
    padding: 8.5rem 1.6rem 2.6rem;
    padding-left: calc(1.6rem + env(safe-area-inset-left));
    padding-right: calc(1.6rem + env(safe-area-inset-right));
  }
  .hero__eyebrow { margin-bottom: 1.1rem; }
  .hero__tag { font-size: 1.5rem; line-height: 1.35; }
  .hero__tag br { display: none; }
  .ornament { margin: 1.7rem auto; }
  .hero__sub { font-size: 0.94rem; max-width: 340px; line-height: 1.7; }
  .footer {
    padding: 1.3rem 1.4rem calc(1.3rem + env(safe-area-inset-bottom));
  }
  .footer__mark { width: 96px; }
  .footer__legal { font-size: 0.6rem; letter-spacing: 0.1em; line-height: 1.9; }
  .portal-orb-wrap { margin-top: 2.4rem; }
  .portal-orb { width: 104px; height: 104px; }
  .cursor-glow { display: none; }
  /* compact counter — keep both stats on one row, scaled down */
  .stats-strip { padding: 2.8rem 1rem; }
  .hero__stats {
    gap: 0.7rem; font-size: 0.54rem; letter-spacing: 0.16em;
  }
  .hero__stats > span { gap: 0.4em; white-space: nowrap; }
  .hero__stats-div { display: inline-block; margin: 0 0.1rem; }
  .flap { font-size: 1.3rem; }
  .odo-fix { font-size: 1.3rem; }
  /* prevent iOS auto-zoom on focus (needs >= 16px) */
  .gate input { font-size: 16px; letter-spacing: 0.22em; }
  .modal { padding: 2.4rem 1.6rem 2rem; }
}

/* ---------- VERY SMALL PHONES (<380px) ---------- */
@media (max-width: 380px) {
  .hero { padding-top: 7.5rem; }
  .hero__tag { font-size: 1.32rem; }
  .hero__sub { font-size: 0.9rem; max-width: 300px; }
  .portal-orb { width: 96px; height: 96px; }
  .stats-strip { padding: 2.4rem 0.8rem; }
  .hero__stats { gap: 0.5rem; font-size: 0.48rem; letter-spacing: 0.1em; }
  .flap { font-size: 1.1rem; }
  .odo-fix { font-size: 1.1rem; }
  .footer__mark { width: 84px; }
}

/* ---------- SHORT / LANDSCAPE PHONES ---------- */
@media (max-height: 560px) and (max-width: 900px) {
  .hero { padding-top: 5rem; padding-bottom: 2rem; }
  .hero__eyebrow { margin-bottom: 0.8rem; }
  .ornament { margin: 1.1rem auto; }
  .portal-orb-wrap { margin-top: 1.6rem; gap: 0.8rem; }
  .portal-orb { width: 88px; height: 88px; }
  .footer { padding: 1rem 1.4rem; }
  .footer__mark { width: 84px; margin-bottom: 0.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
