/* =============================================================
   SANCTUARY — design tokens
   ink   #07080A  void the page recedes into
   ash   #969C93  the grayscale narrative color / secondary text
   bone  #F1ECE1  primary warm-white text
   ember #C9A268  sacred light accent — the thing worth revealing
   moss  #1B2119  deep shadow tint for vignette + scrim
   Fonts are system-native on purpose: zero third-party network
   requests, zero render-blocking, works offline, nothing for a
   CSP to have to trust but 'self'.
   ============================================================= */

:root {
  --ink:   #07080A;
  --ash:   #969C93;
  --bone:  #F1ECE1;
  --ember: #C9A268;
  --moss:  #1B2119;

  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", "Liberation Mono", Menlo, Consolas, monospace;

  --lens-r: 0px;
  --lens-x: 50%;
  --lens-y: 42%;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;             /* single page, no scroll, ever */
  overscroll-behavior: none;
  background: var(--ink);
  color: var(--bone);
}

body {
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

/* ================= STAGE ================= */

.stage {
  position: relative;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: var(--ink);
  touch-action: none;
  cursor: none;
}

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.layer--color { z-index: 1; }

.layer--gray {
  z-index: 2;
  -webkit-mask-image: radial-gradient(
    circle var(--lens-r) at var(--lens-x) var(--lens-y),
    transparent 0%, transparent 58%,
    rgba(0,0,0,0.55) 80%, black 100%
  );
  mask-image: radial-gradient(
    circle var(--lens-r) at var(--lens-x) var(--lens-y),
    transparent 0%, transparent 58%,
    rgba(0,0,0,0.55) 80%, black 100%
  );
}

/* subtle film grain, sits above both video layers */
.grain {
  position: absolute;
  inset: -10%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(7,8,10,0.55) 100%);
}

.scrim {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 5;
  pointer-events: none;
}
.scrim--top    { top: 0;    height: 26vh; background: linear-gradient(to bottom, rgba(7,8,10,0.65), transparent); }
.scrim--bottom { bottom: 0; height: 34vh; background: linear-gradient(to top, rgba(7,8,10,0.75), transparent); }

/* cursor lens ring — hidden; the reveal itself is done via the mask below */
.lens {
  display: none;
}

/* ================= CONTENT ================= */

.content {
  position: absolute;
  z-index: 7;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  padding: 0 5vw;
  gap: clamp(0.5rem, 1.6vh, 0.9rem);
}

.content .notify-form,
.content .notify-form * {
  pointer-events: auto;
}

.hidden-frame {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  border: 0 !important;
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.kicker {
  margin: 0 0 clamp(0.9rem, 2.4vh, 1.6rem);
  font-family: var(--font-mono);
  font-style: italic;
  font-size: clamp(0.7rem, 1.05vw, 0.9rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ember);
  text-shadow: 0 2px 10px rgba(0,0,0,0.85), 0 1px 3px rgba(0,0,0,0.95);
  opacity: 0;
  animation: rise 1.2s 0.5s cubic-bezier(.16,1,.3,1) forwards;
}

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 8.5vw, 5.6rem);
  letter-spacing: -0.01em;
  line-height: 0.95;
  background: linear-gradient(100deg, var(--bone) 30%, #fff8ec 45%, var(--ember) 52%, var(--bone) 68%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 14px rgba(0,0,0,0.85)) drop-shadow(0 1px 4px rgba(0,0,0,0.9));
  opacity: 0;
  animation: rise 1.3s 0.75s cubic-bezier(.16,1,.3,1) forwards, sheen 7s 2.2s ease-in-out infinite;
}

@keyframes sheen {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0% 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================= NOTIFY FORM ================= */

.coming-soon {
  position: absolute;
  z-index: 7;
  left: 0;
  right: 0;
  bottom: clamp(4.5rem, 16vh, 8.5rem);
  text-align: center;
  pointer-events: none;
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.6rem, 5.2vw, 3.1rem);
  letter-spacing: 0.03em;
  background: linear-gradient(100deg, var(--ember) 20%, #fff2d6 45%, var(--ember) 70%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.85)) drop-shadow(0 0 22px rgba(201,162,104,0.3));
  opacity: 0;
  animation: rise 1.2s 1.5s cubic-bezier(.16,1,.3,1) forwards, coming-sheen 5s 2.7s ease-in-out infinite;
}
@keyframes coming-sheen {
  0%, 100% { background-position: 100% 0; }
  50%      { background-position: 0% 0; }
}

.notify-form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: min(420px, 84vw);
  margin: clamp(0.4rem, 1.2vh, 0.7rem) 0 0;
  opacity: 0;
  animation: rise 1.2s 1.0s cubic-bezier(.16,1,.3,1) forwards;
}

.notify-input {
  flex: 1;
  min-width: 0;
  background: rgba(7, 8, 10, 0.62);
  border: 1px solid rgba(201, 162, 104, 0.5);
  border-radius: 999px;
  outline: none;
  color: var(--bone);
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 1.4vw, 0.85rem);
  padding: 0.7rem 1rem;
  line-height: 1.2;
  backdrop-filter: blur(3px);
}
.notify-input::placeholder { color: var(--ember); opacity: 0.75; }
.notify-input:focus { border-color: var(--ember); }

.notify-btn {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  line-height: 1.2;
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.2vw, 0.8rem);
  letter-spacing: 0.06em;
  color: var(--ink);
  background: linear-gradient(100deg, #d9b578, var(--ember));
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.notify-btn:hover { filter: brightness(1.08); }
.notify-btn:active { transform: scale(0.97); }
.notify-btn:disabled { opacity: 0.6; cursor: default; }

.notify-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(0.6rem, 0.95vw, 0.7rem);
  letter-spacing: 0.1em;
  color: var(--ember);
  text-shadow: 0 2px 8px rgba(0,0,0,0.85), 0 1px 3px rgba(0,0,0,0.95);
  opacity: 0;
  animation: rise 1.2s 1.5s cubic-bezier(.16,1,.3,1) forwards;
}
.notify-note.success { color: var(--ember); opacity: 1 !important; }
.notify-note.error   { color: #c97a68; opacity: 1 !important; }

/* ================= CORNER TAGS ================= */

.tag {
  position: absolute;
  z-index: 7;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ember);
  text-shadow: 0 2px 8px rgba(0,0,0,0.85), 0 1px 3px rgba(0,0,0,0.95);
  opacity: 0.85;
  margin: 0;
  pointer-events: none;
}
.tag--bottom-left  { top: auto; bottom: clamp(1.2rem, 3vh, 1.8rem); left: clamp(1.4rem, 3vw, 2.4rem); }
.tag--bottom-right { top: auto; bottom: clamp(1.2rem, 3vh, 1.8rem); right: clamp(1.4rem, 3vw, 2.4rem); opacity: 0.7; font-size: 0.62rem; }

/* ================= MOTION & INPUT PREFERENCES ================= */

@media (prefers-reduced-motion: reduce) {
  .kicker, .wordmark, .coming-soon, .notify-form, .notify-note { animation: none; opacity: 1; }
  .lens { animation: none; }
  .layer--gray { transition: none; }
}

@media (hover: none) {
  .stage { cursor: default; }
}

/* graceful fallback if the mp4 sources fail to load */
.stage.no-video .layer--color {
  background: radial-gradient(ellipse at 50% 40%, #3a4a35 0%, #1b2119 55%, #07080a 100%);
}
.stage.no-video .layer--gray {
  background: radial-gradient(ellipse at 50% 40%, #4d504a 0%, #23241f 55%, #07080a 100%);
}

@media (max-width: 560px) {
  .scrim--bottom { height: 46vh; }
  .notify-form { width: 92vw; }
  .tag--bottom-right { display: none; }
}