/* ============================================================
   OBI — Over-Behavioral Intoxication
   Feuille de styles
   Thème : interface médicale sombre / scanner neurologique /
           tableau de bord clinique des dépendances
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Barlow+Condensed:wght@300;400;600;700;900&family=Barlow:wght@300;400;500&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
  --bg-void:      #060810;
  --bg-panel:     #0c1018;
  --bg-card:      #101520;
  --bg-card-alt:  #0e1a1e;
  --border-dim:   rgba(0,212,232,.12);
  --border-med:   rgba(0,212,232,.28);
  --border-hot:   rgba(0,212,232,.55);
  --cyan:         #00d4e8;
  --cyan-dim:     rgba(0,212,232,.15);
  --red:          #ff2545;
  --red-dim:      rgba(255,37,69,.12);
  --amber:        #ffaa20;
  --amber-dim:    rgba(255,170,32,.10);
  --green:        #00e87a;
  --green-dim:    rgba(0,232,122,.10);
  --text-bright:  #e8f4f8;
  --text-body:    #a8bcc4;
  --text-muted:   #4a6070;
  --mono:         'Share Tech Mono', monospace;
  --sans-cond:    'Barlow Condensed', sans-serif;
  --sans:         'Barlow', sans-serif;
  --glow-cyan:    0 0 20px rgba(0,212,232,.35);
  --glow-red:     0 0 18px rgba(255,37,69,.4);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Corps ───────────────────────────────────────────────── */
body {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-body);
  background-color: var(--bg-void);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scanlines overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,.07) 2px,
    rgba(0,0,0,.07) 4px
  );
  pointer-events: none;
  z-index: 9990;
}

/* ── Canvas neurones (fond) ──────────────────────────────── */
#neuro-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
}

/* ── Barre de progression ────────────────────────────────── */
#read-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--cyan));
  z-index: 9999;
  width: 0;
  box-shadow: 0 0 8px var(--red);
  transition: width .08s linear;
}

/* ── Layout ──────────────────────────────────────────────── */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Header ──────────────────────────────────────────────── */
.obi-header {
  padding: 56px 0 44px;
  border-bottom: 1px solid var(--border-dim);
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
}

.obi-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 96px; height: 96px;
  border: 2px solid var(--red);
  border-radius: 4px;
  position: relative;
  box-shadow: var(--glow-red), inset 0 0 20px rgba(255,37,69,.08);
  flex-shrink: 0;
}
.obi-badge::before,
.obi-badge::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border: 2px solid var(--red);
}
.obi-badge::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.obi-badge::after  { bottom: -2px; right: -2px; border-left: none; border-top: none; }

.obi-badge-text {
  font-family: var(--mono);
  font-size: 2rem;
  color: var(--red);
  letter-spacing: .08em;
  line-height: 1;
  text-shadow: var(--glow-red);
  animation: pulse-red 2.8s ease-in-out infinite;
}
.obi-badge-sub {
  font-family: var(--mono);
  font-size: .5rem;
  color: rgba(255,37,69,.6);
  letter-spacing: .15em;
  margin-top: 4px;
}
@keyframes pulse-red {
  0%,100% { text-shadow: 0 0 10px rgba(255,37,69,.4); }
  50%      { text-shadow: 0 0 28px rgba(255,37,69,.9), 0 0 50px rgba(255,37,69,.3); }
}

.obi-title-group { min-width: 0; }

h1 {
  font-family: var(--sans-cond);
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-bright);
  line-height: 1.1;
  animation: fadeRight .8s ease both;
}
h1 em {
  color: var(--cyan);
  font-style: normal;
  text-shadow: var(--glow-cyan);
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  animation: fadeRight .8s .2s ease both;
}
.meta-chip {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--text-muted);
  border: 1px solid var(--border-dim);
  padding: 3px 10px;
  border-radius: 2px;
  text-transform: uppercase;
}
.meta-chip.alert { color: var(--amber); border-color: rgba(255,170,32,.3); }

/* Jauge dopamine */
.dopamine-gauge {
  margin-top: 22px;
  animation: fadeRight .8s .35s ease both;
}
.gauge-label {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.gauge-label span { color: var(--red); }
.gauge-track {
  height: 4px;
  background: rgba(255,255,255,.06);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.gauge-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--amber), var(--red));
  border-radius: 2px;
  box-shadow: 0 0 10px var(--red);
  transition: width 2.2s cubic-bezier(.22,1,.36,1);
}

@keyframes fadeRight {
  from { opacity:0; transform: translateX(-18px); }
  to   { opacity:1; transform: none; }
}

/* ── EEG décoratif ───────────────────────────────────────── */
.eeg-line {
  display: block;
  width: 100%;
  height: 28px;
  margin: 22px 0 0;
  opacity: .45;
}
.eeg-line path {
  stroke: var(--cyan);
  stroke-width: 1.2;
  fill: none;
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawEEG 3s ease forwards;
}
@keyframes drawEEG {
  to { stroke-dashoffset: 0; }
}

/* ── Sections ────────────────────────────────────────────── */
.section {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 3px;
  padding: 28px 32px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  transition: border-color .3s, box-shadow .3s;
  animation: none;
}
.section.visible {
  opacity: 1;
  transform: none;
  transition: opacity .55s ease, transform .55s ease, border-color .3s, box-shadow .3s;
}
.section:hover {
  border-color: var(--border-med);
  box-shadow: 0 0 30px rgba(0,212,232,.06);
}

/* Coin décor */
.section::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 40px;
  background: linear-gradient(to bottom, var(--cyan), transparent);
  opacity: 0;
  transition: opacity .3s;
}
.section:hover::before { opacity: 1; }

/* Numéro de section */
.section-num {
  position: absolute;
  top: 18px; right: 24px;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-muted);
  letter-spacing: .1em;
}

/* ── Titres h2 ───────────────────────────────────────────── */
h2 {
  font-family: var(--sans-cond);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-bright);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-dim);
}
h2 .h2-index {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(0,212,232,.3);
  padding: 2px 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── h3 ──────────────────────────────────────────────────── */
h3 {
  font-family: var(--sans-cond);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 20px 0 10px;
}

/* ── Paragraphes ─────────────────────────────────────────── */
p {
  font-size: .97rem;
  color: var(--text-body);
  margin-bottom: 14px;
}
p:last-child { margin-bottom: 0; }
b { font-weight: 600; color: var(--text-bright); }

/* ── Listes ──────────────────────────────────────────────── */
ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
li {
  font-size: .94rem;
  color: var(--text-body);
  padding-left: 20px;
  position: relative;
  transition: color .2s, padding-left .2s;
}
li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--text-muted);
  font-size: .7em;
  top: .28em;
  transition: color .2s;
}
li:hover { color: var(--text-bright); padding-left: 26px; }
li:hover::before { color: var(--cyan); }

/* ── Labels symptômes / mécanismes ──────────────────────── */
.symptomes,
.mecanismes {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 4px 12px 4px 10px;
  border-radius: 2px;
  margin: 14px 0 8px;
}
.symptomes {
  color: var(--red);
  background: var(--red-dim);
  border: 1px solid rgba(255,37,69,.25);
}
.symptomes::before {
  content: '⚠';
  font-size: .9em;
}
.mecanismes {
  color: var(--cyan);
  background: var(--cyan-dim);
  border: 1px solid rgba(0,212,232,.25);
}
.mecanismes::before {
  content: '◉';
  font-size: .75em;
}

/* ── Section introduction : mise en avant circuit dopamine ─ */
.section--intro .dopamine-note {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 18px;
  background: rgba(255,170,32,.07);
  border: 1px solid rgba(255,170,32,.2);
  border-radius: 3px;
}
.dopamine-note .dn-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px var(--amber));
}
.dopamine-note p {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--amber);
  margin: 0;
  line-height: 1.5;
}

/* ── Grille étiquettes circuits ──────────────────────────── */
.circuit-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.circuit-tag {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .08em;
  padding: 5px 12px;
  border-radius: 2px;
  border: 1px solid var(--border-dim);
  color: var(--text-muted);
  transition: color .2s, border-color .2s, background .2s;
  cursor: default;
}
.circuit-tag:hover {
  color: var(--cyan);
  border-color: var(--border-hot);
  background: var(--cyan-dim);
}

/* ── Section mécanisme commun : mini tableau ─────────────── */
.neuro-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: .88rem;
}
.neuro-table th {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-dim);
}
.neuro-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text-body);
  vertical-align: top;
}
.neuro-table td:first-child {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--cyan);
  white-space: nowrap;
}
.neuro-table tr:hover td { background: rgba(0,212,232,.04); }

/* ── Footer ──────────────────────────────────────────────── */
.obi-footer {
  border-top: 1px solid var(--border-dim);
  padding: 32px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
}
.footer-brand {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-muted);
  letter-spacing: .1em;
}
.footer-brand strong { color: var(--text-bright); }
.footer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-muted);
  letter-spacing: .1em;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink {
  0%,100% { opacity:1; }
  50%      { opacity:.3; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .wrap { padding: 0 14px 60px; }
  .obi-header { grid-template-columns: 1fr; gap: 20px; }
  .section { padding: 22px 18px; }
  h2 { font-size: 1rem; }
}
