/* ========== SUBSYSTEM CHOOSER + SWITCH (academy, academie, lessons, lecons) ========== */

/* ---- Switch in the menu ---- */
.subsystem-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  gap: 2px;
}
.subsystem-switch .ss-opt {
  padding: 5px 11px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text-muted);
  line-height: 1.2;
}
.nav-links .subsystem-switch a.ss-opt { padding: 5px 11px; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); border: none; }
.nav-links .subsystem-switch a.ss-opt:hover { color: var(--brand-primary); transform: none; }
.subsystem-switch .ss-opt.on { background: var(--brand-primary); color: #050816; }
@media (max-width: 900px) {
  .subsystem-switch-item { margin: 6px 0 4px; }
  .subsystem-switch .ss-opt, .nav-links .subsystem-switch a.ss-opt { padding: 8px 16px; font-size: 0.9rem; }
}

/* ---- Reminder bar (visitor chose the other subsystem before) ---- */
.subsystem-bar {
  position: relative;
  z-index: 50;
  margin: 92px auto -70px;
  max-width: 760px;
  width: calc(100% - 32px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  padding: 10px 44px 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-glow);
  background: rgba(0, 212, 255, 0.08);
  font-size: 0.9rem;
  color: var(--text-light);
}
.subsystem-bar a { color: var(--brand-primary); font-weight: 700; text-decoration: none; }
.subsystem-bar a:hover { text-decoration: underline; }
.subsystem-bar-close {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 0.95rem;
}
.subsystem-bar-close:hover { color: var(--text-light); background: rgba(255, 255, 255, 0.08); }

/* ---- First-visit chooser ---- */
body.ss-open { overflow: hidden; }
.subsystem-chooser {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background: radial-gradient(circle at 25% 20%, rgba(0, 212, 255, 0.16), transparent 55%),
              radial-gradient(circle at 80% 85%, rgba(46, 230, 139, 0.12), transparent 50%),
              rgba(3, 6, 20, 0.94);
  backdrop-filter: blur(14px);
  animation: ssFade 0.35s ease;
}
@keyframes ssFade { from { opacity: 0; } to { opacity: 1; } }
.ss-sheet {
  width: 100%;
  max-width: 820px;
  text-align: center;
  padding: 34px 26px 28px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 14, 34, 0.85);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  animation: ssRise 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
@keyframes ssRise { from { transform: translateY(18px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.ss-logo { border-radius: 14px; display: block; margin: 0 auto 10px; }
.ss-kicker { font-size: 0.78rem; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--brand-primary); margin-bottom: 10px; }
.ss-sheet h2 { font-size: 1.7rem; line-height: 1.25; margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.ss-sheet h2 [lang="fr"] { color: var(--text-muted); font-size: 0.82em; font-weight: 600; }
.ss-sub { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; max-width: 560px; margin: 0 auto 24px; }
.ss-sub [lang="fr"] { display: block; font-style: italic; opacity: 0.85; }

.ss-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ss-card {
  --c: 0, 212, 255;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 4px;
  padding: 22px 20px 20px;
  border-radius: 20px;
  border: 1px solid rgba(var(--c), 0.35);
  background: linear-gradient(160deg, rgba(var(--c), 0.14), rgba(var(--c), 0.03) 60%);
  color: var(--text-light);
  text-decoration: none;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), 0 10px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.2s ease;
}
.ss-card.fr { --c: 46, 230, 139; }
.ss-card:hover, .ss-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(var(--c), 0.9);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.4), 0 18px 34px rgba(var(--c), 0.25);
  outline: none;
}
.ss-card:focus-visible { outline: 2px solid rgb(var(--c)); outline-offset: 3px; }
.ss-badge {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 20px;
  background: rgba(var(--c), 0.18); color: rgb(var(--c));
  margin-bottom: 8px;
}
.ss-card strong { font-size: 1.25rem; line-height: 1.2; }
.ss-card em { font-style: normal; color: var(--text-muted); font-size: 0.88rem; margin-bottom: 10px; }
.ss-levels { font-weight: 700; font-size: 1rem; }
.ss-exams { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }
.ss-go { margin-top: 14px; font-weight: 800; color: rgb(var(--c)); font-size: 0.95rem; }
.ss-note { margin-top: 20px; color: var(--text-muted); font-size: 0.82rem; }

@media (max-width: 640px) {
  .ss-sheet { padding: 26px 16px 20px; border-radius: 22px; }
  .ss-sheet h2 { font-size: 1.35rem; }
  .ss-cards { grid-template-columns: 1fr; gap: 12px; }
  .ss-card { padding: 18px 16px 16px; }
  .ss-go { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .subsystem-chooser, .ss-sheet { animation: none; }
  .ss-card { transition: none; }
}

/* ---- Official resources (past papers, progression sheets) ---- */
.official-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  max-width: 1000px;
  margin: 0 auto;
}
.official-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--card-bg);
  color: var(--text-light);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.official-card:hover { transform: translateY(-3px); border-color: var(--border-glow); }
.official-card .oc-kind { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--brand-primary); }
.official-card strong { font-size: 1.05rem; }
.official-card span.oc-desc { color: var(--text-muted); font-size: 0.86rem; line-height: 1.5; }
.official-card span.oc-go { margin-top: auto; padding-top: 10px; font-weight: 700; font-size: 0.88rem; color: var(--brand-primary); }
.official-note { text-align: center; color: var(--text-muted); font-size: 0.82rem; margin: 18px auto 0; max-width: 720px; line-height: 1.6; }
.official-subhead { text-align: center; font-size: 1.05rem; margin: 34px 0 14px; color: var(--text-light); }

/* ---- Académie francophone: hero "exam cards" — a staircase BEPC → Probatoire → Bac ---- */
.fr-hero-exams { position: relative; height: 470px; width: 100%; max-width: 470px; margin: 0 auto; }
.fr-exam {
  position: absolute;
  width: 250px;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid rgba(var(--c), 0.35);
  background: linear-gradient(165deg, rgba(var(--c), 0.2), rgba(10, 14, 34, 0.97) 60%);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.55);
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}
.fr-exam .fx-class { font-size: 0.75rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: rgb(var(--c)); }
.fr-exam .fx-name { display: block; font-size: 1.6rem; font-weight: 900; margin: 4px 0 10px; line-height: 1.1; }
.fr-exam ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fr-exam li { font-size: 0.85rem; color: var(--text-muted); display: flex; gap: 8px; align-items: center; }
.fr-exam li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--c)); flex: none; }
.fx-1 { --c: 0, 212, 255;  left: 0;    top: 0;     z-index: 1; transform: rotate(-3deg); }
.fx-3 { --c: 46, 230, 139; left: 22%;  top: 150px; z-index: 2; transform: rotate(1deg); }
.fx-2 { --c: 255, 196, 0;  right: 0;   top: 300px; z-index: 3; transform: rotate(3deg); }
.fr-hero-exams:hover .fx-1 { transform: rotate(-3deg) translate(-6px, -6px); }
.fr-hero-exams:hover .fx-2 { transform: rotate(3deg) translate(6px, 6px); }
@media (max-width: 900px) {
  .fr-hero-exams { height: 340px; max-width: 340px; }
  .fr-exam { width: 190px; padding: 14px 16px; }
  .fr-exam .fx-name { font-size: 1.2rem; margin-bottom: 8px; }
  .fr-exam li { font-size: 0.75rem; }
  .fx-3 { top: 112px; left: 18%; }
  .fx-2 { top: 224px; }
}
@media (prefers-reduced-motion: reduce) { .fr-exam { transition: none; } }

/* A section with a single official card (progression sheets): centre it */
#officialProgressions .official-grid { grid-template-columns: minmax(0, 440px); justify-content: center; }

/* Program badges keep their own width inside the flex cards */
.program-card .program-badge, .academy-track > .program-badge { align-self: flex-start; }

/* ---- "Coming soon" block for workbooks that are not ready yet ---- */
.soon-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 26px;
  border-radius: 22px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: var(--card-bg);
  text-align: center;
}
.soon-card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.soon-card p { color: var(--text-muted); line-height: 1.7; }
.soon-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 20px; }
.soon-chips span { padding: 6px 14px; border-radius: 30px; border: 1px solid rgba(255, 255, 255, 0.14); font-size: 0.82rem; font-weight: 600; }

/* Non-link chips (francophone lessons teaser) */
.lesson-chips .lesson-chip-static {
  padding: 8px 16px; border-radius: 30px; border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-light); font-size: 0.85rem; font-weight: 600;
}

/* Exam tag next to a class name on the francophone lessons hub (3e · BEPC …) */
.hub-exam {
  display: inline-block; vertical-align: middle; margin-left: 10px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
  background: rgba(46, 230, 139, 0.14); color: rgb(46, 230, 139);
}

/* ========== PAST-PAPERS LIBRARY (/past-papers, /epreuves) ========== */
.pp-hero { text-align: center; padding-top: 130px; padding-bottom: 20px; max-width: 900px; margin: 0 auto; }
.pp-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; margin: 14px 0 12px; }
.pp-hero .bio { max-width: 680px; margin: 0 auto; }
.pp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 640px; margin: 26px auto 0; }
.pp-stats div { padding: 14px 8px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.1); background: var(--card-bg); }
.pp-stats strong { display: block; font-size: 1.6rem; color: var(--brand-primary); line-height: 1.1; }
.pp-stats span { font-size: 0.8rem; color: var(--text-muted); }

.pp-tools {
  position: sticky; top: 91px; z-index: 40;
  max-width: 1000px; margin: 0 auto; padding: 14px 16px 12px;
  background: rgba(5, 8, 22, 0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.pp-search {
  width: 100%; padding: 13px 18px; border-radius: 14px; font: inherit; font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.04); color: var(--text-light);
}
.pp-search:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15); }
.pp-quicks, .pp-chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.pp-quicks::-webkit-scrollbar, .pp-chips::-webkit-scrollbar { display: none; }
.pp-quick, .pp-chip {
  flex: none; padding: 7px 14px; border-radius: 30px; cursor: pointer; font: inherit; font-size: 0.82rem; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14); background: transparent; color: var(--text-light); white-space: nowrap;
}
.pp-quick { font-size: 0.78rem; color: var(--text-muted); padding: 5px 12px; }
.pp-quick:hover, .pp-chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.pp-quick.on, .pp-chip.on { background: var(--brand-primary); border-color: var(--brand-primary); color: #050816; }
.pp-chip span { margin-left: 4px; padding: 1px 7px; border-radius: 10px; background: rgba(255, 255, 255, 0.1); font-size: 0.72rem; }
.pp-chip.on span { background: rgba(5, 8, 22, 0.18); }
.pp-empty { margin: 14px 0 0; text-align: center; }

.pp-list { max-width: 1000px; margin: 0 auto; padding: 10px 16px 0; }
.pp-exam { padding: 34px 0 6px; scroll-margin-top: 220px; }
.pp-exam-head { margin-bottom: 14px; }
.pp-exam-head h2 { font-size: 1.6rem; margin: 2px 0 4px; text-align: left; }
.pp-exam-head p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
details.pp-year { border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 16px; background: var(--card-bg); margin-bottom: 10px; }
details.pp-year > summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 14px; padding: 14px 18px;
}
details.pp-year > summary::-webkit-details-marker { display: none; }
details.pp-year > summary::after { content: '▾'; margin-left: auto; color: var(--text-muted); transition: transform 0.2s; }
details.pp-year[open] > summary::after { transform: rotate(180deg); }
.pp-y { font-size: 1.2rem; font-weight: 800; }
.pp-yc { color: var(--text-muted); font-size: 0.85rem; }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; padding: 0 14px 14px; }
.pp-sub {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 8px;
  padding: 11px 14px; border-radius: 12px; text-decoration: none; color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s, transform 0.2s;
}
.pp-sub:hover, .pp-sub:focus-visible { border-color: var(--brand-primary); transform: translateY(-2px); outline: none; }
.pp-sub strong { font-size: 0.92rem; line-height: 1.3; }
.pp-sub span { grid-row: 2; color: var(--text-muted); font-size: 0.78rem; }
.pp-sub em { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; font-weight: 700; font-size: 0.8rem; color: var(--brand-primary); }
@media (max-width: 900px) and (min-width: 641px) { .pp-tools { top: 83px; } }
.pp-sub[hidden], .pp-exam[hidden], details.pp-year[hidden] { display: none; }
.pp-after { padding-top: 30px; }
.pp-help {
  max-width: 760px; margin: 26px auto; padding: 26px; border-radius: 22px; text-align: center;
  border: 1px solid var(--border-glow); background: linear-gradient(160deg, rgba(0, 212, 255, 0.08), transparent 70%);
}
.pp-help h3 { font-size: 1.3rem; margin-bottom: 8px; }
.pp-help p { color: var(--text-muted); line-height: 1.7; }
@media (max-width: 640px) {
  .pp-hero { padding-top: 110px; }
  .pp-stats { grid-template-columns: repeat(2, 1fr); }
  .pp-tools { position: static; padding: 10px 12px; background: transparent; backdrop-filter: none; }
  .pp-grid { grid-template-columns: 1fr; padding: 0 10px 10px; }
  details.pp-year > summary { padding: 13px 14px; }
}

/* ========== SKILLS COURSES (/skills, /formations) ========== */
.sk-hero-art { position: relative; height: 380px; width: 100%; max-width: 440px; margin: 0 auto; }
.sk-hero-art > div {
  position: absolute; padding: 18px 20px; border-radius: 18px; font-size: 0.92rem;
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(10, 14, 34, 0.95); box-shadow: 0 22px 44px rgba(0, 0, 0, 0.5);
}
.sk-code { left: 0; top: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; line-height: 1.8; transform: rotate(-3deg); border-color: rgba(46, 230, 139, 0.4) !important; }
.sk-code .k { color: rgb(46, 230, 139); } .sk-code .c { color: var(--text-muted); }
.sk-bubble { right: 0; top: 150px; max-width: 250px; transform: rotate(2deg); border-color: rgba(255, 196, 0, 0.45) !important; }
.sk-sheet { left: 12%; top: 260px; display: grid; grid-template-columns: repeat(3, 44px); gap: 6px; transform: rotate(-1deg); border-color: rgba(0, 212, 255, 0.4) !important; }
.sk-sheet span { padding: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); text-align: center; font-size: 0.8rem; color: var(--text-muted); }
.sk-sheet span:last-child { grid-column: 1 / 4; color: var(--brand-primary); font-family: ui-monospace, Menlo, Consolas, monospace; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; max-width: 1100px; margin: 0 auto; }
.sk-card {
  display: flex; flex-direction: column; padding: 26px 24px; border-radius: 22px; scroll-margin-top: 100px;
  border: 1px solid rgba(var(--c), 0.35); background: linear-gradient(170deg, rgba(var(--c), 0.1), var(--card-bg) 45%);
}
.sk-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.sk-icon { font-size: 2rem; }
.sk-level { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: rgb(var(--c)); text-align: right; }
.sk-card h3 { font-size: 1.45rem; margin-bottom: 6px; }
.sk-pitch { color: var(--text-light); font-weight: 600; line-height: 1.5; margin-bottom: 14px; }
.sk-card h4 { font-size: 0.78rem; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); margin: 10px 0 6px; }
.sk-who { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.sk-end { margin: 16px 0 18px; padding: 12px 14px; border-radius: 12px; background: rgba(var(--c), 0.08); font-size: 0.9rem; line-height: 1.5; }
.sk-end span { display: block; font-weight: 800; color: rgb(var(--c)); font-size: 0.8rem; margin-bottom: 2px; }
.sk-card .apply-btn { margin-top: auto; align-self: flex-start; }
.sk-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 1000px; margin: 0 auto; }
.sk-step { position: relative; padding: 24px 20px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.1); background: var(--card-bg); }
.sk-step-n { position: absolute; top: 14px; right: 16px; font-size: 2rem; font-weight: 900; color: rgba(255, 255, 255, 0.07); }
.sk-step-i { font-size: 1.6rem; }
.sk-step h3 { font-size: 1.1rem; margin: 8px 0 6px; }
.sk-step p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.sk-proof-links a { color: var(--brand-primary); font-weight: 700; text-decoration: none; }
@media (max-width: 900px) {
  .sk-hero-art { height: 300px; max-width: 340px; }
  .sk-bubble { top: 120px; max-width: 200px; }
  .sk-sheet { top: 210px; }
  .sk-steps { grid-template-columns: 1fr; }
}
.ss-skills { margin-top: 10px; font-size: 0.85rem; }
.ss-skills a { color: var(--brand-primary); font-weight: 700; text-decoration: none; }
.ss-skills a:hover { text-decoration: underline; }
.ss-skills span { color: var(--text-muted); }
@media (max-width: 640px) { .ss-skills a { display: block; padding: 4px 0; } .ss-skills span { display: none; } }
/* "overflow-x: hidden" on body stops position: sticky; "clip" keeps the no-sideways-scroll guard without that side effect */
body.pp-page { overflow-x: clip; }
.sk-lang { margin-top: 14px; font-size: 0.9rem; }
.sk-lang a { color: var(--brand-primary); font-weight: 700; text-decoration: none; }

/* Library card for a subject that has AsghinLabs answers */
.pp-sub.has-sol { display: flex; flex-direction: column; gap: 8px; border-color: rgba(46, 230, 139, 0.35); }
.pp-sub.has-sol .pp-main { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 8px; color: var(--text-light); text-decoration: none; }
.pp-sub.has-sol .pp-main strong { font-size: 0.92rem; line-height: 1.3; }
.pp-sub.has-sol .pp-main span { grid-row: 2; color: var(--text-muted); font-size: 0.78rem; }
.pp-sub.has-sol .pp-main em { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; font-weight: 700; font-size: 0.8rem; color: var(--brand-primary); }
.pp-ans { padding: 6px 10px; border-radius: 10px; background: rgba(46, 230, 139, 0.12); color: rgb(46, 230, 139); font-size: 0.8rem; font-weight: 700; text-decoration: none; }
.pp-ans:hover { background: rgba(46, 230, 139, 0.22); }
