/* ============================================================
   fuelbook-explained — same family as fuelbook:
   petrol teal + sand/shell, the E-to-F gauge motif.
   Light scheme default; dark via prefers-color-scheme.
   All animation is CSS-only; base styles ARE the final states,
   so no-JS and prefers-reduced-motion both get a legible page.
   ============================================================ */

:root {
  --bg:        #FAF5EC;  /* shell white */
  --ink:       #0B3C49;  /* deep petrol teal */
  --muted:     #3F5B66;
  --card:      #EFE3CE;  /* shell */
  --card2:     #F5EDDD;
  --line:      #D9CBAA;
  --primary:   #0F4C5C;  /* teal */
  --primary-ink: #FAF5EC;
  --needle:    #B0742B;  /* sand, darkened for AA strokes on light */
  --sand:      #D9A05B;
  --accent-text: #8A5716;
  --danger:    #9B2C1B;
  --focus:     #0F4C5C;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1000px;
  --shadow: 0 14px 34px -22px rgba(11, 60, 73, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #062E38;  /* deep sea */
    --ink:       #F2E9D8;  /* shell */
    --muted:     #A9C4C7;
    --card:      #10505F;  /* teal tint */
    --card2:     #0B4250;
    --line:      #1E667A;
    --primary:   #E0B26E;  /* sand */
    --primary-ink: #062E38;
    --needle:    #E0B26E;
    --sand:      #E0B26E;
    --accent-text: #E8C68F;
    --danger:    #F5A48F;
    --focus:     #E0B26E;
    --shadow: 0 14px 34px -22px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0 0 0.55rem; font-weight: 780; letter-spacing: -0.02em; line-height: 1.12; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 2.8vw, 1.75rem); }
h3 { font-size: 1.06rem; }
p { margin: 0 0 0.65rem; }
em { font-style: normal; color: var(--accent-text); font-weight: 650; }
strong { font-weight: 720; }
code { font-family: var(--mono); font-size: 0.92em; }
pre {
  margin: 0.4rem 0 0.9rem;
  padding: 0.8rem 1rem;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}
a { color: var(--ink); text-decoration-color: var(--sand); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { color: var(--accent-text); }

.fig, .bar-val, .m-odo, .seg-val, .axis-label { font-variant-numeric: tabular-nums; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
main { padding-bottom: 3.5rem; }
section { margin: 3.4rem auto; }

/* ---------- focus / skip-link ---------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--primary); color: var(--primary-ink);
  padding: 10px 18px; border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700; z-index: 60;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 1.12rem; }
.brand-sub { color: var(--accent-text); font-weight: 650; }
.brand-dial { width: 44px; height: 31px; }
.dial-arc { stroke: var(--primary); stroke-width: 5; stroke-linecap: round; }
.dial-tick { stroke: var(--primary); stroke-width: 3; stroke-linecap: round; }
.dial-needle { stroke: var(--needle); stroke-width: 4.4; stroke-linecap: round; }
.dial-hub { fill: var(--needle); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.62rem 1.2rem;
  border-radius: 999px;
  border: 2px solid var(--primary);
  font-weight: 720;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
}
.btn:hover { background: var(--card); color: var(--ink); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary); color: var(--primary-ink); filter: brightness(1.08); }
.btn-small { padding: 0.4rem 0.95rem; font-size: 0.93rem; }
.btn-big { font-size: 1.15rem; padding: 0.8rem 1.9rem; }
.btn-ghost { border-color: var(--line); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.1rem; }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 2.4rem;
  align-items: center;
  padding-top: 3rem;
}
.kicker {
  font-size: 0.85rem; font-weight: 750; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: 0.7rem;
}
.lede { color: var(--muted); font-size: 1.07rem; max-width: 34em; }
.section-lede { color: var(--muted); max-width: 46em; margin-bottom: 1.4rem; }

.hero-dial svg { width: 100%; max-width: 380px; display: block; margin: 0 auto; }
.big-arc-bg { stroke: var(--card); stroke-width: 18; stroke-linecap: round; }
.big-arc { stroke: var(--primary); stroke-width: 7; stroke-linecap: round; }
.big-tick { stroke: var(--muted); stroke-width: 4; stroke-linecap: round; }
.big-tick.strong { stroke: var(--ink); stroke-width: 5; }
.dial-label { font-family: var(--sans); font-size: 24px; font-weight: 800; fill: var(--ink); text-anchor: middle; }
.dial-label.f { fill: var(--accent-text); }
.big-needle { stroke: var(--needle); stroke-width: 8; stroke-linecap: round; }
.big-hub { fill: var(--needle); }
.big-hub-dot { fill: var(--bg); }
.dial-caption { text-align: center; color: var(--muted); margin-top: 0.6rem; }

/* needle sweep E -> F (final state = as drawn, near F) */
.needle-g { transform-box: view-box; transform-origin: 160px 220px; }
@media (prefers-reduced-motion: no-preference) {
  .needle-g { animation: sweep 2.4s cubic-bezier(0.35, 0, 0.25, 1) 0.3s both; }
  @keyframes sweep {
    0%   { transform: rotate(-145.5deg); }
    78%  { transform: rotate(5deg); }
    89%  { transform: rotate(-2.5deg); }
    100% { transform: rotate(0deg); }
  }
}

/* ---------- section divider: short arc ticks (family motif) ---------- */
.arc-divider {
  width: 88px; height: 12px; margin-bottom: 1.3rem;
  background:
    radial-gradient(circle at 6px 6px, var(--sand) 0 4px, transparent 5px),
    radial-gradient(circle at 44px 6px, var(--primary) 0 4px, transparent 5px),
    radial-gradient(circle at 82px 6px, var(--sand) 0 4px, transparent 5px);
}
@media (prefers-color-scheme: light) {
  .arc-divider {
    background:
      radial-gradient(circle at 6px 6px, var(--needle) 0 4px, transparent 5px),
      radial-gradient(circle at 44px 6px, var(--primary) 0 4px, transparent 5px),
      radial-gradient(circle at 82px 6px, var(--needle) 0 4px, transparent 5px);
  }
}

/* ---------- cards ---------- */
.card-grid { display: grid; gap: 16px; }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }
.card-grid.four { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.card p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.card h3 { color: var(--ink); }
.card.mini { padding: 0.95rem 1.05rem; }
.card.mini p { font-size: 0.92rem; }

/* ---------- diagrams ---------- */
.diagram-card {
  margin: 0 0 1.4rem;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.2rem 0.9rem;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.diagram-card svg { width: 100%; min-width: 560px; display: block; }
.diagram-card figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 0.6rem; }

/* timeline */
.tl-axis { stroke: var(--line); stroke-width: 3; }
.m-full { fill: var(--primary); }
.m-partial { fill: none; stroke: var(--needle); stroke-width: 3.5; }
.m-letter { font-family: var(--sans); font-size: 15px; font-weight: 800; fill: var(--primary-ink); text-anchor: middle; }
.m-letter.partial { fill: var(--accent-text); }
.m-odo { font-family: var(--sans); font-size: 16px; font-weight: 750; fill: var(--ink); text-anchor: middle; }
.m-date { font-family: var(--sans); font-size: 13px; fill: var(--muted); text-anchor: middle; }
.seg-line { stroke: var(--needle); stroke-width: 4; stroke-linecap: round; }
.seg-label { font-family: var(--sans); font-size: 15px; font-weight: 600; fill: var(--ink); text-anchor: middle; }
.seg-val { font-weight: 800; fill: var(--accent-text); }
.tl-marker.excluded, .tl-seg.excluded { opacity: 0.55; }
.tl-seg.excluded .seg-label { text-anchor: end; font-size: 13px; fill: var(--muted); }

/* method points */
.method-points { display: grid; gap: 12px; margin-top: 1.2rem; }
.point { display: flex; gap: 14px; align-items: flex-start; }
.point p { margin: 0; color: var(--muted); }
.point-mark {
  flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary); color: var(--primary-ink);
  font-weight: 800; font-size: 1rem;
}

/* trend chart */
.grid { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 2 6; }
.axis-label { font-family: var(--sans); font-size: 13px; fill: var(--muted); text-anchor: end; }
.trend-line { stroke: var(--primary); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.pt { fill: var(--primary); stroke: var(--bg); stroke-width: 2; }
.pt.dip { fill: var(--needle); }
.pt-pulse { fill: none; stroke: var(--needle); stroke-width: 2.5; opacity: 0; }
.avg-line { stroke: var(--needle); stroke-width: 2.5; stroke-dasharray: 8 7; }
.avg-label { font-family: var(--sans); font-size: 13.5px; font-weight: 700; fill: var(--accent-text); text-anchor: end; }
.dip-label { font-family: var(--sans); font-size: 14px; font-weight: 700; fill: var(--accent-text); text-anchor: end; }

/* cost bars */
.cost-card { padding: 1.3rem 1.4rem 1.1rem; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 110px; align-items: center; gap: 14px; margin-top: 0.4rem; }
.bar-name { font-weight: 750; }
.bar-track { background: var(--card); border: 1px solid var(--line); border-radius: 999px; height: 26px; overflow: hidden; }
.bar { height: 100%; width: var(--w); border-radius: 999px; }
.bar.fuel { background: var(--primary); }
.bar.allin { background: linear-gradient(90deg, var(--primary) 0 62%, var(--needle) 62% 100%); }
.bar-val { font-weight: 800; text-align: right; }
.bar-math { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 0.9rem; padding-left: 104px; }
.cost-note { margin: 0.9rem 0 0; color: var(--ink); }

/* privacy */
.pv-app { fill: var(--card); stroke: var(--primary); stroke-width: 2.5; }
.pv-arc { stroke: var(--primary); stroke-width: 4; stroke-linecap: round; }
.pv-needle { stroke: var(--needle); stroke-width: 3.6; stroke-linecap: round; }
.pv-hub { fill: var(--needle); }
.pv-chip-label { font-family: var(--sans); font-size: 14px; font-weight: 700; fill: var(--ink); text-anchor: middle; }
.pv-wall { fill: var(--danger); }
.pv-wall-label { font-family: var(--mono); font-size: 14.5px; font-weight: 700; fill: var(--danger); text-anchor: middle; }
.pv-cloud { fill: none; stroke: var(--muted); stroke-width: 2.5; stroke-dasharray: 6 6; }
.pv-cloud-label { font-family: var(--sans); font-size: 13px; fill: var(--muted); text-anchor: middle; }
.pv-packet { fill: var(--needle); transform: translateX(232px); } /* final: at the wall */
.pv-x-line { stroke: var(--danger); stroke-width: 5; stroke-linecap: round; }
.csp-block { margin-top: 0.4rem; }
.csp-title { font-weight: 750; margin-bottom: 0.2rem; }
.privacy-list { margin: 0.4rem 0 0; padding-left: 1.2rem; display: grid; gap: 8px; color: var(--muted); }

/* limits */
.limits-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 10px; color: var(--muted); max-width: 48em; }
.limits-list strong { color: var(--ink); }

/* cta */
.cta-panel {
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.4rem 1.4rem 2rem;
}
.cta-dial { width: 76px; height: 53px; margin-bottom: 0.6rem; }
.cta-panel p { color: var(--muted); max-width: 34em; margin-left: auto; margin-right: auto; }
.cta-panel .btn-big { margin: 0.8rem 0 0.9rem; }
.cta-sub { font-size: 0.9rem; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 1.6rem 0 2.2rem; color: var(--muted); font-size: 0.9rem; }
.site-footer p { max-width: 60em; }

/* ============================================================
   Animation layer. Applies ONLY when motion is allowed AND JS
   has tagged <html class="js"> — otherwise everything above is
   already the final, legible state.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  /* scroll-revealed sections */
  html.js [data-animate] .stagger,
  html.js [data-animate] .pop,
  html.js [data-animate] .tl-seg,
  html.js [data-animate] .avg-line,
  html.js [data-animate] .avg-label,
  html.js [data-animate] .dip-label,
  html.js [data-animate] .pt {
    opacity: 0;
  }
  html.js [data-animate].in-view .stagger {
    opacity: 1;
    animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }
  html.js [data-animate].in-view .stagger:nth-child(1) { animation-delay: 0.05s; }
  html.js [data-animate].in-view .stagger:nth-child(2) { animation-delay: 0.18s; }
  html.js [data-animate].in-view .stagger:nth-child(3) { animation-delay: 0.31s; }
  html.js [data-animate].in-view .stagger:nth-child(4) { animation-delay: 0.44s; }
  html.js [data-animate].in-view .stagger:nth-child(5) { animation-delay: 0.57s; }
  html.js [data-animate].in-view .stagger:nth-child(6) { animation-delay: 0.70s; }
  html.js [data-animate].in-view .stagger:nth-child(7) { animation-delay: 0.83s; }
  html.js [data-animate].in-view .stagger:nth-child(8) { animation-delay: 0.96s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* timeline markers pop in, segments draw */
  html.js [data-animate].in-view .pop { animation: popin 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
  html.js [data-animate].in-view .tl-seg { animation: fadein 0.6s ease both; }
  html.js [data-animate].in-view .seg-line.grow {
    stroke-dasharray: 230;
    stroke-dashoffset: 230;
    animation: dashdraw 0.7s ease-out both;
  }
  html.js [data-animate].in-view .d1 { animation-delay: 0.1s; }
  html.js [data-animate].in-view .d2 { animation-delay: 0.45s; }
  html.js [data-animate].in-view .d3 { animation-delay: 0.8s; }
  html.js [data-animate].in-view .d4 { animation-delay: 1.15s; }
  html.js [data-animate].in-view .d5 { animation-delay: 1.5s; }
  html.js [data-animate].in-view .d6 { animation-delay: 1.7s; }
  html.js [data-animate].in-view .d6 .seg-line { animation-delay: 1.7s; }
  html.js [data-animate].in-view .d7 { animation-delay: 2.05s; }
  html.js [data-animate].in-view .d7 .seg-line { animation-delay: 2.05s; }
  html.js [data-animate].in-view .d8 { animation-delay: 2.4s; }
  @keyframes popin {
    from { opacity: 0; transform: scale(0.4); transform-box: fill-box; transform-origin: center; }
    to   { opacity: 1; transform: scale(1); transform-box: fill-box; transform-origin: center; }
  }
  @keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
  @keyframes dashdraw { to { stroke-dashoffset: 0; } }
  html.js [data-animate].in-view .tl-seg.excluded { animation-name: fadein-dim; }
  @keyframes fadein-dim { from { opacity: 0; } to { opacity: 0.55; } }
  html.js [data-animate].in-view .tl-marker.excluded { animation-name: popin-dim; }
  @keyframes popin-dim {
    from { opacity: 0; transform: scale(0.4); transform-box: fill-box; transform-origin: center; }
    to   { opacity: 0.55; transform: scale(1); transform-box: fill-box; transform-origin: center; }
  }

  /* trend line draws itself */
  html.js [data-animate] .trend-line.draw { stroke-dasharray: 700; stroke-dashoffset: 700; }
  html.js [data-animate].in-view .trend-line.draw { animation: dashdraw-line 1.9s ease-out 0.2s both; }
  @keyframes dashdraw-line { to { stroke-dashoffset: 0; } }
  html.js [data-animate].in-view .pt { animation: fadein 0.4s ease both; }
  html.js [data-animate].in-view .avg-line,
  html.js [data-animate].in-view .avg-label,
  html.js [data-animate].in-view .dip-label { animation: fadein 0.6s ease both; }
  html.js #trend.in-view .pt-pulse { animation: pulse 1.8s ease-out 2.4s 3; }
  @keyframes pulse {
    0%   { opacity: 0.9; r: 7; }
    70%  { opacity: 0; r: 22; }
    100% { opacity: 0; r: 22; }
  }

  /* cost bars grow */
  html.js [data-animate] .grow-x { transform: scaleX(0); transform-origin: left center; }
  html.js [data-animate].in-view .grow-x { animation: growx 1.1s cubic-bezier(0.2, 0.7, 0.3, 1) 0.15s both; }
  html.js [data-animate].in-view .grow-x.d2 { animation-delay: 0.5s; }
  @keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }

  /* privacy: packet flies, gets blocked; X flashes */
  html.js #privacy .pv-packet { transform: translateX(0); }
  html.js #privacy.in-view .pv-packet { animation: packet 3s cubic-bezier(0.5, 0, 0.9, 1) 0.4s infinite; }
  @keyframes packet {
    0%   { opacity: 0; transform: translateX(0); }
    8%   { opacity: 1; }
    55%  { opacity: 1; transform: translateX(232px); }
    62%  { opacity: 0; transform: translateX(232px); }
    100% { opacity: 0; transform: translateX(232px); }
  }
  html.js #privacy .pv-x { opacity: 1; }
  html.js #privacy.in-view .pv-x { opacity: 0; animation: xflash 3s ease 0.4s infinite; }
  @keyframes xflash {
    0%, 50% { opacity: 0; }
    58%, 92% { opacity: 1; }
    100% { opacity: 0; }
  }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 2rem; }
  .card-grid.three { grid-template-columns: 1fr; }
  .card-grid.four { grid-template-columns: repeat(2, 1fr); }
  .bar-row { grid-template-columns: 76px 1fr 96px; gap: 10px; }
  .bar-math { padding-left: 0; }
}
@media (max-width: 520px) {
  .card-grid.four { grid-template-columns: 1fr; }
  .btn-big { width: 100%; text-align: center; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .cta-row, .btn, .skip-link { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .card, .diagram-card, .cta-panel { box-shadow: none; border: 1px solid #999; background: #fff; }
  a { color: #000; text-decoration: none; }
}
