/* ============ THE BLACK DEN ============ */
:root {
  --black: #050505;
  --coal: #0c0b0d;
  --ash: #141216;
  --blood: #d31a25;
  --blood-deep: #7a0b12;
  --blood-glow: rgba(211, 26, 37, 0.55);
  --bone: #e8e2d9;
  --smoke: #8a8390;
  --font-display: "Cinzel", serif;
  --font-ui: "Rajdhani", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--bone);
  font-family: var(--font-ui);
  overflow-x: hidden;
  cursor: none;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
::selection { background: var(--blood); color: #fff; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--blood-deep); border-radius: 5px; }

/* ---------- Cursor ---------- */
#cursor, #cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; border-radius: 50%; }
#cursor { width: 8px; height: 8px; background: var(--blood); box-shadow: 0 0 12px var(--blood-glow); transform: translate(-50%, -50%); }
#cursor-ring { width: 34px; height: 34px; border: 1px solid var(--blood-glow); transform: translate(-50%, -50%); transition: width .2s, height .2s, border-color .2s; }
body.cursor-hot #cursor-ring { width: 52px; height: 52px; border-color: var(--blood); }
@media (hover: none) { #cursor, #cursor-ring { display: none; } body { cursor: auto; } }

/* ---------- Preloader ---------- */
#preloader {
  position: fixed; inset: 0; z-index: 10000; background: var(--black);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  transition: opacity .8s ease, visibility .8s;
}
#preloader.gone { opacity: 0; visibility: hidden; }
.preloader-logo { width: 110px; animation: pulse 1.6s ease-in-out infinite; filter: drop-shadow(0 0 25px var(--blood-glow)); }
.preloader-text { font-family: var(--font-display); letter-spacing: .5em; color: var(--blood); font-size: 13px; animation: flicker 2s infinite; }
.preloader-bar { width: 220px; height: 2px; background: #1c1c1c; overflow: hidden; }
.preloader-bar span { display: block; height: 100%; width: 40%; background: var(--blood); animation: load 1.2s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%);} 100% { transform: translateX(280%);} }
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.07);} }
@keyframes flicker { 0%,100% {opacity:1;} 92% {opacity:1;} 93% {opacity:.3;} 94% {opacity:1;} 97% {opacity:.5;} 98% {opacity:1;} }

/* ---------- Embers ---------- */
#embers { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* ---------- Nav ---------- */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4vw;
  background: linear-gradient(180deg, rgba(5,5,5,.92), rgba(5,5,5,0));
  transition: background .4s, box-shadow .4s;
}
#nav.solid { background: rgba(8, 6, 8, .95); box-shadow: 0 1px 0 rgba(211,26,37,.25), 0 10px 30px rgba(0,0,0,.6); }
.nav-brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 900; letter-spacing: .18em; font-size: 17px; }
.nav-brand img { height: 40px; filter: drop-shadow(0 0 8px var(--blood-glow)); }
.nav-brand em { color: var(--blood); font-style: normal; }
.nav-links { display: flex; align-items: center; gap: 26px; font-weight: 600; letter-spacing: .14em; font-size: 13px; }
.nav-links a:not(.btn) { position: relative; opacity: .85; }
.nav-links a:not(.btn)::after { content: ""; position: absolute; left: 0; bottom: -5px; width: 0; height: 1px; background: var(--blood); transition: width .3s; }
.nav-links a:not(.btn):hover::after { width: 100%; }
#audio-toggle { background: none; border: 1px solid #2a2a2a; color: var(--smoke); font-family: var(--font-ui); font-size: 11px; letter-spacing: .12em; padding: 5px 10px; cursor: none; transition: .3s; }
#audio-toggle.on { border-color: var(--blood); color: var(--blood); box-shadow: 0 0 10px var(--blood-glow); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 14px 34px; font-family: var(--font-ui); font-weight: 700;
  letter-spacing: .22em; font-size: 14px; border: none; cursor: none; position: relative;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform .15s, box-shadow .3s, background .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-blood { background: linear-gradient(160deg, var(--blood), var(--blood-deep)); color: #fff; box-shadow: 0 0 22px rgba(211,26,37,.35); }
.btn-blood:hover { box-shadow: 0 0 40px rgba(211,26,37,.7); }
.btn-ghost { background: transparent; color: var(--bone); outline: 1px solid #3a3038; outline-offset: -1px; }
.btn-ghost:hover { outline-color: var(--blood); color: var(--blood); }
.btn-small { padding: 9px 20px; font-size: 12px; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.hero-bg {
  position: absolute; inset: -6%; z-index: 0;
  background: url("/assets/hero-bg.jpg") center/cover no-repeat;
  animation: slowzoom 30s ease-in-out infinite alternate;
}
@keyframes slowzoom { from { transform: scale(1); } to { transform: scale(1.08); } }
.hero-vignette {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse at center, transparent 25%, rgba(5,5,5,.75) 75%, var(--black) 100%),
    linear-gradient(180deg, rgba(5,5,5,.55), transparent 30%, transparent 60%, var(--black) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 120px 20px 60px; }
.hero-logo { width: 150px; margin-bottom: 8px; filter: drop-shadow(0 0 35px var(--blood-glow)); animation: heartbeat 4s ease-in-out infinite; }
@keyframes heartbeat { 0%,100% { filter: drop-shadow(0 0 22px var(--blood-glow)); } 50% { filter: drop-shadow(0 0 55px var(--blood)); } }
.hero h1 {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(42px, 8.5vw, 108px);
  letter-spacing: .12em; color: var(--bone); line-height: 1.05;
  text-shadow: 0 0 60px rgba(211,26,37,.35);
}
.hero-sub { margin-top: 10px; letter-spacing: .5em; font-size: clamp(11px, 1.6vw, 16px); color: var(--blood); font-weight: 600; }
.hero-badge {
  display: inline-block; margin-bottom: 18px; padding: 7px 18px; font-size: 11px; letter-spacing: .4em;
  color: var(--blood); border: 1px solid var(--blood-deep); background: rgba(122, 11, 18, .12);
  animation: flicker 4s infinite;
}
.hero-lede { margin: 26px auto 0; max-width: 680px; font-size: 18px; line-height: 1.75; color: var(--smoke); }
.hero-cta { margin-top: 34px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; align-items: center; }
.scroll-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2; color: var(--blood); animation: bob 1.8s infinite; font-size: 18px; }
@keyframes bob { 0%,100% { transform: translate(-50%, 0);} 50% { transform: translate(-50%, 10px);} }

/* ---------- Glitch ---------- */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; overflow: hidden;
  clip-path: inset(50% 0 50% 0); opacity: .85;
}
.glitch::before { color: var(--blood); transform: translateX(-2px); animation: glitch-a 3.5s infinite steps(1); }
.glitch::after { color: #4de0e0; transform: translateX(2px); animation: glitch-b 3.5s infinite steps(1); }
@keyframes glitch-a { 0%,94%,100% { clip-path: inset(50% 0 50% 0);} 95% { clip-path: inset(10% 0 60% 0);} 96% { clip-path: inset(70% 0 10% 0);} 97% { clip-path: inset(40% 0 40% 0);} 98% { clip-path: inset(80% 0 5% 0);} }
@keyframes glitch-b { 0%,94%,100% { clip-path: inset(50% 0 50% 0);} 95.5% { clip-path: inset(60% 0 20% 0);} 96.5% { clip-path: inset(20% 0 65% 0);} 97.5% { clip-path: inset(5% 0 85% 0);} }

/* ---------- Sections ---------- */
.section { position: relative; z-index: 2; padding: 110px 6vw; max-width: 1300px; margin: 0 auto; }
.section-dark { max-width: none; background: linear-gradient(180deg, var(--black), var(--coal) 20%, var(--coal) 80%, var(--black)); }
.section-dark > * { max-width: 1300px; margin-left: auto; margin-right: auto; }
.section-title {
  font-family: var(--font-display); font-weight: 900; letter-spacing: .16em;
  font-size: clamp(30px, 4.5vw, 52px); text-align: center; margin-bottom: 12px;
}
.section-title::after { content: ""; display: block; width: 70px; height: 3px; margin: 18px auto 0; background: linear-gradient(90deg, transparent, var(--blood), transparent); }
.section-sub { text-align: center; color: var(--smoke); letter-spacing: .08em; font-size: 17px; margin-bottom: 54px; }

.reveal { opacity: 0; transform: translateY(36px); transition: opacity .8s ease, transform .8s ease; }
.reveal.shown { opacity: 1; transform: none; }

/* ---------- Prose ---------- */
.prose { max-width: 760px; margin: 0 auto; }
.prose p { font-size: 18px; line-height: 1.85; color: var(--smoke); margin-bottom: 22px; }
.prose b { color: var(--bone); }

/* ---------- Roadmap ---------- */
.roadmap { max-width: 780px; margin: 0 auto; position: relative; }
.roadmap::before { content: ""; position: absolute; left: 27px; top: 10px; bottom: 10px; width: 1px; background: linear-gradient(180deg, var(--blood), #241f26); }
.phase { display: flex; gap: 28px; padding: 26px 0; position: relative; }
.phase-marker {
  flex: 0 0 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 900; font-size: 22px; color: var(--smoke);
  background: var(--coal); border: 1px solid #241f26; z-index: 1;
}
.phase.current .phase-marker { color: #fff; background: linear-gradient(160deg, var(--blood), var(--blood-deep)); border-color: var(--blood); box-shadow: 0 0 25px var(--blood-glow); animation: pulse 3s infinite; }
.phase-body h3 { font-family: var(--font-display); font-size: 19px; letter-spacing: .12em; margin-bottom: 8px; }
.phase-tag { font-family: var(--font-ui); font-size: 10px; letter-spacing: .3em; color: var(--blood); border: 1px solid var(--blood-deep); padding: 3px 10px; margin-left: 12px; vertical-align: middle; animation: flicker 3s infinite; }
.phase-body p { color: var(--smoke); line-height: 1.7; font-size: 16px; max-width: 560px; }

/* ---------- Creed cards ---------- */
.creed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }
.creed-grid.three { max-width: 1100px; }
.card {
  background: linear-gradient(165deg, var(--ash), var(--coal)); border: 1px solid #241f26;
  padding: 34px 28px; position: relative; transition: transform .15s ease, border-color .3s, box-shadow .3s;
  transform-style: preserve-3d; will-change: transform;
}
.card:hover { border-color: var(--blood-deep); box-shadow: 0 20px 50px rgba(0,0,0,.55), 0 0 30px rgba(211,26,37,.12); }
.card-rune { font-family: var(--font-display); font-size: 44px; font-weight: 900; color: var(--blood); opacity: .9; margin-bottom: 14px; text-shadow: 0 0 20px var(--blood-glow); }
.card h3 { font-size: 16px; letter-spacing: .14em; margin-bottom: 12px; font-family: var(--font-display); }
.card p { color: var(--smoke); line-height: 1.65; font-size: 15px; }

/* ---------- Inputs ---------- */
input, textarea {
  background: #0a090b; border: 1px solid #2c2530; color: var(--bone); font-family: var(--font-ui);
  font-size: 15px; padding: 13px 16px; letter-spacing: .04em; outline: none; transition: border-color .3s; cursor: none;
}
input:focus { border-color: var(--blood); box-shadow: 0 0 14px rgba(211,26,37,.18); }
@keyframes rise { from { opacity: 0; transform: translateY(14px);} to { opacity: 1; transform: none;} }
.hidden { display: none !important; }

/* ---------- Back us ---------- */
.back-section { text-align: center; }
.back-section .prose { margin-bottom: 26px; }
.join-logo { width: 90px; display: block; margin: 0 auto 20px; filter: drop-shadow(0 0 25px var(--blood-glow)); }
.btn-disabled { opacity: .45; pointer-events: none; }

/* ---------- Footer ---------- */
footer { position: relative; z-index: 2; text-align: center; padding: 46px 20px; color: var(--smoke); font-size: 13px; letter-spacing: .18em; border-top: 1px solid #191519; }
.footer-links { margin-top: 10px; }
.footer-links a { color: var(--blood); opacity: .8; }
.footer-links a:hover { opacity: 1; }

/* ---------- The Oracle ---------- */
#oracle-fab {
  position: fixed; bottom: 26px; right: 26px; z-index: 500;
  display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px;
  background: radial-gradient(circle at 30% 30%, #1c1216, #0a0608); border: 1px solid var(--blood-deep);
  color: var(--bone); font-family: var(--font-ui); font-weight: 700; font-size: 11px; letter-spacing: .18em;
  cursor: none; box-shadow: 0 0 30px rgba(211,26,37,.35); transition: transform .2s, box-shadow .3s;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
#oracle-fab:hover { transform: scale(1.06); box-shadow: 0 0 50px rgba(211,26,37,.65); }
#oracle-fab img { width: 38px; animation: heartbeat 4s ease-in-out infinite; }
#oracle-fab span { text-align: left; line-height: 1.5; }

#oracle-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(122, 11, 18, .16), transparent 60%),
    rgba(4, 3, 4, .97);
  animation: rise .35s ease;
}
#oracle-viz { position: absolute; inset: 0; width: 100%; height: 100%; }
#oracle-close {
  position: absolute; top: 22px; right: 26px; z-index: 3; background: none; border: 1px solid #2c2530;
  color: var(--smoke); font-size: 18px; width: 44px; height: 44px; cursor: none; transition: .25s;
}
#oracle-close:hover { border-color: var(--blood); color: var(--blood); }
.oracle-stage {
  position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start; padding: 8vh 20px 4vh; text-align: center;
}
.oracle-core { position: relative; width: min(30vh, 240px); height: min(30vh, 240px); display: flex; align-items: center; justify-content: center; }
.oracle-ring {
  position: absolute; inset: -8%; border-radius: 50%;
  border: 1px solid rgba(211, 26, 37, .35);
  animation: spin 24s linear infinite;
  background:
    radial-gradient(circle, transparent 62%, rgba(211,26,37,.06) 70%, transparent 78%);
}
.oracle-ring::before { content: ""; position: absolute; top: -4px; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--blood); box-shadow: 0 0 14px var(--blood); }
@keyframes spin { to { transform: rotate(360deg); } }
#oracle-sigil { width: 62%; transition: transform .08s linear; will-change: transform, filter; }
#oracle-status {
  margin-top: 4vh; font-family: var(--font-display); font-size: 14px; letter-spacing: .45em;
  color: var(--blood); animation: flicker 5s infinite; min-height: 20px;
}
#oracle-captions {
  margin-top: 3vh; max-width: 720px; width: 100%; flex: 1; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
}
.cap { font-size: 17px; line-height: 1.6; animation: rise .3s ease; }
.cap.user { color: var(--smoke); font-size: 15px; }
.cap.user::before { content: "YOU — "; font-size: 10px; letter-spacing: .3em; color: #565060; }
.cap.oracle { color: var(--bone); font-style: italic; text-shadow: 0 0 30px rgba(211,26,37,.25); }
.oracle-controls { margin-top: 3vh; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center; width: 100%; max-width: 640px; }
.oracle-btn {
  background: #0a090b; border: 1px solid var(--blood-deep); color: var(--bone); padding: 12px 18px;
  font-family: var(--font-ui); font-weight: 700; letter-spacing: .14em; font-size: 12px; cursor: none; transition: .25s;
}
.oracle-btn:hover { border-color: var(--blood); box-shadow: 0 0 16px rgba(211,26,37,.3); }
#oracle-form { display: flex; gap: 10px; flex: 1; min-width: 260px; }
#oracle-text { flex: 1; }
.oracle-note { margin-top: 2.5vh; font-size: 11px; letter-spacing: .12em; color: #565060; max-width: 560px; }

/* ---------- BLOOD MODE (easter egg) ---------- */
body.blood-mode { animation: bloodshake .4s; }
body.blood-mode .hero-bg { filter: hue-rotate(-10deg) saturate(1.6) brightness(.8); }
body.blood-mode::after {
  content: ""; position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(122, 6, 12, .38) 100%);
  animation: pulse 2s infinite;
}
@keyframes bloodshake { 0%,100% { transform: none;} 20% { transform: translate(-8px, 4px);} 40% { transform: translate(6px, -6px);} 60% { transform: translate(-4px, -2px);} 80% { transform: translate(4px, 4px);} }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav-links a:not(.btn), #audio-toggle { display: none; }
  .hero-stats { gap: 30px; }
  .section { padding: 80px 6vw; }
}
