/* Page d'accueil — module Philosophie Adaptia */
:root {
  --ink: #1a2330;
  --ink-2: #3d4a5c;
  --ink-3: #6a7688;
  --paper: #f7f6f2;
  --paper-2: #eeecea;
  --paper-3: #e3e0d8;
  --white: #fffcf8;
  --accent: #2d6a4f;
  --accent-2: #40916c;
  --accent-3: #52b788;
  --accent-soft: #d8f3dc;
  --accent-soft-2: #b7e4c7;
  --phase-intro: #2aa3b8;
  --phase-conc: #1e4d6b;
  --warn: #9a5b24;
  --warn-soft: #f3ebe0;
  --font-d: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-b: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --r: 8px;
  --radius: 10px;
  --sh: 0 1px 3px rgba(26, 35, 48, 0.07);
  --shadow: 0 2px 10px rgba(26, 35, 48, 0.08);
  --shadow-hover: 0 6px 20px rgba(45, 106, 79, 0.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-b);
  background:
    radial-gradient(ellipse 65% 42% at 6% -6%, rgba(42, 163, 184, 0.09) 0%, transparent 55%),
    radial-gradient(ellipse 50% 38% at 100% 0%, rgba(45, 106, 79, 0.09) 0%, transparent 50%),
    var(--paper);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 22px 80px;
}

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--accent-soft-2);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-d);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
  text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand span {
  display: block;
  font-family: var(--font-b);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-top: 5px;
}

.topbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 14px;
  font-weight: 600;
}

.topbar-links a {
  border-bottom: 1px solid transparent;
  text-decoration: none;
}

.topbar-links a:hover { border-bottom-color: var(--accent); }

.topbar-links .nav-soon {
  color: var(--ink-3);
  opacity: 0.62;
  cursor: default;
  border-bottom-color: transparent;
  text-decoration: none;
}

.topbar-links .nav-soon:hover {
  border-bottom-color: transparent;
  text-decoration: none;
  opacity: 0.62;
}

.topbar-links .nav-soon .nav-ico.aic {
  opacity: 0.7;
}

/* ── Hero ── */
.hero {
  margin-bottom: 28px;
}

.hero-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.hero h1 {
  font-family: var(--font-d);
  font-size: clamp(1.7rem, 3.6vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 8px;
  max-width: 18ch;
}

.hero-lead {
  color: var(--ink-2);
  max-width: 48ch;
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.55;
}

/* ── Module cards ── */
.modules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 36px;
  align-items: stretch;
}

.module-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 22px;
  background: var(--white);
  border: 1px solid var(--paper-3);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.15s;
  min-height: 168px;
}

.module-card:hover {
  border-color: var(--accent-2);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

.module-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.module-icon.aic svg {
  width: 100%;
  height: 100%;
}

.nav-ico.aic,
.inline-icon.aic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.nav-ico.aic {
  width: 1em;
  height: 1em;
  margin-right: 4px;
}

.topbar-links .teacher-link .nav-ico.aic,
.footer-prof-link.teacher-link .nav-ico.aic {
  width: 0.95em;
  height: 0.95em;
  opacity: 0.72;
}

.inline-icon.aic {
  width: 1.2em;
  height: 1.2em;
  margin-right: 6px;
  color: var(--accent);
}

.modal-close .aic {
  width: 1.1rem;
  height: 1.1rem;
}

.module-card h2 {
  font-family: var(--font-d);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.module-card p {
  font-size: 13.5px;
  color: var(--ink-2);
  flex: 1;
}

.module-badge {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, #c8ecd4 100%);
  color: var(--accent);
  border: 1px solid var(--accent-soft-2);
  margin-top: auto;
}

.module-badge.soon,
.badge--soon {
  background: linear-gradient(180deg, var(--warn-soft) 0%, #ebe0d0 100%);
  color: var(--warn);
  border-color: #dcc9b0;
}

/* Badge pilule partagé (accueil + modules internes) */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
  line-height: 1.3;
  border: 1px solid transparent;
}

.module-card.disabled,
.module-card--soon {
  opacity: 0.72;
  cursor: default;
  pointer-events: none;
  background: var(--paper-2);
}

.module-cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
}

/* ── Timeline section ── */
.timeline-section {
  background: var(--white);
  border: 1px solid var(--paper-3);
  border-radius: 12px;
  box-shadow: var(--sh);
  padding: 40px 28px 36px;
  margin-bottom: 36px;
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 16px;
}

.timeline-head h2 {
  font-family: var(--font-d);
  font-size: 1.35rem;
  font-weight: 600;
}

.timeline-head p {
  font-size: 13.5px;
  color: var(--ink-3);
  max-width: 42ch;
}

.timeline-programme {
  font-size: 13px;
  color: var(--ink-2);
  max-width: 52ch;
  margin-top: 6px;
  margin-bottom: 4px;
  line-height: 1.45;
}

.timeline-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 14px;
}

.timeline-view-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.view-control-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}

.view-toggle-pills {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--paper);
  border: 1px solid var(--paper-3);
  border-radius: 999px;
}

.view-toggle-pill {
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}

.view-toggle-pill:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.view-toggle-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.view-toggle-pill.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(45, 106, 79, 0.25);
}

.view-toggle-pill.is-active:hover {
  background: var(--accent-2);
  color: #fff;
}

.filter-select {
  position: relative;
  display: inline-block;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.filter-toggle:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.filter-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.9;
  transition: transform 0.15s;
}

.filter-toggle[aria-expanded="true"] .filter-chevron {
  transform: rotate(180deg);
}

.filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 100%;
  padding: 4px;
  background: var(--white);
  border: 1px solid var(--paper-3);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(26, 35, 48, 0.12);
}

.filter-menu[hidden] {
  display: none;
}

.filter-option {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.filter-option:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.filter-option.active {
  background: var(--accent);
  color: #fff;
}

.filter-option.active:hover {
  background: var(--accent-2);
  color: #fff;
}

.inline-icon {
  display: inline-flex;
  vertical-align: -0.12em;
  margin-right: 0.35em;
}

.timeline-board {
  padding: 16px 0 12px;
}

.timeline-track {
  margin-top: 4px;
}

.timeline-segments {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  transition: grid-template-columns 0.3s ease, gap 0.3s ease;
}

.timeline-segments:not(.filter-active) {
  overflow-x: auto;
  scrollbar-width: thin;
}

.timeline-segment[data-period="antiquite"],
.timeline-segment[data-period="moyen-age"],
.timeline-segment[data-period="renaissance"] {
  grid-column: span 1;
}

.timeline-segment[data-period="moderne"],
.timeline-segment[data-period="contemporaine"] {
  grid-column: span 2;
}

.timeline-segment {
  background: var(--paper);
  border: 1px solid rgba(227, 224, 216, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 252, 248, 0.65);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 132px;
  min-height: 120px;
  height: auto;
  transition: opacity 0.25s ease, border-color 0.15s, box-shadow 0.18s, transform 0.3s ease;
}

.timeline-segment:hover {
  border-color: var(--accent-soft-2);
  box-shadow: var(--shadow-hover);
}

/* Filtre période actif : blocs visibles en pleine largeur */
.timeline-segments.filter-active {
  grid-template-columns: 1fr;
  gap: 24px;
}

.timeline-segments.filter-active .timeline-segment.filter-visible {
  grid-column: 1 / -1;
  width: 100%;
  animation: segment-filter-in 0.3s ease;
}

@keyframes segment-filter-in {
  from { opacity: 0.55; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

.timeline-segment.is-hidden {
  display: none;
}

.timeline-segment.is-empty:not(.is-hidden) {
  opacity: 0.55;
}

.segment-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px 14px 11px;
  border-bottom: none;
  background: linear-gradient(180deg, var(--white) 0%, var(--paper) 100%);
  box-shadow: inset 0 -1px 0 rgba(26, 35, 48, 0.07);
}

.segment-title {
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-segment[data-period="antiquite"] .segment-title,
.timeline-segment[data-period="moyen-age"] .segment-title,
.timeline-segment[data-period="renaissance"] .segment-title {
  font-size: 13px;
}

.segment-hint {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 4px;
  letter-spacing: 0.01em;
}

.segment-count {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 2px;
  letter-spacing: 0.02em;
  opacity: 0.85;
  line-height: 1.2;
}

.segment-body {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  padding: 14px 12px 12px;
  gap: 12px;
}

.segment-axis-band {
  position: relative;
  flex-shrink: 0;
  padding: 0 8px 4px;
  margin-top: 4px;
  z-index: 1;
}

.segment-axis {
  position: relative;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-soft-2), var(--segment-color, var(--accent)), var(--accent-soft-2));
  border-radius: 2px;
}

.segment-philos {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  align-items: start;
  align-content: start;
  justify-items: center;
  gap: 10px 8px;
  min-height: 0;
  padding: 0 6px 8px;
  z-index: 2;
  flex: 0 1 auto;
}

.timeline-segments:not(.filter-active) .segment-philos:not(.segment-philos--filtered) {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-soft-2) transparent;
}

.timeline-segments:not(.filter-active) .segment-philos:not(.segment-philos--filtered)::-webkit-scrollbar {
  width: 5px;
}

.timeline-segments:not(.filter-active) .segment-philos:not(.segment-philos--filtered)::-webkit-scrollbar-thumb {
  background: var(--accent-soft-2);
  border-radius: 999px;
}

.segment-philos--dense {
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 10px 6px;
}

/* Grille interne par période — harmonie des 5 segments */
.segment-philos--moderne,
.timeline-segment[data-period="moderne"] .segment-philos--dense {
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap: 10px 8px;
}

.segment-philos--contemporaine,
.timeline-segment[data-period="contemporaine"] .segment-philos--dense {
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  gap: 10px 6px;
}

.timeline-segment[data-period="moderne"] .courant-group-items {
  grid-template-columns: repeat(2, minmax(72px, 1fr));
}

.timeline-segment[data-period="contemporaine"] .courant-group-items {
  grid-template-columns: repeat(3, minmax(64px, 1fr));
}

.segment-philos--sparse {
  min-height: 0;
  gap: 12px 10px;
}

.segment-philos--scroll {
  max-height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-soft-2) transparent;
  padding-right: 2px;
}

.segment-philos--scroll::-webkit-scrollbar {
  width: 5px;
}

.segment-philos--scroll::-webkit-scrollbar-thumb {
  background: var(--accent-soft-2);
  border-radius: 999px;
}

/* Mode filtre : philosophes étalés sur toute la largeur */
.segment-philos--filtered {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px 20px;
  min-height: 0;
  width: 100%;
  padding: 0 12px 4px;
}

.segment-philos--filtered .timeline-node {
  flex: 0 0 auto;
}

.segment-philos--filtered.segment-philos--spread {
  justify-content: space-evenly;
}

.segment-philos--scroll-h {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}

.segment-philos--scroll-h::-webkit-scrollbar {
  display: none;
}

.segment-philos--dense .timeline-node {
  width: 72px;
  flex: 0 0 72px;
}

.segment-philos--dense .node-avatar {
  width: 58px;
  height: 58px;
  font-size: 13px;
}

.segment-philos--dense .node-label {
  font-size: 11.5px;
}

.segment-philos--dense .node-year {
  font-size: 10px;
}

.segment-empty {
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
  padding: 16px 8px 4px;
  line-height: 1.45;
}

/* Boîte unifiée philosophe / événement */
.timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  padding: 6px 4px;
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  flex: 0 0 auto;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.timeline-node:hover,
.timeline-node:focus-visible {
  transform: translateY(-3px);
  outline: none;
}

.node-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.28);
  flex-shrink: 0;
  overflow: hidden;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.18s, transform 0.15s;
}

.timeline-node:hover .node-avatar,
.timeline-node:focus-visible .node-avatar {
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.36);
  transform: scale(1.03);
}

.node-avatar img,
.philo-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.node-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.node-year {
  font-size: 10px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1.2;
}

.timeline-node:hover .node-label {
  color: var(--accent);
}

.philo-node .philo-avatar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.philo-node .philo-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  border-radius: 50%;
}

.philo-node:focus-visible .node-avatar {
  box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--accent);
}

.philo-node[data-epoque="Antiquité"] .node-avatar { background: #8b6914; }
.philo-node[data-epoque="Moderne"] .node-avatar { background: var(--phase-intro); }
.philo-node[data-epoque="Contemporaine"] .node-avatar { background: var(--phase-conc); }

.philo-courant {
  display: none;
}

.segment-philos--grouped {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}

.courant-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
}

.courant-label {
  display: inline-block;
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 4px;
  border: none;
  border-left: 3px solid var(--segment-color, var(--accent));
  background: none;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.courant-label:hover,
.courant-label:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent-soft-2);
}

.courant-label--static {
  cursor: default;
  text-decoration: none;
}

.courant-group-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  align-items: start;
  justify-items: center;
  width: 100%;
}

.courant-group-items .timeline-node {
  flex: 0 0 72px;
  width: 72px;
}

.courant-textes-list {
  margin: 0;
  padding-left: 1.1rem;
}

.courant-texte-year {
  color: var(--ink-3);
  font-size: 0.92em;
}

.courant-textes-empty {
  color: var(--ink-3);
  font-style: italic;
  margin: 0;
}

.segment-events-section {
  border-top: 1px solid var(--paper-3);
  padding-top: 10px;
  margin-top: 2px;
}

.segment-events-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 8px 12px;
}

.segment-events {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px 20px;
  width: 100%;
  padding: 0 12px 8px;
}

.segment-events--scroll-h {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.segment-events--scroll-h::-webkit-scrollbar {
  display: none;
}

.segment-events--spread {
  justify-content: space-evenly;
}

.segment-events .timeline-node {
  flex: 0 0 auto;
}

.event-node .event-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff8eb;
  border-color: #e8c87a;
  color: #a67c00;
  box-shadow: 0 2px 6px rgba(166, 124, 0, 0.22);
}

.event-node .event-avatar svg {
  display: block;
}

.event-node:focus-visible .event-avatar {
  box-shadow: 0 0 0 3px var(--white), 0 0 0 5px #c9a227;
}

.event-node:hover .node-label {
  color: #a67c00;
}

.segment-markers {
  display: none;
}

/* Bande repères historiques — pleine largeur sous la frise */
.timeline-reperes-band {
  margin-top: 24px;
  padding: 22px 18px 20px;
  background: linear-gradient(180deg, var(--paper) 0%, #f0eee8 100%);
  border: 1px solid var(--paper-3);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 252, 248, 0.7);
}

.reperes-band-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 16px 4px;
}

.timeline-reperes-axis-wrap {
  position: relative;
  min-height: 132px;
  padding: 10px 10px 18px;
}

.timeline-reperes-axis {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  background: linear-gradient(90deg, var(--accent-soft-2), var(--accent), var(--accent-soft-2));
  border-radius: 2px;
}

.timeline-reperes-markers {
  position: relative;
  min-height: 132px;
  z-index: 1;
}

.timeline-marker {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 96px;
  text-align: center;
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  padding: 0 3px 4px;
  transition: transform 0.15s;
}

.timeline-marker.marker--below {
  top: auto;
  bottom: 4px;
  flex-direction: column-reverse;
}

.timeline-marker:hover,
.timeline-marker:focus-visible {
  transform: translateX(-50%) translateY(-2px);
  outline: none;
  z-index: 2;
}

.timeline-marker.marker--below:hover,
.timeline-marker.marker--below:focus-visible {
  transform: translateX(-50%) translateY(2px);
}

.timeline-marker:focus-visible .marker-icon {
  box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--accent);
}

.marker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--paper-3);
  color: var(--segment-color, var(--accent));
  box-shadow: var(--sh);
}

.marker-icon svg {
  display: block;
}

.marker-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 96px;
  opacity: 0.72;
  max-height: 2.6em;
  pointer-events: none;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.marker-date {
  font-size: 9px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0.65;
  max-height: 1.4em;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.timeline-marker:hover .marker-label,
.timeline-marker:focus-visible .marker-label,
.timeline-marker:hover .marker-date,
.timeline-marker:focus-visible .marker-date {
  opacity: 1;
}

.timeline-marker:hover .marker-label {
  color: var(--accent);
}

.marker-fallback {
  font-size: 14px;
  line-height: 1;
}

.timeline-hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 14px;
  line-height: 1.5;
  border-top: 1px solid var(--paper-3);
  padding-top: 12px;
}

/* ── Modal fiche philosophe ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 35, 48, 0.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--white);
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: min(88vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(26, 35, 48, 0.2);
  transform: translateY(12px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal { transform: none; }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--paper-3);
  background: linear-gradient(180deg, #f4faf6 0%, var(--white) 100%);
}

.modal-head h3 {
  font-family: var(--font-d);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.modal-meta {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 4px;
}

.modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--paper-3);
  border-radius: var(--r);
  background: var(--white);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-2);
}

.modal-close:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.modal-body {
  padding: 0 0 24px;
  overflow-y: auto;
}

.modal-portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  max-height: 220px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--paper-2) 100%);
  overflow: hidden;
}

.modal-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.modal-portrait-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-d);
  font-size: 3.5rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--paper-2) 100%);
}

.modal-body .modal-section {
  padding: 0 22px;
}

.modal-body .modal-section:first-of-type {
  padding-top: 18px;
}

.modal-section {
  margin-bottom: 18px;
}

.modal-section:last-child { margin-bottom: 0; }

.modal-section h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.modal-section p,
.modal-section li {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
}

.modal-section em,
.modal-section em.oeuvre {
  font-style: italic;
  color: var(--ink);
}

.modal-section ul {
  padding-left: 1.15em;
  margin: 0;
}

.modal-section li { margin: 4px 0; }

.modal-repere-hero {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.modal-repere-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent-soft-2);
  color: var(--accent);
}

.modal-repere-icon svg {
  display: block;
}

.modal-section--repere p {
  font-size: 14.5px;
  line-height: 1.55;
}

.textes-manuel-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.textes-manuel-list li {
  margin: 0;
}

.texte-manuel-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  padding: 8px 10px;
  border-radius: var(--r);
  background: var(--paper);
  border: 1px solid var(--paper-3);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.texte-manuel-notion {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.texte-manuel-main {
  flex: 1 1 auto;
  min-width: 0;
}

.texte-manuel-page {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
}

.texte-manuel-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.texte-manuel-link:hover .texte-manuel-page {
  color: var(--accent);
  opacity: 0.85;
}

.textes-manuel-empty {
  font-size: 14px;
  color: var(--ink-3);
  font-style: italic;
  margin: 0;
}

.citation-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.citation-list li {
  padding: 10px 12px;
  background: var(--paper);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r) var(--r) 0;
  font-style: italic;
}

.citation-theme {
  display: inline-block;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
}

.citation-source {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}

.footer-note {
  font-size: 13px;
  color: var(--ink-3);
  padding-top: 4px;
  line-height: 1.5;
}

.site-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--paper-3);
  text-align: center;
}

.footer-prof {
  margin-top: 10px;
}

.footer-prof-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-decoration: none;
  opacity: 0.78;
}

.footer-prof-link:hover {
  color: var(--accent);
  opacity: 1;
  text-decoration: none;
}

/* ── Espace professeur (accueil code) ── */
.prof-access {
  max-width: 420px;
  margin: 48px auto 0;
  padding: 32px 28px;
  background: var(--white);
  border: 1px solid var(--paper-3);
  border-radius: 12px;
  box-shadow: var(--sh);
}

.prof-access h1 {
  font-family: var(--font-d);
  font-size: 1.65rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.prof-lead {
  color: var(--ink-2);
  margin-bottom: 20px;
  font-size: 15px;
}

.prof-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.prof-field span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.prof-field input {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid var(--paper-3);
  border-radius: var(--r);
  background: var(--paper);
}

.prof-field input:focus {
  outline: 2px solid var(--accent-soft-2);
  border-color: var(--accent-2);
}

.prof-submit {
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  color: var(--white);
  background: var(--accent);
  border: none;
  border-radius: var(--r);
  cursor: pointer;
}

.prof-submit:hover {
  background: var(--accent-2);
}

.prof-error {
  margin-top: 14px;
  font-size: 14px;
  color: #9b2335;
}

.prof-back {
  margin-top: 20px;
  font-size: 14px;
  text-align: center;
}

.prof-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: center;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 1366px) {
  .wrap {
    max-width: 100%;
    padding: 20px 18px 72px;
    overflow-x: hidden;
  }

  .timeline-section {
    padding: 32px 20px 28px;
  }

  .timeline-segments {
    gap: 12px;
  }

  .segment-philos--dense:not(.segment-philos--moderne):not(.segment-philos--contemporaine) {
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  }

  .segment-philos--moderne,
  .timeline-segment[data-period="moderne"] .segment-philos--dense {
    grid-template-columns: repeat(2, minmax(72px, 1fr));
  }

  .segment-philos--contemporaine,
  .timeline-segment[data-period="contemporaine"] .segment-philos--dense {
    grid-template-columns: repeat(3, minmax(64px, 1fr));
  }
}

@media (max-width: 1024px) {
  .timeline-segments {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-segment[data-period] {
    grid-column: span 1;
  }

  .timeline-segments.filter-active {
    grid-template-columns: 1fr;
  }

  .timeline-segments.filter-active .timeline-segment.filter-visible {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .modules { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .wrap { padding: 16px 14px 56px; }
  .topbar { align-items: flex-start; }
  .topbar-links { gap: 8px 12px; font-size: 13px; }
  .timeline-section { padding: 28px 16px 24px; }
  .timeline-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .timeline-segments { grid-template-columns: 1fr; }
  .timeline-segment { min-height: 120px; }
  .segment-philos { gap: 10px 8px; min-height: 0; }
  .segment-philos--filtered { gap: 10px 16px; min-height: 0; }
  .node-avatar { width: 52px; height: 52px; }
  .node-label { font-size: 11.5px; }
  .segment-philos--dense .node-avatar { width: 52px; height: 52px; }
  .modal { max-height: 92vh; }
  .timeline-reperes-axis-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .timeline-reperes-markers {
    min-width: 880px;
  }
}
