@font-face { font-family: Anybody; src: url(/assets/anybody.woff2) format('woff2'); font-weight: 100 900; font-stretch: 50% 150%; font-display: swap; }
@font-face { font-family: Atkinson; src: url(/assets/atkinson.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }
:root {
  --sky: #cfdcff;
  --ink: #15104f;
  --soft: #45408a;
  --paper: #ffffff;
  --pick: #ff5a36;
  --pick-ink: #1a0802;
  --sun: #ffd84a;
  --edge: clamp(20px, 5vw, 72px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sky); color: var(--ink); font: 400 1.125rem/1.6 Atkinson, system-ui, sans-serif; }
h1, h2, h3 { font-family: Anybody, system-ui, sans-serif; font-weight: 800; line-height: 1.08; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.7rem); font-stretch: 115%; }
h3 { font-size: 1.3rem; font-stretch: 108%; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
#title:focus, #result-name:focus { outline: none; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--paper); padding: 8px 14px; z-index: 2; }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding: 22px var(--edge); }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; font: 800 1.35rem/1 Anybody, sans-serif; font-stretch: 125%; text-decoration: none; }
.brand svg { width: 34px; height: 34px; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }

.button { display: inline-block; border: 0; border-radius: 10px; padding: 14px 24px; background: var(--ink); color: var(--paper); font: 700 1.125rem/1.2 Atkinson, sans-serif; text-decoration: none; cursor: pointer; }
.button:hover { background: #2a2380; }
.button.line { background: none; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.button.line:hover { background: var(--ink); color: var(--paper); }
[hidden] { display: none !important; }

/* Accueil */
.hero { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(290px, 1fr); gap: 40px clamp(32px, 6vw, 96px); align-items: center; padding: clamp(40px, 7vw, 96px) var(--edge) clamp(56px, 8vw, 112px); }
#title { position: relative; width: fit-content; padding: .14em .22em .2em; margin: 0 0 .5em -.22em; font-size: clamp(2.7rem, 7vw, 6.2rem); font-stretch: 72%; font-weight: 850; line-height: 1; letter-spacing: -.015em; }
#title::before { content: ''; position: absolute; inset: 0; border: 3px solid var(--pick); background: rgb(255 90 54 / .1); border-radius: 2px; pointer-events: none; animation: frame .7s .25s cubic-bezier(.2, .8, .2, 1) backwards; }
#title::after { content: attr(data-size); position: absolute; left: 0; bottom: 100%; margin-bottom: 4px; padding: 5px 9px; background: var(--pick); color: var(--pick-ink); border-radius: 3px; font: 600 .875rem/1.2 system-ui, sans-serif; letter-spacing: 0; white-space: pre; animation: tag .2s .85s backwards; }
#title:not([data-size])::after { display: none; }
@keyframes frame { from { clip-path: inset(0 100% 100% 0); } }
@keyframes tag { from { opacity: 0; } }
.lead { max-width: 54ch; font-size: 1.25rem; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 14px; }
.quiet { color: var(--soft); margin: 0; }

.radio { --beat: .9s; background: var(--sun); color: #2b1d00; border-radius: 28px 28px 28px 4px; padding: 26px; }
.radio h3 { font-size: 1.7rem; font-stretch: 85%; margin: 0 0 6px; }
.radio p { margin: 0; }
.radio-bars { display: flex; align-items: end; gap: 6px; height: 112px; margin: 0 0 22px; }
.radio-bars i { flex: 1; height: 100%; background: #2b1d00; border-radius: 4px 4px 0 0; transform: scaleY(.45); transform-origin: bottom; animation: beat var(--beat) ease-in-out infinite alternate paused; }
.radio.is-playing .radio-bars i { animation-play-state: running; }
.radio-bars i:nth-child(2n) { animation-delay: -.35s; }
.radio-bars i:nth-child(3n) { animation-delay: -.6s; }
.radio-bars i:nth-child(4n+1) { animation-delay: -.78s; }
.radio-bars i:nth-child(5n+2) { animation-delay: -.5s; }
@keyframes beat { from { transform: scaleY(.15); } to { transform: scaleY(1); } }
.radio-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.radio-play { flex: none; width: 64px; height: 64px; border: 0; border-radius: 50%; background: #2b1d00; cursor: pointer; }
.radio-play::before { content: ''; display: block; width: 20px; height: 22px; margin: auto; background: var(--sun); clip-path: polygon(10% 0, 100% 50%, 10% 100%); }
.is-playing .radio-play::before { clip-path: polygon(0 0, 35% 0, 35% 100%, 65% 100%, 65% 0, 100% 0, 100% 100%, 0 100%); }
.radio-play:hover { background: #6b4a00; }
.specimen p.quiet { margin-top: 14px; font-size: 1rem; }

.band { padding: clamp(56px, 8vw, 112px) var(--edge); }
.band.paper { background: var(--paper); }
.band.dark { background: var(--ink); color: var(--paper); }
.band > h2 { max-width: 22ch; margin-bottom: 1.1em; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: clamp(48px, 7vw, 88px); }
.steps li { counter-increment: step; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px clamp(28px, 5vw, 80px); align-items: start; }
.steps h3::before { content: counter(step) '. '; }
.steps h3 { margin-bottom: .5em; }
.steps img { border-radius: 8px; border: 1px solid #c4cbe6; }
kbd { font: 600 .9em/1 system-ui, sans-serif; background: #e6ebfb; border-radius: 5px; padding: 2px 7px; white-space: nowrap; }
.where { width: 100%; max-width: 1000px; border-collapse: collapse; }
.where th, .where td { text-align: left; vertical-align: top; padding: 18px 24px 18px 0; border-top: 2px solid var(--ink); }
.where th { font: 800 1.3rem/1.3 Anybody, sans-serif; font-stretch: 108%; white-space: nowrap; }
.both { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 40px clamp(32px, 6vw, 96px); }
.both h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin-bottom: .7em; }
.both ul { margin: 0; padding-left: 1.1em; }
.both li { margin-bottom: .6em; padding-left: .2em; }
.dark p { max-width: 62ch; }

/* Résultat de l'essai */
#result { position: fixed; inset: auto 0 0 0; z-index: 10; height: min(58vh, 560px); display: flex; flex-direction: column; background: #16181d; color: #e9eaee; box-shadow: 0 -10px 50px rgb(21 16 79 / .45); animation: rise .25s ease-out; }
@keyframes rise { from { translate: 0 30px; opacity: 0; } }
.result-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; }
#result-name { margin: 0 auto 0 0; font: 700 1.1rem/1.2 Atkinson, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
#result button { border: 1px solid #444955; border-radius: 6px; padding: 7px 13px; background: none; color: inherit; font: 500 1rem/1.2 Atkinson, sans-serif; cursor: pointer; }
#result button:hover, #result [aria-pressed=true] { background: #343843; }
#result :focus-visible { outline-color: var(--pick); outline-offset: 1px; }
#result .go { background: var(--pick); border-color: var(--pick); color: var(--pick-ink); font-weight: 700; }
#result .go:hover { background: #ff7a5c; }
.result-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; }
#result-frame { width: 100%; height: 100%; border: 0; background: #fff; }
#result-code { margin: 0; padding: 16px; overflow: auto; font: .875rem/1.55 ui-monospace, 'Cascadia Code', Menlo, monospace; tab-size: 2; }

/* Pages de texte */
.text { max-width: 62ch; padding: clamp(32px, 5vw, 72px) var(--edge) clamp(56px, 8vw, 112px); box-sizing: content-box; }
.text h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-stretch: 108%; margin-bottom: .5em; }
.text h2 { font-size: 1.5rem; font-stretch: 108%; margin: 1.9em 0 .6em; }
.text li { margin-bottom: .5em; }
.text table { border-collapse: collapse; width: 100%; }
.text th, .text td { text-align: left; vertical-align: top; padding: 10px 18px 10px 0; border-top: 1px solid var(--soft); }
.text pre { overflow: auto; background: var(--ink); color: var(--paper); border-radius: 8px; padding: 18px 22px; font: .95rem/1.6 ui-monospace, Menlo, monospace; }
.text h3 { margin: 1.4em 0 .4em; }
.todo { background: var(--sun); padding: 0 .3em; }

.foot { display: flex; flex-wrap: wrap; gap: 14px 40px; padding: 34px var(--edge) 44px; background: var(--ink); color: #dfe4ff; border-top: 1px solid #3a348a; }
.foot p { margin: 0; flex: 1 1 320px; max-width: 58ch; }
.foot nav { display: flex; flex-wrap: wrap; align-content: start; gap: 6px 24px; }
.dark :focus-visible, .foot :focus-visible { outline-color: var(--sun); }

@media (max-width: 860px) {
  .hero, .steps li { grid-template-columns: minmax(0, 1fr); }
  .result-body { grid-template-columns: 1fr; grid-template-rows: 40% 60%; }
  #result { height: 72vh; }
  .where, .where tbody, .where tr, .where th, .where td { display: block; }
  .where td { border: 0; padding-top: 0; }
  .where th { padding-bottom: 4px; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #title::before, #title::after, #result, .radio-bars i { animation: none; }
}
