:root {
  --ground: #07080c;
  --text: #e9ecf2;
  --muted: #8a91a1;
  --cold: #9ddafe;
  --warm: #f3c898;
  --hair: rgba(233, 236, 242, 0.32);
  --gap: clamp(10px, 1.6vw, 24px);
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); }
a { color: var(--text); }
a:hover { color: var(--warm); }
button { font-family: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--warm); outline-offset: 4px; }
::selection { background: var(--warm); color: var(--ground); }

.page {
  position: relative;
  overflow: hidden;
  background: var(--ground);
  color: var(--text);
  font-family: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 300;
}

.axis {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, rgba(233, 236, 242, 0) 0px, rgba(233, 236, 242, 0.7) 28px, rgba(233, 236, 242, 0.7) calc(100% - 110px), rgba(233, 236, 242, 0) 100%);
  box-shadow: -1px 0 0 rgba(157, 218, 254, 0.3), 1px 0 0 rgba(243, 200, 152, 0.3), 0 0 26px rgba(233, 236, 242, 0.32);
  animation: breathe 7s ease-in-out infinite;
}

/* Everything splits around the axis. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  column-gap: var(--gap);
  align-items: baseline;
  margin: 0;
}
.left { text-align: right; }
.right { text-align: left; }
.cold { color: var(--cold); }
.warm { color: var(--warm); }
.muted { color: var(--muted); }
.center { display: flex; justify-content: center; }

.mono {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.mono-left { margin-right: -0.18em; }

.stack {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(36px, 5vw, 64px);
}
.stack.wide { gap: clamp(64px, 9vw, 128px); }
.stack .stack { max-width: none; margin: 0; }

.line {
  font-weight: 300;
  font-size: clamp(17px, 2.6vw, 36px);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.line span { text-wrap: balance; }

.node {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  background: var(--ground);
  border: 1px solid var(--hair);
  border-radius: 50%;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.node.bare { background: none; border: 0; }
.node svg { grid-area: 1 / 1; }

/* Stacked words: all share one cell, one is visible. */
.layers { display: grid; margin: 0; padding: 0; list-style: none; }
.layers > * { grid-area: 1 / 1; }

/* First screen */
.hero {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: clamp(600px, 56vw, 820px);
  padding: clamp(20px, 2.4vw, 32px) clamp(20px, 5vw, 72px) clamp(24px, 4vw, 52px);
  background:
    radial-gradient(44% 48% at 24% 54%, rgba(120, 190, 255, 0.11), rgba(120, 190, 255, 0) 72%),
    radial-gradient(44% 48% at 76% 54%, rgba(255, 184, 120, 0.1), rgba(255, 184, 120, 0) 72%);
}
.hero-middle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 2vw, 26px);
}
.wordmark {
  font-weight: 200;
  font-size: clamp(44px, 9vw, 128px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.nudge { animation: nudge 2.4s ease-in-out infinite; }

/* Mirror */
.mirror {
  box-sizing: border-box;
  padding: clamp(72px, 10vw, 144px) clamp(20px, 5vw, 72px);
}
.pair {
  align-items: start;
  font-weight: 200;
  font-size: clamp(30px, 6.2vw, 88px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.seen, .woken { transition: opacity 0.9s ease, filter 0.9s ease; }
.seen { justify-items: end; color: var(--cold); opacity: 1; filter: blur(0em); }
.woken { justify-items: start; color: var(--warm); opacity: 0.6; filter: blur(0.03em); }
.mirror[data-focus="me"] .seen { opacity: 0.45; filter: blur(0.05em); }
.mirror[data-focus="me"] .woken { opacity: 1; filter: blur(0em); }

.pair li { opacity: 0; filter: blur(0.14em); }
.seen li { transition: opacity 0.4s ease, filter 0.4s ease; }
.seen li.on { opacity: 1; filter: blur(0em); transition: opacity 0.8s ease 0.35s, filter 0.8s ease 0.35s; }
.woken li { transition: opacity 0.4s ease 0.5s, filter 0.4s ease 0.5s; }
.woken li.on { opacity: 1; filter: blur(0em); transition: opacity 0.9s ease 0.9s, filter 0.9s ease 0.9s; }

.focus { align-items: center; }
.focus-left { display: flex; justify-content: flex-end; align-items: center; gap: 14px; }
.focus-right { display: flex; justify-content: flex-start; align-items: center; }
.toggle {
  min-width: 72px;
  height: 44px;
  margin: 0;
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 0;
  color: var(--text);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}
.toggle[aria-pressed="true"] { color: var(--ground); }
.toggle[data-focus-on="you"][aria-pressed="true"] { background: var(--cold); }
.toggle[data-focus-on="me"][aria-pressed="true"] { background: var(--warm); }

.hold svg { transition: opacity 0.3s ease; }
.hold .icon-play { opacity: 0; }
.hold[aria-pressed="true"] .icon-pause { opacity: 0; }
.hold[aria-pressed="true"] .icon-play { opacity: 1; }

/* Last screen */
.inside {
  box-sizing: border-box;
  padding: clamp(72px, 10vw, 144px) clamp(20px, 5vw, 72px) clamp(64px, 8vw, 112px);
  background:
    radial-gradient(40% 44% at 27% 38%, rgba(120, 190, 255, 0.09), rgba(120, 190, 255, 0) 72%),
    radial-gradient(40% 44% at 73% 38%, rgba(255, 184, 120, 0.1), rgba(255, 184, 120, 0) 72%);
}
.sentence { row-gap: clamp(4px, 0.8vw, 12px); }
.big {
  grid-row: 1;
  font-weight: 200;
  font-size: clamp(36px, 7vw, 96px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.big.left { grid-column: 1; }
.big.right { grid-column: 3; }

.cue { grid-column: 1; grid-row: 2; display: grid; justify-items: end; }
.cue > span { grid-area: 1 / 1; margin-right: -0.18em; transition: opacity 0.6s ease; }
.cue-say { opacity: 0; }
.inside.picked .cue-turn { opacity: 0; }
.inside.picked .cue-say { opacity: 1; }

.slot {
  grid-column: 3;
  grid-row: 2;
  display: grid;
  justify-items: start;
  align-items: baseline;
  font-weight: 200;
  font-size: clamp(26px, 5.4vw, 72px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.slot > span { grid-area: 1 / 1; opacity: 0; filter: blur(0.1em); transition: opacity 0.6s ease, filter 0.6s ease; }
.slot > span.on { opacity: 1; filter: blur(0em); }
.slot .blank { color: var(--muted); opacity: 1; filter: none; }
.inside.picked .slot .blank { opacity: 0; }

.choices { align-items: start; }
.choices-left { justify-items: end; }
.choices-right { justify-items: start; }
.choice {
  min-height: 44px;
  margin: 0;
  background: none;
  border: 0;
  border-radius: 0;
  font-weight: 300;
  font-size: clamp(20px, 2.8vw, 36px);
  line-height: 1.2;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 7px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s, text-decoration-color 0.4s ease;
}
.choice.on {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease 0.4s, visibility 0s linear 0.4s, text-decoration-color 0.4s ease;
}
.choice.cold { padding: 0 0 0 20px; text-align: right; text-decoration-color: rgba(157, 218, 254, 0.35); }
.choice.warm { padding: 0 20px 0 0; text-align: left; text-decoration-color: rgba(243, 200, 152, 0.35); }
.choice[aria-pressed="true"] { text-decoration-color: currentColor; }
.inside.picked .choice.on[aria-pressed="false"] { opacity: 0.6; }

@keyframes breathe {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}
@keyframes nudge {
  0% { transform: translateY(0); }
  50% { transform: translateY(5px); }
  100% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
