/* Sapora landing — tokens + motion primitives */

:root {
  /* palette — warm editorial */
  --bg: #F6F0E6;
  --bg-2: #EFE7D8;
  --card: #FFFDF8;
  --ink: #1C1B18;
  --ink-2: #3B3A36;
  --muted: #7A766D;
  --muted-2: #A9A497;
  --line: #E7DFCE;
  --line-2: #EFE8D8;

  /* accents */
  --sage: #6a8e4e;
  --sage-deep: #4F6E39;
  --sage-soft: #E7EEDC;
  --terracotta: #D98A3A;
  --amber: #E8B44C;
  --berry: #a44663;

  /* typography */
  --serif: "DM Serif Display", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 22px;
  --edge: max(20px, env(safe-area-inset-left));
}

/* dark mode */
[data-theme="dark"] {
  --bg: #14120F;
  --bg-2: #1C1914;
  --card: #201D18;
  --ink: #F6F0E6;
  --ink-2: #D8D2C4;
  --muted: #8A857A;
  --muted-2: #5F5A50;
  --line: #2E2A23;
  --line-2: #25221C;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
  transition: background 400ms ease, color 400ms ease;
}

a { color: inherit; }
button { font-family: inherit; }

/* Type scale */
.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.94;
}
.serif {
  font-family: var(--serif);
  letter-spacing: -0.01em;
}
.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Word reveal — used on non-hero headings so they get a staggered entry */
.reveal-words .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.reveal-words .word-inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 700ms cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 55ms);
  will-change: transform;
}
.reveal-words.in .word-inner {
  transform: translateY(0);
}
/* Hero title: no stagger animation, render as plain text */
#hero .reveal-words .word-inner {
  transform: none !important;
  opacity: 1 !important;
  transition: none !important;
}

/* Generic reveal on intersection */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 900ms ease, transform 900ms cubic-bezier(0.22, 0.61, 0.36, 1); }
.reveal.in { opacity: 1; transform: translateY(0); }

.reveal-slow { transition-duration: 1200ms; }

/* grain overlay */
.grain::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.07 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.6;
  z-index: 9;
}
[data-theme="dark"] .grain::before { mix-blend-mode: overlay; opacity: 0.4; }

/* navigation */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 14px var(--edge);
  display: flex; align-items: center; justify-content: space-between;
  transition: background 300ms ease, border-color 300ms ease, backdrop-filter 300ms ease;
}
.nav-scrolled {
  background: color-mix(in oklab, var(--bg), transparent 15%);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.nav-left { display: flex; align-items: center; gap: 10px; }
.nav-logo {
  width: 34px; height: 34px; border-radius: 9px; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #f6f0e6 0%, #e7eedc 100%);
  box-shadow: 0 2px 6px rgba(80, 60, 30, 0.12), inset 0 0 0 1px rgba(106,142,78,0.15);
}
.nav-logo img { width: 82%; height: 82%; object-fit: contain; }
.nav-word { font-family: var(--serif); font-size: 20px; letter-spacing: -0.01em; color: var(--ink); }
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--ink-2); }
.nav-links a { text-decoration: none; opacity: 0.82; transition: opacity 200ms; }
.nav-links a:hover { opacity: 1; }
.nav-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink); color: var(--bg);
  padding: 9px 14px 9px 16px; border-radius: 99px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  border: 0; cursor: pointer; transition: transform 180ms;
}
.nav-cta:hover { transform: translateY(-1px); }

@media (max-width: 820px) {
  .nav-links { display: none; }
}

/* section shared */
.section {
  position: relative;
  padding: 120px var(--edge);
  max-width: 1280px;
  margin: 0 auto;
}
.sec-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  color: var(--sage-deep);
  margin-bottom: 22px;
}
.sec-kicker::before {
  content: ""; width: 16px; height: 1px; background: var(--sage-deep);
}
[data-theme="dark"] .sec-kicker { color: var(--sage); }
[data-theme="dark"] .sec-kicker::before { background: var(--sage); }

/* hero-specific */
#hero {
  position: relative;
  min-height: 100vh;
  padding-top: 80px;
  padding-bottom: 32px;
  overflow: hidden;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  align-items: center;
  min-height: calc(100vh - 112px);
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; min-height: auto; padding-bottom: 40px; }
}

.hero-copy { position: relative; z-index: 2; }
.hero-title {
  font-size: clamp(44px, 6.6vw, 96px);
  line-height: 0.94;
  margin: 0;
}
.hero-title em {
  font-style: italic;
  color: var(--sage-deep);
}
[data-theme="dark"] .hero-title em { color: var(--sage); }
.hero-sub {
  margin: 20px 0 24px;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.5;
  max-width: 460px;
  color: var(--ink-2);
}

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.store-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 14px;
  text-decoration: none; border: 0; cursor: pointer;
  transition: transform 200ms;
}
.store-btn:hover { transform: translateY(-2px); }
.store-btn .store-kicker { font-size: 10px; opacity: 0.7; line-height: 1; }
.store-btn .store-name { font-size: 15px; font-weight: 600; line-height: 1.2; }
.store-btn-g {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
}

.hero-meta {
  margin-top: 28px;
  display: flex; gap: 24px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}
.hero-meta strong { display: block; font-family: var(--serif); font-size: 22px; color: var(--ink); font-weight: 400; line-height: 1; margin-bottom: 4px; }

/* Phone showcase */
.hero-chip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  will-change: transform;
}
@media (max-width: 900px) {
  .hero-chip { display: none; }
}
.phone-stage {
  position: relative;
  height: clamp(560px, 80vh, 760px);
  display: grid; place-items: center;
  transform-style: preserve-3d;
  perspective: 1400px;
  overflow: visible;
  margin-right: -30px;
  margin-left: -30px;
}
.phone-shell {
  position: relative;
  z-index: 5;
  width: 260px; height: 536px;
  border-radius: 52px;
  background: #0d0d0d;
  padding: 10px;
  box-shadow:
    0 60px 100px -30px rgba(80, 60, 30, 0.4),
    0 20px 40px -10px rgba(80, 60, 30, 0.2),
    inset 0 0 0 1.5px rgba(255,255,255,0.06);
  transform: rotateY(calc(-10deg + var(--phone-tilt, 0) * 1deg)) rotateX(calc(4deg + var(--phone-pitch, 0) * 1deg)) translateY(calc(var(--phone-y, 0) * 1px)) scale(var(--phone-scale, 1));
  transition: transform 60ms linear;
  will-change: transform;
}
[data-theme="dark"] .phone-shell {
  box-shadow:
    0 40px 80px -20px rgba(0,0,0,0.6),
    0 10px 24px rgba(0,0,0,0.4),
    inset 0 0 0 1.5px rgba(255,255,255,0.06);
}
.phone-screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 40px;
  background: var(--bg);
  overflow: hidden;
}
.phone-notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 108px; height: 30px; border-radius: 99px; background: #000;
  z-index: 5;
}

/* Ingredient particle base — positions floating items */
.ingredient {
  position: absolute;
  will-change: transform;
  pointer-events: none;
  transition: transform 60ms linear;
}

/* Hero ambient blobs */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}

/* Photo chips — floating real food cards in hero */
.photo-chip {
  width: 150px; height: 186px;
  border-radius: 20px;
  padding: 8px;
  background: var(--card);
  box-shadow: 0 30px 50px -18px rgba(80, 60, 30, 0.28), 0 2px 6px rgba(80,60,30,0.08);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 3;
}
.photo-chip.sm { width: 110px; height: 140px; }
.photo-chip.lg { width: 172px; height: 216px; }
.photo-chip .chip-inner {
  flex: 1;
  border-radius: 14px;
  background-size: cover; background-position: center;
}
.photo-chip .chip-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  padding: 0 4px;
}
.chip-dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }
[data-theme="dark"] .photo-chip { box-shadow: 0 22px 40px -14px rgba(0,0,0,0.5); }

/* Platform pill float */
.platform-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px 8px 12px;
  background: var(--ink); color: var(--bg);
  border-radius: 99px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(80,60,30,0.22);
  z-index: 2;
}

@media (max-width: 900px) {
  .photo-chip, .photo-chip.lg, .photo-chip.sm { display: none; }
  .platform-pill { display: none; }
}

/* marquee */
.marquee { overflow: hidden; white-space: nowrap; }
.marquee-track {
  display: inline-flex; gap: 64px;
  animation: scroll 38s linear infinite;
  padding-right: 64px;
}
.marquee-track span { font-family: var(--serif); font-size: clamp(40px, 6vw, 88px); color: var(--ink); letter-spacing: -0.02em; }
.marquee-track .dot { display: inline-block; width: 14px; height: 14px; border-radius: 99px; background: var(--sage); align-self: center; margin-top: calc(clamp(40px, 6vw, 88px) / 2 - 7px); }
@keyframes scroll {
  to { transform: translateX(-50%); }
}

/* problem section — pinned */
.problem-pin {
  position: sticky; top: 0; height: 100vh;
  display: grid; place-items: center;
  overflow: hidden;
}
.problem-scenes {
  position: relative;
  width: min(720px, 92vw);
  aspect-ratio: 4/3;
}
.problem-scene {
  position: absolute; inset: 0;
  opacity: 0; transform: scale(0.96);
  transition: opacity 500ms ease, transform 700ms cubic-bezier(0.22,0.61,0.36,1);
}
.problem-scene.active { opacity: 1; transform: scale(1); }

.chaos {
  position: relative; width: 100%; height: 100%;
  border-radius: 24px;
  background: linear-gradient(135deg, #8a4a3a, #d98a3a);
  overflow: hidden;
}
.chaos-caption {
  position: absolute;
  background: rgba(0,0,0,0.55); color: #fff;
  padding: 8px 12px; border-radius: 6px;
  font-size: 13px; max-width: 70%;
  line-height: 1.3;
}

.clean-card {
  width: 100%; height: 100%;
  background: var(--card); border-radius: 24px;
  border: 1px solid var(--line);
  padding: 32px; display: flex; flex-direction: column;
  box-shadow: 0 30px 60px -20px rgba(80,60,30,0.15);
}

/* generic card */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 300ms ease, box-shadow 300ms ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 22px 36px -18px rgba(80,60,30,0.22); }

/* pricing */
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 780px) { .price-grid { grid-template-columns: 1fr; } }
.price-card {
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  position: relative;
}
.price-card.featured {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
[data-theme="dark"] .price-card.featured { background: var(--sage-deep); border-color: var(--sage-deep); }
.price-card .amount { font-family: var(--serif); font-size: 56px; line-height: 1; letter-spacing: -0.02em; }
.price-card ul { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; }
.price-card li { display: flex; align-items: flex-start; gap: 10px; line-height: 1.4; }
.check-dot { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }

/* download strip */
.download-wrap {
  background: var(--ink);
  color: var(--bg);
  border-radius: 32px;
  padding: 72px clamp(30px, 6vw, 72px);
  margin: 0 var(--edge);
  max-width: 1280px;
  margin-left: auto; margin-right: auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px; align-items: center;
  overflow: hidden;
  position: relative;
}
[data-theme="dark"] .download-wrap { background: var(--sage-deep); }
@media (max-width: 820px) { .download-wrap { grid-template-columns: 1fr; padding: 56px 30px; } }
.qr-box {
  width: 220px; height: 220px; background: var(--bg); border-radius: 20px;
  padding: 16px; display: grid; place-items: center;
}
.qr-grid {
  width: 100%; height: 100%;
  display: grid;
  grid-template-columns: repeat(21, 1fr);
  grid-template-rows: repeat(21, 1fr);
  gap: 1px;
}
.qr-grid div { background: var(--ink); border-radius: 1px; }

/* footer */
footer {
  padding: 80px var(--edge) 40px;
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 40px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}
@media (max-width: 780px) { footer { grid-template-columns: 1fr 1fr; } }
footer h4 { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted-2); margin: 0 0 14px; }
footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
footer a { color: var(--ink-2); text-decoration: none; transition: color 180ms; }
footer a:hover { color: var(--sage-deep); }

.footer-bottom {
  grid-column: 1 / -1;
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--line-2);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 12px; color: var(--muted-2);
}

/* Tweaks panel */
.tweaks-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 14px 14px 12px;
  box-shadow: 0 18px 40px -12px rgba(80,60,30,0.25);
  display: none;
  min-width: 240px;
}
.tweaks-panel.open { display: block; }
.tweaks-title { font-family: var(--mono); margin-bottom: 12px; color: var(--muted); }
.accents { display: flex; gap: 8px; margin-bottom: 12px; }
.accent-swatch {
  width: 28px; height: 28px; border-radius: 99px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 180ms;
}
.accent-swatch:hover { transform: scale(1.1); }
.accent-swatch.active { border-color: var(--ink); }
.theme-row { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.theme-toggle {
  position: relative; width: 46px; height: 26px;
  border-radius: 99px; background: var(--bg-2);
  border: 1px solid var(--line); cursor: pointer;
  padding: 0;
}
.theme-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 99px;
  background: var(--ink);
  transition: transform 220ms ease;
}
[data-theme="dark"] .theme-toggle::after { transform: translateX(20px); background: var(--sage); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 150ms !important;
  }
}
