/* === Le stagioni del silenzio — Catalogo Galleria Marini === */

:root {
  /* Carta avorio caldo */
  --paper: #efe6d2;
  --paper-warm: #e9dfc7;
  --paper-deep: #e0d4b8;
  --paper-shadow: rgba(60, 45, 25, 0.12);

  /* Inchiostro caldo scuro */
  --ink: #2a241c;
  --ink-soft: #4a4036;
  --ink-faint: #7a6f60;
  --ink-line: #c9bda1;

  /* Accento minimo (bruno seppia) */
  --accent: #6b4a2a;

  --serif-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --serif-text: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #1c1814;
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  height: 100vh;
}

/* === Stage / Book layout === */

.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, #2a2419 0%, #14110d 75%);
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 50%, transparent 60%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
}

.book {
  position: relative;
  display: flex;
  width: 1200px; /* 600+600 px = doppia pagina */
  height: 600px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 10px 30px rgba(0, 0, 0, 0.4);
  background: var(--paper);
  transform-origin: center center;
}

/* Spine shadow between left/right pages */
.book::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 60px;
  transform: translateX(-50%);
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(0,0,0,0.04) 30%,
    rgba(0,0,0,0.18) 50%,
    rgba(0,0,0,0.04) 70%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 5;
}

.page {
  position: relative;
  width: 600px;
  height: 600px;
  background: var(--paper);
  overflow: hidden;
}

.page--left {
  background:
    radial-gradient(ellipse at right center, rgba(0,0,0,0.05) 0%, transparent 35%),
    linear-gradient(to right, var(--paper) 0%, var(--paper-warm) 100%);
}

.page--right {
  background:
    radial-gradient(ellipse at left center, rgba(0,0,0,0.05) 0%, transparent 35%),
    linear-gradient(to left, var(--paper) 0%, var(--paper-warm) 100%);
}

/* Subtle paper texture using SVG noise */
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.18 0 0 0 0 0.13 0 0 0 0 0.07 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
  opacity: 0.55;
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 2;
}

.page-content {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
}

.page-content--no-pad {
  padding: 0;
}

/* === Typography === */

h1, h2, h3, h4, h5, p, ul, ol { margin: 0; }

.eyebrow {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.eyebrow--accent {
  color: var(--accent);
}

.serif-title {
  font-family: var(--serif-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.05;
  color: var(--ink);
}

.serif-subtitle {
  font-family: var(--serif-display);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.005em;
  color: var(--ink-soft);
}

.body-text {
  font-family: var(--serif-text);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink);
  text-align: justify;
  hyphens: auto;
}

.body-text p + p {
  margin-top: 0.85em;
  text-indent: 1.4em;
}

.body-text .dropcap {
  float: left;
  font-family: var(--serif-display);
  font-size: 54px;
  line-height: 0.85;
  padding: 6px 8px 0 0;
  color: var(--ink);
  font-weight: 400;
}

.caption {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.5;
}

.caption-italic {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-transform: none;
}

.rule {
  border: 0;
  border-top: 0.5px solid var(--ink-line);
  margin: 0;
}

.rule--short {
  width: 32px;
  border-top: 0.5px solid var(--ink);
}

/* Folio (page number) */
.folio {
  position: absolute;
  bottom: 24px;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  z-index: 4;
}
.folio--left { left: 60px; }
.folio--right { right: 60px; }

.running-head {
  position: absolute;
  top: 24px;
  font-family: var(--sans);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  z-index: 4;
}
.running-head--left { left: 60px; }
.running-head--right { right: 60px; }

/* === Cover === */

.cover {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

.cover-half {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #1c1814;
}

.cover-half img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.92) contrast(1.02);
}

.cover-half::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.18) 100%);
  pointer-events: none;
}

.cover-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(255,255,255,0.08);
  z-index: 2;
}

.cover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 38px 44px;
  z-index: 3;
  pointer-events: none;
}

.cover-logo-mark {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
}

.cover-logo-mark img {
  display: block;
  width: 44px;
  height: auto;
  filter: invert(1) brightness(1.1);
  opacity: 0.9;
}

.cover-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  color: rgba(255,255,255,0.92);
}

.cover-eyebrow {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 400;
  color: rgba(255,255,255,0.78);
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.cover-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 4;
  width: 72%;
}

.cover-name-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  font-family: var(--serif-display);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f4ecd8;
  text-shadow: 0 1px 6px rgba(0,0,0,0.45);
}

.cover-name {
  flex: 1;
}
.cover-name--left { text-align: left; }
.cover-name--right { text-align: right; }

.cover-title {
  font-family: var(--serif-display);
  font-weight: 400;
  font-style: italic;
  font-size: 56px;
  line-height: 1.0;
  color: #f6efdb;
  letter-spacing: 0.005em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.55);
  margin: 0 auto;
  padding: 28px 0;
  border-top: 0.5px solid rgba(246,239,219,0.55);
  border-bottom: 0.5px solid rgba(246,239,219,0.55);
  max-width: 380px;
}

.cover-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  color: rgba(255,255,255,0.85);
}

.cover-publisher {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: rgba(246,239,219,0.92);
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.cover-dates {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
  text-align: right;
}

/* === Title page (frontespizio) === */

.frontispiece {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: 60px 60px 50px;
}

.frontispiece .gallery-mark {
  width: 38px;
  height: auto;
  margin-bottom: 0;
  opacity: 0.88;
  flex-shrink: 0;
}

.frontispiece .center-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 22px;
}

.frontispiece .artists {
  font-family: var(--serif-display);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.5;
}

.frontispiece .artists em {
  display: block;
  font-style: italic;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  margin: 6px 0;
  text-transform: lowercase;
}

.frontispiece .main-title {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 36px;
  font-weight: 300;
  color: var(--ink);
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin: 0;
  padding: 16px 0;
  border-top: 0.5px solid var(--ink-line);
  border-bottom: 0.5px solid var(--ink-line);
}

.frontispiece .subtitle-trio {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  line-height: 1.7;
}

.frontispiece .gallery-line {
  margin-top: 0;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faint);
  flex-shrink: 0;
}

/* === Colophon === */

.colophon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  font-family: var(--sans);
  font-size: 9.5px;
  line-height: 1.9;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.colophon h4 {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.colophon .col-row {
  margin-bottom: 22px;
}

.colophon .col-label {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 8.5px;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

.colophon .col-value {
  font-family: var(--serif-text);
  font-size: 12.5px;
  letter-spacing: 0;
  color: var(--ink);
  text-transform: none;
  line-height: 1.5;
}

/* === Critical text spread === */

.text-spread-header {
  margin-bottom: 30px;
}

.text-spread-header .eyebrow {
  margin-bottom: 12px;
}

.text-spread-header .title {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 300;
  font-size: 32px;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 8px;
}

.text-spread-header .subtitle {
  font-family: var(--serif-display);
  font-size: 14px;
  font-style: italic;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.two-column {
  columns: 2;
  column-gap: 28px;
  flex: 1;
  font-family: var(--serif-text);
  font-size: 11.5px;
  line-height: 1.7;
  text-align: justify;
  hyphens: auto;
  color: var(--ink);
}

.two-column p { break-inside: avoid-column; }
.two-column p + p { margin-top: 0.7em; text-indent: 1.2em; }

.single-column {
  flex: 1;
  font-family: var(--serif-text);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: justify;
  hyphens: auto;
  color: var(--ink);
}

.single-column p + p { margin-top: 0.8em; text-indent: 1.3em; }

.continued {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 11px;
  color: var(--ink-faint);
  text-align: right;
  margin-top: 12px;
}

/* Inline minimal artwork inside text */
.inline-art {
  width: 38%;
  float: right;
  margin: 8px 0 14px 18px;
  shape-outside: margin-box;
}

.inline-art--left {
  float: left;
  margin: 8px 18px 14px 0;
}

.inline-art img {
  display: block;
  width: 100%;
  height: auto;
  filter: brightness(0.97);
}

.inline-art .caption {
  font-size: 8.5px;
  margin-top: 6px;
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
}

/* Inline series — 3 minimal works side by side, above the text */
.inline-series {
  margin: 0 0 22px;
  width: 100%;
  break-inside: avoid;
}

.inline-series-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: stretch;
}

.inline-series-cell {
  background: rgba(0, 0, 0, 0.02);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04);
}

.inline-series-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inline-series .caption {
  font-size: 8.5px;
  margin-top: 8px;
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

/* === Plate (artwork page) === */

.plate-page {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
}

.plate-frame {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plate-frame img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  width: auto;
  height: auto;
  box-shadow:
    0 6px 22px rgba(40, 28, 12, 0.22),
    0 1px 0 rgba(0,0,0,0.04);
}

/* Caption page (right) */
.caption-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 70px 64px;
}

.caption-page .plate-num {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 64px;
  line-height: 1;
  color: var(--ink-line);
  margin-bottom: 30px;
  font-weight: 300;
}

.caption-page .artist {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.caption-page .work-title {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 30px;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 20px;
}

.caption-page .work-meta {
  font-family: var(--serif-text);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.caption-page .work-meta div + div { margin-top: 2px; }

.caption-page .work-quote {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 0.5px solid var(--ink-line);
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* === Section divider === */

.section-divider {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  text-align: center;
}

.section-divider .roman {
  font-family: var(--serif-display);
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--ink-faint);
  margin-bottom: 38px;
}

.section-divider .section-title {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 50px;
  font-weight: 300;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 14px;
}

.section-divider .section-sub {
  font-family: var(--serif-display);
  font-size: 14px;
  font-style: italic;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  max-width: 380px;
}

/* === Index === */

.index-list {
  flex: 1;
  font-family: var(--serif-text);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

.index-item {
  display: flex;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 0.5px dotted var(--ink-line);
}

.index-num {
  font-family: var(--sans);
  font-size: 8.5px;
  width: 22px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
}

.index-meta {
  flex: 1;
}

.index-title-row {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 11px;
  color: var(--ink);
}

.index-detail {
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.index-page-num {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin-left: 12px;
}

.index-artist-header {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 14px 0 6px;
  border-bottom: 0.5px solid var(--ink);
}

.index-artist-header:first-child { padding-top: 0; }

/* === Bio mostre list === */

.exhibitions-list {
  flex: 1;
  font-family: var(--serif-text);
  font-size: 10px;
  line-height: 1.55;
  color: var(--ink);
  columns: 1;
}

.exhibitions-list .ex-item {
  padding: 3px 0;
  display: grid;
  grid-template-columns: 50px 1fr;
  column-gap: 14px;
  align-items: start;
}

.exhibitions-list .ex-year {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent);
  padding-top: 1px;
}

.exhibitions-list .ex-text {
  flex: 1;
  font-style: italic;
  font-family: var(--serif-display);
  font-size: 12px;
  color: var(--ink);
}

.exhibitions-list .ex-text-roman {
  font-style: normal;
  font-family: var(--serif-text);
  font-size: 10px;
  color: var(--ink-soft);
}

/* === End page === */

.endpage {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 70px 60px;
  text-align: center;
  align-items: center;
}

.endpage .gallery-mark {
  width: 44px;
  height: auto;
  opacity: 0.88;
  flex-shrink: 0;
}

.endpage .quote {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink);
  font-weight: 300;
  margin: auto 0;
  max-width: 420px;
  align-self: center;
}

.endpage .credit {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* === Editorial colophon (closing) === */
.editorial-colophon {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px 56px;
  font-family: var(--serif-display);
  color: var(--ink);
}

.editorial-colophon .ec-logo {
  margin-bottom: 22px;
}

.editorial-colophon .ec-logo img {
  display: block;
  width: 48px;
  height: auto;
  opacity: 0.92;
}

.editorial-colophon .ec-intro {
  font-size: 12.5px;
  line-height: 1.9;
  font-style: italic;
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 22px;
  max-width: 460px;
  position: relative;
  z-index: 1;
}

.editorial-colophon .ec-intro em {
  font-style: italic;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.editorial-colophon .ec-names {
  font-style: normal;
  font-family: var(--serif-display);
  font-weight: 500;
  letter-spacing: 0.12em;
  font-size: 11.5px;
  color: var(--ink);
}

.editorial-colophon .ec-copies {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 12.5px;
  font-weight: 300;
  color: var(--ink);
  margin: 18px 0;
  letter-spacing: 0.01em;
}

.editorial-colophon .ec-rule {
  width: 28px;
  border-top: 0.5px solid var(--ink);
  margin: 14px 0;
}

.editorial-colophon .ec-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 10px 0;
}

.editorial-colophon .ec-row {
  text-align: center;
}

.editorial-colophon .ec-label {
  font-family: var(--sans);
  font-size: 8.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 5px;
  line-height: 1.5;
  white-space: nowrap;
}

.editorial-colophon .ec-value {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.editorial-colophon .ec-copy-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}

.editorial-colophon .ec-copy-line > span:first-child {
  white-space: nowrap;
}

.editorial-colophon .ec-copy-blank {
  display: inline-block;
  width: 110px;
  border-bottom: 0.5px solid var(--ink-soft);
  height: 1px;
  position: relative;
  top: -3px;
}

/* Back cover */
.back-cover {
  background: #1d1916;
  color: #efe6d2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 50px;
  height: 100%;
  position: relative;
}

.back-cover * { color: inherit; }

.back-cover .gallery-mark {
  width: 38px;
  height: auto;
  filter: invert(1) brightness(1.15);
  opacity: 0.92;
}

.gallery-mark--inverted {
  filter: invert(1) brightness(1.15);
}

.back-cover .blurb {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 300;
  max-width: 420px;
  color: #efe6d2;
}

.back-cover .footer {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(239,230,210,0.6);
  display: flex;
  justify-content: space-between;
  border-top: 0.5px solid rgba(239,230,210,0.2);
  padding-top: 14px;
}

/* === Navigation === */

.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 0.5px solid rgba(255,255,255,0.18);
  color: #d4c69e;
  font-family: var(--serif-display);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.nav-arrow:hover {
  background: rgba(255,255,255,0.12);
  color: #f0e3b8;
  border-color: rgba(255,255,255,0.3);
}

.nav-arrow:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.nav-arrow--prev { left: 32px; }
.nav-arrow--next { right: 32px; }

/* Top bar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  z-index: 50;
  pointer-events: none;
}

.topbar > * { pointer-events: auto; }

.topbar-brand {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(239,230,210,0.55);
}

.lang-switch {
  display: flex;
  gap: 0;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 3px;
  backdrop-filter: blur(8px);
}

.lang-switch button {
  background: transparent;
  border: 0;
  color: rgba(239,230,210,0.55);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.22em;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 999px;
  text-transform: uppercase;
  transition: all 0.2s;
}

.lang-switch button.active {
  background: rgba(239,230,210,0.92);
  color: #1c1814;
}

.lang-switch button:hover:not(.active) {
  color: #efe6d2;
}

/* Bottom progress / spread counter */
.spread-counter {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(239,230,210,0.45);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
}

.spread-counter .progress-bar {
  width: 140px;
  height: 1px;
  background: rgba(239,230,210,0.18);
  position: relative;
}

.spread-counter .progress-bar::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--p, 0%);
  background: rgba(239,230,210,0.7);
  transition: width 0.4s ease;
}

/* Page flip animation */
@keyframes flipIn {
  from { opacity: 0; transform: translateX(8px) scale(0.998); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
.book.flipping {
  animation: flipIn 0.45s ease-out;
}

/* Subtle responsive scale */
@media (max-width: 1280px) {
  .book { transform: scale(0.92); }
}
@media (max-width: 1180px) {
  .book { transform: scale(0.84); }
}
@media (max-width: 1080px) {
  .book { transform: scale(0.74); }
}
@media (max-width: 980px) {
  .book { transform: scale(0.64); }
}
@media (max-width: 800px) {
  .book { transform: scale(0.5); }
}

/* Tweaks panel overrides paper variants */
body[data-paper="white"] {
  --paper: #f5efe2;
  --paper-warm: #ece4d2;
  --paper-deep: #ddd2b8;
}
body[data-paper="snow"] {
  --paper: #f8f5ed;
  --paper-warm: #f1ecde;
  --paper-deep: #e3d9c3;
}
body[data-paper="warm"] {
  --paper: #efe6d2;
  --paper-warm: #e9dfc7;
  --paper-deep: #e0d4b8;
}

/* Hidden helper for screen-reader / placeholder photo */
.placeholder-photo {
  background:
    repeating-linear-gradient(135deg, var(--paper-deep) 0 8px, var(--paper-warm) 8px 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  border: 0.5px solid var(--ink-line);
}

/* === Rotate hint (mobile portrait only) === */
.rotate-hint { display: none; }

@media (orientation: portrait) and (max-width: 820px) {
  body > *:not(.rotate-hint) { display: none !important; }
  body { overflow: hidden; }

  .rotate-hint {
    display: flex !important;
    position: fixed;
    inset: 0;
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 40px 32px;
    text-align: center;
    background:
      radial-gradient(ellipse at 50% 30%, rgba(196, 168, 117, 0.06) 0%, transparent 60%),
      linear-gradient(180deg, #1d1916 0%, #221d18 100%);
  }

  .rotate-hint .eyebrow {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: rgba(196, 168, 117, 0.6);
    margin: 0;
  }

  .rotate-hint .icon {
    width: 88px;
    height: 88px;
    color: #c4a875;
    margin: 8px 0 4px;
  }

  .rotate-hint .icon .phone {
    transform-origin: 40px 30px;
    animation: rotate-phone 3.4s cubic-bezier(0.6, 0, 0.4, 1) infinite;
  }

  .rotate-hint .icon .phone-bar {
    transform-origin: 40px 46px;
    animation: rotate-phone-bar 3.4s cubic-bezier(0.6, 0, 0.4, 1) infinite;
  }

  .rotate-hint .icon .arc,
  .rotate-hint .icon .arc-tip {
    animation: arc-fade 3.4s ease-in-out infinite;
  }

  .rotate-hint h1 {
    font-family: var(--serif-display);
    font-style: italic;
    font-weight: 300;
    font-size: 38px;
    line-height: 1.05;
    margin: 0;
    color: #e6d8b8;
    letter-spacing: -0.005em;
  }

  .rotate-hint p {
    font-family: var(--serif);
    font-size: 16.5px;
    line-height: 1.55;
    color: #c4a875;
    margin: 0;
    max-width: 320px;
    text-wrap: balance;
  }

  .rotate-hint .back {
    margin-top: 20px;
    font-family: var(--sans);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: #c4a875;
    padding: 14px 26px;
    border: 0.5px solid rgba(196, 168, 117, 0.45);
    text-decoration: none;
    transition: all 0.3s ease;
  }

  .rotate-hint .back:active,
  .rotate-hint .back:hover {
    background: rgba(196, 168, 117, 0.08);
    border-color: rgba(196, 168, 117, 0.7);
    color: #e6d8b8;
  }
}

@keyframes rotate-phone {
  0%, 24% { transform: rotate(0); }
  44%, 76% { transform: rotate(-90deg); }
  96%, 100% { transform: rotate(0); }
}

@keyframes rotate-phone-bar {
  0%, 24% { transform: rotate(0); }
  44%, 76% { transform: rotate(-90deg); }
  96%, 100% { transform: rotate(0); }
}

@keyframes arc-fade {
  0%, 18% { opacity: 0; }
  28%, 40% { opacity: 0.9; }
  60%, 100% { opacity: 0; }
}

/* === Landscape mobile fixes === */
@media (orientation: landscape) and (max-height: 520px) {
  .book { transform: scale(0.5); }

  .topbar { padding: 8px 12px; }
  .topbar-brand { font-size: 8px; letter-spacing: 0.24em; }
  .lang-switch { padding: 2px; }
  .lang-switch button { padding: 4px 9px; font-size: 8px; letter-spacing: 0.18em; }

  .nav-arrow {
    width: 38px;
    height: 38px;
    font-size: 18px;
    backdrop-filter: blur(6px);
  }
  .nav-arrow--prev { left: 6px; }
  .nav-arrow--next { right: 6px; }

  .spread-counter {
    bottom: 10px;
    font-size: 8px;
    letter-spacing: 0.24em;
    gap: 10px;
  }
  .spread-counter .progress-bar { width: 80px; }
}
