/* Chez Enzo — a table is set for every chapter.
   Geometry stays visible without JavaScript; motion.js supplies the motion. */

.chapter-intro {
  --chapter-bg: var(--cream);
  --chapter-ink: var(--ink);
  --chapter-accent: var(--red);
  --chapter-halo-color: var(--gold);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: clamp(390px, 66svh, 620px);
  margin: 0 auto 42px;
  padding: 72px 32px 80px;
  color: var(--chapter-ink);
  background: var(--chapter-bg);
  text-align: center;
  overflow: hidden;
  overflow: clip;
}

/* A very soft reserve keeps an illustrated chapter readable at its centre. */
.chapter-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at center, var(--chapter-bg) 0, transparent 63%);
  opacity: .5;
  pointer-events: none;
}

/* The curtain is transient paper, never a static gate over the page. */
.chapter-shutters {
  position: absolute;
  inset: -1px;
  z-index: 3;
  opacity: 1;
  pointer-events: none;
  user-select: none;
}

.chapter-shutter {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.6%;
  background: var(--chapter-bg);
  opacity: 0;
  backface-visibility: hidden;
  pointer-events: none;
}

.chapter-shutter-left {
  left: 0;
  border-right: 1px solid #d8b45d80;
  box-shadow: 9px 0 26px #253e6a0a;
  transform-origin: 0 50%;
}

.chapter-shutter-right {
  right: 0;
  border-left: 1px solid #d8b45d80;
  box-shadow: -9px 0 26px #253e6a0a;
  transform-origin: 100% 50%;
}

.chapter-shutter::after {
  content: "";
  position: absolute;
  top: 14%;
  bottom: 14%;
  width: 1px;
  background: #d8b45d35;
}

.chapter-shutter-left::after {
  right: 9px;
}

.chapter-shutter-right::after {
  left: 9px;
}

/* Quiet, flat pigment behind the drawn objects adds depth without glare. */
.chapter-halo {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: min(560px, 68%);
  height: min(430px, 74%);
  border-radius: 50%;
  background: var(--chapter-halo-color);
  margin: auto;
  opacity: .13;
  transform-origin: center;
  pointer-events: none;
  user-select: none;
}

.chapter-folio {
  position: absolute;
  z-index: 2;
  top: 29px;
  left: 32px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .13em;
  color: var(--chapter-ink);
  opacity: .65;
  pointer-events: none;
}

.chapter-folio::after {
  content: "";
  display: block;
  width: 30px;
  height: 1px;
  margin-top: 12px;
  background: currentColor;
  opacity: .45;
}

.chapter-corner-note {
  position: absolute;
  z-index: 2;
  right: 33px;
  bottom: 29px;
  max-width: 185px;
  margin: 0;
  font-family: var(--script);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.02em;
  text-align: right;
  color: var(--chapter-accent);
  transform: rotate(-5deg);
  pointer-events: none;
}

.chapter-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  color: var(--chapter-ink);
  pointer-events: none;
  user-select: none;
}

.chapter-art > svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: visible;
}

.chapter-art [data-chapter-object] {
  transform-box: fill-box;
  transform-origin: center;
}

.chapter-category-number text {
  font-family: var(--serif);
  font-size: 172px;
  font-weight: 500;
  letter-spacing: -.07em;
  fill: var(--ink);
  opacity: .12;
}

.chapter-address-number text {
  font-family: var(--serif);
  font-size: 330px;
  font-weight: 500;
  letter-spacing: -.09em;
  fill: var(--gold);
  opacity: .13;
}

.chapter-art [data-chapter-line],
.chapter-rule path,
.chapter-underline path {
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chapter-kicker,
.chapter-title,
.chapter-note,
.chapter-rule,
.chapter-underline,
.chapter-extra {
  position: relative;
  z-index: 2;
}

.chapter-kicker {
  max-width: 600px;
  margin: 0 0 27px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.65;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--chapter-accent);
}

.chapter-intro .chapter-title {
  max-width: 980px;
  margin: 0;
  padding: 0 .035em;
  font-family: var(--serif);
  font-size: clamp(92px, 9.3vw, 128px);
  font-weight: 500;
  line-height: .99;
  letter-spacing: -.06em;
  color: inherit;
  text-align: center;
  text-wrap: balance;
}

.chapter-title em {
  font-weight: inherit;
  color: var(--chapter-accent);
}

.chapter-title .word {
  padding-bottom: .18em;
  margin-bottom: -.18em;
}

.chapter-note {
  max-width: 590px;
  margin: 23px 0 0;
  font-family: var(--script);
  font-size: 29px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.015em;
  color: var(--chapter-accent);
  text-wrap: balance;
  transform: rotate(-2deg);
}

.chapter-rule,
.chapter-underline {
  display: block;
  flex-shrink: 0;
  width: min(310px, 62%);
  height: 14px;
  margin: 24px auto 0;
  overflow: visible;
  color: var(--gold);
}

.chapter-extra {
  max-width: 550px;
  margin: 24px auto 0;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
}

/* Each backdrop belongs to the material of its section. */
.chapter-intro[data-chapter="menu"] {
  --chapter-bg: var(--cream);
}

.chapter-intro[data-chapter="formulas"],
.chapter-intro[data-chapter="moments"] {
  --chapter-bg: var(--paper);
}

.chapter-intro[data-chapter="pizza"] {
  --chapter-bg: var(--cream);
  --chapter-accent: #a84f38;
  --chapter-halo-color: var(--red);
}

.chapter-intro[data-chapter="house"] {
  --chapter-bg: #eee5d3;
}

.chapter-intro[data-chapter="menu"] .chapter-art {
  opacity: .92;
}

.chapter-intro[data-chapter="formulas"] .chapter-art,
.chapter-intro[data-chapter="pizza"] .chapter-art {
  opacity: .93;
}

.chapter-intro[data-chapter="house"] .chapter-art {
  opacity: .9;
}

.chapter-intro[data-chapter="moments"] .chapter-art {
  opacity: .91;
}

.chapter-intro[data-chapter="formulas"] .chapter-halo {
  width: min(590px, 71%);
  height: min(440px, 73%);
  background: var(--ink);
  opacity: .055;
}

.chapter-intro[data-chapter="pizza"] .chapter-halo {
  width: min(520px, 67%);
  height: min(520px, 83%);
  opacity: .065;
}

.chapter-intro[data-chapter="house"] .chapter-halo {
  width: min(460px, 63%);
  height: min(520px, 86%);
  border-radius: 230px 230px 9px 9px;
  opacity: .14;
}

.chapter-intro[data-chapter="moments"] .chapter-halo {
  width: min(580px, 72%);
  height: min(370px, 66%);
  border-radius: 12px;
  background: var(--ink);
  opacity: .045;
}

/* The last chapter is an address card, with the street number as its mark. */
.chapter-intro[data-chapter="visit"],
.chapter-visit {
  --chapter-bg: var(--ink);
  --chapter-ink: var(--cream);
  --chapter-accent: var(--gold);
  min-height: clamp(400px, 65svh, 620px);
  margin-bottom: 55px;
  border-radius: 4px;
}

.chapter-intro[data-chapter="visit"]::before,
.chapter-visit::before {
  opacity: .46;
}

.chapter-intro[data-chapter="visit"] .chapter-art,
.chapter-visit .chapter-art {
  opacity: .88;
}

.chapter-intro[data-chapter="visit"] .chapter-halo,
.chapter-visit .chapter-halo {
  width: min(600px, 77%);
  height: min(460px, 78%);
  background: var(--gold);
  opacity: .095;
}

.chapter-intro[data-chapter="visit"] .chapter-extra,
.chapter-visit .chapter-extra {
  color: #f8f2e4b8;
}

/* Menu categories are a second, shorter rhythm inside the longer house menu. */
.chapter-intro.chapter-category {
  --chapter-bg: var(--paper);
  min-height: clamp(380px, 50svh, 450px);
  margin: 0;
  padding: 54px 22px 64px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.chapter-category .chapter-kicker {
  margin-bottom: 17px;
  font-size: 9px;
  letter-spacing: .15em;
}

.chapter-intro.chapter-category .chapter-title {
  max-width: 750px;
  font-size: clamp(42px, 5.3vw, 60px);
  letter-spacing: -.05em;
  line-height: 1.04;
}

.chapter-category .chapter-note {
  margin-top: 15px;
  font-size: 24px;
}

.chapter-category .chapter-art {
  opacity: .87;
}

.chapter-category .chapter-halo {
  width: min(390px, 58%);
  height: min(300px, 72%);
  opacity: .1;
}

#menu-cuisine .chapter-halo {
  background: var(--ink);
  opacity: .055;
}

#menu-formules .chapter-halo {
  background: var(--red);
  opacity: .055;
}

.chapter-category .chapter-folio {
  top: 23px;
  left: 23px;
  font-size: 10px;
}

.chapter-category .chapter-corner-note {
  right: 24px;
  bottom: 23px;
  font-size: 25px;
}

.chapter-category .chapter-rule,
.chapter-category .chapter-underline {
  width: 180px;
  max-width: 48%;
  height: 10px;
  margin-top: 17px;
}

/* The initial seal is part of the page, never a loading screen. */
.hero.enzo-hero {
  padding-top: 138px;
}

.hero-table-emblem {
  position: absolute;
  z-index: 2;
  top: 25px;
  left: 50%;
  display: block;
  width: 84px;
  height: 84px;
  overflow: visible;
  color: var(--gold);
  transform: translateX(-50%);
  pointer-events: none;
}

.hero-table-emblem :is(path, circle, ellipse) {
  vector-effect: non-scaling-stroke;
}

.hero-emblem-letter {
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -.07em;
  fill: var(--ink);
}

.hero-emblem-letter tspan {
  fill: var(--red);
}

.hero-table-sweep {
  position: absolute;
  z-index: 0;
  top: 172px;
  left: 50%;
  width: min(1240px, 104vw);
  height: 380px;
  color: var(--gold);
  opacity: .7;
  overflow: visible;
  transform: translateX(-50%) rotate(-7deg);
  pointer-events: none;
}

.hero-table-sweep :is(path, circle, ellipse) {
  vector-effect: non-scaling-stroke;
}

.hero.enzo-hero > .table-lines {
  opacity: .12;
}

.hero.enzo-hero .hero-title {
  perspective: 1100px;
}

.hero.enzo-hero .hero-letter > .letter-inner {
  transform-origin: 50% 90%;
}

/* The opening table: illustrated food at its edges, a clear centre for Enzo. */
.hero-feast {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  overflow: clip;
  pointer-events: none;
  user-select: none;
}

.hero.enzo-hero .hero-copy,
.hero.enzo-hero .hero-chapter {
  z-index: 2;
}

.feast-item {
  --feast-tilt: 0deg;
  --feast-distance: 95px;
  position: absolute;
  display: block;
  aspect-ratio: 1;
  transform: rotate(var(--feast-tilt));
  transform-origin: center;
  pointer-events: none;
}

.feast-float,
.feast-float > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-origin: center;
}

.feast-pizza-one {
  --feast-tilt: -17deg;
  --feast-distance: 145px;
  top: 67px;
  left: -35px;
  width: clamp(210px, 18vw, 260px);
}

.feast-pasta-one {
  --feast-tilt: 16deg;
  --feast-distance: 130px;
  top: 176px;
  right: 10px;
  width: clamp(150px, 13vw, 185px);
}

.feast-olive-one {
  --feast-tilt: -27deg;
  --feast-distance: 105px;
  top: 27px;
  left: 15%;
  width: clamp(135px, 12vw, 175px);
}

.feast-basil-one {
  --feast-tilt: 20deg;
  --feast-distance: 110px;
  top: 27px;
  right: 15%;
  width: clamp(135px, 12vw, 170px);
}

.feast-tomato-one {
  --feast-tilt: -13deg;
  --feast-distance: 105px;
  top: 366px;
  left: 3.5%;
  width: clamp(110px, 10vw, 145px);
}

.feast-lemon-one {
  --feast-tilt: 22deg;
  --feast-distance: 110px;
  top: 405px;
  right: 5%;
  width: clamp(105px, 9vw, 130px);
}

.feast-pasta-two {
  --feast-tilt: 25deg;
  --feast-distance: 125px;
  top: 590px;
  left: -15px;
  width: clamp(115px, 10vw, 145px);
}

.feast-olive-two {
  --feast-tilt: -35deg;
  --feast-distance: 120px;
  top: 565px;
  right: -30px;
  width: clamp(145px, 13vw, 185px);
}

.feast-basil-two {
  --feast-tilt: -16deg;
  --feast-distance: 100px;
  bottom: 110px;
  left: 11%;
  width: clamp(115px, 10vw, 145px);
}

.feast-pizza-two {
  --feast-tilt: 24deg;
  --feast-distance: 140px;
  right: 3%;
  bottom: 41px;
  width: clamp(145px, 12vw, 175px);
}

/* Prepared before first paint; JavaScript releases each surface as it plays.
   With no script, no preparation classes exist and every surface stays visible.
   The reduced-motion class also immediately returns the static composition. */
html.motion-pending:not(.reduced-motion) :is(.split-title, .reveal),
html.motion-pending:not(.reduced-motion) .chapter-intro :is(.chapter-kicker, .chapter-title, .chapter-note, .chapter-rule, .chapter-underline, .chapter-folio, .chapter-corner-note, .chapter-art, .chapter-halo),
html.motion-armed:not(.reduced-motion) .chapter-intro:not(.chapter-has-played) :is(.chapter-kicker, .chapter-title, .chapter-note, .chapter-rule, .chapter-underline, .chapter-folio, .chapter-corner-note, .chapter-art, .chapter-halo),
html.motion-pending:not(.reduced-motion) .reveal-waiting,
html.motion-armed:not(.reduced-motion) .reveal-waiting {
  opacity: 0;
}

html.motion-pending:not(.reduced-motion) .hero :is(.hero-copy, .hero-feast, .hero-table-emblem, .hero-table-sweep),
html.motion-armed:not(.reduced-motion) .hero:not(.hero-has-played) :is(.hero-copy, .hero-feast, .hero-table-emblem, .hero-table-sweep) {
  opacity: 0;
}

@media (max-width: 1050px) {
  .chapter-intro {
    min-height: clamp(380px, 63svh, 570px);
    padding-inline: 25px;
  }

  .chapter-intro .chapter-title {
    font-size: clamp(76px, 9.2vw, 98px);
  }

  .chapter-note {
    font-size: 27px;
  }

  .hero-table-sweep {
    top: 167px;
    height: 325px;
  }

  .feast-pizza-one {
    width: 180px;
    left: -50px;
    top: 52px;
  }

  .feast-pasta-one {
    width: 145px;
    right: -35px;
  }

  .feast-olive-one,
  .feast-basil-one {
    width: 135px;
    top: 25px;
  }

  .feast-tomato-one {
    width: 104px;
    left: -34px;
    top: 385px;
  }

  .feast-lemon-one {
    width: 94px;
    right: -27px;
  }

  .feast-pasta-two {
    width: 110px;
    left: -55px;
  }

  .feast-olive-two {
    width: 125px;
    right: -65px;
  }

  .feast-basil-two {
    width: 100px;
    left: 4%;
  }

  .feast-pizza-two {
    width: 140px;
    right: -40px;
  }
}

@media (max-width: 700px) {
  .chapter-intro {
    min-height: clamp(380px, 62svh, 470px);
    margin-bottom: 28px;
    padding: 58px 14px 72px;
  }

  .chapter-art {
    left: -12%;
    right: -12%;
  }

  .chapter-art > svg {
    width: 100%;
    height: 100%;
  }

  .chapter-intro::before {
    background: radial-gradient(ellipse at center, var(--chapter-bg) 0, transparent 72%);
    opacity: .58;
  }

  .chapter-halo {
    width: min(270px, 79%);
    height: min(260px, 70%);
  }

  .chapter-intro[data-chapter="formulas"] .chapter-halo,
  .chapter-intro[data-chapter="pizza"] .chapter-halo,
  .chapter-intro[data-chapter="house"] .chapter-halo,
  .chapter-intro[data-chapter="moments"] .chapter-halo,
  .chapter-intro[data-chapter="visit"] .chapter-halo,
  .chapter-visit .chapter-halo {
    width: min(290px, 82%);
    height: min(290px, 73%);
  }

  .chapter-intro[data-chapter="house"] .chapter-halo {
    width: min(250px, 76%);
    border-radius: 145px 145px 5px 5px;
  }

  .chapter-intro[data-chapter="moments"] .chapter-halo {
    height: min(220px, 58%);
  }

  .chapter-folio,
  .chapter-category .chapter-folio {
    top: 20px;
    left: 20px;
    font-size: 9px;
    letter-spacing: .1em;
  }

  .chapter-folio::after {
    width: 23px;
    margin-top: 9px;
  }

  .chapter-corner-note,
  .chapter-category .chapter-corner-note {
    right: 20px;
    bottom: 20px;
    max-width: 145px;
    font-size: 19px;
    line-height: 1.05;
  }

  .chapter-kicker {
    max-width: 275px;
    margin-bottom: 23px;
    font-size: 9px;
    letter-spacing: .13em;
  }

  .chapter-intro .chapter-title {
    max-width: 100%;
    font-size: clamp(64px, 15vw, 78px);
    line-height: 1.02;
    letter-spacing: -.06em;
  }

  .chapter-note {
    max-width: 280px;
    margin-top: 20px;
    font-size: 25px;
    line-height: 1.15;
  }

  .chapter-rule,
  .chapter-underline {
    width: 210px;
    max-width: 64%;
    height: 12px;
    margin-top: 20px;
  }

  .chapter-extra {
    max-width: 270px;
    margin-top: 19px;
    font-size: 11px;
    line-height: 1.9;
  }

  .chapter-intro[data-chapter="visit"],
  .chapter-visit {
    min-height: 400px;
    margin-bottom: 38px;
    padding-inline: 18px;
  }

  .chapter-intro.chapter-category {
    min-height: 350px;
    padding: 49px 15px 63px;
    margin: 0;
  }

  .chapter-category .chapter-art {
    left: 0;
    right: 0;
    opacity: .8;
  }

  .chapter-category .chapter-halo {
    width: min(220px, 82%);
    height: min(230px, 70%);
  }

  .chapter-category .chapter-kicker {
    font-size: 8px;
    margin-bottom: 16px;
  }

  .chapter-intro.chapter-category .chapter-title {
    max-width: 100%;
    font-size: clamp(34px, 10vw, 54px);
    line-height: 1.06;
  }

  .chapter-category .chapter-note {
    max-width: 240px;
    margin-top: 15px;
    font-size: 22px;
  }

  .chapter-category .chapter-rule,
  .chapter-category .chapter-underline {
    width: 150px;
    max-width: 48%;
    margin-top: 15px;
  }

  .hero.enzo-hero {
    padding-top: 152px;
  }

  .hero-table-emblem {
    top: 20px;
    width: 70px;
    height: 70px;
  }

  .hero-table-sweep {
    top: 200px;
    width: 122vw;
    height: 215px;
    opacity: .6;
    transform: translateX(-50%) rotate(-9deg);
  }

  .feast-pasta-two,
  .feast-olive-two,
  .feast-basil-two,
  .feast-pizza-two {
    display: none;
  }

  .feast-pizza-one {
    --feast-tilt: -19deg;
    --feast-distance: 85px;
    top: 15px;
    left: -26px;
    width: clamp(145px, 36vw, 180px);
  }

  .feast-pasta-one {
    --feast-tilt: 20deg;
    --feast-distance: 80px;
    top: 29px;
    right: -25px;
    width: clamp(120px, 31vw, 160px);
  }

  .feast-olive-one {
    --feast-tilt: -22deg;
    --feast-distance: 64px;
    top: 285px;
    left: -18px;
    width: clamp(66px, 20vw, 110px);
  }

  .feast-basil-one {
    --feast-tilt: 24deg;
    --feast-distance: 64px;
    top: 300px;
    right: -19px;
    width: clamp(66px, 20vw, 110px);
  }

  .feast-tomato-one {
    --feast-tilt: -11deg;
    --feast-distance: 68px;
    top: 425px;
    left: -16px;
    width: clamp(70px, 19vw, 102px);
  }

  .feast-lemon-one {
    --feast-tilt: 20deg;
    --feast-distance: 68px;
    top: 429px;
    right: -18px;
    width: clamp(66px, 18vw, 95px);
  }
}

@media (max-width: 360px) {
  .chapter-intro {
    padding-inline: 8px;
  }

  .chapter-intro .chapter-title {
    font-size: 60px;
  }

  .chapter-note {
    font-size: 23px;
    max-width: 255px;
  }

  .chapter-intro.chapter-category .chapter-title {
    font-size: 34px;
  }

  .hero-table-sweep {
    height: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chapter-art [data-chapter-object],
  .chapter-shutter,
  .chapter-halo,
  .feast-item,
  .feast-float,
  .hero-table-emblem,
  .hero-table-sweep {
    will-change: auto;
  }
}
