/* Generated by scripts/bundle_css.sh — do not edit. Source: style.css @imports. */

/* --- variables.css --- */
/* Variables et base — chargé en premier */
/* Academic site — blue-dominant, two-column layout */

:root {
  --bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #1e40af;
  --accent-light: #3b82f6;
  --accent-soft: #dbeafe;
  --border: #e2e8f0;
  --tag-bg: #eff6ff;
  --tag-text: #1e40af;
  --header-border: #e2e8f0;
  --content-max: 1200px;
  --page-padding-x: 2rem;
  /* Fixed header clearance on small screens (single-row bar; keep in sync with scroll-margin) */
  --site-header-offset-mobile: 4.5rem;
  /* Police script informatique (monospace) pour titres et cohérence du site */
  --font-script: ui-monospace, "Cascadia Code", "Source Code Pro", "Fira Code", Menlo, monospace;
  /* CharlesGPT — token cycle (light UI: dark text on pastel) */
  --chat-token-0-bg: #eff6ff;
  --chat-token-1-bg: #fdf2f8;
  --chat-token-2-bg: #ecfdf3;
  --chat-token-3-bg: #fefce8;
  --chat-token-4-bg: #f9f5ff;
  --chat-token-5-bg: #fff7ed;
  --chat-token-unsure-0-bg: #7dd3fc;
  --chat-token-unsure-1-bg: #f9a8d4;
  --chat-token-unsure-2-bg: #86efac;
  --chat-token-unsure-3-bg: #fde047;
  --chat-token-unsure-4-bg: #d8b4fe;
  --chat-token-unsure-5-bg: #fdba74;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #60a5fa;
  --accent-light: #93c5fd;
  --accent-soft: #1e3a5f;
  --border: #334155;
  --tag-bg: #1e3a5f;
  --tag-text: #93c5fd;
  --header-border: #334155;
  /* CharlesGPT — token cycle (dark UI: light text on saturated dark chips) */
  --chat-token-0-bg: #1e3a5f;
  --chat-token-1-bg: #4a1942;
  --chat-token-2-bg: #14532d;
  --chat-token-3-bg: #422006;
  --chat-token-4-bg: #2e1065;
  --chat-token-5-bg: #431407;
  --chat-token-unsure-0-bg: #075985;
  --chat-token-unsure-1-bg: #9d174d;
  --chat-token-unsure-2-bg: #166534;
  --chat-token-unsure-3-bg: #a16207;
  --chat-token-unsure-4-bg: #5b21b6;
  --chat-token-unsure-5-bg: #9a3412;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-script), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- glider-background.css --- */
/* Site-wide Game of Life glider — fixed layer behind content */
#site-glider-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* --- header.css --- */
/* Header, nav, langue, thème */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr auto;
  align-items: center;
  gap: 0.75rem;
  /* Slightly inset from viewport edge; a bit more left padding so logo/title aren’t flush */
  padding-left: max(0.65rem, calc((100vw - var(--content-max)) / 2 + 0.65rem));
  padding-right: max(0.5rem, calc((100vw - var(--content-max)) / 2 + 0.5rem));
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  background: var(--bg);
  border-bottom: 1px solid var(--header-border);
}

body {
  padding-top: 3rem;
}

.site-header .header-left {
  grid-column: 1;
  justify-self: start;
  min-width: 0;
  max-width: 100%;
}

.site-header .header-nav {
  grid-column: 2;
  justify-self: center;
}

.site-header .menu-toggle {
  grid-column: 2;
  justify-self: end;
}

.site-header .header-right-actions {
  grid-column: 3;
  justify-self: end;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

a.header-left:hover .header-title,
a.header-left:hover .header-tagline {
  opacity: 0.85;
}

.logo-icon {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-titles {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1 1 auto;
}

/* Each line stays single-line on all viewports (narrow phones, large desktops) */
.header-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.header-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.header-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.35rem 0;
}

.header-nav a:hover {
  color: var(--accent);
}

.header-nav .nav-link-open-to {
  word-spacing: -0.12em;
}

.nav-misc-wrap {
  position: relative;
  display: inline-block;
}

.nav-misc-trigger {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  padding: 0.35rem 0;
  font-family: inherit;
}

.nav-misc-trigger:hover {
  color: var(--accent);
}

.nav-misc-arrow {
  font-size: 0.65rem;
  opacity: 0.8;
  transition: transform 0.2s;
}

.nav-misc-wrap.open .nav-misc-arrow {
  transform: rotate(180deg);
}

.nav-misc-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 10rem;
  display: none;
  z-index: 200;
  padding: 0.25rem 0;
}

[data-theme="dark"] .nav-misc-dropdown {
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.nav-misc-wrap.open .nav-misc-dropdown {
  display: block;
}

.nav-misc-dropdown a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.nav-misc-dropdown a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Language dropdown: only shown on home; reserve space when hidden so nav links don't shift */
.lang-switcher-wrap {
  visibility: hidden;
  width: 3.5rem;
  min-width: 3.5rem;
  pointer-events: none;
}

body.is-home .lang-switcher-wrap {
  visibility: visible;
  pointer-events: auto;
}

.lang-switcher-wrap--menu {
  width: 100%;
  min-width: 0;
}

body:not(.is-home) .lang-switcher-wrap--menu {
  display: none;
}

.mobile-nav-utilities {
  border-top: 1px solid var(--border);
  margin-top: 0.35rem;
  padding: 0.5rem 0.75rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.mobile-nav-utilities .lang-switcher {
  width: 100%;
}

.mobile-nav-utilities .lang-switcher-trigger {
  width: 100%;
  justify-content: space-between;
}

.mobile-nav-utilities .theme-toggle {
  align-self: flex-start;
  padding: 0.45rem 0.5rem;
}

.lang-switcher {
  position: relative;
  display: inline-block;
}

.lang-switcher-trigger {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
  min-width: 2.5rem;
}

.lang-switcher-trigger:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lang-switcher-arrow {
  font-size: 0.7rem;
  opacity: 0.8;
  transition: transform 0.2s;
}

.lang-switcher.open .lang-switcher-arrow {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 8rem;
  display: none;
  z-index: 200;
}

[data-theme="dark"] .lang-dropdown {
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.lang-switcher.open .lang-dropdown {
  display: block;
}

.lang-dropdown button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
  text-align: left;
}

.lang-dropdown button:hover,
.lang-dropdown button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
}

.theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.theme-icon svg {
  display: block;
}
.theme-icon-sun { display: none; }
.theme-icon-moon { display: inline-flex; }
[data-theme="dark"] .theme-icon-sun { display: inline-flex; }
[data-theme="dark"] .theme-icon-moon { display: none; }

/* ----- Mobile: dropdown nav next to flags (replaces hamburger + full-width nav) ----- */
.mobile-nav-wrap {
  display: none;
}

.mobile-nav-trigger {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-family: inherit;
}

.mobile-nav-trigger:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mobile-nav-wrap.open .mobile-nav-trigger {
  border-color: var(--accent);
  color: var(--accent);
}

.mobile-nav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 11rem;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  display: none;
  z-index: 200;
  padding: 0.25rem 0;
}

[data-theme="dark"] .mobile-nav-dropdown {
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.mobile-nav-wrap.open .mobile-nav-dropdown {
  display: block;
}

.mobile-nav-dropdown > a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.mobile-nav-dropdown > a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Nested Misc. cascade */
.mobile-nav-misc-wrap {
  position: relative;
}

.mobile-nav-misc-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  font-family: inherit;
}

.mobile-nav-misc-trigger:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.mobile-nav-misc-arrow {
  font-size: 0.65rem;
  opacity: 0.8;
  transition: transform 0.2s;
}

.mobile-nav-misc-wrap.open .mobile-nav-misc-arrow {
  transform: rotate(90deg);
}

.mobile-nav-misc-dropdown {
  display: none;
  padding-left: 0.5rem;
  border-left: 2px solid var(--border);
  margin-left: 0.75rem;
  margin-bottom: 0.25rem;
}

.mobile-nav-misc-wrap.open .mobile-nav-misc-dropdown {
  display: block;
}

.mobile-nav-misc-dropdown a {
  display: block;
  padding: 0.4rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.mobile-nav-misc-dropdown a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 768px) {
  body {
    padding-top: var(--site-header-offset-mobile, 4.5rem);
  }

  .site-header {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    padding-left: max(0.45rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.2rem, env(safe-area-inset-right, 0px));
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    column-gap: 0.2rem;
    row-gap: 0;
  }

  .site-header .header-left {
    grid-column: 1;
    grid-row: 1;
    justify-self: stretch;
    min-width: 0;
    max-width: 100%;
    gap: 0.3rem;
  }

  .site-header .header-right-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    width: auto;
    flex-shrink: 0;
    justify-content: flex-end;
  }

  .logo-icon {
    width: 28px;
    height: 28px;
  }

  .header-title {
    font-size: 0.95rem;
  }

  .header-tagline {
    font-size: 0.62rem;
    letter-spacing: -0.025em;
  }

  .menu-toggle {
    display: none;
  }

  .header-nav {
    display: none;
  }

  .mobile-nav-wrap {
    display: block;
    position: relative;
  }

  .mobile-nav-trigger {
    box-sizing: border-box;
    min-width: 2.5rem;
    min-height: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.05rem;
    line-height: 1;
  }

  .header-right-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .header-bar-only {
    display: none !important;
  }
}

/* Desktop / tablet: cap title block; reserve a bit less for nav/actions (tighter header padding) */
@media (min-width: 769px) {
  .site-header .header-left {
    max-width: min(36rem, calc(100vw - 18.5rem));
  }
}

.menu-toggle {
  display: none;
}

/* --- layout.css --- */
/* Page wrapper, grille layout, contenu principal, sections */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----- Page content wrapper (grows to push footer down) ----- */
.page-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Home: espace au-dessus du bloc de texte */
body.is-home .content {
  padding-top: 1.25rem;
}

/* ----- Layout ----- */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem var(--page-padding-x);
  width: 100%;
}

/* About CharlesGPT: full-width content, no sidebar (more room for explanations/sketches) */
.page-no-sidebar .layout {
  grid-template-columns: 1fr;
}
.page-no-sidebar #site-sidebar {
  display: none;
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1.5rem;
  }
}

/* ----- Main content ----- */
.content {
  min-width: 0;
}

.section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-icon {
  font-size: 1.2rem;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
}

.section-subtitle a {
  color: var(--accent);
  text-decoration: none;
}

.section-subtitle a:hover {
  text-decoration: underline;
}

.content p {
  margin: 0 0 0.75rem 0;
  color: var(--text);
}

.content a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.content a:hover {
  text-decoration: underline;
}

.content strong {
  font-weight: 700;
  color: var(--text);
}

.content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  margin: 1.5rem 0 0.5rem 0;
}

.content h3:first-of-type {
  margin-top: 0.5rem;
}

.about-lead {
  margin-bottom: 1rem;
}
.about-lead a {
  font-weight: 700;
}

/* About CharlesGPT: sticky title + plan on scroll (below site header) */
.about-page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
@media (min-width: 769px) {
  .about-page-header {
    top: 3rem;
  }
}

.section-title--centered {
  text-align: center;
}

.about-plan {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0 0.75rem;
  margin: 1.25rem 0 0 0;
  padding: 0;
  font-size: 0.9rem;
}
.about-plan a {
  white-space: nowrap;
  font-weight: 400;
  text-decoration: none;
  color: var(--accent);
}
.about-plan a.is-active {
  font-weight: 700;
}
.about-plan a:hover {
  text-decoration: underline;
}
@media (max-width: 640px) {
  .about-plan {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.75rem;
  }
}

/* Scroll margin so anchored h3s don’t sit under fixed header */
/* Inline reference links [1], [2] in about page */
.ref-inline {
  font-size: 0.85em;
  font-weight: 600;
  text-decoration: none;
}
.ref-inline:hover {
  text-decoration: underline;
}

.references-list li[id] {
  scroll-margin-top: 6rem;
}

.section-about-charlesgpt h3[id],
.section-about-tipe h3[id] {
  scroll-margin-top: 6rem;
}

/* TIPE project page: theorem box + figure grid */
.tipe-result-box {
  border: 2px solid var(--border, #e2e8f0);
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.25rem 0;
  border-radius: 8px;
  background: var(--bg-muted, #f8fafc);
}

[data-theme="dark"] .tipe-result-box {
  background: var(--bg-muted, #1e293b);
}

.tipe-figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
  align-items: start;
}

/* TIPE “Simple modeling”: 2-up, then wide rule strip, then narrow centered image + full-width caption */
.tipe-modeling-gallery {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1rem 0;
}

.tipe-modeling-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 560px) {
  .tipe-modeling-pair {
    grid-template-columns: 1fr;
  }
}

.tipe-figure--modeling-large {
  margin: 0;
}

.tipe-figure--modeling-large img {
  width: 100%;
  max-width: min(100%, 920px);
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.tipe-figure--modeling-density {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  max-width: 100%;
}

.tipe-figure-img-center {
  max-width: min(200px, 70%);
}

.tipe-figure-img-center img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
}

.tipe-figure--modeling-density figcaption {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  margin-top: 0.5rem;
  text-align: left;
}

.tipe-figure {
  margin: 0;
}

.tipe-figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
}

.tipe-figure figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
  line-height: 1.4;
}

.tipe-figure--wide {
  grid-column: 1 / -1;
  max-width: min(100%, 720px);
  margin-left: auto;
  margin-right: auto;
}

.content table,
.content-table {
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.95rem;
}

.content th,
.content td,
.content-table th,
.content-table td {
  border: 1px solid var(--border, #ddd);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.content th,
.content-table th {
  background: var(--bg-muted, #f5f5f5);
  font-weight: 600;
}

.about-sketch {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-muted, rgba(0,0,0,0.04));
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-x: auto;
  white-space: pre;
}

/* Interactive architecture diagram: viewport with zoom and pan */
.about-arch-diagram-viewport {
  position: relative;
  margin: 0.75rem 0;
  height: 520px;
  max-width: 100%;
  overflow: hidden;
  background: var(--bg-muted, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.about-arch-diagram-viewport:active {
  cursor: grabbing;
}

.about-arch-diagram-content {
  position: absolute;
  left: 0;
  top: 0;
  width: 420px;
  height: 520px;
  transform-origin: 0 0;
  will-change: transform;
  pointer-events: none;
}

.about-arch-svg {
  display: block;
  width: 420px;
  height: 520px;
}

.about-arch-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 280px;
  padding: 8px 10px;
  font-size: 0.8rem;
  line-height: 1.4;
  background: var(--bg, #fff);
  border: 1px solid var(--border, #94a3b8);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}

.about-arch-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

.about-arch-tooltip-title {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--accent, #1e40af);
}

.about-arch-tooltip-body {
  font-size: 0.75rem;
  color: var(--text, #334155);
}

.about-arch-tooltip-body strong {
  color: var(--text, #1e293b);
}

.about-arch-reset-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 6px 12px;
  font-size: 0.8rem;
  background: var(--bg, #fff);
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  z-index: 2;
}

.about-arch-reset-btn:hover {
  background: var(--bg-muted, #f1f5f9);
  border-color: var(--accent, #3b82f6);
}

.about-formula {
  margin: 0.75rem 0;
  padding: 0.5rem 0.75rem;
  background: var(--bg-muted, rgba(0,0,0,0.04));
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* KaTeX-rendered blocks (CharlesGPT about) */
.about-formula.about-formula--latex {
  font-family: inherit;
  font-size: inherit;
  text-align: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.9rem 1rem 1rem;
}

.about-formula.about-formula--latex .katex-display {
  margin: 0;
}

.about-formula.about-formula--latex .katex {
  font-size: 1.05em;
}

@media (max-width: 640px) {
  .about-formula.about-formula--latex .katex {
    font-size: 0.95em;
  }
}

.content-resume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.content-resume .resume-line-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--accent);
}

/* Paper list */
.paper-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.paper-item {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.paper-item:last-child {
  border-bottom: none;
}

.paper-authors {
  font-weight: 600;
  color: var(--text);
}

.paper-item a {
  color: var(--accent);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 4px;
  font-weight: 500;
}

/* --- footer.css --- */
/* Footer — sticks to bottom via body flex */

body.page-no-footer .site-footer-group {
  display: none !important;
}

:root {
  --footer-bg: #0c2560;
  --footer-text: #e2e8f0;
  --footer-link: #93c5fd;
  --footer-bar-height: 3.5rem;
}

[data-theme="dark"] {
  --footer-bg: #0a1a3d;
  --footer-text: #cbd5e1;
  --footer-link: #93c5fd;
}

.site-footer-group {
  position: relative;
  margin-top: auto;
  flex-shrink: 0;
  overflow: visible;
}

.site-footer {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  min-height: var(--footer-bar-height);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 2rem;
  font-size: 0.85rem;
  line-height: 1.35;
  background: var(--footer-bg, #0c2560);
  color: var(--footer-text, #e2e8f0);
}

.site-footer-build {
  margin: 0;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--footer-link, #93c5fd);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Pieuvre (PNG transparent) ancrée au footer, défile avec la page */
.site-footer-octo {
  position: absolute;
  left: 0;
  bottom: 100%;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  line-height: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.site-footer-group.site-footer--octo-visible .site-footer-octo,
.site-footer-octo.is-visible {
  visibility: visible;
}

.site-footer-octo img {
  display: block;
  width: clamp(14rem, 36vw, 28rem);
  height: auto;
  max-width: none;
  opacity: 0.88;
  filter: contrast(1.35);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}

[data-theme="dark"] .site-footer-octo img {
  filter: brightness(2.65) contrast(1.08);
  opacity: 0.72;
}

.site-footer-octo--broken::after {
  content: "";
  display: block;
  width: 4rem;
  height: 4rem;
  background: #64748b;
  opacity: 0.35;
  border-radius: 50%;
}

.site-footer-octo--broken img {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .site-footer-octo {
    transition: none;
  }
}

@media (max-width: 768px) {
  :root {
    --footer-bar-height: 3.25rem;
  }

  .site-footer {
    padding: 0 1rem;
    font-size: 0.8rem;
  }

  .site-footer-octo img {
    width: clamp(10rem, 52vw, 18rem);
  }
}

/* --- legal.css --- */
/* Legal / Privacy: address block */

.content .legal-address {
  margin: 0.5rem 0 1rem 0;
  padding-left: 0.5rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- technical.css --- */
/* Technical page: static world map (no tiles, no external copyright) */

.technical-map-subtext {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.75rem 0 0 0;
}
.technical-map {
  width: 100%;
  max-width: 800px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 1rem 0;
  background: var(--bg);
}
.technical-map-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 400px;
}
.technical-map-legend {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.technical-map-error {
  padding: 2rem;
  color: var(--text-muted);
}

/* Link graph (force-directed) */
.technical-link-graph {
  width: 100%;
  max-width: 800px;
  height: 400px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1rem 0;
  background: var(--bg);
  overflow: hidden;
}

.technical-link-graph-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.technical-link-graph .link-graph-node text {
  pointer-events: none;
  user-select: none;
}

.technical-link-graph .link-graph-node {
  cursor: grab;
}

.technical-link-graph .link-graph-node:active {
  cursor: grabbing;
}

.technical-link-graph-error {
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Personal note (vibe coding / AI-assisted dev) */
#about-development {
  margin-top: 2rem;
}
.technical-about-dev {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 52rem;
  margin: 0.5rem 0 0 0;
}
.technical-about-dev + .technical-about-dev {
  margin-top: 0.85rem;
}
.technical-about-dev strong {
  color: var(--text);
  font-weight: 600;
}

/* --- bio.css --- */
/* CV / Bio: liens d'ancrage + blocs + vidéo */

#bio-section {
  scroll-margin-top: 5.5rem;
}

.bio-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.75rem;
  margin-bottom: 1.5rem;
}


.bio-nav-link {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.bio-nav-link:hover,
.bio-nav-link.is-active {
  text-decoration: underline;
}

.bio-nav-sep {
  color: var(--text-muted);
  font-weight: 400;
  user-select: none;
}

.cv-block {
  display: none;
  margin-bottom: 0;
  scroll-margin-top: 5.5rem;
}

@media (max-width: 768px) {
  #bio-section {
    padding-top: 0.5rem;
    scroll-margin-top: var(--site-header-offset-mobile, 4.5rem);
  }

  .cv-block {
    scroll-margin-top: var(--site-header-offset-mobile, 4.5rem);
  }
}

.cv-block.is-visible {
  display: block;
}

.cv-block .cv-section-body {
  padding: 0;
}

.cv-block .cv-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.cv-block .cv-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

#education .cv-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

#education .cv-item-logo {
  flex-shrink: 0;
  width: 36px;
  height: auto;
  object-fit: contain;
  margin-top: 0.2em;
}

#education .cv-item-logo--lg {
  width: 42px;
}

#education .cv-item-logo--xl {
  width: 51px;
}

#education .cv-item-inner {
  flex: 1;
  min-width: 0;
}

#education .cv-item-logo-wrap {
  width: 58px;
  flex-shrink: 0;
}

#education a.cv-item-logo-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  align-self: flex-start;
}

#education a.cv-item-logo-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

#education a.cv-item-logo-link:hover .cv-item-logo {
  opacity: 0.88;
}

.cv-item.is-hidden {
  display: none !important;
}

#professional-experience .cv-item:has(.cv-item-logo) {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

#professional-experience .cv-item-logo-wrap {
  width: 58px;
  flex-shrink: 0;
}

#professional-experience a.cv-item-logo-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  align-self: flex-start;
}

#professional-experience a.cv-item-logo-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

#professional-experience a.cv-item-logo-link:hover .cv-item-logo {
  opacity: 0.88;
}

#professional-experience .cv-item-logo {
  width: 36px;
  height: auto;
  object-fit: contain;
  margin-top: 0.2em;
}

#professional-experience .cv-item-logo--sm {
  width: 30px;
}

#professional-experience .cv-item-logo--lg {
  width: 42px;
}

#professional-experience .cv-item-logo--xl {
  width: 50px;
}

#professional-experience .cv-item-logo--xxl {
  width: 58px;
}

#professional-experience .cv-item-inner {
  flex: 1;
  min-width: 0;
}

.cv-block .cv-item-title {
  font-weight: 600;
  color: var(--text);
}

.cv-block .cv-item-meta,
.cv-block .cv-item-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.cv-block .cv-item-subtitle {
  font-style: italic;
}

.cv-block .cv-item-details {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0.35rem 0 0 0;
}

.cv-block ul {
  margin: 0.5rem 0 0 1.25rem;
  padding: 0;
}

.cv-block .cv-section-body > p {
  margin: 0 0 1rem 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.cv-block .cv-section-body > p:first-child {
  padding-top: 0;
  border-top: none;
}

.cv-block .cv-section-body > p:last-child {
  margin-bottom: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

#skills .skills-list {
  margin-bottom: 1rem;
}

#skills .skills-list:last-child {
  margin-bottom: 0;
}

/* Interests: sections escamotables (titre bleu + teaser blanc sous le titre, ou contenu détaillé si ouvert) */
.bio-interests-fold-wrap {
  margin-bottom: 0.5rem;
  border-radius: 6px;
  overflow: hidden;
}

.bio-interests-fold {
  margin-bottom: 0;
}

.bio-interests-fold-title {
  display: block;
  padding: 0.6rem 1rem;
  padding-left: 2.25rem;
  background: #1e3a8a;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
  position: relative;
  line-height: 1.35;
}

.bio-interests-fold-title .bio-interests-fold-hint {
  font-weight: 400;
  font-size: 0.82rem;
  opacity: 0.92;
  margin-left: 0.35rem;
}

.bio-interests-fold-title::-webkit-details-marker,
.bio-interests-fold-title::marker {
  display: none;
}

.bio-interests-fold-title::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  border-left: 5px solid #fff;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s ease;
}

.bio-interests-fold[open] .bio-interests-fold-title::before {
  transform: translateY(-50%) rotate(-90deg);
}

.bio-interests-fold-title:hover {
  background: #1e40af;
}

.bio-interests-fold[open] .bio-interests-fold-title {
  border-radius: 0;
}

.bio-interests-fold-body {
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border, #e2e8f0);
  border-top: none;
  border-radius: 0 0 6px 6px;
}

.bio-interests-fold-body p {
  margin: 0;
  padding: 0;
  border: none;
}

/* Sports: photo grid (Interests) */
.bio-sport-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
  margin-top: 1.1rem;
  max-width: 100%;
}

.bio-sport-photo-cell {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.bio-sport-photo-cell img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(260px, 46vw);
  object-fit: contain;
  border: none;
  border-radius: 0;
}

@media (max-width: 520px) {
  .bio-sport-photo-grid {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .bio-sport-photo-cell img {
    max-height: min(280px, 70vw);
  }
}

/* Teaser: même style que le corps détaillé, sous la barre bleue, masqué quand le volet est ouvert */
.bio-interests-fold-teaser {
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border, #e2e8f0);
  border-top: none;
  border-radius: 0 0 6px 6px;
}

.bio-interests-fold-teaser p {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 0.95rem;
  color: var(--text);
}

.bio-interests-fold-wrap details[open] + .bio-interests-fold-teaser {
  display: none;
}

.bio-video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  margin-top: 1.5rem;
}

.bio-video-wrap {
  margin: 0;
  max-width: none;
}

.bio-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  display: block;
  border-radius: 6px;
  background: var(--bg-muted, #1a1a1a);
  object-fit: cover;
  object-position: center;
}

.bio-video--bright {
  filter: brightness(1.35) contrast(1.08) saturate(1.05);
}

.bio-video--crop-right {
  object-position: 62% center;
}

.bio-video-caption {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 768px) {
  .bio-video-grid {
    grid-template-columns: 1fr;
  }
}

/* Interests: flex so raspberry sits low without forcing full viewport (keeps footer on screen) */
#interests .cv-section-body {
  display: flex;
  flex-direction: column;
  min-height: min(52vh, 28rem);
  padding-bottom: 1.5rem;
  box-sizing: border-box;
}

.bio-interests-raspberry-wrap {
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 1.25rem;
  padding-bottom: 0.25rem;
  text-align: center;
  flex-shrink: 0;
}

.bio-interests-raspberry {
  display: inline-block;
  width: min(76px, 20vw);
  height: auto;
  max-height: 76px;
  object-fit: contain;
  opacity: 0.78;
  cursor: pointer;
  filter: brightness(1.06);
}

.bio-interests-raspberry:fullscreen,
.bio-interests-raspberry:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #000;
  opacity: 1;
  filter: none;
}

/* Inline figure under a CV bullet (e.g. Hexaly slab packing) */
.cv-item-inline-figure {
  margin: 0.65rem 0 0 0;
  padding: 0;
  max-width: 100%;
}

.cv-item-inline-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* Hexaly: image centered at half content width; caption uses full line width */
.cv-item-inline-figure--hexaly {
  max-width: 100%;
  width: 100%;
}

.cv-item-inline-figure--hexaly .cv-item-inline-figure-img-wrap {
  width: 50%;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.cv-item-inline-figure--hexaly .cv-item-inline-figure-img-wrap img {
  width: 100%;
}

.cv-item-inline-figure-caption {
  margin: 0.4rem 0 0 0;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--text-muted);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.bio-interests-entrepreneurship-list {
  margin: 0;
  padding-left: 1.2rem;
}

.bio-interests-entrepreneurship-list li {
  margin-bottom: 0.85rem;
}

.bio-interests-entrepreneurship-list li:last-child {
  margin-bottom: 0;
}

.bio-tstart-media {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1rem;
  margin-top: 0.65rem;
  max-width: 100%;
}

.bio-tstart-media .bio-tstart-logo {
  flex: 0 0 auto;
  width: min(42%, 240px);
  max-width: 240px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}

.bio-tstart-media .bio-tstart-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.bio-tstart-media .bio-tstart-photo {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}

.bio-tstart-media .bio-tstart-photo img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  object-position: center;
  border: none;
  border-radius: 0;
}

@media (max-width: 520px) {
  .bio-tstart-media {
    flex-wrap: wrap;
    align-items: center;
  }

  .bio-tstart-media .bio-tstart-logo {
    width: min(60%, 200px);
    max-width: 200px;
    align-self: auto;
  }

  .bio-tstart-media .bio-tstart-photo {
    flex: 1 1 100%;
    align-self: auto;
  }
}

/* --- projects.css --- */
/* Projets / Fiche expériences */

html {
  scroll-padding-top: 3.25rem;
}

.experience-card {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

/* Align with fixed header (body padding-top: 3rem) — avoid oversized scroll-margin pushing cards too low */
.experience-card[id] {
  scroll-margin-top: 3.25rem;
}

@media (max-width: 768px) {
  .experience-card[id] {
    scroll-margin-top: 3.5rem;
  }
}

.experience-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.05rem;
}

.experience-card-title-accent {
  color: var(--accent);
}

.experience-card .exp-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.experience-card-ascii-logo {
  margin: 0.75rem 0;
  padding: 0;
  overflow-x: auto;
  white-space: pre;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.65rem;
  line-height: 1.2;
}

.experience-card-footer {
  margin: 0.75rem 0 0 0;
  text-align: right;
}

.experience-card-page-link {
  color: var(--accent, #2563eb);
  text-decoration: underline;
}

/* ModularyNN: centered architecture diagram, links to GitHub */
.experience-card-arch-wrap {
  margin: 0.75rem 0 0.5rem 0;
  text-align: center;
}

.experience-card-arch-link {
  display: inline-block;
  max-width: min(100%, 520px);
  line-height: 0;
}

.experience-card-arch-link:hover .experience-card-arch-img {
  opacity: 0.92;
}

.experience-card-arch-link:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 3px;
  border-radius: 6px;
}

.experience-card-arch-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  border: none;
  transition: opacity 0.15s ease;
}

.experience-card-arch-img--small {
  max-width: min(100%, 420px);
  margin: 0 auto;
}

/* KIRO card: poster preview left, objective snippet smaller on the right */
.experience-card-kiro-media {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.85rem 1rem;
  margin: 0.75rem 0 0.5rem 0;
  flex-wrap: wrap;
}

.experience-card-kiro-preview-wrap {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(46.5%, 240px);
}

.experience-card-kiro-preview-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.experience-card-kiro-obj-wrap {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(48%, 267px);
}

.experience-card-kiro-obj-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.experience-card-kiro-obj-img + .experience-card-kiro-obj-img {
  margin-top: 0.65rem;
}

@media (max-width: 520px) {
  .experience-card-kiro-media {
    flex-direction: column;
    align-items: center;
  }

  .experience-card-kiro-preview-wrap {
    max-width: min(100%, 210px);
  }

  .experience-card-kiro-obj-wrap {
    max-width: min(100%, 240px);
  }
}

.experience-card-poster-duo {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.25rem;
  margin: 0.65rem 0 0.4rem 0;
  flex-wrap: wrap;
}

.experience-card-poster-duo-item {
  flex: 0 1 auto;
  margin: 0;
  text-align: center;
}

.experience-card-poster-duo-item--poster {
  max-width: min(100%, 208px);
}

.experience-card-poster-duo-item--slides {
  max-width: min(100%, 250px);
}

.experience-card-venue-note {
  margin: 0.25rem 0 0 0;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted, #64748b);
}

@media (max-width: 520px) {
  .experience-card-poster-duo-item--poster {
    max-width: min(100%, 208px);
  }

  .experience-card-poster-duo-item--slides {
    max-width: min(100%, 250px);
  }
}

.experience-card-poster-wrap {
  margin: 0.65rem 0 0.4rem 0;
  text-align: center;
}

.experience-card-poster-link {
  display: inline-block;
  max-width: min(100%, 520px);
  line-height: 0;
}

.experience-card-poster-link:hover .experience-card-poster-img {
  opacity: 0.94;
}

.experience-card-poster-link:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 3px;
  border-radius: 6px;
}

.experience-card-poster-img {
  width: 100%;
  max-width: min(100%, 520px);
  height: auto;
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  transition: opacity 0.15s ease;
}

.experience-card-poster-img--tiny {
  max-width: min(100%, 208px);
}

.experience-card-poster-img--coper-slides {
  max-width: min(100%, 250px);
}

.experience-card-poster-img--smallish {
  max-width: min(100%, 420px);
}

.experience-card-poster-img--roadef {
  max-width: min(100%, 210px);
}

.experience-card-poster-img--cast3m {
  max-width: min(100%, 320px);
}

/* Small centered portrait (e.g. Eratosthenes card) */
.experience-card-portrait-wrap {
  margin: 0.65rem 0 0.65rem 0;
  text-align: center;
  line-height: 0;
}

.experience-card-portrait-img {
  width: 104px;
  height: auto;
  max-width: min(104px, 32vw);
  display: inline-block;
  vertical-align: middle;
}

/* Card as link (e.g. to TIPE subpage) */
.experience-card--link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.experience-card--link:hover {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Hidden for the moment (see todo) */
.experience-card.is-hidden {
  display: none !important;
}

/* --- chat.css --- */
/* CharlesGPT chat */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.content-chat .chat-container {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft, var(--bg));
}

.content-chat .chat-messages {
  min-height: 280px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.content-chat .chat-message {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 85%;
}

.content-chat .chat-message-user {
  align-self: flex-end;
}

.content-chat .chat-message-bot {
  align-self: flex-start;
}

.content-chat .chat-message-role {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
}

.content-chat .chat-message-text {
  margin: 0;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.content-chat .chat-message-user .chat-message-text,
.content-chat .chat-message-bot .chat-message-text {
  background: var(--border);
  color: var(--text);
}

/* Token-level highlighting (cyclic colors) — backgrounds from variables.css per theme */
.content-chat .chat-message-text .chat-token {
  padding: 0 1px;
  border-radius: 3px;
  color: var(--text);
}

/* Same token colors for user and bot */
.content-chat .chat-message-user .chat-message-text .chat-token-0,
.content-chat .chat-message-bot .chat-message-text .chat-token-0 { background: var(--chat-token-0-bg); }
.content-chat .chat-message-user .chat-message-text .chat-token-1,
.content-chat .chat-message-bot .chat-message-text .chat-token-1 { background: var(--chat-token-1-bg); }
.content-chat .chat-message-user .chat-message-text .chat-token-2,
.content-chat .chat-message-bot .chat-message-text .chat-token-2 { background: var(--chat-token-2-bg); }
.content-chat .chat-message-user .chat-message-text .chat-token-3,
.content-chat .chat-message-bot .chat-message-text .chat-token-3 { background: var(--chat-token-3-bg); }
.content-chat .chat-message-user .chat-message-text .chat-token-4,
.content-chat .chat-message-bot .chat-message-text .chat-token-4 { background: var(--chat-token-4-bg); }
.content-chat .chat-message-user .chat-message-text .chat-token-5,
.content-chat .chat-message-bot .chat-message-text .chat-token-5 { background: var(--chat-token-5-bg); }

/* Stronger when model is unsure (prob < 70%) */
.content-chat .chat-message-user .chat-message-text .chat-token-unsure.chat-token-0,
.content-chat .chat-message-bot .chat-message-text .chat-token-unsure.chat-token-0 { background: var(--chat-token-unsure-0-bg) !important; }
.content-chat .chat-message-user .chat-message-text .chat-token-unsure.chat-token-1,
.content-chat .chat-message-bot .chat-message-text .chat-token-unsure.chat-token-1 { background: var(--chat-token-unsure-1-bg) !important; }
.content-chat .chat-message-user .chat-message-text .chat-token-unsure.chat-token-2,
.content-chat .chat-message-bot .chat-message-text .chat-token-unsure.chat-token-2 { background: var(--chat-token-unsure-2-bg) !important; }
.content-chat .chat-message-user .chat-message-text .chat-token-unsure.chat-token-3,
.content-chat .chat-message-bot .chat-message-text .chat-token-unsure.chat-token-3 { background: var(--chat-token-unsure-3-bg) !important; }
.content-chat .chat-message-user .chat-message-text .chat-token-unsure.chat-token-4,
.content-chat .chat-message-bot .chat-message-text .chat-token-unsure.chat-token-4 { background: var(--chat-token-unsure-4-bg) !important; }
.content-chat .chat-message-user .chat-message-text .chat-token-unsure.chat-token-5,
.content-chat .chat-message-bot .chat-message-text .chat-token-unsure.chat-token-5 { background: var(--chat-token-unsure-5-bg) !important; }

.content-chat .chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.content-chat .chat-input {
  flex: 1;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
}

.content-chat .chat-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.content-chat .chat-send {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: var(--accent);
  color: var(--bg);
}

.content-chat .chat-send:hover {
  opacity: 0.9;
}

/* Out-of-context tokens: no highlight (blend with message background) */
.content-chat .chat-message-user .chat-message-text .chat-token-out,
.content-chat .chat-message-bot .chat-message-text .chat-token-out {
  background: transparent;
}

/* CharlesGPT: About + Parameters links — mobile only, smaller than section title */
.charlesgpt-subnav.charlesgpt-subnav--mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .charlesgpt-subnav.charlesgpt-subnav--mobile-only {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 0.5rem;
    margin-bottom: 0.75rem;
  }

  .charlesgpt-subnav.charlesgpt-subnav--mobile-only .bio-nav-link {
    font-size: 0.82rem;
    font-weight: 600;
  }

  .charlesgpt-subnav.charlesgpt-subnav--mobile-only .bio-nav-sep {
    font-size: 0.72rem;
    opacity: 0.85;
  }
}

#charlesgpt-params {
  scroll-margin-top: 5.5rem;
}

.charlesgpt-metrics-anchor {
  scroll-margin-top: 5.5rem;
  border-top: 1px solid var(--border);
  min-height: 1.25rem;
}

.charlesgpt-metrics-anchor .chat-topk {
  border-top: none;
}

/* Top-k distribution bar chart below chat */
.chat-topk {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-muted, rgba(0, 0, 0, 0.03));
  font-size: 0.85rem;
}

.chat-topk-title {
  margin: 0 0 0.5rem 0;
  font-weight: 700;
  color: var(--text-muted);
}

.chat-topk-chart {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chat-topk-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.5rem;
}

.chat-topk-token {
  flex: 0 0 8ch;
  width: 8ch;
  min-width: 8ch;
  max-width: 8ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--text);
}

.chat-topk-bar-wrap {
  flex: 1;
  display: block;
  min-width: 0;
  height: 1rem;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.chat-topk-bar {
  display: block;
  height: 100%;
  min-width: 2px;
  max-width: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.15s ease, opacity 0.15s ease;
}

.chat-topk-pct {
  flex: 0 0 auto;
  width: 3rem;
  text-align: right;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.chat-embeddings {
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
}

.chat-embeddings-title {
  margin: 0 0 0.25rem 0;
  font-weight: 700;
  color: var(--text);
}

.chat-embeddings-subtitle {
  margin: 0 0 0.45rem 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.chat-embeddings-plot {
  width: 100%;
  height: auto;
  max-height: 280px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

.chat-embeddings-plot .chat-emb-axis {
  stroke: var(--border);
  stroke-width: 1;
}

.chat-embeddings-plot .chat-emb-axis-label {
  fill: var(--text-muted);
  font-size: 9px;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.chat-embeddings-plot .chat-emb-traj-line {
  stroke: #f59e0b;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-opacity: 0.9;
}

.chat-embeddings-plot .chat-emb-point {
  fill: #64748b;
  fill-opacity: 0.72;
}

.chat-embeddings-plot .chat-emb-point.chat-emb-point-map {
  fill: #94a3b8;
  fill-opacity: 0.34;
}

.chat-embeddings-plot .chat-emb-point.is-topk {
  fill: #2563eb;
  fill-opacity: 0.9;
}

.chat-embeddings-plot .chat-emb-point.is-traj {
  fill: #f59e0b;
  fill-opacity: 0.82;
}

.chat-embeddings-plot .chat-emb-point.is-both {
  fill: #16a34a;
  fill-opacity: 0.95;
}

.chat-embeddings-plot .chat-emb-traj-index {
  fill: #f59e0b;
  font-size: 8px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
}

.chat-embeddings-legend {
  margin: 0.35rem 0 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.chat-embeddings-key {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin: 0 0.2rem -0.05rem 0.2rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #64748b;
}

.chat-embeddings-key-topk {
  background: #2563eb;
}

.chat-embeddings-key-traj {
  background: #f59e0b;
}

.chat-embeddings-key-both {
  background: #16a34a;
}

.chat-perplexity {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-muted, rgba(0, 0, 0, 0.03));
  font-size: 0.85rem;
}

.chat-perplexity-title-line {
  margin: 0 0 0.5rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  line-height: 1.35;
}

.chat-perplexity-title-text {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.chat-perplexity-hint-inline {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
}

.chat-perplexity-hint-inline a {
  font-weight: 700;
  font-style: normal;
}

.chat-perplexity-value {
  margin: 0 0 0.05rem 0;
  line-height: 1.25;
}

.chat-perplexity-value .chat-perplexity-score {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  font-family: ui-monospace, monospace;
}

.chat-perplexity-value .chat-perplexity-steps {
  font-size: 0.88em;
  font-weight: 400;
  font-style: italic;
  color: var(--text-muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.chat-perplexity-sparkline-wrap {
  margin: 0.1rem 0 0 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: var(--accent);
}

.chat-perplexity-sparkline-wrap:not(.is-empty) {
  height: 92px;
  opacity: 1;
}

.chat-perplexity-sparkline {
  width: 100%;
  height: 92px;
  display: block;
}

/* Light axes / grid for perplexity sparkline (stroke only; fill none) */
.chat-perplexity-sparkline .ppl-axis {
  stroke: var(--border);
  stroke-width: 1;
  stroke-opacity: 0.85;
  fill: none;
}

.chat-perplexity-sparkline .ppl-grid {
  stroke: var(--border);
  stroke-width: 0.75;
  stroke-opacity: 0.4;
  fill: none;
}

.chat-perplexity-sparkline .ppl-tick {
  stroke: var(--border);
  stroke-width: 1;
  stroke-opacity: 0.75;
  fill: none;
}

.chat-perplexity-sparkline .ppl-tick-label {
  fill: var(--text-muted);
  font-size: 9px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  dominant-baseline: middle;
}

.chat-perplexity-sparkline .ppl-axis-title {
  fill: var(--text);
  font-size: 8.5px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  font-style: normal;
}

.chat-perplexity-sparkline .ppl-legend {
  fill: var(--text);
  font-size: 8px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 500;
}

.chat-perplexity-meta {
  margin: 0.25rem 0 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  #charlesgpt-params {
    scroll-margin-top: var(--site-header-offset-mobile, 4.5rem);
  }

  .charlesgpt-metrics-anchor {
    scroll-margin-top: var(--site-header-offset-mobile, 4.5rem);
  }
}
