/* Patrouille Pythagore — feuille de style unique (mobile d'abord) */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin-ext.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Kenney Future";
  src: url("../fonts/kenney-future.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #16203a;
  --ink-soft: #3b4766;
  --paper: #fffaf0;
  --white: #ffffff;
  --sky: #5db2f5;
  --sky-light: #d4edff;
  --blue: #2f8cf0;
  --blue-text: #1758a8;
  --red: #f2505d;
  --red-text: #b4232f;
  --green: #4fd04c;
  --green-dark: #2b9a33;
  --yellow: #ffd23a;
  --orange: #f59a1e;
  --asphalt: #2a3044;
  --asphalt-2: #353c54;
  --radius: 22px;
  --shadow: 0 6px 0 var(--ink);
  --wrap: 1120px;
  --hud: "Kenney Future", "Fredoka", system-ui, sans-serif;
  color-scheme: light;
}

*, *::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 { animation: none !important; transition: none !important; } }
body {
  margin: 0;
  font-family: "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 420;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}
img, video, svg { max-width: 100%; display: block; }
img { height: auto; }
[hidden] { display: none !important; }
a { color: var(--blue-text); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--ink); }
h1, h2, h3 { line-height: 1.12; font-weight: 700; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 6.5vw, 3.2rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 4px solid var(--orange); outline-offset: 3px; border-radius: 8px; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--yellow); color: var(--ink); padding: 10px 16px; border-radius: 12px; font-weight: 700; }
.skip:focus { top: 12px; }

/* Étiquette façon HUD du jeu */
.hud {
  font-family: var(--hud);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .8rem;
  font-weight: 400;
}
.pill {
  display: inline-flex; align-items: center; gap: .5em;
  background: var(--ink); color: var(--white);
  border-radius: 999px; padding: .45em 1em .4em;
}

/* ------------------------------------------------------------ En-tête */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 250, 240, .92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--ink);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 46px; width: auto; }
.nav { display: none; gap: 4px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 12px; }
.nav a:hover { background: var(--sky-light); }
.header-cta { font-size: .95rem; padding: .55em 1em; }
@media (min-width: 900px) { .nav { display: flex; } }

/* ------------------------------------------------------------ Boutons */
.btn {
  --bg: var(--yellow);
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  font: inherit; font-weight: 700; font-size: 1.1rem; line-height: 1.1;
  color: var(--ink); background: var(--bg);
  border: 3px solid var(--ink); border-radius: 18px;
  padding: .8em 1.3em; text-decoration: none; cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn--green { --bg: var(--green); }
.btn--white { --bg: var(--white); }
.btn small { display: block; font-size: .72em; font-weight: 500; opacity: .85; }
.btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.store-btn { text-align: left; }
.store-btn svg { width: 30px; height: 30px; flex: none; }

/* ------------------------------------------------------------ Héros */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 0%, #a9dcff 0%, transparent 60%),
    linear-gradient(180deg, #7cc3fb 0%, #c4e6ff calc(100% - 120px), #9edb7c calc(100% - 119px), #7cc95e 100%);
  padding: 36px 0 0;
  border-bottom: 3px solid var(--ink);
}
.hero .wrap { display: grid; gap: 28px; align-items: end; }
.hero-logo { width: min(100%, 520px); margin: 0 auto 6px; filter: drop-shadow(0 4px 0 rgba(22, 32, 58, .15)); }
.hero h1 { margin: 0; }
.hero-text { text-align: center; }
.hero .tagline {
  font-size: clamp(1.6rem, 6.6vw, 2.6rem);
  font-weight: 700; line-height: 1.12; margin: 0 0 .45em;
}
.hero .tagline .g { display: inline-block; padding: 0 .28em; border-radius: 10px; color: var(--white); border: 3px solid var(--ink); transform: rotate(-2deg); }
.hero .tagline .g--b { background: var(--blue); }
.hero .tagline .g--r { background: var(--red); transform: rotate(2deg); }
.hero .lead { font-size: 1.12rem; max-width: 34em; margin: 0 auto 1.4em; color: var(--ink); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 18px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 0; margin: 0 0 8px; list-style: none; }
.badges li { background: var(--white); border: 2px solid var(--ink); border-radius: 999px; padding: .3em .85em; font-weight: 600; font-size: .92rem; }

.phone {
  position: relative; width: min(78vw, 300px); margin: 0 auto -40px;
  aspect-ratio: 9 / 16;
  background: var(--ink); border-radius: 38px; padding: 10px;
  box-shadow: 0 0 0 3px var(--ink), 14px 14px 0 rgba(22, 32, 58, .22);
  transform: rotate(2.5deg);
}
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 29px; background: #6fb6ef; }
.phone::before { content: ""; position: absolute; top: 18px; left: 50%; translate: -50% 0; width: 76px; height: 20px; background: var(--ink); border-radius: 20px; z-index: 2; }
.video-toggle {
  position: absolute; right: -10px; bottom: 64px; z-index: 3;
  width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--yellow); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 0 var(--ink);
}
.video-toggle svg { width: 20px; height: 20px; }

.bubble {
  position: absolute; z-index: 4; left: -14px; top: 30%;
  max-width: 170px; background: var(--white); border: 3px solid var(--ink);
  border-radius: 18px; padding: 10px 12px; font-size: .9rem; line-height: 1.3; font-weight: 600;
  box-shadow: 0 4px 0 var(--ink); transform: rotate(-4deg);
}
.bubble .hud { display: block; color: var(--blue-text); font-size: .68rem; margin-bottom: 3px; }

@media (min-width: 900px) {
  .hero { padding-top: 56px; }
  .hero .wrap { grid-template-columns: 1.15fr .85fr; gap: 40px; }
  .hero-text { text-align: left; padding-bottom: 96px; }
  .hero-logo { margin: 0 0 14px -8px; }
  .hero .lead { margin-left: 0; }
  .hero-ctas, .badges { justify-content: flex-start; }
  .phone { width: 320px; margin: 0 auto -48px; }
  .bubble { left: -96px; top: 30%; max-width: 220px; }
}

/* Route : séparation en asphalte avec pointillés */
.road {
  height: 64px; background: var(--asphalt);
  background-image: linear-gradient(90deg, var(--yellow) 0 50%, transparent 50% 100%);
  background-size: 64px 6px; background-repeat: repeat-x; background-position: 0 50%;
  border-bottom: 3px solid var(--ink);
}

/* ------------------------------------------------------------ Sections */
.section { padding: 72px 0; }
.section--sky { background: var(--sky-light); border-block: 3px solid var(--ink); }
.section--asphalt { background: var(--asphalt); color: var(--white); }
.section--asphalt a { color: var(--yellow); }
.kicker { display: inline-block; margin-bottom: 14px; }
.section-head { max-width: 40em; margin-bottom: 36px; }
.section-head p { font-size: 1.12rem; color: var(--ink-soft); }
.section--asphalt .section-head p { color: #d6dcef; }

/* Portes de calcul */
.gates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 40px; }
.gate {
  position: relative; display: grid; place-items: center;
  aspect-ratio: 1 / 1; border: 3px solid var(--ink); border-radius: 14px;
  color: var(--white); font-weight: 700; font-size: clamp(1.7rem, 8vw, 4rem);
  text-shadow: 0 4px 0 rgba(22, 32, 58, .35);
  box-shadow: var(--shadow);
}
.gate::after { content: ""; position: absolute; inset: 8px 8px auto; height: 14%; background: rgba(255, 255, 255, .3); border-radius: 8px; }
.gate--b { background: var(--blue); }
.gate--r { background: var(--red); }
.gate:nth-child(odd) { transform: rotate(-1.5deg); }
.gate:nth-child(even) { transform: rotate(1.5deg); }
@media (min-width: 700px) { .gates { gap: 18px; } .gate { aspect-ratio: 5 / 3; border-radius: 16px; } }

.cards { display: grid; gap: 18px; }
.card {
  background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { display: flex; align-items: center; gap: 10px; }
.card .ico { width: 42px; height: 42px; flex: none; border-radius: 12px; border: 3px solid var(--ink); display: grid; place-items: center; font-weight: 700; color: var(--white); font-size: 1.5rem; line-height: 1; }
.card p:last-child { margin-bottom: 0; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards--4 { grid-template-columns: repeat(4, 1fr); } }

/* Mini-jeu des portes */
.trial {
  margin-top: 44px; background: var(--asphalt); color: var(--white);
  border: 3px solid var(--ink); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  display: grid; gap: 18px;
}
.trial h3 { margin: 0; }
.trial p { margin: 0; color: #d6dcef; }
.trial-count { display: flex; align-items: baseline; gap: 12px; }
.trial-count output { font-size: 3.4rem; font-weight: 700; line-height: 1; color: var(--yellow); }
.trial-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.trial-choices button {
  font: inherit; font-weight: 700; font-size: 2rem; color: var(--white);
  border: 3px solid var(--ink); border-radius: 14px; padding: .5em 0; cursor: pointer;
  box-shadow: 0 5px 0 #0c1222;
}
.trial-choices button:active { transform: translateY(4px); box-shadow: 0 1px 0 #0c1222; }
.trial-choices .b { background: var(--blue); }
.trial-choices .r { background: var(--red); }
.trial-log { min-height: 3em; font-weight: 600; margin-top: 18px !important; color: var(--white) !important; }
.trial-log .hud { color: var(--sky); display: block; margin-bottom: 4px; }
@media (min-width: 900px) { .trial { grid-template-columns: 1fr 1.2fr; align-items: center; padding: 30px; } .trial-side { display: grid; gap: 14px; } }

/* Galerie de captures */
.shots {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(64vw, 250px);
  gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 6px 16px 26px; margin: 0 -16px; scrollbar-width: thin;
}
.shots figure { margin: 0; scroll-snap-align: center; }
.shots img {
  width: 100%; height: auto; aspect-ratio: 540 / 960; object-fit: cover;
  border: 3px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); background: var(--sky);
}
.shots figcaption { margin-top: 12px; font-weight: 600; font-size: .98rem; }
@media (min-width: 1100px) { .shots { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; margin: 0; padding: 6px 0 0; } }

/* Arsenal */
.split { display: grid; gap: 34px; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 48px; } }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list li {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center;
  background: var(--asphalt-2); border: 2px solid #4a5374; border-radius: 16px; padding: 12px 14px;
}
.list .n { grid-row: span 2; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--yellow); color: var(--ink); font-weight: 700; }
.list strong { font-size: 1.08rem; }
.list span { color: #c9d0e6; font-size: .95rem; }
.list--towers .n { background: var(--sky); }
.subtitle { margin: 28px 0 14px; }

/* Base */
.base-grid { display: grid; gap: 22px; align-items: center; }
.base-grid .shot { border: 3px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); width: min(100%, 320px); margin: 0 auto; }
.buildings { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; list-style: none; padding: 0; margin: 0 0 18px; }
.buildings li { background: var(--white); border: 3px solid var(--ink); border-radius: 16px; padding: 12px 14px; box-shadow: 0 4px 0 var(--ink); }
.buildings strong { display: block; line-height: 1.2; margin-bottom: 4px; }
.buildings span { font-size: .92rem; color: var(--ink-soft); }
@media (min-width: 900px) { .base-grid { grid-template-columns: 1.3fr .7fr; gap: 48px; } }

/* Sergent */
.sergent { display: grid; gap: 26px; }
.idcard {
  background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.idcard header { background: var(--blue-text); color: var(--white); padding: 12px 18px; border-bottom: 3px solid var(--ink); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; align-items: center; }
.idcard dl { margin: 0; padding: 6px 18px 18px; }
.idcard dt { font-weight: 700; margin-top: 12px; font-size: .9rem; color: var(--blue-text); text-transform: uppercase; letter-spacing: .04em; }
.idcard dd { margin: 0; font-size: 1.1rem; }
@media (min-width: 560px) { .idcard dl { display: grid; grid-template-columns: 11em 1fr; gap: 10px 16px; padding-top: 16px; } .idcard dt { margin: 0; padding-top: 3px; } }
.quote-box {
  background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; display: grid; gap: 14px; align-content: start;
}
.quote-box .hud { color: var(--blue-text); }
.quote-box blockquote { margin: 0; font-size: clamp(1.4rem, 5vw, 1.9rem); font-weight: 600; line-height: 1.25; min-height: 3.75em; }
.quote-box .moment { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.quotes-all { margin-top: 18px; }
.quotes-all summary { cursor: pointer; font-weight: 700; }
.quotes-all ul { columns: 2 260px; column-gap: 28px; padding-left: 1.1em; }
.quotes-all li { break-inside: avoid; margin-bottom: 6px; }
@media (min-width: 900px) { .sergent { grid-template-columns: .9fr 1.1fr; } }

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details { background: var(--white); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 4px 0 var(--ink); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 52px 16px 18px; font-weight: 700; font-size: 1.1rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 50%; translate: 0 -50%; width: 28px; height: 28px; border-radius: 8px; background: var(--blue); color: var(--white); display: grid; place-items: center; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; background: var(--red); }
.faq details > div { padding: 0 18px 16px; }
.faq details > div p:last-child { margin: 0; }

/* Inscription */
.signup {
  background: var(--yellow); border: 3px solid var(--ink); border-radius: 28px; box-shadow: 0 8px 0 var(--ink);
  padding: 28px 22px; display: grid; gap: 18px; position: relative; overflow: hidden;
}
.signup h2 { font-size: clamp(1.9rem, 6vw, 2.8rem); margin: 0 0 .3em; }
.signup p { margin: 0; font-size: 1.08rem; }
.signup .note { font-size: .92rem; color: var(--ink-soft); }
.signup form { display: flex; flex-wrap: wrap; gap: 10px; }
.signup input[type="email"] {
  flex: 1 1 220px; font: inherit; font-size: 1.05rem; padding: .75em 1em;
  border: 3px solid var(--ink); border-radius: 16px; background: var(--white); color: var(--ink);
}
.signup .deco { display: inline-block; background: var(--blue); color: var(--white); border: 3px solid var(--ink); border-radius: 12px; padding: 0 .3em; transform: rotate(-5deg); margin-right: .1em; }
@media (min-width: 900px) { .signup { grid-template-columns: 1.2fr 1fr; align-items: center; padding: 44px; } }

/* ------------------------------------------------------------ Pages texte (légal, support) */
.page-head { background: var(--sky-light); border-bottom: 3px solid var(--ink); padding: 44px 0 34px; }
.page-head h1 { font-size: clamp(2.1rem, 7vw, 3.2rem); }
.page-head p { color: var(--ink-soft); margin: 0; }
.prose { max-width: 760px; padding: 44px 0 72px; }
.prose h2 { font-size: 1.6rem; margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .97rem; margin: 0 0 1.4em; }
.prose th, .prose td { border: 2px solid var(--ink); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--sky-light); }
.table-scroll { overflow-x: auto; }
.callout { background: var(--white); border: 3px solid var(--ink); border-radius: 18px; padding: 16px 18px; box-shadow: 0 4px 0 var(--ink); margin: 0 0 1.5em; }
.callout--ok { background: #e3f8de; }
.todo { background: #fff0a8; border-radius: 6px; padding: 0 .3em; font-weight: 600; }

/* ------------------------------------------------------------ Pied de page */
.site-footer { background: var(--asphalt); color: #d6dcef; padding: 0 0 36px; }
.site-footer .road { border-bottom: 0; border-top: 3px solid var(--ink); }
.footer-grid { display: grid; gap: 26px; padding-top: 34px; }
.footer-grid img { height: 64px; width: auto; }
.site-footer h2 { font-size: 1rem; color: var(--white); margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--white); }
.site-footer small { display: block; margin-top: 26px; color: #aab3cf; font-size: .88rem; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }

/* Petite animation d'entrée */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; translate: 0 24px; transition: opacity .5s ease, translate .5s ease; }
  .js .reveal.is-in { opacity: 1; translate: 0 0; }
  .bubble { animation: bob 3.2s ease-in-out infinite; }
  @keyframes bob { 50% { translate: 0 -6px; } }
}

.trial-log .calc { display: block; margin-top: 6px; color: var(--yellow); font-weight: 600; }
.trial #trial-restart { margin-top: 4px; }
