/* ============================================================================
   HOME - hero scroll stage, marquee, story, signature blocks
   ============================================================================ */

/* ---------------- HERO: scroll-scrub exploding sandwich ---------------- */
.hero {
  position: relative;
  height: 340vh;            /* scroll distance that drives the deconstruction */
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(22,169,214,0.10), transparent 55%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream) 60%, var(--foam) 100%);
}
.hero__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.hero__grid {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: calc(var(--header-h) + 1rem) clamp(1.25rem, 4vw, 2.5rem) 2rem;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 1rem;
  height: 100%;
}
@media (min-width: 920px) {
  .hero__grid { grid-template-columns: 1.02fr 0.98fr; gap: 2rem; }
}

/* Copy */
.hero__copy { position: relative; z-index: 3; max-width: 34rem; }
.hero__title {
  font-size: var(--text-hero);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}
.hero__title .ink-cyan { color: var(--harbor); position: relative; white-space: nowrap; }
.hero__title .ink-cyan::after {
  content: "";
  position: absolute; left: 0; bottom: 0.08em; height: 0.14em; width: 100%;
  background: var(--cyan); border-radius: 4px; opacity: 0.55;
}
.hero__sub {
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 30rem;
  margin-bottom: 1.75rem;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.85rem; }

.hero__trust {
  margin-top: 1.5rem;
  display: flex; align-items: center; gap: 0.6rem;
  font-size: var(--text-sm); color: var(--ink-soft); font-weight: 600;
}
.hero__trust .stars { color: var(--gold-deep); letter-spacing: 0.08em; }

/* Ingredient ticker that lights up as the sandwich opens */
.hero__ingredients {
  margin-top: 1.6rem;
  display: grid;
  gap: 0.35rem;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
}
@media (max-width: 919px) { .hero__ingredients { display: none; } }
.hero__ingredient {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 700; color: var(--muted);
  opacity: 0.45;
  transform: translateX(-4px);
  transition: opacity var(--dur) var(--ease-out), color var(--dur), transform var(--dur) var(--ease-out);
}
.hero__ingredient::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--line-strong);
  transition: background var(--dur), box-shadow var(--dur);
}
.hero__ingredient.is-on {
  opacity: 1; color: var(--ink); transform: translateX(0);
}
.hero__ingredient.is-on::before { background: var(--cyan); box-shadow: 0 0 0 4px rgba(22,169,214,0.18); }

/* Canvas (sandwich) */
.hero__media { position: relative; z-index: 2; display: grid; place-items: center; height: 100%; }
.hero__canvas {
  width: 100%;
  max-width: min(72vh, 100%);
  aspect-ratio: 1 / 1;
  filter: drop-shadow(0 30px 50px rgba(12,42,64,0.22));
}
.hero__loader {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-weight: 700; font-size: var(--text-sm);
  letter-spacing: 0.1em; text-transform: uppercase;
  transition: opacity var(--dur) var(--ease-out);
}
.hero__loader.is-hidden { opacity: 0; pointer-events: none; visibility: hidden; }

/* Floating seeds (ambient) */
.hero__seeds { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.seed {
  position: absolute;
  width: 7px; height: 11px; border-radius: 50%;
  background: var(--ink);
  opacity: 0.12;
  animation: drift 14s linear infinite;
}
.seed:nth-child(1){ left: 12%; top: 22%; animation-duration: 17s; }
.seed:nth-child(2){ left: 84%; top: 30%; width: 5px; height: 8px; animation-duration: 21s; background: var(--harbor); opacity:0.16; }
.seed:nth-child(3){ left: 70%; top: 70%; animation-duration: 15s; }
.seed:nth-child(4){ left: 24%; top: 78%; width: 5px; height: 9px; animation-duration: 19s; background: var(--cyan); opacity: 0.2; }
.seed:nth-child(5){ left: 50%; top: 14%; width: 4px; height: 7px; animation-duration: 23s; }
.seed:nth-child(6){ left: 38%; top: 52%; animation-duration: 18s; background: var(--gold); opacity: 0.18; }

/* Scroll cue */
.hero__cue {
  position: absolute;
  left: 50%; bottom: 1.8rem; transform: translateX(-50%);
  z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
  color: var(--ink);
  transition: opacity var(--dur) var(--ease-out);
  animation: cueBob 2.2s var(--ease-in-out) infinite;
}
.hero__cue > span:first-child {
  font-family: var(--font-display); font-weight: 700; line-height: 1;
  font-size: clamp(1.5rem, 4.2vw, 2.3rem); letter-spacing: 0.01em;
}
.hero__cue-track { width: 22px; height: 34px; border-radius: 12px; border: 2px solid var(--line-strong); position: relative; }
.hero__cue-dot { position: absolute; left: 50%; top: 6px; width: 4px; height: 6px; border-radius: 4px; background: var(--cyan); transform: translateX(-50%); animation: cue 1.6s var(--ease-in-out) infinite; }
.hero__stage.is-deep .hero__cue { opacity: 0; }
@keyframes cueBob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(7px); } }

@media (max-width: 919px) {
  .hero { height: 300vh; }
  .hero__grid { grid-template-rows: 1fr auto; align-content: center; }
  .hero__media { order: -1; }
  .hero__canvas { max-width: min(56vh, 86vw); }
  .hero__title { font-size: clamp(2.6rem, 12vw, 4rem); }
  .hero__copy { text-align: center; margin-inline: auto; }
  .hero__cta { justify-content: center; }
  .hero__trust { justify-content: center; }
  .hero__cue { display: flex; bottom: 2.2rem; } /* copy is hidden at the top now, so the Scroll cue is safe to show */
}

/* ===================== Full-bleed hero + headline reveal ===================== */
/* The bagel canvas fills the sticky stage; copy overlays it with a scrim. */
.hero__grid { grid-template-columns: 1fr; max-width: none; padding: calc(var(--header-h) + 1rem) 0 0; }
.hero__media { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; }
/* contain on desktop so the FULL deconstruction is visible (cover cropped the
   top/bottom layers on wide screens); cover on mobile portrait where it fits. */
/* Definite square (not 100%/aspect-ratio, which collapsed to viewport-WIDTH and
   clipped the lower layers). 78vh fits the full 5-layer deconstruction. */
.hero__canvas { width: 78vh; height: 78vh; max-width: 90vw; flex: 0 0 auto; padding: 0; transform: translateX(7%);
  -webkit-mask-image: radial-gradient(closest-side, #000 84%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 84%, transparent 100%); }
.hero__ingredients { display: none; }
.hero__stage::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, rgba(250,244,233,0.97) 0%, rgba(250,244,233,0.62) 30%, rgba(250,244,233,0) 56%);
}
.hero__copy {
  position: absolute; z-index: 3; left: clamp(1.25rem, 5vw, 4.5rem); right: auto;
  bottom: 7vh; top: auto; max-width: 42rem; margin: 0; text-align: left;
}
/* Size the headline by the SMALLER of width/height so a wide-but-short
   (landscape laptop) viewport never grows the title tall enough to clip up
   behind the header. min(8vw, 13vh) keeps the 3-line headline inside the stage. */
.hero .hero__title { font-size: clamp(2.6rem, min(8vw, 13vh), 7rem); }
.hero__title-l, .hero__title-r { display: inline-block; will-change: transform; }

/* Short landscape (e.g. maximized 16:9/16:10 laptops): tighten the stack so the
   full headline + CTAs + sandwich all breathe within one screen height. */
@media (min-width: 920px) and (max-height: 860px) {
  .hero__copy { bottom: 5vh; }
  .hero__sub { margin-bottom: 1.1rem; font-size: var(--text-base); }
  .hero__trust { margin-top: 1rem; }
}

/* Scroll-driven reveal: enabled by hero.js (.hero--reveal) only when motion is
   allowed, so no-JS / reduced-motion users still see the headline normally. The
   two halves converge from the left and right as the scrub finishes. */
.hero--reveal .hero__copy { opacity: var(--reveal, 0); }
.hero--reveal .hero__copy > * { animation: none; opacity: 1; }
.hero--reveal .hero__title-l { transform: translateX(calc((var(--reveal, 0) - 1) * 60px)); }
.hero--reveal .hero__title-r { transform: translateX(calc((1 - var(--reveal, 0)) * 60px)); }

/* Real wordmark logo in the header */
.brand__logo { height: 44px; width: auto; display: block; }

@media (max-width: 919px) {
  .hero__media { order: 0; }
  .hero__canvas { width: 90vw; height: 90vw; max-width: 90vw; max-height: 64vh; transform: none; }
  .hero__copy {
    left: clamp(1rem, 6vw, 1.6rem); right: clamp(1rem, 6vw, 1.6rem);
    bottom: 5vh; max-width: none; text-align: center; margin: 0;
  }
  /* Keep the revealed copy from overflowing behind the header on short screens. */
  .hero .eyebrow { display: none; }
  .hero__title { font-size: clamp(1.9rem, 7.6vw, 2.45rem); line-height: 1.1; }
  .hero__sub { font-size: 0.92rem; margin-top: 0.7rem; }
  .hero__cta { justify-content: center; gap: 0.55rem; margin-top: 0.9rem; }
  .hero__cta .btn { min-height: 48px; padding: 0.8rem 1.45rem; font-size: 0.98rem; }
  .hero__trust { justify-content: center; margin-top: 0.7rem; font-size: 0.78rem; }
  .hero__stage::after {
    background:
      linear-gradient(0deg, rgba(250,244,233,0.97) 0%, rgba(250,244,233,0.6) 36%, rgba(250,244,233,0) 70%),
      linear-gradient(90deg, rgba(250,244,233,0.4) 0%, rgba(250,244,233,0) 55%);
  }
  .hero--reveal .hero__title-l { transform: translateX(calc((var(--reveal, 0) - 1) * 34px)); }
  .hero--reveal .hero__title-r { transform: translateX(calc((1 - var(--reveal, 0)) * 34px)); }
  .brand__logo { height: 38px; }
}

/* ===================== Steam + ambient seeds (motion) ===================== */
/* Fresh-and-hot steam rising off the assembled bagel; shows only at the very
   top and fades the moment you scroll (the bagel starts coming apart). */
.steam {
  position: absolute; left: 50%; top: 10%; width: 200px; height: 30%;
  transform: translateX(-50%); z-index: 2; pointer-events: none;
  filter: blur(5px); opacity: 0; transition: opacity 0.7s var(--ease-out, ease);
}
.hero__stage:not(.is-deep) .steam { opacity: 1; }
.steam span {
  position: absolute; bottom: 0; width: 48px; height: 48px; border-radius: 50%;
  background: radial-gradient(circle, rgba(208,213,221,0.62), rgba(208,213,221,0) 67%);
  animation: steamRise 4.8s ease-in-out infinite;
}
.steam span:nth-child(1) { left: 4%;  animation-delay: 0s; }
.steam span:nth-child(2) { left: 32%; animation-delay: 1.2s; }
.steam span:nth-child(3) { left: 60%; animation-delay: 2.4s; }
.steam span:nth-child(4) { left: 24%; animation-delay: 3.3s; }
@keyframes steamRise {
  0%   { transform: translateY(10px) scale(0.6); opacity: 0; }
  20%  { opacity: 0.85; }
  55%  { opacity: 0.5; }
  100% { transform: translateY(-165px) scale(1.6); opacity: 0; }
}

/* Ambient sesame/poppy seeds drifting behind a few sections, with light scroll
   parallax (motion.js). Reuses the hero .seed style + drift keyframe. */
.has-amb { position: relative; }
.has-amb > .amb { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; will-change: transform; }
.has-amb > .container { position: relative; z-index: 1; }
.amb .seed { opacity: 0.10; }
.amb .seed:nth-child(1) { left: 7%;  top: 16%; animation-duration: 19s; }
.amb .seed:nth-child(2) { left: 88%; top: 24%; width: 5px; height: 8px; background: var(--harbor); opacity: 0.14; animation-duration: 23s; }
.amb .seed:nth-child(3) { left: 74%; top: 70%; animation-duration: 17s; }
.amb .seed:nth-child(4) { left: 18%; top: 78%; width: 5px; height: 9px; background: var(--cyan); opacity: 0.16; animation-duration: 21s; }
.amb .seed:nth-child(5) { left: 46%; top: 12%; width: 4px; height: 7px; animation-duration: 25s; }
.amb .seed:nth-child(6) { left: 38%; top: 60%; background: var(--gold); opacity: 0.14; animation-duration: 20s; }

@media (prefers-reduced-motion: reduce) {
  .steam, .has-amb > .amb { display: none; }
  .hero__cue { animation: none; }
  /* Keep the scroll-scrub hero, but still the buzzy floating seeds. */
  .hero__seeds .seed { animation: none; }
}

/* ---------------- Marquee (bagel varieties) ---------------- */
.marquee {
  background: var(--ink);
  color: var(--cream);
  padding: 1.1rem 0;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track { display: inline-flex; align-items: center; gap: 2.5rem; animation: marquee 38s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 2.5rem;
  color: var(--cream);
}
.marquee__item::after { content: "✦"; color: var(--cyan); font-size: 0.7em; }

/* ---------------- Social proof stats strip ---------------- */
.proof { background: var(--card); border-block: 1px solid var(--line); padding-block: clamp(2rem, 5vw, 3.5rem); }
.proof__grid {
  display: grid; gap: var(--space-6);
  grid-template-columns: repeat(2, 1fr);
  text-align: center;
}
@media (min-width: 760px) { .proof__grid { grid-template-columns: repeat(4, 1fr); } }
.proof__item { padding: var(--space-2); }

/* ---------------- Story ---------------- */
.story__media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.story__media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.story__badge {
  position: absolute; right: -14px; bottom: -14px;
  width: 132px; height: 132px;
  background: var(--harbor); color: var(--white);
  border-radius: 50%;
  display: grid; place-content: center; text-align: center; line-height: 1.1;
  box-shadow: var(--shadow-md);
  transform: rotate(-8deg);
}
.story__badge b { font-family: var(--font-display); font-size: 2rem; display: block; }
.story__badge span { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.feature-list { display: grid; gap: var(--space-5); margin-top: var(--space-6); }
.feature {
  display: grid; grid-template-columns: auto 1fr; gap: var(--space-4); align-items: start;
}
.feature__icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: grid; place-items: center; flex: none;
  background: var(--foam); color: var(--harbor);
}
.feature__icon svg { width: 26px; height: 26px; }
.feature h3 { font-size: var(--text-xl); margin-bottom: 0.2rem; }
.feature p { color: var(--muted); font-size: var(--text-base); }

/* ---------------- Cream cheese band media ---------------- */
.cc-hero-note {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(22,169,214,0.12); color: var(--cyan-deep);
  padding: 0.4rem 0.9rem; border-radius: var(--radius-pill);
  font-weight: 700; font-size: var(--text-sm);
}

/* ---------------- Visit ---------------- */
.visit-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-md);
}

/* ---------------- Final CTA ---------------- */
.final-cta { text-align: center; }
.final-cta h2 { color: var(--cream); margin-bottom: var(--space-4); }
.final-cta p { color: rgba(250,244,233,0.8); max-width: 36rem; margin: 0 auto var(--space-6); font-size: var(--text-lg); }
.final-cta__btns { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

/* ---------------- Wave divider ---------------- */
/* Pinned to the section's top edge so it bridges the color boundary cleanly. */
.wave { display: block; width: 100%; height: auto; }
.wave--up { position: absolute; top: 0; left: 0; width: 100%; margin: 0; line-height: 0; }
.section--foam { padding-top: calc(var(--space-section) + 52px); }

/* ---------------- Bagel strip transition (rolling row of bagels) ---------------- */
.bagel-strip {
  position: absolute; top: 0; left: 0; width: 100%; height: 62px; overflow: hidden;
  z-index: 2; background: var(--foam, #edf2f1); display: flex; align-items: center;
}
.bagel-strip::before, .bagel-strip::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 70px; z-index: 1; pointer-events: none;
}
.bagel-strip::before { left: 0;  background: linear-gradient(90deg, var(--foam, #edf2f1), rgba(237,242,241,0)); }
.bagel-strip::after  { right: 0; background: linear-gradient(270deg, var(--foam, #edf2f1), rgba(237,242,241,0)); }
.bagel-strip__track { display: flex; align-items: center; gap: 26px; padding: 0 13px; animation: bagelRoll 36s linear infinite; }
.bagel-strip:hover .bagel-strip__track { animation-play-state: paused; }
.bagel {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 36% 30%, #f2cd9a 0%, #d59a57 58%, #ba7e3a 100%);
  box-shadow: 0 3px 7px rgba(90,50,12,0.18), inset 0 -3px 6px rgba(120,70,20,0.4), inset 0 2px 5px rgba(255,242,214,0.6);
}
.bagel::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 36%; height: 36%;
  transform: translate(-50%, -50%); border-radius: 50%; background: var(--foam, #edf2f1);
  box-shadow: inset 0 1px 3px rgba(90,50,10,0.45);
}
@keyframes bagelRoll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .bagel-strip__track { animation: none; } }

/* ---- "Pick your bagel": traveling spotlight - full center + half above/below,
   glow fades in and out as it sweeps (driven by motion.js) ---- */
#varietyChips .chip {
  position: relative;
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out), color 0.45s var(--ease-out);
}
.chip.is-half {
  transform: scale(1.03);
  color: var(--harbor);
  box-shadow: inset 0 0 0 1.5px rgba(22, 169, 214, 0.5), 0 0 12px rgba(22, 169, 214, 0.3);
  z-index: 1;
}
.chip.is-selected {
  transform: scale(1.08);
  color: var(--harbor);
  box-shadow: inset 0 0 0 2px var(--cyan), 0 0 22px rgba(22, 169, 214, 0.68);
  z-index: 2;
}
