/* =========================================================
   Site de travail — Jimmy Bomy (mmi25c02)
   Hommage Steamboat Willie / 1928 : film muet, noir & blanc.
   Le rouge n'apparait QUE sur interaction (survol / focus).
   100 % HTML + CSS, sans JavaScript ni image externe.
   ========================================================= */

/* ---------- Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------- Variables (mode clair) ----------
   Contrastes verifies (WCAG AA) :
   --ink sur --paper        ~13:1
   --muted sur --card       ~5.6:1
   #fff sur --accent        ~6:1
*/
:root {
    --ink: #16130e;        /* charbon : texte, traits, silhouettes */
    --paper: #e7e0cf;      /* ivoire papier (fond page) */
    --surface: #f2ecdc;    /* ivoire clair (sections) */
    --card: #ece5d4;       /* cartes */
    --muted: #574e40;      /* texte secondaire */
    --accent: #b3122a;     /* rouge Mickey — interaction uniquement */
    --shadow: #16130e;     /* ombre portee dure */
    --grain-blend: multiply;
    --grain-opacity: 0.05;
}

/* ---------- Mode sombre (cinema obscur, identite preservee) ---------- */
@media (prefers-color-scheme: dark) {
    :root {
        --ink: #ece4d0;
        --paper: #15120d;
        --surface: #1f1a13;
        --card: #241e16;
        --muted: #b8ac93;
        --accent: #e0455c;
        --shadow: #000000;
        --grain-blend: screen;
        --grain-opacity: 0.07;
    }
}

html {
    scroll-behavior: smooth;
}

::selection {
    background: var(--accent);
    color: #fff;
}

body {
    font-family: 'Quicksand', Arial, sans-serif;
    color: var(--ink);
    background: var(--paper);
    min-height: 100vh;
    padding: 2.5rem 1.5rem;
    font-weight: 500;
    line-height: 1.55;
    overflow-x: hidden;          /* evite tout scroll horizontal parasite */
}

/* Grain de pellicule (overlay plein ecran, n'intercepte pas les clics) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 60;
    pointer-events: none;
    opacity: var(--grain-opacity);
    mix-blend-mode: var(--grain-blend);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Vignettage facon vieux projecteur */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 55;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 48%, rgba(0, 0, 0, 0.42) 100%);
}

/* ---------- Lien d'evitement ---------- */
.skip-link {
    position: absolute;
    top: -4rem;
    left: 0.5rem;
    z-index: 300;
    background: var(--ink);
    color: var(--paper);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0.5rem;
}

.container {
    max-width: 1150px;
    margin: 0 auto;
}

/* ---------- Bandes de pellicule (haut / bas), theme-aware ----------
   Bande sombre + deux rangees de perforations claires. */
.container::before,
.container::after {
    content: "";
    display: block;
    height: 26px;
    background-color: var(--ink);
    background-image:
        repeating-linear-gradient(90deg, var(--paper) 0 7px, transparent 7px 18px),
        repeating-linear-gradient(90deg, var(--paper) 0 7px, transparent 7px 18px);
    background-position: top 5px center, bottom 5px center;
    background-size: auto 6px, auto 6px;
    background-repeat: repeat-x, repeat-x;
    border-radius: 4px;
}

.container::before { margin-bottom: 2.5rem; }
.container::after  { margin-top: 2.5rem; }

/* ---------- En-tete ---------- */
header {
    text-align: center;
    margin-bottom: 3rem;
}

/* Logo : tete de Mickey dessinee en CSS */
.mickey-ears {
    width: 76px;
    height: 76px;
    background: var(--ink);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    position: relative;
}

.mickey-ears::before,
.mickey-ears::after {
    content: "";
    position: absolute;
    top: -30px;
    width: 48px;
    height: 48px;
    background: var(--ink);
    border-radius: 50%;
    transition: transform 0.25s ease;
}

.mickey-ears::before { left: -22px; }
.mickey-ears::after  { right: -22px; }

/* Easter egg : les oreilles se dressent au survol (bonus desktop) */
.mickey-ears:hover::before { transform: translateY(-6px) rotate(-14deg); }
.mickey-ears:hover::after  { transform: translateY(-6px) rotate(14deg); }

h1 {
    font-family: 'Limelight', serif;
    font-size: clamp(2.1rem, 6vw, 3.6rem);
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    /* relief letterpress monochrome */
    text-shadow: 2px 2px 0 var(--surface), 4px 4px 0 rgba(0, 0, 0, 0.22);
}

.subtitle {
    font-family: 'Poiret One', sans-serif;
    font-size: 1.25rem;
    letter-spacing: 1px;
    margin: 0.9rem 0 1rem;
    color: var(--muted);
}

/* Badge identifiant, facon tampon Art Deco (N&B) */
.badge {
    display: inline-block;
    background: var(--ink);
    color: var(--paper);
    padding: 0.4rem 1.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    border: 2px solid var(--ink);
    box-shadow: inset 0 0 0 2px var(--paper), 3px 3px 0 var(--shadow);
}

/* Frise : bateau a vapeur + notes + millesime */
.boat {
    color: var(--ink);
    max-width: 240px;
    margin: 2rem auto 0;
    opacity: 0.92;
}

.boat svg {
    width: 100%;
    height: auto;
    display: block;
}

.est {
    font-family: 'Limelight', serif;
    text-align: center;
    letter-spacing: 5px;
    font-size: 0.85rem;
    margin-top: 0.6rem;
    color: var(--muted);
}

/* ---------- Sections (un module = une section) ---------- */
.section {
    background: var(--surface);
    border: 2px solid var(--ink);
    border-radius: 6px;
    padding: 2rem;
    margin-bottom: 2.2rem;
    box-shadow: 8px 8px 0 var(--shadow);
}

h2 {
    font-family: 'Poiret One', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

/* Puce = mini tete de Mickey, coloree par le texte (theme-aware) */
h2::before {
    content: "";
    width: 28px;
    height: 25px;
    flex-shrink: 0;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 90'%3E%3Cg fill='%23000'%3E%3Ccircle cx='25' cy='22' r='18'/%3E%3Ccircle cx='75' cy='22' r='18'/%3E%3Ccircle cx='50' cy='58' r='30'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 90'%3E%3Cg fill='%23000'%3E%3Ccircle cx='25' cy='22' r='18'/%3E%3Ccircle cx='75' cy='22' r='18'/%3E%3Ccircle cx='50' cy='58' r='30'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

/* Compteur de sequences (indicateur discret, pousse a droite) */
.seq-count {
    margin-left: auto;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    border: 2px solid currentColor;
    border-radius: 999px;
    padding: 0.1rem 0.65rem;
    letter-spacing: 0.5px;
}

/* ---------- Cartes de travaux ---------- */
.work-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.3rem;
}

.work-card {
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: 6px;
    padding: 1.4rem;
    position: relative;
    overflow: hidden;
    box-shadow: 5px 5px 0 var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

/* Bandeau ROUGE qui glisse au survol / focus (seul moment de couleur) */
.work-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--accent);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.work-card:hover::before,
.work-card:focus-within::before {
    transform: translateX(0);
}

.work-card:hover,
.work-card:focus-within {
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0 var(--accent);
}

.work-card:focus-within {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.work-label {
    display: block;
    font-size: 0.76rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.work-card a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* Toute la carte cliquable (ergonomie) */
.work-card a::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.work-card a:focus-visible {
    outline: none;        /* l'anneau est porte par la carte (focus-within) */
}

.work-card a::after {
    content: "→";
    color: var(--ink);
    font-weight: 800;
    transition: transform 0.25s ease, color 0.18s ease;
}

.work-card:hover a::after,
.work-card:focus-within a::after {
    color: var(--accent);
    transform: translateX(5px);
}

/* Carte "a venir" : texte contraste (pas d'opacite qui casse le ratio) */
.coming-soon {
    background:
        repeating-linear-gradient(45deg, var(--card), var(--card) 10px, rgba(87, 78, 64, 0.16) 10px, rgba(87, 78, 64, 0.16) 20px);
    border-style: dashed;
}

.todo {
    font-style: italic;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--muted);
}

/* ---------- Pied de page ---------- */
footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

footer::before {
    content: "";
    display: block;
    width: 24px;
    height: 21px;
    margin: 0 auto 0.9rem;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 90'%3E%3Cg fill='%23000'%3E%3Ccircle cx='25' cy='22' r='18'/%3E%3Ccircle cx='75' cy='22' r='18'/%3E%3Ccircle cx='50' cy='58' r='30'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 90'%3E%3Cg fill='%23000'%3E%3Ccircle cx='25' cy='22' r='18'/%3E%3Ccircle cx='75' cy='22' r='18'/%3E%3Ccircle cx='50' cy='58' r='30'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Accessibilite ---------- */
a:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

main:focus {
    outline: none;        /* cible du skip link, sans anneau parasite */
}

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

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    body { padding: 1.5rem 1rem; }

    .section {
        padding: 1.5rem;
        box-shadow: 5px 5px 0 var(--shadow);
    }

    .work-grid { grid-template-columns: 1fr; }

    h2 { flex-wrap: wrap; }
}
