@keyframes lantern-breathe {
  0%,
  100% {
    filter: brightness(0.94);
  }

  50% {
    filter: brightness(1.08);
  }
}

/* stylelint-disable no-descending-specificity -- Components follow the page's reading order. */

:root {
  color-scheme: dark;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  font-synthesis: none;
  line-height: 1.65;
  text-rendering: optimizelegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: #0a0806;
  color: #2d2117;
}

a {
  color: inherit;
}

button,
input,
summary {
  font: inherit;
}

audio {
  display: block;
  width: 100%;
  margin-top: 1rem;
  accent-color: #8f2d28;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 1rem;
  border: 2px solid #d8bd76;
  background: #17110c;
  color: #fff6d8;
  transform: translateY(-160%);
  transition: transform 140ms ease;
}

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

.theme-toggle {
  position: fixed;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-shell {
  --ink: #2b2118;
  --muted: #675744;
  --paper: #d8c9a5;
  --paper-deep: #bda77b;
  --paper-pale: #eee3c8;
  --wood: #21150f;
  --wood-light: #422a1b;
  --accent: #8e2724;
  --accent-deep: #591714;
  --jade: #365c4c;
  --gold: #b8904e;
  --line: rgb(67 45 28 / 55%);
  --panel-shadow: 0 20px 45px rgb(0 0 0 / 38%);

  min-height: 100vh;
  background:
    linear-gradient(rgb(11 8 5 / 62%), rgb(11 8 5 / 38%)),
    repeating-linear-gradient(90deg, #251710 0 6px, #1c110c 6px 12px, #2a1b12 12px 24px);
  color: var(--ink);
}

.theme-toggle:checked ~ .site-shell {
  --ink: #dccda7;
  --muted: #a99a76;
  --paper: #25231d;
  --paper-deep: #161b18;
  --paper-pale: #373126;
  --wood: #0d0f0d;
  --wood-light: #1f2821;
  --accent: #8b2e25;
  --accent-deep: #4f1713;
  --jade: #638f72;
  --gold: #b79a5c;
  --line: rgb(191 160 90 / 45%);
  --panel-shadow: 0 0 0 1px rgb(196 159 83 / 30%), 0 22px 50px rgb(0 0 0 / 62%);

  background:
    linear-gradient(rgb(4 8 7 / 83%), rgb(4 8 7 / 87%)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgb(103 149 112 / 10%) 3px 4px),
    #070b09;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 1.5rem;
  align-items: center;
  width: min(100% - 2rem, 1440px);
  min-height: 78px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  border-right: 1px solid rgb(189 144 70 / 42%);
  border-bottom: 3px double var(--gold);
  border-left: 1px solid rgb(189 144 70 / 42%);
  background:
    linear-gradient(90deg, rgb(15 9 6 / 97%), rgb(44 27 17 / 96%) 50%, rgb(15 9 6 / 97%)),
    var(--wood);
  color: #ead8aa;
  box-shadow: 0 8px 22px rgb(0 0 0 / 42%);
}

.language-link {
  display: inline-grid;
  min-width: 2.8rem;
  min-height: 2.8rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid #8e6c38;
  background: #17110d;
  color: #ead8aa;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  place-items: center;
  box-shadow: inset 0 0 0 2px #332317;
}

.language-link:hover,
.language-link:focus-visible {
  border-color: #d5ad5f;
  color: #fff4d2;
}

.music-popout-link {
  display: inline-grid;
  min-height: 2.8rem;
  padding: 0.45rem 0.82rem;
  border: 1px solid #8e6c38;
  background: linear-gradient(135deg, #321711, #17110d);
  color: #ead8aa;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  place-items: center;
  box-shadow: inset 0 0 0 2px #332317;
}

.music-popout-link:hover,
.music-popout-link:focus-visible {
  border-color: #d5ad5f;
  color: #fff4d2;
}

.brand {
  display: inline-flex;
  gap: 0.72rem;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  border: 2px solid #b34a38;
  color: #d9bd78;
  place-items: center;
  transform: rotate(-3deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.28rem;
  letter-spacing: 0.14em;
}

.brand small {
  color: #ae986a;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
}

.site-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.site-nav a,
.mobile-menu a {
  padding: 0.45rem 0.78rem;
  border: 1px solid transparent;
  color: #d7c395;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.mobile-menu a:hover,
.mobile-menu a:focus-visible,
.site-nav a[aria-current="page"],
.mobile-menu a[aria-current="page"] {
  border-color: #8e6c38;
  background: rgb(142 39 36 / 23%);
  color: #fff4d2;
}

.theme-switch {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 0.5rem;
  align-items: center;
  min-width: 7.7rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid #8e6c38;
  background: #17110d;
  color: #ead8aa;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px #332317;
}

.theme-switch:hover {
  border-color: #d5ad5f;
}

.theme-toggle:focus-visible ~ .site-shell .theme-switch {
  outline: 3px solid #f1d17a;
  outline-offset: 3px;
}

.theme-switch-label {
  grid-row: 1 / 3;
  color: #9e875e;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  writing-mode: vertical-rl;
}

.theme-switch-state {
  font-weight: 700;
  letter-spacing: 0.1em;
}

.theme-switch-state-archive {
  display: none;
}

.theme-toggle:checked ~ .site-shell .theme-switch-state-wuxia {
  display: none;
}

.theme-toggle:checked ~ .site-shell .theme-switch-state-archive {
  display: inline;
  color: #8fbd91;
}

.mobile-menu {
  display: none;
}

main,
.site-footer {
  width: min(100% - 2rem, 1400px);
  margin-inline: auto;
}

main {
  padding-block: 2rem 5rem;
}

.hero,
.collection-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 18% 8%, rgb(255 250 219 / 75%), transparent 34%),
    repeating-linear-gradient(0deg, transparent 0 4px, rgb(76 48 28 / 6%) 4px 5px),
    var(--paper);
  box-shadow: var(--panel-shadow);
}

.hero::before,
.collection-hero::before,
.author-section::before {
  position: absolute;
  pointer-events: none;
  content: "";
  inset: 0.55rem;
  border: 1px solid rgb(111 70 38 / 38%);
}

.hero-home {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
  gap: 3rem;
  min-height: 570px;
  padding: clamp(3rem, 7vw, 7.5rem);
  align-items: center;
}

.hero-home::after {
  position: absolute;
  right: 23%;
  bottom: -22%;
  width: 29rem;
  height: 29rem;
  border: 3.5rem solid rgb(66 42 24 / 7%);
  border-radius: 50%;
  content: "";
}

.hero-copy,
.notice-board,
.collection-hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow,
.archive-code {
  margin: 0 0 0.7rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  line-height: 1.18;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(4rem, 9vw, 9rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-shadow: 2px 3px 0 rgb(128 84 42 / 16%);
}

.hero-lede {
  max-width: 46rem;
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.5vw, 1.32rem);
  line-height: 1.9;
}

.seal-link {
  display: inline-block;
  margin-top: 1.8rem;
  padding: 0.76rem 1.45rem;
  border: 2px solid var(--accent-deep);
  background: var(--accent);
  color: #fff1d4;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px rgb(255 235 190 / 22%), 4px 5px 0 rgb(67 29 19 / 22%);
}

.seal-link:hover,
.seal-link:focus-visible {
  background: var(--accent-deep);
  transform: translateY(-2px);
}

.notice-board {
  padding: 2rem;
  border: 1px solid #745b34;
  background:
    linear-gradient(rgb(28 17 10 / 86%), rgb(28 17 10 / 92%)),
    repeating-linear-gradient(90deg, #49301d 0 5px, #2c1b11 5px 12px);
  color: #ddcda5;
  box-shadow: 0 16px 32px rgb(0 0 0 / 30%);
  transform: rotate(1deg);
}

.notice-board p {
  margin-block: 0 1rem;
}

.notice-board-pin {
  padding-bottom: 0.7rem;
  border-bottom: 1px dashed #927447;
  color: #e5b85e;
  font-size: 1.15rem;
  letter-spacing: 0.22em;
}

.notice-board-stamp {
  width: fit-content;
  margin: 1.5rem 0 0 auto;
  padding: 0.3rem;
  border: 2px solid #a63b30;
  color: #d27861;
  font-weight: 700;
  transform: rotate(-6deg);
}

.author-section {
  position: relative;
  margin-top: 2rem;
  padding: clamp(2rem, 5vw, 4.2rem);
  border: 1px solid var(--line);
  background: var(--paper-pale);
  box-shadow: var(--panel-shadow);
}

.section-heading {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: end;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.section-heading h2,
.music-box h2,
.tavern-rules h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.author-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 2rem);
}

.author-door {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  overflow: hidden;
  min-height: 330px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 7px 9px 0 rgb(72 45 27 / 12%);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.author-door:hover,
.author-door:focus-within {
  z-index: 2;
  box-shadow: 10px 14px 0 rgb(72 45 27 / 17%);
  transform: translateY(-5px) rotate(-0.5deg);
}

.author-door:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.door-number {
  position: absolute;
  z-index: 2;
  top: 0.55rem;
  left: 0.55rem;
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid #d4b769;
  background: rgb(28 18 11 / 88%);
  color: #ead39a;
  place-items: center;
}

.cover-art {
  background-color: #271c14;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 300% 200%;
}

.atlas-jin {
  background-image: url("./assets/covers/jinyong-atlas.png");
}

.atlas-gu {
  background-image: url("./assets/covers/gulong-atlas.png");
}

.atlas-huang {
  background-image: url("./assets/covers/huangyi-atlas.png");
}

.cover-1 {
  background-position: 0 0;
}

.cover-2 {
  background-position: 50% 0;
}

.cover-3 {
  background-position: 100% 0;
}

.cover-4 {
  background-position: 0 100%;
}

.cover-5 {
  background-position: 50% 100%;
}

.cover-6 {
  background-position: 100% 100%;
}

.author-door > .cover-art {
  min-height: 100%;
  border-right: 1px solid var(--line);
  filter: saturate(0.85) contrast(1.04);
}

.author-door-copy {
  align-self: end;
  padding: 2rem 1.4rem 1.5rem;
}

.author-door-copy h3 {
  margin: 0 0 0.8rem;
  font-size: clamp(2rem, 3vw, 3.2rem);
}

.author-door-copy p:not(.archive-code) {
  color: var(--muted);
}

.door-action {
  display: inline-block;
  margin-top: 1rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  color: var(--accent);
  font-weight: 700;
}

.card-hit {
  position: absolute;
  z-index: 3;
  inset: 0;
}

.tavern-lower {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 2rem;
  margin-top: 2rem;
}

.music-box,
.tavern-rules {
  border: 1px solid var(--line);
  box-shadow: var(--panel-shadow);
}

.music-box {
  display: grid;
  grid-template-columns: 0.55fr 1.45fr;
  min-height: 430px;
  overflow: hidden;
  background: var(--wood);
  color: #e6d3a4;
}

.music-box-instrument {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at center, rgb(171 107 47 / 20%), transparent 58%),
    repeating-linear-gradient(90deg, #28170f 0 7px, #351e13 7px 15px);
}

.music-box-instrument::before {
  position: absolute;
  inset: 20% 12%;
  border: 2px solid #82623c;
  border-radius: 48% 42% 46% 40%;
  content: "";
}

.music-box-instrument span {
  position: relative;
  z-index: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c4a865 16%, #c4a865 84%, transparent);
}

.music-box-copy {
  padding: clamp(2rem, 4vw, 3.5rem);
  border-left: 1px solid #725634;
  background: linear-gradient(135deg, #1b120d, #2f1d12);
}

.music-box-copy p:not(.eyebrow) {
  color: #bbaa80;
}

.music-intro {
  max-width: 62ch;
}

.music-window-link {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  margin-top: 1rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid #b7924d;
  background: rgb(143 45 40 / 34%);
  color: #f2dfaa;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px rgb(25 13 9 / 58%);
}

.music-window-link:hover,
.music-window-link:focus-visible {
  background: rgb(143 45 40 / 58%);
  color: #fff8df;
}

.track-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.6rem;
}

.track-card {
  padding: 1.1rem;
  border: 1px solid rgb(196 168 101 / 28%);
  background: rgb(9 7 5 / 38%);
}

.track-card-featured {
  border-color: rgb(216 189 118 / 70%);
  box-shadow: inset 0 0 0 1px rgb(143 45 40 / 24%);
}

.track-card h3 {
  margin: 0.2rem 0 0.55rem;
  color: #ead9ad;
  font-size: 1.22rem;
}

.track-card p {
  margin: 0;
  font-size: 0.92rem;
}

.track-card .track-badge {
  color: #d8bd76;
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.track-card audio {
  margin-top: 0.85rem;
}

/* Independent audio page: this document stays open while the archive changes pages. */
.music-window-page .site-shell {
  min-height: 100vh;
}

.music-window-header {
  grid-template-columns: auto 1fr auto;
}

.music-window-nav {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
}

.music-window-nav a {
  padding: 0.55rem 0.8rem;
  border: 1px solid #8e6c38;
  color: #dec78f;
  text-decoration: none;
}

.music-window-nav a:hover,
.music-window-nav a:focus-visible {
  background: rgb(142 39 36 / 23%);
  color: #fff4d2;
}

.standalone-music {
  display: grid;
  min-height: calc(100vh - 170px);
  padding-block: clamp(1rem, 4vw, 4rem);
  place-items: center;
}

.music-cabinet {
  position: relative;
  width: min(100%, 1120px);
  padding: clamp(1.4rem, 5vw, 4.5rem);
  overflow: hidden;
  border: 1px solid #87663d;
  background:
    radial-gradient(circle at 12% 8%, rgb(162 69 44 / 24%), transparent 31%),
    repeating-linear-gradient(90deg, rgb(255 255 255 / 1.5%) 0 1px, transparent 1px 8px),
    linear-gradient(145deg, #17100c, #2c1b12 52%, #10110e);
  color: #ead8aa;
  box-shadow: 0 0 0 1px #2c1b12, 0 28px 70px rgb(0 0 0 / 58%);
}

.music-cabinet::before {
  position: absolute;
  pointer-events: none;
  content: "";
  inset: 0.75rem;
  border: 1px solid rgb(201 166 94 / 28%);
}

.music-cabinet-heading,
.track-list-cabinet,
.music-cabinet-instructions {
  position: relative;
  z-index: 1;
}

.music-cabinet-heading {
  max-width: 820px;
}

.music-cabinet h1 {
  margin-bottom: 0;
  color: #f0db9d;
}

.music-cabinet-english {
  margin: 0.35rem 0 1.2rem;
  color: #b59b67;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.music-cabinet-lede,
.music-cabinet-note {
  max-width: 70ch;
  color: #c9b68c;
}

.music-cabinet-note {
  font-size: 0.92rem;
}

.track-list-cabinet {
  margin-top: 2rem;
}

.track-list-cabinet .track-card {
  padding: clamp(1.1rem, 3vw, 1.8rem);
}

.track-list-cabinet .track-card h2 {
  margin: 0.2rem 0 0.15rem;
  color: #ead9ad;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
}

.music-cabinet-instructions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  border-left: 3px solid #8f2d28;
  background: rgb(9 7 5 / 34%);
  color: #bbaa80;
}

.music-cabinet-instructions p {
  margin: 0;
}

.tavern-rules {
  padding: clamp(2rem, 4vw, 3rem);
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgb(62 40 25 / 5%) 4px 5px),
    var(--paper);
}

.tavern-rules ul {
  margin: 1.5rem 0 0;
  padding-left: 1.25rem;
}

.tavern-rules li + li {
  margin-top: 0.8rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
  padding: 1.5rem 1rem 2.5rem;
  border-top: 1px solid rgb(184 144 78 / 46%);
  color: #aa9368;
}

.site-footer a {
  color: #ddc27e;
}

/* Collection rooms */
.collection-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  min-height: 520px;
}

.collection-hero-art {
  position: relative;
  min-height: 520px;
  border-right: 1px solid var(--line);
}

.collection-hero-art::after {
  position: absolute;
  pointer-events: none;
  content: "";
  inset: 0;
  background: linear-gradient(90deg, transparent 65%, var(--paper));
}

.collection-hero-copy {
  align-self: center;
  padding: clamp(2.5rem, 7vw, 7rem);
}

.collection-hero h1 {
  font-size: clamp(3.8rem, 8vw, 7rem);
}

.collection-hero-note {
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--accent);
  background: rgb(126 78 40 / 8%);
  color: var(--muted);
}

.work-index {
  position: sticky;
  z-index: 10;
  top: 78px;
  display: flex;
  gap: 0.55rem;
  margin: 1.25rem 0 2rem;
  padding: 0.8rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: rgb(31 20 13 / 96%);
  box-shadow: 0 8px 18px rgb(0 0 0 / 28%);
}

.work-index a {
  flex: 0 0 auto;
  padding: 0.55rem 0.85rem;
  border: 1px solid #725734;
  color: #d8c490;
  text-decoration: none;
}

.work-index a:hover,
.work-index a:focus-visible {
  border-color: #d5ad5f;
  background: var(--accent-deep);
  color: #fff1d2;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.work-card {
  display: grid;
  grid-template-columns: minmax(190px, 0.82fr) minmax(0, 1.18fr);
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--panel-shadow);
  scroll-margin-top: 165px;
}

.work-card:target {
  outline: 4px solid var(--accent);
  outline-offset: 4px;
}

.work-card-cover {
  min-height: 100%;
  border-right: 1px solid var(--line);
}

.work-card-body {
  padding: clamp(1.4rem, 3vw, 2.4rem);
}

.work-card h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.65rem, 2.4vw, 2.4rem);
}

.work-card-body > p:not(.archive-code) {
  margin-bottom: 1.2rem;
  color: var(--muted);
}

details summary {
  cursor: pointer;
}

.work-card details {
  border-top: 1px dashed var(--line);
}

.work-card summary {
  padding: 0.8rem 0;
  color: var(--accent);
  font-weight: 700;
}

.work-card details p {
  margin: 0;
  padding: 0 0 0.5rem;
  color: var(--muted);
}

.room-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
}

.room-nav a {
  display: block;
  padding: 1rem 1.25rem;
  border: 1px solid #8b6838;
  background: #20140d;
  color: #e0ca94;
  text-decoration: none;
}

.room-nav a:hover,
.room-nav a:focus-visible {
  border-color: #e0bb69;
  background: var(--accent-deep);
}

/* Archive theme adjustments */
.theme-toggle:checked ~ .site-shell .hero,
.theme-toggle:checked ~ .site-shell .collection-hero,
.theme-toggle:checked ~ .site-shell .author-section,
.theme-toggle:checked ~ .site-shell .work-card,
.theme-toggle:checked ~ .site-shell .tavern-rules {
  background:
    linear-gradient(rgb(22 28 24 / 92%), rgb(22 28 24 / 92%)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgb(111 162 120 / 13%) 3px 4px),
    var(--paper);
}

.theme-toggle:checked ~ .site-shell .hero::before,
.theme-toggle:checked ~ .site-shell .collection-hero::before,
.theme-toggle:checked ~ .site-shell .author-section::before {
  border-style: dashed;
  border-color: rgb(119 167 126 / 42%);
}

.theme-toggle:checked ~ .site-shell .author-door {
  background: linear-gradient(145deg, #23241d, #151a17);
}

.theme-toggle:checked ~ .site-shell .cover-art {
  filter: sepia(0.18) saturate(0.76) contrast(1.12) brightness(0.78);
}

.theme-toggle:checked ~ .site-shell .collection-hero-art::after {
  background: linear-gradient(90deg, transparent 65%, #161c18);
}

.theme-toggle:checked ~ .site-shell .archive-code,
.theme-toggle:checked ~ .site-shell .eyebrow,
.theme-toggle:checked ~ .site-shell .door-action,
.theme-toggle:checked ~ .site-shell .work-card summary {
  color: #80b184;
}

.theme-toggle:checked ~ .site-shell .notice-board-stamp,
.theme-toggle:checked ~ .site-shell .notice-board-pin {
  color: #87b88d;
}

.theme-toggle:checked ~ .site-shell .author-door,
.theme-toggle:checked ~ .site-shell .work-card {
  box-shadow: inset 0 0 0 1px rgb(175 143 78 / 16%), 0 18px 42px rgb(0 0 0 / 54%);
}

.theme-toggle:checked ~ .site-shell h1,
.theme-toggle:checked ~ .site-shell h2,
.theme-toggle:checked ~ .site-shell h3 {
  text-shadow: 0 0 18px rgb(118 176 126 / 13%);
}

@media (width <= 1120px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }

  .desktop-nav {
    display: none;
  }

  .desktop-language {
    display: none;
  }

  .desktop-music {
    display: none;
  }

  .mobile-menu {
    position: relative;
    display: block;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .mobile-menu summary {
    padding: 0.55rem 0.8rem;
    border: 1px solid #8e6c38;
    color: #e6d19a;
    list-style: none;
  }

  .mobile-menu summary::-webkit-details-marker {
    display: none;
  }

  .mobile-menu[open] nav {
    position: absolute;
    top: calc(100% + 0.65rem);
    right: 0;
    display: grid;
    min-width: 13rem;
    padding: 0.65rem;
    border: 1px solid #8e6c38;
    background: #17100b;
    box-shadow: 0 12px 28px rgb(0 0 0 / 55%);
  }

  .theme-switch {
    grid-column: 3;
  }

  .author-door {
    grid-template-columns: 1fr;
  }

  .author-door > .cover-art {
    min-height: 240px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tavern-lower {
    grid-template-columns: 1fr;
  }

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

@media (width <= 760px) {
  html {
    scroll-behavior: auto;
  }

  .site-header {
    position: relative;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    width: calc(100% - 1rem);
    padding: 0.75rem;
  }

  .brand-mark {
    width: 2.3rem;
    height: 2.3rem;
  }

  .brand strong {
    font-size: 1rem;
  }

  .brand small {
    display: none;
  }

  .mobile-menu {
    grid-column: 2;
    justify-self: end;
  }

  .theme-switch {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
  }

  .music-window-header {
    grid-template-columns: 1fr;
  }

  .music-window-header .brand,
  .music-window-nav {
    justify-self: stretch;
  }

  .music-window-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-row: 2;
  }

  .music-window-nav a {
    text-align: center;
  }

  .music-window-header .theme-switch {
    grid-row: 3;
  }

  .theme-switch-label {
    writing-mode: horizontal-tb;
  }

  main,
  .site-footer {
    width: calc(100% - 1rem);
  }

  main {
    padding-top: 0.75rem;
  }

  .hero-home {
    grid-template-columns: 1fr;
    gap: 2rem;
    min-height: auto;
    padding: 3.6rem 1.35rem 2rem;
  }

  .hero-home::after {
    right: -40%;
    width: 20rem;
    height: 20rem;
  }

  h1 {
    font-size: clamp(3.3rem, 20vw, 5.2rem);
  }

  .notice-board {
    padding: 1.35rem;
    transform: none;
  }

  .author-section {
    padding: 2.8rem 1rem 1rem;
  }

  .section-heading {
    display: block;
  }

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

  .author-door {
    grid-template-columns: 0.9fr 1.1fr;
    min-height: 260px;
  }

  .author-door > .cover-art {
    min-height: 100%;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .author-door-copy {
    padding: 1.25rem 1rem;
  }

  .author-door-copy h3 {
    font-size: 2rem;
  }

  .music-box {
    grid-template-columns: 1fr;
  }

  .music-box-instrument {
    min-height: 140px;
  }

  .music-box-copy {
    padding: 1.5rem;
    border-top: 1px solid #725634;
    border-left: 0;
  }

  .track-list {
    grid-template-columns: 1fr;
  }

  .music-cabinet-instructions {
    grid-template-columns: 1fr;
  }

  .collection-hero {
    grid-template-columns: 1fr;
  }

  .collection-hero-art {
    min-height: 320px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .collection-hero-art::after {
    background: linear-gradient(0deg, var(--paper), transparent 45%);
  }

  .theme-toggle:checked ~ .site-shell .collection-hero-art::after {
    background: linear-gradient(0deg, #161c18, transparent 45%);
  }

  .collection-hero-copy {
    padding: 2rem 1.3rem 2.5rem;
  }

  .collection-hero h1 {
    font-size: 3.8rem;
  }

  .work-index {
    top: 0;
    margin-block: 0.75rem 1rem;
  }

  .work-card {
    grid-template-columns: minmax(118px, 0.72fr) minmax(0, 1.28fr);
    min-height: 340px;
    scroll-margin-top: 80px;
  }

  .work-card-body {
    padding: 1.2rem 1rem;
  }

  .work-card h2 {
    font-size: 1.55rem;
  }

  .room-nav,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .room-nav a {
    text-align: center;
  }
}

@media (width <= 430px) {
  .author-door {
    grid-template-columns: 1fr;
  }

  .author-door > .cover-art {
    min-height: 245px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .work-card {
    grid-template-columns: 1fr;
  }

  .work-card-cover {
    min-height: 310px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .brand-mark {
    animation: lantern-breathe 4.5s ease-in-out infinite;
  }
}

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