/* ========================================================================
   NeighbourHub — Landing Page
   Brand tokens (primary/accent/bg/surface/shadow) match the shared NH
   palette: Marigold (primary/Marketplace), Teal (accent/Carpool), Berry
   (Food), Slate (Services/Community). Same tokens as
   customer/src/theme/index.ts. The --food/--tuitions/--slate vars carry
   real category meaning (Food = Berry, carpooling = Teal, Services =
   Slate); the rest of the --grocery/--beauty/--coaching/--snacks vars and
   the icon-* chip backgrounds are decorative variety, not semantic
   bindings.
   ======================================================================== */

:root{
  --primary: #E8871E;
  --primary-dark: #C96C10;
  --primary-light: #F2A855;
  --accent: #17635C;
  --accent-light: #E3EEEC;

  --bg: #F1EFE4;
  --surface: #FFFFFF;
  --surface-alt: #FAF9F2;

  --text: #1B2420;
  --text-secondary: #4B584F;
  --text-tertiary: #7C877D;
  /* Ink, not white — Marigold is too light for white text to clear
     contrast at the button's 15-16px bold weight. */
  --text-on-primary: #1B2420;

  --border: #DBD6C5;
  --border-light: #E7E3D5;
  --divider: #E7E3D5;

  --success: #34C759;
  --warning: #FF9500;
  --error: #FF3B30;
  --star: #A9822E;

  --food: #B23A48;
  --grocery: #E8871E;
  --beauty: #E8871E;
  --tuitions: #17635C;
  --coaching: #E8871E;
  --snacks: #E8871E;
  --slate: #3A5A78;
  --slate-light: #E5EAEF;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-xxl: 24px;

  --shadow-sm: 0 1px 3px rgba(27,36,32,0.08);
  --shadow-md: 0 8px 24px rgba(27,36,32,0.10);
  --shadow-lg: 0 20px 48px rgba(27,36,32,0.16);
  --shadow-xl: 0 30px 70px rgba(10,14,12,0.22);

  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, 'Iowan Old Style', serif;
}

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

html{ scroll-behavior: smooth; }

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,h2,h3{
  font-family: var(--font-display);
  color: var(--text);
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p{ margin: 0 0 1em; color: var(--text-secondary); }

a{ color: inherit; text-decoration: none; }

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

.grain{
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.035; mix-blend-mode: multiply;
  background-image: radial-gradient(circle, #000 1px, transparent 1px);
  background-size: 3px 3px;
}

/* ---------- Layout helpers ---------- */
.section{ padding: 120px 24px; position: relative; }
.section-alt{ background: var(--surface-alt); }
.section-inner{ max-width: 1160px; margin: 0 auto; }

.section-head{ max-width: 680px; margin: 0 auto 64px; text-align: center; }
.section-head h2{ font-size: clamp(28px, 4vw, 42px); }
.section-lead{ font-size: 17px; }

.eyebrow{
  display: inline-block;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 6px 14px;
  border-radius: var(--radius-xxl);
  margin-bottom: 18px;
}

.text-gradient{
  background: linear-gradient(120deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  font-family: var(--font-body);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(.2,.8,.2,1), box-shadow 0.12s;
  white-space: nowrap;
}
/* "Extruded" 3D button: a solid drop-shadow acts as the side face of the
   button; pressing it collapses that face like a real key. */
.btn-primary{
  background: linear-gradient(135deg, var(--primary-light), var(--primary) 55%, var(--primary-dark));
  color: var(--text-on-primary);
  box-shadow:
    0 6px 0 var(--primary-dark),
    0 16px 28px rgba(201,108,16,0.35);
}
.btn-primary:hover{
  transform: translateY(-3px);
  box-shadow:
    0 9px 0 var(--primary-dark),
    0 22px 34px rgba(201,108,16,0.4);
}
.btn-primary:active{
  transform: translateY(4px);
  box-shadow:
    0 2px 0 var(--primary-dark),
    0 6px 14px rgba(201,108,16,0.3);
}
.btn-ghost{
  background: var(--surface);
  color: var(--primary);
  border-color: var(--border);
  box-shadow: 0 4px 0 var(--border), 0 8px 16px rgba(27,36,32,0.06);
}
.btn-ghost:hover{
  border-color: var(--primary-light);
  transform: translateY(-3px);
  box-shadow: 0 7px 0 var(--border), 0 14px 22px rgba(27,36,32,0.1);
}
.btn-ghost:active{ transform: translateY(3px); box-shadow: 0 1px 0 var(--border); }
.btn-lg{ padding: 16px 32px; font-size: 16px; }
.btn-small{ padding: 10px 20px; font-size: 14px; }

/* ---------- Nav ---------- */
.nav{
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(160%);
  background: rgba(241,239,228,0.78);
  border-bottom: 1px solid var(--border-light);
}
.nav-inner{
  max-width: 1160px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand{ display: flex; align-items: center; gap: 10px; }
.brand-mark{
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.brand-name{ font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.nav-links{ display: flex; gap: 32px; }
.nav-links a{
  font-size: 14.5px; font-weight: 600; color: var(--text-secondary);
  transition: color 0.2s;
}
.nav-links a:hover{ color: var(--primary); }

/* ---------- Hero ---------- */
.hero{
  position: relative;
  padding: 72px 24px 100px;
  overflow: hidden;
}
.hero-glow{
  position: absolute; top: -220px; right: -160px;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,135,30,0.16), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}
.hero-inner{
  max-width: 1160px; margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px;
  align-items: center;
}
.hero-copy h1{
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.08;
  margin-bottom: 22px;
}
.lead{ font-size: 18px; max-width: 500px; }
.hero-actions{ display: flex; gap: 16px; margin: 32px 0 44px; flex-wrap: wrap; }
.hero-stats{ display: flex; gap: 40px; }
.hero-stat{ display: flex; flex-direction: column; }
.hero-stat strong{ font-family: var(--font-display); font-size: 26px; color: var(--primary); }
.hero-stat span{ font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.hero-tags{ display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.tag-pill{
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  padding: 7px 14px; border-radius: var(--radius-xxl);
  background: var(--surface); border: 1px solid var(--border-light);
}
.tag-pill i{ width: 8px; height: 8px; border-radius: 50%; display: block; flex: none; }

/* ---------- Hero visual — Group chat vs NeighbourHub toggle ---------- */
.hero-visual{
  position: relative;
  display: flex; justify-content: center; align-items: center;
  perspective: 1000px;
  min-height: 520px;
}

/* ---------- Goal chips (Objective) ---------- */
.goal-row{ display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; perspective: 600px; }
.goal-chip{
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 14px 22px; border-radius: var(--radius-xxl);
  font-weight: 600; font-size: 14.5px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s;
}
.goal-chip:hover{
  transform: translateY(-5px) rotateX(8deg);
  box-shadow: var(--shadow-lg);
}
.goal-mark{
  width: 18px; height: 18px; border-radius: 50%; flex: none; position: relative;
  background: var(--accent);
}
.goal-mark::after{
  content: ''; position: absolute; left: 5.5px; top: 3.5px; width: 5px; height: 9px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(40deg);
}

/* ---------- 3D tilt cards ---------- */
.card-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  perspective: 900px;
}

.tilt-card{
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1), box-shadow 0.3s;
}

.problem-card, .solution-card{
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.problem-card::before, .solution-card::before{
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,0.75), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
/* Rim-light edge that appears only on the side facing the cursor, sold by
   an inset box-shadow — reinforces that the card is a lit 3D object, not a
   flat rectangle with a gradient painted on it. */
.problem-card::after, .solution-card::after{
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), inset 0 0 0 1px rgba(232,135,30,0.14);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.problem-card:hover, .solution-card:hover{
  box-shadow:
    0 30px 60px -12px rgba(27,36,32,0.20),
    0 10px 24px rgba(232,135,30,0.10);
}
.problem-card:hover::before, .solution-card:hover::before{ opacity: 1; }
.problem-card:hover::after, .solution-card:hover::after{ opacity: 1; }

.card-icon{
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  transform: translateZ(46px);
  box-shadow: 0 10px 20px -6px rgba(27,36,32,0.18);
}
/* Pastel chip backgrounds behind each card's mark — decorative variety
   pulled from the brand palette, not tied to the card's own copy. Food
   (Berry) and carpooling (Teal, via icon-tuitions) match the real app's
   category colors; the rest cycle Marigold/Slate tones for contrast. */
.icon-food{ background: #F4E1E3; }
.icon-grocery{ background: #FBE7CE; }
.icon-beauty{ background: #E2E8ED; }
.icon-tuitions{ background: #E3EEEC; }
.icon-coaching{ background: #F5DDBF; }
.icon-snacks{ background: #E4E1D6; }
.icon-primary{ background: #FBE7CE; }
.icon-accent{ background: var(--accent-light); }

/* Two states of one motif: a checked entry (solution — verified, present)
   and an unchecked one (problem — the thing NH's register catches). Same
   mark used in the hero ledger, so the metaphor threads through the page
   instead of resetting per section. */
.card-mark{ width: 26px; height: 26px; border-radius: 50%; position: relative; }
.card-mark-check{ background: var(--accent); }
.card-mark-check::after{
  content: ''; position: absolute; left: 8px; top: 6px; width: 7px; height: 12px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(40deg);
}
.card-mark-empty{ background: transparent; border: 2px dashed var(--text-tertiary); }

.problem-card h3, .solution-card h3{
  font-size: 19px; margin-bottom: 8px; transform: translateZ(30px);
}
.problem-card p, .solution-card p{ font-size: 14.5px; margin: 0; transform: translateZ(16px); }

/* ---------- Steps ---------- */
.steps{
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}
.step{ text-align: left; padding: 8px; }
.step-num{
  display: inline-block;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.step h3{ font-size: 18px; margin-bottom: 8px; }
.step p{ font-size: 14.5px; }

/* ---------- Phone demo (Group chat vs NeighbourHub toggle) ---------- */
.phone-demo{ display: flex; flex-direction: column; align-items: center; }
.toggle{
  display: inline-flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; padding: 4px; margin-bottom: 28px; box-shadow: var(--shadow-md);
  position: relative; z-index: 2;
}
.toggle button{
  appearance: none; background: none; border: none; font-family: inherit; cursor: pointer;
  padding: 10px 22px; border-radius: 100px; font-size: 14px; font-weight: 700;
  color: var(--text-tertiary); position: relative; z-index: 1; transition: color 0.3s ease;
}
.toggle button.active{ color: var(--surface-alt); }
.toggle-thumb{
  position: absolute; top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px); border-radius: 100px;
  background: var(--text); transition: transform 0.35s cubic-bezier(.65,0,.35,1); z-index: 0;
}
.toggle.state-after .toggle-thumb{ transform: translateX(100%); }

.phone{
  width: 290px; height: 588px; border-radius: 44px;
  background: var(--text); padding: 12px; box-shadow: var(--shadow-xl);
  position: relative;
}
.phone-screen{
  width: 100%; height: 100%; border-radius: 34px; background: var(--surface-alt);
  overflow: hidden; position: relative;
}
.phone-notch{
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 120px; height: 22px; background: var(--text); border-radius: 0 0 16px 16px; z-index: 5;
}
.screen-view{
  position: absolute; inset: 0; padding: 34px 16px 16px;
  opacity: 0; transform: scale(1.02);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.screen-view.visible{ opacity: 1; transform: scale(1); pointer-events: auto; }

/* messy chat view */
.chat-header{ font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 2px; }
.chat-sub{ font-size: 10.5px; color: var(--food); font-weight: 700; margin-bottom: 14px; }
.bubble{ background: var(--surface); border-radius: 12px 12px 12px 3px; padding: 8px 10px; margin-bottom: 8px; max-width: 82%; box-shadow: 0 1px 0 var(--border-light); }
.bubble .b-line{ height: 6px; border-radius: 3px; background: var(--border); margin-bottom: 5px; }
.bubble .b-line:last-child{ margin-bottom: 0; width: 60%; }
.bubble.spam{ position: relative; }
.bubble.spam::after{
  content: '!'; font-size: 9px; font-weight: 800; color: var(--surface);
  position: absolute; top: -6px; right: -6px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--food); display: flex; align-items: center; justify-content: center;
}
.bubble.img-msg{ width: 60%; height: 44px; background: repeating-linear-gradient(135deg, var(--border-light), var(--border-light) 6px, var(--bg) 6px, var(--bg) 12px); }
.bubble.right{ margin-left: auto; background: var(--slate); border-radius: 12px 12px 3px 12px; }
.bubble.right .b-line{ background: rgba(255,255,255,0.35); }

/* organized view */
.search-bar{
  display: flex; align-items: center; gap: 6px; background: var(--surface);
  border: 1px solid var(--border-light); border-radius: 100px; padding: 8px 12px; margin-bottom: 12px;
}
.search-bar .b-line{ height: 6px; border-radius: 3px; background: var(--border); width: 70%; }
.cat-row{ display: flex; gap: 6px; margin-bottom: 14px; }
.cat-chip{ font-size: 9.5px; font-weight: 700; color: var(--surface); padding: 5px 10px; border-radius: 100px; }
.feed-card{
  background: var(--surface); border-radius: 14px; padding: 10px 12px; margin-bottom: 9px;
  display: flex; gap: 10px; align-items: flex-start; box-shadow: 0 1px 0 var(--border-light);
}
.feed-icon{ width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; }
.feed-body{ flex: 1; }
.feed-body .f-title{ height: 7px; width: 80%; border-radius: 3px; background: var(--text); opacity: 0.75; margin-bottom: 6px; }
.feed-body .f-sub{ height: 6px; width: 55%; border-radius: 3px; background: var(--border); }
.feed-dist{ font-size: 8.5px; font-weight: 700; color: var(--text-tertiary); white-space: nowrap; }

@media (max-width: 480px){
  .phone{ width: 240px; height: 486px; }
}

/* ---------- Compare ---------- */
.compare-table{
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.compare-col{ padding: 40px 36px; }
.compare-old{ background: var(--surface); }
.compare-new{ background: var(--text); }
.compare-col h3{ font-size: 20px; margin-bottom: 24px; }
.compare-new h3{ color: var(--surface-alt); }
.compare-item{
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0; font-size: 14.5px; color: var(--text-secondary);
  border-top: 1px solid var(--divider);
}
.compare-item:first-of-type{ border-top: none; }
.compare-new .compare-item{
  border-top: 1px solid rgba(250,249,242,0.14);
  color: rgba(250,249,242,0.78);
}
.compare-new .compare-item:first-of-type{ border-top: none; }
/* Reuses the same checked/unchecked mark as the Problem/Solution cards
   and hero ledger, so the "caught vs verified" motif threads through the
   whole page instead of introducing a new red/green convention here. */
.compare-item .card-mark{ margin-top: 2px; flex: none; }

@media (max-width: 760px){
  .compare-table{ grid-template-columns: 1fr; }
}

/* ---------- Store buttons ---------- */
.store-row{ display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.store-btn{
  display: flex; align-items: center; gap: 12px;
  background: var(--text); color: var(--surface-alt);
  padding: 13px 22px; border-radius: var(--radius-md);
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
  transition: transform 0.2s cubic-bezier(.2,.8,.2,1), box-shadow 0.2s;
}
.store-btn:hover{ transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,0.28); }
.store-btn svg{ flex: none; }
.store-text{ text-align: left; }
.store-text small{ display: block; font-size: 11px; opacity: 0.7; }
.store-text strong{ display: block; font-family: var(--font-display); font-size: 15.5px; }

/* ---------- CTA ---------- */
.cta{
  position: relative;
  margin: 0 24px 100px;
  border-radius: var(--radius-xxl);
  padding: 90px 40px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 55%, var(--primary-dark) 100%);
  overflow: hidden;
}
.cta-glow{
  position: absolute; inset: 0;
  background: radial-gradient(600px circle at 50% 0%, rgba(255,255,255,0.14), transparent 60%);
  pointer-events: none;
}
.cta-inner{ position: relative; max-width: 560px; margin: 0 auto; }
.cta h2{ color: #fff; font-size: clamp(28px, 4vw, 40px); }
.cta p{ color: rgba(255,255,255,0.82); font-size: 17px; margin-bottom: 32px; }
.cta .btn-primary{
  background: #fff; color: var(--primary);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.cta .btn-primary:hover{ box-shadow: 0 16px 36px rgba(0,0,0,0.32); }

/* ---------- Footer ---------- */
.footer{ padding: 40px 24px; border-top: 1px solid var(--border-light); }
.footer-inner{
  max-width: 1160px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.footer-links{ display: flex; gap: 24px; }
.footer-links a{ font-size: 13.5px; font-weight: 600; color: var(--text-secondary); transition: color 0.2s; }
.footer-links a:hover{ color: var(--primary); }
.footer-copy{ font-size: 13.5px; color: var(--text-tertiary); }

/* ---------- Reveal-on-scroll ----------
   GSAP ScrollTrigger drives the actual 3D flip-up animation (see
   initScrollReveal in script.js) — this just pre-hides content so there's
   no flash of the final state before GSAP's first tick. If GSAP fails to
   load, script.js falls back to adding .reveal-fallback to <html>, which
   forces everything visible below. */
.reveal{ opacity: 0; }
html.reveal-fallback .reveal{ opacity: 1; }

/* ---------- Legal pages (privacy.html / terms.html) ---------- */
.legal-hero{ padding: 64px 24px 8px; text-align: center; }
.legal-hero-inner{ max-width: 720px; margin: 0 auto; }
.legal-updated{ font-size: 13.5px; color: var(--text-tertiary); margin: 0; }
.legal-content{ padding: 24px 24px 100px; }
.legal-content-inner{ max-width: 720px; margin: 0 auto; }
.legal-content h2{ font-size: 22px; margin-top: 44px; }
.legal-content h2:first-of-type{ margin-top: 8px; }
.legal-content p, .legal-content li{ font-size: 15.5px; }
.legal-content ul{ padding-left: 22px; margin: 0 0 1em; }
.legal-content li{ margin-bottom: 6px; }
.legal-content a{ color: var(--accent); font-weight: 600; text-decoration: underline; }
.legal-content strong{ color: var(--text); }
.legal-note{
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px 22px; margin: 24px 0;
  font-size: 14.5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px){
  .hero-inner{ grid-template-columns: 1fr; }
  .hero-visual{ min-height: 440px; }
  .hero-stats{ gap: 24px; }
  .nav-links{ display: none; }
}

@media (max-width: 560px){
  .section{ padding: 80px 20px; }
  .hero{ padding-top: 48px; }
  .cta{ margin: 0 16px 72px; padding: 64px 24px; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .tilt-card{ transition: none !important; transform: none !important; }
  .reveal{ opacity: 1; transform: none; transition: none; }
}
