/* =============================================================
   FOLIORA — PUBLIC PORTAL
   Design system: Swiss grid, editorial serif, zero icons.
   ============================================================= */

:root {
  --paper: #fafafa;
  --white: #ffffff;
  --navy: #0f2338;
  --navy-soft: #1b3247;
  --navy-70: rgba(15, 35, 56, 0.72);
  --navy-55: rgba(15, 35, 56, 0.55);
  --navy-35: rgba(15, 35, 56, 0.35);
  --line: rgba(15, 35, 56, 0.16);
  --line-soft: rgba(15, 35, 56, 0.08);
  --gold: #c5a028;
  --gold-warm: #d4af37;
  --crimson: #8b1e1e;
  --muted: #5b6a79;

  --serif: "Instrument Serif", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: var(--sans);
  --arabic: "IBM Plex Sans Arabic", "Geeza Pro", "Segoe UI", sans-serif;

  --gutter: clamp(20px, 3.4vw, 48px);
  --rule: 1px solid var(--line);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  background: var(--paper);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
::selection { background: var(--gold); color: var(--navy); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.mono { font-family: var(--mono); font-variant-ligatures: none; }

/* =============================================================
   TOP LINE
   ============================================================= */
.topline {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 8px var(--gutter);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topline__right { color: rgba(212, 175, 55, 0.85); }

/* =============================================================
   MASTHEAD
   ============================================================= */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 20px var(--gutter);
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: var(--rule);
  position: sticky;
  top: 0;
  z-index: 40;
}

.wordmark { display: flex; align-items: center; gap: 14px; }
.wordmark__logo { width: 34px; height: auto; flex: none; }
.wordmark__name {
  font-family: var(--serif);
  font-size: 27px;
  letter-spacing: -0.015em;
  line-height: 1;
}
.wordmark__rule { width: 28px; height: 1px; background: var(--gold); }
.wordmark__tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy-55);
}

.masthead__toggle { display: none; }
.masthead__nav { display: flex; align-items: center; gap: 30px; }
.masthead__nav a {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--navy-70);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.masthead__nav a { white-space: nowrap; }
.masthead__nav a:hover { color: var(--navy); border-bottom-color: var(--gold); }
.masthead__admin {
  font-family: var(--mono);
  font-size: 10px !important;
  letter-spacing: 0.16em !important;
  border: 1px solid var(--line) !important;
  padding: 7px 12px !important;
}
.masthead__admin:hover { background: var(--navy); color: var(--white) !important; border-color: var(--navy) !important; }

/* =============================================================
   HERO
   ============================================================= */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  gap: clamp(24px, 3.2vw, 54px);
  padding: clamp(48px, 7vw, 96px) var(--gutter) clamp(40px, 5vw, 72px);
  max-width: 1440px;
  margin: 0 auto;
  align-items: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--navy-55);
  margin-bottom: 26px;
}
.eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--gold);
  flex: none;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.3vw, 74px);
  line-height: 0.94;
  letter-spacing: -0.026em;
  margin-bottom: 26px;
}
.hero__title em { font-style: italic; color: var(--crimson); }

.hero__lede {
  max-width: 54ch;
  font-size: clamp(14.5px, 1.15vw, 16.5px);
  line-height: 1.68;
  color: var(--navy-70);
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 34px 0 0; }

.hero__meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: var(--rule);
  margin-top: 40px;
  padding-top: 18px;
  gap: 12px;
}
.hero__meta dt {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy-55);
  margin-bottom: 6px;
}
.hero__meta dd {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* =============================================================
   HERO — THE BOOK THAT OPENS
   ============================================================= */
.hero__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  min-width: 0;
}

.stage__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.stage__label,
.stage__ref {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy-55);
}
.stage__ref { color: var(--gold); letter-spacing: 0.14em; white-space: nowrap; }

/* --- the object --- */
.bookstage {
  position: relative;
  padding: 16px 0 26px;
  perspective: 2200px;
  perspective-origin: 44% 46%;
}
.book3d::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 5px;
  background: repeating-linear-gradient(to bottom, #fffdf8 0 1px, #ddd6c3 1px 2px);
  border: 1px solid rgba(15, 35, 56, 0.12);
  border-top: 0;
  opacity: 0;
  transition: opacity 0.4s var(--ease) 0.5s;
}
.book3d.is-open::after, .book3d:hover::after { opacity: 1; }
.bookstage::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -18px;
  height: 22px;
  background: radial-gradient(closest-side, rgba(15, 35, 56, 0.26), rgba(15, 35, 56, 0));
  filter: blur(4px);
  pointer-events: none;
}

.book3d {
  position: relative;
  width: 100%;
  aspect-ratio: 1.5 / 1;
  transform: translateX(-25%) rotateY(-7deg) rotateX(2deg) scale(1.06);
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  transition: transform 1s var(--ease);
}
.book3d.is-open { transform: translateX(0) rotateY(0deg) rotateX(0deg) scale(1); }

/* --- page one --- */
.book3d__page {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  padding: clamp(16px, 1.6vw, 22px) clamp(15px, 1.6vw, 24px) clamp(26px, 2.4vw, 32px);
  overflow: hidden;
  background: linear-gradient(to left, #ffffff 0%, #fdfbf5 54%, #efeade 100%);
  border: 1px solid rgba(15, 35, 56, 0.14);
  border-left: 0;
  box-shadow: inset 14px 0 26px -20px rgba(15, 35, 56, 0.55);
}
.book3d__page::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(15, 35, 56, 0.2), rgba(15, 35, 56, 0) 26%);
  opacity: 0;
  transition: opacity 1s var(--ease);
  pointer-events: none;
}
.book3d.is-open .book3d__page::after { opacity: 1; }

.book3d__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 16px;
  margin-left: -8px;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.45s var(--ease) 0.28s;
  background: linear-gradient(
    to right,
    rgba(15, 35, 56, 0.22) 0%,
    rgba(15, 35, 56, 0.04) 38%,
    rgba(255, 255, 255, 0.85) 50%,
    rgba(15, 35, 56, 0.04) 62%,
    rgba(15, 35, 56, 0.22) 100%
  );
  pointer-events: none;
}
.book3d.is-open .book3d__spine { opacity: 1; }

/* --- the cover --- */
.book3d__cover {
  text-align: left;
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  transform-origin: left center;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: transform 1.15s cubic-bezier(0.55, 0.02, 0.2, 1);
  z-index: 3;
  cursor: pointer;
}
.book3d.is-open .book3d__cover { transform: rotateY(-168deg); }
.book3d__cover:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.cover3d__face {
  position: absolute;
  inset: 0;
  display: block;
  text-align: left;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 2px 0 rgba(15, 35, 56, 0.12), 0 22px 40px -34px rgba(15, 35, 56, 0.9);
}

.cover3d__front {
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(150deg, #17344f 0%, #0f2338 48%, #0a1826 100%);
  overflow: hidden;
}
.cover3d__front::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0));
}
.cover3d__front::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 9px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.32));
}

/* --- edition colours ------------------------------------------------
   The staged copy is the same object in three bindings: navy cloth for
   English, cloth red for French, gold cloth for Arabic. The edition on the
   board drives it; before the script runs <html lang> stands in, so the book
   is already the right colour in the first frame. */
html[lang="fr"] .book3d:not([data-edition]) .cover3d__front,
.book3d[data-edition="fr"] .cover3d__front {
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(150deg, #8f1c28 0%, #70121b 48%, #4f0a12 100%);
}
html[lang="ar"] .book3d:not([data-edition]) .cover3d__front,
.book3d[data-edition="ar"] .cover3d__front {
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(150deg, #1b4728 0%, #12331c 48%, #0a2012 100%);
}
html[lang="ar"] .book3d:not([data-edition]) .cover3d__front::before,
.book3d[data-edition="ar"] .cover3d__front::before {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0));
}

/* green mghlo9 cloth: antique gold foil, the way the printed Arabic cover reads */
html[lang="ar"] .book3d:not([data-edition]) .cover3d__frame,
.book3d[data-edition="ar"] .cover3d__frame { border-color: rgba(212, 175, 55, 0.75); }
html[lang="ar"] .book3d:not([data-edition]) .cover3d__series,
.book3d[data-edition="ar"] .cover3d__series {
  color: #e2c176;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}
html[lang="ar"] .book3d:not([data-edition]) .cover3d__title,
.book3d[data-edition="ar"] .cover3d__title {
  color: #fff9ec;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.70), 0 -1px 0 rgba(255, 255, 255, 0.15);
}
html[lang="ar"] .book3d:not([data-edition]) .cover3d__rule,
.book3d[data-edition="ar"] .cover3d__rule { background: rgba(212, 175, 55, 0.75); }
html[lang="ar"] .book3d:not([data-edition]) .cover3d__sub,
.book3d[data-edition="ar"] .cover3d__sub {
  color: rgba(255, 251, 240, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}
html[lang="ar"] .book3d:not([data-edition]) .cover3d__foot,
.book3d[data-edition="ar"] .cover3d__foot {
  color: #e2c176;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.cover3d__frame {
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(212, 175, 55, 0.72);
  padding: clamp(14px, 1.4vw, 20px) clamp(12px, 1.3vw, 18px);
  display: flex;
  flex-direction: column;
}
.cover3d__series {
  font-size: 7px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.85);
}
.cover3d__title {
  margin-top: auto;
  padding-top: clamp(20px, 3vw, 46px);
  white-space: pre-line;
  font-family: var(--serif);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(18px, 1.95vw, 27px);
  line-height: 0.99;
  letter-spacing: 0.006em;
  color: var(--gold-warm);
}
.cover3d__rule {
  width: 34px;
  height: 1px;
  background: rgba(212, 175, 55, 0.62);
  margin: 11px 0;
}
.cover3d__sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(9px, 0.86vw, 11px);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.64);
  max-width: 27ch;
}
.cover3d__foot {
  margin-top: 18px;
  font-size: 7.5px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 7px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.cover3d__back {
  transform: rotateY(180deg);
  background: linear-gradient(to left, #ffffff 0%, #fdfbf5 60%, #f1ece0 100%);
  padding: clamp(20px, 2vw, 28px);
}
.cover3d__back::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(197, 160, 40, 0.35);
  pointer-events: none;
}
.inside { display: flex; flex-direction: column; height: 100%; }
.inside__series {
  font-size: 7px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy-55);
}
.inside__rule {
  height: 1px;
  width: 100%;
  background: rgba(197, 160, 40, 0.55);
  margin: clamp(16px, 2.2vw, 30px) 0 clamp(16px, 2.2vw, 28px);
}
.inside__note {
  font-family: var(--serif);
  font-size: clamp(11.5px, 1.02vw, 14px);
  line-height: 1.5;
  color: var(--navy-70);
  letter-spacing: -0.004em;
  max-width: 30ch;
}
.inside__colophon {
  display: flex;
  flex-direction: column;
  margin: auto 0 0;
  padding: clamp(12px, 1.4vw, 18px) 0;
  border-top: 1px solid rgba(15, 35, 56, 0.12);
  border-bottom: 1px solid rgba(15, 35, 56, 0.12);
}
.inside__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 2.5px 0;
  font-size: 9.5px;
  line-height: 1.4;
  color: var(--navy-70);
}
.inside__row .mono {
  font-size: 7px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(15, 35, 56, 0.45);
}
.inside__spec {
  margin-top: clamp(12px, 1.4vw, 16px);
  font-size: 7px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* --- page one typography --- */
.p1 { position: relative; display: flex; flex-direction: column; height: 100%; }
.p1__run {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(15, 35, 56, 0.12);
  font-size: 7px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(15, 35, 56, 0.42);
}
.p1__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(19px, 2vw, 28px);
  line-height: 1.04;
  letter-spacing: -0.018em;
  margin-bottom: 9px;
  text-wrap: balance;
}
.p1__sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(10px, 1vw, 12.5px);
  line-height: 1.42;
  color: var(--navy-70);
  margin-bottom: 13px;
}
.p1__meta {
  font-size: 7px;
  line-height: 1.7;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--gold);
  max-width: none;
  white-space: nowrap;
}
.p1__rule { height: 1px; background: rgba(15, 35, 56, 0.14); margin: 14px 0 10px; }
.p1__contents { display: flex; flex-direction: column; }
.p1__contents li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 4.5px 0;
  border-bottom: 1px dotted rgba(15, 35, 56, 0.14);
  font-size: 9px;
  line-height: 1.35;
  color: var(--navy-70);
}
.p1__contents .mono { font-size: 7px; letter-spacing: 0.08em; color: var(--gold); }
.p1__check {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 35, 56, 0.12);
}
.p1__check-label {
  font-size: 7px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.p1__check-line {
  height: 1px;
  background: repeating-linear-gradient(to right, rgba(15, 35, 56, 0.32) 0 4px, transparent 4px 8px);
}
.p1__folio {
  position: absolute;
  bottom: -10px;
  right: 0;
  font-size: 7.5px;
  letter-spacing: 0.14em;
  color: rgba(15, 35, 56, 0.34);
}

/* Arabic review copy */
.book3d.is-ar .p1__title,
.book3d.is-ar .p1__sub,
.book3d.is-ar .inside__note {
  font-family: var(--arabic);
  text-align: right;
  letter-spacing: 0;
}
.book3d.is-ar .p1__title { line-height: 1.45; font-size: clamp(18px, 1.8vw, 25px); }
.book3d.is-ar .p1__sub { line-height: 1.8; }
.book3d.is-ar .p1__contents li { direction: rtl; grid-template-columns: 24px minmax(0, 1fr); }
.book3d.is-ar .p1__run,
.book3d.is-ar .p1__meta { direction: rtl; }
.book3d.is-ar .cover3d__title { font-family: var(--arabic); line-height: 1.4; font-size: clamp(17px, 1.7vw, 23px); }
.book3d.is-ar .cover3d__sub { font-family: var(--arabic); font-style: normal; line-height: 1.7; }
.book3d.is-ar .cover3d__foot { direction: rtl; }
html[dir="rtl"] .cover3d__frame { text-align: right; }
html[dir="rtl"] .cover3d__title { text-align: right; }
html[dir="rtl"] .cover3d__sub { text-align: right; }
html[dir="rtl"] .cover3d__series { text-align: right; }
html[dir="rtl"] .cover3d__rule { margin-inline-start: auto; margin-inline-end: 0; }
.book3d.is-ar .cover3d__series { font-family: var(--arabic); letter-spacing: 0; font-size: 9px; }

.stage__hint {
  margin-top: 40px;
  font-size: 7.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(15, 35, 56, 0.36);
  text-align: start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage__tabs {
  display: flex;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stage__tab {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--navy-55);
  border-inline-end: 1px solid var(--line-soft);
  transition: color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.stage__tab:last-child { border-inline-end: 0; }
.stage__tab .mono { color: var(--gold); letter-spacing: 0.08em; }
.stage__tab:hover { color: var(--navy); background: var(--white); }
.stage__tab.is-active {
  color: var(--navy);
  background: var(--white);
  box-shadow: inset 0 2px 0 var(--navy);
}

/* hover opens the copy on pointer devices */
@media (hover: hover) and (pointer: fine) {
  .book3d:hover { transform: translateX(0) rotateY(0deg) rotateX(0deg) scale(1); }
  .book3d:hover .book3d__cover { transform: rotateY(-168deg); }
  .book3d:hover .book3d__spine { opacity: 1; }
  .book3d:hover .book3d__page::after { opacity: 1; }
}

/* =============================================================
   INDEX BAND
   ============================================================= */
.index-band {
  background: var(--white);
  border-top: var(--rule);
  border-bottom: var(--rule);
  padding: 22px var(--gutter) 26px;
}
.index-band__head {
  font-size: 9px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--navy-55);
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.index-band__list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  max-width: 1440px;
  margin: 0 auto;
}
.index-band__list li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 18px;
  border-inline-start: 1px solid var(--line-soft);
}
.index-band__list li:first-child { border-inline-start: 0; padding-inline-start: 0; }
.index-band__list .mono { font-size: 8.5px; letter-spacing: 0.1em; color: var(--gold); }
.index-band__list p { font-size: 11.5px; line-height: 1.45; color: var(--navy-70); }

/* =============================================================
   PLATES — editorial photography
   ============================================================= */
.plate {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: clamp(26px, 4vw, 64px);
  align-items: center;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(44px, 5.4vw, 84px) var(--gutter);
}
.plate--flip .plate__media { order: 2; }
.plate__media {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--navy);
}
.plate__media img {
  width: 100%;
  height: clamp(260px, 30vw, 430px);
  object-fit: cover;
  filter: grayscale(1) contrast(1.06) brightness(1.02);
  transition: filter 0.6s var(--ease), transform 0.9s var(--ease);
}
.plate__media:hover img { filter: grayscale(0.35) contrast(1.04); transform: scale(1.012); }
.plate__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15, 35, 56, 0) 48%, rgba(15, 35, 56, 0.62) 100%);
  pointer-events: none;
}
.plate__cap {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 13px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 8px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}
.plate__body { max-width: 52ch; }
.plate__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.1vw, 44px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  margin-bottom: 18px;
  text-wrap: balance;
}
.plate__text {
  font-size: 14px;
  line-height: 1.72;
  color: var(--navy-70);
  margin-bottom: 18px;
}
.plate__text + .plate__specs { margin-top: 24px; }
.plate__specs { border-top: var(--rule); }
.plate__specs > div {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.plate__specs dt {
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy-55);
}
.plate__specs dd { font-size: 12.5px; color: var(--navy); line-height: 1.5; }

/* full-bleed band */
.band { position: relative; height: clamp(200px, 24vw, 320px); overflow: hidden; }
.band img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: grayscale(1) contrast(1.08) brightness(0.98);
}
.band__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  background: linear-gradient(to top, rgba(15, 35, 56, 0.78), rgba(15, 35, 56, 0));
  color: rgba(255, 255, 255, 0.8);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* =============================================================
   BUTTONS
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 15px 26px;
  border: 1px solid transparent;
  transition: background 0.22s var(--ease), color 0.22s var(--ease),
    border-color 0.22s var(--ease), transform 0.22s var(--ease);
  text-align: center;
}
.btn--solid { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn--solid:hover { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn--solid:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--navy); background: var(--white); }
.btn--wide { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.link-btn {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy-70);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.link-btn:hover:not(:disabled) { color: var(--crimson); border-color: var(--crimson); }
.link-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* =============================================================
   CREDIBILITY BAR
   ============================================================= */
.credbar {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  align-items: stretch;
  background: var(--navy);
  color: var(--white);
  border-top: 1px solid rgba(212, 175, 55, 0.4);
  border-bottom: 1px solid rgba(212, 175, 55, 0.4);
}
.credbar__label {
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  border-inline-end: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}
.credbar__item {
  padding: 18px clamp(16px, 2.4vw, 32px);
  border-inline-end: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 0.25s var(--ease);
}
.credbar__item:last-child { border-inline-end: 0; }
.credbar__item:hover { background: rgba(255, 255, 255, 0.045); }
.credbar__name { font-family: var(--serif); font-size: 19px; line-height: 1.2; letter-spacing: 0.005em; }
.credbar__url { font-size: 9.5px; letter-spacing: 0.1em; color: rgba(212, 175, 55, 0.8); }

/* =============================================================
   SECTION FURNITURE
   ============================================================= */
.library, .process, .institutions {
  padding: clamp(56px, 7vw, 104px) var(--gutter) clamp(40px, 5vw, 72px);
  max-width: 1440px;
  margin: 0 auto;
}
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
  gap: clamp(24px, 4vw, 72px);
  align-items: end;
  padding-bottom: 34px;
  margin-bottom: 40px;
  border-bottom: var(--rule);
}
.section-head--tight { margin-bottom: 34px; }
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.0;
  letter-spacing: -0.022em;
}
.section-note {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--navy-55);
  max-width: 46ch;
  justify-self: end;
}

/* =============================================================
   BOOKS
   ============================================================= */
.books {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
  border-inline-start: 1px solid var(--line-soft);
}
.book {
  border-inline-end: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  padding: clamp(20px, 2vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: background 0.3s var(--ease);
}
.book:hover { background: #fffdf8; }

/* --- CSS engineered cover --- */
.cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--navy);
  padding: 12px;
  box-shadow: 0 1px 0 rgba(15, 35, 56, 0.2), 0 14px 28px -22px rgba(15, 35, 56, 0.75);
  overflow: hidden;
}
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.07), transparent 42%);
  pointer-events: none;
}
.cover__inner {
  border: 1px solid rgba(212, 175, 55, 0.75);
  height: 100%;
  padding: clamp(16px, 1.8vw, 26px) clamp(13px, 1.5vw, 20px);
  display: flex;
  flex-direction: column;
  position: relative;
}
.cover__series {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.85);
  margin-bottom: clamp(18px, 3vw, 38px);
}
.cover__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(25px, 2.75vw, 38px);
  line-height: 1.04;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--gold-warm);
  margin-top: auto;
  margin-bottom: 14px;
}
.cover__rule { display: block; width: 42px; height: 1px; background: rgba(212, 175, 55, 0.6); margin-bottom: 14px; }
.cover__sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(10.5px, 0.95vw, 13px);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.66);
  max-width: 30ch;
  margin-bottom: auto;
}
.cover__foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(212, 175, 55, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cover__pages {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--white);
  color: var(--navy);
  padding: 3px 7px;
}
.cover__mark { display: block; width: 30px; height: auto; opacity: 0.8; }
.cover__mark-text {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

/* French cover: tighter typographic stack */
.cover--fr .cover__title { font-size: clamp(22px, 2.35vw, 33px); text-transform: uppercase; letter-spacing: 0.01em; }

/* Arabic cover: RTL typography */
.cover--ar .cover__inner { text-align: right; }
.cover--ar .cover__title {
  font-family: var(--arabic);
  font-size: clamp(26px, 2.8vw, 40px);
  line-height: 1.3;
  text-transform: none;
  letter-spacing: 0;
  color: var(--gold-warm);
}
.cover--ar .cover__sub {
  font-family: var(--arabic);
  font-style: normal;
  font-size: clamp(11px, 1vw, 13.5px);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.7);
}
.cover--ar .cover__series { letter-spacing: 0; font-family: var(--arabic); font-size: 9px; }
.cover--ar .cover__foot {
  margin-top: auto; flex-direction: row-reverse; }
.cover--ar .cover__pages { letter-spacing: 0; }

/* --- Book body --- */
.book__body { display: flex; flex-direction: column; flex: 1; }
.book__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--navy-55);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.book__index { color: var(--crimson); }
.book__lang { color: var(--navy-55); }
.book__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(23px, 2vw, 29px);
  line-height: 1.14;
  letter-spacing: -0.012em;
  margin: 16px 0 8px;
}
.book__title--ar { font-family: var(--arabic); text-align: right; font-size: 27px; line-height: 1.5; }
.book__subtitle { font-size: 12.5px; line-height: 1.55; color: var(--navy-70); margin-bottom: 14px; }
.book__subtitle--ar { font-family: var(--arabic); text-align: right; line-height: 1.85; font-size: 13px; }
.book__summary { font-size: 13px; line-height: 1.68; color: var(--navy-55); margin-bottom: 20px; }
.book__summary--ar { font-family: var(--arabic); text-align: right; line-height: 1.95; font-size: 13.5px; }

.book__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: auto;
  margin-bottom: 22px;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}
.book__specs > div {
  flex: 1 1 33%;
  min-width: 92px;
  padding-inline-end: 10px;
}
.book__specs dt {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy-35);
  margin-bottom: 4px;
}
.book__specs dd { font-size: 11.5px; line-height: 1.4; color: var(--navy-70); }
.book__specs--ar dt,
.book__specs--ar dd {
  font-family: var(--arabic);
  text-align: right;
}
.book__specs--ar dt {
  letter-spacing: 0;
  font-size: 9.5px;
}
.book[data-edition="ar"] button[data-open-edition="ar"] {
  font-family: var(--arabic);
  font-size: 13.5px;
  letter-spacing: 0.02em;
}

/* =============================================================
   PROCESS
   ============================================================= */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: var(--rule);
}
.step {
  padding-block: 30px;
  padding-inline: 28px 0;
  border-inline-end: var(--rule);
  border-bottom: var(--rule);
}
.step:last-child { border-inline-end: 0; }
.step:not(:first-child) { padding-inline-start: 28px; }
.step__num {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: 18px;
}
.step__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  margin-bottom: 10px;
}
.step__body { font-size: 13px; line-height: 1.7; color: var(--navy-55); max-width: 38ch; }
.step__tag {
  margin-top: 20px;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy-35);
}

/* =============================================================
   INSTITUTIONS
   ============================================================= */
.inst-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: var(--rule);
}
.inst {
  padding-block: 28px 30px;
  padding-inline: 30px 0;
  border-inline-end: var(--rule);
  border-bottom: var(--rule);
}
.inst:last-child { border-inline-end: 0; }
.inst:not(:first-child) { padding-inline-start: 30px; }
.inst__num { font-size: 10px; letter-spacing: 0.16em; color: var(--gold); margin-bottom: 22px; }
.inst__name { font-family: var(--serif); font-weight: 400; font-size: 25px; line-height: 1.2; }
.inst__role {
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--navy-35);
  margin: 6px 0 14px;
}
.inst__body { font-size: 13px; line-height: 1.7; color: var(--navy-55); margin-bottom: 18px; }
.inst__link {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--navy);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
}
.inst__link:hover { color: var(--crimson); border-color: var(--crimson); }

/* =============================================================
   FOOTER
   ============================================================= */
.site-foot {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.6);
  padding: clamp(40px, 5vw, 64px) var(--gutter) 22px;
  margin-top: clamp(40px, 6vw, 80px);
}
.site-foot__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.site-foot__word { display: block; }
.site-foot__logo { width: clamp(120px, 13vw, 168px); height: auto; opacity: 0.92; }
.site-foot__note { font-size: 12px; line-height: 1.75; max-width: 62ch; justify-self: end; }
.site-foot__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  padding-top: 18px;
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}
.site-foot__links { display: flex; flex-wrap: wrap; gap: 10px 22px; min-width: 0; }
.site-foot__links a { white-space: nowrap; }
.site-foot__links a:hover { color: var(--gold-warm); }

/* =============================================================
   MODAL
   ============================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(9, 20, 32, 0.72);
  backdrop-filter: blur(3px);
}
.modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(92vh, 860px);
  overflow-y: auto;
  background: var(--white);
  border: 1px solid rgba(15, 35, 56, 0.25);
  padding: clamp(22px, 3vw, 36px);
  transform: translateY(14px);
  transition: transform 0.35s var(--ease);
  box-shadow: 0 40px 80px -40px rgba(9, 20, 32, 0.6);
}
.modal.is-open .modal__panel { transform: translateY(0); }

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.modal__kicker {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy-35);
  margin-bottom: 8px;
}
.modal__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.modal__close {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy-55);
  border: 1px solid var(--line);
  padding: 6px 10px;
  flex: none;
  transition: all 0.2s var(--ease);
}
.modal__close:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }

.modal__progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.modal__progress li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 0;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy-35);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.modal__progress li span:first-child { font-size: 9.5px; letter-spacing: 0.06em; }
.modal__progress li.is-active { color: var(--navy); border-bottom-color: var(--gold); }
.modal__progress li.is-done { color: var(--crimson); border-bottom-color: transparent; }

.step-pane { display: none; }
.step-pane.is-active { display: block; animation: paneIn 0.32s var(--ease) both; }
@keyframes paneIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.pane__intro { font-size: 13px; line-height: 1.65; color: var(--navy-55); margin-bottom: 20px; }
.pane__intro strong { color: var(--navy); font-weight: 600; }

/* Fields */
.field { margin-bottom: 16px; }
.field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--navy-70);
  margin-bottom: 7px;
}
.field__req { font-size: 8.5px; letter-spacing: 0.1em; color: var(--navy-35); font-weight: 400; }
.input {
  width: 100%;
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 12px 13px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.input::placeholder { color: rgba(15, 35, 56, 0.32); }
.input:focus { outline: none; border-color: var(--navy); background: var(--white); }
.input.has-error { border-color: var(--crimson); background: rgba(139, 30, 30, 0.035); }
select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%),
    linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 36px;
}

.field__error {
  font-size: 11px;
  line-height: 1.5;
  color: var(--crimson);
  margin-top: 6px;
  min-height: 0;
}
.field__error:empty { display: none; }
.field__error--center { text-align: center; margin: 4px 0 10px; }

.consent {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--navy-70);
  cursor: pointer;
  margin-bottom: 8px;
}
.consent input {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--navy-35);
  background: var(--white);
  margin-top: 2px;
  cursor: pointer;
  display: grid;
  place-content: center;
}
.consent input:checked { background: var(--navy); border-color: var(--navy); }
.consent input:checked::after {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--gold);
}
.consent__req { display: block; margin-top: 4px; font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy-35); }

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.form__note {
  font-size: 9px;
  letter-spacing: 0.07em;
  line-height: 1.7;
  color: var(--navy-35);
  margin-top: 12px;
  text-transform: uppercase;
}
.form__legal { font-size: 10.5px; line-height: 1.6; color: var(--navy-35); margin-top: 10px; }

/* OTP */
.otp {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 6px 0 14px;
}
.otp__box {
  width: 100%;
  aspect-ratio: 1 / 1.15;
  text-align: center;
  font-family: var(--mono);
  font-size: clamp(20px, 3.2vw, 26px);
  font-weight: 500;
  color: var(--navy);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.otp__box:focus { outline: none; border-color: var(--navy); background: var(--white); }
.otp__box.is-filled { border-color: var(--gold); background: rgba(197, 160, 40, 0.06); }
.otp__box.has-error { border-color: var(--crimson); }

.otp__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy-55);
  margin-bottom: 18px;
  padding-top: 4px;
}
.timer {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--navy);
  border: 1px solid var(--line);
  padding: 3px 8px;
  background: var(--paper);
}
.timer.is-expired { color: var(--crimson); border-color: rgba(139, 30, 30, 0.4); background: rgba(139, 30, 30, 0.05); }
.otp__actions { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; flex-wrap: wrap; }

/* Unlocked */
.unlocked { padding-top: 4px; }
.unlocked__badge {
  display: inline-block;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--crimson);
  border: 1px solid rgba(139, 30, 30, 0.4);
  background: rgba(139, 30, 30, 0.05);
  padding: 4px 9px;
  margin-bottom: 16px;
}
.unlocked__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 38px);
  line-height: 1.1;
  margin-bottom: 10px;
}
.unlocked__body { font-size: 13px; line-height: 1.65; color: var(--navy-55); margin-bottom: 20px; }
.unlocked__meta {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.unlocked__meta > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11.5px;
}
.unlocked__meta > div:last-child { border-bottom: 0; }
.unlocked__meta dt { color: var(--navy-35); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; padding-top: 2px; }
.unlocked__meta dd { color: var(--navy); text-align: end; }
#finish-btn { margin-top: 16px; }

/* =============================================================
   TOAST
   ============================================================= */
.toast {
  display: none !important;
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 200;
  width: min(330px, calc(100vw - 40px));
  background: var(--navy);
  color: var(--white);
  border: 1px solid rgba(212, 175, 55, 0.55);
  padding: 14px 16px;
  box-shadow: 0 24px 48px -24px rgba(9, 20, 32, 0.8);
  transform: translateY(16px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--ease);
}
.toast.is-visible { transform: none; opacity: 1; visibility: visible; }
.toast__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.toast__tag { font-size: 8.5px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(212, 175, 55, 0.9); }
.toast__close { font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.5); }
.toast__close:hover { color: var(--white); }
.toast__body { font-size: 11px; color: rgba(255, 255, 255, 0.6); margin-bottom: 4px; }
.toast__code {
  font-size: 30px;
  letter-spacing: 0.32em;
  color: var(--gold-warm);
  line-height: 1.1;
  margin-bottom: 8px;
}
.toast__note { font-size: 8.5px; line-height: 1.6; color: rgba(255, 255, 255, 0.42); text-transform: uppercase; letter-spacing: 0.06em; }

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .hero__stage { max-width: 620px; }
  .index-band__list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 0; }
  .index-band__list li:nth-child(4) { border-inline-start: 0; padding-inline-start: 0; }
  .plate { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .plate--flip .plate__media { order: 0; }
  .books { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credbar { grid-template-columns: 1fr; }
  .credbar__label { border-inline-end: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.12); padding: 10px var(--gutter); }
  .credbar__item { border-inline-end: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
}

@media (min-width: 861px) and (max-width: 1160px) {
  .masthead { gap: 18px; }
  .wordmark__rule,
  .wordmark__tag { display: none; }
  .masthead__nav { gap: 15px; }
  .masthead__nav a { font-size: 10.5px; letter-spacing: 0.05em; }
  .masthead__admin { padding: 6px 9px !important; letter-spacing: 0.1em !important; }
  .themeswitch { margin-inline-start: 2px; }
}

@media (max-width: 860px) {
  .masthead { flex-wrap: wrap; row-gap: 0; }
  .masthead__toggle {
    display: inline-block;
    order: 2;
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 8px 12px;
    border: 1px solid var(--line);
    color: var(--navy-70);
  }
  .masthead__nav {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 12px;
    border-top: 1px solid var(--line);
  }
  .masthead.is-open .masthead__nav { display: flex; }
  .masthead__nav a {
    padding: 12px 2px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 12px;
  }
  .masthead__nav a:hover { border-bottom-color: var(--gold); }
  .masthead__admin { margin: 10px 0 4px; align-self: flex-start; }

  .section-head { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .section-note { justify-self: start; }
  .steps, .inst-grid { grid-template-columns: 1fr; }
  .step, .inst { border-inline-end: 0; padding-inline: 0 !important; }
  .site-foot__top { grid-template-columns: 1fr; gap: 20px; }
  .site-foot__note { justify-self: start; }
  .wordmark__tag { display: none; }
}

@media (max-width: 720px) {
  .topline__right { display: none; }
  .index-band__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index-band__list li { padding: 0 14px; }
  .index-band__list li:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
  /* Phone: the copy is a single portrait page. The cover swings away to the
     left rather than showing a two-page spread that would be unreadable. */
  .book3d {
    aspect-ratio: 0.78 / 1;
    max-width: 360px;
    margin: 0 auto;
    transform: none;
  }
  .book3d.is-open,
  .book3d:hover { transform: none; }
  .book3d__page {
    left: 0;
    right: 0;
    width: 100%;
    border-left: 1px solid rgba(15, 35, 56, 0.14);
    box-shadow: none;
    background: linear-gradient(to right, #ffffff 0%, #fdfbf5 62%, #f0ebde 100%);
  }
  .book3d__spine { display: none; }
  .book3d__cover {
    left: 0;
    right: 0;
    width: 100%;
    transform-origin: left center;
  }
  .book3d.is-open .book3d__cover,
  .book3d:hover .book3d__cover { transform: rotateY(-158deg); }
  .book3d__page::after { display: none; }
  .p1__title { font-size: 25px; }
  .p1__sub { font-size: 12.5px; margin-bottom: 10px; }
  .p1__meta { font-size: 6.5px; letter-spacing: 0.1em; max-width: none; margin-bottom: 12px; }
  .p1__rule { margin: 10px 0 8px; }
  .p1__contents li { font-size: 10.5px; padding: 5px 0; }
  .p1__check { margin-top: auto; padding-top: 10px; }
  .book3d__page { padding-bottom: 22px; }
  .bookstage::after { bottom: 4px; height: 12px; opacity: 0.7; }
  .stage__hint { text-align: start; white-space: normal; line-height: 1.7; }
  .book3d::after { display: none; }
  .plate__media img { height: clamp(220px, 56vw, 320px); }
  .books { grid-template-columns: 1fr; }
  .book { padding: 22px; }
  .cover { max-width: 380px; margin-inline: auto; }
  .hero__meta { grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
  .hero__title { font-size: clamp(38px, 10vw, 56px); }
  .modal { padding: 0; align-items: flex-end; }
  .modal__panel { max-height: 94vh; width: 100%; border-left: 0; border-right: 0; border-bottom: 0; padding: 20px 18px 28px; }
  .modal__progress li span:last-child { display: none; }
  .otp { gap: 6px; }
  .otp__box { font-size: 20px; }
  .unlocked__meta > div { flex-direction: column; gap: 2px; align-items: flex-start; }
  .unlocked__meta dd { text-align: end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}


/* =============================================================
   MOTION
   ============================================================= */
html.has-motion [data-anim="hero"] { opacity: 0; transform: translateY(22px); }
html.has-motion [data-anim="hero-art"] { opacity: 0; }
html.has-motion [data-anim="up"] { opacity: 0; transform: translateY(20px); }
html.has-motion [data-anim="fade"] { opacity: 0; }

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  z-index: 200;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  html.has-motion [data-anim] { opacity: 1 !important; transform: none !important; }
  .scroll-progress { display: none; }
}


/* =============================================================
   DOCUMENT PAGES — about, contact, privacy, terms, 404
   ============================================================= */
.doc { max-width: 1440px; margin: 0 auto; }
.doc-hero {
  padding: clamp(42px, 5vw, 78px) var(--gutter) clamp(30px, 3.4vw, 46px);
  border-bottom: var(--rule);
}
.doc-hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 70px);
  line-height: 0.98;
  letter-spacing: -0.026em;
  max-width: 19ch;
  text-wrap: balance;
}
.doc-hero__lede {
  max-width: 64ch;
  margin-top: 22px;
  font-size: clamp(14.5px, 1.15vw, 16px);
  line-height: 1.72;
  color: var(--navy-70);
}
.doc-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 28px;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy-55);
}
.doc-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.3fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 76px);
  padding: clamp(32px, 4vw, 56px) var(--gutter) clamp(56px, 7vw, 100px);
}
.doc-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  border-top: 1px solid var(--navy);
}
.doc-toc > p {
  padding: 12px 0 10px;
  font-size: 8.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy-55);
  border-bottom: 1px solid var(--line-soft);
}
.doc-toc a {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  line-height: 1.4;
  color: var(--navy-70);
  transition: color 0.2s var(--ease), padding-left 0.2s var(--ease);
}
.doc-toc a:hover { color: var(--crimson); padding-left: 3px; }
.doc-toc .mono { font-size: 8.5px; letter-spacing: 0.1em; color: var(--gold); }

.doc-body { max-width: 74ch; }
.doc-body section + section { margin-top: 34px; }
.doc-body h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(23px, 2.3vw, 33px);
  line-height: 1.1;
  letter-spacing: -0.018em;
  margin-bottom: 14px;
  padding-top: 6px;
  scroll-margin-top: 110px;
}
.doc-body h3 {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 24px 0 10px;
  color: var(--navy);
}
.doc-body p { font-size: 14.5px; line-height: 1.78; color: var(--navy-70); margin-bottom: 14px; }
.doc-body p:last-child { margin-bottom: 0; }
.doc-body ul { margin: 0 0 16px; }
.doc-body li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--navy-70);
}
.doc-body li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--gold);
}
.doc-body a { border-bottom: 1px solid rgba(197, 160, 40, 0.55); }
.doc-body a:hover { color: var(--crimson); border-color: var(--crimson); }
.doc-body strong { color: var(--navy); font-weight: 600; }

.doc-note {
  border: var(--rule);
  background: var(--white);
  padding: 18px 20px;
  margin: 26px 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--navy-70);
}
.doc-note strong { color: var(--navy); }

.doc-specs { border-top: var(--rule); margin: 18px 0 4px; }
.doc-specs > div {
  display: grid;
  grid-template-columns: minmax(0, 0.34fr) minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.doc-specs dt { font-size: 8.5px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--navy-55); }
.doc-specs dd { font-size: 13px; line-height: 1.65; color: var(--navy-70); }

.doc-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  padding-top: 26px;
  border-top: var(--rule);
}
.error .doc-hero { padding-bottom: clamp(26px, 3vw, 40px); }
.error__code {
  font-family: var(--serif);
  font-size: clamp(84px, 13vw, 168px);
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: var(--gold);
  margin-bottom: 14px;
}
.contact-link {
  font-family: var(--serif);
  font-size: clamp(18px, 1.6vw, 22px);
  border-bottom: 1px solid var(--gold);
}
.doc-small { font-size: 8.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--navy-55); margin-top: -4px; }

@media (max-width: 860px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .doc-toc { position: static; order: -1; }
  .doc-specs > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .doc-hero h1 { max-width: 100%; }
}

/* about page band sits directly under the hero */
.band--about { margin-top: 0; }
.band--about img { object-position: center 50%; }


/* =============================================================
   EDITION PICKER — request modal
   ============================================================= */
.edition-pick { margin-bottom: 18px; }
.edition-pick .field__label { margin-bottom: 8px; }
.edition-pick .form__note { margin-top: 8px; }
.edition-pick__opts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--paper);
}
.edition-pick__opt {
  position: relative;
  display: flex;
  cursor: pointer;
  border-inline-end: 1px solid var(--line-soft);
  transition: color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.edition-pick__opt:last-child { border-inline-end: 0; }
.edition-pick__opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.edition-pick__opt > span {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 11px 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy-55);
  transition: color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.edition-pick__opt:hover > span { color: var(--navy); background: var(--white); }
.edition-pick__opt input:checked + span {
  color: var(--navy);
  background: var(--white);
  box-shadow: inset 0 2px 0 var(--gold);
}
.edition-pick__opt input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: -3px; }

/* =============================================================
   AUTHENTICATION UI (LOGOUT & LOGIN)
   ============================================================= */
.logout-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  color: var(--navy);
  border: 1px solid rgba(15, 44, 89, 0.25);
  border-radius: 3px;
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.logout-button:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.login-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 3px;
}
.login-link:hover {
  background: var(--gold);
  color: var(--navy);
}

/* =============================================================
   3D INSPECT BADGE (LIBRARY COVERS)
   ============================================================= */
.cover__inspect-badge {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 10px) translateZ(36px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(15, 35, 56, 0.92);
  color: #f7e7a9;
  border: 1px solid rgba(209, 180, 119, 0.5);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.45), 0 0 16px rgba(209, 180, 119, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  z-index: 10;
  white-space: nowrap;
}
.cover__inspect-badge .inspect-icon {
  color: var(--gold);
  transition: transform 0.3s ease;
}
.cover:hover .cover__inspect-badge,
.book:hover .cover__inspect-badge,
.cover:focus-visible .cover__inspect-badge {
  opacity: 1;
  transform: translate(-50%, 0) translateZ(48px);
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.55), 0 0 22px rgba(209, 180, 119, 0.35);
}
.cover:hover .cover__inspect-badge .inspect-icon {
  transform: rotate(18deg) scale(1.1);
}

/* =============================================================
   3D BOOK INSPECTOR MODAL & ATELIER SHOWCASE
   ============================================================= */
.inspector-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.inspector-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.inspector-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 11, 19, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.inspector-modal__panel {
  position: relative;
  z-index: 2;
  width: min(1280px, 95vw);
  height: min(880px, 92vh);
  background: #0a111a;
  border: 1px solid rgba(209, 180, 119, 0.28);
  border-radius: 10px;
  box-shadow: 0 40px 100px -25px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(14px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.inspector-modal.is-open .inspector-modal__panel {
  transform: scale(1) translateY(0);
}

/* Inspector Header */
.inspector-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px;
  background: rgba(14, 23, 36, 0.85);
  border-bottom: 1px solid rgba(209, 180, 119, 0.2);
  backdrop-filter: blur(12px);
  z-index: 20;
}
.inspector-modal__branding {
  min-width: 220px;
}
.inspector-modal__kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
}
.inspector-modal__title {
  font-family: var(--display);
  font-size: 21px;
  font-weight: 400;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

/* Inspector Tabs */
.inspector-modal__tabs {
  display: inline-flex;
  align-items: center;
  background: rgba(8, 15, 24, 0.7);
  border: 1px solid rgba(209, 180, 119, 0.25);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.inspector-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.inspector-tab span.mono {
  font-size: 9px;
  opacity: 0.6;
}
.inspector-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}
.inspector-tab.is-active {
  background: var(--gold);
  color: #0b1522;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(209, 180, 119, 0.35);
}
.inspector-tab.is-active span.mono {
  opacity: 0.85;
}

.inspector-modal__close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}
.inspector-modal__close:hover {
  color: #ffffff;
  border-color: var(--gold);
  background: rgba(209, 180, 119, 0.08);
}
.inspector-close-kbd {
  display: inline-block;
  padding: 2px 5px;
  font-size: 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  opacity: 0.7;
}

/* 3D Studio Stage */
.inspector-stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  perspective: 2000px;
  perspective-origin: 50% 48%;
  background: radial-gradient(ellipse at 50% 40%, rgba(22, 42, 68, 0.45) 0%, rgba(9, 16, 26, 0.96) 75%);
}

.inspector-stage__ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 36%, rgba(209, 180, 119, 0.12) 0%, transparent 60%);
}

.inspector-stage__pedestal {
  position: absolute;
  bottom: 80px;
  width: 580px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 45%, transparent 70%);
  filter: blur(12px);
  pointer-events: none;
}

/* 3D Viewport & Interactive Grab */
.inspector-viewport {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.inspector-viewport.is-dragging {
  cursor: grabbing;
}

/* =============================================================
   THE 3D BOOK RIG
   ============================================================= */
.inspector-book {
  position: relative;
  width: 340px;
  height: 480px;
  transform-style: preserve-3d;
  transform-origin: 50% 50% -18px;
  transform: rotateX(var(--rot-x, 10deg)) rotateY(var(--rot-y, -22deg)) rotateZ(var(--rot-z, 0deg));
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.inspector-book[data-open="true"] {
  transform: translateX(20%) rotateX(var(--rot-x, 4deg)) rotateY(var(--rot-y, -6deg)) rotateZ(0deg);
}
.inspector-book.is-animating {
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Rounded Spine (Left Edge) --- */
.inspector-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38px;
  transform-origin: left center;
  transform: rotateY(-90deg);
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(0, 0, 0, 0.25) 20%,
    rgba(0, 0, 0, 0.35) 80%,
    rgba(255, 255, 255, 0.08) 100%
  ), var(--book-skin, #0F2C59);
  border-radius: 4px 0 0 4px;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.65), 0 0 6px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 2;
}
.inspector-spine::before,
.inspector-spine::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  box-shadow: 0 0 4px var(--gold);
}
.inspector-spine::before { top: 38px; }
.inspector-spine::after { bottom: 38px; }

.inspector-spine__foil {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--gold-light, #f7e7a9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

/* --- Gilded Edges (Page Block Gilt) --- */
.inspector-gilt {
  position: absolute;
  background: repeating-linear-gradient(
    90deg,
    #b38b3a 0px,
    #ffd97d 2px,
    #cfaf64 4px,
    #8f6c24 6px
  );
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.45);
}
.inspector-gilt--top {
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  transform-origin: top center;
  transform: rotateX(90deg);
}
.inspector-gilt--right {
  top: 0;
  bottom: 0;
  right: 0;
  width: 36px;
  transform-origin: right center;
  transform: rotateY(90deg);
  background: repeating-linear-gradient(
    180deg,
    #b38b3a 0px,
    #ffd97d 2px,
    #cfaf64 4px,
    #8f6c24 6px
  );
}
.inspector-gilt--bottom {
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  transform-origin: bottom center;
  transform: rotateX(-90deg);
}

/* --- Silk Ribbon Bookmark --- */
.inspector-ribbon {
  position: absolute;
  bottom: -46px;
  left: 48px;
  width: 18px;
  height: 60px;
  background: var(--book-ribbon, #122842);
  transform: rotateZ(-5deg) translateZ(-6px);
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.45);
  border-radius: 0 0 2px 2px;
  z-index: 4;
}
.inspector-ribbon__tail {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 8px solid #0a111a;
}

/* --- Interior Book Block (Right Page) --- */
.inspector-interior {
  position: absolute;
  inset: 0;
  display: flex;
  transform-style: preserve-3d;
  background: #fdfcf9;
  border-radius: 0 4px 4px 0;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.12), 0 20px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.interior-sheet {
  width: 100%;
  height: 100%;
  padding: 30px 26px;
  overflow: hidden;
  box-sizing: border-box;
  background: #fdfcf9;
  display: flex;
  flex-direction: column;
}
.interior-sheet--left {
  border-right: 1px solid rgba(15, 35, 56, 0.14);
  box-shadow: inset -15px 0 20px -10px rgba(15, 35, 56, 0.18);
  background: linear-gradient(to right, #f6f3e8 0%, #fdfcf9 85%, #eae3d2 100%);
}
.interior-sheet--right {
  box-shadow: inset 15px 0 20px -10px rgba(15, 35, 56, 0.2);
  background: linear-gradient(to left, #f6f3e8 0%, #fdfcf9 85%, #eae3d2 100%);
}

.interior-sheet__content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Colophon Styles (Left page) */
.colophon__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy-70);
  margin-bottom: 14px;
}
.colophon__mark {
  color: var(--gold);
  margin-bottom: 12px;
}
.colophon__title {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.15;
  color: var(--navy);
  margin: 0 0 4px;
}
.colophon__sub {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--navy-70);
  margin: 0 0 12px;
}
.colophon__rule {
  height: 1px;
  background: rgba(15, 35, 56, 0.14);
  margin-bottom: 14px;
}
.colophon__grid {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 7px 12px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--navy-85);
  margin: 0 0 auto;
}
.colophon__grid dt {
  color: var(--navy-70);
  letter-spacing: 0.05em;
}
.colophon__grid dd {
  margin: 0;
  font-weight: 500;
  color: var(--navy);
}
.colophon__seal {
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dark, #8a6508);
  border-top: 1px dashed rgba(209, 180, 119, 0.4);
  padding-top: 8px;
  margin: 12px 0 0;
}

/* Movement Breakdown Styles (Right page) */
.movement__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy-70);
  margin-bottom: 10px;
}
.movement__title {
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.2;
  color: var(--navy);
  margin: 0 0 12px;
}
.movement__list {
  list-style: none;
  padding: 0;
  margin: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.movement__list li {
  display: flex;
  gap: 10px;
  font-size: 10.5px;
  line-height: 1.25;
}
.movement__list li span.mono {
  color: var(--gold-dark, #8a6508);
  font-weight: 600;
  font-size: 9.5px;
}
.movement__list li strong {
  display: block;
  color: var(--navy);
  font-size: 11.5px;
}
.movement__list li small {
  display: block;
  color: var(--navy-70);
  font-size: 9px;
  line-height: 1.2;
}
.movement__checkpoint {
  background: rgba(15, 44, 89, 0.04);
  border: 1px solid rgba(15, 44, 89, 0.12);
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 12px;
}
.movement__cp-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  margin: 0 0 3px;
  font-weight: 600;
}
.movement__cp-note {
  font-size: 9.5px;
  color: var(--navy-70);
  line-height: 1.35;
  margin: 0;
}

/* --- The 3D Cover (Flips open on hinge) --- */
.inspector-cover {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: transform 1.1s cubic-bezier(0.45, 0.05, 0.2, 1);
  cursor: pointer;
  z-index: 10;
}
.inspector-book[data-open="true"] .inspector-cover {
  transform: rotateY(-172deg);
}

.inspector-cover__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 0 4px 4px 0;
  overflow: hidden;
}

/* Front Face: Ornate debossed gold foil over leather */
.inspector-cover__face--front {
  background: var(--book-skin, #0F2C59);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.4);
}
.cover-skin {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 70%),
    linear-gradient(135deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.6) 100%);
  opacity: 0.7;
}
.cover-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, transparent 20%, rgba(255, 235, 180, 0.15) 45%, transparent 60%);
  pointer-events: none;
}

/* Ornate Corner Filigree */
.cover-filigree {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(209, 180, 119, 0.4);
  pointer-events: none;
}
.cover-filigree::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(209, 180, 119, 0.65);
}
.filigree-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gold);
}
.filigree-corner--tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.filigree-corner--tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.filigree-corner--bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.filigree-corner--br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.cover-content {
  position: relative;
  height: 100%;
  padding: 38px 28px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--gold-light, #f7e7a9);
}
.cover-content__mark {
  color: var(--gold);
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.cover-content__brand {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin: 0 0 24px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.cover-content__title {
  font-family: var(--display);
  font-size: 27px;
  line-height: 1.15;
  color: #fff4d2;
  margin: 0 0 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7), 0 0 2px rgba(209, 180, 119, 0.8);
  letter-spacing: 0.04em;
}
.cover-content__rule {
  width: 48px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
  margin-bottom: 16px;
}
.cover-content__subtitle {
  font-size: 11px;
  line-height: 1.45;
  color: rgba(247, 231, 169, 0.85);
  margin: 0 0 auto;
  max-width: 230px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.cover-content__foot {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--gold);
  border-top: 1px solid rgba(209, 180, 119, 0.35);
  padding-top: 10px;
}

/* Back Face (Left Page of Open Spread) */
.inspector-cover__face--back {
  transform: rotateY(180deg);
  background: #fdfcf9;
  box-shadow: inset -10px 0 25px rgba(0,0,0,0.25);
  display: flex;
}

/* Edition Skin Themes */
.inspector-book[data-edition="en"] {
  --book-skin: #0F2C59;
  --book-ribbon: #081a33;
}
.inspector-book[data-edition="fr"] {
  --book-skin: #721c24;
  --book-ribbon: #4a1016;
}
.inspector-book[data-edition="ar"] {
  --book-skin: #19382b;
  --book-ribbon: #0d221a;
}
.inspector-book[data-edition="ar"] .cover-content__title,
.inspector-book[data-edition="ar"] .cover-content__subtitle,
.inspector-book[data-edition="ar"] .colophon__title,
.inspector-book[data-edition="ar"] .movement__title,
.inspector-book[data-edition="ar"] .movement__list {
  font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  direction: rtl;
}

/* Controls & Actions Bar */
.inspector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 28px;
  background: rgba(12, 20, 31, 0.95);
  border-top: 1px solid rgba(209, 180, 119, 0.2);
  backdrop-filter: blur(12px);
  z-index: 20;
}
.inspector-bar__hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
}
.inspector-bar__hint .hint-icon {
  color: var(--gold);
  animation: pulse-hint 2.4s infinite ease-in-out;
}
@keyframes pulse-hint {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.08); }
}

.inspector-bar__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.inspector-bar__actions .btn--outline {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}
.inspector-bar__actions .btn--outline:hover {
  border-color: var(--gold);
  color: var(--gold-light, #f7e7a9);
}

/* Responsive adjustments for 3D Inspector */
@media (max-width: 900px) {
  .inspector-modal__panel {
    width: 98vw;
    height: 96vh;
    border-radius: 6px;
  }
  .inspector-modal__head {
    padding: 12px 16px;
  }
  .inspector-modal__title {
    font-size: 17px;
  }
  .inspector-book {
    width: 270px;
    height: 390px;
  }
  .cover-content {
    padding: 26px 16px;
  }
  .cover-content__title {
    font-size: 21px;
  }
  .inspector-bar {
    flex-direction: column;
    padding: 12px 16px;
    gap: 10px;
  }
  .inspector-bar__actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
}
@media (max-width: 600px) {
  .inspector-modal__branding { min-width: auto; }
  .inspector-modal__kicker { display: none; }
  .inspector-tab { padding: 4px 10px; font-size: 10px; }
  .inspector-book {
    width: 230px;
    height: 330px;
  }
  .interior-sheet {
    padding: 14px 12px;
  }
  .movement__list li strong { font-size: 9.5px; }
  .colophon__title { font-size: 15px; }
}
