/* FridgeSnap landing, implementing the SnapFridge.dc design:
   cream canvas on a dark backdrop, green brand, Sora display type,
   glass surfaces over drifting parallax blobs. */

:root {
  --backdrop: #232522;
  --canvas: #FAFAF7;
  --card: #FFFFFF;
  --ink: #1B1E1A;
  --ink-soft: #5A6057;
  --ink-muted: #9BA097;
  --green: #1FA24A;
  --green-deep: #167A38;
  --green-light: #E8F5EC;
  --green-bright: #5FCE85;
  --amber: #C06515;
  --amber-light: #FCEFE2;
  --purple: #5A4FBF;
  --purple-light: #E9E7F8;
  --red: #C0392B;
  --red-light: #FCE8E4;
  --line: #E7E9E2;
  --fill: #F2F4EE;
  --dark-band: #1B1E1A;
  --dark-card: #252923;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --r-lg: 32px;
  --r-md: 24px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  background: var(--backdrop);
  color: var(--ink);
  line-height: 1.6;
  padding: 28px 16px;
}

h1, h2, h3, .logo, .price { font-family: "Sora", sans-serif; letter-spacing: -0.02em; line-height: 1.12; }

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-deep); }

/* Canvas frame */
.frame {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  background: var(--canvas);
  border-radius: var(--r-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.frame-content { position: relative; z-index: 1; }

/* Parallax backdrop: blobs drift via CSS animation (transform) and shift
   with scroll via margin-top (script.js), so the two never fight. */
.frame-bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

@keyframes drift1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, 30px) scale(1.08); } }
@keyframes drift2 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-50px, 40px) scale(1.12); } }
@keyframes drift3 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(30px, -40px) scale(0.95); } }

.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(55px);
  will-change: transform, margin-top;
}

.blob-a {
  top: -80px; right: -120px; width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(95, 206, 133, 0.5), rgba(95, 206, 133, 0));
  animation: drift1 14s ease-in-out infinite;
}

.blob-b {
  top: 480px; left: -160px; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(232, 132, 42, 0.32), rgba(232, 132, 42, 0));
  animation: drift2 18s ease-in-out infinite;
}

.blob-c {
  top: 1300px; right: -100px; width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(31, 162, 74, 0.35), rgba(31, 162, 74, 0));
  animation: drift3 16s ease-in-out infinite;
}

.float {
  position: absolute;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  opacity: 0.85;
  filter: drop-shadow(0 10px 16px rgba(27, 30, 26, 0.16));
  will-change: transform;
}

.f1 { top: 24%; left: 2.5%; }
.f2 { top: 34%; right: 4%; }
.f3 { top: 48%; left: 5%; font-size: 1.5rem; }
.f4 { top: 62%; right: 7%; }
.f5 { top: 76%; left: 7%; }
.f6 { top: 88%; right: 10%; font-size: 1.6rem; }

/* Glass */
.glass, .glass-panel {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid var(--glass-edge);
}

.glass-chip {
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 24px rgba(27, 30, 26, 0.06);
}

.glass-dark {
  background: rgba(27, 30, 26, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Nav */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 48px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: rgba(250, 250, 247, 0.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  flex-wrap: wrap;
}

.logo { font-weight: 800; font-size: 1.4rem; color: var(--green); }

.nav-links { display: flex; gap: 8px; flex-wrap: wrap; }

.nav-pill {
  color: #454A43;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  transition: background 0.15s;
}

.nav-pill:hover { background: rgba(255, 255, 255, 0.8); color: var(--ink); }

.cta-pill {
  background: var(--green);
  color: #FFF;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 12px 24px;
  border-radius: 999px;
}

/* Buttons */
.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 1rem;
  padding: 16px 32px;
  border-radius: 999px;
}

.btn-dark { background: var(--ink); color: #FFF; }
.btn-green { background: var(--green); color: #FFF; box-shadow: 0 8px 24px rgba(31, 162, 74, 0.3); }

/* Cinematic golden-hour hero */
.hero-cinema {
  position: relative;
  margin: 20px;
  min-height: 640px;
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  background: url("assets/hero-golden.jpg") center / cover no-repeat, #3A2E1E;
}

/* Legibility scrim: deep charcoal fading to reveal the golden scene */
.hero-cinema::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(20, 18, 14, 0.86) 0%,
    rgba(20, 18, 14, 0.62) 42%,
    rgba(20, 18, 14, 0.12) 72%,
    rgba(20, 18, 14, 0) 100%
  );
}

/* Golden-hour wash: warm light spilling in from the right */
.hero-cinema::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 85% 30%, rgba(255, 178, 82, 0.22), transparent 70%),
    linear-gradient(80deg, transparent 45%, rgba(255, 158, 54, 0.12) 100%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 620px;
  padding: 72px 56px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
  color: var(--canvas);
}

.hero-badge {
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #FFE9C9;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: 999px;
}

.hero-cinema h1 {
  font-size: clamp(2.4rem, 4.6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
  color: #FFFDF8;
  text-shadow: 0 2px 24px rgba(20, 18, 14, 0.35);
}

.subhead {
  font-size: clamp(1rem, 1.8vw, 1.19rem);
  font-weight: 500;
  color: rgba(250, 250, 247, 0.88);
  max-width: 520px;
}

.hero-ctas { display: flex; gap: 16px; align-items: center; }

.hero-fine { font-weight: 600; font-size: 0.88rem; color: rgba(250, 250, 247, 0.65); }

/* Sections */
main section { padding: 72px 48px; }

section h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.section-head { max-width: 640px; margin-bottom: 40px; display: flex; flex-direction: column; gap: 12px; }

.section-sub { font-size: 1.05rem; font-weight: 500; color: var(--ink-soft); }

.cards.three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Dark how-it-works band */
.dark-band {
  background: var(--dark-band);
  color: var(--canvas);
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.dark-band h2 { color: #FAFAF7; }

.dark-card {
  background: var(--dark-card);
  border-radius: var(--r-md);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-num {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--green);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 800 1.1rem "Sora", sans-serif;
}

.dark-card h3 { font-size: 1.35rem; font-weight: 700; }

.dark-card p { font-size: 0.94rem; font-weight: 500; color: #A9AFA4; }

/* Effort mode cards */
#effort .card {
  border-radius: var(--r-md);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 32px rgba(27, 30, 26, 0.07);
}

#effort .card h3 { font-size: 1.4rem; font-weight: 700; }

#effort .card p { font-size: 0.94rem; font-weight: 500; color: var(--ink-soft); }

.card-featured {
  background: rgba(31, 162, 74, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 32px rgba(31, 162, 74, 0.25) !important;
  color: #FFF;
}

.card-featured h3 { color: #FFF; }
.card-featured p { color: #DFF3E5 !important; }
.card-featured .mode-meta { color: #BCE6C8 !important; }

.mode-badge {
  align-self: flex-start;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 999px;
}

.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-white { background: rgba(255, 255, 255, 0.22); color: #FFF; }
.badge-purple { background: var(--purple-light); color: var(--purple); }

.mode-meta { font-weight: 700; font-size: 0.85rem; color: var(--ink-muted); }

/* Macros + freshness two-up */
.two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.feature-card {
  border-radius: 28px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(27, 30, 26, 0.06);
}

.feature-card h2 { font-size: 1.8rem; }

.feature-card p { font-size: 0.98rem; font-weight: 500; color: var(--ink-soft); }

.tint-green { background: rgba(232, 245, 236, 0.55); }
.tint-green p { color: #3E5A47; }

.chip-row { display: flex; gap: 10px; flex-wrap: wrap; }

.stat-chip {
  background: var(--card);
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 0.88rem;
}

.expiry-list { display: flex; flex-direction: column; gap: 10px; }

.expiry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--canvas);
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 0.9rem;
}

.tag { font-weight: 700; font-size: 0.75rem; padding: 4px 12px; border-radius: 999px; }
.tag-red { background: var(--red-light); color: var(--red); }
.tag-amber { background: var(--amber-light); color: var(--amber); }
.tag-green { background: var(--green-light); color: var(--green-deep); }

/* CTA band */
.cta-band { padding-top: 0; }

.cta-inner {
  border-radius: 28px;
  padding: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.cta-inner h2 { color: #FFF; }

.cta-inner p { color: #A9AFA4; font-weight: 500; margin-top: 8px; }

/* Footer */
footer {
  display: flex;
  justify-content: space-between;
  padding: 0 48px 40px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-muted);
  flex-wrap: wrap;
  gap: 12px;
}

footer nav { display: flex; gap: 24px; }

footer nav a { color: var(--ink-muted); }
footer nav a:hover { color: var(--green); }

/* Reveal transitions (gated: only when the script confirms it can run) */
html.fx .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

html.fx .reveal.delay-1 { transition-delay: 0.12s; }
html.fx .reveal.delay-2 { transition-delay: 0.24s; }

html.fx .reveal.in { opacity: 1; transform: none; }

/* Legal pages */
.legal {
  max-width: 720px;
  margin: 0 auto;
  background: var(--canvas);
  border-radius: var(--r-lg);
  padding: 56px 48px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.legal h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }

.legal .updated { color: var(--ink-muted); font-size: 0.9rem; margin-bottom: 30px; }

.legal h2 { font-size: 1.2rem; font-weight: 800; margin: 30px 0 10px; }

.legal p, .legal li { color: var(--ink-soft); margin-bottom: 12px; font-size: 0.95rem; }

.legal ul { padding-left: 22px; }

.back { display: inline-block; margin-bottom: 36px; color: var(--ink-muted); font-size: 0.9rem; font-weight: 600; }
.back:hover { color: var(--green); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.fx .reveal { opacity: 1; transform: none; transition: none; }
  .blob { animation: none; margin-top: 0 !important; }
  .float { transform: none !important; }
}

/* Responsive */
@media (max-width: 920px) {
  body { padding: 12px 8px; }
  .frame { border-radius: 24px; }
  .hero-cinema {
    margin: 12px;
    min-height: 560px;
    /* Lighter 900px asset for phones (76KB vs 351KB) */
    background-image: url("assets/hero-golden-mobile.jpg");
  }
  .hero-cinema::before {
    background: linear-gradient(180deg, rgba(20, 18, 14, 0.55) 0%, rgba(20, 18, 14, 0.78) 100%);
  }
  .hero-inner { padding: 40px 24px; gap: 18px; }
  .hero-ctas { width: 100%; }
  .hero-ctas .btn { width: 100%; text-align: center; }
  .cards.three, .two-up { grid-template-columns: 1fr; }
  main section { padding: 48px 20px; }
  .section-head { margin-bottom: 28px; }
  .feature-card { padding: 28px 22px; }
  .dark-card, #effort .card { padding: 26px 22px; }
  .topbar { padding: 14px 18px; }
  .nav-links { display: none; }
  .logo { font-size: 1.2rem; }
  .cta-pill { padding: 10px 18px; font-size: 0.85rem; }
  .cta-inner { padding: 36px 24px; }
  .cta-inner .btn { width: 100%; text-align: center; }
  footer { padding: 0 20px 28px; justify-content: center; text-align: center; }
  .float { display: none; }
  .blob { filter: blur(45px); }
  .legal { padding: 40px 24px; }
}
