/* garageX home page. Builds on site.css (same tokens). The phone mock-up
   copies the app's Home screen: lib/core/theme/ and docs/SCREENS.md. The app
   is light only, so the phone stays light in dark mode too. */
:root {
  --ink: #111114;
  --on-ink: #FFFFFF;
  --ink-2: #A6A6B0;
  --success: #1B7340;
  --success-soft: #DDF1E5;
  --track: #E7E7EB;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #18181D;
    --on-ink: #F2F2F4;
    --success: #57C98B;
    --success-soft: #123222;
    --track: #222229;
  }
}

.home .wrap { max-width: 1120px; }
/* The hero's gauge is wider than small screens; clip it without a sideways scroll. */
.home main { padding: 0; overflow-x: clip; }
.home h2 {
  font-size: clamp(28px, 4.2vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 16px;
  max-width: 20ch;
}
.home h3 { font-size: 18px; margin: 0 0 6px; }
.home section { padding-top: clamp(64px, 10vw, 112px); }
.num { font-family: "Manrope", "Poppins", system-ui, sans-serif; font-variant-numeric: tabular-nums; font-weight: 600; }
.ico { width: 20px; height: 20px; flex: none; }
.ico-sm { width: 14px; height: 14px; }

/* Header: the home page's header floats over the hero without a rule. */
.home header.site { border-bottom: 0; }

/* Buttons: the app's black pill. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  font-weight: 600; font-size: 16px; text-decoration: none;
  transition: transform .2s var(--ease-out), background-color .2s;
}
.btn-primary { background: var(--text); color: var(--surface); }
.btn-primary:hover { background: #2A2A31; }
.btn-primary:active { transform: scale(.97); }
.btn-quiet { color: var(--text); background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.btn-quiet:hover { background: var(--card); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-color-scheme: dark) {
  .btn-primary:hover { background: #D6D6DC; }
}

/* Hero ------------------------------------------------------------------ */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  padding-top: clamp(32px, 6vw, 72px) !important;
}
.hero h1 {
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0 0 24px;
  max-width: 11ch;
}
.hero-lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--text-2); max-width: 34em; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.hero-note { font-size: 14px; color: var(--text-2); max-width: 30em; }

.stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 28px;
  isolation: isolate;
}
.gauge {
  position: absolute; z-index: -1;
  width: min(640px, 150%); aspect-ratio: 1;
  left: 50%; top: 44%;
  translate: -50% -50%;
  overflow: visible;
}
.gauge-ring { fill: none; stroke: var(--line); stroke-width: 26; stroke-linecap: round; }
.gauge-needle { transform-box: view-box; transform-origin: 256px 256px; rotate: var(--needle, 0deg); transition: rotate 1s var(--ease-out); }

/* The phone ------------------------------------------------------------ */
.phone {
  margin: 0;
  width: 300px;
  padding: 10px;
  border-radius: 48px;
  background: #0E0E11;
  box-shadow: 0 1px 0 1px #2A2A31 inset, 0 40px 80px -24px rgba(17, 17, 20, .35), 0 12px 24px -12px rgba(17, 17, 20, .25);
}
.screen {
  --s-surface: #F1F1F3; --s-card: #FFFFFF; --s-line: #DCDCE1; --s-high: #E7E7EB;
  --s-text: #111114; --s-text-2: #55555F; --s-subtle: #66666F; --s-amber: #E8A33D;
  --s-good: #1B7340; --s-good-soft: #DDF1E5; --s-bad: #B0322A; --s-bad-soft: #FBE1DE;
  position: relative;
  height: 640px;
  border-radius: 38px;
  background: var(--s-surface);
  color: var(--s-text);
  padding: 0 14px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
}
.screen .card { margin: 0; padding: 12px 14px; border: 0; border-radius: 18px; background: var(--s-card); }
.statusbar { display: flex; justify-content: space-between; align-items: center; height: 40px; padding: 4px 14px 0; font: 600 13px "Manrope", sans-serif; }
.status-dots { width: 46px; height: 11px; border-radius: 4px; background: linear-gradient(90deg, var(--s-text) 0 26px, transparent 26px 30px, var(--s-text) 30px); opacity: .85; }
.appbar { display: flex; justify-content: space-between; align-items: center; height: 44px; margin-bottom: 6px; }
.vehicle-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.card-label { display: block; font-size: 11px; font-weight: 500; color: var(--s-text-2); }
.hero-card { padding-bottom: 6px !important; }
.hero-number { display: flex; align-items: baseline; gap: 6px; margin: 2px 0 4px; }
.hero-number .num { font-size: 40px; line-height: 1; letter-spacing: -0.02em; }
.hero-number .unit { font-size: 14px; font-weight: 500; color: var(--s-text-2); }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--s-good-soft); color: var(--s-good); font: 600 11px "Manrope", sans-serif; }
.delta[data-trend="down"] { background: var(--s-bad-soft); color: var(--s-bad); }
.delta[data-trend="down"] .ico { scale: 1 -1; }
.spark { display: block; width: 100%; height: 40px; margin-top: 8px; overflow: visible; }
.spark-line { fill: none; stroke: var(--s-text); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-area { fill: rgba(17, 17, 20, .06); }
.spark-dot { fill: var(--s-amber); stroke: var(--s-card); stroke-width: 2; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 14px; }
.tile .num { display: block; font-size: 17px; margin-top: 2px; white-space: nowrap; }
.tile small { font: 500 11px "Poppins", sans-serif; color: var(--s-text-2); }

.recent-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.recent-links { display: flex; gap: 6px; }
.recent-links span { font-size: 11px; padding: 3px 10px; border-radius: 999px; background: var(--s-card); }
.screen .fill { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px; }
.date { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--s-high); font-size: 10px; line-height: 1; color: var(--s-text-2); }
.date b { font: 700 15px "Manrope", sans-serif; color: var(--s-text); }
.fill-main { flex: 1; display: grid; min-width: 0; }
.fill-main b { font: 700 14px "Manrope", sans-serif; }
.fill-main small { font-size: 11px; color: var(--s-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fill-eff { font: 600 13px "Manrope", sans-serif; }

.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 74px; padding: 0 34px 10px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--s-card); border-radius: 22px 22px 0 0;
  box-shadow: 0 -6px 20px rgba(17, 17, 20, .06);
}
.tab { display: grid; justify-items: center; gap: 2px; font-size: 10px; color: var(--s-subtle); }
.tab-on { color: var(--s-text); font-weight: 600; }
.fab { display: grid; place-items: center; width: 52px; height: 52px; margin-top: -34px; border-radius: 50%; background: var(--s-text); color: #fff; box-shadow: 0 0 0 6px var(--s-surface); }

/* Steps: a real sequence, so it is numbered. -------------------------- */
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; counter-reset: step; }
.steps li { position: relative; margin: 0; padding-top: 64px; }
.steps li::before { content: ""; position: absolute; top: 20px; left: 52px; right: -20px; height: 1px; background: var(--line); }
.steps li:last-child::before { display: none; }
.step-n {
  position: absolute; top: 0; left: 0;
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
  font: 700 16px "Manrope", sans-serif;
}
.steps li:last-child .step-n { background: var(--text); color: var(--surface); box-shadow: none; }
.steps p { color: var(--text-2); margin: 0; max-width: 32ch; }

/* Stats ---------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.stats-copy > p { color: var(--text-2); max-width: 34em; }
.ticks { list-style: none; padding: 0; margin: 20px 0 0; }
.ticks li { position: relative; padding-left: 26px; margin-bottom: 10px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.chart-card { margin: 0; padding: 24px; border-radius: 24px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.chart-head .card-label { color: var(--text-2); font-size: 14px; }
.chart-total { font-size: 14px; color: var(--text-2); }
.chart-total .num { font-size: 22px; color: var(--text); margin-right: 4px; }
.bars { display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; gap: 12px; height: 220px; padding-bottom: 26px; }
.bars span {
  position: relative; height: calc(var(--h) * 100%);
  border-radius: 10px 10px 4px 4px; background: var(--track);
  transform-origin: bottom; transition: scale .9s var(--ease-out);
}
.bars span:nth-child(2) { transition-delay: .06s; }
.bars span:nth-child(3) { transition-delay: .12s; }
.bars span:nth-child(4) { transition-delay: .18s; }
.bars span:nth-child(5) { transition-delay: .24s; }
.bars span:nth-child(6) { transition-delay: .30s; }
.bars .bar-now { background: var(--accent); }
.bars i { position: absolute; left: 0; right: 0; bottom: -24px; text-align: center; font-style: normal; font-size: 12px; color: var(--text-2); }
.js .chart-card:not(.seen) .bars span { scale: 1 0; }

/* Vehicles and units ---------------------------------------------------- */
.types { list-style: none; padding: 0; margin: 32px 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.types li {
  margin: 0; display: grid; justify-items: center; gap: 10px; padding: 20px 8px;
  border-radius: 20px; background: var(--card); text-align: center; font-size: 14px; font-weight: 500;
}
.types .ico { width: 32px; height: 32px; }
.unit-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0; }
.unit-list div { padding: 18px 20px; border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line); }
.unit-list dt { font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.unit-list dd { margin: 0; font-weight: 600; }
.fuels { color: var(--text-2); margin-top: 16px; }

/* Privacy: the one dark band. ----------------------------------------- */
.private { padding-left: 16px !important; padding-right: 16px !important; }
.private-inner {
  padding: clamp(40px, 7vw, 72px) clamp(24px, 6vw, 72px) !important;
  border-radius: 32px; background: var(--ink); color: var(--on-ink);
}
.private h2 { color: var(--on-ink); }
.private-icon { width: 36px; height: 36px; color: var(--accent); margin-bottom: 20px; }
.promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin: 32px 0; }
.promises dt { font-weight: 600; margin-bottom: 6px; }
.promises dd { margin: 0; color: var(--ink-2); }
.text-link { display: inline-flex; align-items: center; min-height: 48px; color: var(--accent); font-weight: 600; }

/* Plans ---------------------------------------------------------------- */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.plan { margin: 0; padding: 28px; border-radius: 24px; border: 0; }
.plan h3 { font-size: 22px; }
.plan-price { color: var(--text-2); margin-bottom: 0; }
.plan-premium { background: var(--accent-soft); }
.plan-premium .plan-price { color: var(--accent-text); }
.plan-plus { margin: 16px 0 0; font-weight: 600; }
.plan-plus + .ticks { margin-top: 10px; }
.plan-note { color: var(--text-2); font-size: 14px; margin-top: 16px; max-width: 46em; }

/* Questions: native disclosure, keyboard and screen reader ready. ----- */
.faq-list { margin-top: 24px; border-top: 1px solid var(--line); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 64px; padding: 12px 0; cursor: pointer; list-style: none;
  font-size: 17px; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px; margin-right: 6px;
  border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2);
  rotate: 45deg; translate: 0 -3px; transition: rotate .25s var(--ease-out), translate .25s var(--ease-out);
}
.faq details[open] summary::after { rotate: 225deg; translate: 0 3px; }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.faq details p { color: var(--text-2); margin: 0 0 20px; max-width: 64ch; }

/* Buy Me a Coffee (the button itself is in site.css). ---------------- */
.coffee-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: clamp(28px, 5vw, 40px); border-radius: 24px; box-shadow: inset 0 0 0 1px var(--line);
}
.coffee h2 { margin-bottom: 6px; }
.coffee p { color: var(--text-2); margin: 0; }

/* Closing -------------------------------------------------------------- */
.closing { display: grid; justify-items: center; text-align: center; padding-bottom: clamp(64px, 10vw, 112px) !important; }
.closing h2 { margin: 20px auto 28px; }
.closing img { width: 72px; height: 72px; }
.home footer.site .wrap { max-width: 1120px; }

/* Load sequence: the gauge draws, the needle sweeps in, the phone rises.
   home.js counts the numbers up and draws the sparkline alongside. */
@media (prefers-reduced-motion: no-preference) {
  .js .gauge-ring { stroke-dasharray: 1; animation: ring-draw 1.2s .1s var(--ease-out) both; }
  .js .gauge-needle { animation: needle-in 1.6s .25s var(--ease-out) both; }
  .js .phone { animation: phone-in 1s var(--ease-out) both; }
  .js .hero-copy > * { animation: copy-in .8s var(--ease-out) both; }
  .js .hero-copy > :nth-child(2) { animation-delay: .08s; }
  .js .hero-copy > :nth-child(3) { animation-delay: .16s; }
  .js .hero-copy > :nth-child(4) { animation-delay: .24s; }
}
@keyframes ring-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes needle-in {
  0% { rotate: -150deg; opacity: 0; }
  15% { opacity: 1; }
  70% { rotate: 6deg; }
  100% { rotate: var(--needle, 0deg); }
}
@keyframes phone-in { from { opacity: 0; translate: 0 40px; } to { opacity: 1; translate: 0 0; } }
@keyframes copy-in { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  .gauge-needle, .bars span, .btn, .faq summary::after { transition: none; }
  .js .chart-card:not(.seen) .bars span { scale: 1; }
}

/* Dark mode: the logo ring is dark ink. */
@media (prefers-color-scheme: dark) {
  .closing img { background: #F1F1F3; border-radius: 50%; }
}

/* Layout ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero, .stats { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 56px; }
  .hero h1 { max-width: 13ch; }
  .types { grid-template-columns: repeat(3, 1fr); }
  .unit-list { grid-template-columns: repeat(2, 1fr); }
  .promises { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 700px) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .steps li { padding: 0 0 0 60px; min-height: 40px; }
  .steps li::before { top: 48px; bottom: -20px; left: 20px; right: auto; width: 1px; height: auto; }
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .unit-list { grid-template-columns: minmax(0, 1fr); }
  .home nav.site a[href="#plans"] { display: none; }
}
@media (max-width: 380px) {
  .phone { width: 280px; }
  .screen { height: 610px; padding: 0 10px; }
  .types { grid-template-columns: repeat(2, 1fr); }
}

/* Extras: receipt scan, budget, backup. ------------------------------- */
.extras-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 32px 0 0; }
.extras-list .card { margin: 0; padding: 24px; border-radius: 24px; }
.extras-list dt { font-weight: 600; font-size: 18px; margin-bottom: 6px; }
.extras-list dd { margin: 0; color: var(--text-2); }
@media (max-width: 900px) {
  .extras-list { grid-template-columns: minmax(0, 1fr); }
}

/* 2.0: five-slot tab bar (Home, History, +, Service, Reminders); free plan card. */
.tabbar-5 { padding: 0 12px 10px; }
.tabbar-5 .tab { min-width: 44px; }
.extras-list dt .ico { width: 20px; height: 20px; vertical-align: -4px; color: var(--accent-text); margin-right: 4px; }
.plan-free { margin-top: 32px; max-width: 820px; }
.plan-free .ticks { columns: 2 260px; column-gap: 32px; margin: 0; }
.plan-free .ticks li { break-inside: avoid; }
