:root {
  --ink: #f3ece1;
  --ink-soft: #cfc6b8;
  --paper: #161311;
  --gold: #c6a36a;
  --gold-2: #d9c39a;
  --wine: #c6b08a;
  --cream: #f3ece1;
  --nero: #0d0b0a;
  --carbone: #16120f;
  --serif: "Cormorant Garamond", Palatino, serif;
  --body: "Source Serif 4", Georgia, serif;
  --caps: "Jost", "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
  height: 100%;
  background: var(--nero);
}

body {
  overflow: hidden;
  min-height: 100dvh;
  font-family: var(--body);
}

.stage {
  height: 100dvh;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) 40px;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(201, 162, 90, 0.09) 0%, transparent 48%),
    radial-gradient(ellipse at 50% 40%, #16120f 0%, #0d0b0a 72%);
}

.topbar,
.bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  font-family: var(--caps);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-brand img {
  width: 56px;
  height: 56px;
  display: block;
}

.topbar-brand span {
  font-size: 12px;
  letter-spacing: 0.26em;
}

.hint { display: none; }

.stage-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 0;
  padding: 8px 72px;
  position: relative;
}

.nav-btn {
  appearance: none;
  border: 1px solid var(--gold);
  background: rgba(13, 11, 10, 0.7);
  color: var(--gold-2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
}
#prev { left: 16px; }
#next { right: 16px; }

.nav-btn:hover { background: var(--gold); color: var(--nero); border-color: var(--gold); }
.nav-btn:disabled { opacity: 0.22; pointer-events: none; }

.book-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.book-glow {
  position: absolute;
  inset: 6% -4%;
  background: radial-gradient(ellipse at 50% 55%, rgba(201, 162, 90, 0.14), transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.book-thickness {
  position: absolute;
  top: 0;
  right: -10px;
  width: 11px;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(
    90deg,
    #2c2722 0 1px,
    #16120f 1px 2px,
    #0d0b0a 2px 3px
  );
  box-shadow: 3px 10px 18px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.book-wrap.is-spread .book-thickness,
.book-wrap.is-cover .book-thickness {
  opacity: 1;
}

.book-wrap.is-cover .book-thickness {
  right: 0;
}

.book-wrap.is-back .book-thickness {
  opacity: 1;
  right: auto;
  left: -10px;
  border-radius: 3px 0 0 3px;
}

.book-wrap.is-flipping .book-thickness {
  opacity: 0;
}

.book-wrap.is-portrait .book-thickness {
  opacity: 0;
}

#book {
  width: 100%;
  height: 100%;
}

#book:not(.stf__parent) {
  opacity: 0;
}

/* pages — designed for ~520×730 */
.page {
  height: 100%;
  overflow: hidden;
  position: relative;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("img/paper.jpg");
  background-blend-mode: multiply;
  background-size: 280px;
  user-select: none;
  -webkit-user-select: none;
}

.page a { user-select: auto; -webkit-user-select: auto; }

.page--paper::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(198, 163, 106, 0.32);
  pointer-events: none;
  z-index: 2;
}

.page--dark {
  color: var(--cream);
  background-color: #0c0b0a;
  background-image: none;
  background-blend-mode: normal;
}

.page--dark::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 28% at 50% -4%, rgba(255, 255, 255, 0.12), transparent 58%),
    linear-gradient(
      102deg,
      transparent 0%,
      transparent 40%,
      rgba(255, 255, 255, 0.03) 46%,
      rgba(255, 255, 255, 0.16) 50%,
      rgba(255, 255, 255, 0.03) 54%,
      transparent 62%
    );
  pointer-events: none;
}

.page.page--cover {
  background-color: #0c0b0a;
  background-image: none;
  background-size: auto;
}

.page.page--cover::after {
  background:
    radial-gradient(ellipse 80% 22% at 50% 0%, rgba(255, 255, 255, 0.1), transparent 60%),
    linear-gradient(
      104deg,
      transparent 0%,
      transparent 41%,
      rgba(255, 255, 255, 0.03) 47%,
      rgba(255, 255, 255, 0.14) 50%,
      rgba(255, 255, 255, 0.03) 53%,
      transparent 60%
    );
}

.page--cover::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(214, 190, 140, 0.55);
  box-shadow:
    inset 0 0 0 5px rgba(7, 6, 5, 0.35),
    inset 0 0 0 6px rgba(201, 162, 90, 0.38),
    inset 0 1px 0 rgba(255, 244, 214, 0.35);
  pointer-events: none;
  z-index: 2;
}

.page--photo {
  background-color: var(--nero);
  background-image: none;
  background-blend-mode: normal;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.page--photo[data-shot="tesoro"] { background-image: url("img/tesoro.jpg"); }
.page--photo[data-shot="bosco"] { background-image: url("img/bosco.jpg"); }
.page--photo[data-shot="giardino"] { background-image: url("img/giardino.jpg"); }
.page--photo[data-shot="nocciola"] { background-image: url("img/nocciola.jpg"); }
.page--photo[data-shot="sbrisola"] { background-image: url("img/sbrisola.jpg"); }
.page--photo[data-shot="tavola"] { background-image: url("img/tavola.jpg"); }
.page--photo[data-shot="peachmary"] { background-image: url("img/peachmary.jpg"); }
.page--photo[data-shot="sera"] { background-image: url("img/sera.jpg"); }
.page--photo[data-shot="lievitati"] { background-image: url("img/lievitati.jpg"); }
.page--photo[data-shot="botanica"] { background-image: url("img/botanica.jpg"); }
.page--photo[data-shot="dopo"] { background-image: url("img/dopo.jpg"); }
.page--photo[data-shot="regali"] { background-image: url("img/regali.jpg"); }
.page--photo[data-shot="cucina"] { background-image: url("img/cucina.jpg"); }
.page--photo[data-shot="pistacchio"] { background-image: url("img/pistacchio.jpg"); }
.page--photo[data-shot="viaggio"] { background-image: url("img/viaggio.jpg"); }
.page--photo[data-shot="miniatura"] { background-image: url("img/miniatura.jpg"); }

.inner {
  height: 100%;
  padding: 36px 40px 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.cover {
  height: 100%;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 11% 12% 9%;
}

.cover .kicker {
  position: relative;
  top: auto;
  margin-bottom: 18px;
}

.seal-plate {
  position: relative;
  left: auto;
  top: auto;
  width: 46%;
  aspect-ratio: 1;
  transform: none;
  margin: 0 0 22px;
}

.cover img.seal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 132.6%;
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%);
  display: block;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.45));
}

.cover-copy {
  position: relative;
  z-index: 2;
}

.kicker {
  font-family: var(--caps);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.cover h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 48px;
  line-height: 0.9;
  margin: 0 0 2px;
  background: linear-gradient(185deg, #fff8ea 0%, #f3d7a2 40%, #c9a25a 68%, #f7e6c0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.45));
}

.cover .year {
  font-family: var(--caps);
  letter-spacing: 0.4em;
  font-size: 11px;
  color: #f0ddb4;
  margin: 4px 0 0;
}

.ornament {
  width: 120px;
  height: 16px;
  margin: 2px auto 10px;
}

.cover .ornament {
  width: 96px;
  margin: 0 auto 2px;
}

.cover .sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: #f6ead2;
}

.cover .place {
  margin: 8px 0 0;
  font-family: var(--caps);
  font-size: 9px;
  letter-spacing: 0.32em;
  color: #f0ddb4;
  flex-shrink: 0;
}

.quote-page {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 48px 40px;
}

.quote-page blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 500;
  max-width: 16ch;
  color: #fbf6ec;
}

.quote-page .whisper {
  margin-top: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--gold-2);
}

.quote-page p {
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(251, 246, 236, 0.8);
  max-width: 32ch;
}

.running {
  display: flex;
  justify-content: space-between;
  font-family: var(--caps);
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  flex-shrink: 0;
}

h2.display {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 34px;
  line-height: 0.96;
  margin: 14px 0 10px;
  flex-shrink: 0;
}

h2.display em { font-style: italic; color: var(--wine); }

.lede {
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.lede + .lede { margin-top: 10px; }

.gold-rule {
  width: 42px;
  height: 1px;
  background: var(--gold);
  border: 0;
  margin: 10px 0 12px;
  flex-shrink: 0;
}

.index { list-style: none; flex: 1; }

.index li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid rgba(176, 122, 46, 0.3);
}

.index .nm {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
}

.index .dots {
  border-bottom: 1px dotted rgba(201, 162, 90, 0.4);
  height: 0.7em;
}

.index .pg {
  font-family: var(--caps);
  font-size: 9px;
  color: var(--gold);
}

.order-block h3 {
  font-family: var(--caps);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin: 12px 0 4px;
}

.order-block p {
  font-size: 13.5px;
  line-height: 1.42;
  color: var(--ink-soft);
}

.order-block a {
  color: var(--wine);
  text-decoration: none;
  border-bottom: 1px solid rgba(142, 42, 54, 0.4);
}

.photo-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background-color: transparent;
}

.shot-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 72px 28px 26px;
  background: linear-gradient(
    to top,
    rgba(8, 7, 6, 0.82) 0%,
    rgba(8, 7, 6, 0.28) 55%,
    transparent 100%
  );
  color: #fbf6ec;
  pointer-events: none;
}

.shot-name span {
  display: block;
  font-family: var(--caps);
  font-size: 8px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-2);
  margin-bottom: 6px;
}

.shot-name strong {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 40px;
  line-height: 0.92;
}

.epigraph {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--wine);
  margin-top: 14px;
  line-height: 1.2;
}

.facts--tight {
  margin-top: 12px;
}

.facts--tight li {
  padding: 7px 0;
}

.facts--tight strong {
  font-size: 15px;
}

.comp em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--wine);
}

.overlay-list {
  list-style: none;
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
  color: #fbf6ec;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

.overlay-list span {
  font-family: var(--caps);
  font-size: 8px;
  letter-spacing: 0.22em;
  color: var(--gold-2);
  margin-left: 8px;
}

.quote-over--top {
  justify-content: flex-start;
  padding-top: 32px;
  background: linear-gradient(
    to bottom,
    rgba(8, 7, 6, 0.86) 0%,
    rgba(8, 7, 6, 0.55) 38%,
    rgba(8, 7, 6, 0.42) 70%,
    rgba(8, 7, 6, 0.62) 100%
  );
}

.quote-over {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 36px 32px 44px;
  background: linear-gradient(
    to top,
    rgba(8, 7, 6, 0.88) 0%,
    rgba(8, 7, 6, 0.35) 42%,
    rgba(8, 7, 6, 0.08) 70%,
    transparent 100%
  );
  color: var(--cream);
}

.quote-over blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 500;
  max-width: 14ch;
  color: #fbf6ec;
}

.quote-over .whisper {
  margin-top: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--gold-2);
}

.quote-over .after {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(251, 246, 236, 0.86);
  max-width: 32ch;
}

.photo-cap {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  font-family: var(--caps);
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-2);
  text-shadow: 0 1px 8px #000;
}

.page--photo:has(.shot-name) .photo-cap { display: none; }

.who {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--wine);
  margin-top: 8px;
  line-height: 1.3;
}

.facts {
  list-style: none;
  margin-top: 6px;
  flex: 1;
}

.facts li {
  padding: 8px 0;
  border-top: 1px solid rgba(176, 122, 46, 0.3);
}

.facts strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
}

.facts p {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-soft);
}

.guide p {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 7px 0;
}

.guide em {
  font-style: italic;
  color: var(--wine);
}

.lede-tight {
  font-size: 13.5px;
  line-height: 1.42;
  color: var(--ink-soft);
}

.lede-tight + .lede-tight { margin-top: 9px; }

.spine-cap {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  font-family: var(--caps);
  font-size: 8px;
  letter-spacing: 0.32em;
  color: var(--gold-2);
  white-space: nowrap;
  z-index: 2;
  text-shadow: 0 1px 6px #000;
}

.set-kicker {
  font-family: var(--caps);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-top: 6px;
  flex-shrink: 0;
}

.set-title {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 38px;
  line-height: 0.92;
  margin: 4px 0 0;
  flex-shrink: 0;
}

.set-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--wine);
  margin: 2px 0 8px;
  flex-shrink: 0;
}

.set-copy {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.comp { list-style: none; margin-top: 10px; }

.comp li {
  font-size: 12.5px;
  line-height: 1.3;
  padding: 6px 0;
  border-top: 1px solid rgba(176, 122, 46, 0.3);
}

.comp li:last-child { border-bottom: 1px solid rgba(176, 122, 46, 0.3); }

.price-block {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-shrink: 0;
}

.price-block .lbl {
  font-family: var(--caps);
  font-size: 8px;
  letter-spacing: 0.24em;
  color: var(--gold);
}

.price-block .val {
  font-family: var(--serif);
  font-size: 26px;
  font-style: italic;
  line-height: 1;
}

.cta {
  font-family: var(--caps);
  font-size: 8px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--nero);
  background: var(--gold);
  padding: 9px 12px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.cta:hover { background: var(--cream); color: var(--nero); }

.foot {
  margin-top: auto;
  padding-top: 12px;
  font-family: var(--caps);
  font-size: 8px;
  letter-spacing: 0.24em;
  color: var(--gold);
}

.back {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 40px;
  position: relative;
  z-index: 1;
}

.back img { width: 88px; margin-bottom: 16px; }

.back h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
}

.back .it {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold-2);
  margin: 6px 0 16px;
}

.back p {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(251, 246, 236, 0.84);
}

.back a { color: var(--gold-2); text-decoration: none; }

.back .buon {
  margin-top: 22px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--gold-2);
}

.stf__item {
  background-color: var(--paper);
}

.stf__parent {
  margin: 0 auto;
  background: transparent;
  overflow: visible;
  z-index: 2;
}

.stf__parent::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow:
    0 0 0 1px rgba(201, 162, 90, 0.16),
    0 28px 60px rgba(0, 0, 0, 0.55),
    0 10px 22px rgba(0, 0, 0, 0.38);
  pointer-events: none;
  z-index: -1;
}

.book-wrap.is-cover .stf__parent::after {
  left: 50%;
}

.book-wrap.is-back .stf__parent::after {
  right: 50%;
  left: 0;
  width: 50%;
}

.book-wrap.is-spread:not(.is-flipping) .stf__parent::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 40px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.18) 40%,
    rgba(0, 0, 0, 0.42) 50%,
    rgba(0, 0, 0, 0.18) 60%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
  z-index: 4;
}

.stf__item.--left .page--paper::after,
.stf__item.--right .page--paper::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.stf__item.--left .page--paper::after {
  background: linear-gradient(90deg, rgba(255, 244, 220, 0.08), transparent 22%, rgba(0, 0, 0, 0.16) 100%);
}

.stf__item.--right .page--paper::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 28%, rgba(255, 244, 220, 0.06) 100%);
}

@media (max-width: 1100px) {
  .nav-btn { display: none; }
  .stage-main { padding: 0 12px; }
}

@media (max-width: 820px) {
  .stage { grid-template-rows: 60px minmax(0, 1fr) 40px; }
  .topbar-brand img { width: 46px; height: 46px; }
  .topbar > span:last-child { display: none; }
  .stage-main { padding: 0 8px; }
  .set-title { font-size: 32px; }
  h2.display { font-size: 28px; }
  .inner { padding: 28px 26px 24px; }
  .bottombar {
    font-size: 8px;
    letter-spacing: 0.14em;
    padding: 0 12px;
    justify-content: center;
    gap: 20px;
  }
  .bottombar span:last-child { display: none; }
}
