:root {
  --ink: #f6f0e6;
  --muted: rgb(246 240 230 / 0.72);
  --line: rgb(255 255 255 / 0.2);
  --accent: #d9b46a;
  --panel: rgb(16 12 9 / 0.42);
  --radius: 8px;
  --bg-rotate-x: 0deg;
  --bg-rotate-y: 0deg;
  --bg-shift-x: 0px;
  --bg-shift-y: 0px;
  --book-gap: 16px;
  --book-thickness: 64px;
  --loop-distance: 1540px;
  --loop-duration: 42s;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #090706;
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  font-family:
    "Arial Narrow",
    "Microsoft YaHei",
    Arial,
    sans-serif;
  overflow-x: hidden;
}

button,
a {
  color: inherit;
  font: inherit;
}

.site-shell {
  position: relative;
  min-height: 100dvh;
  isolation: isolate;
  overflow: hidden;
}

.background-scene,
.candle-scene,
.firelight {
  position: fixed;
  top: 50%;
  left: 50%;
  width: max(100vw, 177.7778vh);
  height: max(100vh, 56.25vw);
  pointer-events: none;
  transform:
    translate(-50%, -50%)
    perspective(1000px)
    translate3d(var(--bg-shift-x), var(--bg-shift-y), 0)
    rotateX(var(--bg-rotate-x))
    rotateY(var(--bg-rotate-y))
    scale(1.08);
  transform-origin: center;
  transition: transform 180ms ease-out;
  will-change: transform;
}

.floor-shimmer,
.shade {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.background-scene {
  z-index: -4;
  background:
    radial-gradient(circle at 50% 18%, rgb(217 180 106 / 0.18), transparent 28%),
    url("assets/backgrounds/magical-library.png") center / 100% 100% no-repeat;
}

.shade {
  z-index: -3;
  background:
    linear-gradient(180deg, rgb(0 0 0 / 0.16), rgb(0 0 0 / 0.56)),
    rgba(0, 0, 0, 0.5);
}

.firelight {
  z-index: -2;
  opacity: 0.3;
  mix-blend-mode: screen;
  background:
    radial-gradient(ellipse at 10.48% 68.01%, rgb(255 177 74 / 0.12), transparent 7.5%),
    radial-gradient(ellipse at 88.27% 61.97%, rgb(255 177 74 / 0.12), transparent 7.5%),
    radial-gradient(ellipse at 30.24% 69.49%, rgb(255 190 92 / 0.08), transparent 5.5%),
    radial-gradient(ellipse at 81.79% 30.83%, rgb(255 180 72 / 0.09), transparent 5.5%),
    radial-gradient(ellipse at 30.36% 16.31%, rgb(255 202 111 / 0.04), transparent 3.5%),
    radial-gradient(ellipse at 52.80% 45.13%, rgb(255 202 111 / 0.025), transparent 2.5%);
  filter: blur(12px) saturate(1.1);
  animation: candleFlicker 3.8s ease-in-out infinite alternate;
  will-change: opacity, filter;
}

.floor-shimmer {
  z-index: -2;
  opacity: 0.22;
  mix-blend-mode: screen;
  background:
    linear-gradient(102deg, transparent 0 16%, rgb(255 183 86 / 0.08) 23%, transparent 31% 52%, rgb(255 137 45 / 0.06) 59%, transparent 68%),
    radial-gradient(ellipse at 50% 82%, rgb(255 176 78 / 0.13), transparent 38%);
  background-size: 180% 100%, 100% 100%;
  transform: translate3d(var(--bg-shift-x), var(--bg-shift-y), 0);
  mask-image: linear-gradient(180deg, transparent 38%, #000 62%, #000 100%);
  animation: floorFirelight 8s ease-in-out infinite;
  will-change: background-position, opacity, transform;
}

.candle-scene {
  z-index: -1;
}

.candle-point {
  position: absolute;
  left: var(--candle-x);
  top: var(--candle-y);
  width: 0;
  height: 0;
  opacity: var(--flame-strength);
  transform: scale(var(--flame-scale));
  transform-origin: 50% 100%;
}

.candle-flame,
.candle-glow {
  position: absolute;
  left: 0;
  bottom: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.candle-flame {
  width: 12px;
  height: 25px;
  margin-left: -6px;
  transform-origin: 50% 100%;
  border-radius: 52% 48% 45% 55% / 72% 68% 32% 28%;
  background:
    radial-gradient(ellipse at 50% 72%, rgb(255 255 226 / 0.86) 0 16%, transparent 18%),
    radial-gradient(ellipse at 50% 58%, rgb(255 229 154 / 0.9) 0 30%, rgb(255 173 62 / 0.82) 52%, rgb(255 99 18 / 0.1) 73%, transparent 76%);
  animation: flameSway var(--flame-duration) ease-in-out var(--flame-delay) infinite alternate;
  will-change: transform, opacity, filter;
}

.candle-glow {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 183 74 / 0.32), rgb(255 132 34 / 0.1) 35%, transparent 70%);
  filter: blur(8px);
  animation: flameGlow var(--glow-duration) ease-in-out var(--flame-delay) infinite alternate;
  will-change: transform, opacity;
}

@keyframes flameSway {
  0% {
    opacity: 0.66;
    transform: rotate(-4deg) scaleX(0.88) scaleY(0.86);
    filter: brightness(0.88) saturate(1.06);
  }

  24% {
    opacity: 0.88;
    transform: rotate(3deg) scaleX(1.02) scaleY(1.12);
    filter: brightness(1.14) saturate(1.16);
  }

  51% {
    opacity: 0.7;
    transform: rotate(-2deg) scaleX(0.94) scaleY(0.96);
    filter: brightness(0.98) saturate(1.1);
  }

  76% {
    opacity: 0.84;
    transform: rotate(4deg) scaleX(0.92) scaleY(1.08);
    filter: brightness(1.1) saturate(1.14);
  }

  100% {
    opacity: 0.72;
    transform: rotate(-3deg) scaleX(1) scaleY(1.02);
    filter: brightness(1.02) saturate(1.1);
  }
}

@keyframes flameGlow {
  0% {
    opacity: 0.2;
    transform: translate(-50%, 44%) scale(0.78);
  }

  45% {
    opacity: 0.52;
    transform: translate(-50%, 44%) scale(1.08);
  }

  100% {
    opacity: 0.3;
    transform: translate(-50%, 44%) scale(0.9);
  }
}

@keyframes candleFlicker {
  0% {
    opacity: 0.22;
    filter: blur(14px) saturate(1.04);
  }

  38% {
    opacity: 0.34;
    filter: blur(11px) saturate(1.12);
  }

  64% {
    opacity: 0.27;
    filter: blur(13px) saturate(1.08);
  }

  100% {
    opacity: 0.38;
    filter: blur(10px) saturate(1.16);
  }
}

@keyframes floorFirelight {
  0% {
    opacity: 0.16;
    background-position: 0% 0%, center;
  }

  45% {
    opacity: 0.28;
    background-position: 58% 0%, center;
  }

  100% {
    opacity: 0.2;
    background-position: 100% 0%, center;
  }
}

.topbar {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 0;
}

.brand,
.nav-links,
.contact-button {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 16px;
  height: 24px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  box-shadow: inset 4px 0 0 rgb(255 255 255 / 0.28);
}

.nav-links {
  gap: 22px;
  justify-self: center;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a,
.contact-button {
  text-decoration: none;
}

.contact-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.contact-link > img {
  width: 15px;
  height: 15px;
  filter: invert(87%) sepia(9%) saturate(364%) hue-rotate(349deg) brightness(92%) contrast(86%);
}

.contact-popover {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 8;
  min-width: max-content;
  padding: 10px 12px;
  border: 1px solid rgb(207 171 100 / 0.48);
  border-radius: 4px;
  background: rgb(15 11 8 / 0.96);
  box-shadow: 0 14px 30px rgb(0 0 0 / 0.42);
  color: rgb(242 229 202 / 0.94);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  visibility: hidden;
}

.contact-popover--qr {
  display: grid;
  width: 176px;
  min-width: 176px;
  gap: 8px;
  justify-items: center;
  padding: 10px;
}

.contact-popover--qr > img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.contact-link:hover .contact-popover,
.contact-link:focus-visible .contact-popover {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.contact-link:focus-visible {
  outline: 1px solid rgb(224 190 109 / 0.86);
  outline-offset: 5px;
}

.contact-button {
  justify-self: end;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid rgb(255 255 255 / 0.36);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.92);
  color: #17120d;
  white-space: nowrap;
  font: inherit;
  font-weight: 700;
  transition: transform 180ms ease;
  cursor: pointer;
}

.contact-button:hover {
  transform: scale(1.08);
}

.hero {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  min-height: calc(100dvh - 72px);
  padding: clamp(22px, 4vh, 44px) 20px 30px;
  text-align: center;
}

.kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: clamp(13px, 1.4vw, 16px);
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-family:
    Georgia,
    "Times New Roman",
    "SimSun",
    serif;
  font-size: clamp(68px, 14vw, 178px);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: 0;
  text-shadow: 0 18px 46px rgb(0 0 0 / 0.58);
}

.intro {
  width: min(720px, 100%);
  margin: 20px auto 0;
  color: var(--muted);
  font-size: clamp(15px, 1.8vw, 20px);
  line-height: 1.7;
}

.library-stage {
  position: relative;
  width: 100vw;
  min-height: clamp(300px, 38vw, 450px);
  margin-top: clamp(12px, 3vh, 34px);
  margin-left: calc(50% - 50vw);
  perspective: 1300px;
}

.library-stage::after {
  content: "";
  position: absolute;
  right: 10%;
  bottom: 8%;
  left: 10%;
  height: 24px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.42);
  filter: blur(18px);
}

.book-rail {
  position: absolute;
  top: 26px;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 28px 0 90px;
  transform-style: preserve-3d;
  will-change: transform;
}

.book-slot {
  position: absolute;
  top: 28px;
  left: 0;
  width: clamp(190px, 17vw, 260px);
  transform-style: preserve-3d;
  will-change: transform;
}

.book-rail.is-paused {
  transform-style: preserve-3d;
}

.book {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(190px, 17vw, 260px);
  aspect-ratio: 1;
  --cover-a: #0e1a26;
  --cover-b: #253d53;
  --cover-c: #c9b57b;
  --cover-text: #fff7e7;
  --cover-line: rgb(255 255 255 / 0.34);
  --cover-metal: #d8b86d;
  cursor: pointer;
  transform: translateY(0);
  transition:
    transform 360ms ease,
    filter 360ms ease;
  outline: none;
  filter: none;
}

.book:hover,
.book:focus-visible {
  z-index: 10;
  transform:
    translateY(-24px)
    scale(1.18);
  filter: none;
}

.book-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.book-cover {
  position: absolute;
  inset: 0;
  border-radius: 4px 9px 9px 4px;
  clip-path: polygon(0 0, 88% 4%, 100% 96%, 7% 100%);
}

.book-depth {
  position: absolute;
  top: 12px;
  right: calc(var(--book-thickness) * -0.72);
  bottom: 13px;
  width: var(--book-thickness);
  border-radius: 0 10px 10px 0;
  background:
    linear-gradient(90deg, #2f2a22 0%, #8d846e 10%, #f8efd3 28%, #cfc4a7 52%, #fff8dc 70%, #817865 100%);
  transform: translate3d(0, 0, -46px) skewY(1.5deg);
  transform-origin: left center;
  box-shadow:
    inset 11px 0 18px rgb(0 0 0 / 0.42),
    inset -4px 0 7px rgb(255 255 255 / 0.42),
    20px 16px 24px rgb(0 0 0 / 0.38);
}

.book-page-block {
  position: absolute;
  inset: 5px 5px 5px 10px;
  border-radius: 0 8px 8px 0;
  background:
    repeating-linear-gradient(90deg, rgb(255 250 226 / 0.94) 0 1px, rgb(159 151 128 / 0.95) 1px 2px, transparent 2px 4px),
    linear-gradient(90deg, rgb(69 63 52 / 0.52), transparent 26%, rgb(255 255 255 / 0.4));
}

.book-page-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -11px;
  width: 15px;
  background: linear-gradient(90deg, rgb(0 0 0 / 0.64), transparent);
}

.book-spine {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -12px;
  z-index: 2;
  width: 30px;
  border-radius: 8px 2px 2px 8px;
  background:
    linear-gradient(90deg, rgb(0 0 0 / 0.5), transparent 30%, rgb(255 255 255 / 0.12)),
    linear-gradient(180deg, color-mix(in srgb, var(--cover-a), black 22%), var(--cover-b) 50%, color-mix(in srgb, var(--cover-c), black 12%));
  transform: translateZ(25px) rotateY(-10deg);
  box-shadow:
    inset 7px 0 12px rgb(0 0 0 / 0.58),
    inset -2px 0 0 color-mix(in srgb, var(--cover-metal), transparent 28%),
    -9px 10px 20px rgb(0 0 0 / 0.42);
}

.book-spine span {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 50%;
  width: 8px;
  border-top: 1px solid var(--cover-metal);
  border-bottom: 1px solid var(--cover-metal);
  background:
    linear-gradient(var(--cover-metal), var(--cover-metal)) 50% 0 / 1px 100% no-repeat;
  opacity: 0.75;
  transform: translateX(-50%);
}

.book-cover {
  overflow: hidden;
  border: 1px solid rgb(216 174 92 / 0.78);
  background:
    radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--cover-glow), transparent 82%), transparent 34%),
    radial-gradient(circle at 50% 72%, color-mix(in srgb, var(--cover-glow), transparent 88%), transparent 32%),
    linear-gradient(150deg, #050403, #12100d 46%, #050403);
  transform: translateZ(34px);
  box-shadow:
    inset 0 0 0 4px #050403,
    inset 0 0 0 6px rgb(218 171 79 / 0.74),
    inset 0 0 0 9px rgb(0 0 0 / 0.78),
    inset 21px 0 30px rgb(0 0 0 / 0.72);
}

.book-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(0 0 0 / 0.66), transparent 20%, transparent 74%, rgb(255 255 255 / 0.08)),
    linear-gradient(180deg, rgb(255 255 255 / 0.08), transparent 20%, transparent 78%, rgb(0 0 0 / 0.72));
  pointer-events: none;
}

.leather-grain {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle, rgb(255 255 255 / 0.06) 0 1px, transparent 1.5px) 0 0 / 8px 8px,
    radial-gradient(circle, rgb(0 0 0 / 0.6) 0 1px, transparent 1.5px) 3px 4px / 10px 9px,
    repeating-linear-gradient(73deg, rgb(255 255 255 / 0.028) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
  opacity: 0.34;
}

.gold-foil {
  color: var(--cover-metal);
  filter:
    drop-shadow(0 0 4px rgb(255 214 122 / 0.2))
    drop-shadow(0 1px 0 rgb(0 0 0 / 0.85));
}

.cover-plate {
  position: absolute;
  inset: 14px 12px;
  z-index: 1;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgb(219 174 89 / 0.88);
  background:
    linear-gradient(90deg, transparent 47%, rgb(218 171 79 / 0.14) 48%, transparent 50%),
    linear-gradient(0deg, transparent 47%, rgb(218 171 79 / 0.12) 48%, transparent 50%);
  box-shadow:
    inset 0 0 0 4px rgb(0 0 0 / 0.52),
    inset 0 0 0 6px rgb(218 171 79 / 0.52),
    inset 0 0 28px rgb(0 0 0 / 0.58);
}

.cover-plate::before,
.cover-plate::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgb(218 171 79 / 0.72);
  opacity: 0.82;
}

.cover-plate::after {
  inset: 12px;
  border-color: rgb(218 171 79 / 0.42);
  opacity: 0.76;
}

.cover-medallions {
  position: absolute;
  inset: 19px 17px;
  z-index: 3;
  pointer-events: none;
}

.medallion {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 1px solid rgb(218 171 79 / 0.9);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 3px rgb(0 0 0 / 0.54),
    inset 0 0 0 4px rgb(218 171 79 / 0.4);
}

.medallion::before,
.medallion::after {
  content: "";
  position: absolute;
  inset: 8px;
}

.medallion-moon {
  top: 0;
  left: 0;
}

.medallion-moon::before {
  border-radius: 50%;
  box-shadow: -5px 0 0 2px var(--cover-metal);
}

.medallion-star {
  top: 0;
  right: 0;
}

.medallion-star::before {
  background:
    linear-gradient(var(--cover-metal), var(--cover-metal)) 50% 0 / 1px 100% no-repeat,
    linear-gradient(90deg, var(--cover-metal), var(--cover-metal)) 0 50% / 100% 1px no-repeat;
  transform: rotate(45deg);
}

.medallion-crystal {
  bottom: 0;
  left: 0;
}

.medallion-crystal::before {
  border: 1px solid var(--cover-metal);
  clip-path: polygon(50% 0, 100% 36%, 76% 100%, 24% 100%, 0 36%);
}

.medallion-flame {
  right: 0;
  bottom: 0;
}

.medallion-flame::before {
  border: 1px solid var(--cover-metal);
  border-top: 0;
  border-radius: 50% 50% 45% 45%;
  transform: rotate(-12deg);
}

.cover-arc-frame {
  position: absolute;
  inset: 30px 22px;
  z-index: 2;
  border: 1px solid rgb(218 171 79 / 0.72);
  border-radius: 46% 46% 12px 12px / 24% 24% 12px 12px;
  pointer-events: none;
}

.cover-arc-frame::before,
.cover-arc-frame::after,
.cover-arc-frame span::before,
.cover-arc-frame span::after {
  content: "";
  position: absolute;
  background: var(--cover-metal);
}

.cover-arc-frame::before {
  top: 38px;
  right: 16px;
  left: 16px;
  height: 1px;
  box-shadow:
    0 6px 0 rgb(218 171 79 / 0.34),
    0 130px 0 rgb(218 171 79 / 0.42);
}

.cover-arc-frame::after {
  top: 41%;
  left: 50%;
  width: 46px;
  height: 46px;
  border: 1px solid rgb(218 171 79 / 0.64);
  border-radius: 50%;
  background:
    linear-gradient(var(--cover-metal), var(--cover-metal)) 50% 7px / 1px 32px no-repeat,
    linear-gradient(90deg, var(--cover-metal), var(--cover-metal)) 7px 50% / 32px 1px no-repeat;
  transform: translate(-50%, -50%) rotate(45deg);
}

.cover-arc-frame span::before,
.cover-arc-frame span::after {
  top: 9px;
  width: 42px;
  height: 42px;
  border-top: 1px solid rgb(218 171 79 / 0.78);
  background: transparent;
}

.cover-arc-frame span::before {
  left: 22px;
  border-left: 1px solid rgb(218 171 79 / 0.78);
  border-radius: 28px 0 0;
}

.cover-arc-frame span::after {
  right: 22px;
  border-right: 1px solid rgb(218 171 79 / 0.78);
  border-radius: 0 28px 0 0;
}

.cover-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: color-mix(in srgb, var(--cover-metal), transparent 8%);
  opacity: 0.9;
}

.corner-a {
  top: 8px;
  left: 8px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.corner-b {
  top: 8px;
  right: 8px;
  border-top: 2px solid;
  border-right: 2px solid;
}

.corner-c {
  right: 8px;
  bottom: 8px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.corner-d {
  bottom: 8px;
  left: 8px;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.cover-title-zone {
  position: absolute;
  inset: 64px 18px auto;
  z-index: 4;
  display: grid;
  min-height: 30%;
  align-content: center;
  text-align: center;
  text-shadow: 0 3px 14px rgb(0 0 0 / 0.84);
}

.cover-title-band {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 92px;
  padding: 8px 8px 6px;
  border: 0;
  background:
    radial-gradient(circle at 50% 48%, rgb(255 255 255 / 0.14), transparent 58%);
  box-shadow: none;
}

.cover-kicker,
.cover-index {
  color: color-mix(in srgb, var(--cover-text), transparent 28%);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cover-headline {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0;
  color: transparent;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7f5ef 26%, #9b9b94 48%, #ffffff 62%, #b57b51 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 0.9px rgb(255 255 255 / 0.92);
  font-family:
    "Old English Text MT",
    "Blackletter",
    "UnifrakturMaguntia",
    Georgia,
    "Times New Roman",
    "Microsoft YaHei",
    serif;
  font-size: clamp(17px, 1.75vw, 26px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: 0.01em;
  filter:
    drop-shadow(1px 1px 0 #6b321d)
    drop-shadow(-1px -1px 0 rgb(255 255 255 / 0.25))
    drop-shadow(0 8px 10px rgb(0 0 0 / 0.7));
  transform: scaleY(1.14);
}

.title-line {
  display: block;
  white-space: nowrap;
}

.title-line-latin {
  font-size: clamp(34px, 3.25vw, 50px);
  letter-spacing: 0.03em;
}

.cover-index {
  justify-self: center;
  width: 34px;
  padding-top: 7px;
  border-top: 1px solid color-mix(in srgb, var(--cover-text), transparent 42%);
}

.cover-ornament-zone {
  position: absolute;
  right: 28px;
  bottom: 32px;
  left: 28px;
  z-index: 4;
  height: 30%;
  border: 1px solid rgb(218 171 79 / 0.74);
  border-radius: 50% 50% 8px 8px / 18% 18% 8px 8px;
  background:
    radial-gradient(circle at 50% 42%, rgb(218 171 79 / 0.12), transparent 44%),
    linear-gradient(90deg, transparent, rgb(218 171 79 / 0.08), transparent);
  box-shadow:
    inset 0 0 0 4px rgb(0 0 0 / 0.42),
    inset 0 0 0 5px rgb(218 171 79 / 0.32);
}

.cover-ornament-zone::before,
.cover-ornament-zone::after {
  content: "";
  position: absolute;
  inset: -18px 18px auto;
  height: 1px;
  background: color-mix(in srgb, var(--cover-metal), transparent 18%);
  box-shadow:
    0 7px 0 color-mix(in srgb, var(--cover-metal), transparent 64%),
    0 14px 0 color-mix(in srgb, var(--cover-metal), transparent 78%);
}

.cover-ornament-zone::after {
  inset: auto 18px -14px;
}

.cover-sigil {
  position: absolute;
  top: -20px;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border: 1px solid color-mix(in srgb, var(--cover-metal), transparent 6%);
  border-radius: 50%;
  color: var(--cover-metal);
  background: color-mix(in srgb, var(--cover-a), black 26%);
  box-shadow:
    0 0 20px color-mix(in srgb, var(--cover-metal), transparent 78%),
    inset 0 0 12px rgb(0 0 0 / 0.42);
  font-family:
    "Old English Text MT",
    "Blackletter",
    "UnifrakturMaguntia",
    Georgia,
    serif;
  font-size: 22px;
  transform: translateX(-50%);
}

.category-icon {
  position: absolute;
  right: 22%;
  bottom: 18%;
  left: 22%;
  height: 44%;
  border-bottom: 2px solid var(--cover-metal);
}

.icon-stage {
  background:
    linear-gradient(var(--cover-metal), var(--cover-metal)) 16% 56% / 2px 44% no-repeat,
    linear-gradient(var(--cover-metal), var(--cover-metal)) 35% 34% / 2px 66% no-repeat,
    linear-gradient(var(--cover-metal), var(--cover-metal)) 54% 20% / 2px 80% no-repeat,
    linear-gradient(var(--cover-metal), var(--cover-metal)) 74% 42% / 2px 58% no-repeat,
    linear-gradient(var(--cover-metal), var(--cover-metal)) 88% 62% / 2px 38% no-repeat;
}

.icon-stage::before {
  content: "";
  position: absolute;
  right: -14%;
  bottom: 0;
  left: -14%;
  height: 68%;
  border: 2px solid var(--cover-metal);
  border-bottom: 0;
  clip-path: polygon(0 100%, 12% 48%, 24% 100%, 36% 38%, 48% 100%, 60% 18%, 72% 100%, 86% 42%, 100% 100%);
}

.icon-stage::after {
  content: "";
  position: absolute;
  right: 18%;
  bottom: 18%;
  left: 18%;
  height: 2px;
  background: var(--cover-metal);
  box-shadow:
    -24px 14px 0 color-mix(in srgb, var(--cover-metal), transparent 28%),
    20px 22px 0 color-mix(in srgb, var(--cover-metal), transparent 36%);
}

.icon-robot {
  right: 27%;
  left: 27%;
  height: 50%;
  border: 2px solid var(--cover-metal);
  border-radius: 9px 9px 5px 5px;
  background:
    radial-gradient(circle, var(--cover-metal) 0 3px, transparent 4px) 28% 32% / 18px 18px no-repeat,
    radial-gradient(circle, var(--cover-metal) 0 3px, transparent 4px) 72% 32% / 18px 18px no-repeat,
    linear-gradient(var(--cover-metal), var(--cover-metal)) 50% 70% / 38% 2px no-repeat;
}

.icon-robot::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 50%;
  width: 2px;
  height: 16px;
  background: var(--cover-metal);
  box-shadow: 0 -5px 0 3px color-mix(in srgb, var(--cover-metal), transparent 20%);
  transform: translateX(-50%);
}

.icon-robot::after {
  content: "";
  position: absolute;
  inset: 30% -13px auto;
  height: 2px;
  background: transparent;
  box-shadow:
    -8px 0 0 var(--cover-metal),
    calc(100% + 8px) 0 0 var(--cover-metal);
}

.icon-package {
  right: 22%;
  left: 22%;
  height: 48%;
  border: 2px solid var(--cover-metal);
  transform: skewY(-5deg);
}

.icon-package::before {
  content: "";
  position: absolute;
  inset: -18px 16% auto;
  height: 22px;
  border: 2px solid var(--cover-metal);
  border-bottom: 0;
  transform: skewX(-28deg);
}

.icon-package::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 49%, var(--cover-metal) 50%, transparent 51%),
    linear-gradient(var(--cover-metal), var(--cover-metal)) 50% 0 / 2px 100% no-repeat;
  opacity: 0.76;
}

.icon-poster {
  right: 19%;
  left: 19%;
  height: 54%;
  border: 2px solid var(--cover-metal);
  border-radius: 2px;
  background:
    linear-gradient(var(--cover-metal), var(--cover-metal)) 50% 25% / 54% 2px no-repeat,
    linear-gradient(var(--cover-metal), var(--cover-metal)) 50% 48% / 68% 2px no-repeat,
    linear-gradient(var(--cover-metal), var(--cover-metal)) 50% 70% / 42% 2px no-repeat;
}

.icon-poster::before,
.icon-poster::after {
  content: "";
  position: absolute;
  top: -15px;
  width: 2px;
  height: 15px;
  background: var(--cover-metal);
}

.icon-poster::before {
  left: 18%;
}

.icon-poster::after {
  right: 18%;
}

.icon-vi {
  right: 18%;
  left: 18%;
  height: 54%;
  border: 2px solid var(--cover-metal);
  border-radius: 50%;
}

.icon-vi::before {
  content: "VI";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--cover-metal);
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
}

.icon-vi::after {
  content: "";
  position: absolute;
  inset: 13%;
  border: 1px solid color-mix(in srgb, var(--cover-metal), transparent 24%);
  border-radius: 50%;
}

.icon-brochure {
  right: 18%;
  left: 18%;
  height: 50%;
  border-bottom: 0;
  background:
    linear-gradient(var(--cover-metal), var(--cover-metal)) 50% 0 / 2px 100% no-repeat;
}

.icon-brochure::before,
.icon-brochure::after {
  content: "";
  position: absolute;
  top: 7%;
  bottom: 7%;
  width: 44%;
  border: 2px solid var(--cover-metal);
  border-radius: 3px 10px 10px 3px;
}

.icon-brochure::before {
  left: 2%;
  transform: skewY(5deg);
}

.icon-brochure::after {
  right: 2%;
  transform: skewY(-5deg);
}

.icon-sigil {
  right: 24%;
  left: 24%;
  height: 50%;
  border: 2px solid var(--cover-metal);
  transform: rotate(45deg);
}

.ornament-moon {
  position: absolute;
  top: 20%;
  right: 20%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: -5px 0 0 var(--cover-metal);
  opacity: 0.9;
}

.ornament-ribbon {
  position: absolute;
  right: 12%;
  bottom: 11%;
  left: 12%;
  height: 11px;
  border-top: 1px solid var(--cover-metal);
  border-bottom: 1px solid var(--cover-metal);
  transform: rotate(-7deg);
  opacity: 0.78;
}

.ornament-stars {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, var(--cover-metal) 0 1px, transparent 2px) 12% 24% / 24px 24px,
    radial-gradient(circle, var(--cover-metal) 0 1px, transparent 2px) 83% 74% / 30px 30px;
  opacity: 0.8;
}

.theme-ember {
  --cover-a: #050403;
  --cover-b: #140806;
  --cover-c: #3f120c;
  --cover-glow: #bd3e24;
  --cover-metal: #f0c170;
  --cover-text: #fff4d8;
  --cover-line: rgb(255 206 126 / 0.46);
}

.theme-azure {
  --cover-a: #050403;
  --cover-b: #06101a;
  --cover-c: #12335c;
  --cover-glow: #4da8de;
  --cover-metal: #c7e3ff;
  --cover-text: #eaf8ff;
  --cover-line: rgb(128 198 232 / 0.48);
}

.theme-jade {
  --cover-a: #050403;
  --cover-b: #06150f;
  --cover-c: #174a34;
  --cover-glow: #67bf75;
  --cover-metal: #cfe99c;
  --cover-text: #efffe9;
  --cover-line: rgb(164 222 183 / 0.48);
}

.theme-ivory {
  --cover-a: #050403;
  --cover-b: #18130e;
  --cover-c: #4a3823;
  --cover-glow: #d6b981;
  --cover-metal: #f5d58a;
  --cover-text: #fff8e8;
  --cover-line: rgb(255 246 214 / 0.58);
}

.theme-violet {
  --cover-a: #050403;
  --cover-b: #12091c;
  --cover-c: #3b1d58;
  --cover-glow: #a76de0;
  --cover-metal: #efc3ff;
  --cover-text: #fbf2ff;
  --cover-line: rgb(202 173 255 / 0.48);
}

.theme-gold {
  --cover-a: #050403;
  --cover-b: #171006;
  --cover-c: #5a4211;
  --cover-glow: #e8be4a;
  --cover-metal: #ffe08a;
  --cover-text: #fff6d7;
  --cover-line: rgb(244 202 99 / 0.54);
}

.book-note {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  width: 190px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(12 9 7 / 0.68);
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  transition:
    opacity 260ms ease,
    transform 260ms ease;
  backdrop-filter: blur(14px);
}

.book:hover .book-note,
.book:focus-visible .book-note {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.book-note span {
  color: var(--accent);
  font-size: 12px;
}

.book-note p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(920px, 100%);
  margin: 0 auto;
}

.category-chips button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: 999px;
  background: rgb(13 10 8 / 0.48);
  color: var(--muted);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.category-chips button:hover,
.category-chips button:focus-visible {
  border-color: rgb(217 180 106 / 0.8);
  color: var(--ink);
}

.profile-strip {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.profile-strip > div {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.profile-strip span {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.profile-strip strong {
  font-size: clamp(14px, 1.5vw, 18px);
}

.portfolio-dialog {
  width: min(1120px, calc(100vw - 36px));
  max-height: min(86dvh, 820px);
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: var(--radius);
  background: rgb(12 9 7 / 0.84);
  color: var(--ink);
  box-shadow: 0 30px 90px rgb(0 0 0 / 0.62);
  backdrop-filter: blur(22px);
}

.portfolio-dialog::backdrop {
  background: rgb(0 0 0 / 0.68);
  backdrop-filter: blur(5px);
}

.dialog-panel {
  max-height: inherit;
  overflow: auto;
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  padding: clamp(18px, 3vw, 30px);
  border-bottom: 1px solid var(--line);
  background: rgb(12 9 7 / 0.92);
  backdrop-filter: blur(18px);
}

.dialog-header span {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dialog-header h2 {
  margin: 8px 0 8px;
  font-family:
    Georgia,
    "Times New Roman",
    "Microsoft YaHei",
    serif;
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 400;
  line-height: 1;
}

.dialog-header p {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgb(255 255 255 / 0.28);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.92);
  color: #17120d;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(14px, 2vw, 22px);
  padding: clamp(18px, 3vw, 30px);
}

.gallery-item {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.06);
}

.gallery-preview-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-preview-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.gallery-preview-button img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: rgb(5 4 3 / 0.88);
}

.gallery-item figcaption {
  padding: 10px 12px 12px;
  color: var(--muted);
  font-size: 13px;
}

.image-preview-dialog {
  width: min(1220px, calc(100vw - 28px));
  max-height: min(92dvh, 920px);
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.24);
  border-radius: var(--radius);
  background: rgb(8 6 5 / 0.92);
  color: var(--ink);
  box-shadow: 0 34px 110px rgb(0 0 0 / 0.72);
  backdrop-filter: blur(20px);
}

.image-preview-dialog::backdrop {
  background: rgb(0 0 0 / 0.78);
  backdrop-filter: blur(7px);
}

.about-dialog {
  width: min(1040px, calc(100vw - 36px));
  height: min(calc(100dvh - 32px), 760px);
  max-height: none;
  padding: 0;
  border: 1px solid rgb(207 171 100 / 0.5);
  border-radius: var(--radius);
  background: rgb(15 11 8 / 0.96);
  color: var(--ink);
  box-shadow: 0 34px 100px rgb(0 0 0 / 0.72);
}

.about-dialog.is-work {
  height: min(calc(100dvh - 32px), 920px);
}

.about-dialog::backdrop {
  background: rgb(0 0 0 / 0.76);
  backdrop-filter: blur(7px);
}

.about-panel {
  position: relative;
  max-height: inherit;
  overflow: hidden;
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid rgb(255 244 212 / 0.1);
  background: rgb(20 15 11 / 0.96);
}

.about-panel::before {
  display: none;
}

.about-page-viewport {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  outline: 1px solid rgb(207 171 100 / 0.28);
  outline-offset: calc(clamp(24px, 4vw, 48px) - 14px);
  border-radius: 5px;
}

.about-pages {
  display: flex;
  width: 200%;
  gap: 53px;
  align-items: flex-start;
  transform: translateX(10px);
  transition: transform 520ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.about-pages.is-work {
  transform: translateX(calc(-50% - 26.5px + 10px));
}

.about-page {
  position: relative;
  flex: 0 0 calc(50% - 26.5px);
  min-width: 0;
}

.about-page--profile {
  padding-right: 46px;
}

.about-page--work {
  padding-bottom: 56px;
}

.about-page-toggle {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgb(207 171 100 / 0.58);
  border-radius: 50%;
  background: rgb(20 15 11 / 0.9);
  color: var(--accent);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.about-page-toggle {
  top: 50%;
  right: 18px;
}

.about-panel.is-work .about-page-toggle {
  right: auto;
  left: 18px;
}

.about-page-toggle:hover {
  background: var(--accent);
  color: #17120d;
  transform: scale(1.08);
}

.about-page-toggle:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

.page-toggle-icon {
  display: block;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid currentColor;
  transform: translateX(1px);
  transition: transform 180ms ease;
}

.about-page-toggle.is-work .page-toggle-icon {
  transform: rotate(180deg) translateX(1px);
}

.work-header {
  padding: 4px 0 12px;
  border-bottom: 1px solid rgb(207 171 100 / 0.42);
}

.work-header h2 {
  margin: 0;
  color: #f4ead8;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 400;
  line-height: 1;
}

.work-header h2 span {
  display: block;
  margin-top: 4px;
  color: rgb(207 171 100 / 0.86);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.work-header > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.work-list {
  display: grid;
  gap: 18px;
  padding: 12px 0 40px;
}

.work-item {
  display: grid;
  grid-template-columns: minmax(175px, 0.34fr) minmax(0, 1fr);
  gap: clamp(14px, 2vw, 24px);
  padding-bottom: 8px;
  border-bottom: 1px solid rgb(207 171 100 / 0.2);
}

.work-item:last-child {
  border-bottom: 0;
}

.work-meta {
  text-align: left;
}

.work-meta h3 {
  margin: 0;
  text-align: left;
  color: #f4ead8;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(16px, 1.8vw, 21px);
  font-weight: 600;
  line-height: 1.25;
}

.work-meta p {
  margin: 6px 0 0;
  text-align: left;
  color: rgb(207 171 100 / 0.82);
  font-size: 10px;
  line-height: 1.35;
}

.work-meta-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
}

.work-role {
  justify-self: end;
  width: 76px;
  padding-top: 6px;
  color: rgb(207 171 100 / 0.82);
  font-size: 10px;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
}

.work-detail p {
  margin: 0 0 4px;
  color: rgb(244 234 216 / 0.78);
  font-size: 11px;
  line-height: 1.35;
}

.work-detail p:last-child {
  margin-bottom: 0;
}

.work-detail strong {
  color: #f4ead8;
  font-weight: 700;
}

.about-panel > .dialog-close {
  position: absolute;
  z-index: 2;
  top: clamp(18px, 3vw, 28px);
  right: clamp(18px, 3vw, 28px);
}

.about-profile {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(260px, 0.76fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.about-kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.about-copy h2 {
  max-width: calc(100% - 64px);
  margin: 0;
  color: #f4ead8;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 400;
  line-height: 0.98;
}

.about-copy h2 span {
  display: block;
  margin-top: 8px;
  color: rgb(207 171 100 / 0.86);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.about-name {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.about-name span {
  margin-left: 10px;
  color: rgb(244 234 216 / 0.74);
  font-size: 14px;
}

.about-roles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: clamp(26px, 4vw, 38px) 0 22px;
}

.about-roles div {
  display: grid;
  gap: 4px;
  min-height: 104px;
  padding: 14px;
  border: 1px solid rgb(207 171 100 / 0.28);
  border-radius: 5px;
  background: rgb(255 255 255 / 0.035);
}

.about-roles span,
.about-roles small {
  color: rgb(207 171 100 / 0.78);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.about-roles strong {
  color: #f4ead8;
  font-size: 18px;
  font-weight: 500;
}

.about-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid rgb(207 171 100 / 0.28);
  border-left: 1px solid rgb(207 171 100 / 0.28);
}

.about-details div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 11px 12px;
  border-right: 1px solid rgb(207 171 100 / 0.28);
  border-bottom: 1px solid rgb(207 171 100 / 0.28);
}

.about-details dt {
  color: rgb(207 171 100 / 0.78);
  font-size: 12px;
}

.about-details dd {
  min-width: 0;
  margin: 0;
  color: rgb(244 234 216 / 0.9);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.about-bio {
  margin: 22px 0 0;
  color: rgb(244 234 216 / 0.78);
  font-size: 15px;
  line-height: 1.85;
}

.about-portrait {
  display: grid;
  justify-items: center;
  gap: 16px;
  margin: 0;
}

.about-portrait-frame {
  width: min(100%, 320px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.about-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(1) contrast(1.04);
}

.about-portrait figcaption {
  color: rgb(207 171 100 / 0.78);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.image-preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: inherit;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.preview-header h2 {
  margin: 0;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 700;
}

.preview-image {
  display: block;
  width: 100%;
  max-height: calc(92dvh - 76px);
  object-fit: contain;
  background: rgb(0 0 0 / 0.38);
  transform-origin: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform 160ms ease;
}

.preview-image.is-dragging {
  cursor: grabbing;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .firelight,
  .floor-shimmer,
  .candle-flame,
  .candle-glow {
    animation: none;
  }

  .candle-flame {
    opacity: 0.78;
    transform: scaleY(0.96);
    filter: brightness(1.02) saturate(1.08);
  }

  .candle-glow {
    opacity: 0.24;
    transform: translate(-50%, 44%) scale(0.86);
  }

  .book,
  .book-note,
  .contact-button,
  .about-pages,
  .about-page-toggle {
    transition: none;
  }
}

@media (max-width: 760px) {
  :root {
    --book-gap: 5px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    width: min(100% - 28px, 720px);
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding-inline: 14px;
  }

  h1 {
    font-size: clamp(58px, 20vw, 96px);
  }

  .library-stage {
    width: 100vw;
    min-height: 474px;
    margin-left: calc(50% - 50vw);
  }

  .book-slot,
  .book {
    width: 252px;
  }

  .profile-strip {
    grid-template-columns: 1fr;
    width: calc(100% - 28px);
  }

  .about-dialog {
    width: min(100vw - 20px, 560px);
    height: min(calc(100dvh - 20px), 900px);
    max-height: none;
  }

  .about-panel {
    max-height: inherit;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 58px 20px 24px;
  }

  .about-page--profile {
    padding-right: 30px;
  }

  .about-page--profile {
    padding-left: 24px;
  }

  .about-page--work {
    padding-left: 16px;
  }

  .about-page-toggle {
    right: 8px;
  }

  .about-panel.is-work .about-page-toggle {
    right: auto;
    left: 8px;
  }

  .about-panel::before {
    display: none;
    inset: 9px;
  }

  .about-page-viewport {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    margin: -50px -12px -12px;
    width: calc(100% + 24px);
    padding: 50px 12px 12px;
    border: 1px solid rgb(207 171 100 / 0.28);
    outline: none;
    border-radius: 5px;
  }

  .about-pages {
    gap: 32px;
  }

  .about-pages.is-work {
    transform: translateX(calc(-50% - 16px));
  }

  .about-page {
    flex: 0 0 calc(50% - 16px);
  }

  .about-page-toggle {
    position: fixed;
    top: 50%;
    right: max(8px, calc((100vw - 560px) / 2 + 8px));
    transform: translateY(-50%);
  }

  .about-panel.is-work .about-page-toggle {
    right: auto;
    left: max(8px, calc((100vw - 560px) / 2 + 8px));
  }

  .about-page-toggle:hover {
    transform: translateY(-50%) scale(1.08);
  }

  .about-profile {
    grid-template-columns: 1fr;
  }

  .about-portrait {
    order: -1;
  }

  .about-portrait-frame {
    width: min(70vw, 260px);
  }

  .about-roles {
    grid-template-columns: 1fr;
  }

  .about-roles div {
    grid-template-columns: 34px 1fr;
    align-items: baseline;
    min-height: 0;
  }

  .about-roles small {
    grid-column: 2;
  }

  .about-details {
    grid-template-columns: 1fr;
  }

  .about-details div {
    padding-block: 14px;
  }

  .about-page--work .work-header,
  .about-page--work .work-list {
    padding-left: 0;
  }

  .work-item {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-bottom: 18px;
  }

  .work-meta h3 {
    font-size: 21px;
  }
}
