:root {
  --blue: #1649b8;
  --blue-deep: #082b79;
  --butter: #f7d65b;
  --paper: #fff8e9;
  --white: #fffdf8;
  --cocoa: #3b2018;
  --cinnamon: #a8472d;
  --pink: #f2a7b3;
  --ink: #17204a;
  --radius: 28px;
  --shadow: 0 24px 80px rgba(32, 22, 16, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--cocoa);
  font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 3vw;
  color: var(--white);
  mix-blend-mode: difference;
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.brand-mark {
  width: 25px;
  height: 25px;
  display: inline-block;
  border: 3px solid currentColor;
  border-radius: 50%;
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-left-color: transparent;
}
.site-header nav { display: flex; gap: 24px; }
.site-header nav a { text-decoration: none; font-size: 0.86rem; }
.sound-toggle {
  justify-self: end;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: default;
}

.kicker {
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 800;
}

.hero-story { height: 430vh; background: var(--blue-deep); }
.hero-sticky {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: hidden;
  background: var(--blue-deep);
  color: var(--white);
}
.hero-video,
.hero-fallback,
.finale-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-video { z-index: 2; opacity: 0; transition: opacity 0.45s ease; }
.hero-video.is-ready { opacity: 1; }
.hero-fallback {
  z-index: 1;
  background-image: var(--hero-image, url("assets/cinnamon-fallback.svg"));
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
}
.hero-shade {
  position: absolute;
  z-index: 3;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 15, 50, 0.84) 0%, rgba(4, 20, 62, 0.47) 38%, rgba(4, 20, 62, 0.06) 70%),
    linear-gradient(0deg, rgba(2, 13, 42, 0.5), transparent 40%);
}
.grain {
  position: absolute;
  z-index: 4;
  inset: -40%;
  opacity: 0.12;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  animation: grainShift 0.25s steps(2) infinite;
}
@keyframes grainShift { 0% { transform: translate(0,0); } 25% { transform: translate(3%,-2%); } 50% { transform: translate(-2%,2%); } 75% { transform: translate(2%,3%); } }

.hero-copy {
  position: absolute;
  z-index: 5;
  left: clamp(24px, 7vw, 110px);
  bottom: clamp(64px, 11vh, 130px);
  width: min(620px, 82vw);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.2,.75,.2,1);
  pointer-events: none;
}
.hero-copy.is-active { opacity: 1; transform: translateY(0); }
.hero-copy h1,
.hero-copy h2 {
  margin: 0 0 20px;
  font-size: clamp(3.4rem, 8vw, 8.6rem);
  line-height: 0.88;
  letter-spacing: -0.075em;
  max-width: 8ch;
}
.hero-copy h2 { font-size: clamp(2.7rem, 6.2vw, 6.6rem); max-width: 10ch; }
.hero-copy > p:last-child {
  margin: 0;
  max-width: 47ch;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.55;
}
.progress-rail {
  position: absolute;
  z-index: 6;
  right: 4vw;
  top: 20vh;
  bottom: 16vh;
  width: 2px;
  background: rgba(255,255,255,0.26);
}
.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0%;
  background: var(--butter);
}
.hero-progress-label {
  position: absolute;
  z-index: 6;
  right: 4vw;
  bottom: 10vh;
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;
}

.ingredient-stage {
  min-height: 1200px;
  padding: 130px 5vw 180px;
  background: var(--butter);
  position: relative;
  overflow: hidden;
}
.ingredient-stage::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border: 2px solid rgba(59,32,24,0.13);
  border-radius: 50%;
  left: -230px;
  top: 180px;
}
.section-intro { max-width: 820px; margin: 0 auto 100px; text-align: center; }
.section-intro h2,
.science-heading h2,
.timeline-copy h2,
.spiral-copy h2 {
  margin: 0 0 24px;
  font-size: clamp(3rem, 6vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}
.section-intro > p:last-child,
.timeline-copy > p:last-child,
.spiral-copy > p {
  font-size: 1.12rem;
  line-height: 1.65;
  max-width: 58ch;
  margin-left: auto;
  margin-right: auto;
}
.ingredient-orbit {
  width: min(880px, 92vw);
  aspect-ratio: 1;
  margin: 0 auto;
  position: relative;
  border: 1px dashed rgba(59,32,24,0.28);
  border-radius: 50%;
  transform: rotate(var(--orbit-rotation, 0deg));
}
.orbit-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(calc(-1 * var(--orbit-rotation, 0deg)));
  text-align: center;
  font-weight: 750;
}
.mini-loaf {
  width: 190px;
  height: 150px;
  margin-bottom: 20px;
  border-radius: 50% 50% 42% 42%;
  background: #d89954;
  box-shadow: inset 0 -20px 0 rgba(101,45,25,0.12), var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  transform: rotate(-5deg);
}
.mini-loaf span { width: 6px; height: 76px; background: rgba(110,53,26,0.22); border-radius: 999px; transform: rotate(9deg); }
.ingredient {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 215px;
  min-height: 205px;
  padding: 24px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(72,42,24,0.12);
  transform:
    translate(-50%, -50%)
    rotate(var(--angle))
    translateX(var(--distance))
    rotate(calc(-1 * var(--angle)))
    rotate(calc(-1 * var(--orbit-rotation, 0deg)));
  transition: transform 0.2s linear;
}
.ingredient h3 { margin: 14px 0 8px; font-size: 1.25rem; }
.ingredient p { margin: 0; font-size: 0.92rem; line-height: 1.5; }
.ingredient-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--cocoa);
  font-weight: 850;
}
.ingredient-cinnamon .ingredient-icon { background: var(--cinnamon); }
.ingredient-milk .ingredient-icon { background: var(--blue); }
.ingredient-butter .ingredient-icon { background: #dfaa16; }
.ingredient-yeast .ingredient-icon { background: #5c823c; }

.spiral-lab { height: 320vh; background: var(--blue); color: var(--white); }
.spiral-sticky {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(400px, 1.1fr);
  align-items: center;
  gap: 5vw;
  padding: 9vh 7vw 7vh;
  overflow: hidden;
}
.spiral-copy { max-width: 590px; }
.spiral-copy > p { margin-left: 0; }
.step-readout {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.35);
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 7px 20px;
}
.step-readout > span { grid-row: 1 / 3; color: var(--butter); font-size: 2.2rem; font-weight: 800; }
.step-readout strong { font-size: 1.3rem; }
.step-readout p { margin: 0; color: rgba(255,255,255,0.77); }
.spiral-visual { position: relative; width: min(620px, 50vw); justify-self: center; }
.spiral-visual svg { width: 100%; overflow: visible; transform: rotate(var(--spiral-rotation, -12deg)) scale(var(--spiral-scale, .9)); }
.dough-disc { fill: #efb96f; }
.cinnamon-path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cinnamon-under { stroke: rgba(68,25,14,0.18); stroke-width: 62; }
.cinnamon-draw { stroke: #7b2f1c; stroke-width: 38; stroke-dasharray: 1600; stroke-dashoffset: var(--spiral-offset, 1600); }
.spiral-core { fill: #7b2f1c; }
.flour-specks { position: absolute; inset: 8%; border-radius: 50%; background-image: radial-gradient(circle, rgba(255,255,255,.75) 0 1px, transparent 2px); background-size: 38px 44px; opacity: 0.28; transform: rotate(19deg); }

.science-section { padding: 140px 6vw; background: var(--paper); }
.science-heading { max-width: 900px; margin-bottom: 80px; }
.science-grid { display: grid; grid-template-columns: 1fr 1.1fr 0.9fr; gap: 20px; align-items: stretch; }
.science-card {
  min-height: 500px;
  border-radius: var(--radius);
  padding: 34px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 50px rgba(67,40,25,0.08);
}
.science-card h3 { margin: auto 0 14px; font-size: clamp(2rem, 3.2vw, 3.4rem); letter-spacing: -0.045em; }
.science-card p { margin: 0; font-size: 1rem; line-height: 1.65; max-width: 38ch; }
.card-number { font-size: 0.78rem; letter-spacing: 0.14em; font-weight: 800; }
.card-rise { background: var(--pink); }
.card-set { background: var(--blue); color: var(--white); transform: translateY(70px); }
.card-brown { background: var(--cinnamon); color: var(--white); }
.bubble-field { position: absolute; inset: 60px 20px auto; height: 220px; }
.bubble-field i { position: absolute; border: 2px solid rgba(59,32,24,0.42); border-radius: 50%; animation: bubble 4s ease-in-out infinite alternate; }
.bubble-field i:nth-child(1) { width: 62px; height: 62px; left: 8%; bottom: 15%; }
.bubble-field i:nth-child(2) { width: 95px; height: 95px; left: 36%; bottom: 42%; animation-delay: .4s; }
.bubble-field i:nth-child(3) { width: 38px; height: 38px; right: 17%; bottom: 15%; animation-delay: .8s; }
.bubble-field i:nth-child(4) { width: 52px; height: 52px; right: 3%; top: 6%; animation-delay: 1.2s; }
.bubble-field i:nth-child(5) { width: 28px; height: 28px; left: 24%; top: 2%; animation-delay: .2s; }
@keyframes bubble { to { transform: translateY(-18px) scale(1.08); } }
.crumb-grid { position: absolute; inset: 66px 36px auto; height: 220px; background: radial-gradient(circle at 12px 12px, rgba(255,255,255,.75) 0 3px, transparent 4px), radial-gradient(circle at 30px 25px, rgba(255,255,255,.28) 0 7px, transparent 8px); background-size: 48px 48px; transform: perspective(500px) rotateX(55deg) rotateZ(-7deg); }
.heat-lines { position: absolute; top: 95px; left: 50%; transform: translateX(-50%); display: flex; gap: 28px; }
.heat-lines i { width: 12px; height: 130px; border-left: 4px solid rgba(255,255,255,.7); border-radius: 50%; transform: skewX(-8deg); animation: heat 2.4s ease-in-out infinite alternate; }
.heat-lines i:nth-child(2) { animation-delay: .4s; }
.heat-lines i:nth-child(3) { animation-delay: .8s; }
@keyframes heat { to { transform: translateY(-24px) skewX(8deg); opacity: .4; } }

.bake-timeline { padding: 180px 6vw 150px; background: var(--white); }
.timeline-copy { max-width: 880px; margin-bottom: 110px; }
.timeline-copy > p:last-child { margin-left: 0; }
.timeline-track { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 24px; position: relative; overflow-x: auto; padding: 28px 4px 20px; scrollbar-width: thin; }
.timeline-line { position: absolute; top: 10px; left: 0; right: 0; height: 3px; background: rgba(59,32,24,.16); }
.timeline-line span { display: block; height: 100%; width: var(--timeline-progress, 0%); background: var(--blue); }
.timeline-track article { border-top: 0; min-height: 260px; padding: 30px 24px; background: var(--paper); border-radius: 22px; }
.timeline-track article > span { display: inline-grid; place-items: center; width: 36px; height: 36px; background: var(--blue); color: var(--white); border-radius: 50%; font-size: .75rem; font-weight: 800; }
.timeline-track h3 { margin: 45px 0 12px; font-size: 1.5rem; }
.timeline-track p { margin: 0; line-height: 1.55; font-size: .93rem; }

.finale { min-height: 100dvh; position: relative; display: grid; place-items: center; overflow: hidden; color: var(--white); }
.finale-media { background-image: var(--hero-image, url("assets/cinnamon-fallback.svg")); background-size: cover; background-position: center; transform: scale(1.08); }
.finale-overlay { position: absolute; inset: 0; background: rgba(4,20,62,.64); backdrop-filter: saturate(.8); }
.finale-copy { position: relative; z-index: 2; max-width: 900px; text-align: center; padding: 10vh 5vw; }
.finale-copy h2 { margin: 0 0 24px; font-size: clamp(4rem, 11vw, 10rem); line-height: .84; letter-spacing: -.08em; }
.finale-copy > p:not(.kicker) { max-width: 54ch; margin: 0 auto 42px; font-size: 1.15rem; line-height: 1.65; }
.replay-button {
  display: inline-flex;
  align-items: center;
  gap: 32px;
  padding: 18px 22px 18px 28px;
  color: var(--cocoa);
  background: var(--butter);
  text-decoration: none;
  border-radius: 999px;
  font-weight: 800;
  transition: transform .2s ease, gap .2s ease;
}
.replay-button:hover { transform: translateY(-4px); gap: 42px; }
footer { display: flex; justify-content: space-between; gap: 30px; padding: 34px 5vw; background: var(--cocoa); color: var(--paper); font-size: .84rem; }
footer p { margin: 0; }

@media (max-width: 980px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-header nav { display: none; }
  .hero-copy h1, .hero-copy h2 { max-width: 8ch; }
  .ingredient-stage { min-height: auto; padding-bottom: 110px; }
  .ingredient-orbit { aspect-ratio: auto; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; transform: none; }
  .orbit-center { position: relative; left: auto; top: auto; transform: none; grid-column: 1 / -1; margin: 0 auto 32px; }
  .ingredient { position: relative; left: auto; top: auto; width: auto; min-height: 210px; transform: none !important; }
  .spiral-sticky { grid-template-columns: 1fr; align-content: center; gap: 3vh; padding-top: 100px; }
  .spiral-copy { max-width: 680px; }
  .spiral-copy h2 { font-size: clamp(2.6rem, 7vw, 5rem); }
  .spiral-copy > p { display: none; }
  .step-readout { margin-top: 24px; }
  .spiral-visual { width: min(460px, 72vw); }
  .science-grid { grid-template-columns: 1fr 1fr; }
  .card-set { transform: none; }
  .card-brown { grid-column: 1 / -1; min-height: 430px; }
}

@media (max-width: 640px) {
  .site-header { height: 60px; padding: 0 18px; }
  .brand span:last-child { display: none; }
  .sound-toggle { font-size: .72rem; }
  .hero-story { height: 390vh; }
  .hero-shade { background: linear-gradient(0deg, rgba(3,15,50,.9) 0%, rgba(3,15,50,.36) 65%, rgba(3,15,50,.12)); }
  .hero-copy { left: 22px; bottom: 78px; width: calc(100vw - 64px); }
  .hero-copy h1 { font-size: clamp(3.4rem, 18vw, 5.5rem); }
  .hero-copy h2 { font-size: clamp(2.8rem, 13vw, 4.2rem); }
  .hero-copy > p:last-child { font-size: .95rem; }
  .progress-rail { right: 18px; top: 18vh; bottom: 18vh; }
  .hero-progress-label { right: 17px; bottom: 10vh; }
  .ingredient-stage { padding: 100px 18px; }
  .section-intro { text-align: left; margin-bottom: 56px; }
  .section-intro h2, .science-heading h2, .timeline-copy h2 { font-size: clamp(2.9rem, 14vw, 4.4rem); }
  .section-intro > p:last-child { margin-left: 0; }
  .ingredient-orbit { grid-template-columns: 1fr; }
  .orbit-center { grid-column: auto; }
  .ingredient { min-height: auto; }
  .spiral-sticky { padding: 88px 20px 36px; }
  .spiral-copy h2 { font-size: 2.7rem; }
  .spiral-copy .kicker { margin-bottom: 10px; }
  .step-readout { grid-template-columns: 52px 1fr; }
  .step-readout > span { font-size: 1.7rem; }
  .spiral-visual { width: min(390px, 92vw); margin-top: -12px; }
  .science-section { padding: 100px 18px; }
  .science-grid { grid-template-columns: 1fr; }
  .science-card, .card-brown { min-height: 430px; grid-column: auto; }
  .bake-timeline { padding: 100px 18px; }
  .timeline-track { grid-template-columns: repeat(6, 76vw); }
  .finale-copy { text-align: left; }
  .finale-copy h2 { font-size: clamp(4rem, 22vw, 6.5rem); }
  .finale-copy > p:not(.kicker) { margin-left: 0; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .bubble-field i, .heat-lines i { animation: none !important; }
  .hero-story, .spiral-lab { height: auto; }
  .hero-sticky, .spiral-sticky { position: relative; min-height: 100dvh; }
  .hero-video { display: none; }
  .hero-copy { position: relative; left: auto; bottom: auto; opacity: 1; transform: none; margin: 0; padding: 120px 28px; display: none; }
  .hero-copy-1 { display: block; }
  .progress-rail, .hero-progress-label { display: none; }
  .spiral-sticky { min-height: auto; padding-top: 110px; padding-bottom: 110px; }
  .cinnamon-draw { stroke-dashoffset: 0 !important; }
}
