/* Litru public site. Tokens mirror docs/design-system/DESIGN-SYSTEM.md (light + dark). */
:root {
  --page: #EFE4CC; --surface: #FFFBF2; --sunken: #F6EEDC; --rim: #C9BFA3; --rim-shade: #A99E80;
  --ink: #241A12; --ink2: #6B6150; --enamel: #B3272D; --enamel-press: #8C1F22; --on-enamel: #FFF6E9;
  --enamel-text: #B3272D; --brass: #C99A2E; --bezel: #8F6B1E; --success-ink: #2F6B3A; --divider: #E3D6BA;
  --hdr1: #B3272D; --hdr2: #8C1F22; --hdr-ink: #F4E8D0;
  --stain: rgba(60, 38, 12, .10); --speck: rgba(60, 38, 12, .10); --shadow: rgba(60, 38, 12, .16);
  /* Pump display: fixed in both themes. */
  --flap-up: #39342C; --flap-lo: #27231E; --hinge: #0B0A08; --digit: #F7EBD3; --digit-go: #5BE08A;
  --digit-idle: #B4AEA4; --digit-ref: #F0B429; --window: #14120F; --engraving: #CFC4AE;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #141210; --surface: #221F1B; --sunken: #1A1815; --rim: #3E3830; --rim-shade: #0A0908;
    --ink: #F4E8D0; --ink2: #B3A994; --enamel: #B8302C; --enamel-text: #F07A6E; --brass: #D9AE4A;
    --bezel: #C99A2E; --success-ink: #6FE083; --divider: #332E28; --hdr1: #5C1518; --hdr2: #2C0D0F;
    --stain: rgba(0, 0, 0, .35); --speck: rgba(255, 240, 210, .035); --shadow: rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background-color: var(--page);
  font-family: "Open Sans", system-ui, sans-serif; font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Workshop floor: speckle plus two faint oil stains, never under text blocks' own plates. */
  background-image:
    radial-gradient(ellipse 380px 200px at 8% 62%, var(--stain), transparent 70%),
    radial-gradient(ellipse 300px 160px at 94% 30%, var(--stain), transparent 70%),
    radial-gradient(var(--speck) 1px, transparent 1.4px),
    radial-gradient(var(--speck) .8px, transparent 1.2px);
  background-size: auto, auto, 23px 19px, 31px 37px;
  background-position: 0 0, 0 0, 0 0, 11px 7px;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

a { color: var(--enamel-text); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Enamel sign header ---------- */
.sign {
  position: relative; background: linear-gradient(var(--hdr1), var(--hdr2)); color: var(--hdr-ink);
  border-radius: 0 0 22px 22px; box-shadow: 0 2px 0 rgba(0, 0, 0, .18);
}
.sign .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 24px; }
.sign .scratches { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .2; }
.wordmark { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.wordmark img { width: 40px; height: 40px; border-radius: 50%; }
.wordmark span { font-family: "Saira Stencil One", sans-serif; font-size: 30px; letter-spacing: 4px; line-height: 1; }
.rivets { position: absolute; left: 12px; right: 12px; bottom: 8px; display: flex; justify-content: space-between; pointer-events: none; }
.rivet { width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FBE6A8, #C99A2E 55%, #6E5214); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.drips { position: absolute; right: 18%; bottom: -13px; display: flex; gap: 6px; pointer-events: none; }
.drips span:first-child { height: 11px; } .drips span:last-child { height: 7px; }
.drips span { width: 5px; border-radius: 0 0 3px 3px; background: var(--hdr2); }

.lang { display: flex; gap: 2px; background: rgba(0, 0, 0, .22); border-radius: 9px; padding: 3px; position: relative; }
.lang button {
  font: inherit; font-size: 14px; font-weight: 600; min-width: 44px; min-height: 36px; border: 0; border-radius: 7px;
  background: transparent; color: var(--hdr-ink); cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--hdr-ink); color: var(--hdr2); }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; padding-block: 64px 56px; }
.hero h1 { font-size: clamp(34px, 5.2vw, 56px); line-height: 1.08; font-weight: 600; letter-spacing: -.01em; margin: 0 0 18px; max-width: 14ch; text-wrap: balance; }
.hero p.lead { font-size: 19px; color: var(--ink2); margin: 0 0 28px; max-width: 34ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 12px 22px;
  border-radius: 9px; font-size: 17px; font-weight: 600; text-decoration: none; line-height: 1.2;
}
.btn.primary { background: var(--enamel); color: var(--on-enamel); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25), 0 1px 0 rgba(0, 0, 0, .2); }
.btn.primary:active { background: var(--enamel-press); transform: translateY(1px); }
.btn.secondary { color: var(--ink); border: 2px solid var(--rim); background: var(--surface); }
.btn .soon { font-size: 13px; font-weight: 600; background: var(--brass); color: #241A12; border-radius: 5px; padding: 1px 7px; }
.btn[aria-disabled="true"] { cursor: default; }
.btn .store { width: 20px; height: 20px; fill: currentColor; flex: none; }
.cta-row .secondary { flex-basis: 100%; max-width: max-content; }

/* ---------- Pump display ---------- */
.pump {
  position: relative; background: var(--window); border: 3px solid var(--bezel); border-radius: 14px;
  padding: 22px 24px 18px; color: var(--engraving);
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .35), 0 10px 26px var(--shadow);
}
.pump .screw { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #E9CF86, #8F6B1E); }
.pump .screw.a { top: 8px; left: 8px; } .pump .screw.b { top: 8px; right: 8px; }
.pump .screw.c { bottom: 8px; left: 8px; } .pump .screw.d { bottom: 8px; right: 8px; }
.pump .plate { font-size: 14px; font-weight: 600; letter-spacing: .04em; color: var(--engraving); margin: 0 0 14px; }
.pump-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 16px; padding: 12px 0; }
.pump-row + .pump-row { border-top: 1px solid #2E2A24; }
.pump-row .fuel { font-size: 18px; font-weight: 600; color: var(--digit); }
.pump-row .where { grid-column: 1 / -1; font-size: 14px; color: var(--engraving); min-height: 1.4em; }
.pump .foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #9C9384; margin-top: 10px; }
.pump .foot .err { color: var(--digit-ref); }

.flaps { display: inline-flex; align-items: flex-end; gap: 3px; }
.flap {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden;
  width: 1.05em; height: 1.5em; border-radius: 4px; color: var(--digit); font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(var(--flap-up) 0 calc(50% - 1px), var(--hinge) calc(50% - 1px) calc(50% + 1px), var(--flap-lo) calc(50% + 1px));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 1px 1px rgba(0, 0, 0, .55);
}
.flap::before, .flap::after { content: ""; position: absolute; top: calc(50% - 2px); width: 2px; height: 4px; background: var(--hinge); border-radius: 1px; }
.flap::before { left: 0; } .flap::after { right: 0; }
/* Each digit is a counter wheel, like a pump's litre/amount register: a 0-9 reel that scrolls
   upward. While data loads the reels run (rightmost fastest), then each settles on its digit. */
.reel { position: absolute; left: 0; right: 0; top: 0; display: flex; flex-direction: column; align-items: center; will-change: transform; }
.reel i { font-style: normal; display: flex; align-items: center; justify-content: center; height: 1.5em; flex: none; }
.flap.run .reel { animation: wheel var(--spd, .6s) linear infinite; }
.flap.settle .reel { transition: transform var(--settle, .5s) cubic-bezier(.2, .9, .25, 1.15); }
/* Reel holds 0-9 twice, so one full revolution is exactly half its height. */
@keyframes wheel { from { transform: translateY(0); } to { transform: translateY(-15em); } }
.flap::before, .flap::after { z-index: 1; }
.flap .shine { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, .35), transparent 22%, transparent 78%, rgba(0, 0, 0, .35)); }
.dot { color: var(--digit); font-weight: 600; line-height: 1; padding-bottom: .18em; }
.flaps.xl { font-size: clamp(30px, 5.4vw, 44px); }
.flaps.md { font-size: 22px; }
.flaps.sm { font-size: 18px; }
.flap.lead .reel { visibility: hidden; }
.flaps.go .flap, .flaps.go .dot { color: var(--digit-go); }
.flaps.idle .flap, .flaps.idle .dot { color: var(--digit-idle); }
.lamp { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--hinge); background: radial-gradient(circle at 35% 35%, #8A8378, #4A453D 55%, #2A2622); transition: background .3s, box-shadow .3s; }
.lamp.go { background: radial-gradient(circle at 35% 35%, #D8FFE6, #5BE08A 45%, #1F7A43); box-shadow: 0 0 0 2px var(--hinge), 0 0 10px 2px rgba(91, 224, 138, .6); }
@media (prefers-reduced-motion: reduce) { .flap.run .reel { animation: none; } .flap.settle .reel { transition: none; } }

/* ---------- Sections ---------- */
section.band { padding: 56px 0; }
section.band h2 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; font-weight: 600; margin: 0 0 10px; max-width: 30ch; text-wrap: balance; }
section.band .intro { color: var(--ink2); margin: 0 0 28px; max-width: 60ch; }
.plate-card {
  position: relative; background: var(--surface); border: 2px solid var(--rim); border-radius: 12px;
  box-shadow: 0 1px 0 var(--rim-shade), 0 2px 3px var(--shadow);
}
.plate-card .rv { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FBE6A8, #C99A2E 55%, #6E5214); }
.rv.tl { top: 6px; left: 6px; } .rv.tr { top: 6px; right: 6px; } .rv.bl { bottom: 6px; left: 6px; } .rv.br { bottom: 6px; right: 6px; }

/* Detour calculator */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; overflow: hidden; }
.calc .inputs { padding: 28px; display: grid; gap: 22px; }
.calc .result { background: var(--window); color: var(--engraving); padding: 28px; display: flex; flex-direction: column; justify-content: center; gap: 14px; border-left: 3px solid var(--bezel); }
.field { display: grid; gap: 6px; }
.field .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field label { font-weight: 600; font-size: 16px; }
.field output { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.field .hint { font-size: 14px; color: var(--ink2); }
input[type="range"] { width: 100%; accent-color: var(--enamel); height: 32px; margin: 0; }
.result .verdict { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 600; color: var(--digit); }
.result .line { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; border-top: 1px solid #2E2A24; padding-top: 10px; }
.result .line span:last-child { font-variant-numeric: tabular-nums; color: var(--digit); }
.result .big { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* Cheapest today */
.tabs { display: inline-flex; background: var(--sunken); border: 2px solid var(--rim); border-radius: 11px; padding: 3px; gap: 2px; margin-bottom: 18px; }
.tabs button { font: inherit; font-size: 16px; min-height: 44px; padding: 6px 18px; border: 0; border-radius: 8px; background: transparent; color: var(--ink2); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--enamel); color: var(--on-enamel); font-weight: 600; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .22); }
.cheap { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.cheap li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; }
.cheap .logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--brass); display: flex; align-items: center; justify-content: center; overflow: hidden; font-weight: 600; color: #fff; }
.cheap .logo img { width: 36px; height: 36px; object-fit: contain; }
.cheap .logo.initial { background: #3B6E8F; }
.cheap .name { font-weight: 600; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.cheap .place { font-size: 14px; color: var(--ink2); }
.cheap .price { background: var(--window); border: 2px solid var(--bezel); border-radius: 8px; padding: 6px 8px; }
.cheap .skeleton { height: 76px; background: var(--sunken); border-color: var(--divider); }
.status-note { color: var(--ink2); font-size: 15px; margin-top: 14px; }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.facts .plate-card { padding: 24px; }
.facts h3 { font-size: 19px; margin: 0 0 6px; font-weight: 600; }
.facts p { margin: 0; color: var(--ink2); font-size: 16px; }
.medal { width: 48px; height: 48px; border-radius: 50%; background: var(--enamel); box-shadow: 0 0 0 2px var(--brass); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.medal svg { width: 24px; height: 24px; fill: none; stroke: #FFF6E9; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Footer */
footer { margin-top: 40px; padding: 28px 0 40px; border-top: 2px solid var(--rim); color: var(--ink2); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* Privacy page */
.doc { max-width: 720px; margin: 48px auto; padding: 32px 28px; }
.doc h1 { font-size: clamp(24px, 6.2vw, 32px); line-height: 1.2; margin: 0 0 4px; hyphens: auto; overflow-wrap: break-word; }
.doc h2 { font-size: 20px; margin: 28px 0 8px; }
.doc p, .doc li { color: var(--ink); }
.doc .updated { color: var(--ink2); margin: 0 0 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-block: 40px 36px; }
  .hero h1 { max-width: 18ch; }
  .calc { grid-template-columns: 1fr; }
  .calc .result { border-left: 0; border-top: 3px solid var(--bezel); }
  .facts { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .wordmark span { font-size: 24px; letter-spacing: 3px; }
  .wordmark img { width: 34px; height: 34px; }
  .lang button { min-width: 40px; font-size: 13px; }
  .hero p.lead { font-size: 17px; }
  .pump { padding: 18px 16px 14px; }
  .calc .inputs, .calc .result { padding: 20px; }
  section.band { padding: 40px 0; }
  .doc { margin: 24px 16px; padding: 24px 18px; }
}
