:root {
  /* Font compliance note: DESIGN.md names IBM Plex Mono** from Google Fonts; implemented with system-safe fallbacks. */
  --cream: #FFF3D9;
  --strawberry: #F7A7B5;
  --pistachio: #B8D8A8;
  --porcelain: #9EC7D9;
  --ink: #3B271F;
  --apricot: #F2A35E;
  --lavender: #C9B7E8;
  --crust: #B87946;
  --display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  --body: "Nunito Sans", "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  background:
    radial-gradient(circle at 18% 12%, rgba(247,167,181,.36), transparent 28%),
    radial-gradient(circle at 78% 8%, rgba(158,199,217,.42), transparent 30%),
    linear-gradient(115deg, var(--cream), #ffeeca 58%, #fbe4bc);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .38;
  background-image:
    linear-gradient(rgba(59,39,31,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,39,31,.04) 1px, transparent 1px),
    radial-gradient(circle, rgba(59,39,31,.16) 1px, transparent 1.5px);
  background-size: 100% 34px, 34px 100%, 29px 29px;
  mix-blend-mode: multiply;
}

.sugar-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.sugar-speckle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,243,217,.94);
  box-shadow: 0 0 7px rgba(255,243,217,.9);
  animation: sugarShimmer 4.8s ease-in-out infinite;
}

.notebook-tabs {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
  display: grid;
  gap: 8px;
  transform: rotate(1deg);
}

.tab,
.brush-tab {
  border: 2px solid var(--ink);
  border-radius: 14px 4px 14px 4px;
  color: var(--ink);
  background: var(--cream);
  box-shadow: 5px 6px 0 rgba(184,121,70,.22);
  font-family: var(--hand);
  font-size: 17px;
  font-weight: 700;
  padding: 7px 13px;
  cursor: pointer;
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.tab:nth-child(2) { background: var(--pistachio); }
.tab:nth-child(3) { background: var(--lavender); }
.tab:nth-child(4) { background: var(--porcelain); }
.tab:nth-child(5) { background: var(--strawberry); }
.tab.active,
.tab:hover,
.brush-tab:hover { transform: translate(-5px, 2px) rotate(-2deg); box-shadow: 2px 3px 0 rgba(184,121,70,.32); }

.tabletop { position: relative; }

.scene {
  position: relative;
  min-height: 100vh;
  padding: 9vh 7vw;
  display: grid;
  isolation: isolate;
}

.depth-plane { transition: transform .16s linear; will-change: transform; }

.hero-scene { place-items: center; perspective: 900px; }
.proofing-scene { grid-template-columns: 1fr 1.1fr; align-items: center; gap: 3vw; }
.atlas-scene { grid-template-columns: 1fr 1fr; align-items: center; gap: 2vw; }
.window-scene { grid-template-columns: 1fr 1fr; align-items: center; }
.crumb-scene { place-items: center; }

.window-grid {
  position: absolute;
  inset: 8vh 6vw auto auto;
  width: 42vw;
  height: 52vh;
  border: 3px solid rgba(59,39,31,.18);
  border-radius: 30px;
  background:
    linear-gradient(90deg, transparent 32%, rgba(59,39,31,.16) 33%, transparent 34% 65%, rgba(59,39,31,.14) 66%, transparent 67%),
    linear-gradient(transparent 48%, rgba(59,39,31,.13) 49%, transparent 50%),
    rgba(158,199,217,.18);
  transform: rotate(-4deg);
  z-index: -1;
}

.placemat,
.recipe-card,
.paper-slip {
  border: 2px solid var(--ink);
  background: rgba(255,243,217,.92);
  box-shadow: 18px 22px 0 rgba(158,199,217,.32), 0 0 0 7px rgba(255,243,217,.35) inset;
}

.placemat {
  position: relative;
  width: min(840px, 78vw);
  padding: clamp(34px, 7vw, 82px);
  border-radius: 36px 24px 42px 20px;
  transform: rotate(-1.5deg);
  text-align: center;
}

.ledger-kicker,
.scene-label {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--crust);
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 600;
  line-height: .9;
  margin: 0;
  letter-spacing: -.045em;
}

h1 { font-size: clamp(68px, 13vw, 164px); font-style: italic; }
h2 { font-size: clamp(54px, 8vw, 108px); font-style: italic; }
h3 { margin: 0 0 14px; font-family: var(--hand); font-size: 30px; }

.hero-copy,
.recipe-card p:not(.scene-label) {
  max-width: 640px;
  margin: 18px auto 0;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.55;
}

.icing-underline {
  display: block;
  width: min(620px, 82%);
  height: auto;
  margin: -4px auto 0;
  overflow: visible;
}

.icing-underline path,
.cookie-constellation path {
  fill: none;
  stroke: var(--apricot);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  filter: drop-shadow(0 3px 0 rgba(184,121,70,.22));
}

.scene.in-view .icing-underline path,
.hero-scene .title-underline path { animation: drawIcing 1.6s cubic-bezier(.65,.02,.22,1) forwards; }

.brush-tab { margin-top: 24px; background: var(--strawberry); }

.paper-slip {
  position: absolute;
  padding: 16px 22px;
  border-radius: 8px;
  font-family: var(--hand);
  font-size: 24px;
  z-index: 4;
}

.menu-slip { top: 15vh; left: 10vw; transform: rotate(-8deg); background: rgba(184,216,168,.9); }
.lavender-slip { right: 9vw; top: 22vh; transform: rotate(8deg); background: rgba(201,183,232,.86); }
.ticket-number { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; }

.spoon {
  position: absolute;
  left: 12vw;
  bottom: 12vh;
  width: 280px;
  height: 52px;
  border: 3px solid var(--ink);
  border-left-width: 70px;
  border-radius: 50% 18px 18px 50%;
  background: rgba(158,199,217,.42);
  box-shadow: 18px 28px 0 rgba(201,183,232,.35);
  transform: rotate(-24deg);
}

.crumb-cluster { position: absolute; inset: 0; pointer-events: none; z-index: 10; transition: transform 1s ease, opacity 1s ease; }
.crumb-cluster.brushed { transform: translateX(28vw) rotate(16deg); opacity: .18; }
.crumb-cluster span,
.final-crumb {
  position: absolute;
  display: block;
  width: 12px;
  height: 10px;
  border-radius: 50% 45% 55% 40%;
  background: var(--crust);
}
.crumb-cluster span:nth-child(1) { left: 38%; top: 54%; }
.crumb-cluster span:nth-child(2) { left: 43%; top: 61%; width: 8px; }
.crumb-cluster span:nth-child(3) { left: 49%; top: 51%; background: var(--apricot); }
.crumb-cluster span:nth-child(4) { left: 55%; top: 58%; width: 7px; }
.crumb-cluster span:nth-child(5) { left: 61%; top: 50%; background: var(--strawberry); }
.crumb-cluster span:nth-child(6) { left: 52%; top: 68%; }
.crumb-cluster span:nth-child(7) { left: 36%; top: 67%; width: 6px; }

.bell-card { position: absolute; right: 11vw; bottom: 10vh; max-width: 330px; padding: 24px; transform: rotate(5deg); background: rgba(247,167,181,.88); }
.brass-bell { width: 74px; height: 58px; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 50% 50% 14px 14px; background: var(--apricot); font-size: 34px; box-shadow: 5px 7px 0 rgba(184,121,70,.28); }
.mono { font-family: var(--mono); color: var(--crust); }

.receipt-edge {
  position: absolute;
  top: 9vh;
  right: 8vw;
  padding: 12px 60px 12px 18px;
  font-family: var(--mono);
  background: repeating-linear-gradient(90deg, var(--cream) 0 18px, rgba(247,167,181,.22) 18px 24px);
  border: 2px dashed var(--crust);
  transform: rotate(4deg);
}

.proof-card { padding: 34px; max-width: 560px; transform: rotate(-3deg); background: rgba(255,243,217,.9); }
.proof-note { right: 13vw; bottom: 13vh; background: var(--lavender); transform: rotate(-7deg); }

.millefeuille {
  position: relative;
  min-height: 420px;
  transform: rotate(3deg);
}
.cake-layer {
  position: relative;
  width: min(520px, 42vw);
  margin: 10px auto;
  padding: 22px 30px;
  border: 3px solid var(--ink);
  border-radius: 20px 8px 22px 10px;
  font-family: var(--hand);
  font-size: 24px;
  box-shadow: 10px 12px 0 rgba(59,39,31,.1);
}
.crust { background: var(--crust); color: var(--cream); }
.cream { background: var(--cream); }
.berry { background: var(--strawberry); }
.pistachio { background: var(--pistachio); }
.jam { background: var(--apricot); }
.layer-label { position: absolute; font-family: var(--hand); font-size: 25px; background: var(--cream); border: 2px solid var(--ink); padding: 7px 14px; border-radius: 18px; }
.label-one { top: 30px; right: 0; transform: rotate(12deg); }
.label-two { top: 190px; left: -20px; transform: rotate(-9deg); }
.label-three { bottom: 20px; right: 34px; transform: rotate(7deg); }

.atlas-title { grid-column: 1 / 2; padding: 34px; max-width: 520px; transform: rotate(2deg); background: rgba(201,183,232,.84); }
.plate-chart {
  position: relative;
  width: min(420px, 70vw);
  aspect-ratio: 1;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: radial-gradient(circle, var(--cream) 0 31%, transparent 32%), conic-gradient(var(--strawberry) 0 28%, var(--pistachio) 28% 51%, var(--apricot) 51% 76%, var(--lavender) 76% 100%);
  box-shadow: 18px 23px 0 rgba(158,199,217,.32), inset 0 0 0 18px rgba(255,243,217,.5);
}
.tart-chart { justify-self: center; grid-column: 2; grid-row: 1 / span 2; transform: rotate(-6deg); }
.slice { position: absolute; inset: 16%; border: 2px dashed rgba(59,39,31,.38); border-radius: 50%; }
.chart-dot { position: absolute; top: 42%; left: 40%; font-family: var(--hand); font-size: 32px; }
.chart-note { position: absolute; right: -60px; bottom: 40px; font-family: var(--hand); font-size: 25px; background: var(--cream); border: 2px solid var(--ink); padding: 8px 12px; transform: rotate(8deg); }

.parfait-bars { width: 440px; padding: 24px; background: rgba(184,216,168,.86); transform: rotate(-2deg); }
.bar-row { display: grid; grid-template-columns: 88px 1fr; align-items: end; gap: 12px; height: 58px; margin: 8px 0; font-family: var(--mono); }
.bar-row i { display: block; width: var(--h); height: 28px; border: 2px solid var(--ink); border-radius: 6px 14px 14px 6px; background: repeating-linear-gradient(90deg, var(--strawberry), var(--strawberry) 12px, var(--cream) 12px, var(--cream) 18px); transform-origin: left center; animation: barAssemble 1.8s ease both; }

.cookie-constellation { position: absolute; left: 8vw; bottom: 7vh; width: min(520px, 52vw); height: auto; overflow: visible; }
.cookie-constellation path { stroke: var(--crust); stroke-width: 4; stroke-dasharray: 680; stroke-dashoffset: 680; }
.cookie-constellation circle { fill: var(--apricot); stroke: var(--ink); stroke-width: 3; }
.scene.in-view .cookie-constellation path { animation: drawIcing 1.7s ease forwards; }

.blue-shadow { position: absolute; inset: 10vh 8vw; background: linear-gradient(135deg, rgba(158,199,217,.52), rgba(255,243,217,.08)); border-radius: 44px; border: 2px solid rgba(59,39,31,.15); transform: rotate(-3deg); }
.window-card { max-width: 610px; padding: 36px; background: rgba(158,199,217,.86); transform: rotate(-2deg); z-index: 2; }
.teacup { justify-self: center; position: relative; width: 330px; height: 250px; }
.teacup::before { content: ""; position: absolute; left: 36px; bottom: 20px; width: 220px; height: 142px; border: 4px solid var(--ink); border-radius: 0 0 90px 90px; background: var(--cream); box-shadow: 18px 21px 0 rgba(201,183,232,.35); }
.teacup::after { content: ""; position: absolute; right: 24px; bottom: 66px; width: 78px; height: 64px; border: 4px solid var(--ink); border-left: 0; border-radius: 0 50% 50% 0; }
.tea-stain { position: absolute; left: 72px; bottom: 112px; width: 145px; height: 46px; border: 3px solid var(--ink); border-radius: 50%; background: conic-gradient(var(--crust) 0 58%, var(--apricot) 58% 82%, var(--cream) 82%); z-index: 1; }
.steam { position: absolute; bottom: 170px; width: 28px; height: 88px; border-left: 4px solid var(--ink); border-radius: 50%; animation: steamCurl 3.8s ease-in-out infinite; }
.steam-one { left: 84px; }
.steam-two { left: 145px; animation-delay: .6s; }
.steam-three { left: 205px; animation-delay: 1.1s; }
.customer-note { top: 20vh; right: 9vw; background: var(--strawberry); transform: rotate(10deg); }

.final-plate { width: min(560px, 72vw); background: radial-gradient(circle, var(--cream) 0 34%, transparent 35%), conic-gradient(from 28deg, var(--pistachio), var(--porcelain), var(--lavender), var(--strawberry), var(--apricot), var(--pistachio)); transform: rotate(4deg); }
.last-card { position: absolute; width: min(650px, 78vw); padding: 42px; background: rgba(255,243,217,.9); transform: rotate(-3deg); text-align: center; }
.stamp { display: inline-block; margin-top: 24px; padding: 10px 18px; border: 4px double var(--crust); color: var(--crust); font-family: var(--mono); text-transform: uppercase; letter-spacing: .15em; transform: rotate(-5deg); }
.closing-slip { left: 9vw; bottom: 12vh; background: var(--pistachio); transform: rotate(7deg); }
.c1 { left: 44%; top: 30%; }.c2 { left: 60%; top: 55%; background: var(--apricot); }.c3 { left: 35%; top: 64%; background: var(--strawberry); }.c4 { left: 52%; top: 42%; width: 7px; }

.recipe-card.reveal,
.paper-slip.reveal,
.plate-chart.reveal,
.millefeuille.reveal { animation: slipReveal .8s cubic-bezier(.2,.8,.2,1) both; }

@keyframes drawIcing { to { stroke-dashoffset: 0; } }
@keyframes sugarShimmer { 0%,100% { transform: translateY(0) scale(.75); opacity: .28; } 50% { transform: translateY(-9px) scale(1.15); opacity: .85; } }
@keyframes slipReveal { from { opacity: 0; translate: 0 26px; rotate: -4deg; } to { opacity: 1; translate: 0 0; } }
@keyframes barAssemble { from { transform: scaleX(.05); } to { transform: scaleX(1); } }
@keyframes steamCurl { 0%,100% { transform: translateY(0) skewX(-8deg); opacity: .32; } 50% { transform: translateY(-18px) skewX(10deg); opacity: .82; } }

@media (max-width: 820px) {
  .notebook-tabs { position: sticky; top: 0; right: auto; display: flex; overflow-x: auto; padding: 10px; background: rgba(255,243,217,.86); transform: none; }
  .scene { min-height: 100svh; padding: 12vh 5vw; display: block; }
  .placemat { width: 100%; }
  .bell-card, .paper-slip, .receipt-edge, .cookie-constellation, .last-card { position: relative; inset: auto; margin: 24px auto; }
  .spoon { opacity: .34; left: 5vw; }
  .millefeuille, .parfait-bars, .plate-chart, .window-card, .teacup { width: 100%; margin: 28px auto; }
  .cake-layer { width: 94%; }
  .chart-note { right: 0; }
}
