/* ============================================================
   TreatStreet website — design tokens mirrored from the app
   (src/utils/theme.ts). Keep these in sync with the app.
   ============================================================ */
:root {
  /* Core palette */
  --primary: #E91E63;
  --primary-light: #F06292;
  --primary-dark: #C2185B;
  --secondary: #9C27B0;
  --secondary-light: #BA68C8;
  --accent: #FF9800;
  --accent-light: #FFB74D;
  --pumpkin: #FF6F00;
  --candy: #E040FB;

  /* Neutral & semantic */
  --white: #FFFFFF;
  --bg: #FFF5F7;
  --bg-dark: #14091B;     /* android adaptive icon bg — used for footer */
  --card: #FFFFFF;
  --border: #F0E0E5;
  --text: #1A1A2E;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --success: #4CAF50;
  --warning: #FF9800;
  --danger: #EF4444;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #E91E63 0%, #FF5722 55%, #FF9800 100%);
  --grad-secondary: linear-gradient(135deg, #9C27B0 0%, #E91E63 100%);
  --grad-warm: linear-gradient(135deg, #FF6F00 0%, #FF9800 55%, #FFC107 100%);
  --grad-candy: linear-gradient(135deg, #E040FB 0%, #E91E63 55%, #FF5722 100%);
  --grad-sunset: linear-gradient(135deg, #9C27B0 0%, #E91E63 50%, #FF9800 100%);
  --grad-night: linear-gradient(160deg, #1A0B26 0%, #2D1240 60%, #3D1A52 100%);

  /* Radii (app: round 32, pill 9999) */
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-round: 32px;
  --r-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(26,26,46,0.08);
  --shadow-md: 0 6px 18px rgba(26,26,46,0.12);
  --shadow-lg: 0 16px 40px rgba(26,26,46,0.15);
  --glow: 0 8px 24px rgba(233,30,99,0.35);

  --maxw: 1080px;
}

* { box-sizing: border-box; }

/* ---- Custom app icons (replaces all stock emoji) ---- */
/* Icon inside the 56px gradient .ico box on feature/safety cards */
.ico { font-size: 0; }
.ico img { width: 38px; height: 38px; object-fit: contain; display: block; }
/* Inline icon in a heading / card title / chip (leading) */
.tic { height: 1.15em; width: auto; vertical-align: -0.18em; margin-right: .4em; }
/* Inline icon trailing a heading */
.tic-r { height: 1em; width: auto; vertical-align: -0.12em; margin-left: .35em; }
/* Inline icon inside a chip — tighter, flex gap handles spacing */
.chip .tic { margin-right: 0; height: 1.05em; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------------- Typography ---------------- */
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; }
.hero-title { font-size: clamp(34px, 6vw, 56px); font-weight: 900; letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; }
h3 { font-size: 20px; font-weight: 800; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: 12px;
  font-weight: 800; color: var(--primary);
}
.lead { font-size: 18px; color: var(--text-secondary); }
.muted { color: var(--text-secondary); }

/* ---------------- Nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,245,247,0.85);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.brand img.brand-emblem { width: auto; height: 44px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.brand img.brand-wordmark { width: auto; height: 34px; border-radius: 0; box-shadow: none; }
.nav-links { display: flex; gap: 6px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-links a {
  color: var(--text); font-weight: 600; font-size: 15px;
  padding: 8px 12px; border-radius: var(--r-pill);
}
.nav-links a:hover { background: #fff; text-decoration: none; box-shadow: var(--shadow-sm); }
/* Hamburger toggle — hidden on desktop, shown on mobile (CSS-only, no JS) */
.nav-toggle { display: none; }
.nav-burger { display: none; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; font-size: 16px; cursor: pointer; border: none;
  padding: 14px 24px; border-radius: var(--r-xl); color: #fff;
  background: var(--grad-primary); box-shadow: var(--glow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 12px 30px rgba(233,30,99,0.4); }
.btn.secondary { background: #fff; color: var(--secondary); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.btn.ghost { background: rgba(255,255,255,0.16); color: #fff; box-shadow: none; border: 1px solid rgba(255,255,255,0.35); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------------- Hero ---------------- */
.hero { background: var(--grad-night); color: #fff; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 80% 10%, rgba(224,64,251,0.30), transparent 70%),
    radial-gradient(50% 40% at 10% 90%, rgba(255,152,0,0.22), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; padding: 70px 20px 80px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero .eyebrow { color: var(--accent-light); }
.hero p.lead { color: rgba(255,255,255,0.82); }
.hero .wrap > div { min-width: 0; }   /* let grid items shrink instead of forcing page-wide overflow */
.hero-art { display: flex; justify-content: center; min-width: 0; }
.hero-art img { width: min(320px, 80%); max-width: 100%; height: auto; border-radius: var(--r-round); box-shadow: var(--shadow-lg); }
.badge-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.22);
  color: #fff; padding: 7px 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600;
}

/* ---------------- Sections ---------------- */
section { padding: 72px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }

/* Cards / grids */
.grid { display: grid; gap: 20px; }
.grid > * { min-width: 0; }   /* prevent wide children from blowing out the track */
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card); border-radius: var(--r-round); padding: 26px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.card h3 { margin-top: 8px; }
.card .ico {
  width: 56px; height: 56px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: var(--grad-warm); box-shadow: var(--shadow-sm);
}
.gradient-card { background: var(--grad-secondary); color: #fff; border: none; }
.gradient-card .muted { color: rgba(255,255,255,0.85); }

/* Steps */
.step { display: flex; gap: 18px; align-items: flex-start; }
.step .num {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: var(--r-pill);
  background: var(--grad-candy); color: #fff; font-weight: 900; font-size: 20px;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--glow);
}

/* Video */
.video-frame {
  border-radius: var(--r-round); overflow: hidden; box-shadow: var(--shadow-lg);
  border: 3px solid rgba(255,255,255,0.6); background: #000;
}
.video-frame video { width: 100%; display: block; }

/* Safety band */
.band { background: var(--grad-sunset); color: #fff; }
.band .card { background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25); color: #fff; backdrop-filter: blur(4px); }
.band a { color: #fff; text-decoration: underline; }

/* CTA */
.cta { text-align: center; }
.cta .panel {
  background: var(--grad-primary); color: #fff; border-radius: var(--r-round);
  padding: 56px 28px; box-shadow: var(--shadow-lg);
}

/* ---------------- Legal / doc pages ---------------- */
.doc { max-width: 820px; margin: 0 auto; padding: 56px 20px 80px; }
.doc h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 900; }
.doc .updated { color: var(--text-muted); font-size: 14px; margin-bottom: 8px; }
.doc h2 { font-size: 24px; margin-top: 40px; }
.doc h3 { font-size: 18px; margin-top: 28px; }
.doc p, .doc li { color: #2b2b3a; font-size: 16px; }
.doc ul { padding-left: 22px; }
.doc li { margin: 6px 0; }
.callout {
  background: #fff; border: 1px solid var(--border); border-left: 5px solid var(--accent);
  border-radius: var(--r-lg); padding: 16px 20px; margin: 22px 0; box-shadow: var(--shadow-sm);
}
.callout.warn { border-left-color: var(--danger); }
.toc { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 22px; margin: 24px 0; }
.toc ul { margin: 8px 0 0; }

/* ---------------- Footer ---------------- */
footer {
  background: var(--bg-dark); color: rgba(255,255,255,0.7);
  padding: 56px 0 40px; margin-top: 40px;
}
footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 14px; }
footer a { color: rgba(255,255,255,0.7); display: block; padding: 5px 0; font-size: 15px; }
footer a:hover { color: #fff; text-decoration: none; }
footer .brand { color: #fff; margin-bottom: 12px; }
footer .legal { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 36px; padding-top: 22px; font-size: 13px; color: rgba(255,255,255,0.55); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; padding: 52px 20px 60px; }
  .hero-art { order: -1; }
  .badge-row, .btn-row { justify-content: center; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }

  /* Two-column highlight sections often have an image card paired with text.
     Stack the visual on top so it reads in a natural order on a phone. */
  .grid-2 { gap: 28px !important; }

  /* Tighter vertical rhythm on phones */
  section { padding: 52px 0; }
  .section-head { margin-bottom: 32px; }
  .cta .panel { padding: 40px 22px; }

  /* ---- Mobile nav: hamburger reveals a dropdown ---- */
  .nav .wrap { gap: 12px; }
  .nav-burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; flex: 0 0 auto; margin-left: auto; cursor: pointer;
    border-radius: 12px; border: 1px solid var(--border); background: #fff;
    padding: 0 11px; box-shadow: var(--shadow-sm);
  }
  .nav-burger span { display: block; height: 2.5px; width: 100%; background: var(--text); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
  .nav-links {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px; margin: 0;
    background: rgba(255,245,247,0.98); backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md);
    padding: 12px 20px 18px;
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links a { padding: 13px 14px; font-size: 16px; border-radius: var(--r-md); }
  .nav-links a.btn { justify-content: center; margin-top: 8px; padding: 14px; }
  /* Burger → X animation when open */
  .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

  /* Footer: brand block spans full width, link columns sit 2-up below */
  footer .cols { grid-template-columns: 1fr 1fr; }
  footer .cols > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .brand img.brand-emblem { height: 38px; }
  .brand img.brand-wordmark { height: 28px; }
  section { padding: 44px 0; }
  .wrap { padding: 0 16px; }
  .card { padding: 22px; }
  .btn { width: 100%; }            /* full-width tap targets */
  .btn-row { flex-direction: column; align-items: stretch; }
  .hero .btn-row .btn { width: 100%; }
  footer .cols { grid-template-columns: 1fr; }
  footer .legal { flex-direction: column; align-items: flex-start; }
}
