:root {
  --paper: #f3e7d7;
  --ink: #263d34;
  --accent: #456758;
  --line: #c4b6a2;
}

.topbar {
  background: var(--paper);
  border-color: #c4b6a2ab;
}

.index-trigger {
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  font-size: 14px;
  cursor: pointer;
}

.index-trigger:hover { text-decoration: underline; text-underline-offset: 5px; }

.opening {
  gap: clamp(11px, 2vh, 24px);
  padding-top: calc(var(--nav) + clamp(10px, 2vh, 22px));
  padding-bottom: 64px;
}

.cover {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  isolation: isolate;
  overflow: hidden;
  border: 0;
  min-height: min(360px, 53vh);
}

.cover-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: #eedcc6;
}

.cover-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f3e7d7d9, #f3e7d7a3 46%, transparent 65%);
  pointer-events: none;
}

.cover-art img {
  object-position: center 75%;
}

.cover-copy {
  width: max-content;
  max-width: 100%;
  padding: clamp(22px, 4vw, 74px);
}

.cover h1 {
  font-size: clamp(58px, 9vw, 146px);
  line-height: .98;
  letter-spacing: -.077em;
}

.cover h1 span, .closing h2 span {
  color: #546f60;
}

.cover-copy p {
  margin: .82em 0 .33em;
  font-size: clamp(15px, 1.55vw, 24px);
  color: #33473b;
}

.cover-entry {
  text-decoration: none;
  border-bottom: 1px solid #58716296;
}

.cover-entry span {
  transition: transform .22s ease;
}

.cover-entry:hover span, .cover-entry:focus-visible span {
  transform: translate(3px,-3px);
}

.slices {
  gap: clamp(8px, 1.5vw, 22px);
  border: 0;
}

.slices .slice {
  grid-template-columns: minmax(0,1fr) auto;
  column-gap: 7px;
  row-gap: 11px;
  padding: 0 0 10px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  transition: border-color .25s ease;
}

.slices .slice:is(:hover,:focus-visible) {
  background: transparent;
  border-color: #486d59;
  outline-offset: 3px;
}

.slices .still {
  grid-column: 1 / -1;
  height: clamp(55px, 11vh, 137px);
  aspect-ratio: auto;
}

.slice-efin .still { background: #a2b5bc; }
.slice-elk .still { background: #234337; }
.slice-pet .still { background: #a66c4f; }
.slice-ring .still { background: #70566f; }
.slice-efin .still img { object-position: 50% 40%; }
.slice-elk .still img { object-position: 50% 38%; }
.slice-pet .still img { object-position: 50% 43%; }
.slice-ring .still img { object-position: 50% 35%; }

.slice-label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4em .8em;
  min-width: 0;
}

.slice-label strong {
  font-family: Georgia, "Songti SC", SimSun, serif;
  font-size: clamp(16px, 2vw, 28px);
  letter-spacing: -.03em;
}

.slice-label small {
  color: #4d574a;
  opacity: 1;
}

.slice-arrow {
  color: #456758;
  transition: transform .2s ease;
}

.slice:is(:hover,:focus-visible) .slice-arrow {
  transform: translate(2px,-2px);
}

.work, .closing {
  --scene-top: calc(var(--nav) + 16px);
  --scene-bottom: 64px;
  --scene-edge: var(--gutter);
  background: var(--paper);
}

.work::before, .closing::before {
  inset: var(--scene-top) var(--scene-edge) var(--scene-bottom);
}

.work {
  padding-inline: calc(var(--scene-edge) + clamp(22px, 4vw, 68px));
  padding-bottom: calc(var(--scene-bottom) + 18px);
}

.work-efin {
  --scene: linear-gradient(90deg, #dce6e9 5%, #dce6e9e8 30%, #dce6e9b9 73%, #dce6e97a),
    #b7c4c7 url("assets/exhibition/print-paper.webp") center 38% / cover;
}

.efin-window {
  transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
  box-shadow: 0 22px 48px #273e5240;
}

.efin-slide {
  transform: rotate(3deg);
  box-shadow: 0 10px 24px #273e5240;
}

.work-elk {
  --scene: linear-gradient(90deg, #192f25a3, #192f2580 50%, #192f25e8),
    #223b35 url("assets/elk-handoff-art-20261117.webp") center / cover;
}

.work-pet {
  --scene: linear-gradient(90deg, #ebd6b9f2, #ebd6b9e8 26%, #ebd6b950 48%, #3b241018),
    #d8a975 url("assets/pet-nest-cottage.webp") center 78% / cover;
}

.pet-art {
  inset: var(--scene-top) var(--scene-edge) var(--scene-bottom);
}

.pet-touch {
  bottom: 7%;
}

.pet-status {
  bottom: 2%;
  background: #f0dec6;
}

.pet-touch::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto 26% 8% 29%;
  height: 7%;
  border-radius: 50%;
  background: #73451d69;
  filter: blur(3px);
}

@media (prefers-reduced-motion: no-preference) {
  .pet-touch.bounce::before { animation: hop-shadow .48s ease both; }
}

@keyframes hop-shadow {
  0%,100% { opacity: 1; transform: none; }
  42% { opacity: .45; transform: scale(.75); }
}

.work-ring {
  --scene: linear-gradient(90deg, #1e152be9, #2218318f 51%, #3326433b),
    #24182e url("assets/ring/title.webp") center / cover;
}

.ring-art {
  inset: var(--scene-top) var(--scene-edge) var(--scene-bottom) 42%;
  overflow: hidden;
}

.closing {
  padding-inline: calc(var(--scene-edge) + clamp(22px, 4vw, 68px));
}

.closing::before {
  content: "";
  position: absolute;
  z-index: -1;
  background: #263d34;
}

.rail-controls {
  bottom: max(8px, env(safe-area-inset-bottom));
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}

.rail-controls button {
  border-color: #898f80;
}

.rail-controls button:hover:not(:disabled) {
  background: #dcd8c7;
}

.rail-line { background: #baa993; }
.rail-line i { background: #456758; }

.rail-controls .rail-index { width: auto; min-width: 60px; font-size: 12px; border: 0; }

.scene-index {
  width: min(560px,calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: clamp(18px, 4vw, 36px);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 32px 100px #15251f50;
}

.scene-index::backdrop { background: #263d3473; }
.index-head { display: flex; justify-content: space-between; align-items: center; gap: 1em; margin-bottom: 16px; }
.index-head h2 { margin: 0; font: normal 32px Georgia,SimSun,serif; }
.index-head button { min-width: 44px; min-height: 44px; background: none; border: 1px solid var(--line); cursor: pointer; font-size: 23px; }
.scene-index nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 16px; }
.scene-index a { display: flex; align-items: center; gap: .65em; min-height: 50px; padding: 4px; border-bottom: 1px solid var(--line); font-size: clamp(14px, 3.7vw, 18px); }
.scene-index a:is(:hover,[aria-current]) { background: #dedbc9; }
.scene-index img { width: 42px; height: 34px; object-fit: cover; }

@media (min-width: 601px) and (max-height: 680px) {
  .opening { grid-template-rows: minmax(265px,1fr) auto; }
  .slices .slice { row-gap: 6px; }
}

@media (max-width: 760px) {
  .slice-label small { flex-basis: 100%; }
}

@media (max-width: 600px) {
  .index-trigger { font-size: 12px; }
  .opening { padding-top: calc(var(--nav) + 9px); gap: 13px; }
  .cover { display: flex; flex-direction: column; min-height: 0; }
  .cover-art { position: relative; inset: auto; order: -1; height: clamp(136px, calc(100dvh - 365px), 453px); }
  .cover-art img { object-position: 86% 58%; }
  .cover-art::after { background: linear-gradient(0deg, var(--paper), #f3e7d70b 24%, transparent 42%); }
  .cover-copy { grid-template-columns: 1fr auto; width: auto; padding: 0 0 4px; margin-top: -15px; }
  .cover h1 { font-size: clamp(44px, 14.2vw, 76px); }
  .cover-copy p { margin: .4em 0 0; line-height: 1.45; font-size: 13px; }
  .cover-entry { font-size: 12px; min-height: 44px; }
  .slices { gap: 5px 12px; }
  .slices .slice { grid-template-columns: 50px minmax(0,1fr) auto; column-gap: 7px; min-height: 47px; padding: 3px 0; }
  .slices .still { grid-column: auto; height: 37px; }
  .slice-label { gap: 2px; }
  .slice-label strong { font-size: 14px; }
  .slice-label small { font-size: 9px; }
  .work, .closing { --scene-edge: 10px; --scene-top: calc(var(--nav) + 9px); --scene-bottom: 63px; }
  .work { padding: calc(var(--scene-top) + 17px) 26px 75px; }
  .work-efin {
    --scene: linear-gradient(#dce6e9f5, #dce6e9ae 60%, #dce6e967),
      #b7c4c7 url("assets/exhibition/print-paper.webp") center 44% / cover;
  }
  .work-elk {
    --scene: linear-gradient(#192f25df, #192f25ab 49%, #192f2580),
      #223b35 url("assets/elk-handoff-art-20261117.webp") 33% center / cover;
  }
  .work-pet {
    --scene: linear-gradient(#ebd6b9f2, #ebd6b9d9 28%, #ebd6b91a 70%),
      #d8a975 url("assets/pet-nest-cottage.webp") center / auto 100%;
  }
  .pet-touch { bottom: 9%; }
  .pet-status { bottom: calc(9% + clamp(100px,31vw,142px) + 6px); }
  .work-ring {
    --scene: linear-gradient(#1e152bef, #22183198 47%, #33264347),
      #24182e url("assets/ring/title.webp") 66% center / cover;
  }
  .ring-art { inset: 24% var(--scene-edge) var(--scene-bottom) 18%; }
  .ring-figure { object-position: 98% bottom; }
}
