/* SpotBuddy website — same "Bold & Friendly" palette as the app
   (lib/theme/app_theme.dart). Light and dark follow the visitor's system. */

:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-muted: #eceef7;
  --border: #e1e3ef;
  --text: #14141f;
  --text-muted: #5b5f73;
  --primary: #4b3fe0;
  --primary-deep: #3a2fc4;
  --primary-tint: #ecebff;
  --amber: #f2a11f;
  --amber-tint: #fff4e0;
  --amber-dark: #8a5200;
  --teal: #0e9f74;
  --teal-tint: #e3f6ef;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(38, 30, 120, 0.10);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0e15;
    --surface: #171823;
    --surface-muted: #20212f;
    --border: #2a2c3c;
    --text: #f3f4fa;
    --text-muted: #a3a6bb;
    --primary: #6258f0;
    --primary-deep: #4b3fe0;
    --primary-tint: #23214a;
    --amber: #f5b447;
    --amber-tint: #33280f;
    --amber-dark: #f5b447;
    --teal: #34c99a;
    --teal-tint: #102b23;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }

/* Google's Material Symbols (loaded in each page's <head>). */
.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  font-size: 26px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  font-variation-settings: "FILL" 1, "wght" 500;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  max-width: 1em;
  color: var(--primary);
}

.wrap { width: min(1120px, 100% - 32px); margin: 0 auto; }

/* ---- Header ---------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); text-decoration: none; letter-spacing: -0.3px; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

/* ---- Buttons --------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: 999px;
  font-weight: 800; font-size: 16px; text-decoration: none;
  background: var(--primary); color: #fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 35%, transparent);
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn.light { background: #fff; color: #1b1440; box-shadow: none; }
.btn .small { display: block; font-size: 11px; font-weight: 700; opacity: .75; line-height: 1.1; }
.btn .big { display: block; font-size: 17px; line-height: 1.2; }
.btn[aria-disabled="true"] { cursor: default; }
.btn[aria-disabled="true"]:hover { transform: none; }

/* ---- Hero ------------------------------------------------------------ */

.hero {
  background: linear-gradient(135deg, #4b3fe0, #3a2fc4);
  color: #fff;
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: ""; position: absolute; width: 720px; height: 720px; right: -220px; top: -260px;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 65%);
}
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px; padding: 72px 0 0; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(38px, 6vw, 64px); line-height: 1.04; letter-spacing: -2px; margin: 0 0 18px; font-weight: 800; }
.hero p.lead { font-size: 20px; opacity: .88; margin: 0 0 30px; max-width: 520px; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.hero .note { font-size: 14px; opacity: .75; margin: 0; }
/* The phone bleeds off the bottom edge of the hero. */
.hero .phone { align-self: end; height: 520px; overflow: hidden; }
.hero .phone img { width: min(360px, 100%); margin: 0 auto; filter: drop-shadow(0 30px 40px rgba(0,0,0,.35)); }
.hero .wrap > div:first-child { padding-bottom: 64px; }
img.buddy { width: 92px; margin-bottom: 18px; animation: float 3.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { img.buddy { animation: none; } html { scroll-behavior: auto; } }

/* ---- Sections -------------------------------------------------------- */

section { padding: 84px 0; }
.eyebrow { color: var(--primary); font-weight: 800; font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase; margin: 0 0 8px; }
h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -1.2px; margin: 0 0 14px; }
.section-lead { color: var(--text-muted); font-size: 19px; max-width: 640px; margin: 0 0 40px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { margin: 14px 0 6px; font-size: 19px; letter-spacing: -0.3px; }
.card p { margin: 0; color: var(--text-muted); font-size: 15.5px; }
.icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 24px; background: var(--primary-tint); }
.icon.amber { background: var(--amber-tint); }
.icon.teal { background: var(--teal-tint); }

.premium { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pill { display: inline-block; background: var(--amber); color: #3d2600; font-weight: 800; font-size: 13px; letter-spacing: 1.5px; padding: 6px 14px; border-radius: 999px; margin-bottom: 14px; }

.shots { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
.shots img { width: 250px; height: auto; flex: none; border-radius: 22px; scroll-snap-align: start; box-shadow: var(--shadow); }

.privacy-band { background: var(--teal-tint); border-radius: 28px; padding: 44px; display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.privacy-band .big-icon { font-size: 54px; }
.privacy-band h2 { margin-bottom: 8px; }
.privacy-band p { margin: 0; color: var(--text-muted); }

.cta { text-align: center; }
.cta .btn { margin-top: 10px; }

/* ---- Documents (privacy, terms, support) ------------------------------ */

.doc { padding: 56px 0 80px; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(34px, 5vw, 48px); letter-spacing: -1.4px; line-height: 1.1; margin: 0 0 8px; }
.doc .updated { color: var(--text-muted); margin: 0 0 36px; font-size: 15px; }
.doc h2 { font-size: 22px; letter-spacing: -0.3px; margin: 34px 0 8px; }
.doc p { margin: 0 0 12px; color: var(--text); }
.doc .box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin: 22px 0; }
.doc .box p:last-child { margin-bottom: 0; }

details { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 4px 22px; margin: 0 0 12px; }
details summary { cursor: pointer; font-weight: 800; padding: 16px 0; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; float: right; color: var(--primary); font-size: 22px; line-height: 1; }
details[open] summary::after { content: "−"; }
details p { margin: 0 0 16px; color: var(--text-muted); }

/* ---- Footer ---------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--border); padding: 36px 0 44px; color: var(--text-muted); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--text); }

/* ---- Small screens --------------------------------------------------- */

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 48px; text-align: center; }
  .hero .wrap > div:first-child { padding-bottom: 0; }
  .hero .phone { height: 420px; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero .badges { justify-content: center; }
  .buddy { margin-left: auto; margin-right: auto; }
  .grid { grid-template-columns: 1fr; }
  .privacy-band { grid-template-columns: 1fr; padding: 30px; text-align: center; }
  .nav a.optional { display: none; }
  section { padding: 60px 0; }
}

/* ---- Motion (same feel as the app) --------------------------------------
   Easing: AppMotion.curve (easeOutCubic) for reveals, a soft spring for
   presses and Buddy. All of it is dropped for prefers-reduced-motion.     */

:root {
  --ease: cubic-bezier(0.215, 0.61, 0.355, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* FadeSlideIn: only when JS is on (site.js adds .reveal / .in). */
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease) var(--d, 0ms), transform 0.6s var(--ease) var(--d, 0ms),
              box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

/* Hero entrance: Buddy drops in with a squash, then the words rise. */
.hero-in { opacity: 0; animation: rise 0.7s var(--ease) forwards; animation-delay: var(--d, 0ms); }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

svg.buddy { display: block; width: 96px; height: auto; margin-bottom: 18px; overflow: visible; }
.buddy-drop { animation: drop 0.9s var(--spring) both; transform-origin: 50% 100%; }
@keyframes drop {
  0% { opacity: 0; transform: translateY(-60px) scale(0.6); }
  55% { opacity: 1; transform: translateY(0) scale(1.08, 0.9); }
  75% { transform: translateY(-6px) scale(0.97, 1.03); }
  100% { transform: none; }
}
.buddy-float { animation: float 3.4s ease-in-out 1s infinite; }
.buddy-eye { transform-box: fill-box; transform-origin: center; }
.buddy-eye.blink { animation: blink 0.17s ease-in-out; }
@keyframes blink { 50% { transform: scaleY(0.08); } }
.buddy-pupil { transition: transform 0.18s var(--ease); }
.buddy-shadow { animation: shadow 3.4s ease-in-out 1s infinite; transform-origin: center; transform-box: fill-box; }
@keyframes shadow { 50% { transform: scaleX(0.82); opacity: 0.6; } }

.hero .phone img { animation: phone-in 1s var(--ease) 0.35s both; }
@keyframes phone-in { from { opacity: 0; transform: translateY(60px) rotate(2deg); } to { opacity: 1; transform: none; } }

/* Pressable: lift on hover, spring down on press. */
.btn { transition: transform 0.2s var(--spring), box-shadow 0.2s var(--ease); }
.btn:active { transform: scale(0.95); }
.btn[aria-disabled="true"]:active { transform: none; }

.card { transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease); }
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(38, 30, 120, 0.16); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.card .icon { transition: transform 0.35s var(--spring); }
.card:hover .icon { transform: scale(1.1) rotate(-4deg); }
.js .card.reveal.in:hover { transform: translateY(-4px); }

.shots img { transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.shots img:hover { transform: translateY(-6px) scale(1.02); }

/* PREMIUM pill: a slow shine sweep. */
.pill { position: relative; overflow: hidden; }
.pill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%); animation: shine 3.2s ease-in-out 1.2s infinite;
}
@keyframes shine { 40%, 100% { transform: translateX(120%); } }

/* Privacy shield: a gentle pulse ring. */
.privacy-band .big-icon { border-radius: 50%; animation: pulse 2.8s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--teal) 40%, transparent); }
  70%, 100% { box-shadow: 0 0 0 22px transparent; }
}

.site-header { transition: box-shadow 0.25s var(--ease); }
.site-header.scrolled { box-shadow: 0 6px 20px rgba(20, 20, 31, 0.08); }
.nav a { transition: color 0.15s var(--ease); }

/* FAQ: the answer slides open. */
details { transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
details:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
details[open] { box-shadow: var(--shadow); }
details[open] > p { animation: rise 0.35s var(--ease); }
details summary::after { transition: transform 0.25s var(--spring); }
details[open] summary::after { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-in { opacity: 1; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---- Scroll story ("How it works") --------------------------------------
   Desktop: the phone sticks while the steps scroll past; its screen
   crossfades to the step in the middle of the viewport (site.js).
   Phones: each step shows its own screenshot inline.                     */

.story { padding-bottom: 40px; --accent: var(--primary); }
.story[data-accent="teal"] { --accent: var(--teal); }
.story[data-accent="amber"] { --accent: var(--amber); }
.story-grid { display: grid; grid-template-columns: 1fr 380px; gap: 64px; align-items: start; }
.story-step {
  min-height: 64vh; display: flex; flex-direction: column; justify-content: center;
  opacity: 0.35; transform: translateX(-10px) scale(0.98); transform-origin: left center;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.story-step.active { opacity: 1; transform: none; }
.step-card {
  max-width: 580px; padding: 30px 32px; border-radius: 28px;
  border: 1px solid transparent; background: transparent;
  transition: background 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s var(--ease);
}
.story-step.active .step-card { background: var(--surface); border-color: var(--border); box-shadow: 0 24px 60px rgba(38, 30, 120, 0.12); }
.step-head { display: flex; align-items: center; gap: 12px; }
.step-head .icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; }
.step-head .icon .material-symbols-rounded { font-size: 28px; }
.story-step h3 { font-size: clamp(26px, 3vw, 36px); line-height: 1.12; letter-spacing: -1px; margin: 18px 0 10px; }
.story-step p { color: var(--text-muted); font-size: 18px; margin: 0; }
.step-num { font-weight: 800; font-size: 15px; letter-spacing: 2px; color: var(--text-muted); }
.pill.small { font-size: 11px; padding: 4px 10px; margin: 0; }
.step-points { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.step-points li {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px;
  background: var(--surface-muted); font-size: 14px; font-weight: 700; color: var(--text);
}
.step-points .material-symbols-rounded { font-size: 18px; color: var(--teal); }
.story-step.active .step-points li { animation: rise 0.45s var(--ease) both; }
.story-step.active .step-points li:nth-child(2) { animation-delay: 70ms; }
.story-step.active .step-points li:nth-child(3) { animation-delay: 140ms; }
.icon.indigo .material-symbols-rounded { color: var(--primary); }
.icon.teal { background: var(--teal-tint); }
.icon.teal .material-symbols-rounded { color: var(--teal); }
.icon.amber { background: var(--amber-tint); }
.icon.amber .material-symbols-rounded { color: var(--amber-dark); }
.icon.indigo { background: var(--primary-tint); }
.step-shot { display: none; }

.story-phone { position: sticky; top: max(84px, calc(50vh - 350px)); display: flex; flex-direction: column; align-items: center; }
.story-phone .phone-frame { z-index: 1; }

/* Colour glow behind the phone, following the active step's accent. */
.phone-glow {
  position: absolute; left: 50%; top: 45%; width: 560px; height: 560px; transform: translate(-50%, -50%);
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent, var(--primary)) 30%, transparent) 0%, transparent 65%);
  transition: background 0.6s var(--ease);
}

/* Floating info bubbles beside the phone, like the app's chips. */
.phone-chip {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 12px 16px; border-radius: 18px; background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 800; box-shadow: 0 16px 40px rgba(38, 30, 120, 0.18); border: 1px solid var(--border);
  opacity: 0; transform: translateY(16px) scale(0.85); pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.5s var(--spring);
}
.phone-chip .material-symbols-rounded { font-size: 22px; color: var(--accent, var(--primary)); }
.phone-chip.left { left: -120px; top: 22%; }
.phone-chip.right { right: -90px; top: 62%; }
.phone-chip.active { opacity: 1; transform: none; transition-delay: 0.12s; }
.phone-chip.right.active { transition-delay: 0.24s; }
.phone-chip.active { animation: bob 4s ease-in-out 0.8s infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.phone-frame {
  position: relative; width: min(300px, calc((100vh - 170px) * 1080 / 2424)); aspect-ratio: 1080 / 2424; border-radius: 46px;
  background: #111118; padding: 12px; box-shadow: 0 40px 80px rgba(38, 30, 120, 0.28);
  transform: rotate(var(--tilt, 0deg)); transition: transform 0.6s var(--ease);
}
.phone-frame .screen {
  position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: cover; object-position: top;
  border-radius: 36px; opacity: 0; transform: scale(0.96) translateY(14px);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
}
.phone-frame .screen.active { opacity: 1; transform: none; }
.story-dots { display: flex; gap: 8px; margin-top: 22px; }
.story-dots span { width: 8px; height: 8px; border-radius: 99px; background: var(--border); transition: width 0.35s var(--spring), background 0.35s var(--ease); }
.story-dots span.active { width: 26px; background: var(--primary); }

/* Scroll progress bar under the header. */
.site-header::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 3px;
  width: calc(var(--progress, 0) * 100%);
  background: linear-gradient(90deg, var(--primary), var(--amber));
}

/* Hero parallax (site.js sets --scroll in px). */
.hero .buddy, .hero h1, .hero .lead { will-change: transform; }

@media (max-width: 860px) {
  .story-grid { grid-template-columns: 1fr; gap: 0; }
  .story-phone { display: none; }
  .story-step { min-height: 0; opacity: 1; transform: none; padding: 14px 0; }
  .step-card { padding: 24px; background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
  .story-step .step-points li { animation: none; }
  .step-shot { display: block; width: min(280px, 80%); margin: 24px auto 0; border-radius: 30px; border: 10px solid #111118; box-shadow: var(--shadow); }
}

/* Parking guides (tool/website/make_guides.py) */
.guide .lede { font-size: 20px; color: var(--text-muted); margin: 0 0 30px; }
.guide h3 { font-size: 18px; margin: 24px 0 6px; }
.guide ul, .guide ol { margin: 0 0 14px; padding-left: 24px; }
.guide li { margin: 0 0 6px; }
.guide hr { border: 0; border-top: 1px solid var(--border); margin: 34px 0; }
.guide code { background: var(--surface-muted); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }
.guide-list { list-style: none; padding: 0 !important; display: grid; gap: 14px; }
.guide-list a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; text-decoration: none; color: var(--text); }
.guide-list a:hover { border-color: var(--primary); }
.guide-list strong { display: block; font-size: 18px; margin-bottom: 4px; }
.guide-list span { color: var(--text-muted); font-size: 15px; }
