/* ==========================================================================
   Plotrip — landing page
   Dark-mode-first design system, aligned with the app's Liquid Glass tokens
   (Theme.swift). Brand: #0047BB (light) / #9DB8FF (dark accents).
   ========================================================================== */

:root {
  /* Dark theme (default) */
  --bg: #0c0f17;
  --bg-top: #101627;
  --surface: #171c28;
  --surface-high: #1f2532;
  --text: #ebedf4;
  --text-muted: #a8aebf;
  --outline: rgba(255, 255, 255, 0.1);
  --brand: #9db8ff;
  --brand-strong: #6f8fe8;
  --brand-deep: #0047bb;
  --on-brand: #0a2260;
  --glass-fill: rgba(35, 42, 58, 0.45);
  --glass-stroke: rgba(255, 255, 255, 0.14);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --blob-a: rgba(0, 71, 187, 0.35);
  --blob-b: rgba(157, 184, 255, 0.12);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fc;
    --bg-top: #eef1ff;
    --surface: #ffffff;
    --surface-high: #eef0f7;
    --text: #171a21;
    --text-muted: #4a4f5e;
    --outline: rgba(23, 26, 33, 0.1);
    --brand: #0047bb;
    --brand-strong: #2f66d6;
    --brand-deep: #0047bb;
    --on-brand: #ffffff;
    --glass-fill: rgba(255, 255, 255, 0.55);
    --glass-stroke: rgba(255, 255, 255, 0.65);
    --shadow: 0 8px 28px rgba(23, 26, 33, 0.1);
    --blob-a: rgba(0, 71, 187, 0.14);
    --blob-b: rgba(157, 184, 255, 0.35);
    color-scheme: light;
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 40%);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: var(--brand); }

.container {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

/* Ambient background blobs (matches the app's BackgroundBlobs) */
.blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  filter: blur(90px);
}
.blobs::before,
.blobs::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.blobs::before {
  width: 55vw; height: 55vw;
  top: -20vw; right: -15vw;
  background: var(--blob-a);
}
.blobs::after {
  width: 40vw; height: 40vw;
  bottom: -10vw; left: -12vw;
  background: var(--blob-b);
}

/* --- Nav ------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0.75rem;
  z-index: 10;
  margin-top: 0.75rem;
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-stroke);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow);
}
.nav-logo { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; }
.nav-logo img { width: 30px; height: 30px; }
.nav-spacer { flex: 1; }
.nav-lang { font-size: 0.85rem; color: var(--text-muted); text-decoration: none; padding: 0.4rem 0.6rem; }
.nav-lang:hover { color: var(--text); }
select.nav-lang {
  background: transparent;
  border: none;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 1rem;
}
.nav-cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--on-brand);
  background: var(--brand);
  text-decoration: none;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(0, 71, 187, 0.35); }

/* --- Hero ------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
  padding: clamp(4rem, 10vh, 7rem) 0 4rem;
}
.hero h1 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.hero h1 .accent {
  background: linear-gradient(90deg, var(--brand-strong), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .answer {
  margin-top: 1.4rem;
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 34rem;
}
.hero-actions { margin-top: 2.2rem; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.badge-store img { height: 54px; width: auto; display: block; transition: transform 0.15s ease; }
.badge-store:hover img { transform: scale(1.04); }
.hero-note { font-size: 0.85rem; color: var(--text-muted); }

/* Phone mockup (pure CSS, mirrors the app's trip dashboard) */
.phone {
  justify-self: center;
  width: min(300px, 80vw);
  aspect-ratio: 9 / 19;
  border-radius: 44px;
  padding: 12px;
  background: linear-gradient(160deg, #2a3040, #12151f);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}
@media (prefers-color-scheme: light) {
  .phone { box-shadow: 0 30px 80px rgba(23, 26, 33, 0.25), inset 0 0 0 2px rgba(255, 255, 255, 0.2); }
}
.phone-screen {
  height: 100%;
  border-radius: 34px;
  overflow: hidden;
  background: linear-gradient(180deg, #101627, #0c0f17);
  padding: 1.1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
/* Real app screenshot inside the frame */
.phone-screen.shot { padding: 0; gap: 0; }
.phone-screen.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phone-screen .p-title { color: #ebedf4; font-weight: 700; font-size: 0.95rem; }
.phone-screen .p-sub { color: #a8aebf; font-size: 0.7rem; }
.p-card {
  border-radius: 16px;
  padding: 0.7rem 0.8rem;
  background: rgba(35, 42, 58, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #ebedf4;
  font-size: 0.72rem;
}
.p-card strong { display: block; font-size: 0.78rem; }
.p-card.p-hero {
  background: linear-gradient(135deg, #0047bb, #2e4e9e);
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.p-card.p-alert { border-color: rgba(255, 144, 134, 0.4); }
.p-alert .p-dot { color: #ff9086; }
.p-row { display: flex; gap: 0.6rem; }
.p-row .p-card { flex: 1; }

/* --- Sections ---------------------------------------------------------- */
section { padding: 4.5rem 0; }
.section-title {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 26ch;
}
.section-sub { margin-top: 0.8rem; color: var(--text-muted); max-width: 52ch; }

/* Bento grid */
.bento {
  margin-top: 2.6rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}
.card {
  grid-column: span 2;
  border-radius: 26px;
  padding: 1.6rem;
  background: var(--glass-fill);
  border: 1px solid var(--glass-stroke);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-3px); }
.card.wide { grid-column: span 3; }
.card .icon { font-size: 1.6rem; }
.card h3 { margin-top: 0.7rem; font-size: 1.1rem; font-weight: 700; }
.card p { margin-top: 0.4rem; font-size: 0.95rem; color: var(--text-muted); }

/* Steps */
.steps { margin-top: 2.6rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; counter-reset: step; }
.step {
  border-radius: 26px;
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--outline);
  box-shadow: var(--shadow);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 2.2rem; height: 2.2rem;
  border-radius: 50%;
  font-weight: 800;
  color: var(--on-brand);
  background: var(--brand);
}
.step h3 { margin-top: 0.9rem; font-size: 1.05rem; }
.step p { margin-top: 0.4rem; font-size: 0.95rem; color: var(--text-muted); }

/* FAQ */
.faq { max-width: 46rem; }
.faq details {
  border-bottom: 1px solid var(--outline);
  padding: 1rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--brand); transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin-top: 0.7rem; color: var(--text-muted); }

/* Final CTA */
.cta-final {
  text-align: center;
  border-radius: 34px;
  padding: 3.5rem 1.5rem;
  background: linear-gradient(135deg, var(--brand-deep), #2e4e9e);
  color: #fff;
  box-shadow: var(--shadow);
}
.cta-final h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; }
.cta-final p { margin-top: 0.6rem; opacity: 0.85; }
.cta-final .badge-store { display: inline-block; margin-top: 1.8rem; }

/* Footer */
footer { padding: 3rem 0 2.5rem; color: var(--text-muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* Legal / support pages */
.legal { max-width: 46rem; padding-top: 3rem; }
.legal h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.legal .updated { margin-top: 0.6rem; color: var(--text-muted); font-size: 0.9rem; }
.legal h2 { margin-top: 2.2rem; font-size: 1.25rem; font-weight: 700; }
.legal p, .legal li { margin-top: 0.7rem; color: var(--text-muted); }
.legal ul { padding-left: 1.2rem; }
.legal strong { color: var(--text); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .nav-cta, .badge-store img { transition: none; }
}

/* Responsive */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 3rem; }
  .hero .answer { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .phone { display: none; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .card, .card.wide { grid-column: span 2; }
  .steps { grid-template-columns: 1fr; }
}
