/* Polices embarquées (aucun appel externe) */
@font-face { font-family: "Big Shoulders Display"; font-weight: 800; font-display: swap; src: url(fonts/big-shoulders-display-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 900; font-display: swap; src: url(fonts/big-shoulders-display-latin-900-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url(fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url(fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); }

/* Palette AMOS : vert du logo #008B57 (fichier officiel) ; verts secondaires approximatifs */
:root {
  --amos: #008B57;
  --font-display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --r-s: 6px; --r-m: 14px;
}
:root, [data-theme="nuit"] {
  --bg: #0B1512; --bg-2: #10201B; --surface: #142621; --surface-2: #1B312B;
  --ink: #EEF5F1; --muted: #9DB3AA; --line: rgba(238, 245, 241, .12);
  --accent: #52A86F; --accent-ink: #6FC489; --on-accent: #08130F;
  --ok: #6FD39A; --ko: #FF7A6B; --glow: rgba(82, 168, 111, .4);
}
[data-theme="jour"] {
  --bg: #F0F5F2; --bg-2: #E2EBE6; --surface: #FFFFFF; --surface-2: #F5F9F7;
  --ink: #10221C; --muted: #536A61; --line: rgba(16, 34, 28, .14);
  --accent: #008B57; --accent-ink: #00704A; --on-accent: #FFFFFF;
  --ok: #1E7A45; --ko: #C2382B; --glow: rgba(0, 139, 87, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 1.1rem/1.55 var(--font-body); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 9; background: var(--accent); color: var(--on-accent); padding: 8px 12px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1; margin: 0; }
.muted { color: var(--muted); }

/* ---------- En-tête ---------- */
.top { display: flex; align-items: center; gap: 16px; padding: 14px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); flex: 1; min-width: 0; }
.brand img { height: 40px; background: #fff; padding: 6px 10px; border-radius: 8px; }
.brand-name { font: 900 1.7rem/1 var(--font-display); white-space: nowrap; }
.years { display: flex; gap: 6px; flex-wrap: wrap; }
.year { font: 800 1.2rem/1 var(--font-display); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; }
.year.on { color: var(--accent-ink); border-color: var(--accent); }
.icon-btn { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .9rem; }

main:focus, main:focus-visible { outline: none; }
main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(24px, 4vw, 56px) clamp(16px, 4vw, 48px) 64px; outline: none; }
.foot { padding: 20px clamp(16px, 4vw, 48px); border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.foot a { color: var(--muted); }

/* ---------- Accueil ---------- */
.hero h1 { font-size: clamp(4.5rem, 15vw, 11rem); font-weight: 900; line-height: .82; letter-spacing: -.01em; }
.hero p { font-size: 1.3rem; color: var(--muted); margin: 18px 0 0; max-width: 46ch; }
.group { margin-top: 48px; }
.group > h2 { font-size: 1.9rem; font-weight: 800; margin-bottom: 16px; }
.classes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* La classe en dossard */
.bib-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; transition: border-color .2s; }
.bib-card:hover { border-color: var(--accent); }
.bib-card:hover .bib { transform: rotate(-1.5deg); }
.bib { position: relative; background: #F4F7FB; color: #10221C; border-radius: 6px; padding: 16px 12px 10px; text-align: center; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); box-shadow: inset 0 0 0 2px rgba(16, 34, 28, .12); }
.bib::before, .bib::after { content: ""; position: absolute; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: #8A8F98; }
.bib::before { left: 8px; } .bib::after { right: 8px; }
.bib .code { display: block; font: 900 3.6rem/.9 var(--font-display); letter-spacing: .02em; }
.bib .strip { display: block; margin-top: 6px; background: var(--amos); color: #fff; font-weight: 700; font-size: .78rem; border-radius: 3px; padding: 2px 0; }
.bib-card .courses { margin: 0; padding: 0; list-style: none; font-weight: 700; font-size: 1rem; }
.bib-card .next { font-size: .92rem; color: var(--muted); margin-top: auto; }
.bib-card .next strong { color: var(--accent-ink); }

/* ---------- Page classe ---------- */
.class-head { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.class-head .bib { width: 190px; }
.class-head .bib .code { font-size: 4.6rem; }
.class-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 900; }
.class-head p { margin: 6px 0 0; color: var(--muted); }
.back { display: inline-block; margin-bottom: 22px; color: var(--muted); text-decoration: none; font-weight: 700; }

.lock { max-width: 520px; margin: 40px auto 0; text-align: center; }
.lock .bib { width: 220px; margin: 0 auto 26px; }
.lock .bib .code { font-size: 5rem; }
.lock form { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.lock input { width: 220px; text-align: center; text-transform: uppercase; letter-spacing: .3em; font: 800 1.8rem/1 var(--font-display); background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-s); padding: 10px; }
.lock input.bad { border-color: var(--ko); animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.lock .err { color: var(--ko); min-height: 1.6em; margin-top: 10px; }
.btn { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 9px 18px; font-weight: 700; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.unlocked .bib { animation: unlock .7s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes unlock { 0% { transform: scale(.85) rotate(-4deg); } 100% { transform: none; } }

.next-card { margin-top: 36px; border-radius: var(--r-m); padding: 22px 24px; background: var(--surface-2); border: 1px solid var(--accent); display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; box-shadow: 0 0 40px -10px var(--glow); }
.next-card .day { text-align: center; font-family: var(--font-display); }
.next-card .day b { display: block; font-size: 3.6rem; line-height: .9; color: var(--accent-ink); }
.next-card .day span { font-weight: 800; font-size: 1.1rem; }
.next-card h2 { font-size: 1.9rem; font-weight: 800; }
.next-card p { margin: 4px 0 0; color: var(--muted); }

.course { margin-top: 56px; }
.course > header h2 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 900; }
.course > header .meta { color: var(--muted); margin: 6px 0 0; }
.course > header p.desc { max-width: 72ch; margin: 14px 0 0; }
details.obj { margin-top: 12px; }
details.obj summary { cursor: pointer; font-weight: 700; color: var(--accent-ink); }
details.obj ul { margin: 10px 0 0; padding-left: 20px; }
details.obj li { margin: 4px 0; }

.timeline { list-style: none; margin: 26px 0 0; padding: 0; border-left: 2px dashed var(--line); }
.seance { position: relative; display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding: 0 0 26px 24px; }
.seance::before { content: ""; position: absolute; left: -9px; top: 10px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--muted); }
.seance.today::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px var(--glow); }
.seance.past::before { background: var(--surface-2); }
.seance .when { font-family: var(--font-display); }
.seance .when b { display: block; font-size: 2.6rem; line-height: .9; }
.seance .when span { display: block; font-weight: 800; font-size: 1rem; color: var(--muted); }
.seance .body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px 18px; }
.seance.today .body { border-color: var(--accent); }
.seance .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seance h3 { font-size: 1.6rem; font-weight: 800; }
.pill { font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; border: 1px solid var(--line); color: var(--muted); }
.pill.today { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.seance .hour { color: var(--muted); font-size: .95rem; margin: 2px 0 0; }
.items { display: grid; gap: 8px; margin-top: 14px; }
.item { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); background: var(--surface-2); border-radius: var(--r-s); padding: 10px 12px; }
.item:hover { outline: 1px solid var(--accent); }
.item .k { font: 800 .95rem/1 var(--font-display); color: var(--accent-ink); min-width: 52px; }
.item.off { color: var(--muted); }
.video { aspect-ratio: 16 / 9; border-radius: var(--r-s); overflow: hidden; margin-top: 14px; background: #000; }
.video iframe, .video video { width: 100%; height: 100%; border: 0; display: block; }

.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.tool { display: block; text-decoration: none; color: var(--ink); border-top: 3px solid var(--accent); padding: 10px 0 0; }
.tool strong { font: 800 1.35rem/1.1 var(--font-display); display: block; }
.tool span { color: var(--muted); font-size: .95rem; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 960px) { .classes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .brand-name { display: none; }
  .classes, .tools { grid-template-columns: 1fr; }
  .seance { grid-template-columns: 1fr; gap: 8px; }
  .next-card { grid-template-columns: 1fr; text-align: left; }
  .next-card .day { text-align: left; }
  .lock form { flex-direction: column; align-items: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.convention-link{text-decoration:none;white-space:nowrap;font-size:.85rem}.top{flex-wrap:wrap}.convention-link:focus-visible{outline:3px solid currentColor;outline-offset:4px}
@media(max-width:600px){.convention-link{font-size:.75rem;padding:8px}.top{gap:8px}}

.teacher-dialog{width:min(440px,calc(100% - 32px));border:1px solid var(--line);border-radius:var(--r-m);padding:24px;background:var(--surface);color:var(--ink)}.teacher-dialog::backdrop{background:#0009}.teacher-dialog h2{margin:0 0 10px}.teacher-dialog p{margin:10px 0}.teacher-dialog label{display:block;margin:16px 0 6px;font-weight:700}.teacher-dialog input{width:100%;padding:12px;font:inherit;border:1px solid var(--line);border-radius:var(--r-s);background:var(--surface-2);color:var(--ink)}.teacher-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:16px}
