/* The ten-slide tours: an examiner's exhibits, drawn in gold on ink. */
.tour { --stage: #16203a; --stage-deep: #0e1528; --line: #c9a24d; --line-soft: rgba(201,162,77,.32); --chalk: #f3efe4; --chalk-dim: #b9bccb; --mark-red: #d0565c; --mark-green: #8fbf8a;
  margin: 0; color: var(--chalk); }
.tour-stage { position: relative; background:
    radial-gradient(120% 90% at 85% 10%, #1f2b4d 0%, rgba(31,43,77,0) 60%),
    linear-gradient(180deg, var(--stage) 0%, var(--stage-deep) 100%);
  border: 1px solid #2c375a; overflow: hidden; aspect-ratio: 16 / 9; min-height: 420px; }
.tour-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: radial-gradient(80% 80% at 70% 40%, #000 30%, transparent 85%); }
.tour-slide { position: absolute; inset: 0; display: grid; grid-template-columns: 42% 58%; grid-template-rows: 100%; align-items: center; gap: 0;
  opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility 0s linear .7s; }
.tour-slide.is-active { opacity: 1; visibility: visible; transition: opacity .7s ease, visibility 0s; z-index: 1; }
.tour-text { padding: 0 0 0 clamp(20px, 4.2vw, 56px); position: relative; z-index: 2; }
.tour-count { font-family: var(--serif-display); font-style: italic; font-size: 1.05rem; color: var(--line); margin: 0 0 .6em; opacity: 0; transform: translateY(6px); transition: opacity .6s ease .1s, transform .6s ease .1s; }
.tour-h { font-family: var(--serif-display); font-weight: 600; color: var(--chalk); font-size: clamp(1.45rem, 2.7vw, 2.35rem); line-height: 1.08; margin: 0 0 .55em; letter-spacing: .005em;
  opacity: 0; transform: translateY(10px); transition: opacity .7s ease .25s, transform .7s ease .25s; }
.tour-b { font-family: var(--serif-text); font-size: clamp(.92rem, 1.25vw, 1.08rem); line-height: 1.6; color: var(--chalk-dim); margin: 0; max-width: 38ch;
  opacity: 0; transition: opacity .9s ease .6s; }
.tour-slide.is-active .tour-count, .tour-slide.is-active .tour-h { opacity: 1; transform: none; }
.tour-slide.is-active .tour-b { opacity: 1; }
.tour-visual { height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 4% 4% 4% 2%; position: relative; z-index: 1; }
.tour-visual svg { width: 100%; height: 100%; max-height: 100%; overflow: visible; }

/* Cover slide */
.tour-cover { height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; position: relative; }
.tour-cover img { max-height: 84%; max-width: 70%; height: auto; width: auto; box-shadow: 0 30px 60px -25px rgba(0,0,0,.8); transform: translateY(18px) scale(.97); opacity: 0;
  transition: transform 1.4s cubic-bezier(.2,.7,.2,1) .2s, opacity 1.1s ease .2s; }
.tour-slide.is-active .tour-cover img { transform: none; opacity: 1; }
.tour-cover .frame { position: absolute; inset: -14px; pointer-events: none; }

/* SVG vocabulary */
.tour svg text { font-family: var(--serif-text); fill: var(--chalk); }
.tour svg .t-disp { font-family: var(--serif-display); font-weight: 600; }
.tour svg .t-dim { fill: var(--chalk-dim); }
.tour svg .t-gold { fill: var(--line); }
.tour svg .t-red { fill: var(--mark-red); }
.tour svg .ln { fill: none; stroke: var(--line); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tour svg .ln-soft { fill: none; stroke: var(--line-soft); stroke-width: 1.2; }
.tour svg .ln-chalk { fill: none; stroke: var(--chalk-dim); stroke-width: 1.4; stroke-linecap: round; }
.tour svg .ln-red { fill: none; stroke: var(--mark-red); stroke-width: 2.4; stroke-linecap: round; }
.tour svg .fill-gold { fill: var(--line); }
.tour svg .fill-soft { fill: rgba(201,162,77,.16); }
.tour svg .fill-red { fill: var(--mark-red); }
.tour svg .fill-ink { fill: var(--stage-deep); }

/* Drawing: every .dr path draws itself; every .fd element fades in; --d sets the moment */
.tour svg .dr { stroke-dasharray: 1; stroke-dashoffset: 1; }
.tour-slide.is-active svg .dr { stroke-dashoffset: 0; transition: stroke-dashoffset var(--len, 1.1s) cubic-bezier(.45,.05,.25,1) var(--d, 0s); }
.tour svg .fd { opacity: 0; }
.tour-slide.is-active svg .fd { opacity: 1; transition: opacity .7s ease var(--d, 0s); }
.tour svg .gr { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); }
.tour-slide.is-active svg .gr { transform: scaleY(1); transition: transform 1.1s cubic-bezier(.2,.7,.2,1) var(--d, 0s); }
.tour svg .gx { transform-box: fill-box; transform-origin: 0 50%; transform: scaleX(0); }
.tour-slide.is-active svg .gx { transform: scaleX(1); transition: transform 1.1s cubic-bezier(.2,.7,.2,1) var(--d, 0s); }
.tour svg .pulse { transform-box: fill-box; transform-origin: center; }
.tour-slide.is-active svg .pulse { animation: tour-pulse 3.2s ease-in-out var(--d, 0s) infinite; }
@keyframes tour-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.18); opacity: .75; } }
.tour-slide.is-active svg .spin { animation: tour-spin 60s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes tour-spin { to { transform: rotate(360deg); } }

/* Controls */
.tour-bar { display: flex; align-items: center; gap: 14px; padding: 12px 0 0; flex-wrap: wrap; }
.tour-progress { display: flex; gap: 6px; flex: 1 1 260px; }
.tour-seg { flex: 1; height: 26px; border: 0; background: none; padding: 11px 0; cursor: pointer; position: relative; }
.tour-seg::before { content: ""; display: block; height: 3px; background: #d9d3c4; }
.tour-seg .fill { position: absolute; left: 0; top: 11px; height: 3px; width: 0; background: var(--gold); }
.tour-seg.done .fill { width: 100%; }
.tour-seg:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tour-btn { font-family: var(--serif-display); font-size: 1.05rem; font-weight: 600; color: var(--ink); background: none; border: 1px solid var(--rule); padding: 6px 14px; cursor: pointer; border-radius: 2px; min-width: 44px; min-height: 40px; }
.tour-btn:hover { border-color: var(--gold-bright); color: var(--accent); }
.tour-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tour-num { font-family: var(--serif-display); font-size: 1.1rem; color: var(--muted); min-width: 4.2em; text-align: right; font-variant-numeric: tabular-nums; }
.tour-stage:fullscreen { aspect-ratio: auto; border: 0; }
.tour-stage:fullscreen .tour-b { font-size: 1.35rem; }
.tour-stage:fullscreen .tour-h { font-size: 3rem; }

@media (max-width: 760px) {
  .tour-stage { aspect-ratio: auto; height: 640px; min-height: 0; }
  .tour-slide { grid-template-columns: 1fr; grid-template-rows: 46% 54%; align-items: start; }
  .tour-visual { order: -1; padding: 18px 16px 0; }
  .tour-text { padding: 14px 20px 20px; }
  .tour-b { max-width: none; }
  .tour-cover img { max-height: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-slide, .tour-slide.is-active { transition: none; }
  .tour-count, .tour-h, .tour-b, .tour-cover img { transition: none !important; transform: none !important; }
  .tour svg .dr { stroke-dashoffset: 0; transition: none !important; }
  .tour svg .fd { opacity: 1; transition: none !important; }
  .tour svg .gr, .tour svg .gx { transform: none; transition: none !important; }
  .tour-slide.is-active svg .pulse, .tour-slide.is-active svg .spin { animation: none; }
}

/* Book page */
.book-hero { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; padding-top: 48px; padding-bottom: 24px; }
.book-hero .cover img { box-shadow: 0 18px 40px -22px rgba(27, 36, 64, .7); }
.book-hero .short { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }
.crumb { font-family: var(--serif-display); font-size: 1.1rem; margin: 0 0 1.2em; }
.crumb a { text-decoration: none; color: var(--muted); }
.tour-section { padding-top: 32px; padding-bottom: 24px; }
.tour-section .section-head p { font-style: italic; }
.about-book { padding-top: 32px; padding-bottom: 56px; max-width: 760px; }
.about-book p { margin: 0 0 1em; }
.about-book p.lead-line { font-family: var(--serif-display); font-size: 1.45rem; font-weight: 600; line-height: 1.25; color: var(--ink); margin-top: 1.4em; }
.tour-link { font-weight: 600; }
.next-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 18px; padding-bottom: 64px; }
.next-books a { text-decoration: none; font-family: var(--serif-display); font-size: 1rem; font-weight: 600; line-height: 1.2; }
.next-books img { margin-bottom: 8px; box-shadow: 0 10px 22px -14px rgba(27, 36, 64, .6); }
@media (max-width: 760px) { .book-hero { grid-template-columns: 1fr; gap: 24px; } .book-hero .cover { max-width: 220px; } }
