/* formation-flutter.fr: the site's only stylesheet, a copy of the one of
   freelance-flutter.fr. Tokens first, then base, layout and components. */

/* ---------- Fonts (latin subset, self-hosted) ---------- */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/fonts/atkinson-hyperlegible-next-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  /* Palette. Only the role tokens below read it: components never use it
     directly. Green theme of formation-flutter.fr (freelance-flutter.fr is
     blue); the names stay those of the shared stylesheet, so --navy and the
     --sky-* steps hold greens. */
  --flutter-pale: #6be59f;
  --flutter-light: #3ddc84;
  --flutter-mid: #23a35a;
  --flutter: #188038;
  --flutter-text: #137333;
  --flutter-deep: #0d5c2a;
  --navy: #0b4d2c;
  --night: #0d2418;

  /* Sky */
  --sky-1: #d6f2df;
  --sky-2: #effaf2;

  /* Pale greys of the night background */
  --mist-1: #d5e2d9;
  --mist-2: #b9c9bf;
  --mist-3: #a9bcaf;

  /* Ink, yellow, red and backgrounds */
  --ink: #0e1128;
  --ink-soft: #3c4262;
  --yellow: #f6b93b;
  --orange: #ee7f4b;
  --red: #b3261e;
  --red-pale: #fbeceb;
  --cream: #f7f1e3;
  --paper: #fbfaf6;
  --line-strong: #8c8778;
  --white: #ffffff;
  --line: #dfdbcc;

  /* Roles: the only colour tokens components use. */
  --color-bg-page: var(--cream);
  /* --cream at 85 %, over the blurred page */
  --color-bg-header: rgb(247 241 227 / 0.85);
  --color-bg-surface: var(--white);
  --color-bg-surface-hover: var(--paper);
  --color-bg-strong: var(--ink);
  --color-bg-inverse: var(--night);
  --color-bg-accent: var(--flutter-light);
  --color-bg-accent-subtle: var(--sky-1);
  --color-bg-highlight: var(--flutter-light);
  --color-bg-error: var(--red-pale);
  /* --night at 35 % and 55 %, behind the mobile menu and the dialog */
  --color-overlay: rgb(13 36 24 / 0.35);
  --color-overlay-strong: rgb(13 36 24 / 0.55);

  --color-text: var(--ink);
  --color-text-secondary: var(--ink-soft);
  /* 5.3:1 on cream, for text of any size */
  --color-text-accent: var(--flutter-text);
  --color-text-accent-strong: var(--navy);
  /* 4.46:1 on cream: large or bold text only */
  --color-text-brand: var(--flutter);
  --color-text-on-accent: var(--white);
  --color-text-error: var(--red);
  --color-text-inverse: var(--white);
  --color-text-inverse-soft: var(--mist-1);
  --color-text-inverse-secondary: var(--mist-2);
  --color-text-inverse-muted: var(--mist-3);
  --color-text-inverse-accent: var(--flutter-light);

  --color-border: var(--line);
  /* Form field outline: 3.6:1 on white, the 3:1 non-text minimum. */
  --color-border-field: var(--line-strong);
  --color-border-strong: var(--ink);
  --color-border-error: var(--red);
  --color-border-inverse: rgb(255 255 255 / 0.12);
  --color-grid-inverse: rgb(255 255 255 / 0.05);
  --color-focus: var(--flutter);
  --color-accent-strong: var(--navy);

  /* Filled buttons: fill, hover fill and the pixel ledge below */
  --color-accent-solid: var(--flutter);
  --color-accent-solid-hover: var(--flutter-text);
  --color-accent-solid-ledge: var(--flutter-deep);
  --color-accent-bright: var(--flutter-light);
  --color-accent-bright-hover: var(--flutter-pale);
  --color-accent-bright-ledge: var(--flutter-mid);
  --color-button-shine: rgb(255 255 255 / 18%);

  /* Illustrations: the pixel scenes, like the palettes of the Dart sprites */
  --scene-sky: var(--sky-1);
  --scene-sky-light: var(--sky-2);
  --scene-wall-top: #e3f3e8;
  --scene-wall-middle: #f1f9f3;
  --scene-wall-bottom: #e7f4eb;
  --scene-floor: #d9b27c;
  --scene-ground: #efe6cf;
  --scene-tile-shape: var(--ink);
  --scene-tile-square: var(--yellow);
  --scene-tile-round: var(--flutter-light);
  --scene-tile-diamond: var(--orange);

  /* Shapes */
  --radius-card: 22px;
  --radius-btn: 10px;
  --shadow-card: 0 30px 60px -30px rgb(0 0 0 / 0.35);

  /* Type */
  --font-heading: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible Next', system-ui, sans-serif;

  /* Layout */
  --wrap: 1120px;
  --gutter: 24px;
  --header-height: 72px;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-height) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg-page);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--color-text-accent);
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3,
.h1,
.h2,
.h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.2;
  text-wrap: balance;
}

.h1 {
  font-size: clamp(2.75rem, 1.5rem + 5vw, 5.25rem);
  line-height: 1;
}

.h2 {
  font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.25rem);
  line-height: 1.05;
}

.h3 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.lead {
  margin: 1.75rem 0 0;
  max-width: 28em;
  color: var(--color-text-secondary);
  font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3125rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.eyebrow {
  margin: 0 0 0.75rem;
  /* --color-text-brand is 4.46:1 on cream, below AA for this size. */
  color: var(--color-text-accent-strong);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Highlighted words in titles */
.hl {
  display: inline-block;
  padding: 0 0.15em;
  border-radius: 14px;
  background: var(--color-bg-highlight);
  transform: rotate(-2deg);
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 2.5rem;
}

.page-intro {
  padding-top: 72px;
  padding-bottom: 96px;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-btn);
  background: var(--color-bg-strong);
  color: var(--color-text-inverse);
  font-weight: 700;
  transform: translateY(-200%);
}

.skip-link:focus {
  color: var(--color-text-inverse);
  transform: none;
}

main:focus {
  outline: none;
}

/* ---------- Buttons ---------- */

/* A 3 px pixel ledge under each button, in the border colour for white
   ones. Pressing pushes the button 2 px down onto a 1 px ledge, only while
   the pointer stays on it (:active alone sticks until the mouse is
   released, even outside). */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-btn);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 80ms,
    box-shadow 80ms,
    background-color 0.12s;
}

.btn:not(:disabled):active:hover {
  transform: translateY(2px);
}

.btn--primary {
  background: var(--color-accent-solid);
  color: var(--color-text-on-accent);
  box-shadow:
    0 3px 0 var(--color-accent-solid-ledge),
    inset 0 1px 0 var(--color-button-shine);
}

.btn--primary:hover {
  background: var(--color-accent-solid-hover);
  color: var(--color-text-on-accent);
}

.btn--primary:not(:disabled):active:hover {
  box-shadow: 0 1px 0 var(--color-accent-solid-ledge);
}

.btn--secondary {
  background: var(--color-bg-surface);
  color: var(--color-text);
  box-shadow:
    inset 0 0 0 1px var(--color-border),
    0 3px 0 var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-bg-surface-hover);
  color: var(--color-text);
}

.btn--secondary:not(:disabled):active:hover {
  box-shadow:
    inset 0 0 0 1px var(--color-border),
    0 1px 0 var(--color-border);
}

.btn--sky {
  background: var(--color-accent-bright);
  color: var(--color-text);
  box-shadow: 0 3px 0 var(--color-accent-bright-ledge);
}

.btn--sky:hover {
  background: var(--color-accent-bright-hover);
  color: var(--color-text);
}

.btn--sky:not(:disabled):active:hover {
  box-shadow: 0 1px 0 var(--color-accent-bright-ledge);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* ---------- Cards and separators ---------- */

.card {
  padding: 34px;
  border-radius: var(--radius-card);
  background: var(--color-bg-surface);
  box-shadow: var(--shadow-card);
}

/* Speech bubbles: the only brutalist touch */
.bubble {
  padding: 10px 18px;
  border: 2px solid var(--color-border-strong);
  border-radius: 16px;
  background: var(--color-bg-surface);
  box-shadow: 4px 4px 0 var(--color-border-strong);
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 800;
}

/* ---------- Link lists ---------- */

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list a {
  text-decoration: none;
}

.link-list a:hover {
  text-decoration: underline;
}

.link-list--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 2rem;
  font-weight: 700;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-header);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: var(--header-height);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.logo:hover {
  color: var(--color-text);
}

.logo__accent {
  color: var(--color-text-brand);
}

.site-nav {
  margin-left: auto;
}

.site-nav .link-list {
  display: flex;
  gap: 28px;
  font-weight: 700;
}

.site-nav a[aria-current='page'],
.mobile-menu a[aria-current='page'] {
  color: var(--color-text-accent);
}

.site-header__cta {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 0.9375rem;
}

.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
}

.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  display: block;
  width: 22px;
  height: 2px;
  margin: 0 auto;
  border-radius: 1px;
  background: currentColor;
}

.menu-toggle__bars {
  position: relative;
}

.menu-toggle__bars::before,
.menu-toggle__bars::after {
  position: absolute;
  left: 0;
  content: '';
}

.menu-toggle__bars::before {
  top: -7px;
}

.menu-toggle__bars::after {
  top: 7px;
}

/* Native popover menu, works without JavaScript.
   Position, display and overflow come from the UA popover styles. */
.mobile-menu {
  inset: var(--header-height) 0 auto 0;
  width: auto;
  max-height: calc(100dvh - var(--header-height));
  margin: 0;
  padding: 8px var(--gutter) 24px;
  overscroll-behavior: contain;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-page);
  box-shadow: var(--shadow-card);
  color: var(--color-text);
}

.mobile-menu .link-list a {
  display: block;
  padding: 12px 8px;
  font-size: 1.125rem;
  font-weight: 700;
}

.mobile-menu li + li {
  border-top: 1px solid var(--color-border);
}

/* .btn is inline-flex: flex makes it full width */
.mobile-menu__cta {
  display: flex;
  margin-top: 16px;
}

.mobile-menu__veil {
  display: none;
}

@media (max-width: 860px) {
  .site-nav,
  .site-header__cta {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  /* Slides in on open; closing is instant */
  .mobile-menu:popover-open {
    transition:
      opacity 0.2s ease-out,
      transform 0.2s ease-out;
  }

  @starting-style {
    .mobile-menu:popover-open {
      opacity: 0;
      transform: translateY(-8px);
    }
  }

  /* Veil below the header: the header stays bright and ✕ gets the tap */
  .mobile-menu::backdrop {
    /* Fallbacks: older ::backdrop does not inherit custom properties */
    inset: var(--header-height, 72px) 0 0;
    background: var(--color-overlay, rgb(13 36 24 / 0.35));
  }

  /* Transparent layer over the veil, behind the panel content: a tap
     closes the menu without reaching the page */
  .mobile-menu:popover-open .mobile-menu__veil {
    position: fixed;
    inset: var(--header-height) 0 0;
    z-index: -1;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
  }

  /* Opaque header and locked page while open */
  .site-header:has(.mobile-menu:popover-open) {
    background: var(--color-bg-page);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  html:has(.mobile-menu:popover-open) {
    overflow: hidden;
  }

  /* ☰ → ✕ */
  .menu-toggle__bars,
  .menu-toggle__bars::before,
  .menu-toggle__bars::after {
    transition:
      transform 0.2s,
      background-color 0.2s;
  }

  .site-header:has(.mobile-menu:popover-open) .menu-toggle__bars {
    background: transparent;
  }

  .site-header:has(.mobile-menu:popover-open) .menu-toggle__bars::before {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header:has(.mobile-menu:popover-open) .menu-toggle__bars::after {
    transform: translateY(-7px) rotate(-45deg);
  }
}

@media (width > 860px) {
  .mobile-menu {
    display: none;
  }
}

/* ---------- Sky hero ---------- */

.sky {
  position: relative;
  overflow: hidden;
}

.hero {
  padding-top: 72px;
  padding-bottom: 120px;
  text-align: center;
}

.hero .lead {
  margin-right: auto;
  margin-left: auto;
}

.hero .lead strong {
  color: var(--color-text);
}

.lead.lead--next {
  margin-top: 1rem;
}

.hero .actions {
  justify-content: center;
}

/* Decorative layer of the home sky: rays, clouds, sun and phones */
.sky__decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* formation-flutter.fr only: the home hero is a classroom. A pale wall
   with a chalkboard, a window and a clock, then wainscoting and parquet
   under Dash and the robot. */
.classroom {
  background: linear-gradient(
    var(--scene-wall-top) 0%,
    var(--scene-wall-middle) 70%,
    var(--scene-wall-bottom) 100%
  );
}

.classroom__shelf {
  top: 236px;
  left: 4%;
  width: 168px;
}

.classroom__window {
  top: 236px;
  right: 4%;
  width: 176px;
}

.classroom__clock {
  top: 250px;
  right: calc(4% + 200px);
  width: 56px;
}

.classroom__clock-hand {
  transform-origin: 50% 100%;
  animation: tick 60s steps(60) infinite;
}

/* Leaves room above the wainscot for the frieze of posters. */
.sky--home.classroom .hero {
  padding-bottom: 210px;
}

/* The shelf and the window take 4% + 176px on each side from 1181px up,
   and the clock 4% + 256px on the right from 1361px up: the text stays
   between them, with a gutter, on both sides to stay centred. */
@media (min-width: 1181px) {
  .sky--home.classroom .hero {
    max-width: min(var(--wrap), calc(92vw - 368px));
  }
}

@media (min-width: 1361px) {
  .sky--home.classroom .hero {
    max-width: min(var(--wrap), calc(92vw - 528px));
  }
}

/* The board and the programming posters hang above the wainscot. */
.classroom__frieze {
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  display: flex;
  gap: 48px;
  align-items: center;
  justify-content: center;
  padding-bottom: 20px;
}

.classroom__frieze .pixel {
  position: static;
}

.classroom__board {
  width: 260px;
}

.classroom__poster {
  width: 64px;
}

/* Desks on the parquet; Dash and the robot sit at the two middle ones. */
.classroom__desk {
  bottom: 24px;
  width: 140px;
  translate: -50% 0;
}

.classroom__desk--1 {
  left: 10%;
}

.classroom__desk--2 {
  left: 24%;
}

.classroom__desk--3 {
  left: 78%;
}

.classroom__desk--4 {
  left: 92%;
}

.classroom__desk--dash {
  left: 42%;
}

.classroom__desk--robot {
  left: 60%;
}

.classroom .world__actor {
  bottom: 70px;
}

.classroom__wainscot {
  display: block;
  width: 100%;
  height: 100%;
}

.world__ground.classroom__floor {
  background: var(--scene-floor);
}

@keyframes tick {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1360px) {
  .classroom__clock {
    display: none;
  }
}

@media (max-width: 860px) {
  .sky--home.classroom .hero {
    padding-bottom: 170px;
  }

  .classroom__frieze {
    gap: 16px;
  }

  .classroom__board {
    width: 180px;
  }

  .classroom__poster {
    width: 44px;
  }

  .classroom__poster:first-child,
  .classroom__poster:last-child,
  .classroom__desk--1,
  .classroom__desk--2,
  .classroom__desk--3,
  .classroom__desk--4 {
    display: none;
  }

  .classroom__desk--dash,
  .classroom__desk--robot {
    width: 100px;
  }

  .classroom__desk--dash {
    left: 30%;
  }

  .classroom__desk--robot {
    right: calc(var(--gutter) - 26px);
    left: auto;
    translate: none;
  }

  .classroom .world__actor {
    bottom: 56px;
  }
}

@media (max-width: 1180px) {
  .classroom__shelf,
  .classroom__window,
  .classroom__clock {
    display: none;
  }

  .classroom__desk--1,
  .classroom__desk--2,
  .classroom__desk--3,
  .classroom__desk--4 {
    width: 110px;
  }
}

/* Inner pages: sky banner with a plain ground strip */
/* The sky ends on its darker green, so the pixel edge into the cream page
   stays visible. */
.page-hero {
  background: linear-gradient(
    var(--scene-sky) 0%,
    var(--scene-sky-light) 55%,
    var(--scene-sky) 100%
  );
}

.page-hero .hero {
  padding-bottom: 96px;
}

.sky--home .hero {
  position: relative;
  padding-bottom: 56px;
}

/* Pixel art: phones in the sky, then the world under the home hero */
.pixel {
  position: absolute;
  shape-rendering: crispEdges;
}

.pixel g {
  transform-box: fill-box;
}

/* The world: stepped hills, then a ground where Dash and the robot chat */
.world {
  position: relative;
}

.world__hills {
  position: relative;
  overflow: hidden;
  height: 64px;
}

.world__ground {
  position: relative;
  height: 230px;
  background: var(--scene-ground);
}

.world__speckles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.world__actor {
  position: absolute;
  bottom: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  translate: -50% 0;
}

.world__actor--dash {
  left: 42%;
}

.world__actor--robot {
  left: 60%;
}

.world__actor .pixel {
  position: static;
}

.world__dash {
  width: 112px;
  animation: bob 1.4s ease-in-out infinite;
}

.world__dash .dash-wing {
  transform-origin: 100% 0;
  animation: flap 0.35s ease-in-out infinite alternate;
}

.world__robot {
  width: 72px;
  animation: hop 2.4s ease-in-out infinite;
}

.sky__robot-light {
  animation: blink 1.2s steps(1) infinite;
}

.sky__robot-eyes {
  transform-origin: 50% 50%;
  animation: wink 4s ease-in-out infinite;
}

.world__bubble {
  margin: 0;
  white-space: nowrap;
  animation:
    popin 0.6s ease-out 0.9s both,
    float 3s ease-in-out 1.5s infinite;
}

.world__bubble--robot {
  animation-delay: 1.3s, 2.4s;
}

/* Small Dash in the logo and the secondary hero button */
.logo__dash,
.btn__dash {
  position: static;
  flex: none;
}

/* 8-bit arrows, in the colour of the text */
.pixel.icon {
  position: static;
  flex: none;
  width: 14px;
  transition: translate 0.15s steps(2);
}

.btn:hover .icon--next {
  translate: 2px 0;
}

/* formation-flutter.fr: Dash behind a school desk, 20 × 16 pixels */
.logo__dash {
  width: 40px;
}

/* Dash flutters when the logo is hovered or focused */
.logo:hover .logo__dash,
.logo:focus-visible .logo__dash {
  animation: logo-hop 0.5s ease-in-out infinite;
}

.logo .dash-wing {
  transform-origin: 100% 0;
}

.logo:hover .dash-wing,
.logo:focus-visible .dash-wing {
  animation: flap 0.18s ease-in-out infinite alternate;
}

.btn__dash {
  width: 24px;
}

@media (max-width: 860px) {
  .world__ground {
    height: 200px;
  }

  .world__dash {
    width: 76px;
  }

  .world__actor--dash {
    left: 30%;
  }

  .world__actor--dash .world__bubble {
    display: none;
  }

  .world__actor--robot {
    right: var(--gutter);
    left: auto;
    align-items: flex-end;
    translate: none;
  }

  .world__robot {
    width: 48px;
  }
}

@keyframes logo-hop {
  50% {
    transform: translateY(-3px) rotate(-6deg);
  }
}

@keyframes bob {
  50% {
    transform: translateY(6px);
  }
}

@keyframes flap {
  to {
    transform: scaleY(0.3);
  }
}

@keyframes float {
  50% {
    translate: 0 -10px;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes hop {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  70% {
    transform: translateY(-8px);
  }

  80% {
    transform: translateY(0);
  }
}

@keyframes wink {
  0%,
  92%,
  100% {
    transform: scaleY(1);
  }

  96% {
    transform: scaleY(0.1);
  }
}

@keyframes popin {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }

  70% {
    transform: scale(1.06);
  }

  100% {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Pixel edges between sections ----------
   The colour below rises into the colour above through a dithered row of
   8 px squares, drawn by masking a plain colour with dither.svg. */

.page-hero::after,
.world__ground::after,
.dark::before,
.dark::after,
.site-footer::before {
  position: absolute;
  right: 0;
  left: 0;
  height: 32px;
  background: var(--edge-color);
  content: '';
  mask: url('/images/dither.svg') 0 0 / 64px 32px repeat-x;
  pointer-events: none;
}


/* -1px covers the seam a fractional section height can leave. */
/* Page heroes: the sky goes straight into the cream page. */
.page-hero::after,
.world__ground::after,
.dark::after {
  bottom: -1px;
  --edge-color: var(--color-bg-page);
}

/* On the home page, the key figures band follows the ground. */
.world__ground::after {
  --edge-color: var(--color-bg-accent);
}

.dark,
.site-footer {
  position: relative;
}

.dark::before,
.site-footer::before {
  bottom: calc(100% - 1px);
  --edge-color: var(--color-bg-inverse);
}

/* ---------- Sections ---------- */

.section {
  padding-top: 96px;
  padding-bottom: 96px;
}

.section--last {
  padding-top: 0;
}

.section > .lead {
  margin-bottom: 48px;
}

/* Fade in on scroll, CSS only: content stays visible without support */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: rise linear both;
      animation-range: entry 0% cover 30%;
      animation-timeline: view();
    }
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Key figures ---------- */

/* A full-width green band, between the ground and the dark section;
   ink text is 10.4:1 on it. */
.figures-band {
  /* The dark section's pixel edge covers the last 32 px: 88 px of clear
     green on each side. */
  padding: 88px 0 120px;
  background: var(--color-bg-accent);
  color: var(--color-text);
}

.key-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin: 0 auto;
  list-style: none;
}

.key-figures p {
  margin: 0;
}

.key-figures__label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 1rem;
  font-weight: 700;
}

/* A pixel square before each label */
.key-figures__label::before {
  width: 10px;
  height: 10px;
  background: var(--color-accent-strong);
  content: '';
}

.key-figures__caption {
  font-size: 1rem;
}

.key-figures__value {
  margin-top: 8px;
  font-family: var(--font-heading);
  font-size: clamp(2.75rem, 2rem + 2.4vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

/* ---------- Dark project section ---------- */

.dark {
  background-color: var(--color-bg-inverse);
  background-image:
    linear-gradient(var(--color-grid-inverse) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid-inverse) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--color-text-inverse);
}

.dark .lead {
  margin-bottom: 40px;
  color: var(--color-text-inverse-secondary);
}

.dark__accent {
  color: var(--color-text-inverse-accent);
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 56px;
  align-items: center;
}

.features {
  display: grid;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.feature__title {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.feature__text {
  margin: 6px 0 0;
  color: var(--color-text-inverse-secondary);
}

/* Square tiles with a pixel shape in the middle */
.tile {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
}

.tile::before {
  width: 18px;
  height: 18px;
  background: var(--scene-tile-shape);
  content: '';
}

.tile--square {
  background: var(--scene-tile-square);
}

.tile--round {
  background: var(--scene-tile-round);
}

.tile--round::before {
  border-radius: 50%;
}

.tile--diamond {
  background: var(--scene-tile-diamond);
}

.tile--diamond::before {
  transform: rotate(45deg);
}

/* ---------- Offers and card grids ---------- */

.offers,
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 24px;
}

.offer-card {
  position: relative;
  transition: transform 0.15s ease;
}

.offer-card:hover {
  transform: translateY(-3px);
}

.offer-card__number {
  margin: 0;
  color: var(--color-text-brand);
  font-weight: 700;
}

.offer-card__title {
  margin: 12px 0;
}

.offer-card__title a {
  text-decoration: none;
}

/* The title link covers the whole card */
.offer-card__title a::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: '';
}

.offer-card:has(a:focus-visible) {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.offer-card__title a:focus-visible {
  outline: none;
}

.offer-card__text {
  margin: 0;
  color: var(--color-text-secondary);
}

/* Card lists */
.grid {
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

.grid .h3 {
  margin-bottom: 12px;
}

.grid p {
  margin: 0;
  color: var(--color-text-secondary);
}

/* formation-flutter.fr: pixel-art icon of an IconCardGrid card */
.card__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: var(--color-bg-accent-subtle);
}

.card__icon .pixel {
  position: static;
  width: 48px;
}

/* FAQ: native accordion, no JavaScript */
.faq {
  margin-top: 40px;
  border-top: 1px solid var(--color-border);
}

.faq__item {
  border-bottom: 1px solid var(--color-border);
}

.faq__item summary {
  padding: 20px 0;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.faq__item p {
  margin: 0 0 20px;
  max-width: 30em;
  color: var(--color-text-secondary);
}

/* Logos of the trainer page: all 76 px high, shown at half size. Their
   width and height attributes keep the layout from shifting. */
/* References on the home page: same-size tiles, one grey logo each. */
.logos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin: 16px 0 40px;
  padding: 0;
  list-style: none;
}

.logos__item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 16px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  background: var(--color-bg-surface);
  text-align: center;
}

.logos img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 38px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.7;
  transition:
    filter 0.2s,
    opacity 0.2s;
}

/* Nearly square logos get more height, for the same visual weight. */
.logos img.logos__img--compact {
  height: 56px;
}

/* Grey and even at rest, in colour under the pointer */
.logos__item:hover img {
  filter: none;
  opacity: 1;
}

/* ---------- Long-form text ---------- */

.prose {
  max-width: 48rem;
}

.prose h1 {
  margin-bottom: 40px;
}

.prose h2 {
  margin: 48px 0 16px;
}

.prose h3 {
  margin: 32px 0 8px;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.prose p,
.prose ul {
  margin: 0 0 1rem;
}

.prose p,
.prose ul {
  max-width: 30em;
}

.prose p {
  text-wrap: pretty;
}

.prose li + li {
  margin-top: 0.25rem;
}

.prose a {
  color: var(--color-text-accent);
}

.author-card {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  margin-top: 64px;
}

.author-card > div {
  flex: 1 1 280px;
}

.author-card p {
  margin: 0 0 8px;
  max-width: 30em;
}

.author-card .actions {
  margin-top: 20px;
}

.author-card__avatar {
  image-rendering: pixelated;
}

.author-card__name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
}

/* ---------- Contact ---------- */

.contact__form {
  max-width: 820px;
  margin: 0 auto;
}

.contact-form {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border-field);
  border-radius: var(--radius-btn);
  background: var(--color-bg-surface);
  color: var(--color-text);
  font: inherit;
}

.field textarea {
  resize: vertical;
}

.field [aria-invalid='true'] {
  border-color: var(--color-border-error);
}

.field__help {
  margin: 0;
  max-width: 34em;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.field__error {
  margin: 0;
  color: var(--color-text-error);
  font-size: 0.9375rem;
}

/* Honeypot: off-screen rather than display: none, which bots skip. */
.contact-form__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form .btn {
  justify-self: start;
}

.contact-form__hint {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.alert {
  margin: 0;
  padding: 14px 18px;
  border-radius: var(--radius-btn);
  background: var(--color-bg-error);
}

.alert:empty {
  display: none;
}

/* Confirmation after a successful send, opened as a modal. */
.contact-dialog {
  width: min(440px, calc(100% - 2 * var(--gutter)));
  padding: 34px;
  border: 0;
  border-radius: var(--radius-card);
  background: var(--color-bg-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
}

.contact-dialog::backdrop {
  background: var(--color-overlay-strong, rgb(13 36 24 / 0.55));
}

.contact-dialog h2 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.contact-dialog p {
  margin: 12px 0 24px;
  color: var(--color-text-secondary);
}

.contact-dialog form {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

/* Room for the Turnstile widget (65 px): no layout shift when it loads. */
.contact__captcha {
  min-height: 65px;
  margin-top: 20px;
}

.contact__note {
  margin: 16px 0 0;
  max-width: 34em;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

@media (max-width: 860px) {
  .contact__form {
    padding: 24px;
  }
}

/* Below 300 px of content, Turnstile renders compact: 150 × 140. */
@media (max-width: 395px) {
  .contact__captcha {
    min-height: 140px;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 56px 0 32px;
  background: var(--color-bg-inverse);
  color: var(--color-text-inverse-soft);
  font-size: 0.9375rem;
}

.site-footer a:hover {
  color: var(--color-text-inverse-accent);
}

.site-footer p {
  margin: 0 0 0.5rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.site-footer__name {
  color: var(--color-text-inverse);
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 800;
}

.site-footer .link-list li + li {
  margin-top: 0.5rem;
}

.site-footer__legal {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px 24px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-inverse);
  color: var(--color-text-inverse-muted);
  font-size: 0.875rem;
}

.site-footer__legal > :last-child {
  justify-self: end;
}

@media (max-width: 640px) {
  .site-footer__legal {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .site-footer__legal > :last-child {
    justify-self: center;
  }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
