/* ============================================================
   churrrn — marketing site
   styles.css — theme tokens, typography, layout, sections
   (the illustration lives in scene.css)
   ============================================================ */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/inter-var.woff2") format("woff2");
}

/* ---------- Design tokens (hand-tweak here) ---------- */
:root {
  color-scheme: light dark;

  /* brand — lifted from the iOS app's asset catalog */
  --butter:      #FFF6DC;               /* app "Butter" background        */
  --ink:         #26200F;               /* warm near-black text           */
  --yellow:      #FFB811;               /* logo yellow                    */
  --text-yellow: #D99400;               /* app "TextYellow" highlight     */

  /* surfaces */
  --panel:    rgba(255, 255, 255, .72); /* glassy card surface            */
  --panel-solid: #FFFDF4;
  --hairline: rgba(38, 32, 15, .10);    /* 1px borders                    */
  --muted:    rgba(38, 32, 15, .62);

  /* elevation */
  --shadow-soft: 0 1px 2px rgba(38, 32, 15, .05),
                 0 16px 40px -16px rgba(38, 32, 15, .22);
  --shadow-lift: 0 2px 4px rgba(38, 32, 15, .06),
                 0 28px 60px -20px rgba(38, 32, 15, .30);

  /* type */
  --font: "Inter", -apple-system, "Segoe UI", sans-serif;

  /* shape */
  --slab-radius: 32px;
  --chip-radius: 18px;

  /* motion */
  --ease-butter: cubic-bezier(.22, 1, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --butter:      #211D15;             /* deepened take on app dark      */
    --ink:         #FFF3D6;
    --text-yellow: #FFC93C;

    --panel:       rgba(48, 42, 31, .72);
    --panel-solid: #2B261C;
    --hairline:    rgba(255, 243, 214, .12);
    --muted:       rgba(255, 243, 214, .60);

    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .25),
                   0 16px 40px -16px rgba(0, 0, 0, .55);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .30),
                   0 28px 60px -20px rgba(0, 0, 0, .65);
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

/* clip on the root — scene elements intentionally bleed past the
   viewport edge on mobile, and this keeps them from creating
   horizontal scroll */
html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--butter);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Display type: tight, confident, sentence case */
.display {
  font-weight: 680;
  line-height: 1.06;
  letter-spacing: -.032em;
  margin: 0 0 .4em;
  text-wrap: balance;
}

h1.display { font-size: clamp(2.6rem, 5.2vw, 4rem); }
h2.display { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }

.hl { color: var(--text-yellow); }

.eyebrow {
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .75rem;
  color: var(--text-yellow);
  margin: 0 0 1.25rem;
}

.body {
  max-width: 38ch;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  color: var(--muted);
  font-weight: 480;
  margin: 0;
}

.lede {
  max-width: 40ch;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--muted);
  font-weight: 480;
  margin: 0;
}

.kicker {
  font-size: .9rem;
  font-weight: 550;
  color: var(--muted);
  margin-top: 3.5rem;
}

/* ---------- Header ---------- */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.4rem clamp(1.25rem, 4vw, 3rem);
}

.header-logo {
  width: 108px;
  height: auto;
  filter: drop-shadow(0 1px 0 rgba(38, 32, 15, .12));
}

/* ---------- Buttons ---------- */
.cta-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2.25rem;
}

.btn {
  display: inline-block;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: -.01em;
  color: var(--butter);
  background: var(--ink);
  text-decoration: none;
  padding: .8em 1.6em;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  transition: transform .25s var(--ease-butter),
              box-shadow .25s var(--ease-butter);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.btn-small { padding: .6em 1.25em; font-size: .85rem; }

.btn-dark { background: #26200F; color: #FFF6DC; }

@media (prefers-color-scheme: dark) {
  /* over the dark footer the ink pill vanishes — go yellow */
  .btn-dark { background: var(--yellow); color: #26200F; }
}

.cta-note { font-weight: 550; font-size: .85rem; color: var(--muted); }

/* ---------- Story layout (copy left, sticky scene right) ---------- */
.story {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(1rem, 4vw, 4rem);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.story-copy { min-width: 0; }

.step {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 0;
}

.step.hero { min-height: 100vh; }

/* sticky rail that hosts the illustration */
.scene-rail { min-width: 0; }

.scene-viewport {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: visible;
}

/* ---------- Section shells ---------- */
.slab {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 6rem) clamp(1.25rem, 4vw, 3rem);
}

/* ---------- More features ---------- */
.more { text-align: center; }
.more .body { margin: 0 auto; max-width: 44ch; }

.more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 3rem;
  text-align: left;
}

.more-card {
  padding: 1.5rem 1.5rem 1.65rem;
  background: var(--panel-solid);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  transition: transform .3s var(--ease-butter), box-shadow .3s var(--ease-butter);
}

.more-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.more-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 184, 17, .16);
  color: var(--text-yellow);
  margin-bottom: 1rem;
}

.more-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.more-card h3 {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -.015em;
  margin: 0 0 .35rem;
}

.more-card p {
  font-size: .9rem;
  color: var(--muted);
  margin: 0;
}

/* ---------- Footer: butter, on a plate ---------- */
.footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) 1rem 2rem;
  text-align: center;
}

.butter-stage {
  position: relative;
  perspective: 1100px;
  /* warm spotlight behind the plate */
  background: radial-gradient(58% 52% at 50% 58%, rgba(255, 184, 17, .16), transparent 70%);
}

.butter-tilt {
  position: relative;
  width: min(760px, 100%);
  aspect-ratio: 800 / 520;
  margin: 0 auto;
  transform-style: preserve-3d;
  transition: transform .3s var(--ease-butter);
  animation: butter-sway 11s ease-in-out infinite alternate;
  will-change: transform;
}

.butter-tilt.is-live {
  animation: none;
  transition: transform .18s ease-out;
}

@keyframes butter-sway {
  from { transform: rotateY(-4deg) rotateX(2deg); }
  to   { transform: rotateY(4deg)  rotateX(-1.5deg); }
}

.butter-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* the stick floats a plane above the plate — this is the 3d */
.butter-layer.plate { transform: translateZ(0); }
.butter-layer.stick { transform: translateZ(52px); }

/* debossed stamp on the front face */
.stamp {
  font-family: var(--font);
  font-size: 30px;
  font-weight: 650;
  letter-spacing: .18em;
}
.stamp-dark  { fill: rgba(158, 113, 22, .48); }
.stamp-light { fill: rgba(255, 250, 225, .6); }

/* CTA overlaid on the scene */
.footer-copy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 4.5%;
  pointer-events: none;
}

.footer-copy .display { margin-bottom: .2em; }
.footer-copy .body { color: var(--muted); }
.footer-copy .btn {
  pointer-events: auto;
  margin-top: 1.4rem;
}

.fine {
  margin-top: 1rem;
  font-size: .8rem;
  font-weight: 550;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .butter-tilt { animation: none; }
}

/* small screens: the copy stacks above the plate instead of overlaying */
@media (max-width: 640px) {
  .butter-stage { display: flex; flex-direction: column; }
  .footer-copy {
    position: static;
    order: -1;
    padding: 0 0 1.5rem;
  }
}

/* ---------- Mobile: flat sections, each with its own scene ---------- */
/* No pinned stage — the sticky rail is hidden and every step shows an
   inline scene frozen in its state (built by script.js, styled in
   scene.css), with the ambient float turned up. */
@media (max-width: 880px) {
  .story {
    grid-template-columns: 1fr;
  }

  .scene-rail { display: none; }

  .step,
  .step.hero {
    min-height: 0;
    padding: 3.5rem 0 1rem;
  }

  .step.hero { padding-top: 7.5rem; }  /* clear the absolute header */

  .kicker { margin-top: 1.75rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .2s !important;
  }
}
