/* PLTI Report — a single black gallery. Every screen is one room. */
html:has(body.reading-report) { scroll-snap-type: y mandatory; background: #000; }
body.reading-report { background: #000; color: #ece8df; -webkit-font-smoothing: antialiased; }
body.reading-report .page { width: 100%; max-width: none; }
body.reading-report .page > header { display: none; }
#result, #matches { margin: 0; }
#result:focus { outline: none; }

#reading-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 1px; z-index: 40;
  background: #cfc9bd; transform-origin: left center; transform: scaleX(0); pointer-events: none;
}
body:not(.reading-report) #reading-progress { display: none; }

/* Rooms */
.report-panel {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  scroll-snap-align: start; scroll-snap-stop: always;
  background: radial-gradient(ellipse 70% 55% at 50% 42%, #141312 0%, #070707 62%, #000 100%);
  padding: 58px 0 82px;
}
/* The faded hairline with a center dot, shared with the portrait covers. */
.report-panel + .report-panel::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: radial-gradient(circle at center, #8f8a81 1.5px, transparent 2.1px),
    radial-gradient(ellipse 46% 1px at center, #6f6b64 0%, #3a3835 55%, transparent 100%);
}
.panel-inner { width: min(calc(100% - 48px), 560px); }

/* Room heading: centered italic numeral cleanly stacked above a quiet serif title */
.panel-head {
  position: relative; height: auto; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  margin-bottom: 26px; text-align: center;
}
.panel-head::after { content: none; display: none; }
.panel-num {
  display: block; font: italic 400 clamp(2.1rem, 9.5vw, 2.8rem)/1 var(--times);
  letter-spacing: .04em; color: #545049; user-select: none;
}
.panel-head h2 {
  position: relative; margin: 0; font: 700 clamp(1.5rem, 6.2vw, 1.95rem)/1.32 var(--song);
  letter-spacing: .08em; color: #f4f1ea; text-wrap: balance;
}
.panel-lede { margin: 0 0 22px; font-size: .94rem; line-height: 1.9; color: #bdb7ab; text-align: center; text-wrap: pretty; }
.meet-bio { margin: 0 0 18px; font-size: .92rem; line-height: 1.88; color: #cfc9bd; text-align: justify; }

.report-panel blockquote {
  margin: 22px 0 0; padding: 14px 18px; border-left: 1px solid #8d877c;
  background: rgba(255,255,255,.035); font-size: .9rem; line-height: 1.8; color: #d6d1c7;
}

/* Reveal: hidden until the room is mostly on screen, then pieces rise in turn */
@media (prefers-reduced-motion: no-preference) {
  .report-panel.await .rv { opacity: 0; transform: translateY(26px); filter: blur(6px); }
  .report-panel.shown .rv {
    opacity: 1; transform: none; filter: none;
    transition: opacity .75s cubic-bezier(.22,1,.36,1), transform .75s cubic-bezier(.22,1,.36,1), filter .7s ease;
    transition-delay: calc(80ms + var(--i, 0) * 85ms);
  }
}

/* Room 1 · the matched philosopher, joined to the cover without a seam */
.panel-hero { padding: 40px 0 72px; background: #000; }
.panel-hero .panel-inner { width: 100%; display: flex; flex-direction: column; align-items: center; }
.panel-hero .portrait-cover { min-height: 0; padding: 6px 0; background: transparent; }
.hero-label { margin: 0 0 6px; font: 400 .9rem/1.4 var(--song); letter-spacing: .32em; color: #8f897e; }
.hero-theme {
  width: min(calc(100% - 48px), 560px); margin: 22px auto 10px; text-align: center;
  font: 700 clamp(1.25rem, 5.6vw, 1.6rem)/1.55 var(--song); color: #f4f1ea; letter-spacing: .04em; text-wrap: balance;
}
.hero-line { width: min(calc(100% - 48px), 520px); margin: 0 auto; text-align: center; font-size: .94rem; line-height: 1.9; color: #a9a397; }
.panel-hero blockquote { width: min(calc(100% - 48px), 520px); }
.scroll-cue {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px 14px 2px; border: 0; background: transparent; cursor: pointer;
  color: rgba(207, 201, 189, .58);
  transition: color .2s ease;
}
.scroll-cue:hover, .scroll-cue:focus-visible { color: rgba(244, 241, 234, .92); outline: none; }
.scroll-cue-text { font: 400 .72rem/1 var(--song); letter-spacing: .24em; padding-left: .24em; }
.scroll-cue-line {
  width: 1px; height: 20px;
  background: linear-gradient(currentColor, transparent); transform-origin: top;
  animation: hint-breathe 2.4s ease-in-out infinite;
}
@keyframes hint-breathe { 0%,100% { opacity: .28; transform: scaleY(.6); } 50% { opacity: .95; transform: scaleY(1); } }

/* Room 2 · companions with classic archival portrait plates (no black box) */
.companion {
  display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 16px; align-items: center;
  padding: 18px 10px; border-top: 1px solid #23211f;
  transition: background-color .22s ease;
}
.companion:last-child { border-bottom: 1px solid #23211f; }
.companion-clickable { cursor: pointer; border-radius: 6px; }
.companion-clickable:hover, .companion-clickable:focus-visible { background: rgba(255,255,255,.045); outline: none; }
.companion-clickable:active { background: rgba(255,255,255,.075); }
.companion-portrait {
  width: 88px; height: 110px; overflow: hidden; display: grid; place-items: end center;
  background: #eae4d8; padding: 6px 4px 0;
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: inset 0 0 0 2px #eae4d8, inset 0 0 0 3px rgba(32,29,24,.14);
}
.companion-portrait.is-full { padding: 0; place-items: center; }
.companion-portrait img {
  width: 92%; height: 94%; object-fit: contain; object-position: center bottom;
  filter: grayscale(1) contrast(1.06);
}
.companion-portrait.is-full img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 20%;
}
.companion-zh { margin: 0; font: 900 1.38rem/1.25 "Cover Han", var(--song), sans-serif; color: #f6f3ec; }
.companion-en { margin: 3px 0 6px; font: 700 .86rem/1.1 "Cover Latin", Arial, sans-serif; letter-spacing: -.02em; color: #8a8478; text-transform: uppercase; }
.companion-theme { margin: 0; font-size: .9rem; line-height: 1.7; color: #cbc5ba; }
.companion-cta {
  display: inline-block; margin-top: 8px; font-size: .8rem; letter-spacing: .08em;
  color: #e4ded2; border-bottom: 1px solid rgba(228,222,210,.35); padding-bottom: 1px;
}
.companion-note { grid-column: 1 / -1; margin: 2px 0 0; font-size: .86rem; line-height: 1.8; color: #8f897e; }

/* Clickable philosopher detail modal */
html.modal-open { overflow: hidden; }
.thinker-modal {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.76); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .22s ease;
}
@media (min-width: 600px) { .thinker-modal { align-items: center; padding: 24px; } }
.thinker-modal.open { opacity: 1; }
.thinker-sheet {
  position: relative; width: min(100%, 540px); max-height: 86svh; overflow-y: auto;
  background: #0d0c0b; color: #ece8df;
  border-top: 1px solid #302d28; padding: 26px 24px max(28px, env(safe-area-inset-bottom));
  transform: translateY(18px); transition: transform .26s cubic-bezier(.22,1,.36,1);
}
@media (min-width: 600px) { .thinker-sheet { border: 1px solid #302d28; border-radius: 8px; } }
.thinker-modal.open .thinker-sheet { transform: none; }
.thinker-close {
  position: sticky; top: 0; float: right; z-index: 2;
  width: 36px; height: 36px; border: 1px solid #34312c; border-radius: 50%;
  background: rgba(13,12,11,.88); color: #ece8df; font: 400 1.35rem/1 Arial, sans-serif;
  cursor: pointer; display: grid; place-items: center;
}
.thinker-top { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 16px; align-items: center; margin-bottom: 18px; }
.thinker-group { margin: 0 0 4px; font-size: .76rem; letter-spacing: .16em; color: #8f897e; }
.thinker-theme { margin: 6px 0 0; font-size: .92rem; color: #f1ede5; }
.thinker-bio { margin: 0 0 18px; font-size: .94rem; line-height: 1.9; color: #d6d1c7; text-align: justify; }
.thinker-sub { margin: 20px 0 10px; font: 400 .84rem/1.4 var(--song); letter-spacing: .22em; color: #8f897e; }
.thinker-sheet blockquote {
  margin: 0 0 12px; padding: 12px 16px; border-left: 1px solid #8d877c;
  background: rgba(255,255,255,.04); font-size: .88rem; line-height: 1.8; color: #dcd7cd;
}
.thinker-story { margin-top: 18px; padding-top: 16px; border-top: 1px solid #23211f; }
.thinker-story p { margin: 0 0 10px; font-size: .92rem; line-height: 1.85; color: #d6d1c7; }

/* Room 3 · ideas */
.idea-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid #23211f; }
.idea-list li { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid #23211f; }
.idea-index { font: italic 1.4rem/1 var(--times); color: #67625a; }
.idea-list p { margin: 0; font-size: .92rem; line-height: 1.8; color: #e2ddd3; }

/* Room 4 · mirror */
.mirror-pair { display: grid; gap: 14px; }
@media (min-width: 560px) { .mirror-pair { grid-template-columns: 1fr 1fr; } }
.mirror-card { padding: 20px 18px; border: 1px solid #2a2825; }
.mirror-card h3 { margin: 0 0 10px; font: 700 1.02rem/1.3 var(--song); letter-spacing: .16em; color: #f4f1ea; }
.mirror-card p { margin: 0; font-size: .9rem; line-height: 1.82; color: #c3bdb1; }
.mirror-cite { margin-top: 10px !important; padding-top: 10px; border-top: 1px solid #262421; font-size: .84rem !important; color: #9c968b !important; }
.anecdote { margin-top: 26px; padding: 22px 0 0; border-top: 1px solid #2a2825; text-align: center; }
.anecdote h3 { margin: 0 0 10px; font: 400 .9rem/1.4 var(--song); letter-spacing: .3em; color: #8f897e; }
.anecdote p { margin: 0 0 14px; font-size: .96rem; line-height: 1.95; color: #e6e1d7; }
.anecdote-link { font-size: .82rem; color: #8f897e; text-decoration: none; border-bottom: 1px solid #45423d; }

/* Room 5 · constellation */
.constellation { margin: 0 auto 10px; max-width: 360px; }
.constellation-svg { display: block; width: 100%; height: auto; }
.constellation-label { font: 600 12px/1 var(--song); fill: #cfc9bd; letter-spacing: .06em; }

/* Rooms 6–11 · one domain each, tinted with the quiz palette */
.panel-domain { --accent: #cfc9bd; }
.report-panel[data-dim="1"] { --accent: #a6cbe5; }
.report-panel[data-dim="2"] { --accent: #99b3ff; }
.report-panel[data-dim="3"] { --accent: #c3afc6; }
.report-panel[data-dim="4"] { --accent: #d9767c; }
.report-panel[data-dim="5"] { --accent: #95abb9; }
.report-panel[data-dim="6"] { --accent: #7d9be0; }
.report-panel[data-dim] .panel-num { color: color-mix(in srgb, var(--accent) 26%, #000); }
.domain-question { margin: -12px 0 26px; text-align: center; font-size: .95rem; color: #9d978b; }
.domain-lead { margin: 0 0 10px; text-align: center; font: 700 1.3rem/1.45 var(--song); color: var(--accent); letter-spacing: .08em; }
.domain-desc { margin: 0 0 24px; text-align: center; font-size: .96rem; line-height: 1.95; color: #ddd8ce; text-wrap: pretty; }
.lane-bars { display: grid; gap: 14px; }
.lane-row { display: grid; grid-template-columns: 6.2em minmax(0,1fr); gap: 14px; align-items: center; }
.lane-label { font-size: .86rem; color: #a49e92; }
.lane-track { height: 2px; background: #24221f; overflow: hidden; }
.lane-fill { display: block; height: 100%; width: 0; background: var(--accent); }
.report-panel.shown .lane-fill { width: var(--w); transition: width 1.2s cubic-bezier(.22,1,.36,1) .5s; }
@media (prefers-reduced-motion: reduce) { .lane-fill { width: var(--w); } }
.domain-slider-stat { margin: 16px 0 0; text-align: center; font-size: .86rem; color: #a8a296; letter-spacing: .04em; }
.domain-deep { margin: 18px 0 0; padding-top: 14px; border-top: 1px dashed #2f2d2a; font-size: .88rem; line-height: 1.8; color: #a9a397; text-align: center; }

/* Tension */
.tension-card { padding: 22px 0; border-top: 1px solid #2a2825; }
.tension-card h3 { margin: 0 0 4px; text-align: center; font: 700 1.12rem/1.5 var(--song); color: #f4f1ea; letter-spacing: .06em; }
.tension-card > p { margin: 18px 0 0; font-size: .94rem; line-height: 1.9; color: #cbc5ba; }
.tension-question { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid #2a2825; text-align: center; font: 700 1rem/1.85 var(--song); color: #f4f1ea; }

/* Literature & present */
.world-card { padding: 24px 0; border-top: 1px solid #2a2825; text-align: center; }
.world-card:last-child { border-bottom: 1px solid #2a2825; }
.world-card h3 { margin: 0 0 12px; font: 700 1.18rem/1.5 var(--song); color: #f4f1ea; text-wrap: balance; }
.world-card p { margin: 0; font-size: .95rem; line-height: 1.95; color: #c6c0b4; }

/* Reading map */
.reading-list { list-style: none; margin: 0; padding: 0; }
.reading-list li { padding: 18px 0; border-top: 1px solid #23211f; text-align: center; }
.reading-step { display: block; font: 400 .82rem/1 var(--song); letter-spacing: .4em; color: #6f6a62; margin-bottom: 8px; }
.reading-list h3 { margin: 0; font: 700 1.08rem/1.55 var(--song); color: #f1ede5; }
.reading-list p { margin: 8px 0 0; font-size: .88rem; line-height: 1.8; color: #9d978b; }
.counterpoint { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: 18px; align-items: center; margin-top: 18px; padding: 22px 0 0; border-top: 1px solid #2a2825; }
.counterpoint-label { margin: 0 0 4px; font-size: .82rem; letter-spacing: .3em; color: #6f6a62; }

/* Final room */
.panel-end .panel-inner { text-align: center; }
.end-quote { margin: 0 0 28px; font: 700 clamp(1.2rem, 5.4vw, 1.5rem)/1.6 var(--song); color: #f4f1ea; letter-spacing: .06em; }
.upgrade-btn { margin: 0 auto 30px; min-width: 200px; padding: 13px 26px; font: 500 .98rem/1.2 var(--song); }
#report-finish {
  width: 100%; margin: 6px 0 0; padding: 18px 0 0; display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid #2a2825;
}
#report-finish .back { color: #bdb7ab; font: .92rem var(--song); letter-spacing: .1em; }
.end-note { margin: 34px 0 0; font-size: .78rem; line-height: 1.8; color: #5f5b54; }
