/* The Loaf Logic, one page. The banner come to life: gingham table, cream
   taped card, warm golden light, dust in the air, a slice peeking out. */

@font-face {
  font-family: 'Poppins';
  src: url('fonts/Poppins-800.woff') format('woff');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #4E84BE;
  --blue-light: #B2CBE4;
  --cream: #FAF3E4;
  --brown: #6E4628;
  --red: #CC4048;
  /* the brand red, deepened a touch so cream text passes AA at small sizes */
  --red-ink: #C23A43;
  --crust: #C47634;
  --ink: #191414;
  --tape-pink: #E87880;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: Georgia, 'Times New Roman', Times, serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Hero stage: the living room video + atmosphere ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
}

.stage { position: absolute; inset: 0; overflow: hidden; }

.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--brown); /* shows if poster is missing */
}

.atmo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* warm golden light-leak, where the sun comes in, top left */
.leak {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, rgba(255, 214, 140, 0.26) 0%, rgba(255, 214, 140, 0) 46%),
    radial-gradient(115% 85% at 6% 0%, rgba(255, 196, 96, 0.34) 0%, rgba(255, 196, 96, 0) 58%);
}

/* soft vignette so the edges settle back into the room */
.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(135% 115% at 50% 40%, rgba(40, 16, 4, 0) 52%, rgba(40, 16, 4, 0.38) 100%);
}

/* floating dust motes, mostly in the upper left light */
.motes {
  position: absolute;
  inset: 0;
}

.motes i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: #FFE9C4;
  box-shadow: 0 0 6px 1px rgba(255, 214, 140, 0.75);
  filter: blur(0.5px);
  opacity: 0;
  animation:
    mote-drift var(--t) ease-in-out var(--dl) infinite alternate,
    mote-twinkle calc(var(--t) * 0.85) ease-in-out var(--dl) infinite;
}

@keyframes mote-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(16px, -22px); }
}

@keyframes mote-twinkle {
  0%, 100% { opacity: var(--o, 0.7); }
  50%      { opacity: 0.12; }
}

/* ---------- The banner card ---------- */

.card-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6vh;
  z-index: 1;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.card-shift { pointer-events: none; }

.card {
  position: relative;
  width: min(720px, 90vw);
  padding: 36px 44px 34px;
  background: var(--cream);
  border-radius: 28px;
  box-shadow:
    0 20px 44px rgba(50, 26, 8, 0.35),
    0 4px 10px rgba(50, 26, 8, 0.22);
  transform: rotate(-1.2deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  pointer-events: auto;
}

/* washi tape on the top corners */
.tape {
  position: absolute;
  top: -13px;
  width: 84px;
  height: 26px;
  border-radius: 2px;
  background:
    repeating-linear-gradient(45deg, var(--tape-pink) 0 7px, rgba(255, 255, 255, 0.6) 7px 10px);
  opacity: 0.88;
  box-shadow: 0 2px 4px rgba(50, 26, 8, 0.18);
}

.tape-l { left: -28px;  transform: rotate(-32deg); }
.tape-r { right: -28px; transform: rotate(32deg); }

.wordmark {
  margin: 0;
  font-family: Georgia, 'Times New Roman', Times, serif;
  font-weight: 700;
  font-size: clamp(2.3rem, 5.4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--blue);
  text-shadow: 0.07em 0.07em 0 var(--brown);
}

.tagline {
  margin: 0;
  font-family: 'Poppins', Georgia, serif;
  font-weight: 800;
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  color: var(--brown);
  white-space: nowrap;
}

.shorts-row {
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.note-shorts { display: block; width: 150px; height: auto; }

.pill {
  margin: 0;
  font-family: 'Poppins', Georgia, serif;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--cream);
  background: var(--red-ink);
  padding: 0.5em 1.3em;
  border-radius: 999px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 56px;
  padding: 12px 26px;
  border-radius: 999px;
  font-family: 'Poppins', Georgia, serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--cream);
  text-decoration: none;
  box-shadow: 0 2px 0 rgba(26, 17, 10, 0.25);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }

.btn:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 3px;
}

.btn-yt { background: var(--red-ink); }
.btn-tt { background: var(--ink); }

/* the red hand written note under the buttons, arrow curling at the YouTube one */
.note-please {
  display: block;
  width: 280px;
  height: auto;
  margin: 8px auto -14px;
  transform: translateX(-52px) rotate(-2deg);
}

/* the slice peeking up from the card's bottom right, cut by the card edge */
.peek {
  position: absolute;
  right: 5.5%;
  bottom: 0;
  width: 100px;
  height: 74px;
  overflow: hidden;
  cursor: pointer;
}

.peek img {
  display: block;
  width: 100%;
  height: auto;
  transform: rotate(-9deg);
  transform-origin: 50% 88%;
}

.peek:hover img,
.peek.wiggling img {
  animation: slice-wiggle 0.8s ease-in-out;
}

@keyframes slice-wiggle {
  0%, 100% { transform: rotate(-9deg); }
  20%      { transform: rotate(-4deg) scale(1.02, 0.97); }
  45%      { transform: rotate(-14deg) translateY(-3px); }
  70%      { transform: rotate(-6deg) scaleY(1.01); }
}

/* little crust crumbs beside the slice */
.crumb {
  position: absolute;
  border-radius: 50%;
  background: var(--crust);
  opacity: 0.85;
}

.c1 { width: 6px; height: 6px; right: calc(5.5% + 116px); bottom: 16px; }
.c2 { width: 4px; height: 4px; right: calc(5.5% + 132px); bottom: 34px; }
.c3 { width: 5px; height: 5px; right: calc(5.5% + 108px); bottom: 44px; }

/* ---------- The table: gingham floor with a taped label ---------- */

.foot {
  padding: 40px 18px 46px;
  background-color: var(--cream);
  background-image:
    repeating-linear-gradient(90deg, rgba(78, 132, 190, 0.30) 0 34px, transparent 34px 68px),
    repeating-linear-gradient(0deg, rgba(178, 203, 228, 0.55) 0 34px, transparent 34px 68px);
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.6;
}

.foot-label {
  position: relative;
  display: inline-block;
  max-width: 560px;
  padding: 20px 26px 16px;
  background: var(--cream);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(50, 26, 8, 0.22);
  transform: rotate(-1deg);
}

.foot-label p { margin: 0 0 6px; color: var(--brown); }
.foot-label p:last-child { margin: 0; opacity: 0.85; font-size: 0.82rem; }

.tape-mid {
  left: 50%;
  top: -13px;
  width: 74px;
  height: 24px;
  transform: translateX(-50%) rotate(3deg);
}

/* ---------- Mobile: video on top, card on the gingham cloth ---------- */

@media (max-width: 700px) {
  .hero {
    min-height: 0;
    display: flex;
    flex-direction: column;
    /* the cloth the card sits on, below the video */
    background-color: var(--cream);
    background-image:
      repeating-linear-gradient(90deg, rgba(78, 132, 190, 0.30) 0 34px, transparent 34px 68px),
      repeating-linear-gradient(0deg, rgba(178, 203, 228, 0.55) 0 34px, transparent 34px 68px);
  }

  .stage { position: relative; inset: auto; }

  .hero-media {
    position: static;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
  }

  .card-wrap {
    position: static;
    margin-top: -40px;
    z-index: 1;
  }

  .card {
    width: min(720px, 90vw);
    padding: 28px 20px 26px;
    gap: 10px;
  }

  /* smaller tape overhang so nothing runs past the screen edge at 360px */
  .tape {
    width: 74px;
    height: 24px;
    top: -12px;
  }

  .tape-l { left: -10px; transform: rotate(-32deg); }
  .tape-r { right: -10px; transform: rotate(32deg); }

  .wordmark { font-size: clamp(2.1rem, 9.5vw, 2.7rem); }

  .tagline {
    white-space: normal;
    max-width: 22rem;
    line-height: 1.35;
  }

  .shorts-row { gap: 8px; }
  .note-shorts { width: 118px; }

  .pill { font-size: 0.78rem; }

  /* buttons stack full width inside the card */
  .cta {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .cta .btn {
    width: 100%;
    justify-content: center;
    min-height: 52px;
  }

  .note-please {
    width: 200px;
    margin: 6px auto -6px;
    transform: translateX(-18px) rotate(-2deg);
  }

  .peek { right: 4%; width: 78px; height: 58px; }

  .c1 { right: calc(4% + 92px); bottom: 13px; }
  .c2 { right: calc(4% + 106px); bottom: 28px; }
  .c3 { bottom: 36px; right: calc(4% + 85px); }

  .foot { padding: 34px 14px 40px; }
  .foot-label { padding: 16px 18px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }

  /* dust settles, everything holds still */
  .motes i { animation: none; opacity: 0.4; }
  .peek img { animation: none !important; transform: rotate(-9deg); }
}

/* Desktop: a flatter card that sits in the clear band under the two faces (hero v2 keeps the lower 35% face-free). */
@media (min-width: 701px) {
  .card-wrap { bottom: 3.5vh; }
  .card { width: min(860px, 92vw); padding: 24px 44px 22px; gap: 9px; }
  .wordmark { font-size: clamp(2.1rem, 3.4vw, 2.9rem); }
  .cta { margin-top: 2px; }
  .note-please { width: 210px; margin: 2px auto -10px; transform: translateX(-70px) rotate(-2deg); }
  .peek { width: 88px; height: 64px; }
}
@media (min-width: 701px) and (max-height: 760px) {
  .tagline { display: none; }
}

/* ---------- Pet reactions: stacked loops, unlockable sound, hint rings ---------- */

/* the dog and cat reaction loops sit exactly over the base video and
   crossfade in while a hotspot is active */
.hero-variant {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease; /* fade back out */
}

.hero-variant.is-on {
  opacity: 1;
  transition: opacity 0.25s ease; /* quicker crossfade in */
}

/* mobile: the base video stays in the flow, the variants cover it */
@media (max-width: 700px) {
  .hero-variant {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }
}

/* small round sound toggle in the hero's top right corner: removed in
   v4; sound now unlocks on the first interaction, so there is no UI */

/* the one-shot invitation: a warm white ring pulsing twice around each animal */
.hint-ring {
  position: absolute;
  border-radius: 50%;
  border: 3px solid rgba(255, 243, 214, 0.55);
  box-shadow:
    0 0 22px 6px rgba(255, 236, 190, 0.45),
    inset 0 0 18px 4px rgba(255, 236, 190, 0.35);
  opacity: 0;
  pointer-events: none;
  animation: hint-pulse 1.3s ease-in-out 2;
}

@keyframes hint-pulse {
  0%   { opacity: 0; transform: scale(0.85); }
  45%  { opacity: 0.5; }
  100% { opacity: 0; transform: scale(1.12); }
}

/* poster only, as in v2: no variant videos, no rings, nothing to hover */
@media (prefers-reduced-motion: reduce) {
  .hero-variant,
  .hint-ring { display: none !important; }
}
