/* soleinacodes: Leina's apartment, one evening, two lamps on. */

:root {
  /* the hallway at dusk */
  --dusk-top: oklch(0.27 0.02 52);
  --dusk: oklch(0.34 0.022 55);
  --dusk-deep: oklch(0.23 0.02 48);
  /* the two lamps: living room ~3000K, bedside ~2200K */
  --lamp: oklch(0.93 0.07 80);
  --lamp-mid: oklch(0.8 0.085 70);
  --lamp-rose: oklch(0.86 0.09 45);
  --lamp-rose-mid: oklch(0.7 0.1 35);
  /* the living room: plaster in lamplight */
  --plaster: oklch(0.94 0.018 78);
  --plaster-hi: oklch(0.975 0.022 85);
  --plaster-shade: oklch(0.86 0.025 70);
  /* the bedroom at night */
  --bed: oklch(0.27 0.03 18);
  --bed-hi: oklch(0.42 0.05 28);
  --bed-deep: oklch(0.2 0.025 15);
  --satin: oklch(0.84 0.055 12);
  /* inks */
  --ink: oklch(0.22 0.012 50);
  --ink-soft: oklch(0.42 0.02 55);
  --cream: oklch(0.95 0.012 80);
  --cream-soft: oklch(0.82 0.02 70);
  --gold: oklch(0.76 0.11 82);
  --gold-deep: oklch(0.62 0.1 75);

  /* type */
  --f-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --f-body: "Switzer", "Helvetica Neue", Arial, system-ui, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --t-welcome: clamp(4.5rem, 14vw, 13rem);
  --t-h1: clamp(2.75rem, 4.5vw + 1rem, 5.25rem);
  --t-h2: clamp(1.5rem, 1.2vw + 1rem, 2rem);
  --t-lead: clamp(1.0625rem, 0.6vw + 0.8rem, 1.3125rem);
  --t-body: clamp(1rem, 0.5vw + 0.75rem, 1.125rem);
  --t-small: 0.90625rem;
  --t-micro: 0.8125rem;

  /* space (8pt) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px; --s11: 160px;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-line: cubic-bezier(0.16, 1, 0.3, 1);
  --d-micro: 150ms;
  --d-std: 280ms;
  --d-exp: 520ms;
  --d-open: 1200ms;

  /* the circle diameter on the hallway */
  --cd: min(26vw, 25rem, 44svh);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--dusk);
  color: var(--cream);
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, p { margin: 0; }
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.skip {
  position: absolute; left: var(--s4); top: -60px; z-index: 100;
  background: var(--cream); color: var(--ink); padding: var(--s2) var(--s4);
  border-radius: 8px; text-decoration: none; font-weight: 500;
}
.skip:focus { top: var(--s4); }

/* plaster grain over everything, very low */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .4 0 0 0 1.4 -.35'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.view { position: relative; min-height: 100svh; display: flex; flex-direction: column; }

/* ---------------- wordmark: soleina + codes, with her caret ---------------- */
.wordmark {
  display: inline-flex; align-items: baseline; gap: 0.18em;
  text-decoration: none; font-size: 1.1875rem; line-height: 1;
}
.wm-name {
  font-family: var(--f-display); font-weight: 520;
  font-variation-settings: "SOFT" 100, "WONK" 0, "opsz" 30; letter-spacing: -0.01em;
}
.wm-code { font-family: var(--f-mono); font-size: 0.82em; letter-spacing: 0.01em; opacity: 0.8; }
.wm-caret {
  width: 0.09em; height: 0.95em; align-self: center; background: var(--gold);
  animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* ================================ HALLWAY ================================ */
.hallway {
  background:
    radial-gradient(ellipse 120% 70% at 50% 0%, oklch(0.39 0.024 58) 0, transparent 62%),
    linear-gradient(to bottom, var(--dusk-top), var(--dusk) 44%, var(--dusk-deep));
  overflow: hidden;
}
.hallway__top { display: flex; justify-content: center; padding: var(--s6) var(--s5) 0; position: relative; z-index: 3; }
.hallway__stage {
  flex: 1; position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--s5) var(--s5) var(--s6);
}
.welcome {
  position: relative; z-index: 1;
  font-family: var(--f-display); font-weight: 380; font-size: var(--t-welcome);
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  line-height: 0.9; letter-spacing: -0.03em;
  color: var(--cream);
  filter: drop-shadow(0 0 40px oklch(0.9 0.08 75 / 0.22));
  overflow: clip; padding: 0.06em 0.04em 0.1em;
}
/* lit from both sides: the floor lamp warms the W, the bedside lamp blushes the e */
.welcome__line {
  display: inline-block;
  background: linear-gradient(90deg, oklch(0.93 0.07 80) 0%, oklch(0.97 0.018 82) 38%, oklch(0.97 0.018 82) 60%, oklch(0.9 0.06 38) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.rooms {
  position: relative;
  display: flex; justify-content: center; gap: clamp(var(--s5), 6vw, 7.5rem);
  margin-top: calc(var(--cd) * -0.2);
}
.room-choice {
  position: relative; /* no z-index: the lamp must sit behind the word */
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none; color: var(--cream); outline: none;
  -webkit-tap-highlight-color: transparent;
}
.lamp {
  position: absolute; z-index: 0; pointer-events: none;
  left: 50%; top: calc(var(--cd) / 2);
  width: calc(var(--cd) * 2.9); aspect-ratio: 1; translate: -50% -50%;
  transition: opacity var(--d-exp) var(--ease-out), transform var(--d-exp) var(--ease-out);
}
/* a lamp on plaster: a hot core, a long warm falloff, and a soft cone washing up the wall */
.lamp--business {
  background:
    radial-gradient(ellipse 30% 34% at 50% 34%, oklch(0.9 0.075 78 / 0.34) 0, oklch(0.8 0.08 72 / 0) 100%),
    radial-gradient(circle, oklch(0.93 0.07 80 / 0.78) 0, oklch(0.84 0.085 72 / 0.46) 22%, oklch(0.72 0.085 66 / 0.18) 42%, oklch(0.62 0.08 65 / 0) 66%);
}
.lamp--private {
  background:
    radial-gradient(ellipse 30% 34% at 50% 34%, oklch(0.84 0.09 40 / 0.32) 0, oklch(0.72 0.1 32 / 0) 100%),
    radial-gradient(circle, oklch(0.88 0.09 48 / 0.74) 0, oklch(0.76 0.1 38 / 0.44) 22%, oklch(0.64 0.1 30 / 0.17) 42%, oklch(0.55 0.09 28 / 0) 66%);
}

.circle {
  position: relative; z-index: 2;
  width: var(--cd); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  box-shadow:
    0 0 0 1px oklch(0.96 0.03 80 / 0.3),
    0 28px 70px -24px oklch(0.16 0.02 45 / 0.75),
    0 0 90px -20px oklch(0.9 0.08 75 / 0.55);
  transition: transform var(--d-exp) var(--ease-out), box-shadow var(--d-exp) var(--ease-out);
}
.room-choice[data-room="private"] .circle {
  box-shadow:
    0 0 0 1px oklch(0.94 0.04 30 / 0.3),
    0 28px 70px -24px oklch(0.14 0.02 20 / 0.8),
    0 0 90px -20px oklch(0.84 0.1 40 / 0.55);
}
.circle img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
.circle::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at 50% 38%, transparent 52%, oklch(0.18 0.025 45 / 0.42) 100%);
}

/* the switch plate by each doorway */
.plate {
  position: relative; z-index: 2; margin-top: var(--s5);
  display: inline-flex; align-items: center; gap: var(--s3);
  padding: 9px 16px 9px 11px; border-radius: 11px;
  background: linear-gradient(to bottom, oklch(0.95 0.014 82), oklch(0.9 0.016 78));
  color: var(--ink); font-weight: 500; font-size: 1rem; letter-spacing: -0.005em;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.7), 0 1px 1px oklch(0.2 0.02 50 / 0.3), 0 8px 20px -10px oklch(0.15 0.02 45 / 0.7);
}
.switch {
  width: 14px; height: 22px; border-radius: 4px; position: relative; flex: none;
  background: oklch(0.86 0.014 78); box-shadow: inset 0 1px 2px oklch(0.3 0.02 50 / 0.35);
}
.switch__toggle {
  position: absolute; left: 2px; right: 2px; top: 2px; height: 9px; border-radius: 2.5px;
  background: linear-gradient(to bottom, oklch(0.99 0.006 85), oklch(0.93 0.01 80));
  box-shadow: 0 1px 1.5px oklch(0.25 0.02 50 / 0.45);
  transition: top var(--d-std) var(--ease-out);
}
.choice__line {
  position: relative; z-index: 2; margin-top: var(--s2);
  font-size: var(--t-small); color: var(--cream-soft);
  display: inline-flex; align-items: center; gap: var(--s2);
}
.age {
  font-size: 0.75rem; font-weight: 600; line-height: 1; padding: 3px 6px 3px;
  border: 1px solid oklch(0.82 0.02 70 / 0.55); border-radius: 5px; color: var(--cream);
}
.hallway__note {
  position: relative; z-index: 2; margin-top: var(--s7);
  font-size: var(--t-body); color: var(--cream-soft); text-align: center;
}

/* hover / focus: reach for that room's switch */
.rooms[data-hover="business"] .room-choice[data-room="business"] .lamp,
.rooms[data-hover="private"] .room-choice[data-room="private"] .lamp { transform: scale(1.12); }
.rooms[data-hover="business"] .room-choice[data-room="private"] .lamp,
.rooms[data-hover="private"] .room-choice[data-room="business"] .lamp { opacity: 0.45; }
.room-choice:hover .circle img, .room-choice:focus-visible .circle img { transform: scale(1.045); }
.room-choice:focus-visible .circle { outline: 2px solid var(--gold); outline-offset: 6px; }
.room-choice:hover .plate__word, .room-choice:focus-visible .plate__word {
  text-decoration: underline; text-decoration-color: var(--gold-deep); text-underline-offset: 4px; text-decoration-thickness: 1.5px;
}
/* chosen: the OTHER lamp switches off */
.rooms[data-chosen="business"] .room-choice[data-room="private"] .lamp,
.rooms[data-chosen="private"] .room-choice[data-room="business"] .lamp { opacity: 0; transition-duration: var(--d-std); }
.rooms[data-chosen="business"] .room-choice[data-room="private"] .switch__toggle,
.rooms[data-chosen="private"] .room-choice[data-room="business"] .switch__toggle { top: 11px; }
.rooms[data-chosen="business"] .room-choice[data-room="private"] .circle,
.rooms[data-chosen="private"] .room-choice[data-room="business"] .circle { filter: brightness(0.55) saturate(0.7); transition: filter var(--d-std) var(--ease-out); }

/* opening ceremony (only when JS runs, so no-JS visitors see everything) */
html.js body.boot .hallway .lamp { opacity: 0; transform: scale(0.72); }
html.js body.boot .welcome__line { transform: translateY(108%); }
html.js body.boot .hallway .circle { opacity: 0; transform: scale(0.94); }
html.js body.boot .hallway .plate,
html.js body.boot .hallway .choice__line,
html.js body.boot .hallway__note,
html.js body.boot .hallway__top,
html.js body.boot .hallway .baseboard { opacity: 0; transform: translateY(12px); }
html.js body.booted .hallway .lamp { transition: opacity var(--d-open) var(--ease-out), transform 1400ms var(--ease-out); }
html.js body.booted .room-choice[data-room="business"] .lamp { transition-delay: 200ms; }
html.js body.booted .room-choice[data-room="private"] .lamp { transition-delay: 350ms; }
html.js body.booted .welcome__line { transition: transform 1000ms var(--ease-line) 120ms; }
html.js body.booted .hallway .circle { transition: opacity 800ms var(--ease-out), transform 900ms var(--ease-out); }
html.js body.booted .room-choice[data-room="business"] .circle { transition-delay: 480ms; }
html.js body.booted .room-choice[data-room="private"] .circle { transition-delay: 620ms; }
html.js body.booted .hallway .plate,
html.js body.booted .hallway .choice__line { transition: opacity var(--d-exp) var(--ease-out) 820ms, transform var(--d-exp) var(--ease-out) 820ms; }
html.js body.booted .hallway__note,
html.js body.booted .hallway__top,
html.js body.booted .hallway .baseboard { transition: opacity var(--d-exp) var(--ease-out) 1000ms, transform var(--d-exp) var(--ease-out) 1000ms; }

/* ============================== BASEBOARD ============================== */
.baseboard {
  position: relative; z-index: 3;
  display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  padding: var(--s4) var(--s6);
  font-size: var(--t-micro); color: var(--cream-soft);
  border-top: 1px solid oklch(0.95 0.02 80 / 0.1);
  background: linear-gradient(to bottom, oklch(0.2 0.018 48 / 0.35), oklch(0.18 0.018 46 / 0.55));
}
.baseboard a { text-decoration: underline; text-decoration-color: oklch(0.76 0.11 82 / 0.7); text-underline-offset: 3px; }
.baseboard a:hover { color: var(--cream); }
.ai-mark {
  display: inline-block; font-family: var(--f-mono); font-size: 0.72rem; line-height: 1;
  padding: 3px 5px; margin-right: var(--s2); border-radius: 4px;
  border: 1px solid oklch(0.76 0.11 82 / 0.6); color: var(--gold); vertical-align: 1px;
}

/* ================================= ROOMS ================================= */
.room { overflow: hidden; }
.room::before {
  content: ""; position: absolute; inset: -10%; z-index: 0; pointer-events: none;
  background: var(--ambient) center / cover no-repeat;
  filter: blur(46px) saturate(1.15); opacity: 0.32;
}
.room--business {
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 90% at 22% 38%, var(--plaster-hi) 0, transparent 70%),
    linear-gradient(to bottom, var(--plaster), var(--plaster-shade));
}
.room--business::before { opacity: 0.22; }
.room--private {
  color: var(--cream);
  background:
    radial-gradient(ellipse 70% 90% at 78% 42%, var(--bed-hi) 0, transparent 70%),
    linear-gradient(to bottom, var(--bed), var(--bed-deep));
}
.room__top {
  position: relative; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s6) clamp(var(--s5), 5vw, var(--s8)) 0;
}
.back {
  font-size: var(--t-small); text-decoration: none; opacity: 0.8;
  display: inline-flex; align-items: center; gap: var(--s2);
}
.back::before { content: "←"; transition: transform var(--d-std) var(--ease-out); }
.back:hover { opacity: 1; }
.back:hover::before { transform: translateX(-4px); }

.room__stage {
  position: relative; z-index: 2; flex: 1;
  display: grid; align-items: center;
  grid-template-columns: minmax(var(--s5), 1fr) auto minmax(var(--s7), 7vw) minmax(0, 33rem) minmax(var(--s5), 1.25fr);
  grid-template-areas: ". door . copy .";
  padding-block: var(--s6) var(--s7);
}
.room--private .room__stage {
  grid-template-columns: minmax(var(--s5), 1.25fr) minmax(0, 33rem) minmax(var(--s7), 7vw) auto minmax(var(--s5), 1fr);
  grid-template-areas: ". copy . door .";
}
.doorway { grid-area: door; margin: 0; }
.room__copy { grid-area: copy; }

/* the arched doorway she stands in (9:16, semicircle top) */
.doorway__frame {
  position: relative; height: min(76svh, 46rem); aspect-ratio: 9 / 16;
  border-radius: 50% 50% 18px 18px / 28.125% 28.125% 18px 18px;
  overflow: hidden; isolation: isolate; perspective: 1400px;
  background: oklch(0.3 0.02 50);
  box-shadow: 0 50px 90px -40px oklch(0.2 0.03 45 / 0.7), 0 0 0 1px oklch(0.2 0.02 50 / 0.12);
}
.room--private .doorway__frame { box-shadow: 0 50px 100px -40px oklch(0.08 0.02 15 / 0.9), 0 0 120px -30px oklch(0.78 0.1 35 / 0.45); }
.doorway__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.doorway__frame::after {
  content: ""; position: absolute; inset: auto 0 0; height: 34%; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, transparent, oklch(0.14 0.015 45 / 0.62));
}
.doorway__rim { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
.rim-track, .rim-fill { fill: none; stroke-width: 3.5; }
.rim-track { stroke: oklch(0.98 0.02 85 / 0.22); }
.rim-fill { stroke: var(--gold); stroke-linecap: round; filter: drop-shadow(0 0 6px oklch(0.85 0.1 80 / 0.8)); }
.room--private .rim-fill { stroke: var(--satin); filter: drop-shadow(0 0 6px oklch(0.84 0.09 25 / 0.8)); }

.sound {
  position: absolute; z-index: 3; left: var(--s3); bottom: 78px;
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 7px 12px 7px 9px; border-radius: 99px; border: 1px solid oklch(0.96 0.02 80 / 0.35);
  background: oklch(0.16 0.015 45 / 0.42); color: var(--cream);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: var(--t-micro); font-weight: 500; cursor: pointer;
  transition: background var(--d-micro) var(--ease-out);
}
.sound:hover { background: oklch(0.16 0.015 45 / 0.6); }
.sound__icon {
  width: 16px; height: 16px; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M17 9l4 4m0-4l-4 4' stroke='%23000' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M17 9l4 4m0-4l-4 4' stroke='%23000' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") center / contain no-repeat;
}
.sound[aria-pressed="true"] .sound__icon {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M16 8.5a5 5 0 0 1 0 7M18.5 6a8.5 8.5 0 0 1 0 12' stroke='%23000' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M16 8.5a5 5 0 0 1 0 7M18.5 6a8.5 8.5 0 0 1 0 12' stroke='%23000' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
}

/* the story reply bar */
.reply {
  position: absolute; z-index: 3; left: var(--s3); right: var(--s3); bottom: var(--s3);
  height: 54px; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: 0 7px 0 var(--s5); border-radius: 27px;
  border: 1px solid oklch(0.97 0.02 85 / 0.5);
  background: oklch(0.16 0.015 45 / 0.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3);
  color: var(--cream); text-decoration: none; font-weight: 500; font-size: 0.97rem; letter-spacing: -0.005em;
  transition: background var(--d-std) var(--ease-out), color var(--d-std) var(--ease-out), border-color var(--d-std) var(--ease-out);
}
.reply__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply__go {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  background: var(--cream); position: relative;
  transition: transform var(--d-std) var(--ease-out), background var(--d-std) var(--ease-out);
}
.reply__go::before {
  content: ""; position: absolute; inset: 0; background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h13M13 6l6 6-6 6' stroke='%23000' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h13M13 6l6 6-6 6' stroke='%23000' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.reply:hover { background: oklch(0.16 0.015 45 / 0.6); }
.reply:hover .reply__go { transform: translateX(3px); }
/* the lamp she left on for you: lights up when her video ends */
.doorway.ended .reply { background: var(--lamp); color: var(--ink); border-color: transparent; animation: glowup 1.6s var(--ease-out) 1; }
.room--private .doorway.ended .reply { background: var(--satin); }
.doorway.ended .reply__go { background: var(--ink); }
.doorway.ended .reply__go::before { background: var(--cream); }
@keyframes glowup { 0% { box-shadow: 0 0 0 0 oklch(0.93 0.07 80 / 0.7); } 100% { box-shadow: 0 0 0 18px oklch(0.93 0.07 80 / 0); } }

/* the bedroom door (18+) */
.door { position: absolute; inset: 0; z-index: 5; transform-style: preserve-3d; }
.door__panel {
  position: absolute; inset: 0; transform-origin: 0% 50%;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch;
  padding: var(--s6) var(--s5) var(--s6);
  background:
    radial-gradient(circle at 89% 46%, oklch(0.8 0.1 82) 0 5px, oklch(0.55 0.08 70) 6px 7px, transparent 8px),
    linear-gradient(to bottom, oklch(0.38 0.045 24), oklch(0.27 0.035 18));
  box-shadow: inset 0 0 0 1px oklch(0.9 0.05 30 / 0.12), inset 14px 0 30px -18px oklch(0.1 0.02 15 / 0.6);
  color: var(--cream);
  transition: transform 900ms var(--ease-out), opacity 900ms var(--ease-out);
}
/* the door's recessed upper panel, following the arch */
.door__panel::before {
  content: ""; position: absolute; left: 13%; right: 13%; top: 7%; height: 30%;
  border-radius: 50% 50% 6px 6px / 38% 38% 6px 6px;
  box-shadow: inset 0 0 0 1px oklch(0.9 0.05 30 / 0.08), inset 0 3px 10px oklch(0.1 0.02 15 / 0.4), 0 1px 0 oklch(0.9 0.05 30 / 0.06);
  pointer-events: none;
}
.door__title { font-family: var(--f-display); font-weight: 450; font-size: clamp(1.625rem, 2.2vw, 2rem); line-height: 1.05; letter-spacing: -0.02em; font-variation-settings: "SOFT" 100, "opsz" 48; }
.door__text { margin-top: var(--s2); color: var(--cream-soft); font-size: 0.97rem; }
.door__yes {
  margin-top: var(--s5); height: 52px; border-radius: 26px; border: 0; cursor: pointer;
  background: var(--satin); color: var(--ink); font-weight: 600; font-size: 1rem;
  box-shadow: 0 10px 26px -12px oklch(0.84 0.09 20 / 0.8);
  transition: transform var(--d-micro) var(--ease-out), filter var(--d-micro);
}
.door__yes:hover { filter: brightness(1.05); }
.door__yes:active { transform: translateY(1px) scale(0.99); }
.door__no { margin-top: var(--s4); align-self: center; font-size: var(--t-small); color: var(--cream-soft); text-underline-offset: 3px; }
.door__small { margin-top: var(--s3); text-align: center; font-size: 0.75rem; color: oklch(0.72 0.03 30); }
.door.open .door__panel { transform: rotateY(-102deg); opacity: 0; pointer-events: none; }

/* room copy */
.room__h {
  font-family: var(--f-display); font-weight: 420; font-size: var(--t-h1);
  font-variation-settings: "SOFT" 100, "WONK" 0, "opsz" 144;
  line-height: 0.95; letter-spacing: -0.028em;
}
.room__sub { margin-top: var(--s4); font-size: var(--t-lead); line-height: 1.5; max-width: 30ch; }
.room--business .room__sub { color: var(--ink); }
.room__offer { margin-top: var(--s7); }
.room__honest:empty { display: none; }
.room__honest { margin-top: var(--s6); font-size: var(--t-small); line-height: 1.6; max-width: 44ch; color: var(--ink-soft); }
.room--private .room__honest { color: var(--cream-soft); }
.room__cta {
  margin-top: var(--s5); display: inline-flex; align-items: center; gap: var(--s2);
  font-weight: 600; font-size: 1.03rem; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat;
  padding-bottom: 3px; transition: background-size var(--d-std) var(--ease-out);
}
.room__cta::after { content: "→"; transition: transform var(--d-std) var(--ease-out); }
.room__cta:hover { background-size: 100% 1.5px; }
.room__cta:hover::after { transform: translateX(4px); }

/* business offer: her editor, one open file per thing she builds */
.editor {
  max-width: 33rem; border-radius: 12px; overflow: hidden;
  background: oklch(0.985 0.008 85);
  border: 1px solid oklch(0.8 0.02 70 / 0.8);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.9), 0 22px 44px -26px oklch(0.28 0.03 50 / 0.5);
}
.editor__tabs { position: relative; display: flex; overflow-x: auto; scrollbar-width: none; background: oklch(0.93 0.014 80); border-bottom: 1px solid oklch(0.82 0.018 72); }
.editor__tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--f-mono); font-size: 0.78rem; color: var(--ink-soft);
  padding: 11px 13px 10px; border-right: 1px solid oklch(0.82 0.018 72);
  transition: background var(--d-micro), color var(--d-micro);
}
.tab:hover { color: var(--ink); background: oklch(0.955 0.012 82); }
.tab[aria-selected="true"] { background: oklch(0.985 0.008 85); color: var(--ink); box-shadow: inset 0 2px 0 var(--gold); }
.editor__body { display: grid; grid-template-columns: auto 1fr; gap: 0 var(--s4); padding: var(--s5) var(--s5) var(--s5) var(--s4); min-height: 7.5rem; }
.editor__gutter { font-family: var(--f-mono); font-size: 0.78rem; line-height: 1.95; color: oklch(0.65 0.02 60); text-align: right; user-select: none; }
.editor__code { font-size: 1rem; line-height: 1.55; color: var(--ink); }
.editor__comment { display: block; font-family: var(--f-mono); font-size: 0.8rem; color: oklch(0.55 0.05 80); margin-bottom: 6px; }
.editor__desc { display: block; }
.editor__desc.swap { animation: swapin var(--d-exp) var(--ease-out); }
@keyframes swapin { from { opacity: 0; transform: translateY(6px); } }

/* private offer: three lines in her DMs */
.thread { display: flex; flex-direction: column; gap: 6px; max-width: 25rem; }
.msg { position: relative; display: flex; align-items: flex-end; gap: var(--s2); }
.msg__avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; visibility: hidden; }
.msg:last-child .msg__avatar { visibility: visible; }
.bubble {
  background: oklch(0.37 0.045 22); color: var(--cream);
  padding: 11px 16px; border-radius: 20px 20px 20px 6px;
  font-size: 1rem; line-height: 1.45;
  box-shadow: 0 6px 16px -10px oklch(0.08 0.02 15 / 0.7);
}
.msg:first-child .bubble { border-radius: 20px 20px 20px 20px; border-bottom-left-radius: 6px; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; border-radius: 20px 20px 20px 6px; background: oklch(0.37 0.045 22); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--cream-soft); animation: dot 1s infinite var(--ease-out); }
.typing i:nth-child(2) { animation-delay: 0.15s; } .typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.msg .typing { position: absolute; left: 36px; bottom: 0; opacity: 0; transition: opacity var(--d-micro); }
.msg[data-state="wait"] .bubble, .msg[data-state="typing"] .bubble { opacity: 0; }
.msg[data-state="typing"] .typing { opacity: 1; }
.msg[data-state="shown"] .bubble { animation: pop var(--d-exp) var(--ease-out); }
.msg[data-state="wait"] .msg__avatar { opacity: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* room entrance stagger */
.room.enter .room__h, .room.enter .room__sub, .room.enter .room__offer, .room.enter .room__honest, .room.enter .room__cta, .room.enter .room__top {
  animation: rise 700ms var(--ease-out) both;
}
.room.enter .room__sub { animation-delay: 60ms; }
.room.enter .room__offer { animation-delay: 130ms; }
.room.enter .room__honest { animation-delay: 190ms; }
.room.enter .room__cta { animation-delay: 240ms; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ============================ THE POUR + MORPH ============================ */
/* the chosen light spilling out: a soft-edged disc, solid to 62% of its radius, feathered beyond */
.pour { position: fixed; z-index: 70; pointer-events: none; border-radius: 50%; will-change: transform; }
.pour--business { background: radial-gradient(circle closest-side, var(--plaster-hi) 0, var(--plaster) 34%, var(--plaster-shade) 62%, oklch(0.86 0.025 70 / 0) 100%); }
.pour--private { background: radial-gradient(circle closest-side, var(--bed-hi) 0, var(--bed) 34%, var(--bed-deep) 62%, oklch(0.2 0.025 15 / 0) 100%); }
.morph { position: fixed; z-index: 80; overflow: hidden; pointer-events: none; will-change: left, top, width, height, border-radius; }
.morph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ================================= ABOUT ================================= */
.about {
  color: var(--ink);
  background:
    radial-gradient(ellipse 60% 50% at 12% 0%, var(--plaster-hi) 0, transparent 70%),
    linear-gradient(to bottom, var(--plaster), var(--plaster-shade));
}
.note { position: relative; z-index: 2; flex: 1; width: min(100% - 2 * var(--s5), 42rem); margin: var(--s9) auto var(--s10); }
.note__h {
  font-family: var(--f-display); font-weight: 420; font-size: clamp(3rem, 5vw + 1rem, 5.5rem);
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; line-height: 0.95; letter-spacing: -0.03em;
}
.note__lead { margin-top: var(--s5); font-size: var(--t-lead); line-height: 1.5; max-width: 34ch; }
.note h2 {
  margin-top: var(--s8); font-family: var(--f-display); font-weight: 500; font-size: var(--t-h2);
  font-variation-settings: "SOFT" 100, "opsz" 36; letter-spacing: -0.015em; line-height: 1.15;
}
.note h2::before { content: ""; display: block; width: 44px; height: 1px; margin-bottom: var(--s4); background: var(--gold-deep); }
.note p:not(.note__lead):not(.note__sign) { margin-top: var(--s3); line-height: 1.65; max-width: 62ch; color: oklch(0.3 0.015 50); }
.note a { text-decoration-color: var(--gold-deep); text-underline-offset: 3px; }
.note__sign { margin-top: var(--s8); font-family: var(--f-display); font-size: 1.35rem; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 36; color: var(--ink-soft); }
.about .baseboard, .room--business .baseboard { color: var(--ink-soft); border-top-color: oklch(0.3 0.02 50 / 0.12); background: oklch(0.8 0.025 70 / 0.35); }
.about .ai-mark, .room--business .ai-mark { color: var(--gold-deep); border-color: var(--gold-deep); }
.about .baseboard a:hover, .room--business .baseboard a:hover { color: var(--ink); }

/* =============================== REGISTER =============================== */
.register__stage {
  position: relative; z-index: 2; flex: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 30rem) minmax(0, 1fr);
  grid-template-areas: ". side form ."; align-items: center; column-gap: clamp(var(--s6), 6vw, var(--s9));
  padding: var(--s7) clamp(var(--s5), 5vw, var(--s8));
}
.register__side { grid-area: side; }
.register__photo {
  height: min(72svh, 40rem); width: auto; aspect-ratio: 9 / 16; object-fit: cover;
  border-radius: 50% 50% 18px 18px / 28.125% 28.125% 18px 18px;
  box-shadow: 0 40px 80px -40px oklch(0.2 0.03 45 / 0.7);
}
.guest { grid-area: form; }
.guest__h { font-family: var(--f-display); font-weight: 420; font-size: clamp(2.25rem, 2.6vw + 1rem, 3.5rem); font-variation-settings: "SOFT" 100, "opsz" 96; line-height: 1; letter-spacing: -0.025em; }
.guest__sub { margin-top: var(--s3); max-width: 36ch; opacity: 0.85; }
.guest__fields { margin-top: var(--s6); display: grid; gap: var(--s5); }
.field { display: grid; gap: 6px; }
.field__label { font-size: 0.875rem; font-weight: 500; opacity: 0.8; }
.field__input {
  width: 100%; border: 0; border-bottom: 1.5px solid currentColor; border-radius: 0;
  background: transparent; color: inherit; font: inherit; font-size: 1.0625rem; padding: 8px 0 9px;
  opacity: 0.9; transition: border-color var(--d-micro), box-shadow var(--d-micro);
  border-bottom-color: oklch(from currentColor l c h / 0.35);
}
textarea.field__input { resize: vertical; min-height: 4.2rem; }
.field__input:focus { outline: none; border-bottom-color: var(--gold-deep); box-shadow: 0 1.5px 0 var(--gold-deep); }
.room--private .field__input:focus { border-bottom-color: var(--satin); box-shadow: 0 1.5px 0 var(--satin); }
.field__input::placeholder { color: inherit; opacity: 0.4; }
.room--private .field__input { color-scheme: dark; }
.guest__error { margin-top: var(--s4); font-size: var(--t-small); color: oklch(0.55 0.16 25); }
.room--private .guest__error { color: oklch(0.8 0.1 25); }
.guest__submit {
  margin-top: var(--s6); width: 100%; height: 56px; border: 0; border-radius: 28px; cursor: pointer;
  background: var(--ink); color: var(--cream); font-weight: 600; font-size: 1.02rem;
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 var(--s5);
  box-shadow: 0 14px 30px -16px oklch(0.2 0.02 50 / 0.8);
  transition: transform var(--d-micro) var(--ease-out), filter var(--d-micro);
}
.guest__submit::after {
  content: ""; width: 40px; height: 40px; border-radius: 50%; background: var(--lamp) center / 18px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h13M13 6l6 6-6 6' stroke='%231c1814' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.room--private .guest__submit { background: var(--satin); color: var(--ink); }
.room--private .guest__submit::after { background-color: var(--ink); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h13M13 6l6 6-6 6' stroke='%23f3ede4' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.guest__submit:hover { filter: brightness(1.08); }
.guest__submit:active { transform: translateY(1px); }
.guest__submit[disabled] { opacity: 0.6; cursor: progress; }
.guest__small { margin-top: var(--s4); font-size: var(--t-micro); opacity: 0.7; max-width: 44ch; }
.guest__alt { margin-top: var(--s5); font-size: var(--t-small); opacity: 0.85; }
.guest__alt a { text-underline-offset: 3px; text-decoration-color: var(--gold-deep); }
.guest__error.is-good { color: inherit; opacity: 0.85; }

/* sign in / reset: back in the hallway light */
.room--hall {
  color: var(--cream);
  background:
    radial-gradient(ellipse 70% 60% at 50% 20%, oklch(0.39 0.024 58) 0, transparent 70%),
    linear-gradient(to bottom, var(--dusk-top), var(--dusk) 50%, var(--dusk-deep));
}
.room--hall .guest__submit { background: var(--lamp); color: var(--ink); }
.room--hall .guest__submit::after { background-color: var(--ink); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h13M13 6l6 6-6 6' stroke='%23f3ede4' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.room--hall .field__input { color-scheme: dark; }

/* terms and privacy: same letter, denser */
.note--legal h2 { margin-top: var(--s7); font-size: clamp(1.25rem, 0.8vw + 1rem, 1.5rem); }
.note--legal p strong { font-weight: 600; color: var(--ink); }

/* ================================ MOBILE ================================ */
@media (max-width: 760px) {
  :root { --cd: min(43vw, 14rem, 30svh); }
  .hallway__top { padding-top: var(--s5); }
  .hallway__stage { padding: var(--s4) var(--s4) var(--s5); }
  .welcome { font-size: clamp(4.25rem, 23vw, 7rem); }
  .rooms { gap: var(--s4); margin-top: calc(var(--cd) * -0.14); }
  .plate { margin-top: var(--s4); padding: 7px 12px 7px 9px; font-size: 0.94rem; gap: 9px; }
  .switch { width: 12px; height: 19px; }
  .switch__toggle { height: 7.5px; }
  .rooms[data-chosen="business"] .room-choice[data-room="private"] .switch__toggle,
  .rooms[data-chosen="private"] .room-choice[data-room="business"] .switch__toggle { top: 9.5px; }
  .choice__line { font-size: 0.8125rem; text-align: center; }
  .hallway__note { margin-top: var(--s6); font-size: 0.97rem; max-width: 22ch; }
  .baseboard { flex-direction: column; align-items: flex-start; gap: 6px; padding: var(--s4) var(--s5); }

  .room__top { padding: var(--s5) var(--s5) 0; }
  .room__stage, .room--private .room__stage {
    display: flex; flex-direction: column; align-items: center; gap: var(--s6);
    padding: var(--s5) var(--s5) var(--s7);
  }
  .doorway__frame { height: min(66svh, 36rem); }
  .room__copy { width: 100%; max-width: 30rem; }
  .room__h { font-size: clamp(2.6rem, 12vw, 3.4rem); }
  .room__offer { margin-top: var(--s6); }

  .register__stage { display: flex; flex-direction: column; padding: var(--s5) var(--s5) var(--s7); gap: var(--s5); }
  .register__side { display: none; }
  .guest { width: 100%; max-width: 30rem; }
  .note { margin-top: var(--s7); }
}

/* QA mode for screenshots: freeze motion */
html.qa *, html.qa *::before, html.qa *::after { animation: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }
  .wm-caret { animation: none; }
}
