/* DiestelKraft murphy beds
   Wall paint sets --bg / --bg-2 / --glow. data-contrast flips type and controls. */
:root {
  color-scheme: dark;
  --bg: #1b120d;
  --bg-2: #241911;
  --glow: #6a3f25;
  --cream: #fbeedd;
  --cream-soft: #c9b39a;
  --ember: #e0762f;
  --accent: #8a5a38;
  --accent-rgb: 138 90 56;
  --shade: 20 12 8;
  --shade-a: 0.45;
  --ring-a: 0.18;
  --bloom-a: 0.35;
  --btn-ring-a: 0.16;
  --btn-bloom-a: 0.3;
  --err: #f0a477;
  --pill: color-mix(in srgb, var(--bg) 55%, #6b4a32);
  --field: color-mix(in srgb, var(--bg) 72%, #4a3324);
  --line: color-mix(in srgb, var(--cream) 22%, transparent);
  --line-strong: color-mix(in srgb, var(--cream) 40%, transparent);
  --opt-bg: color-mix(in srgb, var(--pill) 88%, transparent);
  --veil: rgb(14 9 6 / 72%);
  --cap-shadow: 0 2px 30px rgb(var(--shade) / var(--shade-a));
  --modal-shadow: 0 40px 100px -30px rgb(var(--shade) / var(--shade-a));
  --sans: "Figtree", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 64px);
}
html[data-contrast="dark"] {
  color-scheme: dark;
  --cream: #fbeedd;
  --cream-soft: #c9b39a;
  --err: #f0a477;
  --pill: color-mix(in srgb, var(--bg) 55%, #6b4a32);
  --field: color-mix(in srgb, var(--bg) 72%, #4a3324);
  --veil: rgb(14 9 6 / 72%);
}
html[data-contrast="light"] {
  color-scheme: light;
  --cream: #1b120d;
  --cream-soft: #5a4334;
  --accent: #8a5a38;
  --accent-rgb: 138 90 56;
  --err: #9a3412;
  --pill: color-mix(in srgb, #f5f3f0 78%, var(--bg));
  --field: color-mix(in srgb, #faf9f7 86%, var(--bg));
  --opt-bg: color-mix(in srgb, var(--pill) 92%, transparent);
  --veil: color-mix(in srgb, var(--bg) 28%, rgb(27 18 13 / 45%));
  --cap-shadow: 0 1px 8px rgb(var(--shade) / var(--shade-a));
  --modal-shadow: 0 24px 60px -24px rgb(var(--shade) / var(--shade-a));
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px));
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1,
h2,
h3,
p {
  margin: 0;
}
a {
  color: inherit;
}
.muted {
  color: var(--cream-soft);
}

/* Type scale */
.hero {
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(3.2rem, 9vw, 9.5rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
}
.huge {
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(3.4rem, 11vw, 11rem);
  line-height: 0.84;
  letter-spacing: -0.045em;
}
.big {
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(2.4rem, 5.6vw, 5.6rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
}
.mid {
  font-weight: 800;
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.para {
  font-weight: 600;
  font-size: clamp(1.05rem, 1.5vw, 1.4rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.tiny {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Header */
.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(18px + env(safe-area-inset-top, 0px)) var(--gutter) 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: block;
  background-color: currentColor;
  mask: url("../assets/img/logo-cream.png") center / contain no-repeat;
}
.nav {
  display: flex;
  gap: clamp(14px, 2.4vw, 32px);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav a {
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1.5px dashed transparent;
}
.nav a:hover,
.nav a:focus-visible {
  border-bottom-color: var(--cream);
  outline: none;
}
@media (max-width: 700px) {
  .nav a:not(.q) {
    display: none;
  }
}

/* Story stage */
.story {
  height: 810vh;
  position: relative;
} /* last 90vh holds the final frame; see HOLD in story.js */
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}
#stage-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.stage::after {
  /* melt the floor into the next section */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38vh;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--bg) 0%, transparent),
    color-mix(in srgb, var(--bg) 6%, transparent) 20%,
    color-mix(in srgb, var(--bg) 20%, transparent) 38%,
    color-mix(in srgb, var(--bg) 42%, transparent) 55%,
    color-mix(in srgb, var(--bg) 66%, transparent) 70%,
    color-mix(in srgb, var(--bg) 86%, transparent) 84%,
    var(--bg)
  );
}
.cap {
  position: absolute;
  z-index: 3;
  opacity: 0;
  visibility: hidden;
  will-change: opacity, translate;
  text-shadow: var(--cap-shadow);
  pointer-events: none;
}
.c-hero {
  left: var(--gutter);
  top: 50%;
  transform: translateY(-46%);
  display: grid;
  gap: 18px;
  opacity: 1;
  visibility: visible;
}
.cap .big {
  font-size: clamp(2.9rem, 7.2vw, 7.6rem);
}
.c-l {
  left: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  max-width: 58vw;
}
.c-r {
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  max-width: 58vw;
  text-align: right;
}
.c-end {
  left: 0;
  right: 0;
  top: calc(8vh + 4rem);
  text-align: center;
}
.hint {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 4vh;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}
.hint i {
  width: 22px;
  height: 22px;
  border: 1.5px dashed var(--cream);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 11px;
}
@media (max-width: 760px) {
  .c-hero {
    top: auto;
    bottom: 14vh;
    transform: none;
  }
  .c-l,
  .c-r {
    left: var(--gutter);
    right: var(--gutter);
    top: auto;
    bottom: 12vh;
    transform: none;
    max-width: none;
    text-align: left;
  }
}

/* Interactive model: full bleed, options on the right */
.model {
  padding-block: clamp(120px, 20vh, 240px) 0;
}
.model-head {
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 2;
  scroll-margin-top: calc(72px + env(safe-area-inset-top, 0px));
  scroll-margin-bottom: 12vh;
}
.model-head .huge {
  font-size: clamp(3rem, 9vw, 8.5rem);
}
.viewer {
  position: relative;
  margin-top: -2vh;
  height: min(92vh, 960px);
  min-height: 520px;
  overflow: hidden;
  background: var(--bg);
}
.viewer-stage {
  position: absolute;
  inset: 0;
}
.viewer-stage::before,
.viewer-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 18%;
  z-index: 1;
  pointer-events: none;
}
.viewer-stage::before {
  top: 0;
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--bg) 0%, transparent),
    var(--bg)
  );
}
.viewer-stage::after {
  bottom: 0;
  height: 32%;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--bg) 0%, transparent),
    color-mix(in srgb, var(--bg) 6%, transparent) 20%,
    color-mix(in srgb, var(--bg) 20%, transparent) 38%,
    color-mix(in srgb, var(--bg) 42%, transparent) 55%,
    color-mix(in srgb, var(--bg) 66%, transparent) 70%,
    color-mix(in srgb, var(--bg) 86%, transparent) 84%,
    var(--bg)
  );
}
#model-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
}
#model-canvas:active {
  cursor: grabbing;
}
.viewer-hint {
  position: absolute;
  left: 50%;
  bottom: 4rem;
  z-index: 2;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
  width: max-content;
  max-width: calc(100% - 2 * var(--gutter));
}
.drag {
  margin: 0;
  color: var(--cream-soft);
  pointer-events: none;
  line-height: 2;
  text-align: center;
}
.reset {
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream-soft);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition:
    color 0.2s,
    border-color 0.2s,
    background-color 0.2s;
}
.reset:hover {
  color: var(--cream);
  border-color: var(--line-strong);
  background: var(--opt-bg);
}
.reset:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}
.drag kbd {
  font: inherit;
  font-size: 11px;
  color: var(--cream);
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--opt-bg);
  white-space: nowrap;
}
.view-actions {
  position: absolute;
  z-index: 2;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 10px;
  justify-items: stretch;
  width: min(168px, 28vw);
  max-height: calc(100% - 72px);
}
.view-actions .ctrl-label {
  text-align: right;
}
.opt,
.view-chip {
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cream);
  background: var(--opt-bg);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.opt:hover,
.view-chip:hover {
  border-color: var(--line);
}
.opt.on {
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px rgb(var(--accent-rgb) / var(--ring-a)),
    0 0 24px rgb(var(--accent-rgb) / var(--bloom-a));
}
.opt:focus-visible,
.view-chip:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}
.view-chip {
  justify-content: center;
  width: 100%;
  min-height: 38px;
}
.wall-chip {
  position: relative;
  justify-content: flex-start;
  gap: 8px;
}
.wall-chip input[type="color"] {
  position: absolute;
  inset: 0;
  right: 36px;
  width: auto;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: 0;
}
.wall-reset {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  margin-left: auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cream-soft);
  cursor: pointer;
}
.wall-reset svg {
  width: 14px;
  height: 14px;
}
.wall-reset:hover {
  color: var(--cream);
}
.wall-reset:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
  border-radius: 4px;
}
.controls {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 16px;
  width: min(340px, 38vw);
  max-height: calc(100% - 72px);
  overflow: visible;
}
.ctrl-label {
  width: 100%;
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cream-soft);
}
.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}
.row-finish {
  position: relative;
}
.popover {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 5;
  min-width: min(100%, 240px);
  padding: 10px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  border: 1px solid var(--line-strong);
  box-shadow: 0 12px 40px rgb(var(--shade) / calc(var(--shade-a) * 0.85));
}
.popover-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.paint-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.wall-pick {
  cursor: pointer;
}
.wall-pick input[type="color"] {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.wall-pick input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.wall-pick input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}
.wall-pick input[type="color"]:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}
.sw {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sw);
  flex-shrink: 0;
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.3),
    0 0 0 1px var(--line);
}
@media (max-width: 900px) {
  .viewer {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .viewer-stage {
    position: relative;
    height: 70vh;
    min-height: 420px;
    overflow: hidden;
  }
  .viewer-hint {
    bottom: 1.5rem;
  }
  .controls,
  .view-actions {
    position: static;
    transform: none;
    width: auto;
    max-width: none;
    padding: 8px var(--gutter) 0;
  }
  .controls {
    justify-items: center;
  }
  .view-actions {
    justify-items: center;
    padding-bottom: 12px;
  }
  .view-actions .ctrl-label,
  .ctrl-label {
    text-align: center;
  }
  .row {
    justify-content: center;
  }
  .view-chip {
    width: auto;
    min-width: min(280px, 100%);
  }
}

/* Quote */
.quote {
  padding-block: clamp(80px, 12vw, 180px);
  padding-inline: var(--gutter);
  text-align: center;
  display: grid;
  gap: 22px;
  justify-items: center;
  background: radial-gradient(
    55% 70% at 50% 100%,
    color-mix(in srgb, var(--glow) 55%, transparent),
    transparent 70%
  );
}
.quote-title {
  font-size: clamp(3rem, 10vw, 9rem);
  margin-bottom: 2rem;
}
.btn {
  font: inherit;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--pill);
  cursor: pointer;
  border: 2px solid var(--accent);
  border-radius: 999px;
  padding: 16px 28px;
  text-decoration: none;
  box-shadow:
    0 0 0 4px rgb(var(--accent-rgb) / var(--btn-ring-a)),
    0 0 28px rgb(var(--accent-rgb) / var(--btn-bloom-a));
}
.btn:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 4px;
}
.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Quote modal */
.modal {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--cream);
  max-width: min(36rem, calc(100% - 32px));
  width: 100%;
}
.modal::backdrop {
  background: var(--veil);
  backdrop-filter: blur(8px);
}
.modal-in {
  position: relative;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: radial-gradient(80% 60% at 50% 0%, var(--glow), var(--bg-2) 70%);
  border-radius: 22px;
  padding: clamp(24px, 4vw, 44px);
  box-shadow:
    var(--modal-shadow),
    inset 0 0 0 1px var(--line);
}
@media (max-width: 600px) {
  .modal {
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
    margin: 0;
  }
  .modal-in {
    height: 100%;
    max-height: none;
    border-radius: 0;
    padding-top: calc(clamp(24px, 4vw, 44px) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(
      clamp(24px, 4vw, 44px) + env(safe-area-inset-bottom, 0px)
    );
  }
}

/* Bed options sheet (small screens): anchored to the bottom, model visible above */
.modal.sheet {
  max-width: none;
  width: 100%;
  height: auto;
  max-height: 62vh;
  margin: auto 0 0;
}
.modal.sheet::backdrop {
  background: color-mix(in srgb, var(--bg) 25%, transparent);
  backdrop-filter: none;
}
.sheet .modal-in {
  height: auto;
  max-height: 62vh;
  border-radius: 22px 22px 0 0;
  padding: 24px var(--gutter) calc(24px + env(safe-area-inset-bottom, 0px));
}
.sheet .big {
  font-size: 1.6rem;
  margin-bottom: 18px;
}
.sheet .controls {
  padding: 0;
  justify-items: stretch;
}
.sheet .ctrl-label {
  text-align: left;
}
.sheet .row {
  justify-content: flex-start;
}
.settings-btn {
  display: none;
}
@media (max-width: 900px) {
  .settings-btn {
    position: absolute;
    z-index: 3;
    bottom: 10rem;
    left: 2rem;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: var(--pill);
    color: var(--cream);
    cursor: pointer;
    box-shadow:
      0 0 0 4px rgb(var(--accent-rgb) / var(--btn-ring-a)),
      0 0 24px rgb(var(--accent-rgb) / var(--btn-bloom-a));
  }
  .settings-btn:focus-visible {
    outline: 2px solid var(--cream);
    outline-offset: 4px;
  }
}
.modal .big {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 10px;
  padding-right: 40px;
}
.modal .para {
  font-size: 1.05rem;
  margin-bottom: 22px;
}
.x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--pill);
  color: var(--cream);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.x:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.fields label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cream-soft);
  min-width: 0;
}
.fields .wide {
  grid-column: 1 / -1;
}
.fields input,
.fields select,
.fields textarea {
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cream);
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  width: 100%;
}
.fields textarea {
  resize: vertical;
}
.fields input::placeholder,
.fields textarea::placeholder {
  color: color-mix(in srgb, var(--cream-soft) 88%, var(--field));
  opacity: 1;
}
.fields input:focus,
.fields select:focus,
.fields textarea:focus {
  outline: none;
  border-color: var(--ember);
}
.fields input.is-invalid,
.fields select.is-invalid,
.fields textarea.is-invalid {
  border-color: var(--err);
}
.field-err {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--err);
}
.modal .hint {
  font-size: 14px;
  font-weight: 600;
  color: var(--cream-soft);
  margin: 0 0 14px;
}
.err {
  color: var(--err);
  font-weight: 700;
  margin-bottom: 14px;
}
.done {
  display: grid;
  gap: 14px;
  justify-items: start;
}
.flabel {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-soft);
}
.photos {
  display: grid;
  gap: 8px;
}
.fields .drop {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--field);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--cream-soft);
  transition:
    border-color 0.2s,
    background 0.2s;
}
.drop strong {
  color: var(--cream);
  font-size: 15px;
  font-weight: 800;
}
.drop:hover,
.drop.over,
.drop:focus-within {
  border-color: var(--ember);
  background: color-mix(in srgb, var(--field) 70%, var(--glow));
}
.thumbs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.thumbs:empty {
  display: none;
}
.thumbs li {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--field);
}
.thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumbs button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: var(--veil);
  color: var(--cream);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.thumbs button:focus-visible {
  outline: 2px solid var(--cream);
}
