:root {
  --bg: #0d0f12;
  --bg-elev: #15181e;
  --bg-card: #1a1e26;
  --bg-card-hover: #20252f;
  --line: rgba(255, 255, 255, 0.07);
  --text: #eef1f6;
  --muted: #8b93a7;
  --faint: #5c6578;
  --up: #f07178;
  --down: #6cb6ff;
  --mark: #e11d48;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font: "IBM Plex Sans", "Segoe UI", sans-serif;
  --display: "Syne", "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-feature-settings: "ss01" 1, "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(76, 141, 255, 0.12), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(251, 138, 60, 0.1), transparent 50%),
    radial-gradient(800px 500px at 50% 100%, rgba(45, 212, 160, 0.08), transparent 45%),
    var(--bg);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.hero {
  display: grid;
  gap: 1.1rem;
  margin-bottom: 2rem;
  animation: rise 700ms ease both;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mark {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--mark);
  color: white;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.04em;
  box-shadow: 0 0 0 6px rgba(225, 29, 72, 0.12);
}

.mark.sm {
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
  box-shadow: none;
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.section-nav a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.section-nav a:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.fuel-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.fuel-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.fuel-chip.is-active,
.fuel-chip[aria-pressed="true"] {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
}

.legend-item {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.15rem 0.4rem;
  margin: -0.15rem -0.4rem;
}

.legend-item.is-off {
  opacity: 0.38;
}

.legend-item:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.kpi.is-active {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), var(--shadow);
}

.france-outline {
  fill: rgba(255, 255, 255, 0.02);
  stroke: rgba(180, 190, 210, 0.22);
  stroke-width: 0.8;
  pointer-events: none;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.kpi {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent), var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 0.85rem;
  box-shadow: var(--shadow);
  animation: rise 700ms ease both;
  transition: background 160ms ease, transform 160ms ease;
}

.kpi:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.kpi:nth-child(1) { animation-delay: 40ms; }
.kpi:nth-child(2) { animation-delay: 80ms; }
.kpi:nth-child(3) { animation-delay: 120ms; }
.kpi:nth-child(4) { animation-delay: 160ms; }
.kpi:nth-child(5) { animation-delay: 200ms; }
.kpi:nth-child(6) { animation-delay: 240ms; }

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
}

.kpi-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: 0 0 auto;
}

.kpi-stations {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.kpi-body {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0.75rem;
  align-items: end;
}

.kpi-price {
  font-family: var(--mono);
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-price span {
  display: block;
  margin-top: 0.35rem;
  color: var(--faint);
  font-size: 0.75rem;
  font-family: var(--font);
}

.spark {
  width: 100%;
  height: 36px;
  margin-top: 0.55rem;
}

.deltas {
  display: grid;
  gap: 0.28rem;
  font-size: 0.78rem;
}

.delta-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
}

.delta-row b {
  font-family: var(--mono);
  font-weight: 500;
}

.up { color: var(--up); }
.down { color: var(--down); }

.panel {
  background: rgba(21, 24, 30, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.35rem 1.35rem 1.2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  animation: rise 800ms ease both;
  animation-delay: 180ms;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 0.85rem;
}

h2,
h3 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.sub.tight {
  margin-top: 0;
  margin-bottom: 0.85rem;
}

.ghost-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-bottom: 0.75rem;
}

.legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  background: transparent;
  font: inherit;
}

.legend .legend-item strong {
  color: var(--text);
  font-weight: 500;
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-height: 280px;
}

.footnote {
  margin: 0.7rem 0 0;
  color: var(--faint);
  font-size: 0.8rem;
}

.footnote.center {
  text-align: center;
}

.table-wrap {
  margin-top: 1rem;
  overflow: auto;
  border-top: 1px solid var(--line);
  max-height: 280px;
}

.table-wrap.is-hidden {
  display: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data-table th,
.data-table td {
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--faint);
  font-weight: 500;
  position: sticky;
  top: 0;
  background: #15181e;
  z-index: 1;
}

.data-table td {
  color: #d5dae6;
  font-variant-numeric: tabular-nums;
}

.data-table.compact th,
.data-table.compact td {
  padding: 0.45rem 0.35rem;
  font-size: 0.82rem;
}

.fuel-cell,
.brand-cell,
.dept-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.split-block,
.two-col {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 1.5rem;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.rank-list li {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
}

.rank-list .n {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.rank-list .when {
  color: var(--muted);
  font-size: 0.85rem;
}

.rank-list .price {
  font-family: var(--mono);
  font-size: 0.9rem;
}

.map-block {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0 0.25rem;
}

#france-map {
  width: min(100%, 560px);
  height: auto;
  overflow: visible;
}

.map-bubble {
  fill-opacity: 0.42;
  stroke-opacity: 0.85;
  stroke-width: 1.25;
  transition: fill-opacity 140ms ease, stroke-width 140ms ease;
  cursor: crosshair;
}

.map-bubble:hover {
  fill-opacity: 0.78;
  stroke-width: 2;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.map-legend .dot,
.map-legend .ring {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 0.35rem;
  vertical-align: -1px;
}

.map-legend .dot.up { background: var(--up); }
.map-legend .dot.down { background: var(--down); }
.map-legend .ring {
  background: transparent;
  border: 1.5px solid #9aa3b5;
}

.tooltip {
  position: absolute;
  z-index: 5;
  min-width: 180px;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #0b0d11;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.82rem;
  pointer-events: none;
  transform: translate(-50%, -120%);
}

.tooltip strong {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--display);
  letter-spacing: -0.02em;
}

.bar {
  display: inline-block;
  height: 8px;
  border-radius: 999px;
  vertical-align: middle;
  min-width: 4px;
}

.bar.up { background: rgba(240, 113, 120, 0.85); }
.bar.down { background: rgba(108, 182, 255, 0.85); }

.extremes {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.extreme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.extreme-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.extreme-card .label {
  color: var(--faint);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.extreme-card .city {
  font-weight: 600;
  font-size: 1.05rem;
}

.extreme-card .meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

.extreme-card .price {
  font-family: var(--mono);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.site-foot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  color: var(--faint);
  font-size: 0.85rem;
}

.site-foot a {
  color: #c9d0e0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .kpi-grid,
  .split-block,
  .two-col,
  .extreme-grid {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 1.25rem, 1120px);
    padding-top: 1.5rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-body {
    grid-template-columns: 1fr;
  }

  .brand {
    font-size: 2.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .kpi, .panel { animation: none; }
  .kpi:hover { transform: none; }
}
