/* ============================================================
   resonance — site web du TIPE (landing · supports · wiki)
   Registre du deck : sobre, scientifique. Inter + Fraunces,
   teal / crème / corail. Autonome : fontes + KaTeX en local.
   Système de design hérité de presentation/assets/css/deck.css.
   ============================================================ */

/* ---------- Fontes locales (variable woff2) ---------- */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-wght.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

/* ---------- Jetons de design (miroir du deck) ---------- */
:root {
  --paper:      #f4f1ea;
  --paper-2:    #ece7dc;
  --card:       #ffffff;
  --ink:        #18222f;
  --ink-soft:   #51617a;
  --ink-faint:  #8a93a3;
  --line:       #e0dacd;
  --line-soft:  #ece8de;

  --brain:      #15808d;   /* teal — structure / viscoélastique / calme */
  --brain-deep: #0d5560;
  --brain-tint: #dcecee;
  --brain-tint2:#eef6f7;

  --accent:     #e0533d;   /* corail — résonance, pic, danger */
  --accent-deep:#b53a27;
  --accent-tint:#fbe4de;

  --amber:      #e3a13a;
  --amber-tint: #f8edd6;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 14px;
  --maxw: 880px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 15% -10%, #fbfaf6 0%, transparent 60%),
    radial-gradient(1100px 800px at 110% 120%, var(--brain-tint2) 0%, transparent 55%),
    var(--paper-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---------- Barre de navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 22px;
  padding: 13px clamp(18px, 5vw, 60px);
  background: rgba(244,241,234,.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brain) 0%, var(--brain-deep) 45%, var(--accent) 100%);
}
.topbar .brand {
  font-family: var(--serif); font-weight: 600; font-size: 18px;
  letter-spacing: -.01em; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
}
.topbar .brand .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4bb3bf, var(--brain-deep));
  box-shadow: 0 0 0 3px var(--brain-tint);
}
.topbar nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a {
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  text-decoration: none; padding: 7px 13px; border-radius: 9px;
  transition: background .15s, color .15s;
}
.topbar nav a:hover { background: var(--brain-tint); color: var(--brain-deep); }
.topbar nav a.is-active { background: var(--ink); color: #fff; }

/* ---------- Conteneur de page ---------- */
main.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 44px clamp(18px, 5vw, 40px) 90px;
}
main.wrap.wide { max-width: 1040px; }

/* ---------- Fil d'Ariane ---------- */
.crumbs { font-size: 13px; color: var(--ink-faint); margin: 0 0 22px; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--brain-deep); text-decoration: underline; }
.crumbs .sep { margin: 0 8px; color: #c2bba9; }

/* ---------- Typographie de document ---------- */
h1.page-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 5vw, 42px); line-height: 1.08;
  letter-spacing: -.02em; margin: 0 0 14px; color: var(--ink);
}
h1.page-title em { font-style: italic; color: var(--brain-deep); }
.subtitle {
  font-size: clamp(17px, 2.4vw, 20px); color: var(--ink-soft);
  line-height: 1.5; margin: 0 0 30px; max-width: 640px;
}
h2.sec {
  font-family: var(--serif); font-weight: 600; font-size: 25px;
  letter-spacing: -.01em; color: var(--ink); margin: 46px 0 16px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
h2.sec:first-of-type { margin-top: 30px; }
h3.subsec {
  font-family: var(--sans); font-weight: 700; font-size: 14px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--brain-deep);
  margin: 26px 0 10px;
}
p { margin: 0 0 13px; line-height: 1.62; }
.lead { font-size: 18px; color: var(--ink-soft); }
a.inline { color: var(--brain-deep); text-decoration: underline; text-underline-offset: 2px; }
a.inline:hover { color: var(--accent-deep); }
strong, b { color: var(--ink); font-weight: 700; }
em, i { color: inherit; }
.hl-accent { color: var(--accent-deep); font-weight: 700; }
.hl-brain { color: var(--brain-deep); font-weight: 700; }
.hl { background: linear-gradient(transparent 58%, var(--amber-tint) 58%); padding: 0 2px; font-weight: 700; color: var(--ink); }

ul, ol { margin: 0 0 14px; padding-left: 0; }
ul.clean { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 9px; }
ul.clean li { position: relative; padding-left: 22px; line-height: 1.5; }
ul.clean li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 8px; height: 8px; border-radius: 2px; background: var(--brain);
  transform: rotate(45deg);
}
ul.clean.accent li::before { background: var(--accent); }
ol.steps { padding-left: 22px; }
ol.steps li { margin-bottom: 8px; line-height: 1.55; }

/* ---------- Cartes ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: 0 1px 0 rgba(20,30,45,.02);
}
.card.tint-brain { background: var(--brain-tint2); border-color: #cfe3e5; }
.card.tint-accent { background: var(--accent-tint); border-color: #f3cabf; }
.card.tint-amber { background: var(--amber-tint); border-color: #eedcb4; }
.card-title {
  font-weight: 700; font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brain-deep); margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.card-title.accent { color: var(--accent-deep); }
.card-title .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brain); }
.card-title.accent .dot { background: var(--accent); }

/* ---------- Grilles ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- Bandeau "porteur d'idée" ---------- */
.thesis-strip {
  background: var(--ink); color: #f4f1ea; border-radius: var(--radius);
  padding: 22px 26px; font-size: 17px; line-height: 1.5;
  display: flex; gap: 16px; align-items: flex-start; margin: 8px 0 4px;
}
.thesis-strip .mark { font-family: var(--serif); font-size: 30px; color: var(--accent); line-height: 1; }
.thesis-strip b { color: #fff; }
.thesis-strip .em { color: var(--amber); font-style: italic; font-family: var(--serif); }

/* ---------- Métriques ---------- */
.metrics { display: flex; gap: 16px; flex-wrap: wrap; margin: 18px 0; }
.metric { flex: 1 1 180px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.metric .v { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1; color: var(--accent-deep); letter-spacing: -.01em; }
.metric .v.brain { color: var(--brain-deep); }
.metric .l { font-size: 13px; color: var(--ink-soft); margin-top: 8px; line-height: 1.4; }

/* ---------- Équations ---------- */
.eq {
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--brain); border-radius: 10px;
  padding: 14px 18px; margin: 14px 0; overflow-x: auto;
}
.eq.accent { border-left-color: var(--accent); }
.eq .note { font-size: 13px; color: var(--ink-faint); margin-top: 8px; line-height: 1.4; }

/* ---------- Avertissement honnêteté ---------- */
.honesty {
  border-left: 4px solid var(--accent); background: var(--accent-tint);
  border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 18px 0;
  font-size: 15px; color: var(--ink); line-height: 1.55;
}
.honesty .h-tag {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent-deep);
  margin-right: 8px;
}

/* ---------- Listes de liens (supports, concepts) ---------- */
ul.linklist { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
ul.linklist li { border-bottom: 1px solid var(--line); }
ul.linklist li a {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 15px 6px; text-decoration: none; color: var(--ink);
  transition: background .12s;
}
ul.linklist li a:hover { background: var(--brain-tint2); }
ul.linklist .lk-title { font-weight: 700; font-size: 16px; }
ul.linklist .lk-meta { color: var(--ink-soft); font-size: 14px; line-height: 1.4; flex: 1 1 100%; margin-top: 2px; }
ul.linklist .lk-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brain-deep); background: var(--brain-tint); border-radius: 999px;
  padding: 3px 10px; white-space: nowrap;
}
ul.linklist .lk-badge.pdf { color: var(--accent-deep); background: var(--accent-tint); }
ul.linklist .lk-badge.html { color: var(--brain-deep); background: var(--brain-tint); }

/* ---------- Cartes-supports (avec téléchargement) ---------- */
.support {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 16px;
  align-items: center; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px;
  text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s;
}
.support:hover { border-color: var(--brain); box-shadow: 0 8px 26px -18px rgba(20,30,45,.4); }
.support .ic {
  width: 46px; height: 56px; border-radius: 7px; position: relative;
  background: linear-gradient(160deg, #fff 0%, #f1ede2 100%);
  border: 1px solid var(--line); display: grid; place-items: end center;
  overflow: hidden;
}
.support .ic .corner {
  position: absolute; top: 0; right: 0; width: 16px; height: 16px;
  background: linear-gradient(225deg, var(--line) 50%, transparent 50%);
}
.support .ic .kind {
  font-size: 9px; font-weight: 800; letter-spacing: .06em; color: #fff;
  background: var(--accent); width: 100%; text-align: center; padding: 2px 0;
}
.support .ic.is-html .kind { background: var(--brain); }
.support .s-title { font-weight: 700; font-size: 16px; line-height: 1.25; }
.support .s-meta { font-size: 13.5px; color: var(--ink-soft); margin-top: 3px; line-height: 1.45; }
.support .s-go {
  font-size: 13px; font-weight: 700; color: var(--brain-deep);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.support:hover .s-go { color: var(--accent-deep); }

/* ---------- Aperçu PDF embarqué ---------- */
.pdf-embed {
  width: 100%; height: 78vh; min-height: 520px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); margin: 8px 0 6px;
}
.embed-note { font-size: 13px; color: var(--ink-faint); margin: 0 0 24px; }

/* ---------- Glossaire / concepts ---------- */
.concept-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.concept-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; transition: border-color .15s, transform .12s;
}
.concept-card:hover { border-color: var(--brain); transform: translateY(-2px); }
.concept-card .c-term { font-weight: 700; font-size: 15.5px; color: var(--ink); }
.concept-card .c-term .sym { color: var(--accent-deep); font-family: var(--serif); font-style: italic; }
.concept-card .c-gloss { font-size: 13px; color: var(--ink-soft); margin-top: 4px; line-height: 1.4; }

.family-head {
  font-family: var(--serif); font-weight: 600; font-size: 22px;
  color: var(--brain-deep); margin: 40px 0 14px;
}

/* fiche concept individuelle */
.concept-row { margin: 16px 0; }
.concept-row .lbl {
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 4px;
}
.concept-row.def .lbl { color: var(--brain-deep); }
.concept-row.img .lbl { color: var(--amber); }
.concept-row.lien .lbl { color: var(--accent-deep); }

.term-nav { display: flex; justify-content: space-between; gap: 14px; margin-top: 46px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.term-nav a { color: var(--brain-deep); text-decoration: none; font-weight: 600; }
.term-nav a:hover { color: var(--accent-deep); text-decoration: underline; }
.term-nav .nv-empty { color: var(--ink-faint); }

/* ---------- Encadré code/schéma ASCII ---------- */
pre.ascii {
  background: var(--ink); color: #e9e4d6; border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.45;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; margin: 16px 0;
}

/* ---------- Hero landing ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
  margin: 14px 0 24px;
}
.hero .eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--brain-deep); margin-bottom: 14px; display: flex; align-items: center; gap: 12px;
}
.hero .eyebrow .line { height: 1px; width: 40px; background: var(--brain); }
.hero img.hero-img {
  width: 100%; height: auto; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: 0 18px 50px -28px rgba(20,30,45,.5);
}
.hero .byline { font-size: 14px; color: var(--ink-faint); margin-top: 18px; }
.hero .byline b { color: var(--ink-soft); }

/* ---------- Pied de page ---------- */
footer.site {
  max-width: var(--maxw); margin: 0 auto; padding: 26px clamp(18px,5vw,40px) 50px;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-faint); line-height: 1.6;
}
footer.site b { color: var(--ink-soft); }
footer.site a { color: var(--brain-deep); text-decoration: none; }
footer.site a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .hero .order-img { order: -1; }
  .support { grid-template-columns: 40px 1fr; }
  .support .s-go { grid-column: 2; justify-self: start; margin-top: 2px; }
  .topbar nav a { padding: 6px 9px; }
}
