/* HD Tutorial — feuille de style unique (aucun framework) */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef0f6;
  --ink: #141a2b;
  --ink-2: #4a5268;
  --ink-3: #79819a;
  --line: #e2e5ee;
  --brand: #4f46e5;
  --brand-ink: #ffffff;
  --brand-soft: #eceafd;
  --accent: #ef4444;
  --shadow: 0 1px 2px rgba(20, 26, 43, .06), 0 4px 16px rgba(20, 26, 43, .06);
  --shadow-lg: 0 10px 30px rgba(20, 26, 43, .14);
  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1320px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d111b;
    --surface: #151b29;
    --surface-2: #1d2436;
    --ink: #eef1f8;
    --ink-2: #b4bbcd;
    --ink-3: #848ca3;
    --line: #273047;
    --brand: #8b85ff;
    --brand-ink: #0d111b;
    --brand-soft: #22234a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.i { flex: none; vertical-align: middle; }
.muted { color: var(--ink-3); }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .wrap { padding-inline: 28px; } }
.narrow { max-width: 820px; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }

/* ---------- En-tête ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 14px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 1.2rem; font-weight: 600; white-space: nowrap; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand b { color: var(--brand); font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #6366f1, #ef4444); color: #fff; box-shadow: 0 4px 12px rgba(99, 102, 241, .35); }
.search { flex: 1; display: flex; align-items: center; gap: 8px; max-width: 620px; margin-inline: auto; background: var(--surface-2); border: 1px solid transparent; border-radius: 999px; padding-inline-start: 14px; color: var(--ink-3); transition: border-color .15s, background .15s; }
.search:focus-within { border-color: var(--brand); background: var(--surface); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 0; outline: none; color: var(--ink); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search button { border: 0; background: var(--brand); color: var(--brand-ink); font-weight: 600; padding: 8px 18px; margin: 4px; border-radius: 999px; cursor: pointer; }
.search button:hover { filter: brightness(1.08); }
.langmenu { position: relative; }
.langmenu summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink-2); border: 1px solid var(--line); }
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu summary:hover { border-color: var(--brand); color: var(--brand); }
.langmenu ul { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 200px; max-height: 70vh; overflow: auto; }
.langmenu li a { display: block; padding: 8px 12px; border-radius: 8px; }
.langmenu li a:hover { background: var(--surface-2); color: var(--ink); }
.langmenu li a[aria-current] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
@media (max-width: 720px) {
  .topbar-in { flex-wrap: wrap; height: auto; padding-block: 10px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .langmenu { margin-inline-start: auto; }
  .brand-name { font-size: 1.1rem; }
}
.catbar { border-top: 1px solid var(--line); }
.catbar-in { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-block: 8px; }
.catbar-in::-webkit-scrollbar { display: none; }
.catbar a { flex: none; padding: 6px 13px; border-radius: 999px; font-size: .88rem; font-weight: 500; color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
.catbar a:hover { color: var(--ink); background: var(--line); }
.catbar a[aria-current] { background: var(--ink); color: var(--bg); }

/* ---------- Accueil ---------- */
.hero { background: radial-gradient(1200px 400px at 20% -10%, rgba(99, 102, 241, .22), transparent 60%), radial-gradient(900px 380px at 90% 0%, rgba(239, 68, 68, .16), transparent 60%); border-bottom: 1px solid var(--line); }
.hero-in { padding-block: 56px 48px; text-align: center; }
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); font-weight: 800; letter-spacing: -.025em; max-width: 820px; margin-inline: auto; }
.hero-sub { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--ink-2); max-width: 640px; margin: 0 auto 26px; }
.hero-stats { margin: 18px 0 0; color: var(--ink-3); font-size: .92rem; }
.search-lg { max-width: 640px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding-inline-start: 18px; }
.search-lg input { padding: 14px 0; font-size: 1.05rem; }
.search-lg button { padding: 11px 24px; margin: 5px; }

.section { margin-block: 40px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; margin: 0; }
.section-head h2 .i { color: var(--brand); }
.more { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .92rem; color: var(--brand); white-space: nowrap; }
[dir="rtl"] .i-flip, [dir="rtl"] .more .i, [dir="rtl"] .crumbs .i, [dir="rtl"] .pager .i { transform: scaleX(-1); }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand); color: var(--ink); }
.tile-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); flex: none; }
.tile-txt { display: flex; flex-direction: column; min-width: 0; }
.tile-txt strong { font-weight: 600; }
.tile-txt small { color: var(--ink-3); }

/* ---------- Cartes vidéo ---------- */
.grid { display: grid; gap: 22px 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { min-width: 0; }
.card-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-thumb img { transform: scale(1.04); }
.dur { position: absolute; inset-inline-end: 7px; bottom: 7px; background: rgba(10, 12, 20, .82); color: #fff; font-size: .76rem; font-weight: 600; padding: 2px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.card-body { padding-top: 10px; }
.card-title { font-size: .98rem; font-weight: 600; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .84rem; color: var(--ink-3); margin: 0; }
.card-ch { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Pages liste ---------- */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .88rem; color: var(--ink-3); margin: 22px 0 6px; }
.crumbs a:hover { color: var(--brand); }
.crumbs span { color: var(--ink-2); }
.page-head { display: flex; align-items: flex-start; gap: 18px; margin: 16px 0 22px; }
.page-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 800; }
.page-head p { color: var(--ink-2); max-width: 760px; }
.page-head.plain { margin-top: 30px; }
.page-ic { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); flex: none; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; }
.tabs a { padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.tabs a[aria-selected] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 40px 0 10px; }
.pager a, .pager span { display: inline-flex; align-items: center; gap: 4px; min-width: 42px; height: 42px; justify-content: center; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .92rem; }
.pager span:not([aria-current]) { border-color: transparent; background: none; color: var(--ink-3); }
.pager [aria-current] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.pager a:hover { border-color: var(--brand); }
.empty { text-align: center; padding: 40px 0; }
.empty .search-lg { margin: 20px auto 36px; }
.empty .big { font-size: 5rem; font-weight: 800; line-height: 1; margin: 30px 0 10px; background: linear-gradient(135deg, #6366f1, #ef4444); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chips a { padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .9rem; }
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); color: var(--brand-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); filter: none; }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; font-weight: 700; flex: none; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.6rem; }

/* ---------- Page vidéo ---------- */
.watch { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); margin-top: 10px; }
@media (min-width: 1080px) { .watch { grid-template-columns: minmax(0, 1fr) 380px; } }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow-lg); cursor: pointer; }
.player img { width: 100%; height: 100%; object-fit: cover; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-btn { position: absolute; inset: 0; margin: auto; width: 84px; height: 60px; border: 0; border-radius: 18px; background: rgba(239, 68, 68, .94); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .15s, background .15s; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.player:hover .player-btn { transform: scale(1.08); background: #ef4444; }
.player-noscript { position: absolute; inset-inline: 0; bottom: 12px; text-align: center; color: #fff; text-decoration: underline; }
.player-note { font-size: .78rem; color: var(--ink-3); margin: 8px 0 0; }
.watch-title { font-size: clamp(1.35rem, 2.6vw, 1.85rem); font-weight: 800; margin: 18px 0 10px; }
.watch-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.watch-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-2); font-size: .92rem; margin: 0; }
.watch-meta span { display: inline-flex; align-items: center; gap: 6px; }
.watch-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.channel-chip { display: inline-flex; align-items: center; gap: 12px; margin: 18px 0 4px; padding-block: 8px; padding-inline: 8px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.channel-chip small { display: block; font-size: .75rem; color: var(--ink-3); line-height: 1.2; }
.channel-chip strong { display: block; line-height: 1.3; }
.channel-chip:hover { border-color: var(--brand); color: var(--ink); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-top: 22px; }
.panel h2 { font-size: 1.15rem; }
.panel h3 { font-size: .95rem; margin-top: 20px; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 22px; margin: 14px 0 0; }
.facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.facts dd a { color: var(--brand); }
.tags, .share { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a, .share a { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); font-size: .86rem; color: var(--ink-2); }
.tags a:hover, .share a:hover { background: var(--brand-soft); color: var(--brand); }
.resources { list-style: none; margin: 0; padding: 0; }
.resources li { padding: 14px 0; border-top: 1px solid var(--line); }
.resources li:first-child { border-top: 0; padding-top: 4px; }
.resources a { font-weight: 600; color: var(--brand); display: inline-flex; align-items: center; gap: 6px; }
.resources small { display: block; color: var(--ink-3); font-size: .82rem; }
.resources p { margin: 6px 0 0; color: var(--ink-2); font-size: .92rem; }
.langlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.langlist a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 9px; font-size: .92rem; color: var(--ink-2); }
.langlist a:hover { background: var(--surface-2); color: var(--ink); }
.lang-code { flex: none; font-size: .72rem; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 2px 6px; border-radius: 5px; }
.watch-side h2 { font-size: 1.1rem; margin: 0 0 14px; }
.watch-side h2:not(:first-child) { margin-top: 30px; }
.list { display: grid; gap: 14px; }
.list .card { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 12px; }
.list .card-body { padding-top: 0; }
.list .card-title { font-size: .92rem; }
.list .card-meta { flex-direction: column; gap: 0; font-size: .8rem; }
@media (min-width: 640px) and (max-width: 1079px) { .watch-side .list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Pages texte ---------- */
.prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 44px); margin: 14px 0 40px; }
.prose h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 800; }
.prose h2 { font-size: 1.25rem; margin-top: 1.8em; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li { margin-bottom: .5em; }
.lead { font-size: 1.12rem; color: var(--ink-2); }
.contact-card { padding: 18px 22px; border-radius: var(--radius); background: var(--brand-soft); margin-bottom: 1em; }
.contact-card p:last-child { margin: 0; }

/* ---------- Pied de page ---------- */
.footer { margin-top: 60px; background: var(--surface); border-top: 1px solid var(--line); font-size: .92rem; }
.footer-grid { display: grid; gap: 30px; padding-block: 44px 24px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1.6fr 1fr 1fr; } }
.footer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.footer-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
.footer-about p { color: var(--ink-2); margin-top: 14px; max-width: 360px; }
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--line); padding-block: 18px; color: var(--ink-3); font-size: .82rem; }
.footer-bottom p { margin: 0; }
.statcounter { display: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media (max-width: 720px) {
  .topbar .search { flex: 1 1 100%; width: 100%; }
  .topbar .search button { padding: 7px 14px; }
}
.player-off { display: block; cursor: default; color: #fff; }
a.player-off { cursor: pointer; }
.player-off img { filter: blur(6px) brightness(.45); transform: scale(1.06); }
.player-off p { position: absolute; inset-inline: 8%; top: 50%; transform: translateY(-50%); margin: 0; text-align: center; font-weight: 600; font-size: clamp(.95rem, 2vw, 1.15rem); text-wrap: balance; }
a.player-off p { top: auto; bottom: 10%; transform: none; }
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 10px; gap: 9px; }
  .tile-ic { width: 34px; height: 34px; border-radius: 9px; }
  .tile-txt strong { font-size: .88rem; line-height: 1.25; }
  .tile-txt small { font-size: .76rem; }
  .hero-in { padding-block: 34px 30px; }
}
.summary { color: var(--ink-2); }
.ytdesc { color: var(--ink-2); font-size: .95rem; overflow-wrap: anywhere; }
.ytdesc a { color: var(--brand); }
.ytdesc.is-long { max-height: 13em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.ytdesc.is-open { max-height: none; -webkit-mask-image: none; mask-image: none; }
.js-more { margin-top: 12px; }
.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.chapters button { all: unset; box-sizing: border-box; display: flex; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 9px; cursor: pointer; color: var(--ink-2); }
.chapters button:hover, .chapters button:focus-visible { background: var(--surface-2); color: var(--ink); }
.stamp { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brand); min-width: 3.5em; }
.panel-ai { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); background: linear-gradient(180deg, var(--brand-soft), var(--surface) 140px); }
.ai-summary { font-size: 1.05rem; color: var(--ink); }
.ai-steps { padding-inline-start: 1.4em; margin: 0; display: grid; gap: 6px; color: var(--ink-2); }
.ai-steps li::marker { color: var(--brand); font-weight: 700; }
.faq { display: grid; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; color: var(--ink-2); }
.ai-note { margin: 16px 0 0; font-size: .78rem; color: var(--ink-3); }
