/* Site Neja : une seule feuille, polices du système, aucune ressource externe. */

:root {
  --teal: #1e7f8c;
  --teal-dark: #155f69;
  --navy: #1d3557;
  --orange: #f08c2e;
  --ink: #1f2933;
  --muted: #52606d;
  --line: #d9e2ec;
  --bg: #ffffff;
  --soft: #eef7f8;
  --ok: #1b7a3a;
  --ko: #b42318;
  --indigo: #3f51b5; /* the app's launch screen */
  --accent: var(--teal);
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

/* Couleurs des classes, les mêmes que dans l'appli. */
.class-cp { --accent: #2e7d32; }
.class-ce1 { --accent: #1565c0; }
.class-ce2 { --accent: #e65100; }
.class-cm1 { --accent: #6a1b9a; }
.class-cm2 { --accent: #c62828; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 1.0625rem; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--teal-dark); }
a:hover { color: var(--navy); }
h1, h2, h3 { color: var(--navy); line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); margin: .2em 0 .4em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); margin: 1.8em 0 .5em; }
h3 { font-size: 1.15rem; margin: 1.2em 0 .4em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.wrap { width: min(1080px, 100% - 2rem); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
.small { font-size: .9rem; color: var(--muted); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 46rem; }

/* En-tête et pied de page */
.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .6rem 0; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.4rem; color: var(--navy); text-decoration: none; }
.site-header nav { flex: 1 1 100%; }
.site-header ul { display: flex; flex-wrap: wrap; gap: .1rem .2rem; list-style: none; margin: 0; padding: 0; }
.site-header nav a { display: block; padding: .3rem .55rem; border-radius: 999px; text-decoration: none; color: var(--navy); font-weight: 600; white-space: nowrap; }
.site-header nav a:hover { background: var(--soft); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: .8rem 0 0; margin: 0; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: .4rem; }
.site-footer { margin-top: 4rem; padding: 2rem 0; background: var(--navy); color: #fff; }
.site-footer a { color: #fff; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 1.2rem; list-style: none; padding: 0; }

/* Boutons */
.btn { display: inline-block; border: 2px solid var(--teal); background: var(--teal); color: #fff; font: inherit; font-weight: 700; padding: .7rem 1.3rem; border-radius: 999px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--teal-dark); }
.btn-ghost:hover { background: var(--soft); color: var(--navy); }
.btn-play { background: var(--navy); border-color: var(--navy); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--teal-dark); text-decoration: underline; cursor: pointer; }
.cta { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }

/* Accueil */
.soon { color: var(--muted); }
/* The blue runs the whole window width: a shadow, clipped to the sides, without overflow. */
.hero { display: grid; grid-template-columns: 1fr; gap: 1.5rem 3rem; align-items: center; padding: 1.5rem 0 2.5rem; background: var(--indigo); box-shadow: 0 0 0 100vmax var(--indigo); clip-path: inset(0 -100vmax); color: #fff; }
.hero h1 { color: #fff; margin-top: 0; }
.hero .lead, .hero .soon { color: #e8eaf6; }
.hero .soon a { color: #fff; }
.hero .btn { background: #fff; border-color: #fff; color: var(--indigo); }
.hero .btn:hover { background: #e8eaf6; border-color: #e8eaf6; }
.hero .demo-action { color: #fff; }
.hero .demo > .small { color: #c5cae9; }
.hero .phone { background: #1a237e; }
.waitlist { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: center; }
.waitlist-img { display: none; width: 200px; justify-self: center; border-radius: 50%; background: #fff; }
.choice { border: 0; padding: 0; margin: 0 0 .8rem; }
.choice legend { font-weight: 700; margin-bottom: .3rem; padding: 0; }
.form .choice label { display: inline-flex; align-items: center; gap: .4rem; margin-right: 1.2rem; font-weight: 400; }
.form .choice input { width: auto; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; list-style: none; padding: 0; }
.class-card { display: flex; flex-direction: column; gap: .2rem; padding: 1rem; border-radius: var(--radius); background: var(--accent); color: #fff; text-decoration: none; }
.class-card:hover { color: #fff; filter: brightness(1.1); }
.class-label { font-size: 1.8rem; font-weight: 800; }
details { border-bottom: 1px solid var(--line); padding: .8rem 0; }
summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.captures { display: flex; gap: 1rem; overflow-x: auto; list-style: none; padding: 0; }
.captures img { width: 220px; border-radius: 18px; border: 1px solid var(--line); }

/* Deux cadres seulement : le cadre (blanc, bord fin) et le cadre mis en avant (fond doux, sans bord). */
.pillars li, .plan, .app-cta, .ex-card, .demo-next, .parent-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.card, .help, .plan-premium, .lesson-part.rule { background: var(--soft); border: 1px solid transparent; border-radius: var(--radius); }

/* Les quatre points forts, la double colonne et les tarifs */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 2rem 0; }
.pillars li { padding: .2rem 1rem .8rem; }
.pillars h2 { font-size: 1.2rem; margin: .8rem 0 .3rem; }
.pillars p { margin: 0; color: var(--muted); }
.parent-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; list-style: none; padding: 0; }
.parent-card { padding: .2rem 1.2rem .6rem; }
.parent-card img { display: block; width: 180px; margin: 1rem auto 0; border-radius: 18px; border: 6px solid var(--navy); }
.parent-card h3 { color: var(--navy); }
.offline { max-width: 46rem; }
.offline li { margin: .35rem 0; }
.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.plan { padding: 0 1.2rem 1rem; }
.price { font-size: 1.8rem; font-weight: 800; color: var(--navy); margin: .2rem 0; }
.price span { font-size: 1rem; font-weight: 600; color: var(--muted); }
.plan li { margin: .3rem 0; }

/* Pages */
.page-head { padding-top: 1rem; }
.kicker { margin: 0; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; font-size: .9rem; }
.card { padding: .5rem 1.2rem 1.2rem; margin: 1.5rem 0; }
.card h2 { margin-top: .8em; }
.prose { max-width: 46rem; }
.skills { list-style: none; padding: 0; }
.skills li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.skill { font-weight: 700; }
.subs { display: block; font-size: .9rem; color: var(--muted); }
.badge { font-size: .75rem; background: var(--accent); color: #fff; border-radius: 999px; padding: .1rem .5rem; vertical-align: middle; }
.app-cta { padding: 0 1.2rem 1rem; margin-top: 2rem; }
.dev-note, mark { background: #fff4ce; color: #5c4400; padding: .2rem .4rem; border-radius: 6px; }

/* Exemples de questions et « Comment l'aider » */
.examples ol { padding-left: 1.4rem; }
.examples li { margin: .8rem 0; }
.examples li > p { margin: 0 0 .2rem; font-weight: 600; }
.examples details { border: 0; padding: 0; }
.examples summary { font-weight: 600; color: var(--teal-dark); font-size: .95rem; }
.examples details p { margin: .3rem 0 0; color: var(--ok); }
.help { padding: .1rem 1.2rem .4rem; margin-top: 2rem; }
.help h2 { margin-top: .8em; }

/* Leçon */
.lesson-part { border-left: 4px solid var(--accent); padding: .1rem 0 .1rem 1rem; margin: 1.2rem 0; }
.lesson-part.trap { border-color: var(--ko); }
.lesson-part.rule { padding: .1rem 1.2rem .3rem; }
.lesson-part li { margin: .3rem 0; }
.wrong-right .wrong { color: var(--ko); text-decoration: line-through; margin-right: 1rem; }
.wrong-right .wrong::before { content: "✗ "; }
.wrong-right .right { color: var(--ok); font-weight: 700; }
.wrong-right .right::before { content: "✓ "; }
.column-op { border-collapse: collapse; font-family: ui-monospace, "DejaVu Sans Mono", monospace; font-size: 1.4rem; margin: .6rem 0; }
.column-op td { width: 1.6em; height: 1.7em; text-align: center; padding: 0; }
.column-op td.op { width: 1.2em; }
.column-op tr.result td { border-top: 2px solid var(--ink); }

/* Démo : les vrais exercices de l'appli, dans un cadre de téléphone, chargés au clic */
.demo { max-width: 400px; margin: 0 auto; text-align: center; }
.phone { position: relative; max-width: 380px; margin: 0 auto; padding: 12px; background: var(--navy); border-radius: 38px; box-shadow: 0 10px 30px rgba(29, 53, 87, .28); }
.phone-screen { border-radius: 26px; overflow: hidden; background: #fff; }
.demo-poster-btn { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #fff; cursor: pointer; }
.demo-poster { display: block; width: 100%; height: auto; }
.demo-play { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: rgba(29, 53, 87, .82); box-shadow: 0 4px 14px rgba(0, 0, 0, .3); transition: transform .15s; }
.demo-play::after { content: ""; position: absolute; left: 33px; top: 24px; border-style: solid; border-width: 18px 0 18px 30px; border-color: transparent transparent transparent #fff; }
.demo-poster-btn:hover .demo-play, .demo-poster-btn:focus-visible .demo-play { transform: scale(1.1); background: var(--teal); }
.demo-close { display: block; margin: -4px 4px 8px auto; padding: .3rem .8rem; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .15); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.demo-close:hover { background: rgba(255, 255, 255, .3); }
.demo-frame { display: block; width: 100%; height: min(720px, 80vh); border: 0; background: #fff; }
.demo-action { font-weight: 700; font-size: 1.1rem; color: var(--navy); margin: 1rem 0 .4rem; }
.demo-launch { margin: .4rem 0; }
.demo-loading { font-weight: 700; }
.demo .small { margin: .3rem 0; }
.demo-source { font-size: .8rem; }
.demo-next { margin-top: .8rem; padding: .2rem 1rem; color: var(--ink); }

@media (max-width: 759px) {
  html.demo-lock { overflow: hidden; }
  .demo.is-open .phone { position: fixed; inset: 0; z-index: 50; max-width: none; padding: .5rem 0 0; border-radius: 0; display: flex; flex-direction: column; }
  .demo.is-open .phone-screen { flex: 1; border-radius: 0; }
  .demo.is-open .demo-frame { height: 100%; }
  .demo.is-open .demo-close { margin: 0 .5rem .5rem auto; }
}

/* Cartes d'exercices : accueil, pages de classe, liens entre notions */
.ex-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; list-style: none; padding: 0; }
.ex-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; color: var(--ink); text-decoration: none; transition: box-shadow .15s, transform .15s; }
.ex-card:hover { color: var(--ink); box-shadow: 0 6px 18px rgba(29, 53, 87, .16); transform: translateY(-2px); }
.ex-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 45%; background: var(--soft); border-bottom: 3px solid var(--accent); }
.ex-body { display: flex; flex-direction: column; gap: .3rem; padding: .7rem .8rem .9rem; }
.ex-body .badge { align-self: flex-start; }
.ex-body strong { color: var(--navy); line-height: 1.25; }
.ex-action { font-size: .9rem; color: var(--muted); line-height: 1.35; }

/* Page notion : l'exercice dans une colonne à droite, à partir de 960 px */
.notion-side { text-align: left; }
@media (min-width: 960px) {
  .notion-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: "head side" "main side"; gap: 0 2.5rem; align-items: start; }
  .notion-head { grid-area: head; }
  .notion-main { grid-area: main; }
  .notion-side { grid-area: side; position: sticky; top: 1rem; margin-top: 1rem; }
  /* The sticky column must fit the window, open phone included. */
  .notion-side .demo-frame { height: max(460px, calc(100vh - 270px)); max-height: 720px; }
  .notion-main .lesson h2:first-child { margin-top: .8em; }
}

/* Formulaires */
.form label { display: block; font-weight: 700; margin-bottom: .2rem; }
.form input, .form select, .form textarea { font: inherit; width: 100%; max-width: 32rem; padding: .5rem; border: 2px solid var(--line); border-radius: 8px; background: #fff; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (min-width: 760px) {
  .site-header nav { flex: 1 1 auto; }
  .site-header ul { justify-content: flex-end; }
  .hero { grid-template-columns: 1.3fr 1fr; padding: 3rem 0; }
  .site-header nav a { padding: .4rem .7rem; }
  .waitlist { grid-template-columns: 1fr auto; }
  .waitlist-img { display: block; }
  .ex-cards { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}

@media (min-width: 960px) {
  .related .ex-cards { grid-template-columns: repeat(4, 1fr); }
}

/* Impression : la page sans menus ni démo. */
@media print {
  .site-header, .site-footer, .crumbs, .notion-side, .related, .app-cta, .skip { display: none; }
  .examples details::details-content { content-visibility: visible; }
  .examples summary { display: none; }
}
