/* ============================================================
   BestInSlot — cel-shaded / comic-book homepage
   ============================================================ */

:root {
  /* —— palette: "newsprint pop" —— */
  --paper:   #F6EEDD;
  --paper-2: #EFE4CC;
  --ink:     #171410;
  --pop:     #FF4D2E;   /* vermilion  */
  --sun:     #FFC73C;   /* sunny      */
  --cool:    #2F6FED;   /* comic blue */
  --paper-ink: rgba(23, 20, 16, 0.12);

  /* —— cel-shading primitives —— */
  --line: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --shadow-lg: 10px 10px 0 var(--ink);
  --radius: 14px;

  /* —— type —— */
  --display: "Bricolage Grotesque", "Arial Black", sans-serif;
  --comic:   "Bangers", "Impact", sans-serif;
  --body:    "Hanken Grotesk", system-ui, sans-serif;

  --maxw: 1200px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background-color: var(--paper);
  /* halftone Ben-Day dots + faint comic panel grid */
  background-image:
    radial-gradient(var(--paper-ink) 1px, transparent 1.6px),
    linear-gradient(var(--paper-ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-ink) 1px, transparent 1px);
  background-size: 14px 14px, 88px 88px, 88px 88px;
  background-position: 0 0, 0 0, 0 0;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

img, svg { display: block; max-width: 100%; }

/* the [hidden] attribute must always win over component display rules
   (used to toggle the form row / fineprint / success burst) */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* honeypot: kept in the DOM (bots fill it) but off-screen for real users.
   Deliberately NOT display:none, which many bots skip. */
.hp {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

/* ---------- shared comic button ---------- */
.btn {
  --bg: var(--paper);
  display: inline-flex; align-items: center; gap: .5ch;
  font-family: var(--body);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  background: var(--bg);
  border: var(--line);
  border-radius: 999px;
  padding: .72em 1.25em;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover  { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--cool); outline-offset: 3px; }

.btn--pop { --bg: var(--pop); color: #fff; }
.btn--nav { padding: .55em 1.1em; }
.btn--lg  { font-size: 1.12rem; padding: .9em 1.6em; box-shadow: var(--shadow); }
.btn--lg:hover { box-shadow: 3px 3px 0 var(--ink); }

/* ============================================================
   BRAND (used in the footer)
   ============================================================ */
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.brand__mark {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  background: var(--paper);
  border: var(--line); border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease;
}
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.05); }
.brand__word {
  font-family: var(--display);
  font-weight: 800; font-size: 1.4rem; letter-spacing: -0.03em;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  max-width: var(--maxw); margin: 0 auto;
  /* size the hero so the TOP of the comic panels below peeks above the
     fold (the subtracted px ≈ how much of the panels shows) */
  min-height: calc(100vh - 188px);
  min-height: calc(100svh - 188px);
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: clamp(1.5rem, 4vh, 3rem) clamp(1rem, 5vw, 2rem) 0.5rem;
}

.hero__inner {
  position: relative; z-index: 5;
  max-width: 760px;
  display: flex; flex-direction: column; align-items: center;
  margin: auto 0;
}

/* —— headline —— */
.hero__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 5.4rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0 0 0.85rem;
  text-wrap: balance;
}
/* highlighted word: tilted pop swatch w/ outlined lettering */
.hl {
  position: relative;
  display: inline-block;
  color: var(--paper);
  -webkit-text-stroke: 2px var(--ink);
  padding: 0 .12em;
  transform: rotate(-2deg);
}
.hl::before {
  content: ""; position: absolute; inset: .08em -.05em .06em;
  background: var(--pop);
  border: var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  z-index: -1;
}

.hero__caption {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-weight: 500;
  color: #2b2620;
  max-width: 52ch;
  margin: 0 0 1.25rem;
  text-wrap: pretty;
}

/* —— waitlist form —— */
.waitlist { width: 100%; max-width: 520px; }
.waitlist__row {
  display: flex; gap: .6rem;
  background: var(--paper);
  border: var(--line); border-radius: 999px;
  padding: .4rem .4rem .4rem .35rem;
  box-shadow: var(--shadow);
}
.waitlist__input {
  flex: 1; min-width: 0;
  border: none; background: transparent;
  font-family: var(--body); font-size: 1.05rem; font-weight: 600;
  color: var(--ink);
  padding: .6em 1em;
  border-radius: 999px;
}
.waitlist__input::placeholder { color: #8a8073; font-weight: 500; }
.waitlist__input:focus { outline: none; }
.waitlist__row:focus-within { box-shadow: var(--shadow), 0 0 0 3px var(--sun) inset; }
.waitlist__row.shake { animation: shake .4s ease; }

.waitlist__status {
  min-height: 1.4em;
  margin: .75rem 0 0;
  font-weight: 700; font-size: .95rem;
  color: var(--pop);
}

/* success burst */
.success {
  position: relative;
  width: clamp(170px, 44vw, 210px);
  aspect-ratio: 1;
  margin: .5rem auto 0;
  display: grid; place-items: center;
  animation: pop-in .45s cubic-bezier(.2,1.4,.4,1) both;
}
.success__burst { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin-slow 16s linear infinite; }
.success__text {
  position: relative; z-index: 2;
  font-family: var(--comic);
  font-size: clamp(1.5rem, 5vw, 2rem);
  line-height: .92;
  color: var(--ink);
  text-align: center;
  transform: rotate(-6deg);
}

.hero__fineprint {
  margin: 0.9rem 0 0;
  font-size: .9rem; font-weight: 600;
  color: #6f6557;
}

/* ---------- floating stickers ---------- */
.stickers { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.sticker { position: absolute; filter: drop-shadow(4px 4px 0 var(--ink)); }

.sticker--star {
  top: 11%; left: 4%;
  width: clamp(74px, 9vw, 118px); aspect-ratio: 1;
  display: grid; place-items: center;
  transform: rotate(-12deg);
  animation: bob 4.5s ease-in-out infinite;
}
.sticker--star svg { position: absolute; inset: 0; filter: none; }
.sticker__label {
  position: relative;
  font-family: var(--comic); font-size: clamp(1rem, 1.7vw, 1.35rem);
  color: var(--ink); transform: rotate(-6deg);
}

.sticker--speed {
  top: 20%; right: 5%;
  width: clamp(70px, 9vw, 120px);
  transform: rotate(6deg);
  animation: bob 5.5s ease-in-out infinite .4s;
  filter: none;
}

.sticker--card {
  bottom: 13%; right: 7%;
  width: clamp(96px, 12vw, 150px);
  transform: rotate(7deg);
  animation: bob 6s ease-in-out infinite .2s;
}
.minicard {
  background: var(--paper); border: var(--line); border-radius: 10px;
  padding: 9px; box-shadow: var(--shadow-sm);
}
.minicard__img {
  height: 52px; border: 2.5px solid var(--ink); border-radius: 6px;
  background:
    radial-gradient(circle at 70% 30%, var(--sun) 0 22%, transparent 23%),
    linear-gradient(135deg, var(--cool) 0 55%, var(--pop) 55%);
  margin-bottom: 8px;
}
.minicard__bar { height: 8px; background: var(--ink); border-radius: 4px; margin-top: 6px; }
.minicard__bar--short { width: 60%; background: var(--pop); }

.sticker--bolt {
  bottom: 16%; left: 6%;
  width: clamp(46px, 5.5vw, 70px);
  transform: rotate(-8deg);
  animation: bob 5s ease-in-out infinite .8s;
  filter: none;
}

/* ============================================================
   FLOW — the 3-panel comic strip
   ============================================================ */
.flow {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(.6rem, 1.5vh, 1.1rem) clamp(1rem, 5vw, 2rem) clamp(3.5rem, 8vh, 6rem);
}
/* strip layout */
.strip {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: clamp(.5rem, 1.5vw, 1.1rem);
}

/* —— panel —— */
.panel {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--paper);
  border: var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.4rem 1.6rem;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
/* halftone corner */
.panel::after {
  content: ""; position: absolute; top: -10px; right: -10px;
  width: 96px; height: 96px;
  background-image: radial-gradient(var(--ink) 2px, transparent 2.4px);
  background-size: 11px 11px;
  opacity: .22; pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at top right, #000 40%, transparent 72%);
          mask-image: radial-gradient(circle at top right, #000 40%, transparent 72%);
}
.panel:hover { transform: translate(-2px, -4px); box-shadow: var(--shadow-lg); }

.panel__head {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1rem;
}
.panel__num {
  font-family: var(--comic);
  font-size: 2.4rem; line-height: 0.8;
  color: var(--pop);
  -webkit-text-stroke: 1.5px var(--ink);
}
.panel[data-stage="2"] .panel__num { color: var(--cool); }
.panel[data-stage="3"] .panel__num { color: var(--sun); }

.panel__kicker {
  font-family: var(--body); font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; font-size: 1.05rem;
  color: #4a443a; line-height: 1.1;
}

/* art window */
.panel__art {
  position: relative;
  border: 2.5px solid var(--ink); border-radius: 10px;
  background: var(--paper-2);
  height: 158px; margin-bottom: 1.2rem;
  overflow: hidden;
  display: grid; place-items: center;
}

/* PANEL 1 — ideation */
.panel__art--ideate { background:
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(47,111,237,.06) 10px 20px), var(--paper-2); }
.thought { display: flex; flex-direction: column; gap: .4rem; padding: .9rem; width: 100%; }
.chip {
  align-self: flex-start;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 999px;
  font-size: .72rem; font-weight: 700; padding: .28em .8em;
  box-shadow: 2.5px 2.5px 0 var(--ink);
}
.chip--alt { align-self: flex-end; background: var(--sun); }
.bulb { position: absolute; right: 10px; bottom: 8px; width: 42px; height: 42px; filter: drop-shadow(2px 2px 0 var(--ink)); }

/* PANEL 2 — media */
.frame { position: relative; width: 100%; height: 100%; }
.frame__scene {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #bfe0ff 0 58%, #9fd27a 58%);
  overflow: hidden;
}
.scene__sun {
  position: absolute; top: 16px; left: 22px; width: 40px; height: 40px;
  background: var(--sun); border: 2.5px solid var(--ink); border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(255,199,60,.35);
}
.scene__hill {
  position: absolute; bottom: 0; right: -20px; width: 120px; height: 70px;
  background: #6fae4f; border: 2.5px solid var(--ink); border-radius: 50%;
}
.scene__product {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%) rotate(-6deg);
  width: 46px; height: 60px;
  background: var(--pop); border: 2.5px solid var(--ink); border-radius: 6px;
  box-shadow: 3px 3px 0 var(--ink);
}
.frame__render {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--comic); font-size: .82rem; letter-spacing: .03em;
  color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: 6px;
  padding: 1px 7px; box-shadow: 2px 2px 0 var(--ink);
  animation: pulse 1.5s ease-in-out infinite;
}

/* PANEL 3 — copy */
.panel__art--copy { background:
    radial-gradient(var(--paper-ink) 1.4px, transparent 1.8px) 0 0 / 12px 12px, var(--paper-2); }
.bubble {
  position: relative; width: 86%;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px;
  padding: .8rem .9rem 1rem; box-shadow: 3px 3px 0 var(--ink);
}
.bubble::after { /* tail */
  content: ""; position: absolute; left: 26px; bottom: -14px;
  width: 22px; height: 22px;
  background: var(--paper);
  border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink);
  transform: rotate(45deg);
}
.bubble__head { display: block; font-family: var(--display); font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; margin-bottom: .5rem; }
.bubble__line { display: block; height: 7px; background: var(--ink); border-radius: 4px; margin: .35rem 0; opacity: .8; }
.bubble__line--short { width: 62%; }
.bubble__cta {
  display: inline-block; margin-top: .6rem;
  background: var(--cool); color: #fff;
  font-weight: 800; font-size: .76rem;
  border: 2.5px solid var(--ink); border-radius: 999px;
  padding: .25em .8em; box-shadow: 2.5px 2.5px 0 var(--ink);
}

.panel__title {
  font-family: var(--display); font-weight: 700;
  font-size: 1.32rem; letter-spacing: -.02em; line-height: 1.1;
  margin: 0 0 .5rem;
}
.panel__body { margin: 0; font-size: .98rem; color: #3a342c; }

/* arrows between panels */
.arrow {
  align-self: center;
  width: clamp(36px, 4vw, 64px);
  animation: nudge 1.6s ease-in-out infinite;
}

/* flow CTA */
.flow__cta { text-align: center; margin-top: clamp(2.5rem, 6vh, 4rem); }
.flow__cta-note { margin: 1rem 0 0; font-weight: 600; color: #6f6557; }

/* ============================================================
   FOOTER
   ============================================================ */
.foot {
  background: var(--ink);
  color: var(--paper);
  border-top: var(--line);
  margin-top: 2rem;
  padding: clamp(2.2rem, 6vh, 3.4rem) clamp(1rem, 5vw, 2rem) 1.6rem;
}
.foot__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem;
}
.brand--foot .brand__mark { background: transparent; border-color: var(--paper); box-shadow: 3px 3px 0 var(--pop); }
.brand--foot .brand__word { color: var(--paper); }
.foot__tag { margin: 0; font-weight: 600; color: #d8cdb6; flex: 1 1 240px; }
.foot__links { display: flex; gap: 1.4rem; }
.foot__links a {
  text-decoration: none; font-weight: 700; color: var(--paper);
  border-bottom: 2px solid transparent; padding-bottom: 2px;
  transition: border-color .15s ease;
}
.foot__links a:hover { border-color: var(--sun); }
.foot__copy {
  max-width: var(--maxw); margin: 1.6rem auto 0;
  font-family: var(--comic); letter-spacing: .04em;
  color: #b6ab93; font-size: .95rem;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
@keyframes pop-in {
  0% { transform: scale(.4) rotate(-12deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes bob {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
/* stickers carry a rotation, so bob must preserve it */
.sticker--star { animation-name: bob-star; }
@keyframes bob-star { 0%,100% { transform: rotate(-12deg) translateY(0);} 50% { transform: rotate(-12deg) translateY(-9px);} }
.sticker--speed { animation-name: bob-speed; }
@keyframes bob-speed { 0%,100% { transform: rotate(6deg) translateY(0);} 50% { transform: rotate(6deg) translateY(-9px);} }
.sticker--card { animation-name: bob-card; }
@keyframes bob-card { 0%,100% { transform: rotate(7deg) translateY(0);} 50% { transform: rotate(7deg) translateY(-11px);} }
.sticker--bolt { animation-name: bob-bolt; }
@keyframes bob-bolt { 0%,100% { transform: rotate(-8deg) translateY(0);} 50% { transform: rotate(-8deg) translateY(-8px);} }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes nudge { 0%,100% { transform: translateX(0);} 50% { transform: translateX(5px);} }
@keyframes spin-slow { to { transform: rotate(360deg); } }

/* ---------- reveal on load (hero) ---------- */
.reveal-load { opacity: 1; }
html.js .reveal-load {
  opacity: 0; transform: translateY(22px) rotate(-.4deg);
  animation: reveal-up .6s cubic-bezier(.2,.8,.3,1) forwards;
  animation-delay: calc(var(--d, 0) * 110ms + 150ms);
}
@keyframes reveal-up {
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

/* ---------- reveal on scroll (flow CTA only) ---------- */
.reveal { opacity: 1; }
html.js .reveal {
  opacity: 0; transform: translateY(28px) scale(.97) rotate(-.6deg);
  transition: opacity .55s ease, transform .55s cubic-bezier(.2,1.1,.3,1);
}
html.js .reveal.in-view { opacity: 1; transform: none; }

/* ---------- comic panels: visible on load ---------- */
/* The strip renders immediately — no scroll/IntersectionObserver dependency,
   so a post-load layout shift (e.g. web fonts swapping in) can never leave it
   hidden. The entrance is opacity-only and CSS-only: it never animates
   transform (so the hover lift still works) and shows even if JS doesn't run. */
@media (prefers-reduced-motion: no-preference) {
  .strip > * { animation: panel-fade .45s ease both; }
  .strip > *:nth-child(2) { animation-delay: .07s; }
  .strip > *:nth-child(3) { animation-delay: .14s; }
  .strip > *:nth-child(4) { animation-delay: .21s; }
  .strip > *:nth-child(5) { animation-delay: .28s; }
}
@keyframes panel-fade { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .strip {
    grid-template-columns: 1fr;
    gap: .4rem;
    max-width: 460px; margin: 0 auto;
  }
  .arrow {
    width: 40px; justify-self: center;
    transform: rotate(90deg);
    animation-name: nudge-down;
  }
  @keyframes nudge-down { 0%,100% { transform: rotate(90deg) translateX(0);} 50% { transform: rotate(90deg) translateX(5px);} }

  .sticker--speed, .sticker--bolt { display: none; }
  .sticker--star { top: 6%; left: 2%; }
  .sticker--card { bottom: 8%; right: 2%; }
}

@media (max-width: 560px) {
  .stickers { display: none; }
  .waitlist__row { flex-direction: column; border-radius: 18px; padding: .5rem; }
  .waitlist__input { text-align: center; }
  .btn--pop { justify-content: center; }
  .hero { min-height: auto; padding-top: 2.5rem; padding-bottom: 3rem; }
  .foot__inner { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  html.js .reveal,
  html.js .reveal-load { opacity: 1 !important; transform: none !important; }
}
