/* amor.to — the chamber.
   Warm-violet black; the crystal is the only light source. Gold appears for
   exactly one reason: both of you are here at once. */

:root {
  --void: #0b0910;
  --breath: #16121e;
  --moon: #cfc9d9;
  --whisper-ink: #6f6880;
  --gold: #e8c37a;
  --display: "Didot", "Bodoni 72", "Hoefler Text", "Iowan Old Style", serif;
  --sans: "Avenir Next", "Helvetica Neue", Inter, -apple-system, "Segoe UI", sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Code", "JetBrains Mono", monospace;
  --bloom-hue: 300;
  --bloom-alpha: 0;
  --bloom-x: 50%;
  --bloom-y: 62%;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--moon);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  touch-action: none;
  overscroll-behavior: none;
}

/* ---- the bloom: the synesthetic pulse made visible ---- */

#bloom {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    120vmax circle at var(--bloom-x) var(--bloom-y),
    hsl(var(--bloom-hue) 65% 62% / var(--bloom-alpha)),
    hsl(var(--bloom-hue) 70% 40% / calc(var(--bloom-alpha) * 0.4)) 30%,
    transparent 62%
  );
  transition: background 700ms ease;
}

body.sync #bloom {
  background: radial-gradient(
    120vmax circle at var(--bloom-x) var(--bloom-y),
    hsl(43 72% 66% / calc(var(--bloom-alpha) + 0.18)),
    hsl(38 65% 45% / calc(var(--bloom-alpha) * 0.5)) 34%,
    transparent 66%
  );
}

/* ---- the halo: a thin gold ring at the edge while they are present ---- */

#halo {
  position: fixed;
  inset: 10px;
  border-radius: 28px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  box-shadow: inset 0 0 34px 2px hsl(43 70% 65% / 0.28);
  transition: opacity 2.4s ease;
}

body.present #halo { opacity: 1; }

/* While they're here, the whole chamber warms a degree or two. */
body.present {
  background: var(--void-warm);
}

/* ---- chamber styles: the room around the artifact, chosen per device ---- */

:root {
  --void-warm: #100c12;
}

html[data-theme="dawn"] {
  --void: #171110;
  --void-warm: #1c1513;
  --breath: #221917;
  --moon: #ddd1cc;
  --whisper-ink: #8a7a73;
}

html[data-theme="sea"] {
  --void: #090e15;
  --void-warm: #0d131c;
  --breath: #131a24;
  --moon: #c9d4de;
  --whisper-ink: #64738a;
}

html[data-theme="moss"] {
  --void: #0b110c;
  --void-warm: #0f1610;
  --breath: #151d17;
  --moon: #cdd8cd;
  --whisper-ink: #6c7f6e;
}

html[data-theme="ember"] {
  --void: #150d09;
  --void-warm: #1a110c;
  --breath: #21150f;
  --moon: #ded0c3;
  --whisper-ink: #8d7863;
}

/* ---- shared card layout (welcome / invite / join) ---- */

.card {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  text-align: center;
  padding: 2rem calc(1.4rem + env(safe-area-inset-left)) calc(2rem + env(safe-area-inset-bottom));
}

.card.visible { display: flex; }

.wordmark {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3.4rem, 14vw, 5.2rem);
  letter-spacing: 0.04em;
  color: var(--moon);
  text-shadow: 0 0 42px hsl(280 45% 55% / 0.35);
}

.lede {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  color: var(--moon);
}

.body-copy {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--whisper-ink);
  max-width: 26rem;
}

.token {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--moon);
  background: var(--breath);
  border: 1px solid #2a2438;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  max-width: min(86vw, 30rem);
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}

.row { display: flex; gap: 0.8rem; flex-wrap: wrap; justify-content: center; }

.action {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: var(--void);
  background: var(--moon);
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.7rem;
  cursor: pointer;
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.action:hover { box-shadow: 0 0 26px hsl(280 40% 60% / 0.35); }
.action:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.action:active { transform: scale(0.97); }

.action.quiet {
  background: transparent;
  color: var(--moon);
  border: 1px solid #37304a;
}

.hidden { display: none !important; }

/* ---- the chamber ---- */

#chamber {
  position: fixed;
  inset: 0;
  display: none;
}

#chamber.visible { display: block; }

#stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
}

#crystal {
  width: 100%;
  height: 100%;
  display: block;
}

#whisper {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(3.4rem + env(safe-area-inset-bottom));
  z-index: 3;
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--whisper-ink);
  opacity: 0;
  transition: opacity 1.6s ease;
  pointer-events: none;
  padding: 0 2rem;
}

#whisper.visible { opacity: 1; }

#corner {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 4;
  width: 72px;
  height: 72px;
  background: transparent;
  border: none;
  cursor: pointer;
}

#corner:focus-visible {
  outline: 1px solid var(--whisper-ink);
  outline-offset: -12px;
  border-radius: 50%;
}

/* ---- settings veil ---- */

.veil {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: hsl(258 25% 4% / 0.72);
  backdrop-filter: blur(7px) saturate(1.1);
}

.veil.visible { display: flex; }

.sheet {
  width: min(100%, 26rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.6rem 1.4rem calc(2rem + env(safe-area-inset-bottom));
  background: var(--breath);
  border-radius: 22px 22px 0 0;
  text-align: center;
}

/* The mood calendar: fourteen days, one glowing dot each. */
#mood-calendar {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  min-height: 0.7rem;
}

.mood-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  box-shadow: 0 0 8px 1px currentColor;
}

/* Chamber style + voice pickers in the sheet. */
.picker-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
}

.picker-label {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--whisper-ink);
}

.theme-dot {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  border: 1px solid #3a3350;
  cursor: pointer;
  padding: 0;
}

.theme-dot.active {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.voice-chip {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--moon);
  background: transparent;
  border: 1px solid #37304a;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

.voice-chip.active {
  border-color: var(--gold);
  color: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
  #bloom, #halo, .action { transition: none; }
}
