/* Polices auto-hébergées (pas d'appel à Google Fonts) */
@font-face { font-family: "Nunito"; src: url("/fonts/nunito-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/fonts/lexend-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/fonts/lexend-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* Couleurs : blanc #F5F7DE, noir #060B06 */
:root {
  --blue: #007cbe;
  --green: #00af54;
  --white: #F5F7DE;
  --black: #060B06;
  --text-light: var(--white);
  --text-dark: var(--black);
  --accent: #fff3c2;
  --gradient: linear-gradient(35deg, var(--blue) 0%, var(--green) 100%);
  --font-title: "Nunito", system-ui, sans-serif;
  --font-body: "Lexend", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--blue); }
body { margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; font-family: var(--font-body); font-size: 1rem; line-height: 1.6; color: var(--white); background: var(--gradient); }
a { color: inherit; }
[hidden] { display: none !important; }

h1 { margin: 0; font-family: var(--font-title); font-weight: 700; font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; }
.tagline { margin: 0.4rem 0 0; font-family: var(--font-title); font-weight: 700; font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--accent); }

/* Accueil : présentation */
.home { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1rem, 4vw, 3rem) 3rem; }
.home-card { transition: opacity 0.25s ease-out; }
.home-card.is-loading { opacity: 0; }
.home-card { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2rem); width: 100%; max-width: 1100px; margin: 0 auto; }
.home-pic { flex: none; width: clamp(96px, 11vw, 150px); height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%; border: 3px solid var(--white); box-shadow: 0 12px 30px rgba(6, 11, 6, 0.25); }
.home-block { flex: 1; padding: clamp(1rem, 2.2vw, 1.5rem) clamp(1.25rem, 3vw, 2rem); border: 1px solid rgba(245, 247, 222, 0.35); border-radius: 15px; background: rgba(245, 247, 222, 0.08); }
.home-block h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.home-desc { margin: 0.5rem 0 0; opacity: 0.95; }
.home-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 2rem; margin-top: 1rem; }
.home-email { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 1.1rem; font-weight: 500; text-decoration: none; }
.home-email svg { flex: none; width: 1.3em; height: 1.3em; fill: currentColor; }
.home-email span { border-bottom: 1px solid rgba(245, 247, 222, 0.45); }
.home-email:hover, .home-email:focus-visible { color: var(--accent); }
.home-email:hover span, .home-email:focus-visible span { border-color: var(--accent); }
.home-contact .social-icons { justify-content: flex-start; }

/* Icônes réseaux */
.social-icons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.25rem; }
.social-icons a, .social-icons button { position: relative; display: block; padding: 0; border: 0; background: none; color: var(--white); cursor: pointer; line-height: 0; transition: color 0.2s ease-out, transform 0.2s ease-out; }
.social-icons svg { width: 28px; height: 28px; fill: currentColor; }
.social-icons a:hover, .social-icons a:focus-visible, .social-icons button:hover, .social-icons button:focus-visible { color: var(--accent); transform: translateY(-2px); }
.social-icons a:focus-visible, .social-icons button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.copy-tip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 0.25rem 0.6rem; border-radius: 6px; background: var(--black); color: var(--white); font-size: 0.75rem; line-height: 1.4; opacity: 0; pointer-events: none; transition: opacity 0.2s ease-out; }
.copy-tip.show { opacity: 1; }

/* Accueil : portfolio */
.portfolio { margin-top: clamp(1.75rem, 4vw, 3rem); scroll-margin-top: 1rem; }
.portfolio-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin: 0 0 1.25rem; }
.portfolio-head h2 { margin: 0; font-family: var(--font-title); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tabs a { padding: 0.5rem 1.3rem; border-radius: 30px; border: 2px solid rgba(245, 247, 222, 0.5); font-weight: 500; text-decoration: none; }
.tabs a:hover { border-color: var(--white); }
.tabs a[aria-selected="true"] { background: var(--white); color: #000; border-color: var(--white); mix-blend-mode: screen; } /* texte évidé : le fond du site apparaît à travers les lettres */
.tabs a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Grille : mêmes hauteurs de ligne quel que soit le filtre */
.rvg-wrap { container-type: inline-size; }
.rvg { --cols: 4; --gap: 10px; --cell: calc((100cqi - (var(--cols) - 1) * var(--gap)) / var(--cols)); display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-auto-flow: dense; gap: var(--gap); grid-auto-rows: var(--cell); }
.rvg-h { grid-column: span 2; }
.rvg-v { grid-row: span 2; }
.rvg-s { grid-column: span 2; grid-row: span 2; }

/* Tuiles (vidéo et musique) : même survol */
.tile { position: relative; isolation: isolate; display: block; overflow: hidden; border-radius: 15px; background: rgba(6, 11, 6, 0.25); color: var(--white); text-decoration: none; box-shadow: 0 0 0 rgba(6, 11, 6, 0.3); transition: transform 0.2s ease-out, box-shadow 0.2s ease-out; }
.tile-media { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.tile-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(6, 11, 6, 0.8) 0%, rgba(6, 11, 6, 0.05) 50%, rgba(6, 11, 6, 0) 70%, rgba(6, 11, 6, 0.45) 100%); pointer-events: none; transition: opacity 0.2s ease-out; }
.tile-year { position: absolute; top: 0.85rem; left: 1.1rem; font-family: var(--font-title); font-weight: 700; font-size: 0.95rem; pointer-events: none; transition: opacity 0.2s ease-out; }
.tile-info { position: absolute; left: 1.1rem; right: 1.1rem; bottom: 1.1rem; display: flex; flex-direction: column; pointer-events: none; transition: opacity 0.2s ease-out; }
.tile.has-link .tile-info { right: 7rem; }
.tile-info strong { font-family: var(--font-title); font-weight: 700; font-size: clamp(1.05rem, 1.5vw, 1.35rem); line-height: 1.2; overflow-wrap: anywhere; }
.tile-info small { margin-top: 0.1rem; font-size: 0.85rem; opacity: 0.85; overflow-wrap: anywhere; }
.tile-cta { position: absolute; z-index: 3; right: 1.1rem; bottom: 1.1rem; font-size: 0.8rem; font-weight: 500; text-decoration: none; }
.tile-video .tile-cta { opacity: 0; transition: opacity 0.2s ease-out; }
.tile-music .tile-cta { padding: 0.35rem 0.95rem; border: 2px solid var(--white); border-radius: 30px; transition: background-color 0.2s ease-out, color 0.2s ease-out; }
.tile-music .tile-cta:hover, .tile-music .tile-cta:focus-visible { background: var(--white); color: var(--blue); }
.tile-cta:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (hover: hover) {
  .tile:hover, .tile:focus-within { box-shadow: 5px 5px 10px rgba(6, 11, 6, 0.5); transform: translate(-5px, -5px); }
  .tile:hover .tile-shade, .tile:hover .tile-year, .tile:hover .tile-info { opacity: 0; }
  .tile-video:hover .tile-cta, .tile-video:focus-visible .tile-cta { opacity: 1; }
}

/* Lecteur des tuiles musique */
.mg-play { position: absolute; inset: 0; z-index: 2; display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent; color: var(--white); cursor: pointer; }
.mg-play::before { content: ""; position: absolute; left: 50%; top: 45%; width: clamp(64px, 28%, 96px); aspect-ratio: 1 / 1; transform: translate(-50%, -50%); border: 3px solid var(--white); border-radius: 50%; transition: transform 0.2s ease-out, background-color 0.2s ease-out; }
.mg-play svg { position: absolute; left: 50%; top: 45%; width: clamp(26px, 11%, 38px); height: auto; aspect-ratio: 1 / 1; transform: translate(-50%, -50%); fill: var(--white); }
.mg-play .i-pause { display: none; }
.mg-play[aria-pressed="true"] .i-play { display: none; }
.mg-play[aria-pressed="true"] .i-pause { display: inline; }
.mg-play:hover::before { transform: translate(-50%, -50%) scale(1.08); background: rgba(245, 247, 222, 0.15); }
.mg-play:focus-visible { outline: none; }
.mg-play:focus-visible::before { outline: 3px solid var(--accent); outline-offset: 4px; }
.mg-progress { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(245, 247, 222, 0.15); pointer-events: none; }
.mg-progress span { display: block; height: 100%; width: 0; background: var(--accent); }
.tile-music.is-playing { box-shadow: 0 0 0 3px var(--accent); }

/* Bouton haut de page */
.to-top { position: fixed; z-index: 20; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 2px solid var(--white); border-radius: 50%; background: rgba(6, 11, 6, 0.35); color: var(--white); cursor: pointer; backdrop-filter: blur(4px); transition: background-color 0.2s ease-out, color 0.2s ease-out, transform 0.2s ease-out; }
.to-top svg { width: 24px; height: 24px; fill: currentColor; }
.to-top:hover, .to-top:focus-visible { background: var(--white); color: var(--blue); transform: translateY(-2px); }
.to-top:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Pied de page */
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding: 1.25rem clamp(1.25rem, 5vw, 3rem); font-size: 0.85rem; opacity: 0.85; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Page texte (mentions légales) */
.page { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 5vw, 3rem) 3rem; }
.page h1 { font-size: clamp(2rem, 6vw, 3rem); margin-bottom: 1.5rem; }
.page h2 { font-family: var(--font-title); font-weight: 700; font-size: 1.3rem; margin: 2rem 0 0.5rem; }
.page p { margin: 0 0 0.75rem; }

@media (max-width: 1100px) { .rvg { --cols: 2; } }
@media (max-width: 700px) {
  .home-card { flex-direction: column; text-align: center; }
  .home-block { width: 100%; }
  .home-contact { justify-content: center; }
  .home-contact .social-icons { justify-content: center; }
}
@media (max-width: 640px) {
  .rvg { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .rvg-h, .rvg-v, .rvg-s { grid-column: auto; grid-row: auto; }
  .rvg-h { aspect-ratio: 16 / 9; } .rvg-v { aspect-ratio: 4 / 5; } .rvg-s, .tile-music { aspect-ratio: 1 / 1; }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .tile-shade, .tile-year, .tile-info, .tile-cta, .mg-play::before, .social-icons a, .social-icons button, .to-top { transition: none; }
}
