/* ─────────────────────────────────────────────────────────────────────────
   Oui, mais… ?  —  graphique-trompeur
   Styles séparés du HTML
   ───────────────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── VARIABLES ─── */
:root {
  --blue:       #509be1;  /* navy SVG */
  --blue-dark:   rgb(9, 0, 109);
  --red:        #ff9844;
  --text:       rgb(9, 0, 109);
  --text-dim:   rgb(9, 0, 109);
  --text-ghost: rgb(9, 0, 109);
  --panel:      rgb(188, 212, 255);
  --border:      rgb(9, 0, 109);
  --font:       'Brown LL', 'Brown Regular', 'BrownRegular', 'DM Sans', sans-serif;
  --font-head:  'Brown LL', 'Brown Regular', 'BrownRegular', 'Space Grotesk', sans-serif;
}

/* ─── BASE ─── */
html { font-size: 16px; }

body {
  font-family: var(--font);
  /* SVG palette gradient: pink → yellow → blue */
  background: linear-gradient(to bottom, #ff9844 20%,  #509be1 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── ENTRANCE ANIMATION ─── */
.page { animation: fadeUp .7s ease-out both; }

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

/* ─── HEADER ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 28px;
  background: rgba(236, 165, 201);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header-left  { display: flex; align-items: center; gap: 10px; }
.site-header-right { display: flex; align-items: center; }

.logo-mark {
  width: 28px;
  height: 18px;
  background: var(--blue);
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(30, 53, 128,3);
}

.site-name {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text);
}

.site-desc {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: .04em;
}

/* ─── PAGE ─── */
.page {
  display: flex;
  flex-direction: column;
}

/* ─── INTRO BAND ─── */
.intro-band {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  /*padding: 32px 36px;*/
  position: relative;
  overflow: hidden;
}

.intro-left { position: relative; z-index: 1; }

.intro-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}

.intro-band h1 {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.025em;
  color: var(--text);
}

.intro-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-left: 40px;
  padding-bottom: 2px;
  position: relative;
  z-index: 1;
}

.intro-body {
  font-size: 12px;
  line-height: 1.75;
  color: var(--text-dim);
  max-width: 520px;
}

/* ─── DESKTOP SIDEBAR LAYOUT ─── */
@media (min-width: 900px) {
  .page {
    flex-direction: row;
    align-items: stretch;
    min-height: 100vh;
  }

  .intro-band {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 300px;
    flex-shrink: 0;
    padding: 20px 32px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    border-bottom: none;
    background: var(--blue);
  }

  .intro-right {
    padding-left: 0;
    padding-top: 24px;
    justify-content: flex-start;
  }

  .intro-body { max-width: none; }

  .main { flex: 1; min-width: 0; }
}

.intro-meta {
  margin-top: 18px;
  font-size: 9.5px;
  color: #000000;
  letter-spacing: .07em;
  line-height: 1.9;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

/* ─── MAIN ─── */
.main { display: flex; flex-direction: column; }

/* ─── CHART HEADER ─── */
.chart-header {
  padding: 20px 36px 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  border-bottom: 1px solid var(--border);
}

.chart-category {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 7px;
}

.chart-title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1.25;
  color: var(--text);
}

.chart-title em {
  display: block;
  font-family: var(--font);
  font-style: italic;
  font-weight: 300;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--text-dim);
  margin-top: 6px;
}

.chart-source {
  font-size: 9.5px;
  color: rgba(26, 24, 48);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: right;
  line-height: 1.8;
  flex-shrink: 0;
}

/* ─── LEGEND ─── */
.legend-row {
  padding: 11px 36px;
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--border);
  background-color: var(--blue);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: opacity .4s;
}

.legend-swatch {
  width: 22px;
  height: 4px;
  border-radius: 20px;
  flex-shrink: 0;
}

.legend-item.dimmed { opacity: 100%; }

/* ─── CHART AREA ─── */
.chart-area {
  padding: 28px 36px 0;
  flex: 1;
  overflow: visible;
}

#plot-container { position: relative; overflow: visible; }
#plot-container svg { width: 100%; height: auto; display: block; overflow: visible; }

/* ─── HOVER CARD ─── */
#hover-card {
  position: absolute;
  display: none;
  flex-direction: row;
  width: 240px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.hc-char {
  width: 100px;
  flex-shrink: 0;
  background: #ffdf00;
  display: flex;
  align-items: stretch;
}

.hc-svg {
  width: 100%;
  display: flex;
  align-items: stretch;
}

.hc-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hc-data {
  flex: 1;
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hc-year {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--text);
}

.hc-rows { display: flex; flex-direction: column; gap: 3px; }

.hc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hc-label { color: rgba(0,0,0,0.4); }
.hc-val, .hc-delta { font-weight: 500; color: var(--text); }

.hc-bar-track {
  width: 100%;
  height: 3px;
  background: rgba(0,0,0,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.hc-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .2s;
}

.hc-status {
  font-size: 8px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.35);
  margin-top: auto;
}

.hc-status.post { color: var(--red); }

/* ─── SLIDER PANEL ─── */
.slider-panel {
  border-top: 1px solid var(--border);
  padding: 22px 36px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 28px;
  align-items: center;
}

.slider-instruction {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
  grid-column: 1 / -1;
}

.slider-track-wrap { display: flex; flex-direction: column; gap: 7px; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: rgba(26, 24, 48, .18);
  outline: none;
  cursor: pointer;
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px rgba(30, 53, 128, .35);
  cursor: pointer;
  transition: background .3s, box-shadow .3s;
}

input[type="range"].revealed::-webkit-slider-thumb {
  background: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

input[type="range"].revealed {
  background: linear-gradient(to right, rgba(0, 60, 255) 100%, rgba(255, 255, 255) 100%);
}

.ticks { display: flex; justify-content: space-between; }
.tick  { font-size: 9px; color: #000000; letter-spacing: .06em; }

.year-display {
  font-family: var(--font-head);
  font-size: 54px;
  font-weight: 300;
  letter-spacing: -.05em;
  line-height: 1;
  color: var(--text);
  text-align: right;
  align-self: end;
  transition: color .35s;
}

.year-display.revealed { color: #ffffff; }

/* ─── MESSAGE BAND ─── */
.message-band {
  margin: 16px 36px 0;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
  background: var(-);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background .4s, border-color .4s;
}

.message-band.warning {
  background: rgba(192, 32, 53, .08);
  border-color: rgba(192, 32, 53, .3);
  color: var(--text);
}

.msg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(26, 24, 48, .22);
  
  margin-top: 5px;
  transition: background .3s, box-shadow .3s;
}

.message-band.warning .msg-dot {
  background: var(--red);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.message-band strong            { font-weight: 500; color: var(--text); }
.message-band.warning strong    { color: #000000; }

/* ─── DATA TABLE ─── */
.data-section {
  margin: 20px 36px 36px;
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.data-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

table { width: 100%; border-collapse: collapse; font-size: 11px; letter-spacing: .04em; }
thead tr { border-bottom: 1px solid rgba(26, 24, 48, .12); }
tbody tr { border-bottom: 1px solid rgba(26, 24, 48, .06); }
tbody tr:last-child { border-bottom: none; }

th {
  font-weight: 500;
  text-align: left;
  padding: 5px 12px 8px 0;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: .14em;
  color: var(--text-dim);
}

td { padding: 6px 12px 6px 0; color: var(--text); }
td.val-cell  { font-variant-numeric: tabular-nums; }
td.post-2020 { color: #000000; }

.bar-inline {
  display: inline-block;
  height: 4px;
  vertical-align: middle;
  margin-left: 8px;
  border-radius: 2px;
  opacity: .7;
}

.intro-body a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  opacity: 0.7;
  transition: opacity .2s;
}
.intro-body a:hover { opacity: 1; }
