/* TrueCostMotors design system (rolled out sitewide 2026-09-25 from the M3 pilot).
   Namespaced (p-*). Dark premium theme: "car magazine meets fintech".
   Fonts self-hosted (OFL): Space Grotesk (display) + Inter (body). */

@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-var.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #07090c;
  --bg-soft: #0b0f15;
  --card: #10151d;
  --card-2: #151c26;
  --line: rgba(255, 255, 255, .09);
  --line-soft: rgba(255, 255, 255, .05);
  --ink: #f2f5f9;
  --mut: #a8b1bd;
  --dim: #6d7683;
  --red: #e10600;
  --red-hot: #ff2d1e;
  --red-deep: #6e0300;
  --amber: #ffb400;
  --green: #34d17b;
  --orange: #ff8a3d;
  --fd: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
  --fb: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 16px;
  --wrap: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body.p-body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--fb);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.p-body ::selection { background: var(--red); color: #fff; }
img { max-width: 100%; }
a { color: var(--ink); }
:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 3px; border-radius: 4px; }

.p-wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; }
.js-hidden { display: none !important; }
.ad-slot { display: none; }

/* ---------- header ---------- */
.p-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 9, 12, .82);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.p-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 3.75rem;
}
.p-brand {
  font-family: var(--fd); font-weight: 700; font-size: 1.15rem;
  letter-spacing: -.01em; text-decoration: none; color: var(--ink);
  white-space: nowrap;
}
.p-brand span { color: var(--red-hot); }
.p-nav { display: flex; gap: 1.25rem; align-items: center; }
.p-nav a {
  color: var(--mut); text-decoration: none; font-size: .9rem; font-weight: 500;
  transition: color .18s ease;
}
.p-nav a:hover { color: var(--ink); }
.p-nav .p-nav-cta {
  color: #fff; background: var(--red); padding: .45rem 1rem; border-radius: 999px;
  font-weight: 600;
}
.p-nav .p-nav-cta:hover { background: var(--red-hot); color: #fff; }
@media (max-width: 760px) {
  .p-nav a:not(.p-nav-cta) { display: none; }
}

/* ---------- hero ---------- */
.p-hero {
  position: relative; overflow: clip;
  background:
    linear-gradient(180deg, rgba(7,9,12,.72) 0%, rgba(7,9,12,.55) 45%, var(--bg) 100%),
    url("/assets/img/pilot/hero-texture.webp") center / cover no-repeat,
    var(--bg);
  border-bottom: 1px solid var(--line-soft);
}
.p-hero-inner { padding-block: clamp(3rem, 9vw, 5.5rem) clamp(2.5rem, 7vw, 4rem); position: relative; }
.p-kicker {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--red-hot); margin: 0 0 1.1rem;
}
.p-kicker::before { content: ""; width: 1.6rem; height: 2px; background: var(--red); border-radius: 2px; }
.p-h1 {
  font-family: var(--fd); font-weight: 700;
  font-size: clamp(2rem, 7.5vw, 3.4rem);
  line-height: 1.04; letter-spacing: -.02em;
  margin: 0 0 1.5rem; max-width: 16ch; text-wrap: balance;
}
.p-hero-num { margin: 0 0 .4rem; }
.p-hero-num .p-num-label {
  display: block; font-size: .78rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--mut); margin-bottom: .35rem;
}
.p-hero-num .p-num {
  font-family: var(--fd); font-weight: 700;
  font-size: clamp(3.2rem, 15vw, 6rem);
  line-height: 1; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 30%, #c9d2dd 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.p-hero-num .p-num-sub { display: block; color: var(--dim); font-size: .95rem; margin-top: .5rem; }
.p-kicker-light { color: rgba(255, 255, 255, .85); }
.p-hero-stats.is-hidden { display: none; }
.p-lede { font-size: clamp(1.02rem, 2.6vw, 1.2rem); color: var(--mut); max-width: 62ch; margin: 1.25rem 0 0; }
.p-lede strong { color: var(--ink); font-weight: 650; }

.p-hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r);
  overflow: hidden; margin-top: 2.25rem;
}
.p-hstat { background: rgba(16, 21, 29, .88); padding: 1rem .9rem; }
.p-hstat dt { font-size: .68rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: .3rem; }
.p-hstat dd { margin: 0; font-family: var(--fd); font-weight: 700; font-size: clamp(1.05rem, 4.5vw, 1.5rem); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.p-hstat dd small { font-family: var(--fb); font-weight: 500; font-size: .75rem; color: var(--dim); display: block; margin-top: .15rem; letter-spacing: 0; }

@keyframes p-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.p-hero-inner > * { animation: p-rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.p-hero-inner > *:nth-child(2) { animation-delay: .08s; }
.p-hero-inner > *:nth-child(3) { animation-delay: .16s; }
.p-hero-inner > *:nth-child(4) { animation-delay: .24s; }
.p-hero-inner > *:nth-child(5) { animation-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .p-hero-inner > * { animation: none; }
  * { transition: none !important; }
}

/* ---------- photo ---------- */
.p-photo { margin: 0; }
.p-photo-wrap { padding-top: 1.75rem; }
.p-photo-card {
  margin: -1px 0 0; position: relative;
  border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .8);
}
.p-photo-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.p-credit { color: var(--dim); font-size: .78rem; margin-top: .6rem; }
.p-credit a { color: var(--dim); }

/* ---------- sections ---------- */
.p-section { padding-block: clamp(2.75rem, 8vw, 4.5rem); border-top: 1px solid var(--line-soft); }
.p-section:first-of-type { border-top: 0; }
.p-section > .p-wrap > .p-kicker { margin-bottom: .8rem; }
.p-h2 {
  font-family: var(--fd); font-weight: 700; letter-spacing: -.015em;
  font-size: clamp(1.4rem, 5.2vw, 2rem); line-height: 1.15;
  margin: 0 0 1rem; text-wrap: balance;
}
.p-sub { color: var(--mut); margin: 0 0 1.75rem; max-width: 64ch; }
.p-prose p { color: var(--mut); max-width: 68ch; }
.p-prose p strong, .p-prose li strong { color: var(--ink); }
.p-fine { color: var(--dim); font-size: .82rem; max-width: 70ch; }
.p-fine a { color: var(--dim); }
.p-tight { margin-bottom: 0; }
.p-tight-top { margin-bottom: 1.25rem; }

/* ---------- cards & panels ---------- */
.p-card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(1.25rem, 4vw, 2rem);
  box-shadow: 0 18px 44px -28px rgba(0, 0, 0, .9);
}
.p-field { margin-bottom: 1.25rem; max-width: 22rem; }
.p-field label { display: block; font-size: .78rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-bottom: .45rem; }
.p-field select, .p-field input {
  width: 100%; background: #0a0e13; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .85rem; font: inherit; font-size: 1rem;
}
.p-field select:focus, .p-field input:focus { outline: none; border-color: var(--red-hot); box-shadow: 0 0 0 3px rgba(225, 6, 0, .25); }

.p-gen-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin: 0 0 1rem; }
.p-gen-stats > div { background: #0a0e13; border: 1px solid var(--line-soft); border-radius: 12px; padding: .8rem .95rem; }
.p-gen-stats dt { font-size: .68rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: .25rem; }
.p-gen-stats dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.p-gen-notes { color: var(--mut); font-size: .92rem; margin: 0; max-width: 66ch; }
@media (min-width: 760px) { .p-gen-stats { grid-template-columns: repeat(4, 1fr); } }
.p-gen-specs { border-top: 1px solid var(--line-soft); padding-top: 1rem; }

/* ---------- tables ---------- */
.p-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); -webkit-overflow-scrolling: touch; }
table.p-table { width: 100%; border-collapse: collapse; font-size: .94rem; min-width: 34rem; }
table.p-table caption { text-align: left; padding: 1rem 1.25rem .25rem; color: var(--dim); font-size: .8rem; }
table.p-table th, table.p-table td { padding: .85rem 1.25rem; text-align: left; border-top: 1px solid var(--line-soft); vertical-align: top; }
table.p-table thead th {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); border-top: 0; background: rgba(255, 255, 255, .02);
}
table.p-table tbody th[scope="row"] { font-weight: 550; color: var(--mut); }
table.p-table td { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
table.p-table thead th:not(:first-child) { text-align: right; }
table.p-table tr.total-row th, table.p-table tr.total-row td {
  background: rgba(225, 6, 0, .08); font-weight: 700; color: var(--ink);
  box-shadow: inset 3px 0 0 var(--red);
}
table.p-table tr.total-row td strong { font-weight: 700; }
table.p-table a { color: var(--red-hot); font-weight: 600; text-decoration: none; }
table.p-table a:hover { text-decoration: underline; }
.p-assump { color: var(--dim); font-size: .84rem; margin-top: 1rem; max-width: 70ch; }

/* ---------- problems & mods ---------- */
ul.p-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .9rem; }
ul.p-list > li {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px;
  padding: 1.05rem 1.2rem; color: var(--mut); font-size: .95rem;
  transition: border-color .18s ease, transform .18s ease;
}
ul.p-list > li:hover { border-color: var(--line); }
ul.p-list > li > strong:first-child { color: var(--ink); font-weight: 650; }
ul.p-list > li > strong:last-of-type {
  display: inline-block; margin-top: .55rem;
  font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--amber); background: rgba(255, 180, 0, .1);
  border: 1px solid rgba(255, 180, 0, .28);
  padding: .22rem .65rem; border-radius: 999px; white-space: nowrap;
}
ul.p-list > li em { color: var(--dim); font-style: normal; font-size: .86rem; }
.p-note { color: var(--dim); font-size: .86rem; margin-top: 1.25rem; max-width: 68ch; }
@media (min-width: 760px) { ul.p-list { grid-template-columns: 1fr 1fr; } ul.p-list > li:last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* ---------- affordability ---------- */
.p-afford-result {
  background: #0a0e13; border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 1rem 1.15rem; margin-top: .9rem;
}
.p-afford-line { margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; }
.afford-monthly { font-family: var(--fd); font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.afford-tier { font-weight: 700; font-size: .82rem; padding: .28rem .7rem; border-radius: 999px; border: 1px solid; }
.afford-tier.t-comfortable { color: var(--green); border-color: rgba(52, 209, 123, .4); background: rgba(52, 209, 123, .08); }
.afford-tier.t-doable { color: var(--amber); border-color: rgba(255, 180, 0, .4); background: rgba(255, 180, 0, .08); }
.afford-tier.t-stretch { color: var(--orange); border-color: rgba(255, 138, 61, .4); background: rgba(255, 138, 61, .08); }
.afford-tier.t-over { color: var(--red-hot); border-color: rgba(255, 45, 30, .45); background: rgba(225, 6, 0, .1); }
.afford-detail { color: var(--mut); font-size: .88rem; flex-basis: 100%; }

/* ---------- market trend chart ---------- */
#market-trend-chart { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 1rem .5rem .25rem; }
#market-trend-chart svg { width: 100%; height: auto; display: block; }

/* ---------- faq ---------- */
.p-faq details { background: var(--card); border: 1px solid var(--line-soft); border-radius: 14px; margin-bottom: .7rem; overflow: hidden; }
.p-faq summary {
  cursor: pointer; list-style: none; padding: 1.05rem 1.25rem; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.p-faq summary::-webkit-details-marker { display: none; }
.p-faq summary::after {
  content: "+"; flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  border: 1px solid var(--line); color: var(--red-hot);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 400; transition: transform .2s ease;
}
.p-faq details[open] summary::after { transform: rotate(45deg); }
.p-faq details p { margin: 0; padding: 0 1.25rem 1.2rem; color: var(--mut); }
.p-faq details p strong { color: var(--ink); }

/* ---------- foldable sections ---------- */
.p-fold { background: var(--card); border: 1px solid var(--line-soft); border-radius: 16px; overflow: hidden; }
.p-fold-head { cursor: pointer; list-style: none; padding: 1.05rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.p-fold-head::-webkit-details-marker { display: none; }
.p-fold-head::after {
  content: "+"; flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  border: 1px solid var(--line); color: var(--red-hot);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 400; transition: transform .2s ease;
}
.p-fold[open] > .p-fold-head::after { transform: rotate(45deg); }
.p-fold-titles { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.p-fold-head .p-kicker { margin: 0; }
.p-fold-title { margin: 0; }
.p-fold-body { padding: .25rem 1.25rem 1.35rem; }
.p-fold-body > :first-child { margin-top: 0; }

/* ---------- cta ---------- */
.p-cta {
  border-radius: 20px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #f10600 0%, #a30400 60%, #5c0200 100%);
  padding: clamp(2rem, 7vw, 3.5rem) clamp(1.5rem, 5vw, 3rem);
  box-shadow: 0 30px 70px -30px rgba(225, 6, 0, .55);
}
.p-cta::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("/assets/img/pilot/hero-texture.webp") center / cover no-repeat;
  opacity: .25; mix-blend-mode: overlay;
}
.p-cta > * { position: relative; z-index: 1; }
.p-cta .p-kicker::before { background: rgba(255, 255, 255, .85); }
.p-cta .p-h2 { color: #fff; }
.p-cta p { color: rgba(255, 255, 255, .85); max-width: 56ch; }
.p-cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }
.p-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #fff; color: #111; font-weight: 700; font-size: .95rem;
  padding: .8rem 1.6rem; border-radius: 999px; text-decoration: none; border: 0; cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}
.p-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .6); }
.p-btn-ghost {
  background: transparent; color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .55);
}
.p-btn-ghost:hover { border-color: #fff; box-shadow: none; }

/* ---------- sources ---------- */
.p-sources { color: var(--dim); font-size: .86rem; max-width: 72ch; }

/* ---------- footer ---------- */
.p-footer { border-top: 1px solid var(--line-soft); background: #05070a; margin-top: 1rem; }
.p-footer-grid { display: grid; gap: 2rem; padding-block: 3rem 2rem; }
.p-footer-brand p { color: var(--dim); font-size: .9rem; max-width: 40ch; margin: .6rem 0 0; }
.p-footer-col p { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 0 0 .8rem; }
.p-footer-col a { display: block; color: var(--mut); text-decoration: none; font-size: .9rem; padding: .28rem 0; }
.p-footer-col a:hover { color: var(--ink); }
.p-footer-bottom { border-top: 1px solid var(--line-soft); padding-block: 1.25rem; }
.p-footer-bottom p { color: var(--dim); font-size: .78rem; margin: .3rem 0; }
@media (min-width: 760px) {
  .p-footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* ---------- pilot banner ---------- */
.p-pilot-flag {
  background: var(--amber); color: #1a1200;
  font-size: .78rem; font-weight: 700; text-align: center;
  padding: .45rem 1rem; letter-spacing: .02em;
}
.p-pilot-flag a { color: inherit; }
