/* Radiant Frequencies — sanctuary styles
   Dark cosmic base. Every room recolors the space via CSS custom properties
   (--deep / --glow / --light) set from rooms.js. All motion is slow by design. */

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

:root {
  --deep: #0d0b14;
  --glow: #8f5fc4;
  --light: #e6d4f7;
  --ink: #efeaf6;
  --ink-dim: rgba(239, 234, 246, 0.62);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Segoe UI", system-ui, sans-serif;
}

html, body {
  background: var(--deep);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--glow) 26%, transparent), transparent 60%),
    radial-gradient(90% 70% at 50% 110%, color-mix(in srgb, var(--glow) 14%, transparent), transparent 55%),
    var(--deep);
  transition: background 2.5s ease;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ——— shared type ——— */
h1, h2, .serif { font-family: var(--serif); font-weight: 500; }
.kicker {
  font-size: 0.72rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ink-dim);
}

/* ——— the map (index) ——— */
.portal {
  max-width: 1060px; margin: 0 auto; padding: 0 1.4rem 4rem;
  text-align: center;
}
/* the arrival: ascent art glowing faintly behind the title */
.portal-head {
  position: relative; padding: 5.5rem 1rem 3.4rem; margin: 0 -1.4rem 1rem;
  overflow: hidden;
}
.portal-head::before {
  content: ""; position: absolute; inset: 0;
  background: url("../assets/img/ascent-hero.jpg") center 30% / cover no-repeat;
  opacity: 0.22;
  -webkit-mask-image: radial-gradient(75% 90% at 50% 40%, #000 30%, transparent 100%);
  mask-image: radial-gradient(75% 90% at 50% 40%, #000 30%, transparent 100%);
}
.portal-head > * { position: relative; }
.portal h1 {
  font-size: clamp(2.6rem, 7vw, 4.2rem); letter-spacing: 0.04em; margin: 0.7rem 0 0.4rem;
  text-shadow: 0 2px 30px rgba(0,0,0,0.65);
}
.portal .invite {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.05rem, 2.6vw, 1.3rem); color: var(--ink-dim);
  max-width: 34em; margin: 0 auto;
}

.realm { margin-top: 2.8rem; }
.realm .kicker { display: block; margin-bottom: 1.1rem; }

.rooms {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* The Seven — all seven visible at once: 4 over 3, the bottom row centered,
   reading order walks root→crown. (Robyn's call: nothing hidden behind a scroll.) */
.rooms[data-realm="solfeggio"] {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem;
}
.rooms[data-realm="solfeggio"] .room-tile {
  flex: 0 0 calc(25% - 0.75rem);
}
/* phones: 4-across would shrink the art to postage stamps — become a swipe
   carousel instead (native gesture, snap per card, right edge fades to invite) */
@media (max-width: 640px) {
  .rooms[data-realm="solfeggio"] {
    flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; scroll-snap-type: x mandatory;
    padding-bottom: 0.8rem;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent);
    mask-image: linear-gradient(90deg, #000 90%, transparent);
  }
  .rooms[data-realm="solfeggio"] .room-tile {
    flex: 0 0 62vw;
    scroll-snap-align: center;
  }
}

.room-tile {
  position: relative; border-radius: 14px; overflow: hidden;
  aspect-ratio: 3 / 4; display: flex; flex-direction: column; justify-content: flex-end;
  background: #141020; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.07);
  transition: transform 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}
.room-tile img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.5; transition: opacity 0.6s ease, transform 6s ease;
}
.room-tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(5,4,10,0.92) 8%, rgba(5,4,10,0.15) 55%, transparent);
}
.room-tile:hover { transform: translateY(-4px); border-color: var(--tile-glow, var(--glow)); box-shadow: 0 12px 40px -14px var(--tile-glow, var(--glow)); }
.room-tile:hover img { opacity: 0.72; transform: scale(1.04); }
.room-tile .label {
  position: relative; z-index: 1; padding: 0 0.9rem 0.9rem; text-align: left;
}
.room-tile .hz { font-size: 0.7rem; letter-spacing: 0.22em; color: var(--tile-light, var(--light)); text-transform: uppercase; }
.room-tile .room-name { font-family: var(--serif); font-size: 1.22rem; margin-top: 0.15rem; }

/* the rising path: each of The Seven wears its chakra color as a thread,
   so the row reads red→violet — a ladder, not a shelf */
.rooms[data-realm="solfeggio"] .room-tile::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--tile-glow), transparent);
  z-index: 1; opacity: 0.9;
}

/* locked rooms tease — the art stays beautiful behind the veil */
.room-tile.locked img { opacity: 0.42; filter: saturate(0.75); }
.room-tile.locked .lock {
  position: absolute; top: 0.7rem; right: 0.8rem; z-index: 1;
  font-size: 0.85rem; opacity: 0.85;
}
.room-tile.locked:hover { transform: none; }
.room-tile.locked:hover img { opacity: 0.6; }

/* the Ascent banner tile */
.ascent-tile {
  margin-top: 3rem; position: relative; border-radius: 18px; overflow: hidden;
  min-height: 200px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.1); cursor: pointer;
  transition: box-shadow 0.6s ease, border-color 0.6s ease;
}
.ascent-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.4; }
.ascent-tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(35,13,13,0.82), rgba(26,16,36,0.82) 70%, rgba(230,212,247,0.14));
}
.ascent-tile .label { position: relative; z-index: 1; text-align: center; padding: 2rem 1.2rem; }
.ascent-tile .room-name { font-family: var(--serif); font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
.ascent-tile .sub { color: var(--ink-dim); margin-top: 0.35rem; font-size: 0.95rem; }
.ascent-tile:hover { border-color: #c9a9ee; box-shadow: 0 14px 60px -18px #8f5fc4; }

/* ——— a room ——— */
.chamber {
  min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 2rem 1.4rem 3rem; position: relative;
}
.back {
  position: absolute; top: 1.1rem; left: 1.2rem; font-size: 0.8rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-dim);
  z-index: 3;
}
.back:hover { color: var(--ink); }

.orb-wrap { position: relative; width: min(58vw, 300px); aspect-ratio: 1; margin-bottom: 2rem; }
.orb-glow {
  position: absolute; inset: -22%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--glow) 55%, transparent), transparent 70%);
  animation: breathe 9s ease-in-out infinite;
}
.orb {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--light) 40%, transparent);
  box-shadow: 0 0 90px -18px var(--glow);
  animation: breathe 9s ease-in-out infinite;
}
.orb img, .orb video { width: 100%; height: 100%; object-fit: cover; }
.orb video { position: absolute; inset: 0; }
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.045); }
}

.chamber .hz-big { font-size: 0.78rem; letter-spacing: 0.35em; text-transform: uppercase; color: var(--light); }
.chamber h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 0.4rem 0 1.1rem; }
.chamber .affirm {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.15rem, 3.2vw, 1.5rem); max-width: 26em; line-height: 1.55;
}
.chamber .reflect {
  color: var(--ink-dim); max-width: 36em; line-height: 1.7;
  margin-top: 1rem; font-size: 0.98rem;
}
/* the room speaks its reflection only once the tone begins */
.chamber .reflect.quiet {
  opacity: 0; transition: opacity 2.5s ease 1s;
}
.chamber .reflect.quiet.revealed { opacity: 1; }
.headphones {
  margin-top: 1rem; font-size: 0.85rem; color: var(--light); opacity: 0.85;
}

/* controls */
.controls { margin-top: 2.2rem; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.begin {
  font-family: var(--sans); font-size: 0.95rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink); background: transparent;
  border: 1px solid color-mix(in srgb, var(--light) 55%, transparent);
  border-radius: 999px; padding: 0.95rem 2.6rem; cursor: pointer;
  transition: background 0.5s ease, box-shadow 0.5s ease;
}
.begin:hover { background: color-mix(in srgb, var(--glow) 22%, transparent); box-shadow: 0 0 40px -10px var(--glow); }
.timers { display: flex; gap: 0.6rem; }
.timers button {
  background: transparent; color: var(--ink-dim); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px; padding: 0.4rem 1rem; font-size: 0.8rem; cursor: pointer;
  transition: all 0.3s ease;
}
.timers button.active, .timers button:hover { color: var(--ink); border-color: var(--light); }
.timeleft { font-size: 0.85rem; color: var(--ink-dim); letter-spacing: 0.1em; min-height: 1.2em; }

.volume { display: flex; align-items: center; gap: 0.6rem; color: var(--ink-dim); font-size: 0.8rem; }
.volume input[type=range] { width: 140px; accent-color: var(--glow); }

/* ——— the gate (email veil) ——— */
.veil {
  position: fixed; inset: 0; z-index: 20; display: none;
  align-items: center; justify-content: center;
  background: rgba(6, 5, 12, 0.82); backdrop-filter: blur(10px);
  padding: 1.4rem;
}
.veil.open { display: flex; }
.veil-card {
  max-width: 26rem; width: 100%; text-align: center;
  background: #14101f; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px; padding: 2.4rem 1.8rem;
  box-shadow: 0 30px 80px -20px rgba(143, 95, 196, 0.45);
}
.veil-card h2 { font-size: 1.7rem; margin: 0.5rem 0 0.8rem; }
.veil-card p { color: var(--ink-dim); font-size: 0.95rem; line-height: 1.65; margin-bottom: 1.4rem; }
.veil-card input[type=email] {
  width: 100%; padding: 0.85rem 1rem; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.05);
  color: var(--ink); font-size: 1rem; margin-bottom: 0.8rem; font-family: var(--sans);
}
.veil-card input[type=email]:focus { outline: none; border-color: var(--glow); }
.veil-card button[type=submit] {
  width: 100%; padding: 0.9rem; border-radius: 10px; border: none; cursor: pointer;
  background: linear-gradient(120deg, #8f5fc4, #b87c3f); color: #fff;
  font-size: 0.92rem; letter-spacing: 0.14em; text-transform: uppercase; font-family: var(--sans);
}
.veil-card .later { display: inline-block; margin-top: 1rem; font-size: 0.82rem; color: var(--ink-dim); cursor: pointer; }
.veil-card .later:hover { color: var(--ink); }

/* ——— the Ascent page ——— */
.ascent-stage { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem 1.4rem 3rem; position: relative; }
.ascent-progress {
  display: flex; gap: 0.55rem; margin-bottom: 2rem;
}
.ascent-progress span {
  width: 12px; height: 12px; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.8s ease;
}
.ascent-progress span.lit { background: var(--glow); box-shadow: 0 0 14px var(--glow); border-color: var(--light); }
.ascent-stage .step-count { font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 0.6rem; }

/* ——— the threshold (one breath before the room) ——— */
.threshold {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #060409;
  opacity: 1; transition: opacity 1.3s ease; cursor: pointer;
}
.threshold.gone { opacity: 0; pointer-events: none; }
.breath-orb {
  width: 92px; height: 92px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--light) 55%, transparent);
  box-shadow: 0 0 60px -8px var(--glow), inset 0 0 30px -10px var(--glow);
  animation: one-breath 7s ease-in-out 1 forwards;
}
@keyframes one-breath {
  0%   { transform: scale(0.55); opacity: 0.45; }
  50%  { transform: scale(1.3);  opacity: 1; }    /* the inhale */
  100% { transform: scale(0.6);  opacity: 0.55; } /* the exhale */
}
.threshold .invite-line {
  margin-top: 1.8rem; font-style: italic;
  font-size: 1.15rem; color: var(--ink-dim); letter-spacing: 0.06em;
}
.threshold .skip-hint {
  position: absolute; bottom: 2rem;
  font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: rgba(239,234,246,0.3);
}

/* ——— footer ——— */
.sanctum-foot {
  text-align: center; padding: 2.2rem 1.4rem 2.8rem; color: var(--ink-dim);
  font-size: 0.78rem; line-height: 1.8;
}
.sanctum-foot .rule { opacity: 0.75; max-width: 40em; margin: 0.4rem auto 0; }

@media (max-width: 560px) {
  .rooms { grid-template-columns: repeat(2, 1fr); }
  .portal { padding-top: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .orb, .orb-glow { animation: none; }
  .room-tile, .room-tile img { transition: none; }
}
