/* ============================================================
   ODDICY HISTOIRE, CSS page-specifique
   Scoped a #oddicy-histoire pour ne pas confliter avec
   oddicy-global.css (nav, footer, cursor, body).
   ============================================================ */

/* ── TOKENS (scopes au contenu page) ────────────────────── */
#oddicy-histoire {
  --black:    #080809;
  --deep:     #0e0e12;
  --surface:  #141418;
  --surface2: #1a1a20;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.13);
  --violet:   #7c5cbf;
  --vlight:   #9b7dd4;
  --vdim:     rgba(124,92,191,0.12);
  --vglow:    rgba(124,92,191,0.06);
  --white:    #f0ede8;
  --muted:    rgba(240,237,232,0.40);
  --muted2:   rgba(240,237,232,0.65);
  --accent:   #c8b8e8;
  --amber:    #c9914c;
  --amber-dim:rgba(201,145,76,0.10);
  --red:      #c94c4c;
  --red-dim:  rgba(201,76,76,0.10);
  --green:    rgba(110,220,130,0.8);

  --f-serif: 'Cormorant Garamond', Georgia, serif;
  --f-sans:  'DM Sans', system-ui, sans-serif;
  --f-mono:  'DM Mono', 'Courier New', monospace;
  --f-type:  'Special Elite', 'Courier New', monospace;

  color: var(--white);
  font-family: var(--f-sans);
  font-weight: 300;
}

/* ── READ PROGRESS BAR (fixed top) ──────────────────────── */
.read-progress {
  position: fixed; top: 0; left: 0; height: 2px; z-index: 500;
  background: var(--violet); width: 0%; transition: width .1s linear;
}

/* ── INTRO CINEMATIQUE ──────────────────────────────────── */
.intro {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  position: relative; overflow: hidden; padding: 60px 40px;
}
.intro-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 70% at 50% 50%, rgba(80,50,140,.15) 0%, var(--black) 65%);
}
.intro-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: 60px 60px;
}
.intro-content { position: relative; z-index: 2; max-width: 680px; }

.classification-stamp {
  display: inline-block;
  font-family: var(--f-type); font-size: 11px; letter-spacing: .28em;
  color: var(--red); border: 2px solid var(--red); padding: 5px 14px;
  transform: rotate(-1.5deg); margin-bottom: 36px; opacity: .85;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(201,76,76,.15);
}

.intro-agency {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 16px;
}

.intro-title {
  font-family: var(--f-serif); font-size: clamp(52px,8vw,100px);
  font-weight: 300; line-height: .95; letter-spacing: -.02em; margin-bottom: 24px;
}
.intro-title em { font-style: italic; color: var(--accent); }

.intro-sub {
  font-family: var(--f-serif); font-size: clamp(18px,2.5vw,26px);
  font-weight: 300; font-style: italic; color: var(--muted2); line-height: 1.5; margin-bottom: 40px;
}

.intro-meta {
  display: flex; gap: 32px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 48px;
}
.intro-meta-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.meta-label {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted);
}
.meta-val {
  font-family: var(--f-serif); font-size: 22px; font-weight: 300; color: var(--white);
}

.scroll-prompt {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted);
  animation: promptPulse 2.5s ease-in-out infinite;
}
@keyframes promptPulse { 0%,100%{opacity:.4} 50%{opacity:.9} }
.scroll-arrow {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--muted), transparent);
}

/* ── PAGE LAYOUT ────────────────────────────────────────── */
.history-wrapper {
  display: grid; grid-template-columns: 200px 1fr;
  max-width: 1300px; margin: 0 auto; position: relative;
}

/* ── TIMELINE NAV (sidebar) ─────────────────────────────── */
.timeline-nav {
  position: sticky; top: 0; height: 100vh;
  padding: 48px 0 48px 48px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
}

.tn-line {
  position: absolute; left: 76px; top: 0; bottom: 0; width: 1px;
  background: var(--border);
}
.tn-progress {
  position: absolute; left: 76px; top: 0; width: 1px;
  background: var(--violet); transform-origin: top;
  transition: height .1s linear; height: 0%;
}

.tn-entries { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 0; }
.tn-entry {
  display: flex; align-items: center; gap: 12px; padding: 5px 0;
  cursor: pointer; text-decoration: none; color: inherit; transition: opacity .2s;
  opacity: .4;
}
.tn-entry.active { opacity: 1; }
.tn-entry:hover { opacity: .8; }

.tn-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--muted);
  transition: all .25s; margin-left: -4px;
}
.tn-entry.active .tn-dot {
  background: var(--violet); border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--vglow); width: 10px; height: 10px; margin-left: -5px;
}

.tn-year {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em;
  color: var(--muted); transition: color .25s; white-space: nowrap;
}
.tn-entry.active .tn-year { color: var(--vlight); }
.tn-entry.future .tn-year { color: var(--amber); opacity: .6; }
.tn-entry.future .tn-dot { border-color: var(--amber); }

/* ── CHAPTERS STREAM ────────────────────────────────────── */
.chapters { padding: 0 80px 120px 60px; }

/* ── ERA DIVIDER ────────────────────────────────────────── */
.era-divider {
  display: flex; align-items: center; gap: 20px;
  margin: 80px 0 60px;
}
.era-divider:first-child { margin-top: 60px; }
.era-line { flex: 1; height: 1px; background: var(--border); }
.era-label {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--muted); padding: 6px 14px; border: 1px solid var(--border); border-radius: 1px;
  white-space: nowrap;
}

/* ── CHAPTER CARD ───────────────────────────────────────── */
.chapter {
  margin-bottom: 4px; opacity: 0; transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
  position: relative;
}
.chapter.revealed { opacity: 1; transform: translateY(0); }

.chapter::before {
  content: ''; position: absolute;
  left: -60px; top: 48px;
  width: 40px; height: 1px;
  background: linear-gradient(to right, transparent, var(--border));
}

.chapter-inner {
  background: var(--deep); border: 1px solid var(--border);
  border-radius: 4px; overflow: hidden;
  transition: border-color .3s; position: relative;
}
.chapter-inner:hover { border-color: var(--border2); }

.chapter-bar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.chapter-bar-left { display: flex; align-items: center; gap: 16px; }

.chapter-date {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .18em;
  color: var(--vlight); white-space: nowrap;
}
.chapter-codename {
  font-family: var(--f-type); font-size: 12px; letter-spacing: .12em;
  color: var(--muted); text-transform: uppercase;
}
.chapter-bar-right { display: flex; align-items: center; gap: 8px; }

.status-badge {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .18em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 1px;
}
.status-closed   { background: rgba(255,255,255,.04); color: var(--muted); border: 1px solid var(--border); }
.status-active   { background: var(--vdim); color: var(--vlight); border: 1px solid rgba(124,92,191,.25); animation: activePulse 2s ease-in-out infinite; }
.status-ongoing  { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(201,145,76,.25); animation: activePulse 2.4s ease-in-out infinite; }
.status-critical { background: var(--red-dim); color: var(--red); border: 1px solid rgba(201,76,76,.25); }
@keyframes activePulse { 0%,100%{opacity:1} 50%{opacity:.55} }

/* Chapter body */
.chapter-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.chapter-body.no-image { grid-template-columns: 1fr; }
.chapter-body.image-left { direction: rtl; }
.chapter-body.image-left > * { direction: ltr; }

.chapter-text {
  padding: 28px 32px; display: flex; flex-direction: column; justify-content: center;
}
.chapter-title {
  font-family: var(--f-serif); font-size: clamp(22px,2.8vw,34px); font-weight: 400; line-height: 1.1;
  margin-bottom: 16px; letter-spacing: -.01em;
}
.chapter-title em { font-style: italic; color: var(--accent); }
.chapter-content {
  font-size: 14px; line-height: 1.88; color: var(--muted2); margin-bottom: 20px;
}
.chapter-content strong { color: var(--white); font-weight: 400; }

/* Classified note */
.classified-note {
  margin-top: 16px; padding: 12px 16px;
  background: rgba(255,255,255,.02); border: 1px solid var(--border);
  border-left: 2px solid var(--violet); border-radius: 0 2px 2px 0;
  font-family: var(--f-type); font-size: 12px; line-height: 1.7; color: var(--muted2);
}
.classified-note::before {
  content: 'NOTE INTERNE, '; font-family: var(--f-mono); font-size: 9px; letter-spacing: .2em;
  color: var(--vlight); display: block; margin-bottom: 4px;
}

/* Chapter image */
.chapter-image {
  position: relative; overflow: hidden; min-height: 240px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
}
.chapter-image img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(30%) brightness(.85) contrast(1.08);
  transition: filter .4s ease, transform .5s ease;
}
.chapter-inner:hover .chapter-image img {
  filter: grayscale(10%) brightness(.95) contrast(1.05); transform: scale(1.02);
}

/* Surveillance overlay */
.surv-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(8,8,9,.4) 0%, transparent 30%, transparent 70%, rgba(8,8,9,.5) 100%),
    linear-gradient(to right, rgba(8,8,9,.3) 0%, transparent 20%, transparent 80%, rgba(8,8,9,.3) 100%);
}
.surv-corner {
  position: absolute; width: 16px; height: 16px;
  border-color: rgba(155,125,212,.4); border-style: solid;
}
.surv-tl { top: 10px; left: 10px; border-width: 1px 0 0 1px; }
.surv-tr { top: 10px; right: 10px; border-width: 1px 1px 0 0; }
.surv-bl { bottom: 10px; left: 10px; border-width: 0 0 1px 1px; }
.surv-br { bottom: 10px; right: 10px; border-width: 0 1px 1px 0; }

.surv-stamp {
  position: absolute; bottom: 10px; left: 14px;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: .14em; color: rgba(155,125,212,.5);
}

/* Image placeholder */
.img-placeholder {
  width: 100%; height: 100%; min-height: 240px;
  display: flex; align-items: center; justify-content: center;
}
.placeholder-bg-1  { background: radial-gradient(ellipse at 50% 40%, rgba(80,60,150,.3), #0d0d18); }
.placeholder-bg-2  { background: radial-gradient(ellipse at 60% 50%, rgba(100,60,40,.25), #0e0d14); }
.placeholder-bg-3  { background: radial-gradient(ellipse at 40% 60%, rgba(40,80,60,.22), #0d1210); }
.placeholder-bg-4  { background: radial-gradient(ellipse at 55% 40%, rgba(60,60,100,.28), #0e0e18); }
.placeholder-bg-5  { background: radial-gradient(ellipse at 45% 55%, rgba(100,80,30,.22), #131010); }
.placeholder-bg-6  { background: radial-gradient(ellipse at 50% 50%, rgba(40,100,80,.2), #0d1412); }
.placeholder-bg-7  { background: radial-gradient(ellipse at 60% 40%, rgba(120,60,60,.25), #141010); }
.placeholder-bg-8  { background: radial-gradient(ellipse at 50% 60%, rgba(60,60,120,.28), #0e0e18); }
.placeholder-bg-9  { background: radial-gradient(ellipse at 40% 50%, rgba(80,100,50,.22), #111410); }
.placeholder-bg-10 { background: radial-gradient(ellipse at 55% 45%, rgba(100,70,70,.25), #141010); }
.placeholder-bg-11 { background: radial-gradient(ellipse at 50% 50%, rgba(70,70,120,.3), #0e0e18); }
.placeholder-bg-12 { background: radial-gradient(ellipse at 60% 55%, rgba(100,80,40,.24), #131010); }
.placeholder-bg-13 { background: radial-gradient(ellipse at 45% 40%, rgba(60,100,100,.22), #0d1414); }

.placeholder-label {
  font-family: var(--f-serif); font-size: clamp(16px,2vw,24px); font-style: italic;
  color: rgba(240,237,232,.15); letter-spacing: .05em; text-align: center; padding: 20px;
}

/* ── CHAPTER TAGS ───────────────────────────────────────── */
.chapter-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 1px; border: 1px solid;
}
.tag-lieu    { color: rgba(180,160,230,.7); border-color: rgba(180,160,230,.2); background: rgba(124,92,191,.06); }
.tag-menace  { color: rgba(220,120,100,.7); border-color: rgba(220,120,100,.2); background: rgba(201,76,76,.06); }
.tag-victoire{ color: rgba(110,200,130,.7); border-color: rgba(110,200,130,.2); background: rgba(80,160,100,.06); }
.tag-pivotal { color: var(--amber); border-color: rgba(201,145,76,.25); background: var(--amber-dim); }

/* ── ACTIVE MISSION CARD ────────────────────────────────── */
.mission-active .chapter-inner {
  border-color: rgba(124,92,191,.35);
  box-shadow: 0 0 0 1px rgba(124,92,191,.1), 0 0 40px rgba(124,92,191,.06);
}
.mission-active .chapter-inner::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--accent), var(--violet));
  animation: scanline 3s linear infinite;
}
@keyframes scanline {
  0%{background-position:0% 50%} 100%{background-position:200% 50%}
}

.typing-cursor {
  display: inline-block; width: 2px; height: 1em; background: var(--vlight);
  margin-left: 3px; vertical-align: text-bottom;
  animation: typeBlink .8s step-end infinite;
}
@keyframes typeBlink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── FUTURE SLOTS ───────────────────────────────────────── */
.chapter-future .chapter-inner {
  border-color: rgba(201,145,76,.18);
  background: rgba(201,145,76,.03);
}
.chapter-future .chapter-bar { background: rgba(201,145,76,.05); }
.chapter-future .chapter-title { color: var(--muted2); }

.redacted {
  background: rgba(255,255,255,.12); color: transparent; border-radius: 1px;
  user-select: none; cursor: default; display: inline-block;
}
.redacted:hover { background: rgba(124,92,191,.2); }

/* ── CHAPTER NUMBER (large bg) ──────────────────────────── */
.chapter-num {
  position: absolute; right: 24px; bottom: 16px;
  font-family: var(--f-serif); font-size: 80px; font-weight: 600; line-height: 1;
  color: rgba(255,255,255,.025); pointer-events: none; user-select: none;
  letter-spacing: -.02em;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .history-wrapper { grid-template-columns: 160px 1fr; }
  .chapters { padding: 0 40px 100px 40px; }
  .timeline-nav { padding-left: 24px; }
  .tn-line, .tn-progress { left: 52px; }
}

@media (max-width: 768px) {
  .history-wrapper { grid-template-columns: 1fr; }
  .timeline-nav { display: none; }
  .chapters { padding: 0 20px 80px; }
  .chapter-body { grid-template-columns: 1fr !important; direction: ltr !important; }
  .chapter-image { min-height: 200px; }
  .chapter::before { display: none; }
  .intro { padding: 60px 24px; }
  .era-divider { margin: 50px 0 36px; }
}

@media (max-width: 480px) {
  .intro-meta { gap: 20px; }
  .chapter-text { padding: 20px; }
  .chapter-bar { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
}
