/* Les ouvrages indispensables à lire sur l'IA — Sébastien Tran */

@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('../fonts/inter-normal-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display'; font-style: normal; font-weight: 500 900; font-display: swap;
  src: url('../fonts/playfair-normal-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display'; font-style: italic; font-weight: 500 900; font-display: swap;
  src: url('../fonts/playfair-italic-latin.woff2') format('woff2');
}

:root {
  --bg: #070b18;
  --bg-2: #0d1330;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .22);
  --ink: #f3f4f8;
  --ink-muted: #a9b0c6;
  --ink-faint: #6f7794;
  --accent: #f5b14c;
  --accent-2: #7c8cff;
  --accent-3: #4fd1c5;
  --radius: 18px;
  --radius-pill: 999px;
  --display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --wrap: 1180px;
  --cover-w: clamp(150px, 24vw, 250px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.muted { color: var(--ink-faint); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 999; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ── Barre du haut ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(7, 11, 24, .72);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 1.15rem; font-weight: 600; white-space: nowrap; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .04em;
  background: linear-gradient(135deg, var(--accent), #e0763a); color: #1a1205;
}
.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a { text-decoration: none; font-size: 14.5px; font-weight: 500; color: var(--ink-muted); padding: 8px 12px; border-radius: var(--radius-pill); transition: color .2s, background .2s; }
.topnav a:hover { color: var(--ink); background: var(--surface-2); }
.topnav .topnav-home { color: var(--ink); border: 1px solid var(--line-strong); margin-left: 6px; }
@media (max-width: 820px) {
  .topnav > a:not(.topnav-home) { display: none; }
}
@media (max-width: 420px) {
  .topnav .topnav-home { display: none; }
}
.lang-switch { display: flex; gap: 2px; padding: 3px; margin-left: 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); }
.topnav .lang-btn { display: flex; align-items: center; padding: 6px 9px; opacity: .5; transition: opacity .2s, background .2s; }
.topnav .lang-btn:hover { opacity: .85; background: var(--surface-2); }
.topnav .lang-btn.active { opacity: 1; background: rgba(255, 255, 255, .14); }
.lang-btn svg { width: 24px; height: 16px; display: block; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }

/* ── Hero ── */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 10vw, 120px) 0 clamp(28px, 5vw, 48px); text-align: center; }
.hero-glow {
  position: absolute; inset: -40% -10% auto; height: 120%; pointer-events: none;
  background:
    radial-gradient(40% 50% at 30% 40%, rgba(124, 140, 255, .28), transparent 70%),
    radial-gradient(35% 45% at 72% 35%, rgba(245, 177, 76, .20), transparent 70%),
    radial-gradient(30% 40% at 50% 70%, rgba(79, 209, 197, .14), transparent 70%);
  filter: blur(20px);
}
.hero-inner { position: relative; }
.hero h1 { font-size: clamp(2.1rem, 5.6vw, 4.2rem); max-width: 15ch; margin: 0 auto; }
.hero h1 em {
  font-style: italic;
  background: linear-gradient(100deg, var(--accent) 0%, #f08a5d 45%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { max-width: 62ch; margin: 22px auto 0; color: var(--ink-muted); font-size: clamp(1rem, 1.6vw, 1.15rem); }
.hero-stats { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hero-stats li { font-size: 14px; color: var(--ink-muted); padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); }
.hero-stats strong { color: var(--ink); font-weight: 600; }

/* ── Carrousel coverflow ── */
.coverflow-section { position: relative; padding-bottom: clamp(40px, 7vw, 80px); overflow-x: clip; }
.coverflow {
  position: relative; height: calc(var(--cover-w) * 2.05 + 24px);
  perspective: 1400px; perspective-origin: 50% 40%;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; outline: none;
}
.coverflow-stage { position: absolute; inset: 0; transform-style: preserve-3d; }
.cf-item {
  position: absolute; left: 50%; top: 24px;
  width: var(--cover-w); aspect-ratio: 2 / 3; margin-left: calc(var(--cover-w) / -2);
  padding: 0; border: 0; background: none; cursor: pointer; border-radius: 10px;
  transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(.2, .8, .2, 1), opacity .5s, filter .5s;
  will-change: transform;
  -webkit-box-reflect: below 6px linear-gradient(transparent 62%, rgba(255, 255, 255, .22));
}
.cf-item img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 10px;
  box-shadow: 0 30px 60px -18px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .08);
  pointer-events: none;
}
.cf-item.is-active img { box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .18), 0 0 60px -10px rgba(245, 177, 76, .35); }
.cf-item:not(.is-active) { filter: brightness(.62) saturate(.85); }
.cf-item:focus-visible { outline-offset: 6px; }

.cf-nav {
  position: absolute; top: calc(24px + var(--cover-w) * .75); transform: translateY(-50%); z-index: 200;
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: rgba(13, 19, 48, .75); color: var(--ink); font-size: 28px; line-height: 1; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background .2s, transform .2s;
}
.cf-nav:hover { background: var(--accent); color: #1a1205; }
.cf-prev { left: clamp(8px, 4vw, 48px); }
.cf-next { right: clamp(8px, 4vw, 48px); }
.cf-dots { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 0 16px; }
.cf-dots button {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: var(--line-strong);
  cursor: pointer; transition: width .3s, background .3s;
}
.cf-dots button[aria-selected="true"] { width: 26px; background: var(--accent); }

.spotlight {
  margin-top: 28px; padding: clamp(22px, 4vw, 40px); text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  max-width: 860px;
}
.spotlight .eyebrow { margin-bottom: 8px; }
.spotlight-sub, .card-sub { margin: 6px 0 0; font-family: var(--display); font-style: italic; color: var(--ink-muted); }
.spotlight-sub { font-size: 1.05rem; }
.card-sub { font-size: .95rem; }
.summary-note { margin: 0 0 8px; font-size: 13px; font-style: italic; color: var(--ink-faint); }
.spotlight-title { font-size: clamp(1.45rem, 3vw, 2.1rem); }
.spotlight-meta { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 12px 0 16px; color: var(--ink-muted); font-size: 14px; }
.spotlight .summary { text-align: left; color: #d6d9e6; margin: 0; }
.spotlight.is-changing { animation: fadeUp .45s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.stars { color: var(--accent); letter-spacing: 2px; font-size: 15px; white-space: nowrap; }
.stars-off { color: rgba(255, 255, 255, .18); }
.summary-pending { color: var(--ink-faint) !important; font-style: italic; text-align: center !important; }

/* ── Grille des fiches ── */
.sec { padding: clamp(56px, 9vw, 100px) 0; }
.sec-head { margin-bottom: 28px; }
.sec-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.sec-intro { color: var(--ink-muted); max-width: 64ch; margin: 12px 0 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.chip {
  font: 500 14px var(--sans); color: var(--ink-muted); cursor: pointer;
  padding: 8px 16px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: transparent;
  transition: all .2s;
}
.chip:hover { color: var(--ink); border-color: var(--ink-muted); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 18px; }
.card {
  display: grid; grid-template-columns: 112px 1fr; gap: 20px; padding: 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color .25s, transform .25s, background .25s;
  scroll-margin-top: 90px;
}
.card:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-2px); }
.card[hidden] { display: none; }
.card-cover { width: 112px; aspect-ratio: 2 / 3; height: auto; object-fit: cover; border-radius: 8px; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .8); }
.card h3 { font-size: 1.2rem; }
.card-meta { margin: 6px 0 8px; font-size: 14px; color: var(--ink-muted); }
.card-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.tags li { font-size: 12px; font-weight: 500; color: var(--accent-3); padding: 2px 10px; border-radius: var(--radius-pill); background: rgba(79, 209, 197, .1); }
.card .summary {
  margin: 0; font-size: 15px; line-height: 1.65; color: #c9cddc;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.card.open .summary { display: block; -webkit-line-clamp: unset; }
.card .summary-pending { text-align: left !important; }
.more {
  margin-top: 10px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 600 14px var(--sans); color: var(--accent);
}
.more:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 520px) {
  .card { grid-template-columns: 84px 1fr; gap: 14px; padding: 16px; }
  .card-cover { width: 84px; }
}

/* ── Auteur ── */
.sec-author { background: linear-gradient(180deg, transparent, var(--bg-2) 30%, var(--bg-2) 70%, transparent); }
.author { display: grid; grid-template-columns: 160px 1fr; gap: clamp(20px, 4vw, 48px); align-items: start; }
.author-photo { width: 160px; height: 160px; object-fit: cover; border-radius: 50%; border: 3px solid rgba(245, 177, 76, .6); }
.author h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 14px; }
.author p:not(.eyebrow) { color: #cfd3e1; max-width: 70ch; }
.author-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
@media (max-width: 640px) {
  .author { grid-template-columns: 1fr; }
  .author-photo { width: 120px; height: 120px; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px;
  border-radius: var(--radius-pill); font: 600 15px var(--sans); text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #1a1205; border: 1px solid var(--accent); }
.btn-primary:hover { background: #ffc36b; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); }

/* ── Formulaire ── */
.contact-form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.contact-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink-muted); }
.contact-form input, .contact-form textarea {
  font: 16px var(--sans); color: var(--ink); width: 100%;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .04);
  transition: border-color .2s, background .2s;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); background: rgba(255, 255, 255, .07); }
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { margin: 0; min-height: 1.5em; font-size: 15px; }
.form-status.ok { color: var(--accent-3); }
.form-status.err { color: #ff8f8f; }

/* ── Pied de page ── */
.footer { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: 14px; color: var(--ink-muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer p { margin: 0; }
.footer a { color: var(--ink); text-underline-offset: 3px; }
