/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ox:   #333333;
  --ox2:  #262626;
  --ox3:  #111111;
  --g1:   #A7C5BD;
  --g2:   #C5DAD4;
  --g3:   #8BA89E;
  --p1:   #F5F5F5;
  --p2:   #E0E0E0;
  --p3:   #A3A3A3;
  --i1:   #FFFFFF;
  --i2:   #F5F5F5;
  --i3:   #BBBBBB;          /* readable on dark parchment (#2E2E2E ≈ 5.9:1) */
  --i3-soft: #666666;       /* decorative use only — bullets, ornaments, hairlines */

  /* Parchment surfaces — single source of truth.
     -l: gutter on the left  (highlight at 72%, shadow toward spine)
     -r: gutter on the right (highlight at 28%, shadow toward spine) */
  --paper-grad-l: radial-gradient(ellipse 85% 90% at 72% 50%, #3E3E3E 0%, #2E2E2E 52%, #1E1E1E 100%);
  --paper-grad-r: radial-gradient(ellipse 85% 90% at 28% 50%, #3E3E3E 0%, #2E2E2E 52%, #1E1E1E 100%);
  --paper-shadow-l: inset -50px 0 80px rgba(0,0,0,0.10);
  --paper-shadow-r: inset  50px 0 80px rgba(0,0,0,0.10);

  /* 6×9 book proportions */
  --bh: min(920px, 92vh);
  --pw: calc(var(--bh) * 0.6667);   /* single page width  */
  --bw: calc(var(--pw) * 2);        /* open spread width  */
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #111111;
  font-family: 'EB Garamond', Georgia, serif;
  color: var(--i1);
}

/* ── SCENE ── */
#scene {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 50% 30% at 50% 10%, rgba(167,197,189,0.1) 0%, transparent 70%),
    radial-gradient(ellipse 80% 50% at 50% 110%, rgba(0,0,0,0.7) 0%, transparent 60%),
    #1A1A1A;
}
#scene::after {
  content: '';
  position: fixed; inset: 0;
  background: radial-gradient(ellipse 70% 65% at 50% 50%, transparent 30%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
}

/* ── SHELF ── */
#shelf { display: none; }

#book-wrap {
  position: relative; z-index: 5;
  display: flex; align-items: center;
}

#book-stage {
  position: relative;
  width: var(--pw);
  height: var(--bh);
  overflow: hidden;
  border-radius: 3px;
  filter: drop-shadow(0 44px 60px rgba(0,0,0,0.8)) drop-shadow(0 10px 22px rgba(0,0,0,0.5));
  transform: translateY(150%) rotate(-4deg) scale(0.5);
  opacity: 0;
}

/* ── COVER ── */
#cover {
  position: absolute;
  top: 0; left: 0;
  width: var(--pw); height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  z-index: 30;
  cursor: pointer;
  transition: transform 1.1s cubic-bezier(0.25, 0, 0.1, 1);

  background:
    linear-gradient(155deg, rgba(255,255,255,0.08) 0%, transparent 45%, rgba(0,0,0,0.22) 100%),
    linear-gradient(180deg, var(--ox) 0%, #222222 55%, var(--ox3) 100%);
}
/* Leather grain */
#cover::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.65 0.45' numOctaves='5' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23f)' opacity='0.13'/%3E%3C/svg%3E");
  background-size: 400px 400px;
  pointer-events: none;
}
/* Gold inlay border */
#cover::after {
  content: ''; position: absolute; inset: 16px;
  border: 1.5px solid rgba(167,197,189,0.42);
  box-shadow: inset 0 0 0 7px rgba(0,0,0,0.1);
  pointer-events: none;
}

/* When open: cover rotates -180° around left edge */
#cover.open {
  transform: rotateY(-180deg);
  z-index: 2;
}

#cover-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  pointer-events: none;
  backface-visibility: hidden;
}
.c-corner { position: absolute; width: 34px; height: 34px; opacity: 0.48; }
.c-corner svg { width: 100%; height: 100%; }
.c-corner.tl { top: 20px; left: 20px; }
.c-corner.tr { top: 20px; right: 20px; transform: scaleX(-1); }
.c-corner.bl { bottom: 20px; left: 20px; transform: scaleY(-1); }
.c-corner.br { bottom: 20px; right: 20px; transform: scale(-1,-1); }

#cover-name {
  font-family: 'Cinzel', serif;
  font-size: clamp(18px, 3.5vw, 38px);
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.45;
  text-transform: uppercase;
  color: var(--g1);
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  margin-bottom: 22px;
}
#cover-rule {
  width: 55%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--g2), var(--g1), var(--g2), transparent);
  opacity: 0.65; margin-bottom: 18px;
}
#cover-tag {
  font-style: italic;
  font-size: clamp(9px, 1.2vw, 13px);
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--g3); opacity: 0.82; margin-bottom: 28px;
}
#cover-mono { width: clamp(40px, 5.5vw, 62px); height: clamp(40px, 5.5vw, 62px); opacity: 0.65; }

/* ── COVER ORBITAL SYMBOL ── */
.cover-symbol {
  position: absolute;
  left: 50%; top: 46%;
  z-index: 0;
  width: clamp(140px, 32cqi, 260px);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: 0.38;
  transform: translate3d(-50%, -50%, 0);
}
.cs-ring, .cs-axis, .cs-orbit, .cs-core {
  position: absolute;
  left: 50%; top: 50%;
  transform-style: preserve-3d;
}
.cs-ring {
  border: 1px solid rgba(167,197,189,0.16);
  border-radius: 50%;
  transform: translate3d(-50%, -50%, 0);
}
.cs-ring.ring-outer {
  width: 100%; height: 100%;
  border-style: solid dashed solid dashed;
  animation: c-symbol-spin 42s linear infinite;
}
.cs-ring.ring-inner {
  width: 62%; height: 62%;
  border-color: rgba(167,197,189,0.12);
  animation: c-symbol-spin-reverse 58s linear infinite;
}
.cs-axis {
  background: linear-gradient(90deg, transparent, rgba(167,197,189,0.28), transparent);
  opacity: 0.72;
  transform: translate3d(-50%, -50%, 0);
  animation: c-axis-breathe 5.6s ease-in-out infinite;
}
.cs-axis.axis-x { width: 86%; height: 1px; }
.cs-axis.axis-y {
  width: 1px; height: 86%;
  background: linear-gradient(0deg, transparent, rgba(167,197,189,0.22), transparent);
}
.cs-orbit {
  width: 74%; height: 74%;
  border-radius: 50%;
  transform: translate3d(-50%, -50%, 0) rotate(18deg);
  animation: c-symbol-orbit 24s linear infinite;
}
.cs-orbit.orbit-b {
  width: 48%; height: 48%;
  transform: translate3d(-50%, -50%, 0) rotate(-28deg);
  animation-duration: 31s;
  animation-direction: reverse;
}
.cs-orbit.orbit-c {
  width: 88%; height: 88%;
  transform: translate3d(-50%, -50%, 0) rotate(112deg);
  animation-duration: 38s;
}
.cs-orbit.orbit-d {
  width: 32%; height: 32%;
  transform: translate3d(-50%, -50%, 0) rotate(211deg);
  animation-duration: 18s;
  animation-direction: reverse;
}
.cs-dot {
  position: absolute;
  left: 50%; top: 0;
  border-radius: 50%;
  background: var(--g1);
  box-shadow: 0 0 10px rgba(167,197,189,0.42);
  transform: translate3d(-50%, -50%, 0);
  animation: c-dot-glow 4.8s ease-in-out infinite;
}
.cs-dot.dot-sm { width: 3px; height: 3px; opacity: 0.58; }
.cs-dot.dot-md { width: 5px; height: 5px; opacity: 0.72; animation-delay: 1.4s; }
.cs-dot.dot-lg { width: 8px; height: 8px; opacity: 0.86; box-shadow: 0 0 14px rgba(167,197,189,0.5); }
.cs-orbit.orbit-d .cs-dot.dot-lg { width: 6px; height: 6px; animation-delay: 2.2s; }
.cs-core {
  width: 10px; height: 10px;
  transform: translate3d(-50%, -50%, 0) rotate(45deg);
  border: 1px solid rgba(167,197,189,0.36);
  background: rgba(167,197,189,0.08);
  animation: c-core-pulse 3.8s ease-in-out infinite;
}

@keyframes c-symbol-spin {
  to { transform: translate3d(-50%, -50%, 0) rotate(360deg); }
}
@keyframes c-symbol-spin-reverse {
  to { transform: translate3d(-50%, -50%, 0) rotate(-360deg); }
}
@keyframes c-symbol-orbit {
  to { transform: translate3d(-50%, -50%, 0) rotate(378deg); }
}
@keyframes c-axis-breathe {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.74; }
}
@keyframes c-dot-glow {
  0%, 100% { filter: blur(0); box-shadow: 0 0 8px rgba(167,197,189,0.32); }
  50% { filter: blur(0.15px); box-shadow: 0 0 16px rgba(167,197,189,0.58); }
}
@keyframes c-core-pulse {
  0%, 100% { opacity: 0.42; transform: translate3d(-50%, -50%, 0) rotate(45deg) scale(0.88); }
  50% { opacity: 0.9; transform: translate3d(-50%, -50%, 0) rotate(45deg) scale(1.08); }
}

/* ── 3D EDGES ── */
#edge-spine {
  position: absolute;
  top: 0; left: -20px; width: 20px; height: 100%;
  background: linear-gradient(90deg, #1A1A1A 0%, #222222 50%, #2A2A2A 100%);
  clip-path: polygon(0 2%, 100% 0, 100% 100%, 0 98%);
  z-index: 4;
  box-shadow: inset 2px 0 6px rgba(255,255,255,0.05);
  transition: opacity 0.4s;
}
#edge-spine.hidden { opacity: 0; }

#edge-pages {
  position: absolute;
  top: 0; right: -42px; width: 42px; height: 100%;
  background: repeating-linear-gradient(90deg,
    #222222 0px, #2A2A2A 1.5px,
    #1E1E1E 3px, #2A2A2A 4.5px,
    #262626 6px, #2A2A2A 7.5px,
    #222222 9px
  );
  clip-path: polygon(0 0, 100% 2%, 100% 98%, 0 100%);
  z-index: 4;
  transition: opacity 0.4s;
}
#edge-pages.hidden { opacity: 0; }

/* ── PAGES WRAPPER ── */
#pages-wrapper {
  position: absolute;
  top: 0; left: 0;
  width: var(--bw);
  height: 100%;
  z-index: 10;
}

/* ── SPREAD ── */
.spread {
  position: absolute; inset: 0;
  display: flex; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.spread.active { opacity: 1; pointer-events: all; z-index: 2; }
.spread.flip-under { opacity: 1; pointer-events: none; z-index: 1; }

/* ── SPINE GUTTER ── */
.gutter {
  position: absolute; top: 0; bottom: 0;
  left: calc(50% - 50px); width: 100px;
  pointer-events: none; z-index: 8;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0,0,0,0.06) 22%,
    rgba(0,0,0,0.18) 42%,
    rgba(0,0,0,0.18) 58%,
    rgba(0,0,0,0.06) 78%,
    transparent 100%
  );
}
.gutter::before {
  content: ''; position: absolute; top: 0; bottom: 0;
  left: 50%; width: 1px; transform: translateX(-50%);
  background: rgba(0,0,0,0.22);
}

/* ── PAGE ── */
.page {
  flex: 1;
  position: relative; overflow: hidden;
  padding: 44px 38px 52px;
  /* Make each page its own sizing context, so fluid type/spacing scales
     with the PAGE (cqi/cqh) rather than the viewport. This keeps content
     fitting at any browser zoom (cmd +/-) or window size. */
  container-type: size;
  container-name: pg;
}
/* Paper noise */
.page::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  pointer-events: none; z-index: 0;
}
.page > * { position: relative; z-index: 1; }
.page.flip-hidden { visibility: hidden; }
/* Page number */
.page::after {
  content: attr(data-page);
  position: absolute; bottom: 18px;
  font-size: 10px; font-style: italic;
  letter-spacing: 0.2em; color: var(--i3); opacity: 0.78; pointer-events: none;
}
.page-left::after  { left: 38px; }
.page-right::after { right: 38px; }

.page-left {
  background: var(--paper-grad-l);
  box-shadow:
    var(--paper-shadow-l),
    inset 0 12px 28px rgba(0,0,0,0.04),
    inset 0 -12px 28px rgba(0,0,0,0.06);
}
.page-right {
  background: var(--paper-grad-r);
  box-shadow:
    var(--paper-shadow-r),
    inset 0 12px 28px rgba(0,0,0,0.04),
    inset 0 -12px 28px rgba(0,0,0,0.06);
}

/* ── PAGE FLIP CARD ── */
#flip-card {
  display: none;
  position: absolute;
  top: 0; left: 50%; width: 50%; height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  z-index: 20; pointer-events: none;
}
#flip-card.rev { left: 0; transform-origin: right center; }

#flip-f, #flip-r {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
#flip-r { transform: rotateY(180deg); }

/* Spine gutter shadow on the flip card — visible during page turns */
.flip-gutter {
  position: absolute;
  top: 0; bottom: 0;
  width: 120px;
  pointer-events: none;
  z-index: 25;
}
#flip-card:not(.rev) .flip-gutter {
  left: 0;
  background: linear-gradient(90deg,
    rgba(0,0,0,0.32) 0%,
    rgba(0,0,0,0.22) 15%,
    rgba(0,0,0,0.10) 32%,
    rgba(0,0,0,0.04) 50%,
    transparent 72%
  );
}
#flip-card.rev .flip-gutter {
  right: 0;
  background: linear-gradient(270deg,
    rgba(0,0,0,0.32) 0%,
    rgba(0,0,0,0.22) 15%,
    rgba(0,0,0,0.10) 32%,
    rgba(0,0,0,0.04) 50%,
    transparent 72%
  );
}
.flip-gutter::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: rgba(0,0,0,0.32);
}
#flip-card:not(.rev) .flip-gutter::before { left: 0; }
#flip-card.rev .flip-gutter::before { right: 0; }

/* JS toggles these classes on #flip-f / #flip-r per flip direction */
.flip-as-left  { background: var(--paper-grad-l); box-shadow: var(--paper-shadow-l); }
.flip-as-right { background: var(--paper-grad-r); box-shadow: var(--paper-shadow-r); }
.flip-scope {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.flip-page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  flex: none;
  pointer-events: none;
  container-type: size;
  container-name: pg;
}
.flip-page.scroll,
.flip-page .scroll { pointer-events: none; }

#flip-shadow {
  display: none;
  position: absolute; top: 0; left: 0; width: 50%; height: 100%;
  pointer-events: none; z-index: 19; opacity: 0;
  background: transparent;
}
#flip-shadow.rev { left: 50%; background: transparent; }

/* ═══════════════════ FLIP REALISM ═══════════════════ */
#book-stage {
  perspective: 1400px;
  perspective-origin: 50% 50%;
}

.flip-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
}

/* Flip overlays disabled — no shadows during page turns */
#flip-f .flip-shade,
#flip-r .flip-shade,
.flip-curl,
.flip-thickness,
#flip-shadow,
#flip-shadow.rev {
  background: transparent !important;
}

/* ══════════════ TYPOGRAPHY ══════════════ */
.slabel {
  font-style: italic; font-size: 12px; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--i3); margin-bottom: 12px; opacity: 0.9;
}
.prule {
  width: 100%; height: 1px; margin-bottom: 20px;
  background: linear-gradient(90deg, var(--p3), transparent); opacity: 0.5;
}
.ptitle {
  font-family: 'Cinzel', serif;
  font-size: clamp(14px, 3.9cqi, 22px); font-weight: 400;
  letter-spacing: 0.07em; color: var(--i1); line-height: 1.25; margin-bottom: 16px;
}
.btext { font-size: clamp(11px, 2.5cqi, 14px); line-height: 1.8; color: var(--i1); }
.btext p { margin-bottom: 10px; }
.btext p:last-child { margin-bottom: 0; }
.btext p:first-child::first-letter {
  float: left; font-family: 'Cinzel', serif;
  font-size: clamp(36px, 10.4cqi, 54px); line-height: 0.79;
  margin-right: 6px; margin-top: 6px; color: var(--g2);
}
.scroll {
  height: 100%; overflow-y: auto; padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: var(--p3) transparent;
}
.scroll::-webkit-scrollbar { width: 3px; }
.scroll::-webkit-scrollbar-thumb { background: var(--p3); border-radius: 2px; }

/* ══════════════ TOC ══════════════ */
#s0 .page-left {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 60px 48px !important;
}
.toc-orn {
  font-size: 18px; color: var(--g3); opacity: 0.55;
  letter-spacing: 0.3em; margin-bottom: 32px;
  text-align: center;
}
.toc-name {
  font-family: 'Cinzel', serif;
  font-size: clamp(20px, 6.4cqi, 38px); font-weight: 400;
  letter-spacing: 0.14em; color: var(--i1); line-height: 1.35;
  text-align: center; margin-bottom: 22px;
}
.toc-hrule {
  width: 58%; height: 1px; margin: 0 auto 18px;
  background: linear-gradient(90deg, transparent, var(--p3), transparent); opacity: 0.7;
}
.toc-sub {
  font-style: italic; font-size: clamp(10px, 2.5cqi, 14px);
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--i3); text-align: center; margin-bottom: 36px;
}
.toc-mono { width: clamp(36px, 10.4cqi, 56px); height: clamp(36px, 10.4cqi, 56px); opacity: 0.52; display: block; margin: 0 auto; }

#s0 .page-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 55px 48px 65px;
}
.toc-head {
  font-family: 'Cinzel', serif;
  font-size: clamp(14px, 3.7cqi, 19px); letter-spacing: 0.14em; color: var(--i1);
  padding-bottom: 12px; margin-bottom: 28px;
  border-bottom: 1px solid rgba(143,168,158,0.32);
}
.toc-list { list-style: none; padding: 0; }
.toc-list li { margin-bottom: 18px; }
.toc-list a {
  font-size: clamp(13px, 3.7cqi, 19px); color: var(--i1); text-decoration: none;
  letter-spacing: 0.03em; display: flex; align-items: baseline; gap: 13px;
  cursor: pointer; transition: color 0.2s;
}
.toc-list a:hover { color: var(--g1); }
.tn { font-style: italic; color: var(--i3); min-width: 26px; font-size: 0.87em; }
.tt { flex: 1; padding-bottom: 4px; border-bottom: 1px dotted rgba(143,168,158,0.32); }

/* ══════════════ ABOUT ══════════════ */
#s1 .page-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
#s1 .page-left .slabel { align-self: stretch; text-align: left; }
#s1 .page-left .prule { width: 100%; }
#s1 .page-left .ptitle {
  margin-top: auto;
  font-size: clamp(18px, 5.3cqi, 30px);
  text-align: center;
}
.aimg {
  width: 78%; max-width: 320px;
  margin: 22px auto auto;
  border-radius: 2px; overflow: hidden;
  box-shadow: 3px 4px 18px rgba(0,0,0,0.27), 0 0 0 1px rgba(143,168,158,0.16);
}
.aimg img {
  width: 100%; height: auto; aspect-ratio: 4 / 5;
  display: block;
  object-fit: cover; object-position: center top;
  filter: sepia(14%) contrast(1.06);
}
#s1 .page-right { display: flex; flex-direction: column; justify-content: flex-start; }
#s1 .page-right .scroll { flex: 1; margin-top: 45px; height: auto; }
#s1 #about-bio { font-size: clamp(13px, 2.85cqi, 16px); }

/* ══════════════ AWARDS ══════════════ */
.ayg { margin-bottom: 22px; }
.ayear { font-family: 'Cinzel', serif; font-size: clamp(14px, 3.45cqi, 18px); color: var(--g2); letter-spacing: 0.1em; border-bottom: 1px solid rgba(143,168,158,0.25); padding-bottom: 5px; margin-bottom: 10px; }
.alist { list-style: none; padding: 0; }
.alist li { font-size: clamp(12px, 3.1cqi, 16px); line-height: 1.6; color: var(--i1); padding-left: 16px; position: relative; margin-bottom: 5px; }
.alist li::before { content: '·'; position: absolute; left: 3px; color: var(--i3-soft); }
#s2 #awr { margin-top: 45px; }

/* ══════════════ PUBLICATIONS ══════════════ */
#s3 .page-left { display: flex; flex-direction: column; min-height: 0; }
#s3 .page-right { display: flex; flex-direction: column; }
#s3 .page-right .scroll { flex: 1; margin-top: 45px; height: auto; }
.pub-h { margin-bottom: 12px; }
#pub-books {
  display: flex; flex-direction: column;
  gap: clamp(8px, 1.6cqh, 14px);
  overflow: hidden;
}
.pub-stories-h {
  margin-top: clamp(14px, 2.6cqh, 22px);
  margin-bottom: 8px;
  font-size: clamp(13px, 3.4cqi, 18px);
}
.pub-stories-rule { margin-bottom: 12px; }
.pub-stories { min-height: 0; }
.pub-stories-cont { padding-top: 4px; }
.pbook {
  display: flex; gap: clamp(10px, 2.6cqi, 16px); align-items: center;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(143,168,158,0.18);
  border-radius: 2px;
  padding: clamp(7px, 1.3cqh, 12px) clamp(10px, 2.6cqi, 14px);
}
.pbcov {
  flex: 0 0 auto;
  width: clamp(52px, 13cqi, 84px);
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 3px 5px 16px rgba(0,0,0,0.3), 0 0 0 1px rgba(143,168,158,0.22);
  background: rgba(0,0,0,0.08);
}
.pbcov img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pbinfo { flex: 1; min-width: 0; position: relative; overflow: hidden; }
.pbyr { font-size: clamp(9.5px, 2.2cqi, 11px); letter-spacing: 0.14em; color: var(--i3); float: right; }
.pbtit { font-size: clamp(13px, 3.45cqi, 18px); font-weight: 600; color: var(--i1); margin-bottom: 5px; padding-right: 42px; line-height: 1.3; }
.pbst { font-style: italic; font-size: clamp(11px, 2.75cqi, 15px); color: var(--g2); margin-bottom: 6px; }
.pbdesc { font-size: clamp(10.5px, 2.4cqi, 13px); color: var(--i2); line-height: 1.5; }

.stg { display: flex; gap: 14px; margin-bottom: 14px; align-items: flex-start; }
.styear { font-family: 'Cinzel', serif; font-size: clamp(12px, 2.85cqi, 15px); color: var(--g2); letter-spacing: 0.08em; flex-shrink: 0; width: 38px; padding-top: 2px; }
.stlist { list-style: none; padding: 0; flex: 1; }
.stlist li { font-size: clamp(11px, 2.65cqi, 14px); line-height: 1.6; color: var(--i1); margin-bottom: 4px; }

/* ══════════════ EVENTS ══════════════ */
#s4 .page-left, #s4 .page-right { display: flex; flex-direction: column; }
#s4 #evl, #s4 #evr { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; padding-top: 4px; }
#s4 #evr { margin-top: 45px; }
#s4 #evr { padding-bottom: 4px; }
.evg { margin-bottom: 16px; }
.evg:last-child { margin-bottom: 0; }
.evyr { font-family: 'Cinzel', serif; font-size: clamp(14px, 3.55cqi, 18px); color: var(--g2); border-bottom: 1px solid rgba(143,168,158,0.28); padding-bottom: 4px; margin-bottom: 10px; letter-spacing: 0.08em; }
.evit {
  display: grid;
  grid-template-columns: clamp(95px, 25cqi, 130px) 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 14px;
  row-gap: 2px;
  margin-bottom: 11px;
  padding-bottom: 9px;
  border-bottom: 1px dotted rgba(143,168,158,0.18);
}
.evit:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.evdt {
  grid-column: 1; grid-row: 1 / span 3;
  font-family: 'Cinzel', serif;
  font-size: clamp(9.5px, 2.2cqi, 11px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--g2);
  padding-top: 2px;
}
.evtit, .evloc, .evtype { grid-column: 2; }
.evtit { font-size: clamp(13px, 3.0cqi, 15.5px); font-weight: 600; color: var(--i1); line-height: 1.3; margin-bottom: 2px; }
.evloc { font-size: clamp(10.5px, 2.3cqi, 12.5px); color: var(--i3); font-style: italic; margin-bottom: 3px; }
.evtype { font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--i3); opacity: 0.7; }

/* ══════════════ CONTACT ══════════════ */
#s5 .page-left {
  display: flex; flex-direction: column; align-items: center;
}
#s5 .page-left .slabel { align-self: stretch; text-align: left; }
#s5 .page-left .prule { width: 100%; }
#s5 .page-left .cph { margin-top: auto; }
#s5 .page-left #ct-soc { margin: 26px auto auto; align-self: center; }
#s5 .page-right { display: flex; flex-direction: column; }
#s5 .page-right .scroll { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.cph { width: clamp(150px, 39cqi, 210px); aspect-ratio: 4 / 5; height: auto; margin: 0 auto 15px; overflow: hidden; border-radius: 2px; box-shadow: 3px 4px 18px rgba(0,0,0,0.27), 0 0 0 1px rgba(143,168,158,0.16); }
.cph img { width: 100%; height: 100%; object-fit: cover; filter: sepia(14%) contrast(1.05); }
.slink { display: flex; align-items: center; gap: 10px; font-size: clamp(13px, 2.85cqi, 15px); color: var(--i1); text-decoration: none; margin-bottom: 10px; transition: color 0.2s; }
.slink:hover { color: var(--g1); }
.sico { width: 24px; height: 24px; border: 1px solid currentColor; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.agth { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--i3); font-style: italic; margin: 0 0 14px; }
.agtn { font-size: clamp(13px, 3.0cqi, 16px); font-weight: 600; color: var(--i1); }
.agta { font-size: clamp(11px, 2.4cqi, 13px); color: var(--i3); font-style: italic; }
.agte { font-size: clamp(10px, 2.3cqi, 12px); color: var(--g2); text-decoration: none; word-break: break-all; }
.agte:hover { text-decoration: underline; }
.agtt { margin-bottom: 14px; }

.fl { display: block; font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--i3); font-style: italic; margin: 10px 0 4px; }
.fi, .ft { width: 100%; background: rgba(255,255,255,0.45); border: 1px solid rgba(143,168,158,0.35); border-radius: 2px; padding: 6px 8px; font-family: inherit; font-size: clamp(10px, 2.3cqi, 12px); color: var(--i1); outline: none; transition: border-color 0.2s; resize: none; }
.fi:focus, .ft:focus { border-color: var(--g1); }
.ft { height: 62px; }
.fsub { margin-top: 10px; padding: 7px 18px; background: var(--ox); color: var(--g2); border: none; border-radius: 2px; font-family: inherit; font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; cursor: pointer; transition: background 0.2s; }
.fsub:hover { background: var(--ox2); }

/* ══════════════ BOOK WRAP + PAGE STACKS ══════════════ */
.pg-stack {
  position: absolute;
  top: 4px; bottom: 4px;
  width: 0;
  overflow: hidden;
  transition: width 0.5s ease;
  pointer-events: none;
}
#stack-left  { right: 100%; border-radius: 3px 0 0 3px; }
#stack-right { left: 100%;  border-radius: 0 3px 3px 0; }

.pg-stack-inner {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg,
    #222222 0px, #2A2A2A 1.2px,
    #1E1E1E 2.4px, #2A2A2A 3.6px,
    #262626 4.8px, #2A2A2A 6px,
    #222222 7.2px, #2A2A2A 8.4px,
    #1E1E1E 9.6px
  );
}
.pg-stack-inner::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg,
      rgba(30,30,30,0.28) 0%, transparent 18%,
      transparent 82%, rgba(30,30,30,0.28) 100%);
}
#stack-left  .pg-stack-inner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,0.35) 0%, transparent 60%); }
#stack-right .pg-stack-inner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 40%, rgba(0,0,0,0.35) 100%); }

/* ══════════════ CORNER CLICK ZONES ══════════════ */
.page-click {
  display: none;
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  z-index: 30;
  cursor: pointer;
}
.page-click-prev { left: 0; }
.page-click-next { right: 0; }

/* Keep interactive content above the click zones so it stays usable */
.page a,
.page button,
.page input,
.page textarea,
.page select,
.page label,
.page .scroll,
.page form { position: relative; z-index: 31; }

/* ══════════════ UI CHROME ══════════════ */
#book-nav {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 350;
  display: none;
  align-items: center;
  gap: 14px;
  padding: 6px;
  background: rgba(17,17,17,0.72);
  border: 1px solid rgba(167,197,189,0.24);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#book-nav.on { display: flex; }
#toc-btn {
  background: rgba(167,197,189,0.16);
  border: 1px solid rgba(167,197,189,0.34);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--p1);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
#toc-btn:hover { background: rgba(167,197,189,0.28); color: var(--i1); }
.book-nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 8px;
}
.book-nav-links a {
  position: relative;
  color: rgba(245,245,245,0.68);
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}
.book-nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1px;
  background: var(--g1);
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 0.2s, transform 0.2s;
}
.book-nav-links a:hover,
.book-nav-links a[aria-current="true"] { color: var(--g1); }
.book-nav-links a[aria-current="true"]::after {
  opacity: 0.9;
  transform: scaleX(1);
}

#skip-btn {
  position: fixed; top: 18px; left: 20px; z-index: 400;
  background: transparent; border: none; color: rgba(183,201,194,0.45);
  font-family: inherit; font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; cursor: pointer; transition: color 0.2s;
}
#skip-btn:hover { color: rgba(183,201,194,0.88); }

/* ══════════════ ACCESSIBILITY ══════════════ */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Skip link — visible only when focused */
#skip-link {
  position: fixed; top: -100px; left: 20px; z-index: 500;
  background: var(--p1); color: var(--i1);
  padding: 10px 16px; border: 1.5px solid var(--g1); border-radius: 4px;
  font-family: inherit; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  transition: top 0.18s ease;
}
#skip-link:focus { top: 18px; outline: none; }

/* Heading reset — preserve the typographic system from the old divs/paragraphs */
h1, h2, h3 { font-weight: inherit; font-size: inherit; line-height: inherit; }

/* Focus indicators */
:focus-visible { outline: 2px solid var(--g1); outline-offset: 3px; border-radius: 2px; }
#cover:focus-visible { outline-offset: -10px; }
.toc-list a:focus-visible { outline-offset: 4px; }
#pages-wrapper:focus-visible { outline: none; }

/* Page-click zones — no visual hover/focus indicators */
.page-click:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  #skip-link { transition: none; }
  /* Honor the system pref globally — flatten transitions and animations.
     The book still functions; only the motion layer is suppressed. */
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  #cover.open { transform: rotateY(-180deg); }
  .spread .page { transition: none !important; }
}

/* ══════════════ MOBILE ══════════════ */
@media (max-width: 700px) {
  :root { --bh: min(620px, 86vh); }
  .spread { flex-direction: column; }
  .spread .page { flex: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; transition: transform 0.38s ease, opacity 0.38s ease; }
  .spread .page-right { transform: translateX(100%); opacity: 0; }
  .spread.sr .page-left  { transform: translateX(-100%); opacity: 0; }
  .spread.sr .page-right { transform: translateX(0); opacity: 1; }
  #flip-card, #flip-shadow { display: none !important; }

  /* Hide invisible page-click zones — they overlap the form on mobile.
     Swipe handler on #pages-wrapper carries navigation. */
  .page-click { display: none !important; }

  /* Form: WCAG 2.5.5 — every interactive control ≥44×44px */
  .fl { font-size: 10px; margin: 14px 0 5px; }
  .fi, .ft {
    padding: 12px 12px;
    font-size: 16px; /* prevents iOS auto-zoom */
    min-height: 44px;
  }
  .ft { height: 88px; min-height: 88px; }
  .fsub {
    padding: 14px 26px;
    font-size: 11px;
    min-height: 44px;
    margin-top: 14px;
  }

  /* Social + agent links: bigger tap zone */
  .slink {
    padding: 8px 4px;
    margin-bottom: 4px;
    min-height: 44px;
    font-size: 14px;
  }
  .sico { width: 32px; height: 32px; font-size: 14px; }
  .agte {
    display: inline-block;
    padding: 6px 0;
    min-height: 32px;
    font-size: 13px;
  }

  /* TOC links: more tappable */
  .toc-list li { margin-bottom: 22px; }
  .toc-list a { padding: 6px 0; font-size: 17px; }

  /* Lift body-text minima off 11px to 12–13px */
  .alist li { font-size: 13px; }
  .stlist li { font-size: 13px; }
  .pbdesc { font-size: 12px; }
  .evdt { font-size: 11px; letter-spacing: 0.16em; }
  .evloc { font-size: 12px; }

  /* Book nav: compact horizontal scroll without covering page controls */
  #book-nav {
    left: 14px;
    right: 14px;
    top: 12px;
    max-width: calc(100vw - 28px);
    gap: 10px;
    border-radius: 16px;
    overflow: hidden;
  }
  .book-nav-links {
    flex: 1;
    overflow-x: auto;
    gap: 14px;
    padding: 3px 6px 5px 0;
    scrollbar-width: none;
  }
  .book-nav-links::-webkit-scrollbar { display: none; }
  .book-nav-links a { flex: 0 0 auto; font-size: 9px; }

  /* Cover/edge "Skip intro" + Contents buttons need larger tap area */
  #skip-btn { padding: 10px 14px; font-size: 11px; }
  #toc-btn { padding: 10px 14px; font-size: 10px; min-height: 40px; }
}

/* Very small screens — landscape phones, narrow Android */
@media (max-width: 380px) {
  :root { --bh: min(580px, 84vh); }
  .page { padding: 32px 24px 44px; }
}
