/* ExaTrack — site statique. Layout + composants, bâtis sur les tokens du Design System.
   Les composants du DS (Button, Card, Badge, Stat) sont recréés ici en CSS pur
   pour un site statique autonome (mêmes tokens, même rendu). */

html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { min-height: 100vh; display: flex; flex-direction: column; }
img { max-width: 100%; display: block; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); border-radius: var(--radius-xs); }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-5); width: 100%; }
.narrow { max-width: var(--container-narrow); }
main { flex: 1; }
.section { padding: var(--space-8) 0; }
.section--tint { background: var(--bg-surface); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.panel { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); padding: var(--space-7) var(--space-6); }
.eyebrow { display: block; margin-bottom: var(--space-3); }
.lead { font-size: var(--text-lg); line-height: var(--leading-relaxed); color: var(--text-muted); }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.mono { font-family: var(--font-mono); }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.hide { display: none !important; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg-page) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border-subtle); }
.site-header__inner { display: flex; align-items: center; gap: var(--space-5); height: 72px; }
/* .brand { display: inline-flex; line-height: 0; background: rgba(255,255,255,.94); border-radius: var(--radius-sm); padding: 7px 11px; flex: none; } */
.brand { display: inline-flex; line-height: 0; border-radius: var(--radius-sm); padding: 7px 11px; flex: none; }
.brand img { height: 40px; width: auto; }
.nav { display: flex; gap: var(--space-5); margin-left: var(--space-2); }
.nav a { font-weight: var(--fw-semibold); font-size: var(--text-sm); color: var(--text-muted); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text-strong); text-decoration: none; }
.nav a.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); }
.langtoggle { display: flex; align-items: center; font-family: var(--font-mono); font-size: var(--text-xs); border: 1px solid var(--border-default); border-radius: var(--radius-pill); overflow: hidden; }
.langtoggle button { border: 0; background: transparent; padding: 4px 10px; font: inherit; color: var(--text-muted); cursor: pointer; }
.langtoggle button.is-active { background: var(--brand); color: var(--text-on-brand); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--border-default); border-radius: var(--radius-pill); background: transparent; color: var(--text-muted); cursor: pointer; transition: color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard); }
.icon-btn:hover { color: var(--text-strong); border-color: var(--border-strong); }
.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); font-family: var(--font-body); font-weight: var(--fw-semibold); font-size: var(--text-sm); line-height: 1; text-decoration: none; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 12px 18px; cursor: pointer; transition: background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard); white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn--sm { padding: 8px 14px; font-size: var(--text-xs); }
.btn--lg { padding: 14px 24px; font-size: var(--text-base); }
.btn--accent { background: var(--accent); color: #221706; }
.btn--accent:hover { background: var(--accent-hover); color: #221706; }
.btn--primary { background: var(--brand); color: var(--text-on-brand); }
.btn--primary:hover { background: var(--brand-hover); color: var(--text-on-brand); }
.btn--secondary { background: transparent; color: var(--text-strong); border-color: var(--border-default); }
.btn--secondary:hover { background: var(--bg-sunken); border-color: var(--border-strong); }
.btn--ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn--ghost:hover { background: var(--brand-wash); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); color: #fff; }
.btn--block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---------- Card ---------- */
.card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: var(--space-5); position: relative; }
.card--pad0 { padding: 0; overflow: hidden; }
.card--accent::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
a.card { text-decoration: none; color: inherit; display: block; }
.card--link { transition: transform var(--dur-base) var(--ease-standard), border-color var(--dur-base) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard); }
.card--link:hover { transform: translateY(-2px); border-color: var(--border-default); box-shadow: var(--shadow-md); text-decoration: none; }

/* ---------- Badge / Tag ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-body); font-weight: var(--fw-semibold); font-size: var(--text-xs); letter-spacing: .02em; padding: 3px 9px; border-radius: var(--radius-pill); border: 1px solid transparent; white-space: nowrap; }
.badge--brand { background: var(--brand-wash); color: var(--brand); }
.badge--accent { background: var(--accent-wash); color: var(--accent); }
.badge--neutral { background: var(--bg-sunken); color: var(--text-muted); border-color: var(--border-subtle); }
.badge--crit { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.badge--high { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.badge--low { background: color-mix(in srgb, var(--prune) 20%, transparent); color: var(--prune); }
[data-theme="dark"] .badge--low { color: #b98aa0; }

/* ---------- Stat ---------- */
.stat__value { font-family: var(--font-display); font-size: var(--text-3xl); line-height: 1; color: var(--brand); }
.stat__value--accent { color: var(--accent); }
.stat__value--danger { color: var(--danger); }
.stat__label { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-2); line-height: var(--leading-snug); max-width: 16ch; }
.stat-row { display: flex; gap: var(--space-7); flex-wrap: wrap; }
.stat-row--bordered { padding-top: var(--space-6); border-top: 1px solid var(--border-subtle); }

/* ---------- Hero ---------- */
.hero { padding: var(--space-9) 0 var(--space-8); }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--space-7); align-items: center; }
.hero h1 { font-size: var(--text-3xl); line-height: 1.06; }
.hero .accent-word { color: var(--brand); }
.page-hero { padding: var(--space-8) 0 var(--space-6); }
.page-hero h1 { font-size: var(--text-3xl); }
.breadcrumb { font-size: var(--text-xs); color: var(--text-faint); margin-bottom: var(--space-4); font-family: var(--font-mono); }

/* ---------- Node graph artwork ---------- */
.graph-frame { position: relative; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-sunken); overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 220px; }
.graph-frame__glow { position: absolute; inset: 15%; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--brand) 24%, transparent), transparent 68%); filter: blur(14px); }
.graph { position: relative; width: 90%; height: auto; }
.graph .lk { stroke: var(--border-default); stroke-width: 1.3; }
.graph circle.n { fill: var(--bg-surface); stroke: var(--brand); stroke-width: 1.5; }
.graph circle.hot { fill: var(--accent); }

/* ---------- Generic grids ---------- */
.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-7); align-items: center; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.arrow-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: var(--fw-semibold); text-decoration: none; }
.arrow-link:hover { text-decoration: none; color: var(--brand-hover); }

/* icon tile */
.icon-tile { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--brand-wash); color: var(--brand); margin-bottom: var(--space-4); }
.icon-tile--accent { background: var(--accent-wash); color: var(--accent); }
.svc-title { font-family: var(--font-display); text-transform: uppercase; font-size: var(--text-sm); letter-spacing: var(--tracking-display); color: var(--text-strong); margin: 0 0 var(--space-2); }

/* OS coverage tiles */
.os-tile { text-align: center; }
.os-tile .icon-tile { margin-left: auto; margin-right: auto; }

/* feature list */
.feature { display: flex; align-items: center; gap: var(--space-3); color: var(--text-body); font-size: var(--text-sm); padding: 2px 0; }
.feature svg { color: var(--brand); flex: none; }

/* steps / timeline */
.steps { display: grid; gap: var(--space-3); }
.steps--row { grid-auto-flow: column; grid-auto-columns: 1fr; }
.step { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-surface); padding: var(--space-4); }
.step__n { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-pill); border: 1.5px solid var(--brand); color: var(--brand); font-family: var(--font-mono); font-size: var(--text-sm); margin-bottom: var(--space-3); }
.step__title { font-weight: var(--fw-semibold); color: var(--text-strong); font-size: var(--text-sm); margin-bottom: 4px; }

/* pills row */
.pills { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pill { border: 1px solid var(--border-default); border-radius: var(--radius-pill); padding: 4px 12px; font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-mono); }

/* accordion */
.acc { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; }
.acc ~ .acc { margin-top: 0.5rem; }
.acc__head { width: 100%; text-align: left; background: var(--bg-surface); border: 0; padding: var(--space-4) var(--space-5); font: var(--fw-semibold) var(--text-base)/1.3 var(--font-body); color: var(--text-strong); display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); cursor: pointer; }
.acc__head:hover { background: var(--bg-sunken); }
.acc__body { padding: 0 var(--space-5); max-height: 0; overflow: hidden; transition: max-height var(--dur-slow) var(--ease-standard), padding var(--dur-slow) var(--ease-standard); color: var(--text-muted); }
.acc.is-open .acc__body { padding: 0 var(--space-5) var(--space-5); max-height: 480px; overflow-y: auto; }
.acc.is-open .acc__body::-webkit-scrollbar { width: 8px; }
.acc.is-open .acc__body::-webkit-scrollbar-track { background: transparent; }
.acc.is-open .acc__body::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: var(--radius-pill); }
.acc.is-open .acc__body::-webkit-scrollbar-thumb:hover { background: var(--brand); }
.acc.is-open .acc__body { scrollbar-width: thin; scrollbar-color: var(--border-default) transparent; }
.acc.is-open .acc__chev { transform: rotate(180deg); }
.acc__chev { transition: transform var(--dur-base) var(--ease-standard); flex: none; }
.acc__body ul { margin: var(--space-2) 0; padding-left: var(--space-5); }
.acc__body li { margin-bottom: var(--space-2); }
.acc__body li ul { margin-top: var(--space-2); }

/* CTA band */
.cta-band { position: relative; border: 1px solid var(--border-default); border-radius: var(--radius-xl); background: var(--bg-inverse); overflow: hidden; padding: var(--space-8) var(--space-7); text-align: center; }
.cta-band__glow { position: absolute; inset: 0; background: radial-gradient(circle at 50% 130%, color-mix(in srgb, var(--brand) 32%, transparent), transparent 60%); }
.cta-band > * { position: relative; }
.cta-band h2 { color: var(--text-on-inverse); }
.cta-band p { color: var(--text-on-inverse); opacity: .82; max-width: 56ch; margin-left: auto; margin-right: auto; }

/* alert / emergency */
.alert { border: 1px solid var(--danger); border-radius: var(--radius-md); background: color-mix(in srgb, var(--danger) 12%, var(--bg-surface)); padding: var(--space-5); display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.alert h2 { color: var(--text-strong); margin: 0 0 4px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field label { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.input, .textarea, .select { font: var(--fw-semibold) var(--text-sm)/1.4 var(--font-body); color: var(--text-body); background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-ring); }
.textarea { min-height: 120px; resize: vertical; }

/* IOC table */
.table-wrap { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; }
table.ioc { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.ioc th { text-align: left; font-family: var(--font-display); font-size: var(--text-xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-faint); background: var(--bg-sunken); padding: 10px 14px; font-weight: var(--fw-regular); }
table.ioc td { padding: 10px 14px; border-top: 1px solid var(--border-subtle); color: var(--text-body); }
table.ioc td.mono { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-strong); }

/* publications */
.pub-featured { display: grid; grid-template-columns: 1fr 1fr; min-height: 320px; }
.pub-featured__art { background: var(--bg-sunken); border-right: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: center; }
.pub-featured__body { padding: var(--space-6); display: flex; flex-direction: column; }
.pub-title { font-family: var(--font-mono); font-weight: var(--fw-semibold); color: var(--text-strong); }
.pub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.pub-card__thumb { aspect-ratio: 16/9; background: var(--bg-sunken); display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); margin-bottom: var(--space-3); }
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.filter { border: 1px solid var(--border-default); border-radius: var(--radius-pill); padding: 5px 14px; font-size: var(--text-xs); color: var(--text-muted); background: transparent; cursor: pointer; font-family: var(--font-body); font-weight: var(--fw-semibold); }
.filter.is-active { background: var(--brand); color: var(--text-on-brand); border-color: var(--brand); }
.badge-list { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }

/* article body */
.article-body { max-width: var(--container-narrow); }
.article-body h2 { font-size: var(--text-xl); margin-top: var(--space-7); }
.article-body h3 { margin-top: var(--space-6); }
.article-body p, .article-body li { font-size: var(--text-base); line-height: var(--leading-relaxed); color: var(--text-body); }
.article-body pre { background: var(--bg-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-4); overflow-x: auto; }
.article-body img { border-radius: var(--radius-md); margin: var(--space-5) 0; }
.article-meta { display: flex; gap: var(--space-4); align-items: center; color: var(--text-muted); font-size: var(--text-sm); margin-bottom: var(--space-5); flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border-subtle); background: var(--bg-page); margin-top: var(--space-8); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-6); padding: var(--space-7) 0; }
.footer-col h4 { font-family: var(--font-display); text-transform: uppercase; font-size: var(--text-xs); letter-spacing: var(--tracking-label); color: var(--text-faint); margin-bottom: var(--space-3); }
.footer-col a { display: block; color: var(--text-muted); font-size: var(--text-sm); text-decoration: none; padding: 4px 0; }
.footer-col a:hover { color: var(--brand); text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--border-subtle); }
.footer-bottom .container { padding-top: var(--space-4); padding-bottom: var(--space-4); font-size: var(--text-xs); color: var(--text-faint); }
.footer-brand p { font-size: var(--text-sm); color: var(--text-muted); max-width: 34ch; margin-top: var(--space-4); }

/* private badge */
.private-note { color: var(--accent); font-size: var(--text-sm); font-weight: var(--fw-semibold); display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__grid, .split { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .pub-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .steps--row { grid-auto-flow: row; }
  .pub-featured { grid-template-columns: 1fr; }
  .pub-featured__art { min-height: 160px; border-right: 0; border-bottom: 1px solid var(--border-subtle); }
}
@media (max-width: 640px) {
  .hero h1 { font-size: var(--text-3xl); }
  .page-hero h1 { font-size: var(--text-2xl); }
  .nav, .header-actions .btn { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.is-open { display: flex; position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0; background: var(--bg-page); border-bottom: 1px solid var(--border-subtle); padding: var(--space-3) var(--space-5); z-index: 60; }
  .nav.is-open a { padding: 12px 0; border-bottom: 1px solid var(--border-subtle); }
  .grid-2, .grid-3, .grid-4, .grid-5, .pub-grid, .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-5); }
  .stat-row { gap: var(--space-5); }
  .section { padding: var(--space-7) 0; }
  .cta-band { padding: var(--space-7) var(--space-5); }
  .panel { padding: var(--space-5); }
}
