/*
 * Sabi Quest family site. One common template: the page keeps the family colors (Ciel, Bleu Nuit,
 * Orange Soleil), and each app card carries its own identity through --card / --card-soft /
 * --card-ink (the AA-safe step of the same hue, as src/exams/config.ts defines it).
 */
:root {
  --night: #14427a;
  --ink: #1c2430;
  --muted: #58697c;
  --faint: #8595a6;
  --line: #dbe5ee;
  --page: #f4f8fc;
  --brand: #2e9bf0;
  --brand-soft: #e7f3fe;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
button, a { font: inherit; }

main {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 67% 19%, color-mix(in srgb, var(--brand-soft) 55%, transparent), transparent 28%),
    var(--page);
}

h1, h2, h3 { color: var(--night); }
.eyebrow { font: 500 10px "DM Mono"; letter-spacing: .15em; color: #68798c; text-transform: uppercase; }

/* Barre de navigation */
nav {
  height: 88px;
  padding: 0 5vw;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 248, 252, .84);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 10;
}
.brand { display: flex; gap: 12px; align-items: center; color: var(--night); text-decoration: none; font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.brand small { display: block; margin-top: 2px; color: #748397; font: 500 8px "DM Mono"; letter-spacing: .16em; }
.brand-bird { width: 35px; height: 35px; border-radius: 50% 50% 44% 44%; display: grid; place-items: center; background: var(--brand); color: white; font-weight: 800; box-shadow: inset 0 -5px 0 rgba(20, 66, 122, .14); }
.nav-center { display: flex; gap: 34px; }
.nav-center a { position: relative; color: #758397; text-decoration: none; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.nav-center a:hover { color: var(--ink); }
.nav-center a:hover::after { content: ""; position: absolute; left: 0; right: 0; bottom: -14px; height: 2px; background: var(--brand); }
.status { justify-self: end; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; font: 500 10px "DM Mono"; text-transform: uppercase; letter-spacing: .08em; }
.status i { width: 7px; height: 7px; background: #2bc48a; border-radius: 50%; box-shadow: 0 0 0 4px rgba(43, 196, 138, .14); }

/* Hero */
.hero { min-height: 640px; display: grid; grid-template-columns: 47% 53%; max-width: 1440px; margin: 0 auto; }
.hero-copy { padding: 100px 4vw 80px 6vw; position: relative; z-index: 2; }
h1 { font-size: clamp(66px, 7.6vw, 118px); line-height: .82; letter-spacing: -.085em; margin: 34px 0; font-weight: 800; }
h1 em { font-style: normal; color: var(--brand); }
.lede { max-width: 490px; font-size: 17px; line-height: 1.75; color: var(--muted); }
.motto { display: flex; gap: 7px; margin: 32px 0 40px; }
.motto strong { padding: 9px 13px; color: white; background: var(--night); border-radius: 6px; font-size: 13px; }
.motto strong:nth-child(2) { background: var(--brand); }
.motto strong:nth-child(3) { background: #ff8a1f; transform: rotate(-2deg); }

/* Accès direct aux quatre applis, sous le slogan */
.hero-apps { display: flex; flex-wrap: wrap; gap: 10px; border-top: 1px solid #d7e1eb; padding-top: 26px; }
.hero-apps a { display: inline-flex; align-items: center; gap: 9px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 99px; background: white; color: var(--card-ink); text-decoration: none; font-size: 12px; font-weight: 700; transition: transform .15s, border-color .15s; }
.hero-apps a:hover { transform: translateY(-2px); border-color: var(--card); }
.hero-apps i { width: 9px; height: 9px; border-radius: 50%; background: var(--card); }

.character-stage { min-height: 640px; position: relative; display: grid; place-items: center; }
.character-stage::before { content: ""; width: min(40vw, 560px); aspect-ratio: 1; border-radius: 50%; background: var(--brand-soft); position: absolute; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 12%, transparent); }
.character-stage::after { content: ""; width: min(34vw, 480px); aspect-ratio: 1; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--brand) 35%, transparent); position: absolute; animation: orbit 40s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.sabi { position: relative; z-index: 2; width: min(29vw, 400px); overflow: visible; filter: drop-shadow(0 22px 20px rgba(20, 66, 122, .13)); animation: float 4.5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(1deg); } }
.accessory { transform-origin: 146px 170px; animation: accessory 4.5s ease-in-out infinite; }
@keyframes accessory { 50% { transform: rotate(-1.5deg); } }

/* Titres de section, communs à toutes les sections */
.section-heading { max-width: 1280px; margin: 0 auto 55px; display: flex; justify-content: space-between; align-items: end; gap: 60px; }
.section-heading h2 { margin: 20px 0 0; font-size: clamp(40px, 4.6vw, 68px); line-height: .98; letter-spacing: -.06em; }
.section-heading > p { max-width: 400px; line-height: 1.8; color: #66778a; font-size: 14px; }

/* Les quatre applis : un seul gabarit, la couleur de chaque appli */
.apps { padding: 100px 6vw 110px; background: #fff; border-top: 1px solid var(--line); }
.app-grid { max-width: 1280px; margin: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.app-card { display: grid; grid-template-rows: auto 1fr; background: var(--page); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: inset 0 3px 0 var(--card); }
.app-icon { height: 190px; display: grid; place-items: center; background: var(--card-soft); }
.app-icon .sabi { width: 130px; animation: none; filter: drop-shadow(0 14px 12px rgba(20, 66, 122, .12)); }
.app-icon .accessory { animation: none; }
.app-body { padding: 24px; display: flex; flex-direction: column; align-items: flex-start; }
.app-body small { font: 500 9px "DM Mono"; letter-spacing: .12em; color: var(--card-ink); }
.app-body h3 { margin: 10px 0 4px; font-size: 22px; letter-spacing: -.03em; }
.app-exam { color: #728296; font-size: 12px; }
.app-body p { margin: 14px 0 0; color: #55677a; font-size: 13px; line-height: 1.6; flex: 1; }
.app-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; padding: 13px 19px; border-radius: 12px; background: var(--card); color: var(--ink); font-size: 13px; font-weight: 800; text-decoration: none; box-shadow: inset 0 -4px 0 rgba(20, 66, 122, .18); transition: transform .15s; }
.app-link:hover { transform: translateY(-2px); }
.app-link.soon { background: #eef2f6; color: var(--muted); box-shadow: none; font-weight: 700; }
.app-link.soon:hover { transform: none; }
a:focus-visible { outline: 3px solid var(--night); outline-offset: 3px; }

/* Comparer les trois préparations : objectif, score, et la table du CECRL */
.compare { padding: 100px 6vw 110px; background: var(--page); border-top: 1px solid var(--line); }
.compare-aims { max-width: 1280px; margin: 0 auto 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.aim { padding: 26px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: inset 0 3px 0 var(--card); }
.aim small { font: 500 9px "DM Mono"; letter-spacing: .12em; color: var(--card-ink); }
.aim h3 { margin: 10px 0 16px; font-size: 20px; letter-spacing: -.03em; }
.aim p { margin: 0 0 10px; font-size: 13px; line-height: 1.65; color: #55677a; }
.aim p:last-child { margin-bottom: 0; }
.aim b { color: var(--night); }

.compare-table { max-width: 1280px; margin: auto; }
.compare-table table { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.compare-table caption { caption-side: top; text-align: left; padding: 0 0 14px; font-size: 13px; color: #66778a; }
.compare-table th, .compare-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
.compare-table thead th { background: #f8fafc; color: var(--card-ink); font-size: 12px; font-weight: 800; vertical-align: bottom; }
.compare-table thead th:first-child { color: var(--faint); font: 500 9px "DM Mono"; letter-spacing: .12em; text-transform: uppercase; }
.compare-table thead i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--card); margin-right: 8px; }
.compare-table thead small { display: block; margin-top: 4px; color: #8090a1; font: 400 10px "DM Mono"; }
.compare-table tbody th { background: #fbfcfe; }
.compare-table tbody th b { color: var(--night); font-size: 15px; }
.compare-table tbody th small { display: block; margin-top: 3px; color: #8090a1; font-weight: 500; font-size: 11px; }
.compare-table tbody tr:last-child th, .compare-table tbody tr:last-child td { border-bottom: 0; }
.compare-table td { font-variant-numeric: tabular-nums; color: #27394e; font-weight: 600; }
.compare-table td.none { color: var(--faint); font-weight: 400; }
.compare-note { max-width: 860px; margin: 18px 0 0; font-size: 12px; line-height: 1.7; color: #66778a; }

/* Sabi */
.sabi-section { padding: 100px 6vw 110px; background: var(--night); color: white; border-top: 1px solid var(--line); }
.sabi-section h2 { color: white; }
.sabi-section .eyebrow { color: #89b5dd; }
.sabi-section .section-heading > p { color: #abc1d7; }
.atouts { max-width: 1280px; margin: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.atout { padding: 28px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 14px; background: rgba(255, 255, 255, .04); }
.atout h3 { margin: 0 0 12px; color: white; font-size: 20px; letter-spacing: -.03em; }
.atout p { margin: 0; color: #abc1d7; font-size: 13px; line-height: 1.7; }

footer { background: #0f335f; color: #8daac6; padding: 24px 6vw; font: 500 9px "DM Mono"; letter-spacing: .12em; }
footer > div { display: flex; justify-content: space-between; gap: 20px; }
footer strong { color: white; }
footer p { margin: 18px 0 0; max-width: 760px; font: 400 11px/1.7 "Manrope", sans-serif; letter-spacing: 0; color: #a9c1d8; }

@media (max-width: 1000px) {
  .app-grid { grid-template-columns: repeat(2, 1fr); }
  .compare-aims { grid-template-columns: 1fr; }
  .atouts { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  nav { grid-template-columns: 1fr auto; }
  .nav-center { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 70px 7vw 24px; }
  h1 { font-size: clamp(64px, 17vw, 104px); }
  .character-stage { min-height: 560px; }
  .character-stage::before { width: min(82vw, 520px); }
  .character-stage::after { width: min(72vw, 460px); }
  .sabi { width: min(56vw, 360px); }
  .section-heading { align-items: start; flex-direction: column; }
}

@media (max-width: 560px) {
  nav { height: 72px; padding: 0 20px; }
  .status span { display: none; }
  .hero-copy { padding-top: 52px; }
  .lede { font-size: 15px; }
  .character-stage { min-height: 460px; }
  .apps, .sabi-section, .compare { padding: 72px 20px; }
  .compare-table { overflow-x: auto; }
  .compare-table table { min-width: 560px; }
  .compare-table th, .compare-table td { padding: 12px; }
  .app-grid { grid-template-columns: 1fr; }
  .section-heading h2 { font-size: 44px; }
  footer > div { flex-direction: column; gap: 8px; }
  footer { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; }
}
