/* CraftedByMhairi — quiet, tactile, theatrical */

@font-face {
  font-family: "Crafted";
  src: url("../fonts/Crafted-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f3eee6;
  --paper-2: #e7dfd2;
  --ink: #241f1b;
  --ink-soft: #3a342e;
  --muted: #6d645b;
  --rule: #d4cbbc;
  --clay: #9a4e35;
  --clay-hover: #7e3d28;
  --forest: #3c524c;
  --stage: #161311;
  --white: #faf7f2;
  --focus: #9a4e35;
  --btn-fg: #f3eee6;
  --shadow: 0 18px 50px rgba(36, 31, 27, 0.16);
  --wash-clay: rgba(156, 78, 53, 0.06);
  --wash-forest: rgba(60, 82, 76, 0.05);

  --serif: "Crafted", "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: "Figtree", "Segoe UI", Helvetica, Arial, sans-serif;

  --pad: clamp(1.25rem, 4vw, 3rem);
  --wrap: 72rem;
  --header: 4.7rem;
  --header-strip: #063539;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #161311;
  --paper-2: #221c18;
  --ink: #f3eee6;
  --ink-soft: #e4dcd0;
  --muted: #c4bbb0;
  --rule: #3d352e;
  --clay: #d0896c;
  --clay-hover: #e09a7c;
  --forest: #9cbfb4;
  --stage: #0e0b09;
  --white: #1c1714;
  --focus: #d0896c;
  --btn-fg: #161311;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --wash-clay: rgba(208, 137, 108, 0.08);
  --wash-forest: rgba(156, 191, 180, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(ellipse 80% 50% at 10% 0%, var(--wash-clay), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 10%, var(--wash-forest), transparent 45%);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--clay);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.site-header :focus-visible {
  outline-color: #f3eee6;
}

.lightbox :focus-visible {
  outline-color: #f3eee6;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.skip:focus,
.skip:focus-visible {
  top: 1rem;
  outline-color: var(--focus);
}

.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;
}

.wrap {
  width: min(100%, var(--wrap));
  margin-inline: auto;
  padding-inline: var(--pad);
}

picture {
  display: block;
}

.hero-photo picture,
.work-item picture,
.thumb picture,
.howto-card picture,
.feature-photo picture,
.pair picture,
.howto-sheet picture,
.about-layout picture,
.howto-made picture {
  width: 100%;
}

.wordmark picture {
  width: auto;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header);
  background: var(--header-strip);
  border-bottom: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header);
  padding-block: 0.45rem;
  gap: 0.75rem 1rem;
}

.wordmark {
  display: flex;
  align-items: center;
  margin-right: auto;
  text-decoration: none;
  color: #f3eee6;
}

.wordmark img {
  display: block;
  height: 3.15rem;
  width: auto;
}

.wordmark:hover {
  color: #f3eee6;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: #d5e8e4;
}

.site-nav a:hover {
  color: #fff;
}

.site-nav a[aria-current="page"] {
  color: #fff;
  box-shadow: inset 0 -1px 0 #e0b49a;
}

.theme-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  margin: 0 -0.3rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d5e8e4;
  cursor: pointer;
}

.theme-toggle:hover {
  color: #fff;
}

.theme-toggle svg {
  width: 1.2rem;
  height: 1.2rem;
}

.theme-toggle .theme-icon-sun {
  display: none !important;
}

.theme-toggle .theme-icon-moon {
  display: block !important;
}

[data-theme="dark"] .theme-toggle .theme-icon-moon {
  display: none !important;
}

[data-theme="dark"] .theme-toggle .theme-icon-sun {
  display: block !important;
}

.nav-toggle {
  display: none;
  position: relative;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.4rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.4rem;
  height: 2px;
  background: #f3eee6;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-toggle-bars {
  top: 50%;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  top: 0;
  transform: translateX(-50%) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  top: 0;
  transform: translateX(-50%) rotate(-45deg);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: none;
  }

  .site-header {
    height: auto;
  }

  .header-inner {
    flex-wrap: wrap;
    height: auto;
    min-height: 0;
    padding-block: 0.55rem 0.5rem;
    gap: 0.5rem 1rem;
  }

  .wordmark img {
    height: 2.7rem;
  }

  .site-nav {
    position: static;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .site-nav ul {
    flex-wrap: wrap;
    gap: 0.35rem 0.7rem;
  }

  .site-nav a {
    font-size: 0.78rem;
  }

  .theme-toggle {
    order: 2;
  }

  .site-nav {
    order: 3;
  }
}

/* Type */

.kicker {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay);
}

h1,
h2,
.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.18;
  margin: 0;
}

h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.6rem);
}

.intro-lines {
  font-family: var(--serif);
  font-size: clamp(1.38rem, 5.3vw, 2.4rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.38;
  margin: 0;
  overflow-wrap: break-word;
}

.intro-lines span {
  display: block;
}

h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
}

.lede {
  margin: 1.25rem 0 0;
  max-width: 28rem;
  font-size: 1.12rem;
  color: var(--ink-soft);
  overflow-wrap: break-word;
}

.lede p {
  margin: 0 0 0.2rem;
}

.muted {
  color: var(--muted);
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.7rem 1.35rem;
  background: var(--clay);
  color: var(--btn-fg);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--clay);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn:hover {
  background: var(--clay-hover);
  border-color: var(--clay-hover);
  color: var(--btn-fg);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Hero */

.hero {
  padding: clamp(1.75rem, 5vw, 3rem) 0 0;
}

.hero-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
  min-width: 0;
}

.hero-copy {
  max-width: 36rem;
  min-width: 0;
  padding-bottom: 0.5rem;
}

.hero-photo {
  margin: 0;
}

.hero-photo img {
  width: 100%;
  height: auto;
  background: var(--stage);
}

@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: center;
    gap: 3.5rem;
    padding-bottom: 1rem;
  }
}

/* Selected work */

.section {
  padding: clamp(3rem, 8vw, 5.5rem) 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.section-head a {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--forest);
}

.selected-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
}

.thumb-scroller {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-bottom: 0.2rem;
}

.thumb-scroller::-webkit-scrollbar {
  display: none;
}

.thumb {
  flex: 0 0 min(58vw, 13.5rem);
  text-decoration: none;
  color: inherit;
  scroll-snap-align: start;
}

.thumb figure {
  margin: 0;
}

.thumb img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--paper-2);
}

.thumb-goobie img {
  object-position: 50% 18%;
}

.thumb-oakley img {
  object-position: 50% 38%;
}

.thumb-scout img {
  object-position: 50% 22%;
}

.thumb-bearded img {
  object-position: 48% 18%;
}

.thumb-storybox img {
  object-position: 42% 55%;
}

.thumb-workshop img {
  object-position: 28% 42%;
}

.thumb figcaption {
  margin-top: 0.55rem;
}

.thumb:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.thumb .title {
  display: block;
  margin: 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 400;
}

.thumb .line {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
}

.selected-prev,
.selected-next {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--clay);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.selected-prev:hover,
.selected-next:hover {
  border-color: var(--clay);
}

/* Work grid */

.page-intro {
  padding: clamp(2rem, 6vw, 3.5rem) 0 0.5rem;
  min-width: 0;
}

.page-intro h1,
.page-intro .lede {
  max-width: 100%;
}

.page-intro h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}

.page-intro .lede {
  margin-top: 0.85rem;
}

.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.6rem 0.4rem;
  padding-bottom: 3rem;
  align-items: start;
}

.work-item {
  margin: 0;
}

.work-open {
  display: block;
  width: 100%;
  margin: 0;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
}

.work-item img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--paper-2);
  transition: opacity 0.25s var(--ease);
}

.work-item:hover img,
.work-open:focus-visible img {
  opacity: 0.9;
}

.work-open:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.work-item figcaption {
  margin-top: 0.65rem;
}

.work-item .title,
.howto-card .title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
}

.work-item .line {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.1rem;
}

.work-item .count {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--forest);
}

@media (min-width: 760px) {
  .work-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem 0.4rem;
  }
}

#goobie img { object-position: 50% 18%; }
#oakley img { object-position: 50% 38%; }
#scout img { object-position: 50% 20%; }
#bearded-lady img { object-position: 50% 14%; }
#storybox img { object-position: 48% 52%; }
#cloud-room img { object-position: 50% 42%; }
#shadow img { object-position: 50% 42%; }
#party img { object-position: 50% 40%; }
#sock-it-to-em img { object-position: 50% 48%; }
#masks img { object-position: 50% 48%; }
#marionette img { object-position: 50% 28%; }
#birds img { object-position: 50% 32%; }
#session img { object-position: 40% 72%; }
#electronics img { object-position: 50% 42%; }
#suitcase img { object-position: 50% 55%; }
#forest img { object-position: 50% 10%; }
#dragons img { object-position: 50% 40%; }

.howto-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.howto-card:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.howto-card:focus-visible img {
  opacity: 0.9;
}

.howto-grid .work-item img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

#bird-how img {
  object-position: 50% 28%;
}

#sock-how img {
  object-position: 50% 40%;
}

#lights-how img {
  object-position: 62% 68%;
}

@media (min-width: 980px) {
  .howto-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.kicker a {
  color: inherit;
  text-decoration: none;
}

.kicker a:hover {
  color: var(--clay-hover);
}

.howto-sheet {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 var(--pad) 2.5rem;
}

.howto-sheet img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--white);
}

.howto-sheet figcaption {
  margin-top: 0.65rem;
}

.howto-made {
  padding-bottom: 3rem;
}

@media (min-width: 760px) {
  .howto-made.pair {
    grid-template-columns: 1fr 1fr;
  }
}

/* Lightbox */

.lightbox {
  border: 0;
  padding: 0;
  max-width: min(96vw, 68rem);
  max-height: 94vh;
  background: var(--stage);
  color: var(--paper);
  box-shadow: var(--shadow);
}

.lightbox::backdrop {
  background: rgba(22, 19, 17, 0.78);
}

.lightbox-inner {
  position: relative;
}

.lightbox picture {
  width: 100%;
}

.lightbox img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #110e0c;
  cursor: pointer;
}

.lightbox figcaption {
  padding: 0.9rem 1.1rem 1.1rem;
}

.lightbox .title {
  font-family: var(--serif);
  font-size: 1.15rem;
}

.lightbox .line {
  display: block;
  color: color-mix(in srgb, var(--paper) 70%, transparent);
  font-size: 0.92rem;
}

.lightbox-count {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--paper) 55%, transparent);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  z-index: 3;
  border: 0;
  background: color-mix(in srgb, var(--stage) 72%, transparent);
  color: #f3eee6;
  cursor: pointer;
}

.lightbox-close {
  top: 0.6rem;
  right: 0.6rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  font-size: 1.3rem;
  line-height: 1;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.8rem;
  line-height: 1;
}

.lightbox-prev {
  left: 0.4rem;
}

.lightbox-next {
  right: 0.4rem;
}

.lightbox.is-single .lightbox-prev,
.lightbox.is-single .lightbox-next {
  display: none;
}

/* Facilitation */

.split-blocks {
  display: grid;
  gap: 2.25rem;
  margin: 2.25rem 0 3rem;
}

@media (min-width: 800px) {
  .split-blocks {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
}

.block h2 {
  font-size: 1.35rem;
  margin-bottom: 0.85rem;
}

.block ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.block li {
  padding: 0.35rem 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
}

.block li:last-child {
  border-bottom: 1px solid var(--rule);
}

.feature-photo {
  margin: 0;
}

.feature-photo img {
  width: 100%;
  height: auto;
}

.photo-caption {
  margin: 0.7rem 0 0;
  font-size: 0.88rem;
  color: var(--forest);
}

.pair {
  display: grid;
  gap: 0.75rem;
  margin-top: 2.5rem;
  align-items: start;
}

@media (min-width: 760px) {
  .pair {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
  }
}

.pair img {
  width: 100%;
  height: auto;
  display: block;
}

.pair-flush {
  margin: 0.35rem 0 0;
  gap: 0.35rem;
  align-items: stretch;
}

.pair-flush figure {
  margin: 0;
}

@media (min-width: 760px) {
  .pair-flush {
    grid-template-columns: 1fr 1fr;
  }
}

.pair-flush img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* About */

.about-layout {
  display: grid;
  gap: 2rem;
  padding-bottom: 3.5rem;
}

@media (min-width: 800px) {
  .about-layout {
    grid-template-columns: 0.85fr 1.15fr;
    gap: 3.5rem;
    align-items: start;
    padding-top: 1rem;
  }
}

.about-layout img {
  width: 100%;
  height: auto;
}

.about-copy p {
  max-width: 34rem;
  font-size: 1.12rem;
  margin: 0 0 1.75rem;
  overflow-wrap: break-word;
}

.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 26rem;
}

.facts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

.facts li:last-child {
  border-bottom: 1px solid var(--rule);
}

.facts span {
  color: var(--muted);
}

/* Contact */

.contact-layout {
  display: grid;
  gap: 2.5rem;
  padding-bottom: 3.5rem;
}

@media (min-width: 800px) {
  .contact-layout {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: start;
  }
}

.form {
  display: grid;
  gap: 1rem;
}

.form .btn {
  justify-self: start;
  min-width: 8.5rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: color-mix(in srgb, var(--white) 70%, var(--paper));
  border: 1px solid var(--rule);
  padding: 0.75rem 0.85rem;
  border-radius: 0;
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--clay);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--clay);
}

.form-note {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.form-note[data-state="ok"] {
  color: var(--forest);
}

.aside-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.aside-list li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
}

.aside-list li:last-child {
  border-bottom: 1px solid var(--rule);
}

.aside-list .label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 2.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-inner {
  display: grid;
  gap: 0.3rem;
}

.footer-name {
  font-family: var(--serif);
  color: var(--ink);
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  text-decoration: none;
}

.site-footer .quiet {
  color: var(--muted);
}

.dot {
  margin: 0 0.45rem;
}

/* Utility */

.cta-row {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

/* Lighting desk */

.light-desk {
  display: grid;
  gap: 1.4rem;
  padding-bottom: 3rem;
}

.stage-tray {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  background: color-mix(in srgb, var(--white) 72%, var(--paper-2));
  border: 1px solid var(--rule);
  overflow-x: auto;
  align-self: start;
}

.stage-slot {
  flex: 0 0 auto;
  width: 4.4rem;
  min-height: 7.2rem;
}

.stage-tray-label {
  display: none;
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.stage-piece {
  display: block;
  width: 4.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.stage-piece img,
.stage-piece svg {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.stage-piece:focus {
  outline: none;
}

.stage-piece:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.stage-piece.is-dragging {
  cursor: grabbing;
  z-index: 40;
}

.stage-dress .stage-piece {
  position: absolute;
}

@media (min-width: 800px) {
  .stage-tray {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: visible;
    padding: 0.85rem 0.45rem;
    width: 6.8rem;
  }

  .stage-tray-label {
    display: block;
    margin-bottom: 0.3rem;
  }

  .stage-slot {
    width: 5rem;
    min-height: 8rem;
  }

  .stage-piece {
    width: 5rem;
  }
}



.stage {
  --white-l: 0.55;
  --white-r: 0.55;
  --red: 0;
  --green: 0;
  --blue: 0;
  --live: 1;
  position: relative;
  overflow: hidden;
  min-height: 18rem;
  aspect-ratio: 16 / 10;
  background: #0a0908;
  color: #f3eee6;
}

.stage-house {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(#14110f, #14110f) top / 100% 12% no-repeat,
    linear-gradient(#0e0c0b, #0e0c0b) bottom / 100% 6% no-repeat;
  z-index: 5;
  pointer-events: none;
}

.stage-cyc {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 12%;
  height: 58%;
  background:
    url("../images/storybox/backdrop.png") center 40% / cover no-repeat,
    linear-gradient(180deg, #1a1613 0%, #2a231c 55%, #1c1814 100%);
  border-radius: 40% 40% 0 0 / 8% 8% 0 0;
}

.stage-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6%;
  height: 34%;
  background:
    linear-gradient(180deg, #161311 0%, #0c0b0a 100%);
  transform: perspective(18rem) rotateX(18deg);
  transform-origin: top center;
}

.stage-set {
  position: absolute;
  inset: 12% 10% 8%;
  z-index: 2;
  pointer-events: none;
}

.flat {
  position: absolute;
  top: 8%;
  width: 18%;
  height: 62%;
  background: linear-gradient(90deg, #1b1714, #2c261f 40%, #1b1714);
}

.flat-l {
  left: 4%;
  transform: skewY(-6deg);
}

.flat-r {
  right: 4%;
  transform: skewY(6deg);
}

.portal {
  position: absolute;
  left: 50%;
  bottom: 22%;
  width: 9%;
  height: 38%;
  transform: translateX(-50%);
  background: #120f0d;
  box-shadow: inset 0 0 0 1px rgba(243, 238, 230, 0.06);
}

.stage-dress {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.stage-wash {
  position: absolute;
  inset: 10% 0 6%;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 3;
}

.stage-wash-white-l {
  opacity: calc(var(--white-l) * var(--live));
  background:
    radial-gradient(ellipse 72% 88% at 14% 8%, rgba(255, 248, 232, 0.95), transparent 64%),
    radial-gradient(ellipse 48% 42% at 24% 80%, rgba(255, 244, 220, 0.42), transparent 70%);
}

.stage-wash-white-r {
  opacity: calc(var(--white-r) * var(--live));
  background:
    radial-gradient(ellipse 72% 88% at 86% 8%, rgba(255, 248, 232, 0.95), transparent 64%),
    radial-gradient(ellipse 48% 42% at 76% 80%, rgba(255, 244, 220, 0.42), transparent 70%);
}

.stage-wash-red {
  opacity: calc(var(--red) * var(--live));
  background:
    radial-gradient(ellipse 58% 78% at 32% 10%, rgba(220, 36, 36, 0.92), transparent 66%),
    radial-gradient(ellipse 42% 38% at 36% 80%, rgba(200, 28, 28, 0.4), transparent 72%);
}

.stage-wash-green {
  opacity: calc(var(--green) * var(--live));
  background:
    radial-gradient(ellipse 58% 78% at 50% 8%, rgba(36, 180, 72, 0.9), transparent 66%),
    radial-gradient(ellipse 42% 38% at 50% 80%, rgba(28, 160, 64, 0.4), transparent 72%);
}

.stage-wash-blue {
  opacity: calc(var(--blue) * var(--live));
  background:
    radial-gradient(ellipse 58% 78% at 68% 10%, rgba(40, 96, 230, 0.92), transparent 66%),
    radial-gradient(ellipse 42% 38% at 64% 80%, rgba(32, 80, 210, 0.4), transparent 72%);
}

.stage-lanterns {
  position: absolute;
  top: 4.5%;
  left: 12%;
  right: 12%;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.lantern {
  width: 1.15rem;
  height: 0.7rem;
  background: #2a2420;
  border-radius: 0 0 2px 2px;
  box-shadow: 0 0.35rem 0.15rem -0.1rem rgba(0, 0, 0, 0.5);
}

.lantern::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  opacity: calc(var(--level, 0) * var(--live));
}

.lantern-white-l {
  --level: var(--white-l);
}

.lantern-white-l::after,
.lantern-white-r::after {
  background: #fff6e4;
  box-shadow: 0 0 12px 3px rgba(255, 248, 232, 0.55);
}

.lantern-white-r {
  --level: var(--white-r);
}

.lantern-red {
  --level: var(--red);
}

.lantern-red::after {
  background: #ff4a4a;
  box-shadow: 0 0 12px 3px rgba(220, 36, 36, 0.55);
}

.lantern-green {
  --level: var(--green);
}

.lantern-green::after {
  background: #3ad05a;
  box-shadow: 0 0 12px 3px rgba(36, 180, 72, 0.5);
}

.lantern-blue {
  --level: var(--blue);
}

.lantern-blue::after {
  background: #5a8cff;
  box-shadow: 0 0 12px 3px rgba(40, 96, 230, 0.55);
}

.desk {
  display: grid;
  gap: 1.25rem;
  padding: 1.15rem 1rem 1.25rem;
  background: color-mix(in srgb, var(--white) 72%, var(--paper-2));
  border: 1px solid var(--rule);
}

.fader-row {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.fader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  min-width: 2.6rem;
  flex: 1 1 0;
}

.fader output {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.fader label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  white-space: nowrap;
}

.fader input[type="range"] {
  writing-mode: vertical-lr;
  direction: rtl;
  appearance: slider-vertical;
  width: 2.8rem;
  height: 12.5rem;
  margin: 0;
  padding: 0;
  background: transparent;
  touch-action: none;
  cursor: ns-resize;
  accent-color: var(--fader-accent, var(--clay));
}

.fader-white-l,
.fader-white-r {
  --fader-accent: #cfc6ba;
}

.fader-red {
  --fader-accent: #d23a3a;
}

.fader-green {
  --fader-accent: #2f9a4a;
}

.fader-blue {
  --fader-accent: #3d6fd4;
}

.fader-red {
  margin-left: 0.15rem;
  padding-left: 0.45rem;
  border-left: 1px solid var(--rule);
}

.fader input[type="range"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.desk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn-blackout {
  background: #241f1b;
  border-color: #241f1b;
  color: #f3eee6;
}

.btn-blackout:hover {
  background: #3a322c;
  border-color: #3a322c;
  color: #f3eee6;
}

.btn-blackout[aria-pressed="true"] {
  background: #7a2e28;
  border-color: #7a2e28;
  color: #f3eee6;
  box-shadow: inset 0 0 0 1px rgba(243, 238, 230, 0.15);
}

[data-theme="dark"] .desk {
  background: color-mix(in srgb, var(--white) 80%, var(--paper));
}

[data-theme="dark"] .btn-blackout {
  background: #0e0b09;
  border-color: #6d645b;
}

[data-theme="dark"] .btn-blackout:hover {
  background: #241f1b;
  border-color: #c4bbb0;
}

.btn-blackout[aria-pressed="true"],
[data-theme="dark"] .btn-blackout[aria-pressed="true"] {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--btn-fg);
}

@media (min-width: 800px) {
  .light-desk {
    grid-template-columns: 6.8rem minmax(0, 1.55fr) minmax(18rem, 1fr);
    gap: 1.6rem;
    align-items: start;
  }

  .stage {
    min-height: 22rem;
    aspect-ratio: 16 / 10;
    width: 100%;
  }

  .desk {
    align-content: start;
  }

  .fader input[type="range"] {
    height: 16rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage-wash,
  .lantern::after {
    transition: none;
  }
}
