/* ==========================================================================
   Drop A Cake — layout & components
   Consumes tokens.css only. Mobile-first; breakpoints at 48rem and 64rem.
   ========================================================================== */

/* ---- Base ---- */
*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: clip;
}

h1, h2, h3, p, ul, figure, blockquote { margin: 0; }

ul { padding: 0; list-style: none; }

a { color: inherit; }

.svg-defs { position: absolute; width: 0; height: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--chocolate);
  color: var(--white);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
}
.skip-link:focus { top: 0.5rem; }

:focus-visible {
  outline: var(--border-w) solid var(--cherry);
  outline-offset: 2px;
}

/* Entrance hiding — only when JS runs and motion is allowed (html.js set
   pre-paint in index.html). js-safe is the 3s fallback if main.js fails. */
.js [data-hero],
.js [data-drop],
.js [data-drop-group] > * { opacity: 0; }
.js.js-safe [data-hero],
.js.js-safe [data-drop],
.js.js-safe [data-drop-group] > * { opacity: 1; }

/* ---- Bands (the layer cake) ---- */
.band {
  position: relative;
  padding: var(--band-pad-y) 0;
  overflow: clip;
}

.band__inner {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.band--cream     { background: var(--cream); }
.band--blush     { background: var(--blush); }
.band--sponge    { background: var(--sponge); }
.band--pink      { background: var(--pink); }
.band--cherry    { background: var(--cherry); color: var(--ink-inverse); }
.band--chocolate { background: var(--chocolate); color: var(--ink-inverse); }

/* Serif accent recolors per contrast pairing rules (DESIGN.md §3) */
.band--pink .accent-serif   { color: var(--chocolate); }
.band--cherry .accent-serif { color: var(--white); }

.band h2 {
  font-size: var(--text-h2);
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

/* ---- Frosting dividers ---- */
.frosting {
  display: block;
  margin-top: -1px;
  margin-bottom: -1px;
  line-height: 0;
}
.frosting svg {
  display: block;
  width: 100%;
  height: clamp(40px, 6vw, 80px);
}
.frosting use { fill: currentColor; }

.frosting--from-cream     { color: var(--cream); }
.frosting--from-blush     { color: var(--blush); }
.frosting--from-sponge    { color: var(--sponge); }
.frosting--from-pink      { color: var(--pink); }
.frosting--from-cherry    { color: var(--cherry); }
.frosting--from-chocolate { color: var(--chocolate); }

.frosting--on-cream     { background: var(--cream); }
.frosting--on-blush     { background: var(--blush); }
.frosting--on-sponge    { background: var(--sponge); }
.frosting--on-pink      { background: var(--pink); }
.frosting--on-cherry    { background: var(--cherry); }
.frosting--on-chocolate { background: var(--chocolate); }

/* ---- Crumb speckle (sponge/peach bands only) ---- */
.texture-crumb::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cg fill='black'%3E%3Ccircle cx='12' cy='22' r='1.6'/%3E%3Ccircle cx='58' cy='9' r='1.2'/%3E%3Ccircle cx='104' cy='31' r='1.8'/%3E%3Ccircle cx='31' cy='74' r='1.3'/%3E%3Ccircle cx='83' cy='63' r='1.7'/%3E%3Ccircle cx='128' cy='88' r='1.2'/%3E%3Ccircle cx='17' cy='118' r='1.8'/%3E%3Ccircle cx='66' cy='131' r='1.4'/%3E%3Ccircle cx='115' cy='122' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---- Tilts (rotated clusters) — half-strength on mobile ---- */
.tilt-1 { transform: rotate(calc(var(--tilt-1) / 2)); }
.tilt-2 { transform: rotate(calc(var(--tilt-2) / 2)); }
.tilt-3 { transform: rotate(calc(var(--tilt-3) / 2)); }

/* ---- Nav ---- */
.nav-sentinel {
  position: absolute;
  top: 0;
  width: 1px;
  height: 1px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 0.625rem clamp(1rem, 4vw, 2rem);
  background: color-mix(in srgb, var(--cream) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color var(--dur-hover) var(--ease-out);
}

/* Transparent while the page sits at the top (toggled off on scroll in main.js) */
.nav--top {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav__wordmark {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-display);
  font-size: 1.375rem;
  text-decoration: none;
  padding: 0.5rem 0;
}

.btn--nav { padding: 0.625rem 1.25rem; }

/* ---- Buttons: touch-safe pressed state ---- */
.btn:active {
  transform: translate(3px, 3px);
  box-shadow: var(--shadow-sticker-pressed);
}
.btn { text-decoration: none; text-align: center; }

/* ---- Hero ---- */
.hero { padding-top: clamp(3rem, 8vh, 6rem); }

/* Layer-cake strata background: stacked wavy tints behind the hero.
   Painted in source order — each stratum's wavy top edge covers the last. */
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stratum--sponge { fill: var(--sponge); }
.stratum--pink   { fill: var(--pink); }
.stratum--peach  { fill: var(--peach); }
.stratum--cream  { fill: var(--cream); }

/* Jam seam between frosting and pink sponge */
.stratum-jam {
  fill: none;
  stroke: var(--cherry);
  stroke-width: 26;
}

/* Cast shadow under each layer boundary: offset down like the sticker shadows */
.stratum-shadow {
  fill: none;
  stroke: var(--chocolate);
  stroke-width: 16;
  opacity: 0.16;
  transform: translateY(7px);
}

/* Texture overlays, all behind the content */
.hero__pores {
  opacity: 0.05;
  mix-blend-mode: multiply;
}

.hero__grain {
  opacity: 0.13;
  mix-blend-mode: multiply;
}

.hero__crumbs { opacity: 0.12; }

.crumb-dot { fill: var(--chocolate); }

.hero .band__inner,
.hero__strip { position: relative; }

.kicker { margin-bottom: clamp(1rem, 3vh, 2rem); }

.hero__headline {
  font-size: var(--text-hero);
  margin-left: -0.04em; /* optical alignment for Anton's side bearing */
}
.hero__line { display: block; }
.hero-word { display: inline-block; }
.hero__headline .accent-serif { font-size: 0.95em; }

.hero__sub {
  max-width: 34em;
  margin-top: clamp(1.25rem, 3vh, 2rem);
  font-size: calc(var(--text-body) * 1.15);
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
}

.hero__strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  max-width: var(--content-max);
  margin: clamp(3rem, 8vh, 5rem) auto 0;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* ---- Photo placeholders ---- */
.ph { min-width: 0; }

.ph__img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sticker);
}

.ph__img--tall   { aspect-ratio: 3 / 4; }
.ph__img--square { aspect-ratio: 1 / 1; }
.ph__img--wide   { aspect-ratio: 4 / 3; }

.ph__img--focus-low { object-position: center 72%; }

.ph__img--cherry    { background: var(--cherry); }
.ph__img--pink      { background: var(--pink); }
.ph__img--blush     { background: var(--blush); }
.ph__img--sponge    { background: var(--sponge); }
.ph__img--peach     { background: var(--peach); }
.ph__img--chocolate { background: var(--chocolate); }

.ph figcaption { margin-top: 0.75rem; }

/* Over the hero strata, captions ride on cream label chips */
.hero__strip figcaption {
  display: inline-block;
  background: var(--cream);
  padding: 0.25rem 0.625rem;
  border-radius: calc(var(--radius-md) / 3);
}

/* ---- Ticker ---- */
.ticker { padding: 1.125rem 0; }

.marquee {
  display: flex;
  overflow: clip;
}

.marquee__track {
  display: flex;
  flex-shrink: 0;
  min-width: 100%;
  align-items: center;
  animation: marquee-scroll var(--marquee-loop) linear infinite;
}

.marquee:hover .marquee__track { animation-play-state: paused; }

.marquee__track li {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-display);
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  color: var(--pink);
  white-space: nowrap;
  padding-inline: 0.75em;
}

@keyframes marquee-scroll {
  to { transform: translateX(-100%); }
}

/* ---- The difference ---- */
.difference__split {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
}

.difference__label {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
  font-size: var(--text-h3);
  background: var(--cream);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sticker);
  padding: 0.35em 0.85em 0.3em;
  margin-bottom: clamp(1.25rem, 3vh, 2rem);
  transform: rotate(calc(var(--tilt-3) / 2));
}

.difference__col--drop .difference__label {
  background: var(--cherry);
  color: var(--white);
  transform: rotate(calc(var(--tilt-2) / 2));
}

/* Demarcation between the two halves: rule on top when stacked, on the left side-by-side */
.difference__col--drop {
  border-top: var(--border-w) solid color-mix(in srgb, var(--chocolate) 25%, transparent);
  padding-top: clamp(1.5rem, 4vh, 2.5rem);
}

.dead-email {
  background: var(--cream);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(1.25rem, 3vw, 2rem);
  opacity: 0.65;
}
.dead-email p { margin-bottom: 0.5rem; }
.dead-email hr {
  border: 0;
  border-top: var(--border-w) solid var(--chocolate);
  opacity: 0.2;
  margin: 1rem 0;
}
.dead-email__fate { opacity: 0.6; }

.difference__note { margin-top: 1rem; opacity: 0.75; }

.chat {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat__row { max-width: 85%; }
.chat__row--sender { align-self: flex-end; text-align: right; }

.bubble {
  display: inline-block;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-bubble);
  border: var(--border-w) solid var(--border);
  text-align: left;
  position: relative;
}

.bubble--them {
  background: var(--white);
  color: var(--ink);
  border-bottom-left-radius: calc(var(--radius-bubble) / 5);
}

.bubble--sender {
  background: var(--cherry);
  color: var(--white);
  border-bottom-right-radius: calc(var(--radius-bubble) / 5);
}

.chat__stamp { margin-top: 0.375rem; opacity: 0.65; }

.stat { margin-top: clamp(1.5rem, 4vh, 2.5rem); }

.stat__num {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 7rem);
  line-height: var(--leading-display);
  color: var(--cherry);
}

/* ---- How it works: cake-box cards ---- */
.how__cards {
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.5rem);
}

.box-card {
  background: var(--cream);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sticker);
  overflow: clip;
  transition: transform var(--dur-hover) var(--ease-out),
              box-shadow var(--dur-hover) var(--ease-out);
}

.box-card:hover {
  transform: rotate(0deg) translate(-2px, -2px);
  box-shadow: var(--shadow-lift);
}

.box-card__lid {
  background: var(--pink);
  border-bottom: var(--border-w) solid var(--border);
  padding: 0.625rem 1.5rem;
  font-weight: 700;
}

.box-card__body { padding: clamp(1.25rem, 3vw, 2rem); }

.box-card h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
  font-weight: 400;
  font-size: var(--text-h3);
  margin-bottom: 0.75rem;
}

.box-card p { margin-bottom: 0.75rem; }

.box-card__note { color: var(--cherry); font-weight: 700; margin-bottom: 0; }

/* ---- The bakers ---- */
.bakers__line { max-width: 38em; margin-bottom: clamp(2rem, 5vh, 3rem); }

.bakers__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: clamp(1.5rem, 4vh, 2.5rem);
}

.bakers__row li {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-display);
  font-size: var(--text-h3);
  background: var(--cream);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sticker);
  padding: 0.375em 0.875em;
}

.bakers__row li:nth-child(odd)  { transform: rotate(calc(var(--tilt-3) / 2)); }
.bakers__row li:nth-child(even) { transform: rotate(calc(var(--tilt-2) / 2)); }

/* ---- Proof / gallery ---- */
.gallery {
  columns: 2;
  column-gap: clamp(1.25rem, 3vw, 2rem);
}

.gallery .ph {
  break-inside: avoid;
  margin-bottom: clamp(1.5rem, 3.5vw, 2.25rem);
}

.pullquote {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  max-width: 22em;
}

.pullquote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-h3);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.pullquote cite { font-style: normal; opacity: 0.75; }

/* ---- Waitlist ---- */
.waitlist__sub { max-width: 32em; margin-bottom: clamp(1.5rem, 4vh, 2.5rem); }

.waitlist__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 36rem;
}

.waitlist__input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.25rem;
  color: var(--ink);
  background: var(--cream);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.waitlist__input:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 var(--border-w) var(--cherry);
}

.waitlist__input::placeholder { color: var(--ink); opacity: 0.5; }

.waitlist__success {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-h3);
  margin-top: 1rem;
}

.waitlist__error { margin-top: 1rem; font-weight: 700; }

.waitlist__trust { margin-top: clamp(1.5rem, 4vh, 2.5rem); opacity: 0.9; }

/* ---- Footer ---- */
.footer { padding-bottom: 0; }

.footer__contact { margin-bottom: 0.75rem; }
.footer__contact a { text-underline-offset: 3px; }

.footer__line {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-h3);
}

.footer__wordmark {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-display);
  line-height: 0.75;
  font-size: clamp(4.5rem, 17vw, 15rem);
  white-space: nowrap;
  text-align: center;
  color: var(--cream);
  margin-top: clamp(1.5rem, 4vh, 3rem);
  margin-bottom: -0.22em; /* bleed off the bottom edge */
}

/* ==========================================================================
   Breakpoint: 48rem (tablet)
   ========================================================================== */
@media (min-width: 48rem) {
  .tilt-1 { transform: rotate(var(--tilt-1)); }
  .tilt-2 { transform: rotate(var(--tilt-2)); }
  .tilt-3 { transform: rotate(var(--tilt-3)); }
  .bakers__row li:nth-child(odd)  { transform: rotate(var(--tilt-3)); }
  .bakers__row li:nth-child(even) { transform: rotate(var(--tilt-2)); }

  .hero__strip { grid-template-columns: repeat(4, 1fr); }

  .difference__split { grid-template-columns: 1fr 1.2fr; }
  .difference__col--drop {
    border-top: 0;
    padding-top: 0;
    border-left: var(--border-w) solid color-mix(in srgb, var(--chocolate) 25%, transparent);
    padding-left: clamp(1.5rem, 3vw, 2.5rem);
  }

  .how__cards { grid-template-columns: repeat(3, 1fr); }

  .gallery { columns: 3; }

  .waitlist__form { flex-direction: row; }
  .waitlist__input { flex: 1; }
}

/* ==========================================================================
   Breakpoint: 64rem (desktop)
   ========================================================================== */
@media (min-width: 64rem) {
  .hero__strip figure:nth-child(2),
  .hero__strip figure:nth-child(4) { margin-top: 2.5rem; }

  .pullquote { margin-inline: auto; text-align: center; }
}

/* ---- Reduced motion: neutralize tilts' hover motion & transitions ---- */
@media (prefers-reduced-motion: reduce) {
  .box-card, .btn { transition: none; }
}
