:root {
  color-scheme: dark;
  --ink: #071525;
  --deep: #0b2238;
  --night: #102f4d;
  --paper: #f5edda;
  --paper-dim: #d9d0bd;
  --tomato: #ff5d50;
  --tomato-dark: #bc3441;
  --aqua: #79d9dc;
  --aqua-dark: #237c8c;
  --yellow: #ffd56b;
  --lavender: #b7a3ff;
  --line: rgba(245, 237, 218, .28);
  --shadow: 0 22px 60px rgba(0, 0, 0, .35);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--ink);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

#app {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(330px, 38vw) minmax(520px, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 17, 30, .98) 0 38%, rgba(7, 21, 37, .34) 57%, transparent 100%),
    var(--ink);
}

#app::after {
  content: "";
  position: absolute;
  z-index: 20;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.night {
  position: absolute;
  z-index: -5;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(#071525, #143d5d 58%, #276978 100%);
}

.moon {
  position: absolute;
  top: 8%;
  right: 12%;
  width: clamp(90px, 12vw, 180px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f7e6ad;
  box-shadow: 0 0 80px rgba(255, 231, 165, .22);
}

.ridge {
  position: absolute;
  right: -4%;
  bottom: 0;
  width: 72%;
  height: 26%;
  background: #092035;
  clip-path: polygon(0 61%, 10% 45%, 19% 53%, 29% 22%, 39% 56%, 50% 27%, 63% 58%, 75% 33%, 86% 57%, 100% 39%, 100% 100%, 0 100%);
}

.ridge-b {
  right: -12%;
  bottom: -5%;
  height: 24%;
  opacity: .7;
  transform: scaleX(1.2);
  background: #061321;
}

.stars {
  position: absolute;
  inset: 0;
  opacity: .55;
  background-image:
    radial-gradient(circle at 72% 12%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 87% 24%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 63% 31%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 92% 8%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 52% 17%, #fff 0 1px, transparent 1.5px);
}

.masthead {
  position: relative;
  z-index: 14;
  grid-column: 1;
  grid-row: 1;
  padding: clamp(22px, 4vw, 56px) clamp(24px, 4vw, 58px) 12px;
}

.series {
  margin: 0 0 16px;
  color: var(--aqua);
  font-size: clamp(.62rem, .75vw, .76rem);
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  max-width: 570px;
  margin: 0;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.1rem, 5.6vw, 6.8rem);
  font-weight: 400;
  letter-spacing: -.07em;
  line-height: .76;
  text-wrap: balance;
}

.premise {
  max-width: 37ch;
  margin: 20px 0 0;
  color: var(--paper-dim);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(.94rem, 1.2vw, 1.15rem);
  font-style: italic;
  line-height: 1.35;
}

.kitchen {
  position: absolute;
  z-index: 0;
  inset: 0 0 0 31%;
  overflow: hidden;
}

.wall {
  position: absolute;
  inset: 7% 4% 17% 13%;
  border: 1px solid rgba(245, 237, 218, .18);
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(245, 237, 218, .08) 50%, transparent 50.2%),
    linear-gradient(rgba(245, 237, 218, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 237, 218, .07) 1px, transparent 1px),
    #173b51;
  background-size: 100% 100%, 62px 62px, 62px 62px, auto;
  box-shadow: inset 0 -80px 100px rgba(4, 13, 23, .56);
  transform: perspective(700px) rotateY(-3deg);
  transform-origin: right center;
}

.window {
  position: absolute;
  top: 9%;
  left: 8%;
  width: 31%;
  height: 37%;
  overflow: hidden;
  border: 9px solid #0b2639;
  background: linear-gradient(#061321, #0b2740 62%, #155064);
  box-shadow: 0 12px 0 rgba(5, 16, 27, .35);
}

.window::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(118deg, transparent 46%, rgba(121, 217, 220, .08) 46% 48%, transparent 48%);
}

.window-bar {
  position: absolute;
  z-index: 2;
  display: block;
  background: #0b2639;
}

.window-bar.vertical {
  top: 0;
  bottom: 0;
  left: 51%;
  width: 7px;
}

.window-bar.horizontal {
  right: 0;
  left: 0;
  top: 58%;
  height: 7px;
}

.window-light {
  position: absolute;
  bottom: 13%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow);
}

.window-light.one { left: 12%; }
.window-light.two { left: 72%; bottom: 25%; }
.window-light.three { left: 84%; bottom: 9%; }

.cabinet {
  position: absolute;
  top: 8%;
  width: 20%;
  height: 31%;
  border: 2px solid #102c3e;
  background: #235366;
  box-shadow: inset 0 0 0 7px rgba(7, 21, 37, .12), 0 12px 20px rgba(5, 16, 27, .2);
}

.cabinet::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 5px;
  height: 13px;
  border-radius: 5px;
  background: var(--paper-dim);
}

.cabinet-a { right: 28%; }
.cabinet-b { right: 7%; }
.cabinet-a::after { right: 9px; }
.cabinet-b::after { left: 9px; }

.clock-face {
  position: absolute;
  top: 42%;
  right: 10%;
  width: 64px;
  aspect-ratio: 1;
  border: 5px solid #0a2133;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: .5rem;
  text-align: center;
  box-shadow: 0 7px 12px rgba(3, 13, 22, .25);
}

.clock-face span {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 900;
}

.clock-face i,
.clock-face b {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 2px;
  height: 20px;
  transform-origin: 50% 100%;
  background: var(--tomato-dark);
}

.clock-face i { transform: translate(-50%, -100%) rotate(98deg); }
.clock-face b { height: 15px; transform: translate(-50%, -100%) rotate(11deg); }

.counter-line {
  position: absolute;
  right: 0;
  bottom: 18%;
  left: 0;
  height: 8%;
  border-top: 7px solid #092235;
  background: #2d6370;
}

.sink {
  position: absolute;
  left: 14%;
  bottom: 20%;
  width: 22%;
  height: 4%;
  border: 4px solid #102b3e;
  border-radius: 0 0 50% 50%;
  background: #0f3146;
}

.tap {
  position: absolute;
  left: 23%;
  bottom: 26%;
  width: 33px;
  height: 55px;
  border-top: 7px solid #91adb2;
  border-left: 7px solid #91adb2;
  border-radius: 22px 0 0;
}

.lamp {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 54%;
  width: 230px;
  height: 66%;
  transform: translateX(-50%);
  pointer-events: none;
}

.lamp-cord {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 19%;
  background: #050d17;
}

.lamp-shade {
  position: absolute;
  z-index: 2;
  top: 16%;
  left: 50%;
  width: 116px;
  height: 63px;
  transform: translateX(-50%);
  border-radius: 58px 58px 10px 10px;
  background: var(--tomato);
  box-shadow: inset 0 -12px 0 var(--tomato-dark), 0 15px 30px rgba(255, 93, 80, .18);
}

.light-cone {
  position: absolute;
  z-index: 0;
  top: 23%;
  left: 50%;
  width: 310px;
  height: 520px;
  transform: translateX(-50%);
  opacity: .42;
  background: linear-gradient(rgba(255, 213, 107, .5), rgba(255, 213, 107, .1));
  clip-path: polygon(36% 0, 64% 0, 100% 100%, 0 100%);
  mix-blend-mode: screen;
}

.person {
  position: absolute;
  z-index: 4;
  width: clamp(112px, 13vw, 190px);
  height: clamp(230px, 37vh, 420px);
  transition: filter .35s ease, transform .45s cubic-bezier(.2, .7, .2, 1), opacity .35s ease;
}

.person-mara {
  left: 11%;
  bottom: 16%;
  --skin: #bd694e;
  --hair: #16131b;
  --clothes: #7dd8d8;
}

.person-eli {
  left: 44%;
  bottom: 17%;
  --skin: #d69a72;
  --hair: #4a271d;
  --clothes: #f1c85f;
}

.person-june {
  right: 6%;
  bottom: 15%;
  --skin: #9f604d;
  --hair: #20151f;
  --clothes: #a993f4;
}

.person-shape {
  position: absolute;
  inset: 0;
}

.face {
  position: absolute;
  z-index: 3;
  top: 10%;
  left: 50%;
  display: block;
  width: 41%;
  aspect-ratio: .78;
  transform: translateX(-50%);
  border: 3px solid var(--ink);
  border-radius: 46% 45% 52% 48%;
  background: var(--skin);
  box-shadow: inset 8px -5px 0 rgba(107, 44, 41, .12);
}

.hair {
  position: absolute;
  z-index: 4;
  top: 6%;
  left: 50%;
  display: block;
  width: 47%;
  height: 18%;
  transform: translateX(-50%) rotate(-4deg);
  border: 3px solid var(--ink);
  border-radius: 60% 45% 30% 20%;
  background: var(--hair);
}

.person-mara .hair {
  height: 25%;
  border-radius: 50% 50% 18% 18%;
}

.person-june .hair {
  width: 52%;
  height: 22%;
  transform: translateX(-50%) rotate(7deg);
  border-radius: 65% 40% 58% 20%;
}

.eye {
  position: absolute;
  top: 45%;
  width: 5px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform .25s ease;
}

.eye-a { left: 24%; }
.eye-b { right: 24%; }

.mouth {
  position: absolute;
  bottom: 22%;
  left: 50%;
  display: block;
  width: 19%;
  height: 6px;
  transform: translateX(-50%);
  border-bottom: 2px solid var(--ink);
  border-radius: 50%;
}

.neck {
  position: absolute;
  z-index: 2;
  top: 27%;
  left: 50%;
  display: block;
  width: 18%;
  height: 12%;
  transform: translateX(-50%);
  border: 3px solid var(--ink);
  background: var(--skin);
}

.torso {
  position: absolute;
  z-index: 1;
  top: 34%;
  left: 50%;
  display: block;
  width: 78%;
  height: 59%;
  transform: translateX(-50%);
  border: 3px solid var(--ink);
  border-radius: 44% 44% 8% 8%;
  background: var(--clothes);
  box-shadow: inset -14px 0 rgba(5, 20, 35, .09);
}

.arm {
  position: absolute;
  z-index: 4;
  top: 51%;
  left: 44%;
  display: block;
  width: 64%;
  height: 17%;
  transform: rotate(12deg);
  transform-origin: left center;
  border: 3px solid var(--ink);
  border-radius: 30px;
  background: var(--clothes);
}

.person-eli .arm { left: 1%; transform: rotate(-8deg); }
.person-june .arm { left: -8%; transform: rotate(-17deg); }

.nameplate {
  position: absolute;
  z-index: 8;
  bottom: 0;
  left: 50%;
  min-width: 104px;
  margin: 0;
  padding: 7px 10px 6px;
  transform: translateX(-50%) rotate(-2deg);
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 4px 5px 0 var(--ink);
  text-align: center;
}

.nameplate b {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1;
}

.nameplate span {
  display: block;
  margin-top: 3px;
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.person[data-speaking="true"] {
  z-index: 6;
  transform: translateY(-8px) scale(1.03);
  filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .28));
}

.person[data-speaking="false"] {
  opacity: .78;
  filter: saturate(.72) brightness(.78);
}

.person[data-speaking="true"] .mouth {
  height: 8px;
  border: 2px solid var(--ink);
  background: rgba(7, 21, 37, .35);
}

.island {
  position: absolute;
  z-index: 7;
  right: 3%;
  bottom: -2%;
  left: 7%;
  height: 30%;
  transform: perspective(800px) rotateX(5deg);
}

.island-top {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  height: 43%;
  border: 4px solid var(--ink);
  background: #e7d4ae;
  clip-path: polygon(5% 0, 95% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 -14px rgba(149, 105, 77, .18);
}

.island-front {
  position: absolute;
  right: 4%;
  bottom: 0;
  left: 4%;
  height: 67%;
  border: 4px solid var(--ink);
  background: #15435a;
  box-shadow: inset 0 14px #0d2e43;
}

.letter {
  position: absolute;
  z-index: 5;
  top: 5%;
  left: 48%;
  display: grid;
  width: clamp(104px, 12vw, 164px);
  aspect-ratio: 1.62;
  transform: rotate(-4deg);
  place-items: center;
  border: 2px solid var(--ink);
  background: #f4e8cd;
  color: var(--tomato-dark);
  box-shadow: 5px 6px 0 rgba(7, 21, 37, .25);
  font-size: clamp(.48rem, .63vw, .72rem);
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1.15;
  text-align: center;
}

.letter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(32deg, transparent 49%, rgba(7, 21, 37, .16) 50%, transparent 51%);
}

.key {
  position: absolute;
  z-index: 5;
  top: 17%;
  left: 31%;
  width: 44px;
  height: 13px;
  transform: rotate(17deg);
  border-radius: 8px;
  background: var(--yellow);
  box-shadow: 0 3px 0 rgba(7, 21, 37, .2);
}

.key i {
  position: absolute;
  top: -8px;
  right: -4px;
  width: 27px;
  aspect-ratio: 1;
  border: 8px solid var(--yellow);
  border-radius: 50%;
}

.mug {
  position: absolute;
  z-index: 5;
  top: 9%;
  width: 38px;
  height: 34px;
  border: 3px solid var(--ink);
  border-radius: 4px 4px 12px 12px;
  background: var(--tomato);
}

.mug::after {
  content: "";
  position: absolute;
  right: -14px;
  top: 4px;
  width: 12px;
  height: 15px;
  border: 3px solid var(--ink);
  border-left: 0;
  border-radius: 0 12px 12px 0;
}

.mug-a { left: 13%; }
.mug-b { right: 14%; background: var(--aqua); transform: rotate(8deg); }

.story {
  position: relative;
  z-index: 13;
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  min-height: 330px;
  margin: 0 clamp(24px, 4vw, 58px) 18px;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid rgba(245, 237, 218, .26);
  background: rgba(7, 21, 37, .82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.story::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 15%;
  left: 15%;
  height: 5px;
  background: var(--tomato);
}

.story > *:not(.story-echo) {
  position: relative;
  z-index: 1;
}

.story-echo {
  position: absolute;
  z-index: 0;
  right: -32%;
  top: 23%;
  width: 86%;
  overflow: hidden;
  color: var(--tomato);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.15rem, 3.9vw, 4.8rem);
  font-style: italic;
  letter-spacing: -.05em;
  line-height: .84;
  opacity: .24;
  pointer-events: none;
  text-align: right;
  text-decoration: line-through .07em;
  text-transform: uppercase;
  transform: rotate(-4deg);
}

.story-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.chapter,
.time {
  margin: 0;
  color: var(--aqua);
  font-size: .63rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.time { color: var(--paper-dim); }

.lines {
  min-height: 106px;
  padding: 16px 0 10px;
}

.line {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  margin: 0 0 10px;
  animation: line-in .4s both;
}

.line:nth-child(2) { animation-delay: .08s; }
.line:nth-child(3) { animation-delay: .16s; }
.line:nth-child(4) { animation-delay: .24s; }

.speaker {
  padding-top: 4px;
  color: var(--yellow);
  font-size: .59rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.line[data-speaker="mara"] .speaker { color: var(--aqua); }
.line[data-speaker="eli"] .speaker { color: var(--yellow); }
.line[data-speaker="june"] .speaker { color: var(--lavender); }
.line[data-speaker="you"] .speaker { color: var(--tomato); }
.line[data-speaker="house"] .speaker { color: var(--paper-dim); }

.line-text {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  line-height: 1.25;
}

.line.memory-line .line-text {
  color: var(--tomato);
  font-style: italic;
}

.line.memory-line {
  border-left: 2px solid var(--tomato);
  padding-left: 9px;
}

.choice-prompt {
  margin: 0 0 8px;
  color: var(--paper-dim);
  font-size: .63rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.choices {
  display: grid;
  gap: 7px;
}

.choice {
  position: relative;
  min-height: 46px;
  padding: 10px 38px 10px 13px;
  overflow: hidden;
  border: 1px solid rgba(245, 237, 218, .36);
  border-radius: 0;
  background: rgba(245, 237, 218, .06);
  color: var(--paper);
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .96rem;
  line-height: 1.2;
  text-align: left;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}

.choice::after {
  content: "↗";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tomato);
  font-family: Arial, Helvetica, sans-serif;
  font-size: .9rem;
  font-weight: 900;
}

.choice:hover {
  transform: translateX(4px);
  border-color: var(--aqua);
  background: var(--aqua);
  color: var(--ink);
}

.choice:hover::after { color: var(--ink); }

.result-actions {
  padding-top: 7px;
}

.continue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 49px;
  padding: 11px 14px;
  border: 2px solid var(--paper);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.continue:hover { background: var(--yellow); border-color: var(--yellow); }
.continue span { font-size: 1.2rem; }

.instructions {
  position: fixed;
  z-index: 50;
  left: clamp(24px, 4vw, 58px);
  bottom: clamp(62px, 7vh, 90px);
  width: min(440px, calc(100vw - 48px));
  padding: 22px 24px;
  border: 3px solid var(--paper);
  background: var(--tomato);
  color: var(--ink);
  box-shadow: 12px 14px 0 var(--ink), 14px 16px 0 var(--paper);
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
}

.instructions .back-glyph {
  position: absolute;
  top: -57px;
  left: -3px;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4rem;
  line-height: 1;
}

.instructions p {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.35;
}

.instructions button {
  min-width: 150px;
  min-height: 48px;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

body.started .instructions {
  visibility: hidden;
  opacity: 0;
  transform: translateY(20px);
}

.story-nav {
  position: relative;
  z-index: 14;
  grid-column: 1;
  grid-row: 3;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 14px;
  min-height: 54px;
  padding: 0 clamp(24px, 4vw, 58px) 18px;
}

.reconsider,
.restart {
  min-height: 44px;
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: var(--paper-dim);
  cursor: pointer;
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.reconsider {
  justify-self: start;
  color: var(--tomato);
}

.reconsider span { margin-right: 6px; font-size: 1rem; }
.restart { justify-self: end; }
.reconsider:hover,
.restart:hover { color: var(--paper); }

.memory-count {
  grid-column: 1 / -1;
  min-height: 12px;
  color: var(--aqua);
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.status {
  position: fixed;
  z-index: 60;
  right: 20px;
  bottom: 20px;
  max-width: 280px;
  padding: 10px 14px;
  transform: translateY(20px);
  opacity: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: .72rem;
  font-weight: 800;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.status.visible {
  transform: translateY(0);
  opacity: 1;
}

.memory-field {
  position: absolute;
  z-index: 10;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ghost-choice {
  position: absolute;
  right: -3vw;
  left: 32vw;
  top: var(--ghost-top, 14%);
  overflow: hidden;
  color: var(--tomato);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 6.8vw, 8rem);
  font-style: italic;
  letter-spacing: -.06em;
  line-height: .82;
  opacity: .17;
  text-align: right;
  text-decoration: line-through .06em;
  text-transform: uppercase;
  transform: rotate(var(--ghost-rotate, -4deg));
  transform-origin: center;
  animation: ghost-in .65s both;
}

.rewind-wash {
  position: absolute;
  z-index: 40;
  top: 0;
  bottom: 0;
  left: -30%;
  width: 26%;
  transform: skewX(-11deg);
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(121, 217, 220, .72), rgba(245, 237, 218, .92), transparent);
  pointer-events: none;
}

#app.is-rewinding .rewind-wash {
  animation: rewind-wash .58s cubic-bezier(.2, .8, .2, 1);
}

#app.is-rewinding .kitchen,
#app.is-rewinding .story,
#app.is-rewinding .masthead {
  animation: rewind-jolt .58s cubic-bezier(.2, .8, .2, 1);
}

#app[data-ending="true"] .light-cone {
  opacity: .72;
  background: linear-gradient(rgba(255, 213, 107, .64), rgba(255, 93, 80, .08));
}

#app[data-ending="true"] .window {
  background: linear-gradient(#123a55, #f06b59 65%, #ffc86b);
}

#app[data-ending="true"] .window-light { display: none; }

#app[data-ending="true"] .clock-face i {
  transform: translate(-50%, -100%) rotate(126deg);
}

#app[data-ending="true"] .person {
  filter: none;
  opacity: 1;
}

noscript {
  display: block;
  padding: 20px;
  background: var(--tomato);
  color: var(--ink);
  font-weight: 800;
}

@keyframes line-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ghost-in {
  from { opacity: 0; transform: translateX(70px) rotate(var(--ghost-rotate, -4deg)); }
  to { opacity: .17; transform: translateX(0) rotate(var(--ghost-rotate, -4deg)); }
}

@keyframes rewind-wash {
  0% { left: 110%; opacity: 0; }
  18% { opacity: .9; }
  100% { left: -35%; opacity: 0; }
}

@keyframes rewind-jolt {
  0%, 100% { transform: translateX(0); filter: none; }
  36% { transform: translateX(8px); filter: saturate(.2) contrast(1.5); }
  58% { transform: translateX(-4px); }
}

@media (max-width: 1080px) {
  #app {
    grid-template-columns: minmax(310px, 42vw) minmax(470px, 1fr);
  }

  .kitchen { left: 35%; }
  .person { width: clamp(108px, 14vw, 160px); }
  .person-mara { left: 9%; }
  .person-eli { left: 41%; }
}

@media (max-width: 820px) {
  #app {
    display: block;
    min-height: 100dvh;
    overflow: visible;
    background: var(--ink);
  }

  .night {
    position: fixed;
  }

  .masthead {
    position: absolute;
    top: 0;
    left: 0;
    width: 58%;
    padding: 18px 0 0 18px;
  }

  .series {
    margin-bottom: 9px;
    font-size: .52rem;
  }

  h1 {
    font-size: clamp(2.7rem, 12vw, 5rem);
    line-height: .78;
  }

  .premise { display: none; }

  .kitchen {
    position: relative;
    inset: auto;
    height: 47dvh;
    min-height: 360px;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(7, 21, 37, .2), transparent);
  }

  .wall {
    inset: 5% -18% 9% 22%;
  }

  .window {
    left: 9%;
    width: 34%;
  }

  .cabinet-a { right: 27%; }
  .cabinet-b { right: 5%; }
  .clock-face { right: 10%; width: 48px; }

  .lamp {
    left: 65%;
    width: 170px;
  }

  .lamp-shade { width: 82px; height: 46px; }
  .light-cone { width: 210px; height: 360px; }

  .person {
    width: 112px;
    height: 238px;
  }

  .person-mara { left: 8%; bottom: 11%; }
  .person-eli { left: 38%; bottom: 12%; }
  .person-june { right: 1%; bottom: 10%; }

  .nameplate {
    min-width: 82px;
    padding: 5px 7px;
  }

  .nameplate b { font-size: .86rem; }
  .nameplate span { font-size: .43rem; }

  .island {
    right: -5%;
    bottom: -4%;
    left: 1%;
    height: 29%;
  }

  .letter { left: 50%; width: 90px; }
  .key { left: 34%; transform: scale(.75) rotate(17deg); }
  .mug { transform: scale(.78); }
  .mug-b { transform: scale(.78) rotate(8deg); }

  .story {
    min-height: 0;
    margin: 0;
    padding: 22px 20px 18px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    background: rgba(7, 21, 37, .98);
    box-shadow: none;
    backdrop-filter: none;
  }

  .story::before {
    right: 0;
    left: 0;
  }

  .story-echo {
    right: 3%;
    top: 25%;
    width: 72%;
    font-size: clamp(2.25rem, 11vw, 4.2rem);
    opacity: .2;
  }

  .lines { min-height: 112px; }
  .line-text { font-size: 1.06rem; }
  .choice { min-height: 50px; font-size: 1rem; }

  .story-nav {
    display: grid;
    min-height: 70px;
    padding: 8px 20px calc(16px + env(safe-area-inset-bottom));
    background: var(--ink);
  }

  .instructions {
    left: 18px;
    bottom: calc(22px + env(safe-area-inset-bottom));
    width: calc(100vw - 36px);
    padding: 20px;
    box-shadow: 8px 9px 0 var(--ink), 10px 11px 0 var(--paper);
  }

  .instructions .back-glyph { top: -48px; font-size: 3.3rem; }

  .ghost-choice {
    position: fixed;
    right: -8vw;
    left: 6vw;
    top: var(--ghost-top, 19%);
    font-size: clamp(2.2rem, 15vw, 5.7rem);
  }
}

@media (max-width: 430px) {
  .kitchen {
    height: 45dvh;
    min-height: 340px;
  }

  .masthead { width: 68%; }
  .person { width: 96px; height: 216px; }
  .person-mara { left: 7%; }
  .person-eli { left: 37%; }
  .person-june { right: -2%; }
  .nameplate span { display: none; }
  .wall { left: 18%; }
  .letter { left: 49%; }
  .line { grid-template-columns: 43px 1fr; }
  .story-heading { gap: 8px; }
  .chapter, .time { letter-spacing: .11em; }
}

@media (max-height: 760px) and (min-width: 821px) {
  .masthead { padding-top: 24px; }
  h1 { font-size: clamp(3.2rem, 5vw, 5.5rem); }
  .premise { margin-top: 12px; }
  .story { min-height: 300px; padding-top: 17px; padding-bottom: 17px; }
  .lines { min-height: 88px; padding-top: 12px; padding-bottom: 6px; }
  .choice { min-height: 40px; padding-top: 7px; padding-bottom: 7px; }
  .person { height: 330px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
