:root {
  --night: #0c1427;
  --hall: #13223b;
  --hall-warm: #223653;
  --ink: #171a22;
  --paper: #f3e9cc;
  --paper-deep: #e5d5ae;
  --chalk: #e9eee6;
  --muted: #aeb9c4;
  --brass: #d7a94f;
  --brass-dark: #8d6729;
  --coral: #d86049;
  --coral-dark: #8d3328;
  --teal: #3d8989;
  --teal-dark: #1f555b;
  --ochre: #c9953e;
  --ochre-dark: #7d5924;
  --shadow: rgba(3, 8, 19, 0.48);
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --body: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --utility: "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  color-scheme: dark;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--night);
  scroll-behavior: auto;
}

body {
  position: relative;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--chalk);
  background:
    radial-gradient(circle at 80% 12%, rgba(215, 169, 79, 0.13), transparent 25rem),
    linear-gradient(145deg, #172b48 0%, var(--hall) 48%, var(--night) 100%);
  font-family: var(--body);
}

body::before {
  content: "";
  position: fixed;
  z-index: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34px;
  border-top: 4px solid rgba(215, 169, 79, 0.36);
  background: #09101f;
  box-shadow: 0 -8px 30px rgba(2, 7, 16, 0.3);
  pointer-events: none;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled),
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid #ffe29b;
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

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

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

.hall-light,
.wall-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hall-light {
  background:
    linear-gradient(104deg, transparent 0 62%, rgba(248, 211, 139, 0.055) 62.2% 62.8%, transparent 63% 100%),
    radial-gradient(ellipse at 38% 0%, rgba(129, 177, 185, 0.11), transparent 46%);
}

.wall-grain {
  opacity: 0.17;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.035) 4px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.025) 0 1px, transparent 1px 5px);
  mix-blend-mode: overlay;
}

.house-header,
main,
.house-footer {
  position: relative;
  z-index: 2;
}

.house-header {
  display: flex;
  width: min(1320px, calc(100% - 48px));
  min-height: 82px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(230, 238, 231, 0.14);
}

.house-mark {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--chalk);
  text-decoration: none;
}

.house-mark__key {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(215, 169, 79, 0.58);
  border-radius: 50%;
  color: var(--brass);
  font-size: 1.25rem;
  transform: rotate(45deg);
}

.house-mark strong,
.house-mark small {
  display: block;
}

.house-mark strong {
  font-family: var(--display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.house-mark small {
  margin-top: 1px;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.room-tools {
  display: flex;
  gap: 8px;
}

.tool-button,
.back-button,
.draw-again,
.clock-button,
.text-action,
.house-footer button {
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.tool-button {
  display: inline-flex;
  min-height: 42px;
  padding: 8px 12px;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(230, 238, 231, 0.14);
  border-radius: 3px;
  font-family: var(--utility);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tool-button:hover {
  border-color: rgba(215, 169, 79, 0.58);
  color: var(--chalk);
  background: rgba(255, 255, 255, 0.035);
}

main {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
}

.hallway {
  display: grid;
  min-height: calc(100vh - 142px);
  padding: clamp(44px, 7vh, 86px) 0 76px;
  grid-template-columns: minmax(390px, 0.86fr) minmax(560px, 1.14fr);
  gap: clamp(48px, 7vw, 104px);
  align-items: center;
}

.hallway__copy {
  align-self: center;
}

.eyebrow {
  display: flex;
  margin: 0 0 18px;
  gap: 9px;
  align-items: center;
  color: var(--brass);
  font-family: var(--utility);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 28px;
  height: 2px;
  background: currentColor;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.25rem, 5.4vw, 5.5rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

h1 em {
  color: var(--paper);
  font-weight: 400;
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.12em;
}

.lede {
  max-width: 580px;
  margin: 26px 0 0;
  color: #c6d0d7;
  font-family: var(--display);
  font-size: clamp(1.1rem, 1.5vw, 1.32rem);
  line-height: 1.55;
}

.work-slip {
  max-width: 570px;
  margin-top: 38px;
}

.work-slip label,
.making-desk > label {
  display: block;
  margin: 0 0 10px;
  color: #d6dfe3;
  font-family: var(--utility);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.work-slip__paper {
  position: relative;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(46, 82, 101, 0.14) 31px 32px),
    var(--paper);
  box-shadow: 0 18px 50px rgba(3, 8, 19, 0.3), inset 0 0 40px rgba(141, 103, 41, 0.1);
  transform: rotate(-0.7deg);
}

.work-slip__paper::before {
  content: "WORKING FRAGMENT";
  position: absolute;
  z-index: 1;
  top: -11px;
  right: 22px;
  padding: 5px 9px 4px;
  color: #f8e9ca;
  background: var(--coral-dark);
  font-family: var(--utility);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  transform: rotate(1.5deg);
}

.work-slip__paper textarea {
  display: block;
  width: 100%;
  min-height: 102px;
  padding: 24px 42px 18px 24px;
  resize: vertical;
  border: 0;
  border-left: 4px solid rgba(191, 77, 64, 0.62);
  border-radius: 0;
  outline-color: var(--coral);
  color: var(--ink);
  background: transparent;
  font-family: var(--display);
  font-size: 1.08rem;
  line-height: 1.85;
}

.work-slip__paper textarea::placeholder {
  color: rgba(23, 26, 34, 0.56);
}

.work-slip__pin {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: inset -2px -2px 0 var(--brass-dark), 0 2px 3px rgba(0, 0, 0, 0.35);
}

.input-note {
  margin: 14px 0 0;
  color: #95a5b2;
  font-size: 0.82rem;
}

.doors-ready .input-note {
  color: #d8c69b;
}

.door-gallery {
  position: relative;
  display: grid;
  min-width: 0;
  padding: 48px 30px 34px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(13px, 2vw, 26px);
  align-items: end;
  border-bottom: 12px solid #080f1e;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent 20% 80%, rgba(0, 0, 0, 0.11)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.09), transparent 60%);
  box-shadow: inset 0 -1px 0 rgba(215, 169, 79, 0.25);
}

.door-gallery::before {
  content: "AUTHORIZED CREATIVE EXITS";
  position: absolute;
  top: 0;
  left: 50%;
  padding: 9px 18px 7px;
  border: 1px solid rgba(215, 169, 79, 0.5);
  color: var(--brass);
  background: #101a2f;
  font-family: var(--utility);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  white-space: nowrap;
  transform: translateX(-50%);
}

.door-choice {
  --door: var(--coral);
  --door-dark: var(--coral-dark);
  position: relative;
  min-width: 0;
  aspect-ratio: 0.55;
  padding: 0;
  border: 8px solid #0a1222;
  border-bottom-width: 12px;
  border-radius: 2px 2px 0 0;
  background: #080e1a;
  box-shadow:
    0 22px 34px rgba(1, 5, 12, 0.3),
    0 0 0 2px rgba(215, 169, 79, 0.14),
    inset 0 0 38px rgba(0, 0, 0, 0.75);
  perspective: 1100px;
  cursor: pointer;
  isolation: isolate;
}

.door-choice--strange {
  --door: var(--teal);
  --door-dark: var(--teal-dark);
}

.door-choice--true {
  --door: var(--ochre);
  --door-dark: var(--ochre-dark);
}

.door-choice:disabled {
  cursor: not-allowed;
}

.door-choice__room,
.door-choice__leaf,
.door-choice__light {
  position: absolute;
  inset: 0;
}

.door-choice__room {
  display: grid;
  overflow: hidden;
  place-items: center;
  color: rgba(255, 239, 192, 0.5);
  background:
    radial-gradient(circle at 50% 66%, rgba(255, 211, 125, 0.35), transparent 26%),
    linear-gradient(180deg, #050a12, #142236);
}

.door-choice__room::before {
  content: "";
  position: absolute;
  right: 14%;
  bottom: 0;
  left: 14%;
  height: 34%;
  background: linear-gradient(170deg, transparent 45%, rgba(215, 169, 79, 0.2) 46% 100%);
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
}

.room-symbol {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 4.5rem);
  opacity: 0.65;
  transform: translateY(-12%);
}

.door-choice__light {
  z-index: -1;
  inset: 12% -18% -8%;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(249, 210, 130, 0.36), transparent 66%);
  transition: opacity 300ms ease;
}

.door-choice__leaf {
  display: grid;
  padding: 14% 11% 12%;
  grid-template-rows: 1fr auto 1fr;
  border: 2px solid color-mix(in srgb, var(--door-dark) 82%, black);
  color: #f7edda;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 12% 88%, rgba(0, 0, 0, 0.16)),
    var(--door);
  box-shadow:
    inset 7px 0 0 rgba(255, 255, 255, 0.05),
    inset -10px 0 18px rgba(0, 0, 0, 0.16);
  transform: rotateY(0deg);
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 800ms cubic-bezier(0.18, 0.78, 0.25, 1), filter 220ms ease;
  backface-visibility: hidden;
}

.door-choice:disabled .door-choice__leaf {
  filter: saturate(0.35) brightness(0.63);
}

.door-choice:not(:disabled):hover .door-choice__leaf {
  filter: brightness(1.1);
  transform: rotateY(-9deg);
}

.door-choice:not(:disabled):hover .door-choice__light,
.door-choice:focus-visible .door-choice__light {
  opacity: 0.55;
}

.door-choice.is-opening .door-choice__leaf,
.door-choice.is-opening:hover .door-choice__leaf {
  filter: brightness(0.92);
  transform: rotateY(-76deg);
}

.door-choice.is-opening .door-choice__light {
  opacity: 1;
}

.door-choice__panel {
  border: 2px solid color-mix(in srgb, var(--door-dark) 76%, black);
  background: rgba(255, 255, 255, 0.025);
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.025),
    inset 0 10px 20px rgba(255, 255, 255, 0.025),
    inset 0 -12px 18px rgba(0, 0, 0, 0.08);
}

.door-choice__sign {
  position: relative;
  z-index: 2;
  width: 112%;
  margin: 12px 0 11px -6%;
  padding: 11px 6px 10px;
  border: 1px solid rgba(248, 232, 195, 0.62);
  color: #241e18;
  background: var(--paper);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.14);
  text-align: center;
  transform: rotate(-1deg);
}

.door-choice--strange .door-choice__sign {
  transform: rotate(1.3deg);
}

.door-choice--true .door-choice__sign {
  transform: rotate(-0.4deg);
}

.door-choice__sign small,
.door-choice__sign strong {
  display: block;
}

.door-choice__sign small {
  margin-bottom: 5px;
  color: #725d3d;
  font-family: var(--utility);
  font-size: clamp(0.44rem, 0.75vw, 0.6rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.door-choice__sign strong {
  font-family: var(--display);
  font-size: clamp(1rem, 1.7vw, 1.42rem);
  font-weight: 650;
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.door-choice__knob {
  position: absolute;
  z-index: 3;
  top: 54%;
  right: 10%;
  width: clamp(10px, 1.25vw, 15px);
  height: clamp(10px, 1.25vw, 15px);
  border: 2px solid #f0cf7c;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: inset -3px -3px 0 var(--brass-dark), 0 3px 5px rgba(0, 0, 0, 0.32);
}

.door-gallery__instruction {
  position: absolute;
  right: 0;
  bottom: -46px;
  left: 0;
  margin: 0;
  color: #8295a6;
  font-family: var(--display);
  font-size: 0.86rem;
  font-style: italic;
  text-align: center;
}

.workroom {
  min-height: calc(100vh - 142px);
  padding: 32px 0 72px;
}

.workroom__topline {
  display: flex;
  min-height: 46px;
  margin-bottom: 22px;
  align-items: center;
  justify-content: space-between;
}

.back-button {
  min-height: 42px;
  padding: 6px 0;
  color: #b8c6cf;
  font-size: 0.82rem;
}

.back-button:hover,
.draw-again:hover,
.clock-button:hover,
.text-action:hover,
.house-footer button:hover {
  color: var(--paper);
}

.workroom__door-label {
  margin: 0;
  color: var(--brass);
  font-family: var(--utility);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.workroom__layout {
  position: relative;
  display: grid;
  min-height: 600px;
  grid-template-columns: minmax(330px, 0.88fr) 178px minmax(380px, 1fr);
  gap: clamp(22px, 3vw, 44px);
  align-items: center;
}

.prompt-card {
  --card-accent: var(--coral);
  position: relative;
  min-height: 500px;
  padding: clamp(32px, 4vw, 58px);
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 44px, rgba(185, 77, 62, 0.22) 44px 46px, transparent 46px),
    repeating-linear-gradient(0deg, transparent 0 35px, rgba(47, 76, 95, 0.11) 35px 36px),
    var(--paper);
  box-shadow: 0 32px 70px rgba(2, 7, 17, 0.46), inset 0 0 60px rgba(142, 104, 48, 0.12);
  transform: rotate(-0.55deg);
}

.workroom[data-door="strange"] .prompt-card {
  --card-accent: var(--teal);
}

.workroom[data-door="true"] .prompt-card {
  --card-accent: var(--ochre);
}

.prompt-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 100%;
  background: var(--card-accent);
}

.prompt-card__clip {
  position: absolute;
  top: -13px;
  left: 26%;
  width: 46px;
  height: 76px;
  border: 4px solid #9c7941;
  border-bottom-color: transparent;
  border-radius: 22px 22px 0 0;
  opacity: 0.76;
  transform: rotate(5deg);
}

.prompt-card__task {
  margin: 0 0 26px;
  padding-left: 22px;
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.45;
}

.prompt-card__task span {
  display: block;
  margin-bottom: 4px;
  color: #7e6c50;
  font-family: var(--utility);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.prompt-card__task strong {
  font-weight: 600;
}

.prompt-card__rule {
  width: 52px;
  height: 5px;
  margin: 0 0 30px 22px;
  background: var(--card-accent);
}

.prompt-card__kind {
  margin: 0 0 7px 22px;
  color: #79684e;
  font-family: var(--utility);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.prompt-card h2 {
  margin: 0 0 18px 22px;
  font-family: var(--display);
  font-size: clamp(2.6rem, 4.3vw, 4.5rem);
  font-weight: 560;
  line-height: 0.93;
  letter-spacing: -0.05em;
}

.prompt-card__instruction {
  max-width: 570px;
  margin: 0 0 30px 22px;
  font-family: var(--display);
  font-size: clamp(1.14rem, 1.55vw, 1.35rem);
  line-height: 1.55;
}

.draw-again {
  margin: 4px 0 0 22px;
  padding: 8px 0;
  color: #5f665f;
  font-family: var(--utility);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.clock-panel {
  display: flex;
  min-width: 0;
  padding: 24px 10px;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.hourglass {
  --sand-top: 1;
  --sand-bottom: 0.06;
  position: relative;
  width: 82px;
  height: 150px;
  margin-bottom: 17px;
}

.hourglass__cap {
  position: absolute;
  z-index: 2;
  right: 4px;
  left: 4px;
  height: 14px;
  border: 2px solid #8c672b;
  background: linear-gradient(180deg, #e9c369, #a8762f);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
}

.hourglass__cap--top {
  top: 0;
}

.hourglass__cap--bottom {
  bottom: 0;
}

.hourglass__glass {
  position: absolute;
  top: 13px;
  right: 12px;
  bottom: 13px;
  left: 12px;
  overflow: hidden;
  border: 2px solid rgba(226, 234, 225, 0.42);
  background: rgba(212, 230, 230, 0.08);
  clip-path: polygon(0 0, 100% 0, 62% 48%, 100% 100%, 0 100%, 38% 48%);
}

.hourglass__sand {
  position: absolute;
  right: 7px;
  left: 7px;
  background: linear-gradient(90deg, #b97b2c, #f0c968 48%, #b87829);
}

.hourglass__sand--top {
  top: 8px;
  height: 49px;
  clip-path: polygon(0 0, 100% 0, 62% 100%, 38% 100%);
  transform: scaleY(var(--sand-top));
  transform-origin: top center;
}

.hourglass__sand--bottom {
  bottom: 7px;
  height: 50px;
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  transform: scaleY(var(--sand-bottom));
  transform-origin: bottom center;
}

.hourglass__stream {
  position: absolute;
  z-index: 2;
  top: 54px;
  left: calc(50% - 1px);
  width: 2px;
  height: 32px;
  background: #e9bc54;
  opacity: 0.8;
  animation: sand-stream 460ms linear infinite;
}

.clock-off .hourglass__stream,
.clock-done .hourglass__stream {
  animation: none;
  opacity: 0;
}

.clock-panel__time {
  margin: 0;
  color: var(--paper);
  font-family: var(--utility);
  font-size: 2.35rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.clock-panel__note {
  margin: 8px 0 14px;
  color: #9eadb8;
  font-family: var(--display);
  font-size: 0.83rem;
  line-height: 1.45;
}

.clock-button {
  min-height: 38px;
  padding: 7px 4px;
  font-family: var(--utility);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-transform: uppercase;
}

.making-desk {
  position: relative;
  align-self: stretch;
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid rgba(215, 169, 79, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 50%),
    rgba(6, 13, 27, 0.38);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.18);
}

.making-desk__paper {
  position: relative;
  overflow: hidden;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(52, 88, 107, 0.16) 31px 32px),
    #f1e6ca;
  box-shadow: 0 20px 50px rgba(2, 7, 17, 0.33), inset 0 0 45px rgba(141, 103, 41, 0.09);
  transition: transform 380ms ease, opacity 380ms ease, filter 380ms ease;
}

.making-desk__paper.is-shredding {
  opacity: 0;
  filter: blur(2px);
  transform: translateY(180px) scaleX(0.72) scaleY(0.28);
}

.making-desk__paper textarea {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  min-height: 310px;
  padding: 21px 26px 20px 48px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  outline-color: var(--brass);
  color: var(--ink);
  background: transparent;
  font-family: var(--display);
  font-size: 1.08rem;
  line-height: 1.82;
}

.making-desk__paper textarea::placeholder {
  color: rgba(23, 26, 34, 0.5);
}

.paper-margin {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 34px;
  width: 2px;
  background: rgba(191, 77, 64, 0.38);
}

.making-desk__actions,
.ending__actions {
  display: flex;
  margin-top: 18px;
  gap: 10px;
  align-items: stretch;
}

.primary-action,
.secondary-action,
.shred-action {
  min-height: 48px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--utility);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.primary-action {
  flex: 1;
  color: #1b1813;
  background: var(--brass);
  box-shadow: 0 5px 0 #72501f;
}

.primary-action:hover:not(:disabled) {
  background: #e7bd67;
  transform: translateY(-2px);
}

.primary-action:active:not(:disabled) {
  box-shadow: 0 2px 0 #72501f;
  transform: translateY(3px);
}

.primary-action:disabled,
.shred-action:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.secondary-action,
.shred-action {
  color: #c3cfd6;
  border-color: rgba(230, 238, 231, 0.22);
  background: rgba(255, 255, 255, 0.025);
}

.secondary-action:hover,
.shred-action:hover:not(:disabled) {
  border-color: rgba(215, 169, 79, 0.6);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.055);
}

.making-desk__privacy {
  margin: 18px 0 0;
  color: #8192a0;
  font-size: 0.73rem;
  line-height: 1.45;
}

.shredder {
  position: absolute;
  z-index: -1;
  right: 13%;
  bottom: -25px;
  width: 170px;
  height: 108px;
  opacity: 0;
  color: #9faeb7;
  background: linear-gradient(180deg, #25344a, #101a2d);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(24px);
  transition: opacity 240ms ease, transform 240ms ease;
  text-align: center;
}

.shredder.is-active {
  z-index: 4;
  opacity: 1;
  transform: translateY(0);
}

.shredder__slot {
  display: block;
  width: 130px;
  height: 8px;
  margin: 18px auto 12px;
  border-radius: 10px;
  background: #040811;
  box-shadow: inset 0 2px 3px black;
}

.shredder__body {
  font-family: var(--utility);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.5;
}

.ending {
  display: grid;
  min-height: calc(100vh - 142px);
  padding: 60px 24px 90px;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.ending__artifact {
  position: relative;
  display: grid;
  width: 150px;
  height: 150px;
  margin-bottom: 35px;
  place-items: center;
}

.ending__glow {
  position: absolute;
  inset: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(215, 169, 79, 0.3), transparent 64%);
  animation: breathe 4s ease-in-out infinite;
}

.ending__paper {
  position: relative;
  display: grid;
  width: 92px;
  height: 112px;
  place-items: center;
  color: var(--coral-dark);
  background: var(--paper);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
  font-family: var(--display);
  font-size: 2.6rem;
  transform: rotate(-4deg);
}

.ending .eyebrow {
  justify-content: center;
}

.ending h2 {
  max-width: 740px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.2rem, 6vw, 6rem);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.ending > p:not(.eyebrow) {
  max-width: 620px;
  margin: 22px auto 0;
  color: #bdcad2;
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.55;
}

.ending__actions {
  margin-top: 34px;
}

.house-footer {
  display: flex;
  width: min(1320px, calc(100% - 48px));
  min-height: 60px;
  margin: 0 auto;
  padding-bottom: 20px;
  align-items: flex-start;
  justify-content: space-between;
  color: #748797;
  font-size: 0.72rem;
}

.house-footer p {
  margin: 0;
}

.house-footer button {
  padding: 0;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

dialog {
  width: min(760px, calc(100% - 32px));
  max-height: min(82vh, 820px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(215, 169, 79, 0.5);
  border-radius: 2px;
  color: var(--chalk);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 35%),
    #111d32;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.62);
}

dialog::backdrop {
  background: rgba(3, 8, 18, 0.78);
  backdrop-filter: blur(5px);
}

.drawer__header {
  display: flex;
  padding: 34px 38px 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.drawer .eyebrow,
.about .eyebrow {
  margin-bottom: 10px;
}

.drawer h2,
.about h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.3rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.dialog-close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(230, 238, 231, 0.2);
  border-radius: 50%;
  color: #c9d3d9;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
}

.dialog-close:hover {
  border-color: var(--brass);
  color: var(--paper);
}

.drawer__intro {
  margin: 0;
  padding: 0 38px 28px;
  color: #9eafb9;
  font-family: var(--display);
  line-height: 1.55;
}

.drawer__items {
  display: grid;
  padding: 0 38px 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.keeper-card {
  position: relative;
  min-height: 190px;
  padding: 24px 24px 56px;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(52, 88, 107, 0.12) 28px 29px),
    var(--paper);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.keeper-card:nth-child(3n + 1) {
  transform: rotate(-0.5deg);
}

.keeper-card:nth-child(3n + 2) {
  transform: rotate(0.6deg);
}

.keeper-card__meta {
  display: flex;
  margin: 0 0 14px;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: #806d4e;
  font-family: var(--utility);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.keeper-card__text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.55;
}

.keeper-card__task {
  margin: 15px 0 0;
  color: #74684f;
  font-size: 0.72rem;
  line-height: 1.4;
}

.keeper-card__actions {
  position: absolute;
  right: 18px;
  bottom: 16px;
  left: 18px;
  display: flex;
  justify-content: space-between;
}

.keeper-card button {
  padding: 5px;
  border: 0;
  color: #765f3b;
  background: transparent;
  font-family: var(--utility);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.keeper-card button:hover {
  color: var(--coral-dark);
}

.drawer__empty {
  display: grid;
  min-height: 220px;
  padding: 30px;
  place-content: center;
  justify-items: center;
  color: #8295a4;
  text-align: center;
}

.drawer__empty span {
  color: var(--brass);
  font-size: 3.2rem;
}

.drawer__empty p {
  margin: 12px 0 0;
  font-family: var(--display);
}

.drawer__footer {
  display: flex;
  padding: 20px 38px 34px;
  gap: 18px;
  border-top: 1px solid rgba(230, 238, 231, 0.1);
  justify-content: flex-end;
}

.text-action {
  min-height: 38px;
  padding: 6px 0;
  font-size: 0.72rem;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.text-action--danger:hover {
  color: #ef9684;
}

.about {
  max-width: 630px;
  padding: 46px 48px 48px;
}

.about .dialog-close {
  position: absolute;
  top: 20px;
  right: 20px;
}

.about > p:not(.eyebrow) {
  color: #b9c6ce;
  font-family: var(--display);
  font-size: 1.06rem;
  line-height: 1.65;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100% - 48px));
  padding: 14px 18px;
  border: 1px solid rgba(215, 169, 79, 0.54);
  color: var(--paper);
  background: #0a1324;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  font-family: var(--display);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes sand-stream {
  0%, 100% { transform: scaleY(0.7); }
  50% { transform: scaleY(1); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.62; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.05); }
}

@media (max-width: 1080px) {
  .hallway {
    grid-template-columns: minmax(320px, 0.82fr) minmax(450px, 1.18fr);
    gap: 38px;
  }

  .door-gallery {
    padding-right: 18px;
    padding-left: 18px;
  }

  .workroom__layout {
    grid-template-columns: minmax(390px, 1fr) 160px;
    align-items: start;
  }

  .making-desk {
    grid-column: 1 / -1;
  }

  .making-desk__paper textarea {
    min-height: 230px;
  }
}

@media (max-width: 800px) {
  .house-header,
  main,
  .house-footer {
    width: min(100% - 32px, 680px);
  }

  .house-header {
    min-height: 72px;
  }

  .hallway {
    min-height: auto;
    padding: 44px 0 82px;
    grid-template-columns: 1fr;
    gap: 58px;
  }

  .hallway__copy {
    max-width: 650px;
  }

  h1 {
    font-size: clamp(3.5rem, 11vw, 5.25rem);
  }

  .door-gallery {
    width: min(100%, 620px);
    margin: 0 auto;
  }

  .door-choice__sign strong {
    font-size: clamp(1.1rem, 3.2vw, 1.5rem);
  }

  .workroom__layout {
    grid-template-columns: 1fr 150px;
    gap: 22px;
  }

  .prompt-card {
    min-height: 440px;
  }

  .clock-panel {
    align-self: center;
  }

  .making-desk {
    grid-column: 1 / -1;
  }

  .shredder {
    right: 10%;
  }
}

@media (max-width: 560px) {
  body::before {
    height: 22px;
  }

  .house-header,
  main,
  .house-footer {
    width: calc(100% - 24px);
  }

  .house-header {
    min-height: 66px;
  }

  .house-mark__key {
    width: 31px;
    height: 31px;
  }

  .house-mark strong {
    font-size: 0.96rem;
  }

  .house-mark small,
  #soundToggle span:last-child,
  #drawerButton span:first-child {
    display: none;
  }

  .room-tools {
    gap: 5px;
  }

  .tool-button {
    min-width: 41px;
    min-height: 41px;
    padding: 7px 9px;
    justify-content: center;
    font-size: 0.64rem;
  }

  .hallway {
    padding: 34px 0 72px;
    gap: 52px;
  }

  .eyebrow {
    margin-bottom: 14px;
    font-size: 0.63rem;
  }

  h1 {
    font-size: clamp(2.75rem, 14vw, 4rem);
    line-height: 0.97;
  }

  .lede {
    margin-top: 20px;
    font-size: 1rem;
  }

  .work-slip {
    margin-top: 30px;
  }

  .work-slip__paper textarea {
    min-height: 92px;
    padding: 22px 30px 16px 18px;
    font-size: 0.96rem;
  }

  .door-gallery {
    padding: 43px 5px 25px;
    gap: 7px;
    border-bottom-width: 8px;
  }

  .door-gallery::before {
    padding-right: 12px;
    padding-left: 12px;
    font-size: 0.52rem;
  }

  .door-choice {
    border-width: 5px;
    border-bottom-width: 8px;
  }

  .door-choice__leaf {
    padding: 12% 8% 10%;
  }

  .door-choice__sign {
    width: 116%;
    margin-left: -8%;
    padding: 8px 2px 7px;
  }

  .door-choice__sign small {
    display: none;
  }

  .door-choice__sign strong {
    font-size: clamp(0.73rem, 3.6vw, 1rem);
    line-height: 0.98;
  }

  .door-choice__knob {
    right: 7%;
    width: 9px;
    height: 9px;
    border-width: 1px;
  }

  .door-gallery__instruction {
    bottom: -40px;
    font-size: 0.76rem;
  }

  .workroom {
    padding: 18px 0 70px;
  }

  .workroom__topline {
    margin-bottom: 12px;
  }

  .workroom__door-label {
    max-width: 45%;
    font-size: 0.58rem;
    text-align: right;
  }

  .workroom__layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .prompt-card {
    min-height: 400px;
    padding: 35px 28px 30px;
    background:
      linear-gradient(90deg, transparent 0 29px, rgba(185, 77, 62, 0.22) 29px 31px, transparent 31px),
      repeating-linear-gradient(0deg, transparent 0 31px, rgba(47, 76, 95, 0.11) 31px 32px),
      var(--paper);
  }

  .prompt-card__task,
  .prompt-card__kind,
  .prompt-card h2,
  .prompt-card__instruction,
  .draw-again {
    margin-left: 12px;
  }

  .prompt-card__rule {
    margin-left: 12px;
  }

  .prompt-card h2 {
    font-size: clamp(2.5rem, 13vw, 4rem);
  }

  .prompt-card__instruction {
    font-size: 1.07rem;
  }

  .clock-panel {
    display: grid;
    width: 100%;
    padding: 8px 10px 14px;
    grid-template-columns: 66px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 18px;
    text-align: left;
  }

  .hourglass {
    width: 56px;
    height: 104px;
    margin: 0;
    grid-row: 1 / 4;
  }

  .hourglass__glass {
    right: 9px;
    left: 9px;
  }

  .hourglass__sand--top {
    height: 35px;
  }

  .hourglass__sand--bottom {
    height: 35px;
  }

  .hourglass__stream {
    top: 38px;
    height: 22px;
  }

  .clock-panel__time {
    align-self: end;
    font-size: 2rem;
  }

  .clock-panel__note {
    margin: 2px 0 0;
    font-size: 0.75rem;
  }

  .clock-button {
    justify-self: start;
    padding-left: 0;
  }

  .making-desk {
    padding: 22px 14px 24px;
  }

  .making-desk__paper textarea {
    min-height: 245px;
    padding: 18px 18px 18px 38px;
    font-size: 1rem;
  }

  .paper-margin {
    left: 28px;
  }

  .making-desk__actions,
  .ending__actions {
    flex-direction: column;
  }

  .shred-action,
  .secondary-action {
    min-height: 44px;
  }

  .ending {
    min-height: calc(100vh - 126px);
    padding: 48px 12px 80px;
  }

  .ending__artifact {
    margin-bottom: 22px;
  }

  .ending h2 {
    font-size: clamp(2.85rem, 14vw, 4.4rem);
  }

  .ending > p:not(.eyebrow) {
    font-size: 1.02rem;
  }

  .house-footer {
    min-height: 76px;
    gap: 18px;
    flex-direction: column;
    justify-content: flex-start;
  }

  .drawer__header,
  .drawer__intro,
  .drawer__items,
  .drawer__footer {
    padding-right: 20px;
    padding-left: 20px;
  }

  .drawer__header {
    padding-top: 25px;
  }

  .drawer h2,
  .about h2 {
    font-size: 2.4rem;
  }

  .drawer__items {
    grid-template-columns: 1fr;
  }

  .drawer__footer {
    justify-content: space-between;
  }

  .about {
    padding: 58px 24px 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
