:root {
  --bg: #050506;
  --fg: #f2ede4;
  --muted: #8b8690;
  --gold: #c9973e;
  --indigo: #4a3f8f;
  --danger: #b0121f;

  /* Two families, clearly distinct roles:
     serif  = the house voice (wordmark, brandmark) — high-contrast didone,
              hairlines that half-disappear against black under the spots
     mono   = the machine voice (manifesto, typed lines, UI) */
  --serif: 'Bodoni Moda', Didot, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, 'Courier New', monospace;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
}

/* ---------- access gate ---------- */
/* not real security — a client-side view-source bypass is trivial. this is
   a velvet rope, not a lock: it withholds the experience, matching the
   rest of the site's "not for everyone" voice. real protection needs
   host-level auth once a domain/host is picked. */
#gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.6s ease;
}

#gate.hide {
  opacity: 0;
  pointer-events: none;
}

#gate-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.gate-mark {
  width: 46px;
  height: 60px;
  margin-bottom: 0.6rem;
  background: var(--muted);
  -webkit-mask: url('assets/l4wless-mark.svg') center / contain no-repeat;
  mask: url('assets/l4wless-mark.svg') center / contain no-repeat;
  opacity: 0.8;
}

.gate-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.5em;
  color: var(--muted);
}

.gate-input {
  width: 9em;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(242, 237, 228, 0.35);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 1.4rem;
  letter-spacing: 0.6em;
  text-align: center;
  padding: 0.3em 0 0.5em;
  caret-color: var(--gold);
}

.gate-input:focus {
  outline: none;
  border-bottom-color: var(--gold);
}

.gate-submit {
  background: none;
  border: 1px solid rgba(201, 151, 62, 0.5);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.4em;
  padding: 0.6em 1.6em;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.gate-submit:hover,
.gate-submit:focus-visible {
  color: var(--gold);
  border-color: var(--gold);
}

.gate-error {
  min-height: 1.2em;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--danger);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gate-error.visible { opacity: 1; }

@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

#gate.shake #gate-form { animation: gateShake 0.4s ease; }

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

/* ---------- ambient dust ---------- */
#dust {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  opacity: 0.5;
}

/* ---------- film grain overlay ----------
   was overlay @ .05, which pivots around mid-grey and did nothing over
   a near-black page. soft-light + gold-tinted noise actually reads. */
#grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.09;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='matrix' values='1 0 0 0 0  0.82 0 0 0 0  0.5 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- intro ---------- */
#intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: radial-gradient(ellipse at 50% 40%, #0e0e11 0%, var(--bg) 70%);
  transition: opacity 0.85s ease, transform 0.85s ease;
}

#intro.hide {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.intro-inner { text-align: center; padding: 0 1.5rem; }

.intro-logo {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 96;
  font-weight: 700;
  font-size: clamp(2.6rem, 12vw, 6.5rem);
  letter-spacing: 0.14em;
  margin: 0 0 0.5rem 0;
  padding-left: 0.14em; /* optical: cancel the trailing tracking */
  color: var(--fg);
  text-shadow: 0 0 22px rgba(201, 151, 62, 0.30), 0 0 70px rgba(74, 63, 143, 0.22);
  opacity: 0;
  animation: reveal 2.1s cubic-bezier(.16,1,.3,1) forwards;
}

@keyframes reveal {
  0%   { opacity: 0; letter-spacing: 0.42em; filter: blur(7px); }
  60%  { opacity: 1; }
  100% { opacity: 1; letter-spacing: 0.14em; filter: blur(0); }
}

.intro-logo-sub {
  font-family: var(--mono);
  font-weight: 400;
  font-size: clamp(0.62rem, 2.2vw, 0.85rem);
  letter-spacing: 0.62em;
  margin: 0;
  padding-left: 0.62em;
  color: var(--muted);
  opacity: 0;
  animation: fadeIn 1.2s ease forwards;
  animation-delay: 1.5s;
}

.intro-hint {
  margin-top: 3.2rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.42em;
  color: var(--muted);
  opacity: 0;
  animation: fadeIn 0.9s ease forwards, pulse 2.4s ease-in-out infinite;
  animation-delay: 2.4s, 3.1s;
}

@keyframes fadeIn { to { opacity: 1; } }
@keyframes pulse {
  0%, 100% { opacity: 0.32; }
  50% { opacity: 0.85; }
}

/* ---------- skip ---------- */
#skip-btn {
  position: fixed;
  bottom: calc(1.5rem + var(--safe-b));
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  padding: 0.5rem 1.1rem;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.5s ease, color 0.3s ease;
}
#skip-btn.visible { opacity: 0.45; }
#skip-btn:hover { color: var(--fg); opacity: 0.9; }
#skip-btn.gone { opacity: 0; pointer-events: none; }

/* ---------- symbol transition ---------- */
#transition {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 45%, #0e0e11 0%, var(--bg) 72%);
  opacity: 1;
  transition: opacity 1.05s ease 0.15s; /* delayed so the rays are actually seen */
}

#transition.breaking { opacity: 0; pointer-events: none; }

.rays {
  position: absolute;
  width: 140vmax;
  height: 140vmax;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(242, 237, 228, 0.5) 0deg 2.2deg,
    transparent 2.2deg 15deg
  );
  mix-blend-mode: screen;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

#transition.breaking .rays {
  opacity: 0.75;
  transform: scale(1.6);
  transition: opacity 1.05s cubic-bezier(.2,.8,.3,1), transform 1.05s cubic-bezier(.2,.8,.3,1);
}

.symbol-wrap { position: relative; z-index: 1; }

.symbol {
  width: clamp(88px, 22vw, 118px);
  aspect-ratio: 118 / 154;
  background: linear-gradient(155deg, var(--fg) 0%, #d8c9bd 100%);
  -webkit-mask: url('assets/l4wless-mark.svg') center / contain no-repeat;
  mask: url('assets/l4wless-mark.svg') center / contain no-repeat;
  opacity: 0;
  filter: brightness(0.5) drop-shadow(0 0 4px rgba(201, 151, 62, 0.2));
  animation: symbolReveal 1.2s ease forwards;
}

@keyframes symbolReveal {
  0%   { opacity: 0; transform: scale(0.82); filter: brightness(0.4) drop-shadow(0 0 0 rgba(201,151,62,0)); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1); filter: brightness(1) drop-shadow(0 0 30px rgba(201,151,62,0.55)); }
}

#transition.breaking .symbol {
  animation: none;
  transition: transform 1.05s cubic-bezier(.55,0,.85,1), opacity 0.9s ease, filter 0.9s ease;
  transform: scale(15);
  opacity: 0;
  filter: brightness(2.4) drop-shadow(0 0 70px rgba(255,255,255,0.6));
}

#flash {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
#flash.active { opacity: 0.92; transition: opacity 0.12s ease-out; }
#flash.fading { opacity: 0; transition: opacity 0.6s ease-in; }

/* ---------- manifesto ---------- */
#manifesto {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #0e0e11 0%, var(--bg) 72%);
}

#mf-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.85s ease;
}
#manifesto.lit #mf-svg { opacity: 1; }

#mf-text {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 58px;      /* user units — real size comes from the viewBox */
  letter-spacing: 0.02em;
  fill: var(--fg);
}

.mf-deadline-word { fill: var(--danger); }

/* ---------- experience ---------- */
#experience {
  position: fixed;
  inset: 0;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}
#experience.visible { opacity: 1; pointer-events: auto; }

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* shown only if the three.js import fails — keeps a lit hero instead of a void */
#scene-fallback {
  position: absolute;
  inset: 0;
  display: none;
  background:
    radial-gradient(ellipse 42% 30% at 50% 62%, rgba(201,151,62,0.16) 0%, transparent 70%),
    radial-gradient(ellipse 55% 45% at 50% 45%, rgba(74,63,143,0.13) 0%, transparent 72%);
}
#experience.no-webgl #scene-fallback { display: block; }

.brandmark {
  position: fixed;
  top: 1.6rem;
  left: calc(1.8rem + var(--safe-l));
  z-index: 20;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: color 0.3s ease;
  font-family: var(--serif);
  font-variation-settings: 'opsz' 16;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  color: var(--muted);
}

.brandmark:hover { color: var(--fg); }
.brandmark:hover .brand-icon { background: var(--fg); }

.brand-icon {
  display: inline-block;
  width: 10px;
  height: 13px;
  margin-right: 0.7em;
  background: var(--muted);
  transition: background 0.3s ease;
  -webkit-mask: url('assets/l4wless-mark.svg') center / contain no-repeat;
  mask: url('assets/l4wless-mark.svg') center / contain no-repeat;
}

.drop-number {
  position: fixed;
  bottom: calc(1.4rem + var(--safe-b));
  right: calc(1.6rem + var(--safe-r));
  z-index: 20;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  opacity: 0.55;
}

/* ---------- buy button ----------
   was a tracked-out uppercase pill with a backdrop blur — the most
   generic element on the page, and the blur was compositing over a
   live WebGL canvas every frame. now: plain, square, machine voice. */
#buy-btn {
  position: fixed;
  top: 78%;
  left: 50%;
  z-index: 20;
  transform: translate(-50%, -50%);
  padding: 0.8rem 2.4rem;
  background: rgba(8, 8, 10, 0.55);
  border: 1px solid rgba(242, 237, 228, 0.5);
  color: var(--fg);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.26em;
  border-radius: 0;
  cursor: pointer;
  transition: top 0.45s cubic-bezier(.2,1.3,.4,1), left 0.45s cubic-bezier(.2,1.3,.4,1),
              border-color 0.3s ease, color 0.3s ease, opacity 0.6s ease, transform 0.6s ease;
}
#buy-btn:hover { border-color: var(--gold); color: var(--gold); }
#buy-btn.gone {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  pointer-events: none;
}

/* ---------- final message ---------- */
#final-message {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
  pointer-events: none;
}

.fm-typed {
  margin: 0;
  min-height: 1.4em;
  font-family: var(--mono);
  font-size: clamp(1.15rem, 3.4vw, 1.9rem);
  color: var(--fg);
  opacity: 0;
  transition: opacity 0.6s ease;
}
#final-message.visible .fm-typed { opacity: 1; }

.fm-cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--gold);
  animation: fmBlink 1s steps(1) infinite;
}
@keyframes fmBlink { 50%, 100% { opacity: 0; } }

.contact-btn {
  margin-top: 2rem;
  padding: 0.6rem 2.2rem;
  border: 1px solid var(--gold);
  color: var(--fg);
  background: rgba(201, 151, 62, 0.10);
  text-decoration: none;
  font-family: 'UnifrakturMaguntia', 'Old English Text MT', serif;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  text-transform: none;
  border-radius: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.7s ease, transform 0.7s ease, background 0.3s ease, border-color 0.3s ease;
  pointer-events: none;
}
.contact-btn:hover { background: rgba(201, 151, 62, 0.22); border-color: #ddb567; }
.contact-btn.is-static { opacity: 1; transform: none; pointer-events: auto; }

#final-message.typed-done .contact-btn {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------- noscript ---------- */
.noscript-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: radial-gradient(ellipse at 50% 42%, #0e0e11 0%, var(--bg) 70%);
}
.noscript-title {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 96;
  font-weight: 700;
  font-size: clamp(2rem, 9vw, 4rem);
  letter-spacing: 0.14em;
  padding-left: 0.14em;
  margin: 0;
}
.noscript-body {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 640px) {
  .brandmark { font-size: 0.8rem; top: 1.2rem; left: calc(1.2rem + var(--safe-l)); }
  .drop-number { font-size: 0.72rem; }
  #buy-btn { padding: 0.75rem 2rem; font-size: 0.78rem; }
}

/* ---------- reduced motion ----------
   this site is 100% motion: a 15x emblem burst, a 40x zoom and two
   full-screen white flashes. respect the setting properly rather than
   just slowing things down. JS also skips straight to the scene. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #dust { display: none; }
  #flash { display: none; }
  .rays { display: none; }
  .intro-logo, .intro-logo-sub, .intro-hint { opacity: 1; }
  .fm-cursor { animation: none; }
}
