/* dragnix.fr — voir DESIGN.md. Mobile d'abord. */

@font-face { font-family: "Fredoka"; src: url("/static/fredoka-latin-wght-normal.6438e7de.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/static/nunito-latin-wght-normal.76388dbf.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  /* Palette de marque */
  --steel: #43608A;
  --orange: #FF8807;
  --brown: #5A1E0F;
  --ice: #EAF3FB;
  --white: #FFFFFF;
  --night: #0F1B2D;

  /* Rôles (thème clair) */
  --bg: var(--ice);
  --surface: var(--white);
  --surface-2: #DCEAF7;
  --text: #1B2A41;
  --muted: #44546E;
  --heading: var(--steel);
  --line: var(--brown);
  --link: var(--steel);
  --focus: var(--brown);
  --shadow: rgba(90, 30, 15, 1);
  --flake: rgba(67, 96, 138, .55);
  --on-orange: var(--brown);

  --radius: 16px;
  --font-title: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 1rem;
  --max: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--night);
    --surface: #17294A;
    --surface-2: #1F3560;
    --text: #EAF3FB;
    --muted: #B9C9E0;
    --heading: #CFE0F5;
    --line: #8FA6C9;
    --link: #FFB25A;
    --focus: var(--orange);
    --shadow: rgba(0, 0, 0, .55);
    --flake: rgba(255, 255, 255, .8);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.65;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; position: relative; z-index: 1; outline: none; }
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-title); color: var(--heading); line-height: 1.15; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 8vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .14em; }
ul, ol { padding-left: 1.3em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.icon { width: 1.5em; height: 1.5em; flex: none; }
.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 100; background: var(--orange); color: var(--on-orange); padding: .6rem 1rem; border-radius: var(--radius); font-weight: 700; }
.skip:focus { top: .5rem; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font: 700 1.05rem/1.2 var(--font-title); text-decoration: none; cursor: pointer;
  padding: .85rem 1.3rem; min-height: 3rem;
  color: var(--on-orange); background: var(--orange);
  border: 3px solid var(--brown); border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--brown);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { box-shadow: 7px 7px 0 var(--brown); filter: brightness(1.06); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--brown); }
.btn--ghost { background: var(--surface); color: var(--heading); border-color: var(--line); box-shadow: 4px 4px 0 var(--line); }
.btn--ghost:hover { box-shadow: 7px 7px 0 var(--line); }
.btn--ghost:active { box-shadow: 1px 1px 0 var(--line); }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; box-shadow: 4px 4px 0 var(--brown); }
.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.4rem; }

/* ---------- En-tête ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--steel); color: #fff; border-bottom: 3px solid var(--brown); }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: #fff; padding: .35rem 0; }
.brand img { border-radius: var(--radius); }
.brand__name { font: 700 1.5rem/1 var(--font-title); }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 3rem; height: 3rem; background: transparent; color: #fff; border: 3px solid #fff; border-radius: var(--radius); cursor: pointer; }
.nav-toggle .nav-toggle__close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: block; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.nav a { display: block; padding: .55rem .8rem; color: #fff; text-decoration: none; font: 600 1rem/1.2 var(--font-title); border-radius: var(--radius); transition: background-color .12s ease; }
.nav a:hover { background: rgba(255, 255, 255, .18); }
.nav a[aria-current="page"] { background: var(--orange); color: var(--on-orange); }
.site-header :focus-visible { outline-color: #fff; }
.site-header .nav a[aria-current="page"]:focus-visible { outline-color: #fff; }

@media (max-width: 63.99rem) {
  .js .nav-toggle { display: inline-flex; }
  .js .nav { flex-basis: 100%; display: none; padding-bottom: .8rem; }
  .js .nav.is-open { display: block; }
  .js .nav ul { flex-direction: column; }
}
@media (min-width: 64rem) { .nav ul { flex-wrap: nowrap; } }

/* ---------- Sections ---------- */
.section { padding: clamp(2.2rem, 6vw, 4rem) 0; }
.section--alt { background: var(--surface-2); border-block: 3px solid var(--line); }
.section__head { max-width: 40rem; margin-bottom: 1.6rem; }
.lead { font-size: 1.2rem; color: var(--muted); }
.eyebrow { font: 700 .9rem/1 var(--font-title); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.page-title { padding: clamp(2rem, 6vw, 3.5rem) 0 1rem; }
.page-title p { max-width: 40rem; }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface); color: var(--text);
  border: 3px solid var(--line); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--line);
  padding: 1.25rem;
}
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: 1.2rem; }
@media (min-width: 40rem) { .grid--2, .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Bandeau live ---------- */
.live-banner { background: var(--orange); color: var(--on-orange); border-bottom: 3px solid var(--brown); }
.live-banner p { margin: 0; padding: .7rem 0; display: flex; align-items: center; justify-content: center; gap: .6rem; font: 700 1.1rem/1.3 var(--font-title); text-align: center; }
.live-banner a { color: inherit; }

/* ---------- Héros ---------- */
.hero { padding: clamp(1.6rem, 6vw, 4rem) 0 clamp(2rem, 6vw, 3.5rem); }
.hero__grid { display: grid; gap: 1.5rem; align-items: center; }
.hero__art { justify-self: center; width: min(62vw, 17rem); }
.mascot { position: relative; aspect-ratio: 4 / 5; }
.mascot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .2s ease; }
.mascot img + img { opacity: 0; }
.mascot:hover img + img, .mascot:focus-within img + img { opacity: 1; }
.mascot:hover img:first-child { opacity: 0; }
.hero__text h1 { margin-bottom: .2em; }
.hero__text h1 span { color: var(--orange); }
.slogan { font: 700 clamp(1.3rem, 4.5vw, 1.9rem)/1.25 var(--font-title); color: var(--heading); margin-bottom: .3em; }
.tagline { font-size: 1.15rem; color: var(--muted); }
@media (min-width: 48rem) {
  .hero__grid { grid-template-columns: 1.2fr .8fr; }
  .hero__art { order: 2; width: min(100%, 22rem); }
}

/* ---------- Lecteur Twitch / vidéos ---------- */
.embed { position: relative; border: 3px solid var(--line); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--line); overflow: hidden; background: var(--night); }
.embed.is-playing { aspect-ratio: 16 / 9; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed__facade { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem; padding: 1.6rem 1rem 1.8rem; text-align: center; background: linear-gradient(160deg, var(--steel), var(--night)); color: #fff; }
.embed__facade img { width: clamp(6rem, 22vw, 9rem); }
.embed__facade p { margin: 0; max-width: 32rem; font-size: .95rem; color: #DCEAF7; }
.embed-note { font-size: .95rem; color: var(--muted); margin-top: .9rem; }
.video { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-decoration: none; color: var(--text); transition: transform .12s ease, box-shadow .12s ease; }
.video:hover { box-shadow: 7px 7px 0 var(--line); }
.video img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 3px solid var(--line); }
.video__body { padding: 1rem 1.1rem 1.2rem; }
.video__title { font: 600 1.1rem/1.3 var(--font-title); color: var(--heading); margin: 0 0 .3rem; }
.video__date { font-size: .9rem; color: var(--muted); margin: 0; }
.empty { display: grid; gap: 1rem; align-items: center; justify-items: center; text-align: center; }
.empty img { width: 8rem; }
@media (min-width: 40rem) { .empty { grid-template-columns: auto 1fr; text-align: left; justify-items: start; } }

/* ---------- Tuiles (liens, navigation) ---------- */
.tiles { display: grid; gap: 1.1rem; list-style: none; padding: 0; margin: 0; }
@media (min-width: 40rem) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .tiles--3 { grid-template-columns: repeat(3, 1fr); } }
.tile {
  position: relative; display: flex; align-items: center; gap: 1rem; min-height: 5.5rem;
  padding: 1rem 1.2rem; text-decoration: none; color: var(--text);
  background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--line);
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
a.tile:hover { box-shadow: 7px 7px 0 var(--line); background: var(--surface-2); }
a.tile:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--line); }
.tile__icon { display: grid; place-items: center; width: 3.4rem; height: 3.4rem; flex: none; background: var(--orange); color: var(--on-orange); border: 3px solid var(--brown); border-radius: var(--radius); }
.tile__icon .icon { width: 1.8rem; height: 1.8rem; }
.tile__body { display: flex; flex-direction: column; min-width: 0; }
.tile__title { font: 700 1.3rem/1.2 var(--font-title); color: var(--heading); }
.tile__text { font-size: .98rem; color: var(--muted); line-height: 1.4; }
.tile__go { margin-left: auto; color: var(--muted); }
.tile--soon { opacity: .75; box-shadow: none; border-style: dashed; }
.tile__tag { margin-left: auto; font: 700 .85rem/1 var(--font-title); padding: .4rem .6rem; border: 2px solid var(--line); border-radius: var(--radius); color: var(--muted); }
.tile--big { min-height: 7rem; }
.tile--big .tile__title { font-size: 1.5rem; }

/* ---------- Prose (blog, pages texte) ---------- */
.prose { max-width: 44rem; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose blockquote { margin: 1.4em 0; padding: .8em 1.2em; border-left: 6px solid var(--orange); background: var(--surface); border-radius: var(--radius); }
.prose code { background: var(--surface-2); padding: .1em .35em; border-radius: 6px; font-size: .95em; }
.prose pre { overflow-x: auto; padding: 1em; background: var(--surface-2); border-radius: var(--radius); }
.prose img { border-radius: var(--radius); }
.notice { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 1.2rem; background: var(--surface); border: 3px dashed var(--line); border-radius: var(--radius); margin: 0 0 1.6rem; }
.notice .icon { margin-top: .15rem; color: var(--orange); }
.notice p { margin: 0; }
.badge { display: inline-block; font: 700 .8rem/1 var(--font-title); letter-spacing: .05em; text-transform: uppercase; padding: .35rem .6rem; background: var(--orange); color: var(--on-orange); border: 2px solid var(--brown); border-radius: var(--radius); }
.post-card { display: flex; flex-direction: column; gap: .5rem; }
.post-card h2, .post-card h3 { margin: 0; font-size: 1.4rem; }
.post-card h2 a, .post-card h3 a { color: var(--heading); text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { text-decoration: underline; }
.meta { font-size: .92rem; color: var(--muted); margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.split { display: grid; gap: 1.5rem; align-items: center; }
.split img { width: min(70%, 15rem); justify-self: center; }
@media (min-width: 48rem) { .split { grid-template-columns: 1fr auto; } .split--rev { grid-template-columns: auto 1fr; } .split img { width: 15rem; } }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; list-style: none; padding: 0; margin: 0; }
@media (min-width: 48rem) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery figure { margin: 0; text-align: center; }
.gallery figcaption { font: 600 1rem/1.2 var(--font-title); color: var(--heading); margin-top: .4rem; }

/* ---------- Planning ---------- */
.schedule { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--line); overflow: hidden; }
.schedule th, .schedule td { padding: .8rem 1rem; text-align: left; border-bottom: 2px solid var(--surface-2); }
.schedule thead th { background: var(--steel); color: #fff; font-family: var(--font-title); }
.schedule tbody tr:last-child > * { border-bottom: 0; }
.schedule th[scope="row"] { font-family: var(--font-title); color: var(--heading); }
.next-live { font: 700 1.3rem/1.3 var(--font-title); color: var(--heading); }
.rules { counter-reset: regle; list-style: none; padding: 0; display: grid; gap: 1rem; }
.rules li { counter-increment: regle; display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.rules li::before { content: counter(regle); display: grid; place-items: center; width: 2.6rem; height: 2.6rem; font: 700 1.3rem/1 var(--font-title); background: var(--orange); color: var(--on-orange); border: 3px solid var(--brown); border-radius: var(--radius); }
.rules strong { display: block; font: 700 1.15rem/1.3 var(--font-title); color: var(--heading); }

/* ---------- Formulaires / livre d'or ---------- */
.form { display: grid; gap: 1.1rem; }
.field label { display: block; font: 700 1.05rem/1.3 var(--font-title); color: var(--heading); margin-bottom: .35rem; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  padding: .8rem 1rem; border: 3px solid var(--line); border-radius: var(--radius);
}
.field textarea { min-height: 9rem; resize: vertical; }
.field .hint span:last-child { white-space: nowrap; }
.field .hint { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; color: var(--muted); margin-top: .3rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.status { margin: 0; padding: .9rem 1.1rem; border: 3px solid var(--line); border-radius: var(--radius); background: var(--surface); font-weight: 700; }
.status[hidden] { display: none; }
.status--ok { border-color: var(--steel); }
.status--err { border-color: var(--orange); }
.messages { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.message__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; margin-bottom: .5rem; }
.message__author { font: 700 1.15rem/1.2 var(--font-title); color: var(--heading); }
.message__date { font-size: .9rem; color: var(--muted); }
.message__text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Pied de page ---------- */
.ice-strip { position: relative; z-index: 1; height: 4.2rem; margin-top: 3rem; background: var(--surface); border-top: 3px solid var(--line); overflow: hidden; }
.slider { position: absolute; bottom: -.2rem; left: 0; width: 5rem; height: auto; animation: glisse 18s cubic-bezier(.45, .05, .55, .95) infinite; }
.site-footer { position: relative; z-index: 1; background: var(--steel); color: #fff; padding: 2rem 0 1.2rem; border-top: 3px solid var(--brown); }
.site-footer a { color: #fff; }
.site-footer :focus-visible { outline-color: #fff; }
.footer__grid { display: grid; gap: 1.5rem; }
.footer__brand { font: 700 1.6rem/1 var(--font-title); margin: 0 0 .3rem; }
.footer__text { margin: 0 0 .8rem; color: #DCEAF7; }
.footer__mail { display: flex; align-items: center; gap: .5rem; margin: 0; font-weight: 700; flex-wrap: wrap; }
.footer__links, .footer__socials { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.footer__socials { gap: .6rem; }
.social { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border: 3px solid #fff; border-radius: var(--radius); transition: background-color .12s ease, transform .12s ease; }
.social:hover { background: var(--orange); color: var(--on-orange); border-color: var(--brown); }
.footer__copy { margin: 1.4rem auto 0; font-size: .9rem; color: #DCEAF7; }
@media (min-width: 48rem) { .footer__grid { grid-template-columns: 1.3fr 1.4fr auto; align-items: start; } .footer__links { display: grid; grid-template-columns: repeat(2, auto); justify-content: start; gap: .4rem 2rem; } }

/* ---------- Neige ---------- */
.snow { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.flake { position: absolute; top: -12px; background: var(--flake); border-radius: var(--radius); animation: neige linear infinite; }

/* ---------- Animations autorisées (voir DESIGN.md) ---------- */
@keyframes glisse {
  0% { transform: translateX(-6rem) rotate(0deg); }
  15% { transform: translateX(8vw) rotate(-4deg); }
  100% { transform: translateX(calc(100vw + 2rem)) rotate(3deg); }
}
@keyframes neige {
  from { transform: translate3d(0, -5vh, 0); }
  to { transform: translate3d(var(--drift, 30px), 105vh, 0); }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise .7s ease-out both; }
  @supports (animation-timeline: view()) {
    .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slider { animation: none; left: 70%; }
  .snow { display: none; }
  * { transition: none !important; }
}

