/* =========================================================
   秦 · 终章 — “你，不止一个人”
   A single-page closing interaction for a history course.
   ========================================================= */

:root {
  --ink: #0c0b09;
  --ink-soft: #12100c;
  --ink-lift: #19160f;
  --paper: #eee2ca;
  --paper-soft: #cfc0a4;
  --paper-dim: #988b74;
  --bronze: #c89a5c;
  --bronze-deep: #8e6332;
  --cinnabar: #a84431;
  --line: rgba(219, 190, 143, 0.16);
  --line-strong: rgba(219, 190, 143, 0.32);

  --font-display: "STZhongsong", "Songti SC", "STSong", "SimSun", serif;
  --font-serif: "Songti SC", "STSong", "SimSun", serif;
  --font-kai: "STKaiti", "KaiTi", "Kaiti SC", "STSong", serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-layout: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  min-width: 320px;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  background:
    radial-gradient(120% 82% at 50% -8%, #211c13 0%, #13110c 37%, var(--ink) 72%),
    var(--ink);
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body:not(.is-revealed) {
  overflow: hidden;
}

button,
summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  color: #16120b;
  background: var(--bronze);
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 50%;
  padding: 10px 18px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 13px;
  transform: translate(-50%, -180%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------
   Atmosphere
   --------------------------------------------------------- */

.ambient {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
}

.ambient-glow--one {
  top: -32vw;
  left: 50%;
  width: 92vw;
  height: 68vw;
  background: radial-gradient(ellipse at center, rgba(176, 128, 65, 0.17), transparent 64%);
  transform: translateX(-50%);
}

.ambient-glow--two {
  right: -28vw;
  bottom: -42vw;
  width: 80vw;
  height: 80vw;
  background: radial-gradient(ellipse at center, rgba(118, 82, 40, 0.12), transparent 66%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.6;
  background-image:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(214, 183, 132, 0.045) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(0deg, transparent calc(100% - 0.5px), rgba(214, 183, 132, 0.025) 100%);
  background-size: 25% 100%, 100% 25%;
  mask-image: radial-gradient(ellipse at 50% 42%, #000 20%, transparent 76%);
}

.ambient-qin {
  position: absolute;
  right: -0.06em;
  bottom: -0.3em;
  color: transparent;
  font-family: var(--font-display);
  font-size: clamp(360px, 54vw, 860px);
  line-height: 1;
  opacity: 0.32;
  -webkit-text-stroke: 1px rgba(214, 178, 118, 0.075);
  user-select: none;
}

.ambient-dust {
  position: absolute;
  inset: 0;
}

.dust-mote {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(228, 199, 146, 0.42);
  opacity: 0;
  animation: drift var(--duration) linear infinite;
  animation-delay: var(--delay);
}

@keyframes drift {
  0% { opacity: 0; transform: translate3d(0, 14px, 0); }
  18% { opacity: var(--opacity); }
  78% { opacity: var(--opacity); }
  100% { opacity: 0; transform: translate3d(var(--drift-x), -80px, 0); }
}

.grain {
  position: fixed;
  z-index: 120;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("assets/grain.png");
  background-repeat: repeat;
  background-size: 128px 128px;
  opacity: 0.028;
  pointer-events: none;
}

/* ---------------------------------------------------------
   Masthead
   --------------------------------------------------------- */

.masthead {
  position: absolute;
  z-index: 40;
  top: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  padding: clamp(20px, 2.4vw, 32px) clamp(22px, 4.2vw, 68px);
  pointer-events: none;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 13px;
}

.wordmark-seal {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #f2dfc2;
  border: 1px solid rgba(189, 86, 62, 0.7);
  background:
    linear-gradient(135deg, rgba(174, 66, 44, 0.9), rgba(121, 38, 27, 0.86));
  font-family: var(--font-kai);
  font-size: 21px;
  line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(26, 12, 8, 0.35);
  transform: rotate(-2deg);
}

.wordmark-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--paper-soft);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.32em;
}

.wordmark-text small {
  color: var(--paper-dim);
  font-family: var(--font-sans);
  font-size: 7px;
  letter-spacing: 0.26em;
  opacity: 0.8;
}

.masthead-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 0;
  color: rgba(207, 192, 164, 0.55);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.22em;
  white-space: nowrap;
}

.meta-rule {
  width: 38px;
  height: 1px;
  background: var(--line-strong);
}

/* ---------------------------------------------------------
   Prologue — the inner monologue
   --------------------------------------------------------- */

.prologue {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 96px 28px 70px;
  background:
    radial-gradient(54% 50% at 50% 51%, rgba(102, 72, 37, 0.16), transparent 76%),
    linear-gradient(180deg, rgba(12, 11, 9, 0.2), rgba(12, 11, 9, 0.76));
  transition: opacity 1s var(--ease-soft), visibility 1s, transform 1.2s var(--ease-soft);
}

body.is-revealed .prologue {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.025);
  pointer-events: none;
}

.prologue-columns {
  position: absolute;
  inset: 8% 7%;
  display: flex;
  justify-content: space-around;
  opacity: 0.5;
  mask-image: linear-gradient(180deg, transparent, #000 24%, #000 76%, transparent);
}

.prologue-columns span {
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(206, 169, 107, 0.14), transparent);
  transform: scaleY(0);
  animation: columnGrow 1.8s var(--ease-out) forwards;
}

.prologue-columns span:nth-child(2) { animation-delay: 0.12s; }
.prologue-columns span:nth-child(3) { animation-delay: 0.24s; }
.prologue-columns span:nth-child(4) { animation-delay: 0.36s; }
.prologue-columns span:nth-child(5) { animation-delay: 0.48s; }

@keyframes columnGrow {
  to { transform: scaleY(1); }
}

.prologue-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 900px);
  text-align: center;
}

.prologue-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 clamp(30px, 5vh, 58px);
  color: var(--paper-dim);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.34em;
  opacity: 0;
  animation: softIn 1s 0.4s var(--ease-out) forwards;
}

.tag-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bronze);
  box-shadow: 0 0 10px rgba(200, 154, 92, 0.8);
}

.os {
  position: relative;
  margin: 0;
  font-family: var(--font-kai);
  font-size: clamp(34px, 4.4vw, 62px);
  font-weight: 400;
  line-height: 1.68;
  letter-spacing: 0.075em;
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.55);
}

.os-line {
  display: block;
  opacity: 0;
  transform: translateY(18px);
  animation: osLineIn 1.4s var(--ease-out) forwards;
}

.os-line:nth-child(2) {
  animation-delay: 0.75s;
}

.os-caret {
  position: absolute;
  right: -1.2em;
  bottom: 0.32em;
  width: 1px;
  height: 1.15em;
  background: var(--bronze);
  box-shadow: 0 0 8px rgba(200, 154, 92, 0.7);
  animation: blink 1.1s step-end infinite;
}

@keyframes osLineIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 52% { opacity: 1; }
  53%, 100% { opacity: 0; }
}

@keyframes softIn {
  to { opacity: 1; }
}

.prologue-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: clamp(38px, 7vh, 72px);
  opacity: 0;
  animation: softIn 1s 1.65s var(--ease-out) forwards;
}

.enter-button {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  padding: 13px 24px 13px 27px;
  color: var(--paper-soft);
  border: 1px solid rgba(208, 175, 123, 0.28);
  background: rgba(20, 17, 12, 0.3);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.24em;
  cursor: pointer;
  transition: color 0.35s, border-color 0.35s, background 0.35s, transform 0.35s;
}

.enter-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s var(--ease-out);
}

.enter-button:hover,
.enter-button:focus-visible {
  color: #1a140c;
  border-color: var(--bronze);
  background: var(--bronze);
  outline: none;
}

.enter-button:hover svg,
.enter-button:focus-visible svg {
  transform: translateY(3px);
}

.prologue-note {
  margin: 0;
  color: rgba(152, 139, 116, 0.56);
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.24em;
}

.prologue-side {
  position: absolute;
  top: 50%;
  right: clamp(24px, 4.4vw, 72px);
  margin: 0;
  color: rgba(207, 192, 164, 0.28);
  font-family: var(--font-kai);
  font-size: 12px;
  letter-spacing: 0.5em;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}

/* ---------------------------------------------------------
   Reveal / main content
   --------------------------------------------------------- */

.reveal {
  position: relative;
  z-index: 2;
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: clamp(88px, 9vh, 108px) clamp(18px, 3vw, 48px) 0;
  opacity: 0;
  visibility: hidden;
}

body.is-revealed .reveal {
  opacity: 1;
  visibility: visible;
}

.thesis {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  padding-bottom: clamp(16px, 2.4vh, 28px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--bronze);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.28em;
}

.eyebrow-line {
  width: 28px;
  height: 1px;
  background: rgba(200, 154, 92, 0.5);
}

.thesis-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(48px, 5.8vw, 86px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: 0.035em;
}

.title-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}

.title-line > span {
  display: block;
  transform: translateY(112%);
  transition: transform 1.15s var(--ease-out);
}

body.is-revealed .title-line > span {
  transform: translateY(0);
}

body.is-revealed .title-line:nth-child(2) > span {
  transition-delay: 0.1s;
}

.lede {
  max-width: 900px;
  margin: 15px 0 0;
  color: var(--paper-soft);
  font-family: var(--font-serif);
  font-size: clamp(13px, 1vw, 14px);
  line-height: 1.85;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s 0.45s, transform 0.9s 0.45s var(--ease-out);
}

body.is-revealed .lede {
  opacity: 1;
  transform: none;
}

.thesis-mark {
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  column-gap: 15px;
  padding-bottom: 9px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1s 0.55s, transform 1s 0.55s var(--ease-out);
}

body.is-revealed .thesis-mark {
  opacity: 1;
  transform: none;
}

.mark-number {
  grid-column: 2;
  color: transparent;
  font-family: var(--font-display);
  font-size: clamp(94px, 10vw, 150px);
  font-weight: 700;
  line-height: 0.82;
  -webkit-text-stroke: 1px rgba(200, 154, 92, 0.38);
  position: relative;
}

.mark-number::after {
  content: "";
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  background: var(--cinnabar);
  opacity: 0.9;
}

.mark-caption {
  grid-column: 1;
  color: rgba(152, 139, 116, 0.65);
  font-family: var(--font-kai);
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: 0.2em;
  text-align: right;
  writing-mode: vertical-rl;
  justify-self: end;
  margin-bottom: 7px;
}

/* ---------------------------------------------------------
   Gallery
   --------------------------------------------------------- */

.gallery-section {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.gallery-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 12px;
}

.section-label {
  margin: 0;
  color: var(--paper-soft);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.24em;
}

.gallery-sub {
  margin: 7px 0 0;
  color: rgba(152, 139, 116, 0.66);
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.gallery-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 2px;
  color: rgba(207, 192, 164, 0.58);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.hint-touch {
  display: none;
}

.cursor-pulse {
  position: relative;
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 2px;
  border-radius: 50%;
  background: var(--bronze);
}

.cursor-pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid rgba(200, 154, 92, 0.6);
  border-radius: 50%;
  opacity: 0;
  animation: cursorPulse 2.2s ease-out infinite;
}

@keyframes cursorPulse {
  0% { opacity: 0.65; transform: scale(0.55); }
  70%, 100% { opacity: 0; transform: scale(2.1); }
}

.rail-wrap {
  position: relative;
}

@media (min-width: 981px) {
  .rail-wrap {
    margin-right: calc(-1 * clamp(18px, 3vw, 48px));
    margin-left: calc(-1 * clamp(18px, 3vw, 48px));
    padding-right: 8px;
    padding-left: 8px;
  }
}

.rail {
  display: flex;
  justify-content: center;
  gap: 8px;
  height: clamp(440px, 58vh, 640px);
}

.ruler {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
  color: var(--paper);
  border: 1px solid rgba(219, 190, 143, 0.14);
  background:
    radial-gradient(72% 54% at 50% 45%, rgba(var(--accent-rgb), 0.09), transparent 68%),
    linear-gradient(180deg, #15120d, #0e0c09);
  text-align: left;
  cursor: pointer;
  isolation: isolate;
  contain: layout paint;
  --figure-shift: 120px;
  appearance: none;
  -webkit-appearance: none;
  transition:
    flex-grow 0.55s var(--ease-layout),
    transform 0.55s var(--ease-layout),
    opacity 0.35s ease,
    border-color 0.4s ease;
}

.ruler:focus {
  outline: none;
}

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

.ruler::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    radial-gradient(85% 65% at 50% 80%, rgba(var(--accent-rgb), 0.24), transparent 64%),
    linear-gradient(180deg, rgba(12, 11, 9, 0.08) 8%, rgba(12, 11, 9, 0.03) 43%, rgba(10, 9, 7, 0.9) 100%);
  opacity: 0.86;
  transition: opacity 0.7s ease;
}

.ruler::after {
  content: "";
  position: absolute;
  z-index: 7;
  inset: 0;
  border: 1px solid transparent;
  background: radial-gradient(88% 82% at 50% 34%, rgba(5, 4, 3, 0.18) 0%, rgba(5, 4, 3, 0.82) 100%);
  opacity: 0;
  pointer-events: none;
  transition: border-color 0.5s ease, opacity 0.4s ease;
}

.ruler.is-active {
  flex-grow: 2.9;
  border-color: rgba(var(--accent-rgb), 0.5);
  transform: translateY(-7px);
  z-index: 5;
}

.ruler.is-active::before {
  opacity: 1;
}

.ruler.is-active::after {
  border-color: rgba(var(--accent-rgb), 0.25);
}

.rail.has-active .ruler:not(.is-active) {
  opacity: 0.56;
}

.rail.has-active .ruler:not(.is-active):hover {
  opacity: 0.9;
}

.ruler-inner {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  transform: translateY(28px);
  animation: cardIn 1s var(--ease-out) forwards;
  animation-delay: calc(0.42s + var(--i) * 0.09s);
}

.ruler-inner::after {
  content: "";
  position: absolute;
  z-index: 9;
  inset: 9px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  pointer-events: none;
  transition: border-color 0.5s ease;
}

.ruler.is-active .ruler-inner::after {
  border-color: rgba(var(--accent-rgb), 0.22);
}

body:not(.is-revealed) .ruler-inner {
  animation: none;
}

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

.ruler-aura {
  position: absolute;
  z-index: 0;
  top: 39%;
  left: 50%;
  width: 145%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.22), transparent 63%);
  opacity: 0.6;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.8s ease, transform 1.1s var(--ease-out);
}

.ruler.is-active .ruler-aura {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.ghost-glyph {
  position: absolute;
  z-index: 0;
  top: -0.14em;
  left: 50%;
  color: rgba(231, 210, 174, 0.038);
  font-family: var(--font-display);
  font-size: clamp(200px, 20vw, 320px);
  font-weight: 700;
  line-height: 1;
  transform: translateX(-50%);
  user-select: none;
  transition: transform 0.8s var(--ease-out);
}

.ruler.is-active .ghost-glyph {
  color: rgba(var(--accent-rgb), 0.07);
  transform: translateX(-50%) translateY(6px);
}

.figure {
  position: absolute;
  z-index: 2;
  bottom: -1px;
  left: 50%;
  height: 98%;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  pointer-events: none;
  transition: transform 0.55s var(--ease-layout);
}

.figure img {
  display: block;
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
  user-select: none;
}

.ruler.is-active .figure {
  transform: translateX(calc(-50% - var(--figure-shift, 120px)));
}

.spine {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  padding: 26px 10px 21px;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.55s var(--ease-out);
}

.ruler.is-active .spine {
  opacity: 0;
  transform: translateY(12px);
}

.ordinal {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: rgba(var(--accent-rgb), 0.95);
  border: 1px solid rgba(var(--accent-rgb), 0.33);
  font-family: var(--font-kai);
  font-size: 10px;
  line-height: 1;
}

.name {
  color: #f0e2c9;
  font-family: var(--font-kai);
  font-size: clamp(26px, 2.5vw, 36px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.17em;
  writing-mode: vertical-rl;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

.epithet {
  color: rgba(207, 192, 164, 0.72);
  font-family: var(--font-serif);
  font-size: 11.5px;
  letter-spacing: 0.22em;
}

.panel {
  position: absolute;
  z-index: 6;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: 292px;
  max-width: none;
  padding: clamp(22px, 2.5vw, 34px) clamp(18px, 2vw, 29px) clamp(22px, 2.4vw, 32px) 10px;
  contain: layout paint;
  opacity: 0;
  transform: translateX(26px);
  pointer-events: none;
  transition: opacity 0.4s 0.22s ease, transform 0.55s 0.22s var(--ease-layout);
  background: linear-gradient(90deg, rgba(12, 11, 9, 0) 0%, rgba(12, 11, 9, 0.72) 19%, rgba(12, 11, 9, 0.93) 44%, rgba(12, 11, 9, 0.97) 100%);
}

.ruler.is-active .panel {
  opacity: 1;
  transform: none;
}

.panel-head {
  margin-bottom: auto;
  padding-top: 2px;
}

.panel-name {
  display: block;
  color: #f4e8d1;
  font-family: var(--font-kai);
  font-size: clamp(23px, 2vw, 29px);
  line-height: 1.2;
  letter-spacing: 0.08em;
}

.panel-era {
  display: block;
  margin-top: 8px;
  color: rgba(var(--accent-rgb), 0.9);
  font-family: var(--font-sans);
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: 0.14em;
}

.panel-rule {
  display: block;
  width: 26px;
  height: 1px;
  margin-top: 15px;
  background: rgba(var(--accent-rgb), 0.42);
}

.quote {
  position: relative;
  display: block;
  padding-top: 18px;
}

.quote::before {
  content: "“";
  position: absolute;
  top: -0.38em;
  left: -0.18em;
  color: rgba(var(--accent-rgb), 0.18);
  font-family: Georgia, serif;
  font-size: 76px;
  line-height: 1;
  pointer-events: none;
}

.quote-lead {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 11px;
  color: rgba(var(--accent-rgb), 0.92);
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.25em;
}

.quote-lines {
  position: relative;
  z-index: 1;
  display: block;
  color: #f4e7ce;
  font-family: var(--font-kai);
  font-size: clamp(20px, 1.7vw, 27px);
  line-height: 1.55;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s 0.32s ease, transform 0.6s 0.32s var(--ease-out);
}

.ruler.is-active .quote-lines {
  opacity: 1;
  transform: none;
}

.quote-body {
  position: relative;
  z-index: 1;
  display: block;
  min-height: 6.2em;
  margin-top: 14px;
  color: rgba(207, 192, 164, 0.78);
  font-family: var(--font-serif);
  font-size: clamp(11px, 0.9vw, 12.5px);
  line-height: 1.95;
  letter-spacing: 0.04em;
}

.quote-body .typed-caret {
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--bronze);
  animation: blink 0.9s step-end infinite;
}

.quote-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: rgba(152, 139, 116, 0.55);
  font-family: var(--font-sans);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.quote-meta i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.8);
}

.rail-edge {
  position: absolute;
  z-index: 10;
  top: 0;
  bottom: 0;
  width: 36px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.rail-edge--left {
  left: 0;
  background: linear-gradient(90deg, var(--ink), transparent);
}

.rail-edge--right {
  right: 0;
  background: linear-gradient(-90deg, var(--ink), transparent);
}

.gallery-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  padding: 17px 0 0;
}

.gallery-caption {
  margin: 0;
  color: rgba(152, 139, 116, 0.56);
  font-family: var(--font-kai);
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: 0.1em;
}

.progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}

.progress-label {
  color: rgba(152, 139, 116, 0.68);
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.18em;
  transition: color 0.4s ease;
}

.ticks {
  display: flex;
  gap: 5px;
}

.ticks span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(207, 192, 164, 0.14);
  transition: background 0.35s ease;
}

.ticks span.is-read {
  background: var(--bronze);
}

body.all-visited .progress-label {
  color: var(--bronze);
}

/* ---------------------------------------------------------
   Coda
   --------------------------------------------------------- */

.coda {
  position: relative;
  width: min(100%, 1160px);
  margin: clamp(94px, 14vh, 156px) auto 0;
  padding: 0 10px clamp(74px, 10vh, 110px);
  text-align: center;
  opacity: 0.58;
  transform: translateY(16px);
  transition: opacity 1s ease, transform 1s var(--ease-out);
}

.coda.in-view {
  opacity: 1;
  transform: none;
}

.coda-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 26px;
}

.coda-rule span {
  width: min(18vw, 160px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 154, 92, 0.35));
}

.coda-rule span:last-child {
  background: linear-gradient(-90deg, transparent, rgba(200, 154, 92, 0.35));
}

.coda-rule i {
  display: block;
  width: 5px;
  height: 5px;
  border: 1px solid rgba(200, 154, 92, 0.55);
  transform: rotate(45deg);
}

.coda-kicker {
  margin: 0 0 24px;
  color: var(--bronze);
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.32em;
}

.coda-title {
  margin: 0;
  color: #f2e6ce;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.66;
  letter-spacing: 0.04em;
}

.coda-qin {
  display: inline-block;
  position: relative;
  margin: 0 0.08em;
  color: var(--bronze);
  font-family: var(--font-kai);
  font-size: 1.16em;
  line-height: 0.9;
}

.coda-qin::after {
  content: "";
  position: absolute;
  right: 0.03em;
  bottom: -0.13em;
  left: 0.03em;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 154, 92, 0.65), transparent);
}

.coda-body {
  max-width: 680px;
  margin: 28px auto 0;
  color: rgba(207, 192, 164, 0.72);
  font-family: var(--font-serif);
  font-size: clamp(12px, 1vw, 14px);
  line-height: 2.1;
  letter-spacing: 0.055em;
}

.coda-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: 42px;
}

.seal {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  color: #f3ddc1;
  border: 2px solid rgba(238, 200, 160, 0.58);
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 196, 154, 0.18), transparent 35%),
    linear-gradient(135deg, #a84632, #7f2d21);
  font-family: var(--font-kai);
  font-size: 38px;
  line-height: 1;
  box-shadow:
    inset 0 0 0 3px rgba(72, 22, 15, 0.5),
    inset 0 0 22px rgba(45, 12, 8, 0.45),
    0 10px 30px rgba(0, 0, 0, 0.3);
  transform: rotate(-3deg);
  opacity: 0.86;
  transition: transform 0.6s var(--ease-out), opacity 0.6s ease;
}

body.all-visited .seal {
  opacity: 1;
}

body.all-visited .coda.in-view .seal {
  animation: sealStamp 0.75s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
}

@keyframes sealStamp {
  0% { opacity: 0; transform: scale(1.5) rotate(-9deg); }
  62% { opacity: 1; transform: scale(0.94) rotate(-2deg); }
  100% { opacity: 1; transform: scale(1) rotate(-3deg); }
}

.coda-end {
  color: rgba(152, 139, 116, 0.55);
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.32em;
}

.history-note {
  width: fit-content;
  max-width: 630px;
  margin: 46px auto 0;
  color: rgba(152, 139, 116, 0.55);
  border-top: 1px solid rgba(219, 190, 143, 0.1);
  font-family: var(--font-sans);
  text-align: left;
}

.history-note summary {
  padding: 13px 2px 8px;
  font-size: 9px;
  letter-spacing: 0.18em;
  cursor: pointer;
  list-style: none;
  transition: color 0.3s ease;
}

.history-note summary::-webkit-details-marker {
  display: none;
}

.history-note summary::before {
  content: "+";
  display: inline-block;
  width: 15px;
  color: var(--bronze);
}

.history-note[open] summary::before {
  content: "−";
}

.history-note summary:hover {
  color: var(--paper-soft);
}

.history-note p {
  margin: 0;
  padding: 2px 2px 4px 17px;
  font-size: 10px;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

.noscript-note {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 40px;
  color: var(--paper);
  background: var(--ink);
  text-align: center;
  font-family: var(--font-sans);
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 1180px) {
  .thesis {
    gap: 24px;
  }

  .thesis-title {
    font-size: clamp(48px, 6.4vw, 78px);
  }

  .rail {
    gap: 8px;
  }

  .ruler {
    --figure-shift: 100px;
  }

  .panel {
    width: 250px;
    padding-right: 20px;
  }

  .quote-body {
    min-height: 7.8em;
  }
}

@media (max-width: 980px) {
  .rail-wrap {
    margin-right: calc(clamp(18px, 3vw, 48px) * -1);
    margin-left: calc(clamp(18px, 3vw, 48px) * -1);
  }

  .rail {
    justify-content: flex-start;
    height: clamp(460px, 64vh, 600px);
    padding: 0 clamp(18px, 3vw, 48px) 9px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .rail::-webkit-scrollbar {
    display: none;
  }

  .ruler {
    flex: 0 0 min(62vw, 348px);
    max-width: none;
    scroll-snap-align: center;
  }

  .ruler.is-active {
    flex-basis: min(76vw, 438px);
    max-width: none;
    transform: translateY(-4px);
  }

  .ruler.is-active .figure {
    height: 98%;
    transform: translateX(-50%);
  }

  .figure {
    height: 93%;
  }

  .panel {
    top: auto;
    width: 100%;
    height: auto;
    min-height: 54%;
    padding: 78px 21px 21px;
    transform: translateY(18px);
    background: linear-gradient(180deg, transparent 0%, rgba(11, 10, 8, 0.64) 17%, rgba(11, 10, 8, 0.95) 42%, rgba(11, 10, 8, 0.99) 100%);
  }

  .ruler.is-active .panel {
    transform: none;
  }

  .panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    margin-bottom: 0;
  }

  .panel-era {
    margin-top: 0;
  }

  .panel-rule {
    display: none;
  }

  .quote {
    padding-top: 13px;
  }

  .quote::before {
    font-size: 62px;
  }

  .quote-body {
    min-height: 0;
  }

  .quote-meta {
    display: none;
  }

  .spine {
    padding-bottom: 20px;
  }

  .rail-edge--left,
  .rail-edge--right {
    opacity: 1;
  }

  .gallery-hint {
    white-space: normal;
    text-align: right;
  }

  .hint-desktop {
    display: none;
  }

  .hint-touch {
    display: inline;
  }
}

@media (max-width: 720px) {
  .masthead {
    padding-top: 20px;
  }

  .masthead-meta {
    font-size: 8px;
    letter-spacing: 0.12em;
  }

  .masthead-meta span:nth-child(3),
  .meta-rule {
    display: none;
  }

  .prologue {
    padding: 84px 22px 52px;
  }

  .prologue-side {
    display: none;
  }

  .os {
    font-size: clamp(30px, 8.6vw, 44px);
    line-height: 1.8;
  }

  .os-caret {
    right: -0.7em;
  }

  .prologue-columns {
    inset: 9% 3%;
  }

  .dust-mote {
    display: none;
  }

  .reveal {
    padding-top: 78px;
  }

  .thesis {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .thesis-mark {
    display: none;
  }

  .thesis-title {
    font-size: clamp(44px, 13vw, 60px);
    letter-spacing: 0.01em;
  }

  .lede {
    margin-top: 14px;
    font-size: 12.5px;
    line-height: 1.9;
  }

  .gallery-section {
    padding-top: 16px;
  }

  .gallery-head {
    display: block;
    margin-bottom: 14px;
  }

  .gallery-hint {
    margin-top: 10px;
    text-align: left;
    font-size: 9px;
  }

  .rail {
    height: clamp(470px, 66vh, 590px);
  }

  .ruler {
    flex-basis: 80vw;
  }

  .ruler.is-active {
    flex-basis: 88vw;
  }

  .name {
    font-size: 30px;
  }

  .view-cue {
    top: calc(14px + env(safe-area-inset-top));
    right: 12px;
    padding: 5px 8px 5px 6px;
    font-size: 9.5px;
    opacity: 0.85;
  }

  .view-cue-desktop {
    display: none;
  }

  .view-cue-touch {
    display: inline;
  }

  .panel {
    min-height: 57%;
    padding: 72px 18px 19px;
  }

  .panel-name {
    font-size: 23px;
  }

  .quote-lines {
    font-size: 22px;
  }

  .quote-body {
    margin-top: 11px;
    font-size: 12px;
    line-height: 1.9;
  }

  .gallery-foot {
    align-items: flex-start;
    padding-top: 14px;
  }

  .gallery-caption {
    display: none;
  }

  .progress {
    align-items: flex-start;
    margin-left: 0;
  }

  .ticks span {
    width: 19px;
  }

  .coda {
    margin-top: 82px;
    padding-right: 0;
    padding-left: 0;
  }

  .coda-title {
    font-size: clamp(27px, 8.4vw, 38px);
    line-height: 1.7;
  }

  .coda-body {
    margin-top: 22px;
    font-size: 12px;
    line-height: 2;
  }

  .history-note {
    margin-top: 36px;
  }

  .history-note p {
    font-size: 9.5px;
  }
}

@media (max-height: 650px) and (min-width: 981px) {
  .reveal {
    padding-top: 90px;
  }

  .thesis-title {
    font-size: clamp(48px, 5.6vw, 72px);
  }

  .lede {
    margin-top: 14px;
    line-height: 1.8;
  }

  .rail {
    height: 440px;
  }

  .quote-body {
    min-height: 4em;
  }
}

/* ---------------------------------------------------------
   Hover dossier
   --------------------------------------------------------- */

.ruler {
  transition:
    transform 0.42s var(--ease-out),
    opacity 0.35s ease,
    border-color 0.4s ease;
}

.rail:has(.ruler:hover) .ruler:not(:hover),
.rail:has(.ruler.is-current) .ruler:not(.is-current) {
  opacity: 0.68;
}

.rail:has(.ruler:hover) .ruler:not(:hover)::after,
.rail:has(.ruler.is-current) .ruler:not(.is-current)::after {
  opacity: 0.62;
}

.ruler.is-current::after,
.ruler:hover::after {
  opacity: 0;
}

.view-cue {
  position: absolute;
  z-index: 6;
  top: 20px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 7px;
  color: rgba(238, 226, 202, 0.78);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 999px;
  background: rgba(10, 9, 7, 0.5);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.12em;
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.3s ease, color 0.3s ease, border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.view-cue-plus {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  color: rgba(var(--accent-rgb), 0.95);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 50%;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  line-height: 1;
}

.view-cue-touch {
  display: none;
}

.ruler:hover .view-cue,
.ruler:focus-visible .view-cue,
.ruler.is-current .view-cue {
  color: #f3e6ce;
  border-color: rgba(var(--accent-rgb), 0.62);
  background: rgba(var(--accent-rgb), 0.13);
  opacity: 1;
  transform: translateY(-2px);
}

.ruler.is-current {
  z-index: 5;
  border-color: rgba(var(--accent-rgb), 0.55);
  transform: scaleX(1.05);
}

.ruler.is-current .ruler-aura {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.08);
}

.ruler.is-current .ghost-glyph {
  color: rgba(var(--accent-rgb), 0.07);
  transform: translateX(-50%) translateY(6px);
}

@media (hover: hover) {
  .ruler:hover {
    z-index: 5;
    border-color: rgba(var(--accent-rgb), 0.55);
    transform: translateY(-10px) scale(1.1);
  }

  .ruler:hover .figure {
    transform: translateX(-50%) scale(1.035);
  }

  .ruler:hover .ruler-aura {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }

  .ruler:hover .ghost-glyph {
    color: rgba(var(--accent-rgb), 0.07);
    transform: translateX(-50%) translateY(6px);
  }
}

.ruler:focus-visible {
  z-index: 5;
  border-color: rgba(var(--accent-rgb), 0.55);
  transform: translateY(-8px) scale(1.06);
}

.hover-detail {
  --accent: #c89a5c;
  --accent-rgb: 200, 154, 92;
  position: fixed;
  z-index: 35;
  bottom: clamp(16px, 2.6vh, 28px);
  left: 50%;
  width: min(1260px, calc(100vw - 48px));
  padding: 24px 34px 22px;
  color: var(--paper);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background:
    radial-gradient(65% 100% at 22% 50%, rgba(var(--accent-rgb), 0.12), transparent 70%),
    rgba(11, 9, 7, 0.96);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.48);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.4s var(--ease-out), visibility 0.4s;
}

.hover-detail.is-visible {
  pointer-events: auto;
}

.hover-detail::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.8), transparent);
}

.hover-detail.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.hover-detail-inner {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 160px;
  gap: 30px;
  align-items: center;
}

.hover-detail-kicker {
  display: block;
  margin-bottom: 7px;
  color: rgba(var(--accent-rgb), 0.9);
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.18em;
}

.hover-detail-name {
  margin: 0;
  color: #f4e7cf;
  font-family: var(--font-kai);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.07em;
}

.hover-detail-era {
  margin: 6px 0 0;
  color: rgba(207, 192, 164, 0.66);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.08em;
}

.hover-detail-copy {
  min-width: 0;
  padding-left: 25px;
  border-left: 1px solid rgba(var(--accent-rgb), 0.2);
}

.hover-detail-lead {
  margin: 0 0 6px;
  color: rgba(var(--accent-rgb), 0.9);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.2em;
}

.hover-detail-merit {
  margin: 0;
  color: #f3e5cc;
  font-family: var(--font-kai);
  font-size: 27px;
  line-height: 1.4;
  letter-spacing: 0.03em;
}

.hover-detail-body {
  min-height: 2.7em;
  margin: 7px 0 0;
  color: rgba(207, 192, 164, 0.76);
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.85;
  letter-spacing: 0.03em;
}

.hover-detail-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: 10px;
  padding: 6px 10px;
  color: rgba(244, 231, 207, 0.86);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.07);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.11em;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.hover-detail-cta span {
  color: var(--accent);
  font-size: 15px;
  line-height: 0.7;
}

.hover-detail-cta:hover,
.hover-detail-cta:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent);
  outline: none;
}

.hover-detail-cta:hover span,
.hover-detail-cta:focus-visible span {
  color: var(--ink);
}

.hover-detail-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  align-self: stretch;
  gap: 12px;
  padding: 4px 0;
}

.hover-detail-more {
  margin: 9px 0 0;
  color: rgba(214, 173, 108, 0.92);
  font-family: var(--font-sans);
  font-size: 10.5px;
  line-height: 1.7;
  letter-spacing: 0.07em;
}

.hover-detail-more span {
  margin-right: 4px;
  padding-bottom: 1px;
  color: #f2e2c8;
  border-bottom: 1px solid rgba(214, 173, 108, 0.55);
}

.hover-detail-meta {
  color: rgba(152, 139, 116, 0.68);
  font-family: var(--font-sans);
  font-size: 10.5px;
  line-height: 1.7;
  letter-spacing: 0.1em;
  text-align: right;
}

.hover-detail-seal {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #f2ddc0;
  border: 1px solid rgba(166, 61, 45, 0.7);
  background: rgba(139, 48, 35, 0.75);
  font-family: var(--font-kai);
  font-size: 22px;
  line-height: 1;
  transform: rotate(-3deg);
}

@media (max-width: 760px) {
  .hover-detail {
    bottom: 0;
    width: 100%;
    padding: 12px 16px 13px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    overflow: hidden;
    transform: translate(-50%, 20px);
  }

  .hover-detail-inner {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
  }

  .hover-detail-kicker {
    display: none;
  }

  .hover-detail-name {
    font-size: 28px;
  }

  .hover-detail-era {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.55;
  }

  .hover-detail-copy {
    padding: 8px 0 0;
    border-top: 1px solid rgba(var(--accent-rgb), 0.2);
    border-left: 0;
  }

  .hover-detail-lead {
    margin-bottom: 4px;
    font-size: 9px;
  }

  .hover-detail-merit {
    font-size: 22px;
    line-height: 1.35;
  }

  .hover-detail-body {
    display: none;
  }

  .hover-detail-end {
    display: none;
  }

  .hover-detail-cta {
    margin-top: 8px;
    padding: 5px 8px;
    font-size: 10.5px;
  }
}
/* Full-screen five-portrait ending */
body.is-revealed {
  overflow: hidden;
}

body.is-revealed .masthead {
  display: none;
}

.reveal {
  width: 100%;
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding: 0;
}

.reveal .gallery-section {
  display: flex;
  height: 100%;
  padding: 0;
  border: 0;
}

.reveal .rail-wrap {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.reveal .rail {
  height: 100dvh;
  padding: 0;
  gap: 2px;
  justify-content: stretch;
}

.reveal .ruler {
  height: 100%;
}

.reveal .figure {
  height: 100%;
  bottom: 0;
}

.reveal .ruler:hover {
  transform: scaleX(1.05);
}

.reveal .ruler:focus-visible {
  transform: scaleX(1.04);
}

.reveal .ruler:hover .figure {
  transform: translateX(-50%);
}

.reveal .spine {
  padding-bottom: 28px;
}

@media (max-height: 700px) {
  .hover-detail {
    bottom: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .hover-detail-body {
    min-height: 0;
  }
}

/* Click spotlight: 80vw x 80dvh with side copy */
body.spotlight-open {
  overflow: hidden;
}

.spotlight {
  --accent: #c89a5c;
  --accent-rgb: 200, 154, 92;
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.spotlight.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.spotlight-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(55% 48% at 50% 45%, rgba(90, 61, 32, 0.16), transparent 70%),
    rgba(5, 4, 3, 0.84);
}

.spotlight-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 55% 45%;
  width: 80vw;
  height: 80dvh;
  max-width: 1500px;
  max-height: 920px;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.48);
  background: linear-gradient(135deg, #1a1610, #0b0907 72%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: opacity 0.32s ease, transform 0.48s var(--ease-out);
}

.spotlight.is-open .spotlight-panel {
  opacity: 1;
  transform: none;
}

.spotlight-panel::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: radial-gradient(60% 72% at 25% 66%, rgba(var(--accent-rgb), 0.16), transparent 68%);
  pointer-events: none;
}

.spotlight-panel::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  pointer-events: none;
}

.spotlight-close {
  position: absolute;
  z-index: 7;
  top: 22px;
  right: 22px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  color: var(--paper-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  border-radius: 50%;
  background: rgba(11, 9, 7, 0.72);
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.spotlight-close span {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
}

.spotlight-close span::before,
.spotlight-close span::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 16px;
  height: 1px;
  background: currentColor;
}

.spotlight-close span::before { transform: rotate(45deg); }
.spotlight-close span::after { transform: rotate(-45deg); }

.spotlight-close:hover,
.spotlight-close:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent);
  outline: none;
}

.spotlight-audio-controls {
  position: absolute;
  z-index: 7;
  top: 22px;
  right: 78px;
  display: flex;
  gap: 6px;
}

.spotlight-audio-btn,
.spotlight-audio-replay {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 14px;
  color: rgba(244, 231, 207, 0.9);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 999px;
  background: rgba(11, 9, 7, 0.72);
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.spotlight-audio-btn:hover,
.spotlight-audio-btn:focus-visible,
.spotlight-audio-replay:hover,
.spotlight-audio-replay:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent);
  outline: none;
}

.spotlight-audio-btn.is-playing {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent);
}

.spotlight-audio-btn:disabled,
.spotlight-audio-replay:disabled {
  color: rgba(207, 192, 164, 0.45);
  border-color: rgba(207, 192, 164, 0.2);
  background: rgba(11, 9, 7, 0.72);
  cursor: not-allowed;
}

.spotlight-audio-icon {
  display: grid;
  width: 15px;
  place-items: center;
  font-size: 10px;
  line-height: 1;
}

.spotlight-audio-replay span:first-child {
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
}

.spotlight-audio-replay:hover span:first-child,
.spotlight-audio-replay:focus-visible span:first-child {
  color: var(--ink);
}

.spotlight-audio-progress {
  position: absolute;
  z-index: 6;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(var(--accent-rgb), 0.12);
  pointer-events: none;
}

.spotlight-audio-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.08s linear;
}

.sound-toggle {
  position: fixed;
  z-index: 45;
  bottom: 22px;
  left: 22px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px 0 9px;
  color: rgba(238, 226, 202, 0.9);
  border: 1px solid rgba(200, 154, 92, 0.42);
  border-radius: 999px;
  background: rgba(10, 9, 7, 0.72);
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.35s ease, visibility 0.35s, transform 0.35s ease, color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

body.is-revealed .sound-toggle {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

body.spotlight-open .sound-toggle,
body.summary-open .sound-toggle {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent);
  outline: none;
}

.sound-toggle-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 12px;
  line-height: 1;
}

.sound-toggle.is-playing .sound-toggle-icon {
  color: var(--ink);
  background: var(--accent);
}

.sound-toggle.is-off {
  color: rgba(207, 192, 164, 0.42);
}

.sound-toggle.is-off .sound-toggle-icon {
  color: rgba(207, 192, 164, 0.42);
  border-color: rgba(207, 192, 164, 0.2);
}

.spotlight-figure {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.spotlight-figure::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 22%;
  background: linear-gradient(180deg, transparent, rgba(11, 9, 7, 0.7));
  pointer-events: none;
}

.spotlight-figure img {
  display: block;
  width: auto;
  max-width: 118%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  user-select: none;
}

.spotlight-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(26px, 2.6vw, 38px) clamp(30px, 4vw, 62px);
  background: linear-gradient(90deg, rgba(12, 10, 8, 0) 0%, rgba(12, 10, 8, 0.72) 12%, rgba(12, 10, 8, 0.95) 48%, #0b0907 100%);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.35) transparent;
}

.spotlight-kicker {
  margin: 0 0 15px;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0.22em;
}

.spotlight-name {
  margin: 0;
  color: #f4e7cf;
  font-family: var(--font-kai);
  font-size: clamp(40px, 3.8vw, 56px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.08em;
}

.spotlight-role {
  margin: 8px 0 0;
  color: rgba(var(--accent-rgb), 0.92);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.spotlight-era {
  margin: 4px 0 0;
  color: rgba(207, 192, 164, 0.68);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.65;
  letter-spacing: 0.08em;
}

.spotlight-rule {
  display: block;
  width: 44px;
  height: 1px;
  margin: 16px 0 14px;
  background: rgba(var(--accent-rgb), 0.45);
}

.spotlight-scroll-hint {
  display: none;
}

.spotlight-story {
  display: grid;
  gap: 11px;
}

.spotlight-story p {
  margin: 0;
  color: rgba(225, 211, 186, 0.86);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 2;
  letter-spacing: 0.035em;
}

.spotlight-story p:first-child {
  color: #f2e4ca;
  font-size: 16.5px;
}

.spotlight-intro {
  margin: 0 0 14px;
  color: rgba(207, 192, 164, 0.82);
  font-family: var(--font-serif);
  font-size: 12.5px;
  line-height: 1.85;
  letter-spacing: 0.035em;
}

.spotlight-lead {
  margin: 0 0 8px;
  color: rgba(var(--accent-rgb), 0.92);
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.25em;
}

.spotlight-merit {
  margin: 0;
  color: #f4e7ce;
  font-family: var(--font-kai);
  font-size: clamp(23px, 2.2vw, 31px);
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.spotlight-body {
  min-height: 0;
  margin: 10px 0 0;
  color: rgba(207, 192, 164, 0.78);
  font-family: var(--font-serif);
  font-size: 12.5px;
  line-height: 1.85;
  letter-spacing: 0.04em;
}

.spotlight-facts-title {
  margin: 14px 0 0;
  padding-top: 12px;
  color: rgba(var(--accent-rgb), 0.92);
  border-top: 1px solid rgba(var(--accent-rgb), 0.18);
  font-family: var(--font-sans);
  font-size: 8px;
  letter-spacing: 0.2em;
}

.spotlight-facts {
  display: grid;
  gap: 7px;
  margin-top: 7px;
}

.spotlight-facts p {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  color: rgba(207, 192, 164, 0.76);
  font-family: var(--font-serif);
  font-size: 10.5px;
  line-height: 1.75;
  letter-spacing: 0.02em;
}

.spotlight-facts span {
  padding-top: 2px;
  color: rgba(var(--accent-rgb), 0.9);
  font-family: var(--font-sans);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.spotlight-takeaway {
  margin-top: 12px;
  padding: 9px 12px;
  border-left: 2px solid rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.055);
}

.spotlight-takeaway span {
  display: block;
  margin-bottom: 4px;
  color: rgba(var(--accent-rgb), 0.9);
  font-family: var(--font-sans);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.spotlight-takeaway p {
  margin: 0;
  color: rgba(244, 231, 207, 0.9);
  font-family: var(--font-serif);
  font-size: 11.5px;
  line-height: 1.75;
  letter-spacing: 0.02em;
}

.spotlight-quote {
  margin: 14px 0 0;
  padding: 9px 0 0 14px;
  border-left: 2px solid rgba(var(--accent-rgb), 0.45);
}

.spotlight-quote p {
  margin: 0;
  color: rgba(244, 231, 207, 0.9);
  font-family: var(--font-kai);
  font-size: 13.5px;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.spotlight-quote cite {
  display: block;
  margin-top: 5px;
  color: rgba(152, 139, 116, 0.65);
  font-family: var(--font-sans);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.1em;
}

.spotlight-meta {
  margin: 12px 0 0;
  color: rgba(152, 139, 116, 0.72);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.14em;
}

@media (max-width: 760px) {
  .spotlight-panel {
    grid-template-columns: 1fr;
    grid-template-rows: 58px minmax(160px, 32dvh) 1fr;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    padding-top: env(safe-area-inset-top);
    border: 0;
  }

  .spotlight-figure {
    grid-row: 2;
    background: #0b0907;
  }

  .spotlight-figure img {
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
    object-position: center 10%;
  }

  .spotlight-copy {
    grid-row: 3;
    justify-content: flex-start;
    padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(11, 9, 7, 0) 0%, #0b0907 8%);
    overscroll-behavior: contain;
  }

  .spotlight-close {
    top: calc(9px + env(safe-area-inset-top));
    right: 12px;
    width: 40px;
    height: 40px;
  }

  .spotlight-audio-controls {
    top: calc(9px + env(safe-area-inset-top));
    right: 60px;
    left: 12px;
    justify-content: flex-start;
    gap: 4px;
  }

  .spotlight-audio-btn,
  .spotlight-audio-replay {
    height: 40px;
    padding: 0 10px;
    font-size: 9.5px;
    letter-spacing: 0.06em;
  }

  .spotlight-audio-replay span:first-child {
    font-size: 13px;
  }

  .sound-toggle {
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 14px;
    min-height: 34px;
  }

  .reveal .spine {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }

  .spotlight-name {
    font-size: 36px;
  }

  .spotlight-scroll-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 13px;
    color: rgba(207, 192, 164, 0.55);
    font-family: var(--font-sans);
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .spotlight-scroll-hint span {
    color: var(--accent);
    font-size: 13px;
  }

  .spotlight-story {
    gap: 11px;
  }

  .spotlight-story p,
  .spotlight-story p:first-child {
    font-size: 15.5px;
    line-height: 1.95;
  }

  .spotlight-rule {
    margin: 16px 0 14px;
  }

  .reveal .rail {
    scroll-snap-type: x mandatory;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .reveal .ruler {
    flex-basis: 84vw;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  body.is-revealed .prologue {
    transition-duration: 0.45s;
  }
}

@media (max-width: 760px) and (max-height: 650px) {
  .spotlight-panel {
    grid-template-rows: 52px minmax(120px, 24dvh) 1fr;
  }

  .spotlight-close {
    top: 6px;
    width: 38px;
    height: 38px;
  }

  .spotlight-audio-controls {
    top: 6px;
  }

  .spotlight-audio-btn,
  .spotlight-audio-replay {
    height: 38px;
    padding: 0 9px;
    font-size: 9px;
  }

  .spotlight-copy {
    padding: 14px 18px calc(20px + env(safe-area-inset-bottom));
  }

  .spotlight-name {
    font-size: 32px;
  }

  .spotlight-scroll-hint {
    margin-bottom: 10px;
    font-size: 8.5px;
  }

  .spotlight-story {
    gap: 9px;
  }

  .spotlight-story p,
  .spotlight-story p:first-child {
    font-size: 15px;
    line-height: 1.85;
  }
}

/* Finale: the five rulers are one "I" */
body.summary-open {
  overflow: hidden;
}

.finale {
  --accent: #d6ad6c;
  --accent-rgb: 214, 173, 108;
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.finale.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.finale-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(50% 45% at 50% 46%, rgba(109, 76, 38, 0.2), transparent 72%),
    rgba(6, 5, 4, 0.9);
}

.finale-panel {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 64px));
  max-height: 90dvh;
  overflow-y: auto;
  padding: 52px 58px 42px;
  border: 1px solid rgba(var(--accent-rgb), 0.46);
  background:
    radial-gradient(70% 58% at 50% 8%, rgba(var(--accent-rgb), 0.13), transparent 72%),
    linear-gradient(145deg, #1b1610, #0b0907 72%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.56);
  text-align: center;
  opacity: 0;
  transform: translateY(22px) scale(0.98);
  transition: opacity 0.35s ease, transform 0.5s var(--ease-out);
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.35) transparent;
}

.finale.is-open .finale-panel {
  opacity: 1;
  transform: none;
}

.finale-panel::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  pointer-events: none;
}

.finale-close {
  position: absolute;
  z-index: 4;
  top: 18px;
  right: 18px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  color: var(--paper-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  border-radius: 50%;
  background: rgba(11, 9, 7, 0.72);
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.finale-close span {
  position: relative;
  display: block;
  width: 15px;
  height: 15px;
}

.finale-close span::before,
.finale-close span::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 15px;
  height: 1px;
  background: currentColor;
}

.finale-close span::before { transform: rotate(45deg); }
.finale-close span::after { transform: rotate(-45deg); }

.finale-close:hover,
.finale-close:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent);
  outline: none;
}

.finale-kicker {
  margin: 0 0 16px;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.28em;
}

.finale-title {
  margin: 0;
  color: #f4e7cf;
  font-family: var(--font-kai);
  font-size: clamp(48px, 6.4vw, 78px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.08em;
}

.finale-lead {
  margin: 22px 0 0;
  color: rgba(229, 214, 188, 0.9);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 2;
  letter-spacing: 0.04em;
}

.finale-lead strong {
  color: var(--accent);
  font-weight: 500;
}

.finale-copy strong {
  color: #f1dfc2;
  font-weight: 500;
}

.finale-names {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 30px 0 26px;
  padding: 15px 0;
  border-top: 1px solid rgba(var(--accent-rgb), 0.22);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.22);
  list-style: none;
}

.finale-names li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-left: 1px solid rgba(var(--accent-rgb), 0.14);
}

.finale-names li:first-child {
  border-left: 0;
}

.finale-names strong {
  color: #f3e5cc;
  font-family: var(--font-kai);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.finale-names span {
  color: rgba(var(--accent-rgb), 0.9);
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.finale-names small {
  color: rgba(152, 139, 116, 0.7);
  font-family: var(--font-sans);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.finale-copy {
  max-width: 690px;
  margin: 0 auto;
  color: rgba(207, 192, 164, 0.82);
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 2;
  letter-spacing: 0.035em;
}

.finale-question {
  margin: 26px 0 8px;
  color: rgba(var(--accent-rgb), 0.94);
  font-family: var(--font-kai);
  font-size: 22px;
  letter-spacing: 0.05em;
}

.finale-answer {
  margin: 0;
  color: #f4e6cd;
  font-family: var(--font-kai);
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.7;
  letter-spacing: 0.06em;
}

.finale-back {
  margin-top: 26px;
  padding: 9px 18px;
  color: rgba(244, 231, 207, 0.86);
  border: 1px solid rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.08);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.finale-back:hover,
.finale-back:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent);
  outline: none;
}

.finale-open {
  position: fixed;
  z-index: 46;
  top: calc(22px + env(safe-area-inset-top));
  left: 22px;
  padding: 8px 13px;
  color: rgba(244, 231, 207, 0.82);
  border: 1px solid rgba(214, 173, 108, 0.36);
  background: rgba(10, 9, 7, 0.66);
  font-family: var(--font-sans);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.3s ease, visibility 0.3s, transform 0.3s ease, color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

body.all-visited .finale-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}

body.spotlight-open .finale-open,
body.summary-open .finale-open {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.finale-open:hover,
.finale-open:focus-visible {
  color: var(--ink);
  border-color: #d6ad6c;
  background: #d6ad6c;
  outline: none;
}

@media (max-width: 760px) {
  .finale {
    padding: 0;
  }

  .finale-panel {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    padding: calc(54px + env(safe-area-inset-top)) 20px calc(22px + env(safe-area-inset-bottom));
    border: 0;
    text-align: left;
  }

  .finale-panel::before {
    inset: 8px;
  }

  .finale-close {
    top: calc(10px + env(safe-area-inset-top));
    right: 12px;
    width: 40px;
    height: 40px;
  }

  .finale-kicker {
    margin-bottom: 11px;
    font-size: 9px;
  }

  .finale-title {
    font-size: clamp(36px, 10.8vw, 44px);
    line-height: 1.1;
    letter-spacing: 0.03em;
  }

  .finale-lead {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.9;
  }

  .finale-names {
    grid-template-columns: 1fr;
    margin: 18px 0;
    padding: 0;
    border-bottom: 0;
  }

  .finale-names li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: baseline;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid rgba(var(--accent-rgb), 0.14);
    border-left: 0;
  }

  .finale-names li:first-child {
    border-top: 0;
  }

  .finale-names strong {
    font-size: 18px;
  }

  .finale-names span {
    font-size: 9px;
  }

  .finale-names small {
    font-size: 8px;
  }

  .finale-copy {
    font-size: 14px;
    line-height: 1.85;
  }

  .finale-question {
    margin-top: 18px;
    font-size: 19px;
  }

  .finale-answer {
    font-size: 26px;
    line-height: 1.6;
  }

  .finale-back {
    margin-top: 18px;
  }

  .finale-open {
    top: calc(14px + env(safe-area-inset-top));
    left: 14px;
    font-size: 9px;
  }
}

/* Scrollable reveal: summary first, then the five portraits */
body.is-revealed {
  overflow-x: hidden;
  overflow-y: auto;
}

.reveal {
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
}

.reveal-summary {
  width: min(1040px, calc(100vw - 44px));
  margin: 0 auto;
  padding: clamp(72px, 10vh, 118px) clamp(18px, 4vw, 54px) clamp(38px, 5vh, 62px);
  border-bottom: 1px solid rgba(214, 173, 108, 0.16);
  text-align: center;
}

.reveal-summary-kicker {
  margin: 0 0 15px;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.28em;
}

.reveal-summary-title {
  margin: 0;
  color: #f4e7cf;
  font-family: var(--font-kai);
  font-size: clamp(52px, 7.2vw, 88px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.08em;
}

.reveal-summary-lead {
  margin: 22px 0 0;
  color: rgba(229, 214, 188, 0.88);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 2;
  letter-spacing: 0.04em;
}

.reveal-summary-lead strong {
  color: var(--accent);
  font-weight: 500;
}

.reveal-summary-body strong {
  color: #f1dfc2;
  font-weight: 500;
}

.reveal-summary-body {
  max-width: 760px;
  margin: 18px auto 0;
  color: rgba(207, 192, 164, 0.76);
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 2;
  letter-spacing: 0.035em;
}

.reveal-summary-question {
  margin: 28px 0 8px;
  color: rgba(214, 173, 108, 0.94);
  font-family: var(--font-kai);
  font-size: 22px;
  letter-spacing: 0.05em;
}

.reveal-summary-answer {
  margin: 0;
  color: #f4e6cd;
  font-family: var(--font-kai);
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.7;
  letter-spacing: 0.06em;
}

.reveal .gallery-section {
  display: block;
  height: auto;
  padding: 0 clamp(12px, 2vw, 28px) clamp(42px, 6vh, 76px);
  border: 0;
}

.reveal .rail-wrap {
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
}

.reveal .rail {
  height: clamp(520px, 68vh, 760px);
  padding: 0;
  gap: 2px;
  justify-content: stretch;
}

.reveal .ruler {
  height: 100%;
}

.reveal .figure {
  height: 100%;
  bottom: 0;
}

.finale-open {
  display: none !important;
}

@media (max-width: 760px) {
  .reveal-summary {
    width: 100%;
    padding: calc(64px + env(safe-area-inset-top)) 22px 30px;
  }

  .reveal-summary-kicker {
    margin-bottom: 10px;
    font-size: 9px;
  }

  .reveal-summary-title {
    font-size: clamp(38px, 11vw, 46px);
    letter-spacing: 0.03em;
  }

  .reveal-summary-lead {
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.9;
  }

  .reveal-summary-body {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.85;
  }

  .reveal-summary-question {
    margin-top: 22px;
    font-size: 19px;
  }

  .reveal-summary-answer {
    font-size: 26px;
    line-height: 1.6;
  }

  .reveal .gallery-section {
    padding: 0 12px calc(42px + env(safe-area-inset-bottom));
  }

  .reveal .rail {
    height: clamp(430px, 68dvh, 620px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }

  .prologue-columns span {
    transform: scaleY(1);
  }

  .os-line,
  .prologue-tag,
  .prologue-foot {
    opacity: 1;
    transform: none;
  }

  .ruler-inner {
    opacity: 1;
    transform: none;
  }

  .title-line > span {
    transform: none;
  }

  .coda {
    opacity: 1;
    transform: none;
  }

  .dust-mote {
    display: none;
  }
}

@media (max-width: 720px) {
  .view-cue-desktop {
    display: none;
  }

  .view-cue-touch {
    display: inline;
  }
}
