/* ============================================================
   Blender pour l'image animée — support de formation
   Vanilla CSS · dark-first · WCAG-AA validated palette
   ============================================================ */

:root {
  /* palette (dark) */
  --bg:        #1A1A1D;
  --bg-panel:  #222226;
  --bg-panel2: #2A2A30;
  --border:    #34343c;
  --text:      #EDEDED;
  --text-dim:  #A8A8AE;
  --accent:    #E87D0D;   /* Blender orange */
  --accent-hi: #F5A623;   /* small accent text on dark */
  --accent-ink:#1A1A1D;   /* text ON accent (6.09:1) — never white */
  --shadow:    0 10px 30px rgba(0,0,0,.35);

  /* layout */
  --sidebar-w: 264px;
  --topbar-h: 60px;
  --container: clamp(640px, 90vw, 900px);
  --pad: clamp(1.1rem, 3.5vw, 2.6rem);
  --radius: 14px;

  /* type */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

[data-theme="light"] {
  --bg:        #F6F6F4;
  --bg-panel:  #FFFFFF;
  --bg-panel2: #F0F0EC;
  --border:    #E2E2DC;
  --text:      #1B1B1E;
  --text-dim:  #5C5C63;
  --accent:    #C25E00;   /* darker orange for AA on light */
  --accent-hi: #9E4A00;
  --accent-ink:#FFFFFF;
  --shadow:    0 10px 30px rgba(0,0,0,.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3 { font-family: var(--font-display); line-height: 1.12; font-weight: 600; }
a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--bg-panel2); padding: .1em .4em; border-radius: 5px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; z-index: 200; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* ============ TOP BAR ============ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 clamp(.8rem, 2vw, 1.4rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar__brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.topbar__brand:hover { text-decoration: none; }
.topbar__title em { color: var(--text-dim); font-style: normal; font-weight: 500; }
.topbar__mark { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); flex: none; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.topbar__burger { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 6px; }
.topbar__burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
.topbar__burger[aria-expanded="true"] span:nth-child(1){ transform: translateY(6px) rotate(45deg);}
.topbar__burger[aria-expanded="true"] span:nth-child(2){ opacity: 0;}
.topbar__burger[aria-expanded="true"] span:nth-child(3){ transform: translateY(-6px) rotate(-45deg);}

.theme-toggle { background: var(--bg-panel); border: 1px solid var(--border); color: var(--text); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 1.1rem; }
.theme-toggle:hover { border-color: var(--accent); }

/* ============ BUTTONS ============ */
.btn { display: inline-block; padding: .7rem 1.25rem; border-radius: 10px; font-weight: 600; font-size: .95rem; cursor: pointer; border: 1px solid transparent; transition: transform .12s, background .2s, border-color .2s; }
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--sm { padding: .5rem .85rem; font-size: .85rem; }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--accent-hi); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-hi); }

/* ============ SHELL / SIDEBAR ============ */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; align-items: start; }
.sidebar {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 1.4rem 1rem 2rem;
  display: flex; flex-direction: column;
}
.sidebar__nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar__group { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--text-dim); margin: 1.2rem .6rem .35rem; font-weight: 600; }
.sidebar__group:first-child { margin-top: 0; }
.navlink { color: var(--text-dim); padding: .42rem .65rem; border-radius: 8px; font-size: .92rem; border-left: 2px solid transparent; }
.navlink:hover { color: var(--text); background: var(--bg-panel); text-decoration: none; }
.navlink.is-active { color: var(--accent-hi); background: color-mix(in srgb, var(--accent) 12%, transparent); border-left-color: var(--accent); font-weight: 600; }
.sidebar__foot { margin-top: auto; padding-top: 1.4rem; color: var(--text-dim); font-size: .82rem; line-height: 1.5; }
.sidebar__foot strong { color: var(--text); }
.sidebar__scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 90; }

/* ============ MAIN / SECTIONS ============ */
.main { min-width: 0; }
.section { padding: clamp(3rem, 7vw, 5.5rem) var(--pad); border-bottom: 1px solid var(--border); }
.section--alt { background: var(--bg-panel); }
.section__head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-bottom: 1.2rem; max-width: var(--container); }
.section__num { font-family: var(--font-display); font-weight: 700; color: var(--accent); font-size: 1rem; letter-spacing: .05em; opacity: .9; }
.section__title { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin: 0; }
.section .lead, .section > p, .section .links, .section .note { max-width: var(--container); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--text); }
.note { color: var(--text-dim); font-size: .95rem; background: var(--bg-panel2); border-left: 3px solid var(--accent); padding: .7rem 1rem; border-radius: 0 8px 8px 0; }
.badge { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-ink); background: var(--accent); padding: .25rem .6rem; border-radius: 999px; }

/* ============ HERO ============ */
.hero { position: relative; min-height: clamp(440px, 72vh, 660px); display: flex; align-items: center; padding: clamp(2.5rem, 6vw, 5rem) var(--pad); overflow: hidden; border-bottom: 1px solid var(--border); }
.hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .28; filter: saturate(1.05); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent), var(--bg) 92%); }
.hero__inner { position: relative; z-index: 1; max-width: var(--container); }
.hero__eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--accent-hi); font-weight: 600; margin: 0 0 1rem; }
.hero__title { font-size: clamp(2.2rem, 6vw, 4.4rem); font-weight: 700; margin: 0 0 1.1rem; letter-spacing: -.01em; }
.grad { background: linear-gradient(100deg, var(--accent), var(--accent-hi)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lede { font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--text); max-width: 60ch; margin: 0 0 1.8rem; }
.hero__cta { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero__note { margin-top: 1.4rem; color: var(--text-dim); font-size: .9rem; }

/* ============ GRIDS / CARDS ============ */
.grid { display: grid; gap: 1rem; max-width: var(--container); margin-top: 1.6rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card { background: var(--bg-panel2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.25rem; }
.section--alt .card { background: var(--bg); }
.card h3 { margin: 0 0 .5rem; font-size: 1.12rem; }
.card p { margin: .4rem 0; color: var(--text-dim); font-size: .94rem; }
.card--key { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card__note { font-size: .85rem !important; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: .55rem; margin-top: .6rem; }
.tag { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: .12rem .45rem; border-radius: 6px; background: var(--bg-panel); border: 1px solid var(--border); color: var(--text-dim); vertical-align: middle; }
.tag--official { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* chips */
.chips { list-style: none; padding: 0; margin: 1.4rem 0; display: flex; flex-wrap: wrap; gap: .5rem; max-width: var(--container); }
.chips li { background: var(--bg-panel2); border: 1px solid var(--border); padding: .4rem .8rem; border-radius: 999px; font-size: .88rem; font-weight: 500; }
.section--alt .chips li { background: var(--bg); }

/* links row */
.links { margin-top: 1.4rem; font-size: .93rem; color: var(--text-dim); display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; align-items: center; }
.links a { position: relative; }
.links a::after { content: "↗"; font-size: .75em; margin-left: .15em; opacity: .6; }

/* rig / link lists */
.rig-list { list-style: none; padding: 0; margin: .6rem 0 0; }
.rig-list li { padding: .35rem 0; border-bottom: 1px dashed var(--border); display: flex; gap: .5rem; flex-wrap: wrap; align-items: baseline; }
.rig-list li:last-child { border-bottom: 0; }
.rig-list span { color: var(--text-dim); font-size: .85rem; }

/* callouts */
.callout { background: var(--bg-panel2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.4rem; margin-top: 1.6rem; max-width: var(--container); }
.section--alt .callout { background: var(--bg); }
.callout h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.callout p { margin: .5rem 0; }
.callout__cta { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; }
.callout--accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--bg-panel2)), var(--bg-panel2)); }

/* ============ VIDEO FACADE ============ */
.video-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; max-width: var(--container); margin-top: 1.6rem; }
.video { margin: 0; }
.video__frame { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; cursor: pointer; border: 1px solid var(--border); background: #000 center/cover no-repeat; }
.video__frame::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.25); transition: background .2s; }
.video__frame:hover::before { background: rgba(0,0,0,.1); }
.video__play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 1.5rem; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); transition: transform .15s; }
.video__frame:hover .video__play { transform: scale(1.08); }
.video__play::after { content: "▶"; margin-left: 3px; }
.video iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--radius); display: block; }
.video figcaption { color: var(--text-dim); font-size: .86rem; margin-top: .5rem; }

/* ============ FILMS GALLERY ============ */
.films { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; max-width: var(--container); margin-top: 1.6rem; }
.film { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1/1; display: block; }
.film img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.film:hover img { transform: scale(1.06); }
.film__meta { position: absolute; left: 0; right: 0; bottom: 0; padding: .8rem .6rem .5rem; font-size: .78rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.film__meta strong { display: block; font-family: var(--font-display); }
.film--feature { grid-column: span 2; grid-row: span 2; aspect-ratio: 1/1; }
.film--feature .film__meta { font-size: .92rem; }

/* ============ AGENDA ============ */
.day { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.4rem; }
.section--alt .day { background: var(--bg-panel2); }
.day h3 { margin: 0 0 .8rem; color: var(--accent-hi); }
.agenda { list-style: none; padding: 0; margin: 0; counter-reset: a; }
.agenda li { padding: .55rem 0; border-top: 1px solid var(--border); font-size: .94rem; }
.agenda li:first-child { border-top: 0; }
.agenda span { display: inline-block; font-weight: 600; color: var(--accent-hi); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin-right: .4rem; }

/* ============ FOOTER ============ */
.footer { padding: clamp(2.5rem,5vw,4rem) var(--pad); color: var(--text-dim); font-size: .9rem; }
.footer p { margin: .25rem 0; max-width: var(--container); }
.footer__brand { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: var(--text); }
.footer__fine { margin-top: 1.2rem !important; font-size: .78rem; opacity: .8; }

/* ============ REVEAL ANIMATION ============ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  :root { --container: 100%; }
  .topbar__burger { display: flex; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; z-index: 95;
    width: min(82vw, 320px); height: calc(100vh - var(--topbar-h));
    background: var(--bg); transform: translateX(-105%); transition: transform .25s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.is-open { transform: none; }
  .film--feature { grid-column: span 2; grid-row: span 2; }
}
@media (max-width: 560px) {
  .topbar__title em { display: none; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .films { grid-template-columns: repeat(2, 1fr); }
}
