/* Le Brief DSI — « journal du matin » : papier chaud, encre profonde, accent lever de soleil. */
:root {
  --paper: #f3ede2;
  --paper-2: #ebe3d4;
  --ink: #1b1813;
  --ink-soft: #5c554a;
  --rule: #cfc4b1;
  --accent: #d9480f;
  --accent-soft: #f6d3bf;
  --card: #fbf8f2;
  --display: "Instrument Serif", "Times New Roman", serif;
  --body: "IBM Plex Sans", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 5vw, 56px);
  --measure: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14120f;
    --paper-2: #1c1915;
    --ink: #efe8dc;
    --ink-soft: #a89f90;
    --rule: #3a342c;
    --accent: #ff7a3d;
    --accent-soft: #3d2215;
    --card: #1b1814;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--paper);
  /* grain papier */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, audio { max-width: 100%; }

/* ---------- En-tête ---------- */
.masthead {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.brand-clock {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--paper);
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: .04em;
}
.brand-name { font-family: var(--display); font-size: 26px; line-height: 1; }
.nav { display: flex; gap: 22px; align-items: center; font-size: 14px; }
.nav a { text-decoration: none; color: var(--ink-soft); transition: color .2s; }
.nav a:hover { color: var(--ink); }
.nav-cta { color: var(--accent) !important; font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(48px, 9vw, 104px) var(--gutter) clamp(24px, 4vw, 40px);
  overflow: hidden;
}
.hero::before {
  /* grande horloge en filigrane */
  content: "07:00";
  position: absolute;
  right: calc(var(--gutter) * -0.5);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--display);
  font-size: clamp(140px, 30vw, 380px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--rule);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.kicker {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}
.kicker a { text-decoration: none; }
.hero-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 6.6vw, 80px);
  line-height: 1;
  letter-spacing: -.01em;
  margin: 0 0 28px;
}
.hero-title em { color: var(--accent); }
.hero-lede { font-size: clamp(17px, 2vw, 20px); color: var(--ink-soft); max-width: 56ch; margin: 0 0 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-block;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: transform .2s ease, background .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* barres « à l'antenne » */
.onair { display: flex; gap: 5px; align-items: flex-end; height: 34px; margin-top: 44px; }
.onair span {
  width: 5px;
  background: var(--accent);
  border-radius: 3px;
  animation: level 1.2s ease-in-out infinite;
}
.onair span:nth-child(1) { animation-delay: -.2s; }
.onair span:nth-child(2) { animation-delay: -.9s; }
.onair span:nth-child(3) { animation-delay: -.5s; }
.onair span:nth-child(4) { animation-delay: -1.1s; }
.onair span:nth-child(5) { animation-delay: -.3s; }
.onair span:nth-child(6) { animation-delay: -.7s; }
.onair span:nth-child(7) { animation-delay: -.1s; }
@keyframes level { 0%, 100% { height: 20%; } 50% { height: 100%; } }

/* ---------- Sections ---------- */
.section { max-width: var(--measure); margin: 0 auto; padding: clamp(32px, 4.5vw, 56px) var(--gutter); }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  border-top: 2px solid var(--ink);
  padding-top: 14px;
  margin-bottom: 36px;
}
.section-num { font-family: var(--mono); font-size: 13px; color: var(--accent); margin: 0; }
.section-head h2, .community h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  margin: 0;
}
.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 32px 0 14px;
}
.muted { color: var(--ink-soft); }

/* ---------- Brief du jour ---------- */
.brief-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: clamp(22px, 4vw, 44px);
  box-shadow: 0 1px 0 var(--rule), 0 24px 48px -32px rgba(0, 0, 0, .35);
}
.brief-date { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); margin: 0 0 8px; }
.brief-title, .episode-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 4.5vw, 48px);
  line-height: 1.08;
  margin: 0 0 24px;
}
.player { width: 100%; height: 44px; accent-color: var(--accent); }
.brief-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(24px, 4vw, 56px); }
.takeaways { margin: 0; padding: 0; list-style: none; counter-reset: k; }
.takeaways li {
  counter-increment: k;
  position: relative;
  padding: 0 0 16px 44px;
  font-size: 16px;
}
.takeaways li::before {
  content: counter(k, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: -6px;
  font-family: var(--display);
  font-size: 30px;
  color: var(--accent);
}
.topics { list-style: none; margin: 0; padding: 0; }
.topic {
  display: grid;
  grid-template-columns: 52px 1fr;
  column-gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--rule);
  text-decoration: none;
  transition: background .15s;
}
.topic:hover .topic-title { color: var(--accent); }
.topic-time { font-family: var(--mono); font-size: 13px; color: var(--accent); grid-row: span 2; padding-top: 2px; }
.topic-bloc { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.topic-title { font-size: 15.5px; line-height: 1.4; transition: color .15s; }
.more { display: inline-block; margin-top: 28px; font-weight: 600; color: var(--accent); text-decoration: none; }
.more:hover { text-decoration: underline; }

/* ---------- Principe ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-left: 1px solid var(--rule);
}
.step { padding: 4px 24px 8px; border-right: 1px solid var(--rule); }
.step-figure {
  display: block;
  font-family: var(--display);
  font-size: clamp(48px, 6vw, 72px);
  line-height: 1;
  color: var(--accent);
  margin-bottom: 12px;
}
.step-figure small { font-size: .4em; margin-left: 4px; }
.step h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.step p { font-size: 15px; color: var(--ink-soft); margin: 0; }

/* ---------- Archives ---------- */
.archive { list-style: none; margin: 0; padding: 0; }
.archive-item { border-bottom: 1px solid var(--rule); padding: 18px 0; }
.archive-link {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 18px;
  align-items: baseline;
  text-decoration: none;
}
.archive-date { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.archive-title { font-family: var(--display); font-size: 25px; line-height: 1.15; transition: color .15s; }
.archive-link:hover .archive-title { color: var(--accent); }
.archive-duration { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.themes { list-style: none; margin: 10px 0 0 238px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.themes li {
  font-size: 13px;
  padding: 3px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--paper-2);
}

/* ---------- Communauté ---------- */
.community-inner {
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  padding: clamp(32px, 6vw, 72px);
  position: relative;
  overflow: hidden;
}
.community-inner::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: .55;
}
.community-inner > * { position: relative; z-index: 1; }
.community h2 { max-width: 18ch; margin-bottom: 18px; }
.community p:not(.kicker) { max-width: 58ch; color: color-mix(in srgb, var(--paper) 78%, transparent); margin: 0 0 28px; }

/* ---------- Page épisode ---------- */
.episode .player { margin-bottom: 8px; }
.source-block { padding: 18px 0; border-bottom: 1px dashed var(--rule); }
.source-block h3 { font-size: 18px; font-weight: 600; margin: 0 0 6px; display: flex; gap: 12px; align-items: baseline; }
.source-block p { margin: 0 0 8px; color: var(--ink-soft); }
.sources { margin: 0; padding-left: 18px; font-size: 14.5px; }
.sources a { text-decoration: none; }
.sources a:hover { color: var(--accent); }
.verify-note { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); margin: 28px 0; }

/* ---------- Pied de page ---------- */
.footer { border-top: 1px solid var(--rule); margin-top: 24px; }
.footer-inner { max-width: var(--measure); margin: 0 auto; padding: 32px var(--gutter) 48px; display: grid; gap: 10px; }
.footer-brand { font-family: var(--display); font-size: 22px; margin: 0; display: flex; gap: 10px; align-items: baseline; }
.footer-note { font-size: 14px; color: var(--ink-soft); max-width: 70ch; margin: 0; }
.footer-links { display: flex; gap: 20px; font-size: 14px; margin: 6px 0 0; }
.footer-links a { color: var(--accent); text-decoration: none; }

/* ---------- Apparition au chargement ---------- */
.reveal { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.reveal:nth-of-type(2) { animation-delay: .12s; }
.reveal:nth-of-type(3) { animation-delay: .24s; }
.reveal:nth-of-type(4) { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal, .onair span { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .brief-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; border-left: 0; }
  .step { border-right: 0; border-top: 1px solid var(--rule); padding: 20px 0; }
  .step:nth-child(odd) { padding-right: 16px; }
  .archive-link { grid-template-columns: 1fr auto; }
  .archive-date { grid-column: 1 / -1; }
  .themes { margin-left: 0; }
}
@media (max-width: 560px) {
  .hero-title br { display: none; }
  .nav a:not(.nav-cta) { display: none; }
  .steps { grid-template-columns: 1fr; }
  .step:nth-child(odd) { padding-right: 0; }
}

/* ---------- Avis ---------- */
.review { margin-top: 44px; padding-top: 8px; border-top: 1px solid var(--rule); }
.review-form { display: grid; gap: 18px; max-width: 560px; }
.field-label { margin: 0 0 6px; font-size: 14px; color: var(--ink-soft); }
.stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 38px; line-height: 1; cursor: pointer; color: var(--rule); transition: color .15s; padding: 0 2px; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--accent); }
.stars input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--ink-soft); }
.field textarea, .field input, .field select {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px;
}
.field textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button.btn { border: 0; cursor: pointer; font-family: inherit; }
button.btn:disabled { opacity: .6; cursor: wait; }
.review-status { margin: 0; font-size: 14px; color: var(--ink-soft); min-height: 1.4em; }
.review-thanks { font-family: var(--display); font-size: 30px; margin: 0; }

/* ---------- Monitoring ---------- */
.lede { max-width: 62ch; }
.month-picker { max-width: 220px; margin: 24px 0 8px; }
.month { margin-top: 24px; }
.month[hidden] { display: none; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 14px 0 36px; }
.stat { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; }
.stat-value { font-family: var(--display); font-size: 38px; line-height: 1; margin: 0; }
.stat-label { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 8px 0 0; }
.chart { width: 100%; height: auto; display: block; margin: 8px 0 36px; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .axis { fill: var(--ink-soft); font-family: var(--mono); font-size: 11px; }
.chart .bar { fill: var(--accent); }
.chart .bar-value { fill: var(--ink); font-family: var(--mono); font-size: 11px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data-table th { font-family: var(--mono); font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.data-table .num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.breakdown { margin: 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); }


/* ---------- Architecture ---------- */
.diagram-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); padding: 12px; margin: 8px 0 40px; }
.diagram { display: block; width: 100%; min-width: 760px; height: auto; }
.dg-node rect { fill: var(--paper); stroke: var(--ink-soft); stroke-width: 1.2; }
.dg-title-t { fill: var(--ink); font-family: var(--display); font-size: 21px; }
.dg-sub { fill: var(--ink-soft); font-family: var(--mono); font-size: 11.5px; }
.dg-edge { fill: none; stroke: var(--ink-soft); stroke-width: 1.5; }
.dg-edge.loop { stroke: var(--accent); stroke-dasharray: 5 4; }
.dg-head { fill: var(--ink-soft); }
.dg-edge-t { fill: var(--accent); font-family: var(--mono); font-size: 11px; }
.pipeline { list-style: none; margin: 18px 0 40px; padding: 0; }
.pipe-step { display: grid; grid-template-columns: 56px 1fr; gap: 8px; padding: 18px 0; border-bottom: 1px dashed var(--rule); }
.pipe-num { font-family: var(--mono); font-size: 13px; color: var(--accent); margin: 3px 0 0; }
.pipe-title { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.2; margin: 0 0 6px; }
.pipe-title code { font-family: var(--mono); font-size: 17px; color: var(--accent); }
.pipe-step p { margin: 0 0 8px; }
.pipe-io { font-size: 13.5px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.pipe-io span { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; min-width: 52px; }
.pipe-io code, .plain-list code, .data-table code { font-family: var(--mono); font-size: 12.5px; background: var(--accent-soft); padding: 1px 6px; border-radius: 4px; color: var(--ink); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 48px); margin-bottom: 36px; }
.plain-list { padding-left: 20px; margin: 0 0 36px; }
.plain-list li { margin-bottom: 10px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
