/* === FONTS === */
@font-face {
  font-family: 'SuisseIntl';
  src: url('../fonts/SuisseIntl-Black-WebXL.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SuisseIntl';
  src: url('../fonts/SuisseIntl-Bold-WebXL.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* === DEPTH-DRIVEN CSS VARS === */
:root {
  --void-bg: #050505;
  --void-text: #cccccc;
  --void-accent: #8b0000;
  --void-highlight: #ff0000;
  --void-dim: #333333;
  --void-ghost: #222222;
  --void-breathing: 0;
  --void-flinch: 0;
  --void-noise: 0;
  --void-scanlines: 0;
  --void-crt: 0;
  --void-chromatic: 0;
  --void-font: 'SuisseIntl', Arial, sans-serif;
  --void-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--void-bg);
  color: var(--void-text);
  font-family: var(--void-font);
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background 2s ease;
}
::selection { background: var(--void-accent); color: #fff; }
::-webkit-scrollbar { display: none; }

/* === CANVAS === */
#void-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.85;
}
#void-canvas canvas { width: 100% !important; height: 100% !important; }

/* === CUSTOM CURSOR (template style) === */
#cursor-dot { mix-blend-mode: difference; }

/* === OVERLAY === */
#void-overlay {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
/* Ensure content always sits above noise/scanlines */
#void-main { z-index: 10; }

/* === PHANTOM CURSOR === */
#phantom-cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--void-accent);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s ease;
  filter: blur(1px);
}

/* === GHOST LAYER === */
#ghost-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.ghost-fragment {
  position: absolute;
  font-family: var(--void-font);
  font-weight: 700;
  font-size: 14px;
  color: var(--void-ghost);
  opacity: 0;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* === GATE === */
#gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 60px 0 40px;
}
.gate-bg { position: absolute; inset: 0; background: #000; }
.gate-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 600px;
  padding: 0 24px;
}
.gate-title {
  font-weight: 900;
  font-size: clamp(48px, 10vw, 120px);
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 48px;
  opacity: 0;
}
.gate-line {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.6;
  color: #888;
  margin-bottom: 12px;
  opacity: 0;
}
/* === DISCLAIMER === */
#gate-disclaimer { opacity: 0; margin-top: 32px; }
.disclaimer-box {
  text-align: left;
  max-width: 520px;
  margin: 0 auto;
  border: 1px solid #1a1a1a;
  padding: 24px;
  background: rgba(255,255,255,0.02);
}
.disclaimer-text {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.5;
  color: #666;
  margin-bottom: 12px;
}
.disclaimer-crisis {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #1a1a1a;
  font-size: 12px;
  color: #555;
}
.disclaimer-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
}
.disclaimer-list li {
  font-size: 12px;
  line-height: 1.6;
  color: #555;
  padding: 4px 0 4px 16px;
  position: relative;
}
.disclaimer-list li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  color: #333;
}
.disclaimer-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  cursor: none;
  font-size: 13px;
  font-weight: 700;
  color: #888;
  line-height: 1.4;
}
.disclaimer-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1px solid #333;
  background: none;
  cursor: none;
  margin-top: 2px;
  position: relative;
  transition: border-color 0.3s, background 0.3s;
}
.disclaimer-check input[type="checkbox"]:checked {
  border-color: var(--void-accent);
  background: var(--void-accent);
}
.disclaimer-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 2px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

#gate-enter {
  margin-top: 32px;
  background: none;
  border: 1px solid #333;
  color: #666;
  font-family: var(--void-font);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 16px 48px;
  cursor: none;
  opacity: 0;
  transition: border-color 0.3s, color 0.3s, opacity 0.3s;
}
#gate-enter:disabled { opacity: 0.3 !important; pointer-events: none; }
#gate-enter:not(:disabled) { opacity: 1 !important; border-color: #555; color: #ccc; }
#gate-enter:hover:not(:disabled) { border-color: var(--void-accent); color: #fff; }

/* === VOID MAIN === */
#void-main {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
#void-container {
  width: 100%;
  max-width: 680px;
  padding: 0 24px;
  will-change: transform;
  position: relative;
  z-index: 5;
}
#void-output { min-height: 120px; margin-bottom: 48px; }

.void-question {
  font-weight: 900;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--void-text);
  margin-bottom: 32px;
}
.void-truth {
  font-weight: 700;
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.7;
  color: var(--void-accent);
  margin-bottom: 16px;
}
.void-truth.devastating { color: var(--void-highlight); }
.void-truth span { opacity: 0; display: inline; }
.void-orient { font-weight: 700; font-size: 18px; line-height: 1.6; color: #555; }

/* === HORIZONTAL RULE (template style — animates width) === */
.void-rule {
  width: 0;
  height: 1px;
  background: #1a1a1a;
  margin: 24px 0;
  transition: width 3s cubic-bezier(0.43, 0.195, 0.02, 1);
}
.void-rule.expand { width: 100%; }
.void-processing {
  color: #333;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.4em;
}

/* === INPUT === */
#void-input-wrap { position: relative; display: flex; align-items: flex-end; gap: 12px; }
#void-submit {
  display: none; /* shown on mobile */
  background: none;
  border: 1px solid #222;
  color: #555;
  font-size: 20px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s;
  flex-shrink: 0;
}
#void-submit:active { border-color: var(--void-accent); color: var(--void-text); }
#void-input {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid #1a1a1a;
  color: var(--void-text);
  font-family: var(--void-font);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.6;
  padding: 16px 0;
  outline: none;
  resize: none;
  caret-color: var(--void-accent);
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}
#void-input::placeholder { color: #222; transition: color 2s; }
#void-input:focus { border-color: rgba(255,255,255,0.05); }
#void-input { transition: border-color 3s ease, font-size 2s ease; }

/* === DEPTH + TIMER (start nearly invisible — absorption state) === */
#depth-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  font-family: var(--void-mono);
  font-size: 11px;
  color: #1a1a1a;
  letter-spacing: 0.1em;
  z-index: 15;
  opacity: 0.15;
  transition: color 0.5s, opacity 3s;
}
#session-timer {
  position: fixed;
  top: 24px;
  right: 24px;
  font-family: var(--void-mono);
  font-size: 11px;
  color: #1a1a1a;
  letter-spacing: 0.1em;
  z-index: 15;
  opacity: 0.2;
  transition: opacity 3s;
}

/* === FULLSCREEN OVERRIDES === */
:fullscreen body, :-webkit-full-screen body { background: var(--void-bg); }
html { overscroll-behavior: none; }

/* === COOLDOWN === */
#cooldown-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.cooldown-inner { text-align: center; }
.cooldown-text { font-weight: 700; font-size: 18px; color: #444; margin-bottom: 16px; }

/* === PAYWALL === */
#paywall {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.95);
}
.paywall-inner { text-align: center; }
.paywall-text { font-weight: 900; font-size: 24px; color: var(--void-text); margin-bottom: 16px; }
.paywall-text.dim { font-weight: 700; font-size: 16px; color: #555; }
.paywall-btn {
  display: block;
  margin: 16px auto 0;
  background: none;
  border: 1px solid #333;
  color: #888;
  font-family: var(--void-font);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 40px;
  cursor: none;
  transition: border-color 0.3s, color 0.3s;
}
.paywall-btn:hover { border-color: var(--void-accent); color: var(--void-text); }
.paywall-btn.dim { border-color: #1a1a1a; color: #444; }

/* === SAFETY === */
#safety-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.safety-inner { text-align: center; max-width: 500px; padding: 0 24px; }
.safety-title { font-weight: 900; font-size: 24px; color: #fff; margin-bottom: 24px; }
.safety-text { font-weight: 700; font-size: 16px; color: #888; line-height: 1.6; margin-bottom: 32px; }
.safety-resources { margin-bottom: 40px; }
.safety-link {
  display: block;
  color: var(--void-accent);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  padding: 12px 0;
  border-bottom: 1px solid #1a1a1a;
  transition: color 0.3s;
}
.safety-link:hover { color: var(--void-highlight); }
.safety-btn {
  background: none;
  border: 1px solid #333;
  color: #666;
  font-family: var(--void-font);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 40px;
  cursor: none;
  transition: border-color 0.3s, color 0.3s;
}
.safety-btn:hover { border-color: var(--void-accent); color: var(--void-text); }

/* === UTILITY === */
.hidden { display: none !important; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  /* Restore normal cursor on mobile */
  body, #gate-enter, .paywall-btn, .safety-btn, .disclaimer-check, .disclaimer-check input { cursor: auto !important; }
  #void-input { cursor: text !important; }

  /* Hide desktop-only effects */
  #phantom-cursor, #cursor-dot { display: none !important; }

  /* Canvas: enabled on mobile with touch interaction */
  #void-canvas { opacity: 0.7; }

  /* Gate: must be scrollable on small screens */
  #gate {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
    padding: 60px 0 40px;
  }
  .gate-inner { padding: 0 20px; }
  .gate-title { font-size: 56px; margin-bottom: 24px; }
  .gate-line { font-size: 14px; margin-bottom: 8px; }

  /* Disclaimer: fit on mobile */
  #gate-disclaimer { margin-top: 20px; }
  .disclaimer-box { padding: 16px; }
  .disclaimer-text { font-size: 12px; }
  .disclaimer-list li { font-size: 11px; line-height: 1.5; padding: 3px 0 3px 14px; }
  .disclaimer-crisis { font-size: 11px; }
  .disclaimer-check { font-size: 12px; gap: 8px; }
  .disclaimer-check input[type="checkbox"] { width: 22px; height: 22px; min-width: 22px; }
  #gate-enter { margin-top: 24px; padding: 14px 32px; width: 100%; }

  /* Main void: accommodate mobile keyboard */
  #void-main {
    align-items: flex-start;
    padding-top: 60px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  #void-container {
    padding: 0 16px;
    padding-bottom: 120px; /* space for keyboard */
  }
  #void-output { min-height: 80px; margin-bottom: 24px; }

  /* Typography: mobile sizes */
  .void-question { font-size: 18px; line-height: 1.5; margin-bottom: 20px; }
  .void-truth { font-size: 15px; line-height: 1.6; }
  .void-orient { font-size: 15px; }
  .void-processing { font-size: 20px; }

  /* Input: prevent iOS zoom (must be 16px+), full width */
  #void-input {
    font-size: 16px !important;
    padding: 12px 0;
    border-bottom: 1px solid #222;
    flex: 1;
  }
  #void-input-wrap { margin-bottom: 20px; }
  #void-submit { display: block; }

  /* Depth + timer: reposition for mobile */
  #depth-indicator { bottom: 12px; right: 12px; font-size: 10px; }
  #session-timer { top: 12px; right: 12px; font-size: 10px; }

  /* Safety: scrollable on small screens */
  #safety-overlay { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 40px 0; align-items: flex-start; }
  .safety-inner { padding: 0 20px; }
  .safety-title { font-size: 20px; }
  .safety-text { font-size: 14px; }
  .safety-link { font-size: 14px; padding: 14px 0; }
  .safety-btn { width: 100%; padding: 16px; }

  /* Paywall: mobile friendly */
  .paywall-text { font-size: 20px; }
  .paywall-btn { width: 80%; padding: 16px; }

  /* Ghost fragments: smaller on mobile */
  .ghost-fragment { font-size: 12px; }

  /* Cooldown */
  .cooldown-text { font-size: 16px; }
}

/* Small phones (iPhone SE, etc) */
@media (max-width: 380px) {
  .gate-title { font-size: 42px; }
  .gate-line { font-size: 13px; }
  .disclaimer-list li { font-size: 10px; }
  .void-question { font-size: 16px; }
  .void-truth { font-size: 14px; }
  #void-container { padding: 0 12px; }
}

/* Keyboard visible: shrink content above fold */
@media (max-height: 500px) and (max-width: 768px) {
  #void-main { padding-top: 20px; }
  #void-output { min-height: 40px; margin-bottom: 16px; }
  .void-question { font-size: 16px; margin-bottom: 12px; }
}
/* glorp.me */
