/* OCTAVE — styles. Dark universe, per-realm accents via CSS custom props. */

:root {
  --accent: #8b7bd8;
  --accent2: #4a90d9;
  --ink: #ece9f6;
  --bg: #060510;
  --dur: 900ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

body { transition: color var(--dur) var(--ease); }

#gl, #fallback-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}
#fallback-bg {
  background: radial-gradient(120% 120% at 30% 20%, color-mix(in oklab, var(--accent) 35%, transparent), transparent 60%),
              radial-gradient(100% 100% at 75% 80%, color-mix(in oklab, var(--accent2) 30%, transparent), transparent 55%),
              var(--bg);
  transition: background 1.2s var(--ease);
}

/* ---------- chrome ---------- */
#chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.6rem;
  z-index: 30;
  pointer-events: none;
}
#chrome > * { pointer-events: auto; }

.wordmark {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.35em;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.3s, text-shadow 0.3s;
}
.wordmark:hover { opacity: 1; text-shadow: 0 0 18px var(--accent); }

#realm-dots { display: flex; gap: 0.55rem; }
#realm-dots button {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  padding: 0;
}
#realm-dots button:hover { transform: scale(1.5); }
#realm-dots button.on {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.chip {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s var(--ease);
}
.chip:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px color-mix(in oklab, var(--accent) 45%, transparent);
  transform: translateY(-1px);
}
.chip.ghost { background: transparent; border-color: rgba(255,255,255,0.12); }

/* ---------- views ---------- */
.view {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: none;
  opacity: 0;
}
.view.active { display: flex; animation: viewIn var(--dur) var(--ease) forwards; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- hero ---------- */
#hero {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  gap: 0.6rem;
}

.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  opacity: 0.65;
  font-weight: 500;
}
#daily-kicker b { color: var(--accent); font-weight: 600; }
#daily-kicker { cursor: pointer; transition: opacity 0.3s; }
#daily-kicker:hover { opacity: 1; }

.title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 10.5vw, 7.6rem);
  letter-spacing: 0.06em;
  max-width: 100vw;
  line-height: 0.95;
  background: linear-gradient(100deg, #fff 10%, var(--accent) 45%, var(--accent2) 70%, #fff 95%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 9s linear infinite;
  filter: drop-shadow(0 0 30px color-mix(in oklab, var(--accent) 30%, transparent));
}
@keyframes shimmer { to { background-position: 300% 0; } }

.subtitle {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.95rem, 2.4vw, 1.25rem);
  opacity: 0.75;
  margin-bottom: 2.2rem;
}

#constellation {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.4rem;
  max-width: 900px;
}
#constellation button {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: clamp(1.15rem, 3.4vw, 1.9rem);
  letter-spacing: 0.02em;
  background: none;
  border: none;
  color: var(--ink);
  opacity: 0.55;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  transition: all 0.35s var(--ease);
  position: relative;
}
#constellation button:hover, #constellation button:focus-visible {
  opacity: 1;
  color: var(--hover-accent, var(--accent));
  text-shadow: 0 0 26px var(--hover-accent, var(--accent));
  transform: translateY(-3px) scale(1.04);
}
#constellation button.today::after {
  content: '✦ today';
  position: absolute;
  top: -0.55rem; right: -1.1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  opacity: 0.9;
}

.hint {
  margin-top: 2.8rem;
  font-size: 0.8rem;
  opacity: 0.45;
  font-weight: 300;
}
.hint .key { color: var(--accent); opacity: 1; }

/* ---------- realm ---------- */
#realm { padding: 7rem 1.5rem 5rem; justify-content: center; }
.realm-inner { max-width: 1060px; width: 100%; margin: 0 auto; }

.realm-epithet { color: var(--accent); opacity: 0.95; margin-bottom: 0.8rem; }

.realm-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  margin-bottom: 1.6rem;
  background: linear-gradient(95deg, var(--ink) 20%, var(--accent) 75%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 24px color-mix(in oklab, var(--accent) 35%, transparent));
}

.realm-essence {
  font-family: 'Fraunces', serif;
  font-weight: 340;
  font-size: clamp(1.02rem, 2.2vw, 1.22rem);
  line-height: 1.75;
  max-width: 62ch;
  opacity: 0.92;
  margin-bottom: 1.2rem;
}

.realm-signature {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 0.98rem;
  color: var(--accent);
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  max-width: 58ch;
  opacity: 0.95;
  margin-bottom: 3rem;
}

.realm-columns {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 3rem;
}
@media (max-width: 820px) { .realm-columns { grid-template-columns: 1fr; } }

.col-title {
  font-family: 'Syne', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 1.3rem;
}
.cuts-title { margin-top: 2rem; }

/* timeline */
.era-timeline { list-style: none; position: relative; padding-left: 1.6rem; }
.era-timeline::before {
  content: '';
  position: absolute;
  left: 0.3rem; top: 0.4rem; bottom: 0.4rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}
.era-timeline li { position: relative; margin-bottom: 1.35rem; }
.era-timeline li::before {
  content: '';
  position: absolute;
  left: -1.44rem; top: 0.42rem;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.era-year {
  font-family: 'Syne', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  display: block;
}
.era-title a {
  font-family: 'Fraunces', serif;
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.25s;
}
.era-title a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.era-note { font-size: 0.84rem; opacity: 0.62; line-height: 1.5; margin-top: 0.15rem; font-weight: 300; }

/* player */
.player-slot iframe {
  width: 100%;
  height: 360px;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 12px 50px color-mix(in oklab, var(--accent) 22%, transparent);
}
.player-note { font-size: 0.72rem; opacity: 0.4; margin-top: 0.5rem; }

/* deep cuts */
.deep-cuts { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.deep-cuts a {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--ink);
  text-decoration: none;
  padding: 0.42rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  transition: all 0.25s var(--ease);
}
.deep-cuts a:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 16px color-mix(in oklab, var(--accent) 40%, transparent);
  transform: translateY(-2px);
}

.realm-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
}

/* ---------- mood overlay ---------- */
#mood-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 3, 12, 0.72);
  backdrop-filter: blur(18px);
  animation: fadeIn 0.35s var(--ease);
}
#mood-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }

.mood-card { text-align: center; padding: 2rem; width: min(640px, 94vw); }
.mood-card .kicker { margin-bottom: 1.6rem; }

#mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.6rem;
}
#mood-grid button {
  font-family: 'Inter', sans-serif;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  color: var(--ink);
  padding: 1rem 0.8rem;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: center;
}
#mood-grid button:hover {
  border-color: var(--accent);
  box-shadow: 0 0 22px color-mix(in oklab, var(--accent) 35%, transparent);
  transform: translateY(-3px);
}
#mood-grid .m-emoji { font-size: 1.5rem; }
#mood-grid .m-label { font-size: 0.85rem; font-weight: 600; }
#mood-grid .m-blurb { font-size: 0.68rem; opacity: 0.55; font-weight: 300; }

/* ---------- main nav ---------- */
#main-nav { display: flex; gap: 0.35rem; }
#main-nav button {
  font-family: 'Syne', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.55;
  background: none;
  border: none;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.3s var(--ease);
}
#main-nav button:hover { opacity: 1; }
#main-nav button.on {
  opacity: 1;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 16px color-mix(in oklab, var(--accent) 35%, transparent);
}
.chrome-right { display: flex; gap: 0.5rem; align-items: center; }

.orbit-tease {
  margin-top: 2rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--ink);
  background: rgba(255,255,255,0.05);
  border: 1px solid color-mix(in oklab, var(--accent) 55%, transparent);
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s var(--ease);
  animation: teasePulse 3.5s ease-in-out infinite;
}
.orbit-tease b { color: var(--accent); }
.orbit-tease:hover { transform: translateY(-2px); box-shadow: 0 0 26px color-mix(in oklab, var(--accent) 45%, transparent); }
@keyframes teasePulse { 50% { border-color: color-mix(in oklab, var(--accent) 90%, transparent); } }

/* ---------- app pages (orbit/forge/auditions/connect) ---------- */
.page-inner { max-width: 1020px; width: 100%; margin: 0 auto; padding: 7rem 1.5rem 5rem; }
#orbit, #forge, #auditions, #connect { justify-content: center; }

.view-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.6rem);
  margin: 0.6rem 0 1.4rem;
  background: linear-gradient(95deg, var(--ink) 25%, var(--accent) 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.view-sub { font-family: 'Fraunces', serif; font-weight: 340; font-size: 1.05rem; line-height: 1.7; opacity: 0.85; max-width: 64ch; margin-bottom: 2.2rem; }
.view-sub b { color: var(--accent); }

.orbit-story {
  font-family: 'Fraunces', serif;
  max-width: 68ch;
  margin-bottom: 2.6rem;
}
.story-title { font-family: 'Fraunces', serif; font-style: italic; font-weight: 600; font-size: 1.35rem; color: var(--accent); margin-bottom: 0.9rem; }
.orbit-story p { font-weight: 340; font-size: 1.04rem; line-height: 1.8; opacity: 0.92; margin-bottom: 1rem; }

.orbit-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.6rem; margin-bottom: 2rem; }
@media (max-width: 820px) { .orbit-grid { grid-template-columns: 1fr; } }
.orbit-side { display: flex; flex-direction: column; gap: 1.6rem; }

.orbit-card {
  background: rgba(8, 6, 20, 0.55);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 18px;
  padding: 1.5rem 1.6rem;
  backdrop-filter: blur(14px);
}
.card-vibe { font-family: 'Fraunces', serif; font-style: italic; font-size: 0.9rem; opacity: 0.7; margin-bottom: 1rem; }
.card-body { font-size: 0.92rem; line-height: 1.65; opacity: 0.85; margin-bottom: 1rem; font-weight: 300; }

.tracklist { list-style: none; margin-bottom: 1.2rem; }
.tracklist li { display: flex; align-items: baseline; gap: 0.8rem; padding: 0.42rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.tr-num { font-family: 'Syne', sans-serif; font-size: 0.65rem; color: var(--accent); opacity: 0.8; }
.tracklist a { text-decoration: none; display: flex; flex-direction: column; }
.tr-title { color: var(--ink); font-size: 0.94rem; font-weight: 500; transition: color 0.2s; }
.tr-artist { font-size: 0.72rem; opacity: 0.55; color: var(--ink); }
.tracklist a:hover .tr-title { color: var(--accent); }

.create-status { font-size: 0.78rem; opacity: 0.75; margin-top: 0.6rem; min-height: 1em; }
.create-status a { color: var(--accent); }
.orbit-foot { margin-top: 1rem; font-size: 0.85rem; opacity: 0.7; }
.linklike { background: none; border: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
.linklike:hover { text-decoration: underline; }

/* trivia */
.trivia-q { font-family: 'Fraunces', serif; font-size: 1.02rem; margin-bottom: 1rem; line-height: 1.5; }
.trivia-opts { display: grid; gap: 0.5rem; margin-bottom: 0.8rem; }
.trivia-opts button {
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: var(--ink);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.trivia-opts button:hover:not(:disabled) { border-color: var(--accent); transform: translateX(3px); }
.trivia-opts button.right { border-color: #4ade80; background: rgba(74, 222, 128, 0.12); }
.trivia-opts button.wrong { border-color: #f87171; background: rgba(248, 113, 113, 0.12); opacity: 0.8; }
.trivia-why { font-size: 0.82rem; opacity: 0.75; line-height: 1.55; font-weight: 300; }
#streak-badge { color: var(--accent); }

/* forge */
.forge-controls { display: flex; flex-direction: column; gap: 0.9rem; margin-bottom: 2.4rem; }
.forge-row { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.forge-label { font-family: 'Syne', sans-serif; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; opacity: 0.55; min-width: 64px; }
.fchip {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--ink);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  margin: 0.15rem 0.25rem 0.15rem 0;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.fchip:hover { border-color: var(--accent); }
.fchip.on { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 22%, transparent); box-shadow: 0 0 14px color-mix(in oklab, var(--accent) 35%, transparent); }
.forge-out { max-width: 620px; }
.forge-out-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.6rem; }
.forge-create { border-color: var(--accent); }

/* auditions */
.audition-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem; }
.audition-card {
  background: rgba(8, 6, 20, 0.55);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 18px;
  padding: 1.4rem 1.5rem;
  backdrop-filter: blur(14px);
  transition: all 0.3s var(--ease);
  border-top: 2px solid var(--cand);
}
.audition-card:hover { transform: translateY(-3px); box-shadow: 0 14px 40px color-mix(in oklab, var(--cand) 22%, transparent); }
.audition-card.voted-keep { border-color: var(--cand); box-shadow: 0 0 24px color-mix(in oklab, var(--cand) 30%, transparent); }
.audition-card.voted-pass { opacity: 0.45; }
.aud-lane { font-size: 0.68rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--cand); margin-bottom: 0.35rem; }
.aud-name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.5rem; margin-bottom: 0.6rem; }
.aud-pitch { font-size: 0.88rem; line-height: 1.6; opacity: 0.82; font-weight: 300; margin-bottom: 0.9rem; }
.audition-card .deep-cuts { margin-bottom: 0.9rem; }
.aud-embed iframe { width: 100%; height: 250px; border: 0; border-radius: 12px; margin-top: 0.8rem; }
.aud-votes { display: flex; gap: 0.6rem; margin-top: 0.9rem; }
.vote {
  flex: 1;
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.6rem;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  transition: all 0.25s var(--ease);
}
.vote.keep:hover, .vote.keep.on { border-color: var(--cand); background: color-mix(in oklab, var(--cand) 25%, transparent); }
.vote.pass:hover, .vote.pass.on { opacity: 0.9; border-color: rgba(255,255,255,0.35); }

/* connect */
.setup-steps { margin: 0 0 1.6rem 1.2rem; max-width: 64ch; }
.setup-steps li { font-size: 0.94rem; line-height: 1.7; margin-bottom: 0.8rem; font-weight: 300; }
.setup-steps a, .setup-steps b { color: var(--accent); }
.setup-steps code {
  background: rgba(255,255,255,0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85em;
  user-select: all;
}
.connect-row { display: flex; gap: 0.7rem; max-width: 520px; margin-bottom: 0.8rem; }
.connect-row input {
  flex: 1;
  font-family: 'Inter', monospace;
  font-size: 0.88rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: var(--ink);
  padding: 0.6rem 1.1rem;
  outline: none;
}
.connect-row input:focus { border-color: var(--accent); }
.top-artists { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.top-artist {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; color: var(--ink);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 999px;
  padding: 0.35rem 0.9rem 0.35rem 0.35rem;
  font-size: 0.84rem;
  transition: all 0.25s var(--ease);
}
.top-artist:hover { border-color: var(--accent); transform: translateY(-2px); }
.top-artist img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .title { animation: none; }
  .view.active { animation-duration: 1ms; }
}
