/* Car Calculator — Australia
   Role-based tokens; light/dark; Crown Money brand. */

/* Display face: Bricolage Grotesque (latin subset, self-hosted) — used for
   headings and hero numbers; body text stays on the system sans. */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/bricolage-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../assets/fonts/bricolage-800.woff2') format('woff2');
}

/* Crown Money brand: #250B40 (crown purple) · #E6DEEE (lavender) · white.
   Neutrals are tinted toward the brand purple; chart series stay on the
   validated categorical palette. */
:root {
  --crown: #250b40;
  --lavender: #e6deee;

  --page: #faf9fc;
  --surface-1: #ffffff;
  --text-primary: #1d1526;
  --text-secondary: #554a63;
  --text-muted: #8c8496;
  --grid: #eae5f0;
  --baseline: #cfc7da;
  --border: rgba(37, 11, 64, 0.12);
  --good-text: #006300;

  /* Method series colors — categorical slots 1-3, fixed order */
  --series-outright: #2a78d6; /* blue */
  --series-loan: #1baf7a;     /* aqua */
  --series-lease: #eda100;    /* yellow */

  --accent: #5d3a8e;      /* readable brand-purple tint for links/focus */
  --btn-bg: #250b40;      /* selected controls */
  --btn-ink: #ffffff;
  --radius: 13px;
  --shadow: 0 1px 2px rgba(37, 11, 64, 0.05), 0 4px 14px rgba(37, 11, 64, 0.05);
  --shadow-lift: 0 2px 4px rgba(37, 11, 64, 0.07), 0 12px 28px rgba(37, 11, 64, 0.11);
  --glass: rgba(250, 249, 252, 0.82);
  --focus-ring: rgba(93, 58, 142, 0.25);
  --font-display: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --show-dark-logo: inline;
  --show-light-logo: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #120b1c;
    --surface-1: #1d1329;
    --text-primary: #ffffff;
    --text-secondary: #cfc5dc;
    --text-muted: #948aa3;
    --grid: #2e2440;
    --baseline: #413456;
    --border: rgba(255, 255, 255, 0.1);
    --good-text: #0ca30c;

    --series-outright: #3987e5;
    --series-loan: #199e70;
    --series-lease: #c98500;

    --accent: #cbb3ec;
    --btn-bg: #e6deee;
    --btn-ink: #250b40;
    --shadow: none;
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 12px 28px rgba(0, 0, 0, 0.45);
    --glass: rgba(18, 11, 28, 0.8);
    --focus-ring: rgba(203, 179, 236, 0.3);
    --show-dark-logo: none;
    --show-light-logo: inline;
  }
}

/* Explicit theme override (e.g. a host page's toggle stamping data-theme)
   must win over the OS preference in both directions. */
:root[data-theme="dark"] {
  --page: #120b1c;
  --surface-1: #1d1329;
  --text-primary: #ffffff;
  --text-secondary: #cfc5dc;
  --text-muted: #948aa3;
  --grid: #2e2440;
  --baseline: #413456;
  --border: rgba(255, 255, 255, 0.1);
  --good-text: #0ca30c;
  --series-outright: #3987e5;
  --series-loan: #199e70;
  --series-lease: #c98500;
  --accent: #cbb3ec;
  --btn-bg: #e6deee;
  --btn-ink: #250b40;
  --shadow: none;
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.4), 0 12px 28px rgba(0, 0, 0, 0.45);
  --glass: rgba(18, 11, 28, 0.8);
  --focus-ring: rgba(203, 179, 236, 0.3);
  --show-dark-logo: none;
  --show-light-logo: inline;
}

:root[data-theme="light"] {
  --page: #faf9fc;
  --surface-1: #ffffff;
  --text-primary: #1d1526;
  --text-secondary: #554a63;
  --text-muted: #8c8496;
  --grid: #eae5f0;
  --baseline: #cfc7da;
  --border: rgba(37, 11, 64, 0.12);
  --good-text: #006300;
  --series-outright: #2a78d6;
  --series-loan: #1baf7a;
  --series-lease: #eda100;
  --accent: #5d3a8e;
  --btn-bg: #250b40;
  --btn-ink: #ffffff;
  --shadow: 0 1px 2px rgba(37, 11, 64, 0.05), 0 4px 14px rgba(37, 11, 64, 0.05);
  --shadow-lift: 0 2px 4px rgba(37, 11, 64, 0.07), 0 12px 28px rgba(37, 11, 64, 0.11);
  --glass: rgba(250, 249, 252, 0.82);
  --focus-ring: rgba(93, 58, 142, 0.25);
  --show-dark-logo: inline;
  --show-light-logo: none;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.hero .wrap { padding-bottom: 0; }

/* -------------------------------------------------------------- hero --- */
/* The hero commits to Crown purple in both themes. */

.hero {
  --hero-ink: #ffffff;
  --hero-ink-2: #cfc0e2;
  --hero-accent: #e6deee;
  background:
    radial-gradient(1100px 420px at 82% -10%, rgba(230, 222, 238, 0.16), transparent 60%),
    linear-gradient(168deg, #2f1052 0%, #250b40 55%, #1c0832 100%);
  color: var(--hero-ink);
  padding: 44px 0 52px;
}

.hero-inner { display: flex; flex-direction: column; gap: 18px; }

.brand-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }

.brand {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.brand em { font-style: normal; color: var(--hero-accent); }
.brand .tld { font-weight: 500; color: var(--hero-ink-2); font-size: 14px; }

.presented {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--hero-ink-2);
  margin-left: auto;
}
.presented img { height: 30px; width: auto; display: block; }

@media (max-width: 700px) {
  .presented { margin-left: 0; width: 100%; }
}

.fy-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--surface-1);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.hero-badge {
  color: var(--hero-accent);
  border-color: rgba(230, 222, 238, 0.45);
  background: rgba(230, 222, 238, 0.08);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 4px 0 0;
  max-width: 21ch;
  text-wrap: balance;
}

.hero-sub {
  color: var(--hero-ink-2);
  font-size: 16.5px;
  line-height: 1.55;
  max-width: 62ch;
  margin: 0;
}
.hero-sub em { color: var(--hero-ink); font-style: italic; }

.hero-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 6px; }

.cta {
  display: inline-block;
  background: #ffffff;
  color: #250b40;
  font-weight: 700;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s;
}
.cta:hover {
  background: var(--hero-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
}
.cta:focus-visible { outline: 2px solid var(--hero-accent); outline-offset: 2px; }

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--hero-ink-2);
}
.hero-chips li::before { content: "✓ "; color: var(--hero-accent); font-weight: 700; }

/* ---------------------------------------------------------- tab bar --- */

.tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 6px;
  margin: 0 -20px;
  padding: 12px 20px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--grid);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s, transform 0.15s;
}
.tabs button:hover { color: var(--text-primary); transform: translateY(-1px); }
.tabs button[aria-selected="true"] {
  background: var(--btn-bg);
  color: var(--btn-ink);
  border-color: transparent;
}
.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tab-panel { margin-top: 22px; }
.tab-panel[hidden] { display: none; }

.layout-mini {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.layout-mini > * { min-width: 0; }
@media (max-width: 900px) { .layout-mini { grid-template-columns: 1fr; } }

/* Mini-tool results */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px 18px;
  margin-bottom: 14px;
}
.stat .stat-label { font-size: 12.5px; color: var(--text-muted); margin: 0 0 2px; }
.stat .stat-value { font-family: var(--font-display); font-size: 22px; font-weight: 800; margin: 0; }
.stat .stat-value small { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.stat.hero-stat .stat-value { font-size: 34px; }

table.mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.mini th, table.mini td { padding: 6px 10px; text-align: right; border-bottom: 1px solid var(--grid); }
table.mini th:first-child, table.mini td:first-child { text-align: left; color: var(--text-secondary); }
table.mini thead th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); border-bottom: 1px solid var(--baseline);
}
table.mini td { font-variant-numeric: tabular-nums; }
table.mini tr.hl td { font-weight: 700; color: var(--text-primary); }

.result-note { font-size: 13px; color: var(--text-secondary); margin: 12px 0 0; max-width: 66ch; }
.result-note a { color: var(--accent); }

/* -------------------------------------------------------------- lead --- */

.lead {
  margin-top: 40px;
  background:
    radial-gradient(700px 300px at 90% -20%, rgba(230, 222, 238, 0.14), transparent 60%),
    linear-gradient(160deg, #2f1052 0%, #250b40 60%, #1c0832 100%);
  border-radius: var(--radius);
  color: #fff;
  padding: 30px 28px;
}

.lead-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 20px 36px;
  align-items: center;
}
@media (max-width: 820px) { .lead-inner { grid-template-columns: 1fr; } }

.lead h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  text-wrap: balance;
}
.lead p { margin: 0; color: #cfc0e2; font-size: 14.5px; line-height: 1.55; }

.lead-fields {
  display: grid;
  grid-template-columns: 1fr 1.3fr auto;
  gap: 10px;
  align-items: end;
}
@media (max-width: 560px) { .lead-fields { grid-template-columns: 1fr; } }

.lead .field { margin: 0; }
.lead .field label { color: #cfc0e2; }
.lead .field input {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: #1d1526;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 8px;
}
.lead .field input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(230, 222, 238, 0.45);
}

#leadCompany { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.lead-submit {
  font: inherit;
  font-weight: 700;
  background: var(--lavender);
  color: #250b40;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s;
}
.lead-submit:hover { background: #fff; transform: translateY(-1px); }
.lead-submit:disabled { opacity: 0.6; cursor: default; transform: none; }
.lead-submit:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.lead-status { min-height: 20px; font-size: 13.5px; margin: 10px 0 0 !important; color: #fff !important; }
.lead-status.error { color: #ffb3ad !important; }
.lead-privacy { font-size: 12px !important; color: #a894c4 !important; margin-top: 8px !important; }

@media (prefers-reduced-motion: reduce) {
  .lead-submit, .lead-submit:hover { transition: none; transform: none; }
}

/* ------------------------------------------------------------ banner --- */

.ad-banner { margin-top: 40px; }
.ad-banner a { display: block; max-width: 780px; margin: 0 auto; }
.ad-banner img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ad-banner a:hover img { transform: translateY(-3px) scale(1.005); box-shadow: var(--shadow-lift); }

.wrap > .layout { margin-top: 28px; }

/* ------------------------------------------------------------ layout --- */

.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* Grid items default to min-width:auto, which lets wide content (the
   breakdown table) blow out the page on small screens. */
.layout > * { min-width: 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .seg button { padding: 10px 4px; }
  .hero { padding: 30px 0 38px; }
  .wrap > .layout { margin-top: 20px; }
  .panel { padding: 16px; }
  .explainer, .faq { margin-top: 40px; }
}

.panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.panel h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 14px;
}

/* ------------------------------------------------------------ inputs --- */

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.field .hint { font-weight: 400; color: var(--text-muted); }

.field input[type="number"],
.field input[type="text"],
.field select {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  color: var(--text-primary);
  background: var(--page);
  border: 1px solid var(--baseline);
  border-radius: 7px;
}

.field input, .field select { transition: border-color 0.15s, box-shadow 0.15s; }
.field input:focus-visible, .field select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.seg {
  display: flex;
  border: 1px solid var(--baseline);
  border-radius: 7px;
  overflow: hidden;
}
.seg button {
  flex: 1;
  padding: 7px 4px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: var(--page);
  color: var(--text-secondary);
  cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--baseline); }
.seg button[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-ink); }

.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-secondary); }
.check input { margin-top: 3px; accent-color: var(--accent); }

details.advanced { border-top: 1px solid var(--grid); margin-top: 18px; padding-top: 12px; }
details.advanced summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  list-style: none;
  display: flex; align-items: center; gap: 6px;
}
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary::before { content: "▸"; transition: transform 0.15s; color: var(--text-muted); }
details.advanced[open] summary::before { transform: rotate(90deg); }
details.advanced .fields { margin-top: 12px; }

.subhead {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); margin: 16px 0 8px;
}
.subhead:first-child { margin-top: 4px; }

/* ------------------------------------------------------------ verdict --- */

.verdict { margin-bottom: 20px; }

.verdict .lead-in { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 6px; }

.verdict .headline {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.verdict .headline .amount {
  font-size: 34px;
  background: linear-gradient(100deg, var(--accent), var(--text-primary) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.verdict .sub { color: var(--text-secondary); margin: 0; font-size: 14px; }

/* ------------------------------------------------------ method cards --- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

@media (max-width: 700px) {
  .cards { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  border-top: 3px solid var(--series, var(--baseline));
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card.best { box-shadow: 0 0 0 2px color-mix(in srgb, var(--good-text) 45%, transparent), var(--shadow); }
.card.best:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--good-text) 45%, transparent), var(--shadow-lift); }

.card[data-method="outright"] { --series: var(--series-outright); }
.card[data-method="loan"] { --series: var(--series-loan); }
.card[data-method="lease"] { --series: var(--series-lease); }

.card .name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; margin: 0 0 2px; }

.card .cheapest-chip {
  font-size: 11px; font-weight: 700;
  color: var(--good-text);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 1px 8px;
}

.card .net { font-family: var(--font-display); font-size: 28px; font-weight: 800; margin: 6px 0 0; }
.card .net-label { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; }

.card dl { margin: 0; font-size: 13px; }
.card dl div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.card dt { color: var(--text-secondary); }
.card dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* ------------------------------------------------------------- chart --- */

figure.chart { margin: 0 0 20px; }

figure.chart figcaption { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 2px; }
figure.chart .figsub { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }

.chart svg { display: block; width: 100%; height: auto; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }

.viz-tooltip {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  background: var(--surface-1);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(11, 11, 11, 0.18);
  padding: 8px 10px;
  font-size: 12.5px;
  min-width: 150px;
  display: none;
}
.viz-tooltip .tt-title { font-weight: 700; margin-bottom: 4px; }
.viz-tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; padding: 1px 0; }
.viz-tooltip .tt-row .k { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.viz-tooltip .tt-row .swatch { width: 10px; height: 10px; border-radius: 3px; }
.viz-tooltip .tt-row .v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------- breakdown table --- */

.table-scroll { overflow-x: auto; }

table.breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 560px;
}

table.breakdown th, table.breakdown td { padding: 7px 10px; text-align: right; }
table.breakdown th:first-child, table.breakdown td:first-child { text-align: left; }

table.breakdown thead th {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); border-bottom: 1px solid var(--baseline);
}
table.breakdown thead th .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: baseline; }

table.breakdown tbody td { border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
table.breakdown tbody td:first-child { color: var(--text-secondary); }
table.breakdown td.credit { color: var(--good-text); }
table.breakdown td.na { color: var(--text-muted); }

/* Keep the item names readable while the value columns scroll on mobile */
table.breakdown thead th:first-child,
table.breakdown tbody td:first-child,
table.breakdown tfoot td:first-child {
  position: sticky;
  left: 0;
  background: var(--surface-1);
  z-index: 1;
}
table.breakdown tr.group-row td { position: static; }

table.breakdown tr.group-row td {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding-top: 14px;
  border-bottom: 1px solid var(--baseline);
}

table.breakdown tfoot td {
  font-weight: 700; border-top: 2px solid var(--baseline);
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- notes --- */

.notes { font-size: 13.5px; color: var(--text-secondary); }
.notes h3 { font-size: 14px; color: var(--text-primary); margin: 18px 0 6px; }
.notes ul { padding-left: 20px; margin: 6px 0; }
.notes li { margin: 4px 0; }
.notes a { color: var(--accent); }
.notes .sources li { overflow-wrap: anywhere; }

.callout {
  border-left: 3px solid var(--accent);
  background: var(--page);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin: 10px 0;
}

/* ------------------------------------------------- explainer & FAQ --- */

.section-h {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0 0 18px;
  text-wrap: balance;
}

.explainer { margin-top: 56px; }

.explain-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 700px) { .explain-cards { grid-template-columns: 1fr; } }

.explain-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-top: 3px solid var(--series, var(--baseline));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.explain-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.explain-card[data-method="outright"] { --series: var(--series-outright); }
.explain-card[data-method="loan"] { --series: var(--series-loan); }
.explain-card[data-method="lease"] { --series: var(--series-lease); }
.explain-card h3 { font-family: var(--font-display); margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.explain-card p { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.55; }

.faq { margin-top: 56px; max-width: 820px; }

.faq details {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  padding: 0 18px;
  transition: border-color 0.15s;
}
.faq details:hover { border-color: var(--accent); }
.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
  width: 18px;
  flex: none;
  text-align: center;
  transition: transform 0.15s;
}
.faq details[open] summary::before { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px 28px; color: var(--text-secondary); line-height: 1.6; max-width: 68ch; }
.faq details p strong { color: var(--text-primary); }

footer.site {
  margin-top: 56px;
  font-size: 12.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--grid);
  padding-top: 16px;
}
footer.site a { color: var(--accent); }

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 12px;
}
.footer-brand img { height: 34px; width: auto; }
.crown-logo-dark { display: var(--show-dark-logo); }
.crown-logo-light { display: var(--show-light-logo); }

html { scroll-behavior: smooth; }

/* Entrance motion — hero rises on load; sections fade up as they enter view.
   The .reveal class is added by JS, so no-JS users see everything instantly. */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.hero .brand-row { animation: rise-in 0.45s ease-out both; }
.hero h1 { animation: rise-in 0.5s ease-out 0.08s both; }
.hero .hero-sub { animation: rise-in 0.5s ease-out 0.16s both; }
.hero .hero-cta-row { animation: rise-in 0.5s ease-out 0.24s both; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Hero copy cross-fades when the selected calculator changes */
.hero-swap { animation: rise-in 0.4s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .faq summary::before, details.advanced summary::before { transition: none; }
  .hero .brand-row, .hero h1, .hero .hero-sub, .hero .hero-cta-row { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card, .explain-card, .cta, .tabs button, .ad-banner img { transition: none; }
  .card:hover, .explain-card:hover, .cta:hover, .tabs button:hover { transform: none; }
}

/* Last so it wins the cascade against the base field rules above:
   16px stops iOS Safari zooming the page when a field gets focus. */
@media (max-width: 700px) {
  .field input[type="number"],
  .field input[type="text"],
  .field select { font-size: 16px; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
