/* Site de Mouchard. Les valeurs reprennent le système de design de l'app
   (../app/Sources/Mouchard/Theme.swift) : Palette, Spacing, Radius, Pill et .surface(). */

/* MARK: - Jetons */

/* Chaque couleur a sa valeur claire et sa valeur sombre, comme Color(light:dark:) dans l'app :
   light-dark() choisit selon color-scheme, qui suit le système ou le choix fait avec le bouton (data-theme). */
:root {
    color-scheme: light dark;

    /* Palette de l'app : marque (jaune de l'icône) et couleurs de sens, réservées aux pastilles. */
    --brand: light-dark(#F5B400, #FFC21A);
    --brand-soft: light-dark(#FFF3CC, #3B3222);
    --on-brand: #1B1F3B;
    --success: light-dark(#23964F, #4CC27A);
    --warning: light-dark(#C96A12, #F2A14B);
    --danger: light-dark(#D23F3F, #F26B6B);
    --info: light-dark(#2E6BD8, #70A6FF);
    --local: light-dark(#7E4FD0, #B592FF);
    --neutral: light-dark(#6E7480, #9AA0AB);
    --device: light-dark(#C93A82, #F27AB4);

    /* SyntaxTheme : coloration du JSON dans l'inspecteur. */
    --syntax-key: light-dark(#2B5FB4, #7AB0F5);
    --syntax-string: light-dark(#2E7D32, #98C379);
    --syntax-number: light-dark(#B35C00, #E5A66B);
    --syntax-literal: light-dark(#9A2EA0, #D08AE8);
    --syntax-punctuation: light-dark(#6E7781, #8B939E);
    --syntax-fold-background: light-dark(#E6E9EE, #3A3F47);
    --syntax-fold-text: light-dark(#5C6570, #AEB6C0);

    /* Page : noir et blanc, sans teinte ; la couleur reste aux pastilles et au jaune de la marque. */
    --background: light-dark(#FAFAFA, #0A0A0A);
    --surface: light-dark(#FFFFFF, #161616);
    --surface-sunken: light-dark(#F4F4F5, #111111);
    --text: light-dark(#0A0A0A, #F5F5F5);
    --text-secondary: light-dark(rgb(10 10 10 / 0.62), rgb(245 245 245 / 0.64));
    --border: light-dark(rgb(0 0 0 / 0.1), rgb(255 255 255 / 0.1));
    /* Halo jaune en haut de page, la lueur du fond du DMG (scripts/dmg/Background.swift). */
    --glow: light-dark(rgb(255 225 90 / 0.45), rgb(255 194 26 / 0.14));
    --shadow: 0 2px 6px light-dark(rgb(0 0 0 / 0.05), rgb(0 0 0 / 0.3));
    --shadow-hover: 0 18px 40px light-dark(rgb(0 0 0 / 0.1), rgb(0 0 0 / 0.5));
    --shadow-large: 0 24px 60px light-dark(rgb(0 0 0 / 0.14), rgb(0 0 0 / 0.55));
    /* Ombre du bouton principal, et son reflet en haut. */
    --shadow-brand: 0 6px 16px light-dark(rgb(0 0 0 / 0.14), rgb(0 0 0 / 0.4));
    --shadow-brand-hover: 0 10px 22px light-dark(rgb(0 0 0 / 0.2), rgb(0 0 0 / 0.5));
    --highlight: rgb(255 255 255 / 0.4);

    /* Terminal : noir dans les deux thèmes, avec le jaune de l'icône pour l'invite. */
    --terminal-background: #0A0A0A;
    --terminal-text: #EDEDED;
    --terminal-prompt: #FFC21A;

    /* Spacing : grille de 4 points. */
    --space-xxs: 2px;
    --space-xs: 4px;
    --space-s: 8px;
    --space-m: 12px;
    --space-l: 16px;
    --space-xl: 24px;
    /* Au-delà de l'app : les marges d'une page web. */
    --space-xxl: 48px;
    --space-section: 112px;

    /* Radius, plus un rayon de page pour les grandes cartes. */
    --radius-s: 6px;
    --radius-m: 10px;
    --radius-l: 14px;
    --radius-xl: 22px;

    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    /* .rounded de SwiftUI : titres et pastilles. */
    --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

    --content-width: 1120px;
    --gutter: 16px;
}

/* Choix fait avec le bouton de l'en-tête (posé par head.js avant le premier rendu). */
:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

@media (min-width: 640px) {
    :root {
        --gutter: 24px;
    }
}

/* MARK: - Base */

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

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

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.55;
    color: var(--text);
    background: radial-gradient(ellipse 720px 420px at 50% -80px, var(--glow), transparent 70%) no-repeat, var(--background);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

a {
    color: inherit;
}

h1,
h2,
h3 {
    font-family: var(--font-rounded);
    line-height: 1.15;
    margin: 0;
    text-wrap: balance;
}

h2 {
    font-size: clamp(30px, 4.4vw, 44px);
    font-weight: 800;
    letter-spacing: -0.015em;
}

h3 {
    font-size: 19px;
    font-weight: 700;
}

p {
    margin: 0;
}

code,
kbd {
    font-family: var(--font-mono);
    font-size: 0.88em;
}

code {
    padding: 0.1em 0.35em;
    border-radius: var(--radius-s);
    background: color-mix(in srgb, var(--neutral) 14%, transparent);
}

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

.container {
    width: 100%;
    max-width: calc(var(--content-width) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.secondary {
    color: var(--text-secondary);
}

.mono {
    font-family: var(--font-mono);
}

/* MARK: - Teintes */

/* Une teinte de Palette, posée sur une pastille : la teinte passe par --tint. */
.tint-success { --tint: var(--success); }
.tint-warning { --tint: var(--warning); }
.tint-danger { --tint: var(--danger); }
.tint-info { --tint: var(--info); }
.tint-local { --tint: var(--local); }
.tint-device { --tint: var(--device); }
.tint-brand { --tint: var(--brand); }

/* Sans teinte, une pastille est neutre. */
.pill:not([class*="tint-"]) { --tint: var(--neutral); }

/* MARK: - Composants de l'app */

/* Pill : texte court sur un fond teinté à 14 %, comme les étiquettes de l'app. */
.pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 3px var(--space-s);
    border-radius: 999px;
    font-family: var(--font-rounded);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--tint, var(--neutral));
    background: color-mix(in srgb, var(--tint, var(--neutral)) 14%, transparent);
}

/* Le jaune de la marque est trop clair pour du texte : fond doux et encre, comme les indices de l'app. */
.pill.tint-brand {
    color: var(--text);
    background: var(--brand-soft);
}

/* .surface() : fond, coins arrondis, liseré et ombre légère. */
.surface {
    padding: var(--space-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow);
}

/* MARK: - Boutons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-s);
    min-height: 48px;
    padding: var(--space-m) var(--space-xl);
    border-radius: var(--radius-m);
    font-family: var(--font-rounded);
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
}

.button svg {
    flex: none;
}

.button--primary {
    color: var(--on-brand);
    background: var(--brand);
    box-shadow: 0 1px 0 var(--highlight) inset, var(--shadow-brand);
}

.button--primary:hover {
    box-shadow: 0 1px 0 var(--highlight) inset, var(--shadow-brand-hover);
}

.button--secondary {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* MARK: - En-tête */

.site-header {
    padding-block: var(--space-l);
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: var(--space-l);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-s);
    margin-right: auto;
    font-family: var(--font-rounded);
    font-size: 20px;
    font-weight: 800;
    text-decoration: none;
}

.brand img {
    width: 34px;
    height: 34px;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-l);
    font-size: 15px;
    font-weight: 500;
}

.nav a {
    text-decoration: none;
    color: var(--text-secondary);
}

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

.nav .nav-section {
    display: none;
}

@media (min-width: 760px) {
    .nav .nav-section {
        display: inline;
    }
}

.language {
    display: inline-flex;
    padding: var(--space-xxs);
    border-radius: 999px;
    background: color-mix(in srgb, var(--neutral) 14%, transparent);
    font-family: var(--font-rounded);
    font-size: 13px;
    font-weight: 700;
}

.nav .language a,
.language span {
    padding: var(--space-xxs) var(--space-s);
    border-radius: 999px;
}

.language [aria-current] {
    color: var(--on-brand);
    background: var(--brand);
}

/* Bouton de thème : il a besoin de JavaScript, donc caché sans (head.js pose la classe js).
   Il montre la lune en clair et le soleil en sombre : le thème vers lequel il bascule. */
.theme-toggle {
    display: none;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--neutral) 14%, transparent);
    cursor: pointer;
}

.js .theme-toggle {
    display: inline-grid;
}

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

.theme-toggle .sun,
.theme-toggle[aria-pressed="true"] .moon {
    display: none;
}

.theme-toggle[aria-pressed="true"] .sun {
    display: block;
}

/* MARK: - Accroche */

.hero {
    padding-block: var(--space-l) var(--space-xxl);
    text-align: center;
}

.hero-stage {
    position: relative;
    width: min(300px, 64vw);
    margin: 0 auto var(--space-xl);
}

.mascot {
    width: 100%;
    height: auto;
}

/* Étiquettes qui flottent autour de la mascotte, seulement sur grand écran. */
.floaters {
    display: none;
}

@media (min-width: 900px) {
    .floaters {
        display: block;
        position: absolute;
        inset: 0;
        pointer-events: none;
    }

    .floaters .pill {
        position: absolute;
        box-shadow: var(--shadow);
        background: color-mix(in srgb, var(--tint, var(--neutral)) 14%, var(--surface));
        animation: float 6s ease-in-out infinite;
    }

    .floaters .pill.tint-brand {
        background: var(--brand-soft);
    }

    .floaters .pill:nth-child(1) { left: -150px; top: 8%; animation-delay: -1s; }
    .floaters .pill:nth-child(2) { left: -90px; top: 52%; animation-delay: -3s; }
    .floaters .pill:nth-child(3) { left: -230px; top: 84%; animation-delay: -5s; }
    .floaters .pill:nth-child(4) { right: -160px; top: 2%; animation-delay: -2s; }
    .floaters .pill:nth-child(5) { right: -120px; top: 46%; animation-delay: -4s; }
    .floaters .pill:nth-child(6) { right: -200px; top: 80%; animation-delay: -0.5s; }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.eyebrow {
    margin-bottom: var(--space-l);
}

.hero h1 {
    max-width: 16ch;
    margin-inline: auto;
    font-size: clamp(38px, 7vw, 68px);
    font-weight: 900;
    letter-spacing: -0.025em;
}

.hero .lead {
    max-width: 40em;
    margin: var(--space-xl) auto 0;
    font-size: clamp(17px, 2.2vw, 20px);
    color: var(--text-secondary);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-m);
    margin-top: var(--space-xl);
}

.requirements-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-s);
    margin-top: var(--space-l);
}

/* MARK: - Capture d'écran */

.screenshot {
    margin: var(--space-xl) auto 0;
    max-width: 1200px;
    padding-inline: var(--gutter);
}

.screenshot img {
    width: 100%;
    border-radius: var(--radius-m);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-large);
}

.screenshot figcaption {
    margin-top: var(--space-m);
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

/* MARK: - Sections */

.section {
    padding-top: var(--space-section);
}

.section-header {
    max-width: 46em;
    margin-bottom: var(--space-xxl);
}

.section-header p {
    margin-top: var(--space-m);
    font-size: 18px;
    color: var(--text-secondary);
}

/* MARK: - Cartes */

/* Carte de page : la surface de l'app, en plus grand. Un halo suit le pointeur
   (--x et --y, posés par site.js), et son liseré s'allume au même endroit. */
.card {
    --tint: var(--text);
    --x: 50%;
    --y: 0%;
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
    padding: var(--space-l) var(--space-l) var(--space-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card::before,
.card::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card::before {
    z-index: -1;
    background: radial-gradient(420px circle at var(--x) var(--y), color-mix(in srgb, var(--tint) 12%, transparent), transparent 65%);
}

.card::after {
    padding: 1px;
    background: radial-gradient(260px circle at var(--x) var(--y), color-mix(in srgb, var(--tint) 45%, transparent), transparent 70%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.card:hover::before,
.card:hover::after {
    opacity: 1;
}

.card h3 {
    margin-top: var(--space-s);
    padding-inline: var(--space-s);
}

.card p {
    padding-inline: var(--space-s);
    font-size: 16px;
    color: var(--text-secondary);
}

/* Zone d'illustration : un bout d'interface sur un fond en creux. */
.card-visual {
    display: grid;
    place-items: center;
    min-height: 168px;
    padding: var(--space-l);
    border-radius: var(--radius-l);
    overflow: hidden;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
}

/* MARK: - Grille des fonctionnalités */

.bento {
    display: grid;
    gap: var(--space-l);
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 720px) {
    .bento {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1000px) {
    .bento {
        grid-template-columns: repeat(12, 1fr);
    }

    .card--4 { grid-column: span 4; }
    .card--5 { grid-column: span 5; }
    .card--7 { grid-column: span 7; }
}

/* MARK: - Illustrations */

.stack {
    display: grid;
    gap: var(--space-m);
    justify-items: center;
}

.mini-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-s);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-s);
    padding: 6px var(--space-m);
    border-radius: var(--radius-m);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.chip.mono {
    font-size: 13px;
    font-weight: 500;
}

.chip.muted {
    color: var(--text-secondary);
    border-style: dashed;
    box-shadow: none;
}

.link-line {
    width: 28px;
    border-top: 2px dashed var(--border);
}

/* Cadenas du certificat. */
.lock {
    flex: none;
    color: var(--text-secondary);
}

.chain {
    width: 64px;
}

/* Redirections : une flèche n'a de sens qu'entre ses deux bouts, donc pas de retour à la ligne.
   Trop étroit pour tenir sur une ligne, on empile et la flèche pointe vers le bas. */
.routes {
    container-type: inline-size;
    width: 100%;
    gap: var(--space-l);
}

.route {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-s);
}

.route-end {
    display: inline-flex;
    align-items: center;
    gap: var(--space-s);
}

@container (max-width: 440px) {
    .route {
        flex-direction: column;
        gap: var(--space-xs);
    }

    /* La rotation ne change pas la place occupée : les marges la réservent. */
    .route .chain {
        width: 44px;
        margin-block: var(--space-m);
        transform: rotate(90deg);
    }

    /* Deux redirections distinctes : qu'on ne les lise pas comme une seule chaîne. */
    .route + .route {
        margin-top: var(--space-m);
        padding-top: var(--space-l);
        border-top: 1px dashed var(--border);
    }
}

/* Interrupteur du proxy système : il s'allume au survol de la carte. */
.proxy-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-l);
    padding: var(--space-m) var(--space-l);
    border-radius: var(--radius-l);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.proxy-label {
    display: grid;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: left;
}

.proxy-label span {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

.state-on,
.card:hover .state-off {
    display: none;
}

.card:hover .state-on {
    display: inline;
}

.switch {
    position: relative;
    width: 52px;
    height: 30px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--neutral) 35%, transparent);
    transition: background-color 0.25s ease;
}

.switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease;
}

.card:hover .switch {
    background: var(--text);
}

.card:hover .switch::after {
    transform: translateX(22px);
}

.pill-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-s);
    max-width: 360px;
}

.pill-cloud .pill {
    background: color-mix(in srgb, var(--tint) 14%, var(--surface));
    box-shadow: var(--shadow);
}

.pill-cloud .pill.tint-brand {
    background: var(--brand-soft);
}

.card-visual--code {
    place-items: center start;
}

.code {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    color: var(--syntax-punctuation);
    white-space: pre;
    overflow-x: auto;
    max-width: 100%;
}

.code .fold {
    display: inline-block;
    width: 1.4em;
    margin-left: -1.4em;
    color: var(--syntax-punctuation);
}

.code .k { color: var(--syntax-key); }
.code .s { color: var(--syntax-string); }
.code .n { color: var(--syntax-number); }
.code .l { color: var(--syntax-literal); }
.code .p { color: var(--syntax-punctuation); }

.code .folded {
    padding: 0 6px;
    border-radius: var(--radius-s);
    color: var(--syntax-fold-text);
    background: var(--syntax-fold-background);
}

.card-visual--code .code {
    padding-left: 1.6em;
}

.messages,
.devices,
.diff {
    display: grid;
    gap: var(--space-s);
    width: 100%;
    max-width: 320px;
}

.message {
    display: flex;
    gap: var(--space-s);
    padding: 6px var(--space-m);
    border-radius: var(--radius-m);
    background: var(--surface);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message b {
    font-family: var(--font-rounded);
}

.message--out {
    margin-right: var(--space-xl);
}

.message--out b {
    color: var(--success);
}

.message--in {
    margin-left: var(--space-xl);
}

.message--in b {
    color: var(--text-secondary);
}

.device {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    padding: 6px var(--space-m);
    border-radius: var(--radius-m);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 500;
}

.device .pill {
    margin-left: auto;
    font-size: 12px;
}

.device-icon {
    color: var(--text-secondary);
    font-weight: 700;
}

.keys {
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

.key {
    display: grid;
    place-items: center;
    min-width: 56px;
    height: 56px;
    padding-inline: var(--space-m);
    border-radius: var(--radius-m);
    font-family: var(--font-rounded);
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 3px 0 var(--border), var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.keys .pill {
    margin-left: var(--space-s);
}

.card:hover .key {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--border), var(--shadow);
}

.diff {
    font-family: var(--font-mono);
    font-size: 13px;
}

.diff-add,
.diff-remove,
.diff-row {
    padding: 6px var(--space-m);
    border-radius: var(--radius-m);
}

.diff-add {
    color: var(--success);
    background: color-mix(in srgb, var(--success) 12%, var(--surface));
}

.diff-remove {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, var(--surface));
    text-decoration: line-through;
}

.diff-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-s);
    background: var(--surface);
    border: 1px solid var(--border);
}

.diff-row .mono {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* MARK: - Volontairement petit */

.small-grid {
    display: grid;
    gap: var(--space-xl);
    align-items: start;
}

@media (min-width: 960px) {
    .small-grid {
        grid-template-columns: 7fr 4fr;
    }
}

/* Une fenêtre de l'app, dont les requêtes sont ce que Mouchard ne fait pas. */
.window {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-large);
}

.window-bar {
    display: flex;
    align-items: center;
    gap: var(--space-l);
    padding: var(--space-m) var(--space-l);
    border-bottom: 1px solid var(--border);
    background: var(--surface-sunken);
}

.lights {
    display: flex;
    gap: var(--space-s);
}

.lights i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--neutral) 35%, transparent);
}

.window:hover .lights i:nth-child(1) { background: var(--danger); }
.window:hover .lights i:nth-child(2) { background: var(--brand); }
.window:hover .lights i:nth-child(3) { background: var(--success); }

.window-title {
    font-family: var(--font-rounded);
    font-weight: 700;
}

.window-title small {
    margin-left: var(--space-s);
    font-weight: 500;
    color: var(--text-secondary);
}

.rows {
    margin: 0;
    padding: var(--space-s);
    list-style: none;
}

.row {
    display: grid;
    grid-template-columns: 84px 1fr auto;
    grid-template-areas:
        "method path status"
        "note note note";
    align-items: center;
    gap: var(--space-xs) var(--space-m);
    padding: var(--space-s) var(--space-m);
    border-radius: var(--radius-m);
}

.row:nth-child(odd) {
    background: color-mix(in srgb, var(--neutral) 6%, transparent);
}

.row:hover {
    background: color-mix(in srgb, var(--neutral) 12%, transparent);
}

.row > .pill:first-child {
    grid-area: method;
    justify-self: start;
    font-size: 12px;
}

.row-path {
    grid-area: path;
    font-family: var(--font-mono);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row > .pill:nth-child(3) {
    grid-area: status;
}

.row-note {
    grid-area: note;
    font-size: 14px;
    color: var(--text-secondary);
}

@media (min-width: 720px) {
    .row {
        grid-template-columns: 84px minmax(0, 0.9fr) 72px minmax(0, 1.4fr);
        grid-template-areas: "method path status note";
    }

    .row > .pill:nth-child(3) {
        justify-self: center;
    }
}

/* Le certificat Mouchard CA : une fiche à la manière de Trousseaux d'accès. */
.certificate {
    padding: var(--space-xl);
    border-radius: var(--radius-l);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.certificate-head {
    display: flex;
    align-items: center;
    gap: var(--space-m);
    padding-bottom: var(--space-l);
    margin-bottom: var(--space-l);
    border-bottom: 1px solid var(--border);
}

.certificate-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-m);
    background: var(--surface-sunken);
    border: 1px solid var(--border);
}

.certificate-head p {
    font-size: 14px;
    color: var(--text-secondary);
}

.certificate dl {
    display: grid;
    gap: var(--space-m);
    margin: 0;
}

.certificate dt {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.certificate dd {
    margin: 0;
    font-weight: 500;
}

/* MARK: - Démarrer */

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: var(--space-l);
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.steps .card {
    counter-increment: step;
    padding: var(--space-xl) var(--space-m);
}

.steps h3::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-bottom: var(--space-m);
    border-radius: 50%;
    font-weight: 800;
    color: var(--on-brand);
    background: var(--brand);
}

.steps h3 {
    margin: 0 0 var(--space-xs);
}

/* Le terminal reste noir dans les deux thèmes. */
.terminal {
    margin: var(--space-xl) 0 0;
    padding: var(--space-l) var(--space-xl);
    border-radius: var(--radius-m);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--terminal-text);
    background: var(--terminal-background);
    border: 1px solid var(--border);
}

.terminal code {
    padding: 0;
    background: none;
}

.terminal .prompt {
    color: var(--terminal-prompt);
    user-select: none;
}

.terminal .comment {
    opacity: 0.6;
}

/* MARK: - Téléchargement */

.download {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-xxl) var(--space-xl);
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    background: var(--surface);
}

/* Comme la fenêtre du DMG : l'icône, la chaînette, puis la destination. */
.download-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-l);
}

.download-row .app-icon {
    width: 112px;
    height: 112px;
}

.chain-large {
    width: 120px;
    display: none;
}

@media (min-width: 560px) {
    .chain-large {
        display: block;
    }
}

.requirements {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-s);
}

/* MARK: - Page introuvable */

/* La requête qui a échoué, comme une ligne de la liste de l'app. */
.missed-request {
    display: inline-flex;
    align-items: center;
    gap: var(--space-m);
    max-width: 100%;
    margin-bottom: var(--space-xl);
    padding: var(--space-s) var(--space-m);
    border-radius: var(--radius-m);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.missed-path {
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.not-found .hero {
    padding-bottom: var(--space-section);
}

/* MARK: - Pied de page */

.site-footer {
    margin-top: var(--space-section);
    padding-block: var(--space-xl) var(--space-xxl);
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-l);
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-l);
}

.site-footer a {
    text-decoration: none;
}

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

/* MARK: - Mouvement réduit */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .button:hover,
    .card:hover {
        transform: none;
    }
}
