:root {
  --bg: #08111f;
  --bg2: #111f36;
  --card: rgba(14, 24, 42, 0.82);
  --text: #e8eef8;
  --muted: #a8b4ca;
  --accent: #62c2ff;
  --line: rgba(200, 220, 255, 0.16);
  --topbar-h: 49px;
}

* {
  box-sizing: border-box;
}

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

html.lang-en .fr { display: none; }
html.lang-fr .en { display: none; }

#langBtn {
  cursor: pointer;
  font-family: inherit;
}

a:hover {
  text-decoration: underline;
}

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(1200px 600px at 8% 0%, #14325f 0%, var(--bg) 45%),
              linear-gradient(160deg, #0a1424 0%, var(--bg2) 100%);
  font-family: "Space Grotesk", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.25;
  z-index: -1;
}

.orb-a {
  width: 320px;
  height: 320px;
  background: #26a1ff;
  top: -60px;
  left: -80px;
}

.orb-b {
  width: 420px;
  height: 420px;
  background: #6ce2ad;
  right: -140px;
  bottom: -140px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 20px;
  background: rgba(8, 17, 31, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - var(--topbar-h));
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  background: rgba(8, 17, 31, 0.55);
  border-right: 1px solid var(--line);
  padding: 1.75rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.sidebar-logo img {
  height: 26px;
  width: auto;
  display: block;
  background: #fff;
  border-radius: 6px;
  padding: 3px 6px;
}

.sidebar-logo span {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sidebar-sub {
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 0.9rem;
  line-height: 1.4;
}

.home-link {
  display: inline-block;
  width: fit-content;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.home-link:hover {
  color: var(--accent);
  border-color: rgba(98, 194, 255, 0.4);
  text-decoration: none;
}

.nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0.9rem 0 0.35rem;
}

.nav-link {
  display: block;
  font-size: 0.83rem;
  color: var(--muted);
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-decoration: none;
}

.main {
  min-width: 0;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.hero {
  padding: 2.5rem 20px 22px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1 {
  margin: 8px 0 10px;
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  line-height: 1;
}

.subtitle {
  margin: 0;
  max-width: 70ch;
  color: var(--muted);
  font-size: 1rem;
}

.layout {
  padding: 8px 20px 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(8px);
}

.span-2 {
  grid-column: span 2;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.08rem;
}

.codeblock {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: rgba(4, 8, 16, 0.9);
  border: 1px solid rgba(130, 180, 240, 0.25);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.87rem;
  line-height: 1.45;
  white-space: pre;
  overflow-x: auto;
}

.image-frame {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(3, 8, 15, 0.8);
  overflow: hidden;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

.image-frame img,
.gallery-item img,
.lecture-figure img {
  cursor: zoom-in;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.image-frame img:hover,
.gallery-item img:hover,
.lecture-figure img:hover {
  opacity: 0.88;
}

.gallery-item img:hover {
  transform: scale(1.03);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 20px;
  background: rgba(4, 8, 16, 0.92);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  margin: 0;
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: default;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(143, 176, 220, 0.3);
  cursor: default;
}

.lightbox-figure figcaption {
  color: #d9e6fa;
  font-size: 0.9rem;
  text-align: center;
  max-width: 80ch;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(14, 24, 42, 0.9);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(24, 38, 62, 0.95);
}

.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stat {
  border: 1px solid rgba(143, 176, 220, 0.2);
  border-radius: 10px;
  padding: 10px;
  background: rgba(6, 13, 24, 0.72);
}

.stat .label {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat .value {
  font-size: 0.98rem;
  font-family: "IBM Plex Mono", monospace;
}

.feature-list {
  margin: 0;
  padding-left: 18px;
}

.feature-list li {
  margin: 0 0 8px;
  color: #d3dff2;
}

.span-3 {
  grid-column: span 3;
}

.lecture {
  color: #d9e6fa;
  line-height: 1.45;
  margin-bottom: 12px;
}

.lecture p {
  margin: 0 0 10px;
}

.lecture-sections {
  display: block;
}

.lecture-section {
  padding: 14px 0 16px;
  border-top: 1px solid rgba(200, 220, 255, 0.2);
}

.lecture-section:first-child {
  border-top: none;
  padding-top: 2px;
}

.lecture-section h3 {
  margin: 0 0 8px;
  color: #eaf4ff;
  font-size: 1.02rem;
}

.lecture-section p {
  margin: 0 0 10px;
  color: #c9daf3;
  line-height: 1.45;
  max-width: 95ch;
}

.lecture-figure {
  margin: 0;
}

.lecture-figure img {
  display: block;
  width: min(100%, 980px);
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(143, 176, 220, 0.2);
  background: rgba(6, 13, 24, 0.72);
}

.lecture-figure figcaption {
  margin-top: 7px;
  color: #a9c0df;
  font-size: 0.86rem;
  max-width: 95ch;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gallery-item {
  margin: 0;
  border: 1px solid rgba(143, 176, 220, 0.2);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(6, 13, 24, 0.72);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.gallery-item figcaption {
  padding: 8px 10px;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer {
  padding: 6px 20px 24px;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr 1fr;
  }

  .span-2 {
    grid-column: span 2;
  }

  .span-3 {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .span-3 {
    grid-column: span 1;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .lecture-figure img {
    width: 100%;
  }
}
