/* Hallmark · genre: playful · macrostructure: rhythmic cutlist (scroll-craft) · theme: custom bespoke
 * tone: playful-retro · anchor hue: strawberry 22° · nav: loud slab bar · footer: inside close cut
 * pre-emit critique: P4 H4 E4 S5 R4 V5 (re-scored after verification, see REPORT)
 */

/* ------------------------------------------------------------- base -- */
html, body { overflow-x: clip; }
html { scroll-behavior: auto; scrollbar-color: var(--c-navy) var(--c-blush); }
body {
  margin: 0;
  background: var(--c-coral);
  color: var(--c-ink);
  font-family: var(--font-text);
  font-size: var(--text-lede);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--c-navy); color: var(--c-ink-light); }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 2px; }
@media (hover: hover) and (pointer: fine) { a:not([class*="bar__"]):not(.cta):not(.move):hover { text-decoration-thickness: 4px; } }
a:active { opacity: 0.8; }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: fixed; left: var(--space-4); top: var(--space-4); z-index: 20;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm);
  background: var(--c-navy); color: var(--c-ink-light); font-weight: 600;
  transform: translateY(-200%);
}
.skip:focus-visible { transform: none; }

/* ------------------------------------------------------- the loud bar -- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: var(--bar-h);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: var(--space-5);
  padding: 0 var(--gutter);
  background: var(--c-navy);
  color: var(--c-ink-light);
  box-shadow: var(--shadow-bar);
  --c-focus: var(--c-accent-on-dark);
}
.bar__mark { display: flex; align-items: baseline; gap: var(--space-3); text-decoration: none; white-space: nowrap; }
.bar__brand {
  font-family: var(--font-display); font-weight: 800; font-size: 1.32rem;
  letter-spacing: -0.03em; line-height: 1;
}
.bar__flavor { font-weight: 600; font-size: 0.95rem; color: var(--c-ink-light-soft); }
.bar__moves { display: flex; justify-content: center; gap: var(--space-2); }
.move {
  --chip: var(--c-red);
  position: relative;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm);
  font-family: var(--font-display); font-weight: 600; font-size: 0.84rem; letter-spacing: -0.01em;
  text-decoration: none; white-space: nowrap;
  color: var(--c-ink-light);
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--chip) 70%, transparent);
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.move::after {   /* how far through this movement you are, in its own fruit colour */
  content: ""; position: absolute; left: 6px; right: 6px; bottom: -6px; height: 3px; border-radius: 2px;
  background: var(--chip); transform-origin: left center; transform: scaleX(var(--fill, 0));
}
.move--straw::after { background: var(--c-accent-on-dark); }
.move--peach { --chip: var(--c-peach); }
.move--both  { --chip: var(--c-coral); }
.move.is-on { background: var(--chip); color: var(--c-navy-deep); box-shadow: none; }
.move--straw.is-on { color: var(--c-ink-light); background: var(--c-accent); }
@media (hover: hover) and (pointer: fine) {
  .move:hover { background: color-mix(in oklab, var(--chip) 30%, transparent); }
  .move.is-on:hover { background: var(--chip); }
  .move--straw.is-on:hover { background: var(--c-accent); }
}
.move:active { transform: translateY(1px); }

.bar__cta {
  font-family: var(--font-display); font-weight: 800; font-size: 1.02rem; letter-spacing: -0.02em;
  white-space: nowrap; text-decoration: none;
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-sm);
  background: var(--c-accent); color: var(--c-accent-ink);
  box-shadow: var(--edge-accent);
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .bar__cta:hover { background: var(--c-accent-press); } }
.bar__cta:active { transform: translateY(1px); }

@media (max-width: 760px), (max-aspect-ratio: 19/20) {
  .bar {
    grid-template-columns: 1fr auto; grid-template-rows: 3.4rem 2.7rem;
    gap: 0 var(--space-3); padding: 0 var(--space-4);
  }
  .bar__flavor { display: none; }
  .bar__moves { grid-column: 1 / -1; grid-row: 2; justify-content: stretch; gap: var(--space-2); padding-bottom: var(--space-2); }
  .move { flex: 1; text-align: center; padding: var(--space-2) var(--space-1); font-size: 0.78rem; }
  .bar__cta { font-size: 0.86rem; padding: var(--space-2) var(--space-3); }
}

/* ----------------------------------------------------- the 3D layer -- */
.stage {
  position: fixed; inset: 0; z-index: 1;
  width: 100%; height: 100lvh;
  pointer-events: none;
  display: block;
}

/* -------------------------------------------------------------- cuts -- */
.cut {
  position: relative;
  min-height: calc(var(--span, 1) * 100svh);
  overflow: clip;
  display: grid;
  align-items: center;
  padding: calc(var(--bar-h) + var(--space-6)) var(--gutter) var(--space-7);
  box-sizing: border-box;
}
.copy, .facts, .close, .foot, .peak__line, .hush { position: relative; z-index: 2; }

.display {
  font-family: var(--font-display); font-weight: 800;
  font-size: var(--text-h2); line-height: 1.02; letter-spacing: var(--track-display);
  margin: 0; text-wrap: balance; max-width: 13ch;
  overflow-wrap: anywhere; min-width: 0;
}
.body { margin: 0; max-width: 46ch; text-wrap: pretty; font-weight: 500; }
.sc-stack > * + * { margin-top: var(--space-5); }

.copy { width: min(100%, 36rem); }
.copy--lead  { justify-self: start; }
.copy--trail { justify-self: end; text-align: right; }
.copy--trail .display, .copy--trail .body { margin-left: auto; }

.fine-only { display: none; }
@media (hover: hover) and (pointer: fine) { .fine-only { display: inline; } .touch-only { display: none; } }

.poster { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; z-index: 1; }
.poster[hidden] { display: none; }   /* the engine sets img { display: block }, which beats [hidden] */
.no-webgl .poster { display: block; }
.no-webgl .bite-btn, .no-webgl #bite-say { display: none; }   /* nothing to bite without the live layer */

/* 1 · hero ------------------------------------------------------------ */
.cut--hero { background: var(--c-coral); align-items: start; }
/* the copy belongs to the first screen, not to the bottom of a 1.25-screen cut */
.hero__copy { margin-top: calc(100svh - var(--bar-h) - var(--space-6) - clamp(3rem, 9vh, 6.5rem)); transform: translateY(-100%); }
.sun {
  position: absolute; right: 4vw; top: calc(var(--bar-h) + 4vh);
  width: min(58vw, 74vh); aspect-ratio: 1; border-radius: 50%;
  background: linear-gradient(180deg, var(--c-apricot) 0%, var(--c-peach) 46%, var(--c-coral-deep) 78%, var(--c-red) 100%);
  /* the 80s sunset: stripes cut out of the lower half, widening as they fall */
  -webkit-mask: linear-gradient(#000 0 52%, transparent 52% 55%, #000 55% 63%, transparent 63% 67%, #000 67% 74%, transparent 74% 79.5%, #000 79.5% 85%, transparent 85% 91.5%, #000 91.5%);
          mask: linear-gradient(#000 0 52%, transparent 52% 55%, #000 55% 63%, transparent 63% 67%, #000 67% 74%, transparent 74% 79.5%, #000 79.5% 85%, transparent 85% 91.5%, #000 91.5%);
  transform: translate3d(calc(var(--px, 0) * -14px), calc(var(--py, 0) * -10px), 0);
}
.hero__copy { position: relative; max-width: min(100%, 62rem); }
.hero__title {
  overflow-wrap: anywhere; min-width: 0;
  font-family: var(--font-display); font-weight: 900;
  font-size: var(--text-hero); line-height: 0.9; letter-spacing: var(--track-hero);
  margin: 0; color: var(--c-ink);
}
.hero__title span { display: block; }
.hero__title span + span { color: var(--c-crimson); }
.hero__sub { margin: var(--space-5) 0 0; max-width: 46ch; text-wrap: balance; font-weight: 600; font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.4rem); }

.hero__title span, .hero__sub { opacity: 0; transform: translateY(0.35em); }
.is-loaded .hero__title span, .is-loaded .hero__sub {
  opacity: 1; transform: none;
  transition: opacity 620ms var(--ease-out), transform 620ms var(--ease-out);
}
.is-loaded .hero__title span + span { transition-delay: 70ms; }
.is-loaded .hero__sub { transition-delay: 140ms; }

/* 2 · strawberry ------------------------------------------------------- */
.cut--straw { background: var(--c-red); color: var(--c-ink-light); --c-focus: var(--c-ink-light); }

/* 3 · bite --------------------------------------------------------------- */
.cut--bite { background: var(--c-blush); }
.bite-btn {
  font: 700 0.98rem/1 var(--font-display); letter-spacing: -0.01em;
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-sm);
  color: var(--c-ink); background: transparent;
  border: 2px solid var(--c-ink); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .bite-btn:hover { background: var(--c-ink); color: var(--c-ink-light); } }
.bite-btn:active { transform: scale(0.97); }
.bite-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.is-biteable { cursor: pointer; }

/* 4 · peach ---------------------------------------------------------------- */
.cut--peach { background: var(--c-apricot); }

/* 5 · half ------------------------------------------------------------------ */
.cut--half { background: var(--c-leaf); color: var(--c-ink-light); --c-focus: var(--c-ink-light); }
.cut--half .display { line-height: 1.08; padding-block: 0.06em; }

/* 6 · hush (authored silence) ----------------------------------------------- */
.cut--hush { background: var(--c-blush-pale); justify-items: center; }
.hush {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.6rem); letter-spacing: -0.02em; color: var(--c-ink-soft);
}

/* 7–10 · peak cuts --------------------------------------------------------- */
.peak { position: relative; }
/* The captions belong to the held moment, so they live in a fixed band the fruit
   never enters (bottom on desktop, under the bar on phones). Each caption is
   position: fixed INSIDE its own cut, and each cut clips with clip-path (which,
   unlike overflow, also clips fixed descendants). So the band only ever shows the
   caption of the ground currently under it, and the words hard-cut on exactly the
   same edge as the colour. Real markup, no overlay, no JS. */
.peak .cut { clip-path: inset(0); }
.cut--p1 { background: var(--c-red); color: var(--c-ink-light); }
.cut--p2 { background: var(--c-apricot); }
.cut--p3 { background: var(--c-coral); }
.cut--p4 { background: var(--c-blush); }
.peak__line {
  position: fixed; left: var(--gutter); right: var(--gutter); bottom: clamp(1.5rem, 5vh, 3rem);
  margin: 0; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2rem, 0.9rem + 4.2vw, 5rem); line-height: 1.05; letter-spacing: var(--track-display);
}
.peak__line--trail { text-align: right; }
@media (max-width: 760px), (max-aspect-ratio: 19/20) {
  .peak__line { bottom: auto; top: calc(var(--bar-h) + var(--space-5)); left: var(--space-4); right: var(--space-4); font-size: clamp(1.9rem, 9.4vw, 2.6rem); }
}

/* 11 · facts ------------------------------------------------------------------ */
.cut--facts { background: var(--c-navy); color: var(--c-ink-light); --c-focus: var(--c-accent-on-dark); }
.facts { max-width: 60rem; }
.facts__title {
  margin: 0 0 var(--space-6); font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.5rem); letter-spacing: -0.01em; color: var(--c-accent-on-dark);
}
.facts__list { list-style: none; margin: 0; padding: 0; }
.facts__list li {
  overflow-wrap: anywhere;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2rem, 0.9rem + 4.2vw, 5.4rem); line-height: 1.04; letter-spacing: var(--track-display);
  padding-block: 0.05em;
}
.facts__note { margin: var(--space-7) 0 0; max-width: 44ch; color: var(--c-ink-light-soft); font-size: clamp(1rem, 0.94rem + 0.25vw, 1.15rem); line-height: 1.6; font-weight: 500; text-wrap: pretty; }
.facts__note a { color: var(--c-ink-light); font-weight: 600; white-space: nowrap; }

/* 12 · close ---------------------------------------------------------------------- */
.cut--close {
  background: var(--c-coral);
  grid-template-rows: 1fr auto; align-items: center;
  padding-bottom: var(--space-5);
}
.close { max-width: 40rem; }
.close__title {
  overflow-wrap: anywhere; min-width: 0;
  margin: 0; font-family: var(--font-display); font-weight: 900;
  font-size: clamp(2.4rem, 1rem + 6vw, 6.8rem); line-height: 0.95; letter-spacing: var(--track-hero);
  max-width: 9ch;
}
.close__price { margin: var(--space-5) 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4); }
.close__amount { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.5rem); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.close__where { font-size: var(--text-small); color: var(--c-ink-soft); font-weight: 600; }
.close__actions { margin-top: var(--space-6); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-6); }
.cta {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.2rem); letter-spacing: -0.02em;
  white-space: nowrap; text-decoration: none;
  padding: var(--space-4) var(--space-5); border-radius: var(--radius-sm);
  background: var(--c-accent); color: var(--c-accent-ink);
  box-shadow: var(--shadow-cta), var(--edge-accent);
  transition: background-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .cta:hover { background: var(--c-accent-press); } }
.cta:active { transform: translateY(1px); }
.link { font-weight: 700; color: var(--c-ink); white-space: nowrap; }
.foot { grid-row: 2; align-self: end; max-width: 72ch; }
.foot p { margin: 0; font-size: var(--text-small); line-height: 1.55; color: var(--c-ink-soft); font-weight: 500; }

/* ---------------------------------------------------------------- phones -- */
@media (max-width: 760px), (max-aspect-ratio: 19/20) {
  .cut { padding-inline: var(--space-4); }
  .copy--trail { justify-self: start; text-align: left; }
  .copy--trail .display, .copy--trail .body { margin-left: 0; }
  /* phones: copy sits in the top band, the object owns the lower band */
  .cut--straw, .cut--bite, .cut--peach, .cut--half { align-items: start; }
  .hero__copy { margin-top: 0; transform: none; }
  .sun { width: 92vw; right: -10vw; top: auto; bottom: 4vh; }
  .hero__title { font-size: clamp(2.5rem, 12.6vw, 4.6rem); }
  .cut--close { align-items: start; min-height: 135svh; }
}

/* --------------------------------------------------------- reduced motion -- */
/* side-by-side layouts: the copy column gives way as the screen narrows, so the
   3D (scaled by FIT in main.js) always has its own half */
@media (min-width: 761px) and (min-aspect-ratio: 19/20) {
  .copy { width: min(36rem, 44vw); }
  .facts { max-width: min(60rem, 54vw); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title span, .hero__sub { transform: none; }
  .is-loaded .hero__title span, .is-loaded .hero__sub { transition: opacity 150ms linear; }
  .sun { transform: none; }
  .move:active, .bar__cta:active, .cta:active, .bite-btn:active { transform: none; }
  .move::after { transition: none; }
}
