/* ==========================================================================
   saut.css — labs/le-saut.html
   Mobile-first. Breakpoints: 600px and 900px (min-width).
   ========================================================================== */

/* 1. Fonts ------------------------------------------------------------- */

@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-100_900-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-100_900-normal-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1EFF, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('../fonts/plex-mono-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('../fonts/plex-mono-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* 2. Tokens ------------------------------------------------------------ */

:root {
  --nuit: #0d1524;
  --ivoire: #eceef1;
  --blanc: #fafbfc;
  --craie: #f1f3f5;
  --encre: #0d1524;
  --gris-nuit: #94a0b4;
  --gris-ivoire: #4b5668;
  --ambre: #f5a524;
  --ambre-texte: #9a5205;
  --f-text: 'Archivo', system-ui, sans-serif;
  --f-mono: 'Plex Mono', ui-monospace, monospace;
  --t-xl: clamp(2.75rem, 1.6rem + 4.2vw, 5.5rem);
  --t-l: clamp(2rem, 1.4rem + 2.4vw, 3.5rem);
  --t-m: clamp(1.375rem, 1.15rem + .8vw, 2rem);
  --t-body: clamp(1rem, .96rem + .2vw, 1.125rem);
  --t-s: .875rem;
  --t-xs: .75rem;
  --gutter: clamp(16px, 2vw, 28px);
  --margin: calc(var(--gutter) * 2);
  --ease: cubic-bezier(.3, 0, .2, 1.12);
  --soft: cubic-bezier(.165, .84, .44, 1);
  --sp-tight: 64px;
  --sp-normal: 96px;
  --sp-airy: 144px;
}

/* 3. Base -------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--nuit);
  color: var(--craie);
  font: 400 var(--t-body)/1.55 var(--f-text);
  font-stretch: 100%;
}

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

a {
  color: inherit;
}

::selection {
  background: var(--ambre);
  color: var(--nuit);
}

:focus-visible {
  outline: 2px solid var(--ambre);
  outline-offset: 3px;
}

.tone-ivoire :focus-visible,
.tone-blanc :focus-visible {
  outline-color: var(--encre);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--f-text);
  font-weight: 640;
  font-stretch: 112%;
  letter-spacing: -.03em;
  line-height: .95;
  text-wrap: balance;
}

h1 {
  font-size: var(--t-xl);
}

h2 {
  font-size: var(--t-l);
}

h3 {
  font-size: var(--t-m);
  line-height: 1.05;
  letter-spacing: -.015em;
}

p {
  margin: 0;
  max-width: 62ch;
}

.skip-link {
  position: absolute;
  left: var(--margin);
  top: -80px;
  background: var(--ambre);
  color: var(--nuit);
  padding: 10px 14px;
  font-weight: 600;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* 4. Tones ------------------------------------------------------------- */

.tone-nuit {
  background: var(--nuit);
  color: var(--craie);
}

.tone-nuit p {
  color: var(--gris-nuit);
}

.tone-ivoire {
  background: var(--ivoire);
  color: var(--encre);
}

.tone-ivoire p {
  color: var(--gris-ivoire);
}

.tone-blanc {
  background: var(--blanc);
  color: var(--encre);
}

.tone-blanc p {
  color: var(--gris-ivoire);
}

/* 5. Grid -------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
  max-width: 1440px;
  margin-inline: auto;
}

.grid > h2 {
  grid-column: 1 / -1;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .grid > h2 {
    grid-column: 1 / span 6;
  }
}

/* 6. Header ------------------------------------------------------------ */

.frame {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--margin);
  color: var(--encre);
  background: var(--blanc);
  border-bottom: 1px solid rgba(13, 21, 36, .1);
  transition: translate .5s var(--soft);
}

html.frame-away .frame {
  translate: 0 -110%;
}

.frame__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 600;
  font-stretch: 105%;
  letter-spacing: -.01em;
}

.frame__brand img {
  width: 36px;
  height: 36px;
  mix-blend-mode: multiply;
  border-radius: 0;
}

.frame__nav {
  display: none;
  position: relative;
}

.frame__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 32px;
}

.nav-link {
  text-decoration: none;
  font-size: var(--t-s);
  font-weight: 500;
  padding: 6px 0;
  display: inline-block;
}

.nav-marker {
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 6px;
  height: 6px;
  background: var(--ambre);
  pointer-events: none;
  opacity: 0;
}

.nav-link[aria-current="page"] {
  color: var(--ambre-texte);
}

.lang-toggle,
.menu-toggle {
  background: none;
  border: 1px solid rgba(13, 21, 36, .35);
  color: inherit;
  font: 500 var(--t-xs)/1 var(--f-mono);
  letter-spacing: .06em;
  padding: 9px 10px;
  min-width: 44px;
  min-height: 36px;
  cursor: pointer;
  transition: background .3s var(--soft), color .3s var(--soft);
}

@media (hover: hover) {
  .lang-toggle:hover,
  .menu-toggle:hover {
    background: var(--encre);
    color: var(--blanc);
    border-color: var(--encre);
  }
}

.lang-toggle:focus-visible,
.menu-toggle:focus-visible {
  background: var(--encre);
  color: var(--blanc);
  border-color: var(--encre);
}

html.menu-open .frame__nav {
  display: block;
  position: fixed;
  inset: 0;
  background: var(--blanc);
  padding: 96px var(--margin);
}

html.menu-open .frame__nav ul {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

html.menu-open .nav-link {
  font-size: var(--t-l);
  font-weight: 640;
  font-stretch: 112%;
}

@media (min-width: 900px) {
  .frame__nav {
    display: block;
  }

  .menu-toggle {
    display: none;
  }
}

/* 7. Buttons ----------------------------------------------------------- */

.btn {
  position: relative;
  isolation: isolate;
  overflow: clip;
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 26px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid currentColor;
}

.btn--fill {
  background: var(--ambre);
  color: var(--nuit);
  border-color: var(--ambre);
}

.btn--line {
  color: inherit;
}

.btn__fill {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--craie);
  clip-path: inset(calc(100% - 3px) 100% 0 0);
}

.tone-ivoire .btn__fill,
.tone-blanc .btn__fill {
  background: var(--encre);
}

.btn__label {
  position: relative;
  transition: color .3s;
}

@keyframes btn-l {
  0% {
    clip-path: inset(calc(100% - 3px) 100% 0 0);
  }
  50% {
    clip-path: inset(calc(100% - 3px) 0 0 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}

.btn:focus-visible .btn__fill {
  animation: btn-l .5s var(--soft) forwards;
}

@media (hover: hover) {
  .btn:hover .btn__fill {
    animation: btn-l .5s var(--soft) forwards;
  }

  .btn--fill:hover .btn__label,
  .btn--line:hover .btn__label {
    color: var(--nuit);
  }
}

.tone-ivoire .btn--line:focus-visible .btn__label,
.tone-blanc .btn--line:focus-visible .btn__label {
  color: var(--ivoire);
}

@media (hover: hover) {
  .tone-ivoire .btn--line:hover .btn__label,
  .tone-blanc .btn--line:hover .btn__label {
    color: var(--ivoire);
  }
}

.btn:active {
  scale: .97;
}

@media (prefers-reduced-motion: reduce) {
  .btn__fill {
    animation: none !important;
    transition: none;
  }

  .btn:hover .btn__fill,
  .btn:focus-visible .btn__fill {
    clip-path: inset(0);
  }
}

/* 8. Hero -------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: start;
  padding-block: 120px var(--sp-normal);
  overflow: clip;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  row-gap: 28px;
}

.hero__title {
  grid-column: 1 / -1;
  max-width: 13ch;
}

.hero__sub {
  grid-column: 1 / -1;
  font-size: 1.125rem;
  color: var(--gris-nuit);
}

.hero__actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

@media (min-width: 900px) {
  .hero {
    align-items: center;
    padding-block: 96px;
  }

  .hero__title {
    grid-column: 1 / span 5;
    max-width: 14ch;
  }

  .hero__sub {
    grid-column: 1 / span 4;
  }
}

/* 9. Le rang ----------------------------------------------------------- */

.rang {
  position: relative;
  height: 260svh;
}

.rang__stage {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: center;
  row-gap: 48px;
  padding-block: 96px 48px;
  overflow: clip;
}

.rang__head h2 {
  grid-column: 1 / -1;
}

.rang__intro {
  grid-column: 1 / -1;
}

.rang__progress {
  grid-column: 1 / -1;
  font: 500 var(--t-xs)/1.4 var(--f-mono);
  letter-spacing: .04em;
  color: var(--gris-ivoire);
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 8px;
}

.rang__count {
  color: var(--ambre-texte);
  font-weight: 600;
}

.rang__hint {
  margin-left: auto;
  animation: rang-hint 1.8s ease-in-out infinite;
}

@keyframes rang-hint {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

.rang.is-complete .rang__hint {
  opacity: 0;
  transition: opacity .3s;
}

@media (min-width: 900px) {
  .rang__head h2 {
    grid-column: 1 / span 5;
  }

  .rang__intro {
    grid-column: 5 / span 4;
    align-self: end;
  }

  .rang__progress {
    grid-column: 5 / span 4;
  }
}

.rang__cases {
  list-style: none;
  counter-reset: case;
  align-self: start;
  margin: 0 auto;
  margin-top: 96px;
  width: 100%;
  max-width: 1440px;
  padding-inline: var(--margin);
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  position: relative;
}

.case {
  position: relative;
  min-height: 132px;
  background: #ffffff;
  border: 1px solid rgba(13, 21, 36, .12);
  perspective: 900px;
}

.case__face {
  position: absolute;
  inset: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  backface-visibility: hidden;
  padding-right: 104px;
  transition: rotate .8s var(--ease), opacity .3s;
}

.case__face--before {
  justify-content: flex-start;
}

.case::before {
  content: counter(case, decimal-leading-zero);
  counter-increment: case;
  position: absolute;
  right: 20px;
  bottom: 16px;
  font: 500 3.5rem/1 var(--f-mono);
  color: rgba(13, 21, 36, .07);
  pointer-events: none;
  transition: opacity .3s;
}

.case.is-done::before {
  opacity: 0;
}

.case__shot {
  display: none;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  object-position: top;
  border: 1px solid rgba(13, 21, 36, .12);
  margin-bottom: 4px;
}

.case__face--after {
  rotate: x 180deg;
  justify-content: flex-start;
  gap: 8px;
}

.case.is-done .case__face--before {
  rotate: x -180deg;
}

.case.is-done .case__face--after {
  rotate: x 0deg;
}

.case.is-done {
  box-shadow: inset 0 0 0 1px var(--ambre);
}

.case.is-next .case__face--before {
  animation: case-pulse 2.4s ease-in-out infinite;
}

@keyframes case-pulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(245, 165, 36, 0);
  }
  50% {
    box-shadow: inset 0 0 0 1px rgba(245, 165, 36, .55);
  }
}

.case__label {
  font: 500 var(--t-xs)/1.2 var(--f-mono);
  letter-spacing: .04em;
  color: var(--gris-ivoire);
}

.case__face--after .case__label {
  color: var(--ambre-texte);
}

.case__task {
  font: 400 1.05rem/1.4 var(--f-mono);
  color: var(--encre);
}

.case__tool {
  font-size: var(--t-m);
  font-weight: 640;
  font-stretch: 112%;
  letter-spacing: -.02em;
  line-height: 1;
}

.case__what {
  font-size: var(--t-s);
  color: var(--gris-ivoire);
  line-height: 1.4;
}

.case__stack {
  font: 400 var(--t-xs)/1.4 var(--f-mono);
  color: var(--encre);
  opacity: .72;
}

.case__link {
  margin-top: auto;
  font-size: var(--t-s);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .25em;
  align-self: flex-start;
  display: inline-block;
  padding-block: 4px;
  min-height: 24px;
}

.rang__path {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
  fill: none;
  stroke-linejoin: miter;
}

.rang__ghost {
  stroke: rgba(13, 21, 36, .3);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  animation: rang-march .8s linear infinite;
}

.rang__trail {
  stroke: var(--ambre);
  stroke-width: 2;
}

.rang__node {
  fill: var(--ivoire, #eef0f3);
  stroke: rgba(13, 21, 36, .4);
  stroke-width: 1;
  transition: fill .2s, stroke .2s;
}

.rang__node.is-on {
  fill: var(--ambre);
  stroke: var(--ambre);
}

@keyframes rang-march {
  to {
    stroke-dashoffset: -8;
  }
}

.rang.is-complete .rang__ghost {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .rang__ghost {
    animation: none;
  }
}

.knight-mini {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  font: 400 7px/1 var(--f-mono);
  letter-spacing: 0;
  color: var(--encre);
  white-space: pre;
  pointer-events: none;
  z-index: 3;
  will-change: transform;
}

/* Phone: the list scrolls normally and each case grows to fit its longest
   face (both faces share one grid cell instead of being absolute). */
@media (max-width: 899px) {
  .rang {
    height: auto;
  }

  .rang__stage {
    position: relative;
    height: auto;
    overflow: visible;
  }

  .case {
    display: grid;
    min-height: 0;
  }

  .case__face {
    position: relative;
    inset: auto;
    grid-area: 1 / 1;
  }

  .rang__path {
    display: none;
  }
}

@media (min-width: 900px) {
  .rang__cases {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin-top: 120px;
  }

  .case {
    aspect-ratio: auto;
    min-height: 400px;
  }

  .case__shot {
    display: block;
  }

  .case__task {
    font-size: 1.15rem;
  }

  .case__face {
    padding-right: 20px;
  }

  .case:nth-child(odd) {
    background: #ffffff;
  }

  .case:nth-child(even) {
    background: #f5f6f8;
  }

  .knight-mini {
    font-size: 9px;
  }
}

/* 10. Builds ----------------------------------------------------------- */

.builds {
  padding-block: var(--sp-airy) var(--sp-normal);
}

.builds h2 {
  grid-column: 1 / -1;
}

.builds__note {
  grid-column: 1 / -1;
  margin-top: 20px;
  font-size: var(--t-s);
}

@media (min-width: 900px) {
  .builds h2 {
    grid-column: 1 / span 5;
  }

  .builds__note {
    grid-column: 5 / span 4;
  }
}

.index {
  list-style: none;
  margin: 56px auto 0;
  padding: 0 var(--margin);
  max-width: 1440px;
}

.index__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 28px 0;
  border-top: 1px solid rgba(13, 21, 36, .14);
}

.index__row:last-child {
  border-bottom: 1px solid rgba(13, 21, 36, .14);
}

@media (min-width: 900px) {
  .index__row {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    column-gap: var(--gutter);
  }

  .index__row h3 {
    grid-column: 1 / span 4;
  }

  .index__row p {
    grid-column: 5 / span 4;
  }
}

/* 11. Work ------------------------------------------------------------- */

.work {
  padding-block: var(--sp-normal) var(--sp-airy);
}

.work__head {
  align-items: end;
  row-gap: 16px;
}

.work__head h2 {
  grid-column: 1 / -1;
}

.work__all {
  grid-column: 1 / -1;
  font-size: var(--t-s);
  font-weight: 600;
  text-underline-offset: .25em;
  text-decoration: none;
  background: linear-gradient(currentColor 0 0) left bottom / 100% 1px no-repeat;
  padding-bottom: 4px;
  transition: background-size .45s var(--soft), translate .35s var(--ease);
}

@media (min-width: 900px) {
  .work__head h2 {
    grid-column: 1 / span 5;
  }

  .work__all {
    grid-column: 7 / span 2;
    justify-self: end;
  }
}

.work__wall {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  padding-inline: var(--margin);
  max-width: 1440px;
  margin: 64px auto 0;
}

.work-card__link {
  display: block;
  text-decoration: none;
}

.work-card__frame {
  overflow: clip;
  background: #ffffff;
  border: 1px solid rgba(13, 21, 36, .12);
  aspect-ratio: 16 / 10;
}

.work-card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: translate .5s var(--ease), scale .5s var(--ease);
  scale: 1.04;
}

.work-card h3 {
  margin-top: 22px;
  font-size: var(--t-m);
}

.work-card p {
  margin-top: 8px;
}

.work-card__link:focus-visible img {
  translate: 12px -6px;
}

.work-card__link:focus-visible h3 {
  text-decoration: underline;
  text-underline-offset: .15em;
  text-decoration-thickness: 1px;
}

@media (hover: hover) {
  .work__all:hover {
    background-size: 0% 1px;
    translate: 6px 0;
  }

  .work__all:focus-visible {
    translate: 6px 0;
  }

  .work-card__link:hover img {
    translate: 12px -6px;
  }

  .work-card__link:hover h3 {
    text-decoration: underline;
    text-underline-offset: .15em;
    text-decoration-thickness: 1px;
  }
}

.work-more h3 {
  font: 500 var(--t-xs)/1 var(--f-mono);
  letter-spacing: .06em;
  color: var(--gris-ivoire);
  margin-bottom: 12px;
}

.work-more ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.work-more li {
  border-top: 1px solid rgba(13, 21, 36, .14);
}

.work-more li a {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  font-weight: 500;
  min-height: 24px;
}

.work-more li a:hover {
  color: var(--ambre-texte);
}

@media (min-width: 600px) {
  .work__wall {
    gap: 48px;
  }
}

@media (min-width: 900px) {
  .work__wall {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    column-gap: var(--gutter);
    row-gap: 72px;
  }

  .work-card--1 {
    grid-column: 1 / span 4;
    grid-row: 1;
  }

  .work-card--2 {
    grid-column: 5 / span 4;
    grid-row: 1;
    margin-top: 160px;
  }

  .work-card--3 {
    grid-column: 3 / span 4;
    grid-row: 2;
  }

  .work-more {
    grid-column: 7 / span 2;
    grid-row: 2;
    align-self: end;
  }
}

/* 12. Method ----------------------------------------------------------- */

.method {
  padding-block: var(--sp-airy);
}

.moves {
  list-style: none;
  margin: 56px auto 0;
  padding: 0 var(--margin);
  max-width: 1440px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  counter-reset: none;
}

@media (min-width: 600px) {
  .moves {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 32px;
  }
}

.move {
  display: grid;
  grid-template-columns: 2ch 1fr;
  grid-auto-rows: auto;
  align-content: start;
  column-gap: 20px;
  row-gap: 12px;
  padding-top: 20px;
  border-top: 1px solid rgba(13, 21, 36, .14);
}

.move > * {
  grid-column: 2;
  margin: 0;
}

.move__n {
  grid-column: 1;
  grid-row: 1 / span 3;
  font: 500 var(--t-m)/1.1 var(--f-mono);
  color: var(--ambre-texte);
  font-variant-numeric: tabular-nums;
}

.move__facts {
  display: grid;
  align-content: start;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px dashed rgba(13, 21, 36, .2);
}

.move__facts dt {
  font: 500 var(--t-xs)/1.2 var(--f-mono);
  letter-spacing: .04em;
  color: var(--ambre-texte);
}

.move__facts dd {
  margin: 0;
  font-size: var(--t-s);
  line-height: 1.45;
  color: var(--encre);
}

@media (min-width: 900px) {
  .moves {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    column-gap: var(--gutter);
    row-gap: 64px;
  }

  .move {
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 12px;
  }

  .move:nth-child(1) {
    grid-column: 1 / span 3;
  }

  .move:nth-child(2) {
    grid-column: 5 / span 3;
  }

  .move:nth-child(3) {
    grid-column: 1 / span 3;
  }

  .move:nth-child(4) {
    grid-column: 5 / span 3;
  }
}

/* 13. Finale ----------------------------------------------------------- */

.finale {
  padding-block: var(--sp-airy);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: 28px;
  padding-inline: var(--margin);
  max-width: 1440px;
  margin-inline: auto;
  box-shadow: 0 0 0 100vmax var(--nuit);
  clip-path: inset(0 -100vmax);
}

.chip-badge {
  grid-column: 1 / -1;
  grid-row: 1 / span 4;
  align-self: start;
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  width: min(100%, 320px);
  aspect-ratio: 3 / 4;
  perspective: 1000px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.chip-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: rotate .8s var(--ease);
}

.chip-badge.is-flipped .chip-inner {
  rotate: y 180deg;
}

.chip-badge.is-peek .chip-inner {
  rotate: y 24deg;
}

.chip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  background: var(--nuit);
  color: var(--craie);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(241, 243, 245, .22);
}

.chip-back {
  rotate: y 180deg;
  justify-content: center;
}

.chip-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.chip-label {
  font-weight: 640;
  font-stretch: 112%;
  font-size: 1.25rem;
  letter-spacing: -.01em;
}

.chip-ref {
  font: 500 var(--t-xs) var(--f-mono);
  color: var(--gris-nuit);
}

.chip-back .chip-ref {
  color: var(--craie);
}

.chip-pins {
  display: grid;
  gap: 0;
}

.chip-pin {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(241, 243, 245, .14);
  font: 500 var(--t-s) var(--f-mono);
}

.led {
  width: 8px;
  height: 8px;
  background: var(--ambre);
}

.chip-hint {
  grid-column: 1 / -1;
  font: 400 var(--t-xs) var(--f-mono);
  color: var(--gris-nuit);
}

.finale__title {
  grid-column: 1 / -1;
  font-size: var(--t-xl);
}

.finale p,
.finale .btn,
.finale .js-mail {
  grid-column: 1 / -1;
  justify-self: start;
}

.finale .js-mail {
  font: 500 var(--t-s) var(--f-mono);
  color: var(--gris-nuit);
  text-decoration: underline;
  text-underline-offset: .25em;
  display: inline-block;
  padding-block: 4px;
}

@media (min-width: 900px) {
  .finale {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    align-items: start;
  }

  .chip-badge {
    grid-column: 1 / span 3;
  }

  .chip-hint {
    grid-column: 1 / span 3;
    grid-row: 5;
  }

  .finale__title {
    grid-column: 5 / span 4;
  }

  .finale p,
  .finale .btn,
  .finale .js-mail {
    grid-column: 5 / span 4;
  }
}

/* 15. Footer ----------------------------------------------------------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 28px var(--margin);
  background: var(--nuit);
  color: var(--gris-nuit);
  font-size: var(--t-s);
}

.foot a {
  text-decoration: none;
  display: inline-block;
  padding-block: 6px;
}

.foot .footer-links {
  display: flex;
  gap: 20px;
  margin: 0;
}

.foot a:focus-visible {
  text-decoration: underline;
}

@media (hover: hover) {
  .foot a:hover {
    color: var(--craie);
  }
}

/* 16. Reduced motion (rang) -------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .rang {
    height: auto;
  }

  .rang__stage {
    position: static;
    height: auto;
  }

  .case__face {
    position: static;
    rotate: none !important;
  }

  .case {
    min-height: 0;
    aspect-ratio: auto;
    display: grid;
    gap: 12px;
    padding-bottom: 4px;
  }

  .knight-mini {
    display: none;
  }

  .case.is-next .case__face--before {
    animation: none;
  }

  .rang__hint {
    animation: none;
  }
}

/* 16b. Global reduced motion ------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
