/* ============================================
   PEPTIDES PORTAL — Liquid Gradient Dreamscape
   One flowing WebGL scene · big quiet type
   ============================================ */

:root {
  --ink: #F6F0E6;
  --ink-dim: rgba(246,240,230,0.62);
  --ink-faint: rgba(246,240,230,0.34);
  --line: rgba(246,240,230,0.18);
  --line-2: rgba(246,240,230,0.4);
  --accent: #F4CE86;

  --display: 'Hanken Grotesk', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--display);
  color: var(--ink);
  background: #160E2E;
  line-height: 1.5; overflow: hidden; position: relative;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; }
::selection { background: var(--accent); color: #160E2E; }

/* ── BACKGROUND ── */
#gl { position: fixed; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; }
/* CSS fallback if WebGL unavailable */
.gl-fallback {
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(130deg, #160E2E, #6A2A6B 35%, #1E7A78 68%, #E8A06A 100%);
  background-size: 300% 300%; animation: drift 26s ease infinite;
}
@keyframes drift { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }

.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.5; mix-blend-mode: overlay;
  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.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: 1; pointer-events: none;
  background: radial-gradient(ellipse 70% 65% at 50% 50%, transparent 35%, rgba(8,5,18,0.55) 100%);
}

/* ── HUD ── */
.hud { position: fixed; z-index: 30; font-family: var(--mono); font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--ink-faint); pointer-events: none; }
.hud.tl { top: 28px; left: 30px; }
.hud.tr { top: 28px; right: 30px; }
.hud.bl { bottom: 28px; left: 30px; }

/* ── STAGE / SCREENS ── */
.stage { position: relative; z-index: 10; height: 100vh; height: 100dvh; }
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 40px;
  opacity: 0; visibility: hidden; pointer-events: none;
}
.screen.active { opacity: 1; visibility: visible; pointer-events: auto; }
.col { display: flex; flex-direction: column; align-items: center; max-width: 820px; }

/* ── TYPE ── */
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 5px; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 30px; }
.display {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(56px, 13vw, 184px); line-height: 0.92; letter-spacing: -0.04em;
  color: var(--ink); text-shadow: 0 4px 60px rgba(8,5,18,0.4);
}
.display .char { display: inline-block; will-change: transform, opacity; }
.q-display {
  font-family: var(--display); font-weight: 300;
  font-size: clamp(34px, 6vw, 76px); line-height: 1.02; letter-spacing: -0.03em;
  color: var(--ink); max-width: 14ch; margin-bottom: 56px; text-shadow: 0 4px 50px rgba(8,5,18,0.35);
}
.q-display .char { display: inline-block; will-change: transform, opacity; }
.lede { font-size: clamp(16px, 2vw, 20px); font-weight: 400; color: var(--ink-dim); max-width: 460px; margin-top: 32px; line-height: 1.6; }
.lede b { color: var(--ink); font-weight: 600; }

/* ── ENTER / TEXT BUTTON ── */
.enter-btn {
  margin-top: 52px; display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--ink); padding-bottom: 8px; position: relative; will-change: transform;
}
.enter-btn::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: var(--line-2); transform: scaleX(0.0); transform-origin: left; transition: transform .4s var(--ease), background .3s var(--ease); }
.enter-btn:hover::after { transform: scaleX(1); background: var(--accent); }
.enter-btn .arrow { transition: transform .3s var(--ease); }
.enter-btn:hover .arrow { transform: translateX(6px); color: var(--accent); }
.enter-btn:disabled { color: var(--ink-faint); cursor: not-allowed; }
.enter-btn:disabled:hover .arrow { transform: none; color: var(--ink-faint); }

/* ── GATE ── */
.gate-toggle {
  display: flex; align-items: flex-start; gap: 16px; text-align: left; cursor: pointer;
  max-width: 480px; margin-top: 12px; padding: 4px;
}
.gate-dot {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2); flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center; transition: all .3s var(--ease); color: #160E2E;
}
.gate-toggle.on .gate-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 24px rgba(244,206,134,0.5); }
.gate-dot svg { opacity: 0; transition: opacity .25s var(--ease); }
.gate-toggle.on .gate-dot svg { opacity: 1; }
.gate-toggle span { font-size: 15px; color: var(--ink); line-height: 1.6; font-weight: 400; }

/* ── QUIZ ── */
.q-top { font-family: var(--mono); font-size: 12px; letter-spacing: 4px; text-transform: uppercase; color: var(--accent); margin-bottom: 30px; display: flex; align-items: center; gap: 14px; }
.q-bar { width: 60px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.q-bar .fill { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.answers { display: flex; flex-direction: column; gap: 2px; width: 100%; max-width: 560px; }
.answer {
  display: flex; align-items: baseline; gap: 20px; text-align: left; padding: 18px 8px;
  border-bottom: 1px solid var(--line); position: relative; will-change: transform, opacity;
  transition: padding-left .35s var(--ease);
}
.answer::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(244,206,134,0.14), transparent); transition: width .4s var(--ease); pointer-events: none; }
.answer:hover { padding-left: 22px; }
.answer:hover::before { width: 100%; }
.answer-key { font-family: var(--mono); font-size: 12px; color: var(--accent); flex-shrink: 0; width: 18px; }
.answer-body { display: flex; flex-direction: column; gap: 3px; }
.answer-t { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; }
.answer-s { font-size: 13px; color: var(--ink-dim); }
.answer .answer-go { margin-left: auto; align-self: center; opacity: 0; transform: translateX(-8px); transition: all .35s var(--ease); color: var(--accent); }
.answer:hover .answer-go { opacity: 1; transform: translateX(0); }

/* ── REVEAL ── */
.r-form { display: flex; align-items: center; gap: 0; width: 100%; max-width: 440px; margin-top: 40px; border-bottom: 1.5px solid var(--line-2); transition: border-color .3s var(--ease); }
.r-form:focus-within { border-color: var(--accent); }
.r-input { flex: 1; padding: 14px 4px; background: transparent; border: none; color: var(--ink); font-family: var(--mono); font-size: 15px; outline: none; }
.r-input::placeholder { color: var(--ink-faint); }
.r-submit { padding: 14px 10px; color: var(--ink); transition: color .25s var(--ease); will-change: transform; }
.r-submit:hover { color: var(--accent); }
.r-note { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--ink-faint); margin-top: 22px; }
.r-success { display: none; flex-direction: column; align-items: center; }
.r-success .ring { width: 60px; height: 60px; border-radius: 50%; border: 1.5px solid var(--accent); display: flex; align-items: center; justify-content: center; color: var(--accent); margin-bottom: 28px; box-shadow: 0 0 30px rgba(244,206,134,0.4); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition: none !important; }
}
