/* Car & Play — connectcarplay.com
   Same system as our other app sites (fyndmydevices.com, tap2pdf.com). Tokens mirror the app's Theme.swift:
   accent #00D46A on near-black. System font (SF on Apple devices), Inter elsewhere. */

:root {
  --bg: #0E0F11;
  --surface: #16181A;
  --text: #F4F5F7;
  --muted: #8E8E9C;
  --line: #24272A;
  --grid: rgba(0, 212, 106, .07);
  --brand: #00D46A;
  --brand-2: #3BE88F;
  --brand-deep: #00B85C;
  --brand-soft: rgba(0, 212, 106, .12);
  --on-brand: #04140B;
  --green: #00D46A;
  --orange: #FF872B;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .6);
  --maxw: 1160px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

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

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }

.nav { display: flex; gap: 26px; margin-inline-start: auto; }
.nav a { color: var(--muted); font-weight: 600; font-size: 15px; }
.nav a:hover { color: var(--text); text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: var(--on-brand); font-weight: 700; font-size: 15px;
  border: 0; cursor: pointer; transition: background .15s, transform .15s;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; filter: none; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface); }

@media (max-width: 760px) {
  .nav { display: none; }
  .site-header .btn { margin-inline-start: auto; }
}

/* ---------- Generic sections ---------- */
section { padding-block: 96px; scroll-margin-top: 60px; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 14px;
}
h1, h2, h3 { line-height: 1.12; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(40px, 6vw, 66px); font-weight: 800; }
h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 800; }
h3 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.lead { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 40ch; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.section-head p { color: var(--muted); margin: 14px auto 0; font-size: 18px; }

/* ---------- Hero ---------- */
.hero { padding-block: 56px 96px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 .accent { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { margin: 22px 0 32px; }
.store-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.store-badge img { height: 54px; width: auto; }
.store-badge:hover { opacity: .85; }
.micro { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 22px; color: var(--muted); font-size: 15px; font-weight: 600; }
.micro span::before { content: "✓"; color: var(--green); font-weight: 800; margin-inline-end: 6px; }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero .lead { margin-inline: auto; }
  .store-row, .micro { justify-content: center; }
}

/* ---------- Cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 540px) { .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.card p { color: var(--muted); margin: 10px 0 0; font-size: 16px; }
.icon-badge {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); margin-bottom: 18px;
}
.icon-badge svg { width: 24px; height: 24px; }

/* ---------- Privacy band ---------- */
.band {
  background: radial-gradient(120% 140% at 0% 0%, #0E4A2A 0%, #0A2718 45%, #0A1410 100%); border: 1px solid rgba(0,212,106,.16);
  color: #fff; border-radius: 32px; padding: clamp(36px, 6vw, 72px);
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
}
.band .eyebrow { color: var(--brand); }
.band p { color: rgba(255,255,255,.72); font-size: 18px; margin: 16px 0 0; }
.band ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.band li { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 14px 16px; font-weight: 600; display: flex; gap: 12px; align-items: center; }
.band li::before { content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%; background: #00D46A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B0F1C' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat; }
@media (max-width: 860px) { .band { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 0 22px; }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 0; font-weight: 700; font-size: 18px;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 26px; font-weight: 500; color: var(--brand); transition: transform .2s; line-height: 1; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 20px; color: var(--muted); }

/* ---------- CTA ---------- */
.cta { text-align: center; }
.cta .card { padding: clamp(36px, 6vw, 72px); background: linear-gradient(160deg, #22DE7C, #00A855); color: var(--on-brand); border: 0; }
.cta .card p { color: rgba(4,20,11,.75); font-size: 18px; max-width: 46ch; margin: 16px auto 30px; }
.cta .store-row { justify-content: center; }
.cta .micro { justify-content: center; color: rgba(4,20,11,.75); }
.cta .micro span::before { color: var(--on-brand); }
/* a thin dark edge so the green icon stands off the green card */
.cta-icon { width: 84px; height: 84px; border-radius: 22.37%; margin: 0 auto 24px; box-shadow: 0 0 0 1.5px rgba(4,20,11,.28), 0 14px 32px rgba(4,20,11,.35); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px 48px; color: var(--muted); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: flex-start; }
.site-footer .brand { margin-bottom: 8px; }
.site-footer p { margin: 0; max-width: 42ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.footer-links a { color: var(--muted); font-weight: 600; }
.footer-links a:hover { color: var(--text); }
.copyright { width: 100%; font-size: 14px; }

/* ---------- Legal pages ---------- */
.legal { padding-block: 56px 96px; }
.legal .wrap { max-width: 800px; }
.legal .back { display: inline-flex; gap: 6px; font-weight: 700; margin-bottom: 28px; }
.legal h1 { font-size: clamp(36px, 5vw, 52px); }
.legal .updated { color: var(--muted); margin: 12px 0 36px; font-weight: 600; }
.legal h2 { font-size: 24px; margin: 44px 0 12px; letter-spacing: -.015em; }
.legal h3 { font-size: 18px; margin: 24px 0 8px; }
.legal p, .legal li { color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.legal ul { padding-inline-start: 22px; }
.legal li { margin-bottom: 8px; }
.legal .note { background: var(--brand-soft); border-radius: var(--radius-sm); padding: 18px 20px; margin: 24px 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
.legal th, .legal td { text-align: start; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { font-weight: 800; }
.table-scroll { overflow-x: auto; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Small screens ---------- */
.brand, .btn { white-space: nowrap; }
@media (max-width: 480px) {
  .wrap { padding-inline: 18px; }
  .site-header .wrap { gap: 12px; height: 60px; }
  .brand { font-size: 17px; }
  .brand img { width: 30px; height: 30px; }
  .site-header .btn { height: 38px; padding: 0 14px; font-size: 14px; }
  section { padding-block: 72px; }
}
@media (max-width: 640px) {
  .legal table, .legal tbody, .legal tr, .legal td { display: block; width: 100%; }
  .legal thead { display: none; }
  .legal tr { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 4px; margin-bottom: 12px; background: var(--surface); }
  .legal td { border: 0; padding: 6px 12px; }
  }

/* ---------- Hero with live demo ---------- */
.hero-demo { padding-block: 40px 72px; position: relative; isolation: isolate; }
.hero-demo .wrap { grid-template-columns: 1fr auto; gap: 64px; }
.hero-demo h1 { font-size: clamp(38px, 5.2vw, 60px); }
.hero-demo .lead { max-width: 44ch; margin: 20px 0 26px; }
.hero-phone { display: flex; flex-direction: column; align-items: center; gap: 12px; position: relative; }
.hero-phone::before {
  content: ""; position: absolute; z-index: -1; inset: 6% -18% 18%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 212, 106, .2), transparent); filter: blur(24px);
}
.demo-hint { margin: 6px 0 0; max-width: 340px; text-align: center; color: var(--muted); font-size: 14px; min-height: 2.6em; }
.demo-reset { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; padding: 4px 8px; }
.demo-reset:hover { text-decoration: underline; }

.demo-picks { display: grid; gap: 10px; margin-bottom: 28px; max-width: 460px; }
.demo-pick {
  display: flex; align-items: center; gap: 14px; text-align: start; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 12px 16px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.demo-pick:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.demo-pick[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.demo-pick b { display: block; font-size: 16px; }
.demo-pick small { display: block; color: var(--muted); font-size: 14px; }
.pick-ic { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.demo-pick[aria-pressed="true"] .pick-ic { background: var(--brand); color: var(--on-brand); }
.pick-ic svg { width: 22px; height: 22px; }
.demo-pick:focus-visible, .try-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.try-link { margin-top: 14px; background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--brand); cursor: pointer; }
.try-link:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .hero-demo .wrap { grid-template-columns: 1fr; gap: 32px; }
  .hero-demo .lead { margin-inline: auto; }
  .demo-picks { grid-template-columns: repeat(3, 1fr); max-width: none; gap: 8px; }
  .demo-pick { flex-direction: column; text-align: center; gap: 8px; padding: 12px 8px; }
  .demo-pick small { display: none; }
  .demo-pick b { font-size: 13px; }
  .hero-demo .hero-copy .store-row, .hero-demo .micro { display: none; }
}
.mobile-only { display: none; }
@media (max-width: 900px) { .mobile-only { display: inline-block; margin-top: 6px; } }

/* ---------- Rating + post-demo CTA ---------- */
.app-rating { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.app-rating b { color: var(--text); }
.app-rating .stars { color: #FFB300; letter-spacing: 1px; font-size: 15px; }
.demo-cta {
  display: grid; justify-items: center; gap: 4px; text-align: center; max-width: 340px; width: 100%;
  background: var(--surface); border: 1.5px solid var(--brand); border-radius: 20px; padding: 16px 18px 18px;
  box-shadow: 0 10px 30px -12px rgba(0,212,106,.35); animation: ctaIn .4s cubic-bezier(.2,.9,.3,1.2);
}
.demo-cta b { font-size: 17px; }
.demo-cta span { color: var(--muted); font-size: 14px; }
.demo-cta .btn { margin-top: 10px; }
@keyframes ctaIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .demo-cta { animation: none; } }
@media (max-width: 900px) { .hero-demo .store-row .app-rating { display: none; } }
/* on phones the hero's store row is hidden, so the rating sits under the badge below the demo */
.hero-phone .rating-mobile { display: none; }
@media (max-width: 900px) { .hero-phone .rating-mobile { display: inline-flex; } }

/* ---------- Language menu (footer) ---------- */
.lang-menu { position: relative; width: fit-content; }
.lang-menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--text);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary svg { width: 16px; height: 16px; color: var(--muted); }
.lang-menu summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-135deg) translate(-1px, -1px); margin-inline-start: 2px; }
.lang-menu[open] summary::after { transform: rotate(45deg) translate(-2px, -2px); }
.lang-list {
  position: absolute; bottom: calc(100% + 8px); inset-inline-start: 0; z-index: 60; width: 240px; max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 6px;
  display: grid;
}
.lang-list a { padding: 8px 12px; border-radius: 10px; color: var(--text); font-weight: 500; font-size: 15px; }
.lang-list a:hover { background: color-mix(in srgb, var(--text) 6%, transparent); text-decoration: none; }
.lang-list a[aria-current="page"] { color: var(--brand); font-weight: 700; }
.lang-menu summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* CJK and Devanagari: no negative tracking on headings */
:lang(ja) :is(h1, h2, h3), :lang(ko) :is(h1, h2, h3), :lang(zh) :is(h1, h2, h3), :lang(hi) :is(h1, h2, h3), :lang(th) :is(h1, h2, h3), :lang(ar) :is(h1, h2, h3, .brand) { letter-spacing: 0; }
/* Arabic letters join, so never add tracking; Thai and Vietnamese need taller lines for their marks */
:lang(ar) * { letter-spacing: 0 !important; }
:lang(th) h1, :lang(vi) h1, :lang(hi) h1 { line-height: 1.3; }

.site-footer .lang-menu { flex-basis: 100%; }
.site-footer .lang-menu .lang-list { width: 240px; }

:lang(ja) .eyebrow, :lang(ko) .eyebrow, :lang(zh) .eyebrow, :lang(hi) .eyebrow, :lang(th) .eyebrow { text-transform: none; letter-spacing: .04em; }
:lang(ar) .eyebrow { text-transform: none; }

/* ---------- ?embed: only the demo phone, shown inside pmapps.online ---------- */
html.embed body { background: transparent; }
html.embed .site-header, html.embed .site-footer, html.embed main > section:not(.hero-demo), html.embed .hero-copy,
html.embed .hero-phone > .store-badge, html.embed .rating-mobile, html.embed .hero-demo::before,
html.embed .hero-phone::before { display: none !important; }
html.embed .hero-demo { padding: 8px 0 16px; }
html.embed .hero-demo .wrap { display: flex; justify-content: center; max-width: none; padding: 0; }
.demo-note { margin: -4px 0 0; max-width: 340px; text-align: center; color: var(--muted); font-size: 12.5px; opacity: .85; }
.cta .btn { background: var(--on-brand); color: #fff; }
@media (max-width: 560px) { h1, h2, h3 { overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; } }

/* "Try it" sits at the bottom of each feature card, so the links in a row line up */
.feature-grid .card { display: flex; flex-direction: column; align-items: flex-start; }
.feature-grid .card .try-link { margin-top: auto; padding-top: 14px; }
/* the three ticks under the download button as a tidy column */
.hero-demo .micro { flex-direction: column; gap: 8px; }
@media (max-width: 1120px) { .hero-demo .micro { align-items: center; } }
/* the four small cards continue the feature grid above, same gap as between its rows */
#features { padding-bottom: 0; }
.more-features { padding-top: 20px; }
