/* #region Variables & Base */
:root {
  --bg: #f1f2f5;
  --surface: #fff;
  --ink: #14161b;
  --muted: #5d6470;
  --line: #d8dbe2;
  --bio: #b7a4ff;
  --projets: #38d39f;
  --code: #6ea8ff;
  --art: #ff8fb1;
  --audio: #ffc857;
  --on: #14161b;
  --pad: clamp(1rem, 4vw, 3rem);
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101216;
    --surface: #181b21;
    --ink: #eceef2;
    --muted: #9aa1ad;
    --line: #2a2e37;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #101216;
  --surface: #181b21;
  --ink: #eceef2;
  --muted: #9aa1ad;
  --line: #2a2e37;
  color-scheme: dark;
}

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

html {
  background: var(--bg);
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: 30;
}

[hidden] {
  display: none !important;
}

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

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 40;
  background: var(--ink);
  color: var(--bg);
  padding: .6rem 1rem;
  border-radius: 8px;
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--pad);
}
/* #endregion */

/* #region Header & Navigation */
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem var(--pad);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -.03em;
  color: inherit;
  text-decoration: none;
}

nav {
  display: flex;
  gap: .25rem;
}

nav a {
  --a: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--muted);
  text-decoration: none;
}

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

nav a[aria-current] {
  background: var(--a);
  color: var(--on);
}

nav a[data-r=""][aria-current] {
  color: var(--bg);
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

body.fr [lang="en"],
body.en [lang="fr"] {
  display: none !important;
}
/* #endregion */

/* #region Section Accueil & Bannière */
.home {
  padding-block: 0 clamp(2rem, 6vw, 4rem);
}

.v-projets {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.v-projets svg {
  width: 2.2rem;
  height: 2.2rem;
}

.home .wrap {
  padding-top: clamp(2rem, 4vw, 3rem);
}

.hero-banner {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 21 / 9;
  max-height: 420px;
  object-fit: cover;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
}

@media(max-width: 720px) {
  .hero-banner {
    aspect-ratio: 16 / 9;
    max-height: 250px;
  }
}

.home h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.03em;
}

.intro {
  max-width: 34ch;
  margin: .8rem 0 clamp(2rem, 5vw, 3.5rem);
  font-size: 1.2rem;
  color: var(--muted);
}

.intro a {
  color: var(--ink);
  font-weight: 600;
  text-underline-offset: .2em;
}

.rows {
  border-top: 1px solid var(--line);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem 1.5rem;
  margin-inline: -1rem;
  padding: clamp(.6rem, 2vw, 1.2rem) 1rem;
  border-bottom: 6px solid var(--a);
  color: inherit;
  text-decoration: none;
  transition: background .2s, color .2s;
}

.row:hover, .row:focus-visible {
  background: var(--a);
  color: var(--on);
}

.row .t {
  font-weight: 800;
  font-stretch: 75%;
  font-size: clamp(3.5rem, 14vw, 8.5rem);
  line-height: .95;
  letter-spacing: -.04em;
}

.row .m {
  display: flex;
  flex-direction: column;
  margin-left: auto;
  text-align: right;
}

.row .m b {
  font-weight: 600;
}

.row .m small {
  font-size: .9rem;
  opacity: .7;
}

.v {
  display: none;
}

@media(min-width: 721px) {
  .v {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 6.5rem;
    height: 3rem;
    opacity: 0;
    transition: opacity .2s;
  }
  .row:hover .v, .row:focus-visible .v {
    opacity: 1;
  }
}

.v-code {
  font-weight: 800;
  font-size: 2rem;
}

.v-art i {
  width: 2.6rem;
  height: 2.6rem;
  margin-left: -1rem;
  border-radius: 50%;
  background: currentColor;
  opacity: .3;
}

.v-audio i {
  width: 6px;
  height: 2.4rem;
  margin-left: 4px;
  border-radius: 3px;
  background: currentColor;
}

.row:hover .v-audio i {
  animation: eq .8s ease-in-out infinite;
}

.v-audio i:nth-child(2) { animation-delay: .15s !important; }
.v-audio i:nth-child(3) { animation-delay: .3s !important; }
.v-audio i:nth-child(4) { animation-delay: .45s !important; }
.v-audio i:nth-child(5) { animation-delay: .6s !important; }

@keyframes eq {
  50% {
    transform: scaleY(.25);
  }
}
/* #endregion */

/* #region Structure Globale des Pages */
.band {
  background: var(--a);
  color: var(--on);
}

.band .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(2rem, 7vw, 5rem) clamp(1.2rem, 3vw, 2rem);
}

.band h2 {
  margin: 0;
  font-weight: 800;
  font-stretch: 75%;
  font-size: clamp(4.5rem, 18vw, 12rem);
  line-height: .82;
  letter-spacing: -.04em;
}

.band p {
  margin: 0;
  max-width: 26ch;
  font-size: 1.05rem;
  font-weight: 500;
}

.body {
  padding-block: clamp(2rem, 5vw, 4rem);
}

h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -.02em;
}
/* #endregion */

/* #region Section Bio & Tags */
.bio {
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}

.portrait {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: 999px 999px 14px 14px;
  background: var(--line);
}

.prose {
  max-width: 60ch;
  font-size: 1.1rem;
}

.prose p {
  margin: 0 0 1em;
}

.prose h3 {
  margin: 2rem 0 .7rem;
}

.tl {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tl li {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  padding: .7rem 0;
  border-top: 1px solid var(--line);
}

.tl b {
  font-variant-numeric: tabular-nums;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: .15rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .85rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.tags img {
  width: 1.1em;
  height: auto;
}

/* Correction de l'affichage du bouton CV */
#cv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.4rem;
  background: var(--ink);
  color: var(--bg) !important;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  width: fit-content;
  white-space: nowrap;
}

#cv-btn span {
  color: var(--bg) !important;
  display: inline;
}

#cv-btn:hover {
  background: var(--bio);
  color: var(--on) !important;
}

#cv-btn:hover span {
  color: var(--on) !important;
}
/* #endregion */

/* #region Section Code & Projets (Cartes avec miniatures) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.2rem;
}

.chip {
  min-height: 44px;
  padding: 0 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: var(--code);
  border-color: var(--code);
  color: var(--on);
}

.proj {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) auto;
  gap: 1rem 2rem;
  align-items: start;
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
}

.proj-col-main h3 {
  margin: 0 0 0.8rem;
  font-size: 1.7rem;
}

.proj-thumb {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: var(--line);
  display: block;
}

.proj-col-desc {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.proj-col-desc p {
  margin: 0;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.2rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, color .2s;
}

.btn:hover {
  background: var(--code);
  color: var(--on);
}
/* #endregion */

/* #region Section Art & Modale */
.gallery {
  columns: 3 240px;
  column-gap: 1rem;
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  break-inside: avoid;
  cursor: zoom-in;
  color: #fff;
  text-align: left;
}

.tile span {
  position: absolute;
  inset: auto 0 0;
  padding: 2rem .9rem .8rem;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  font-weight: 600;
  opacity: 0;
  transition: opacity .2s;
}

.tile:hover span, .tile:focus-visible span {
  opacity: 1;
}

@media(hover: none) {
  .tile span {
    opacity: 1;
  }
}

dialog {
  width: 95vw;
  max-width: 1400px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(0,0,0,.65);
}

#lbimg {
  width: 100%;
  height: 80vh;
  max-height: 900px;
}

#lbimg.is-embed {
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: 85vh;
  background: #000;
}

#lbimg iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px 16px 0 0;
}

#lbcap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 1rem 1.2rem;
}

#lbcap small {
  color: var(--muted);
}

.x {
  position: absolute;
  top: .6rem;
  right: .6rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
}
/* #endregion */

/* #region Section Audio & Vidéo */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--line);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.trk {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(140px, 360px);
  align-items: center;
  gap: .4rem 1.2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.play {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--audio);
  color: var(--on);
  font-size: 1rem;
  cursor: pointer;
}

.trk.on .play {
  background: var(--ink);
  color: var(--bg);
}

.meta b {
  display: block;
  font-size: 1.25rem;
  letter-spacing: -.02em;
}

.meta small {
  display: flex;
  gap: 1rem;
  color: var(--muted);
}

.wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 44px;
}

.wave i {
  flex: 1;
  min-width: 2px;
  border-radius: 2px;
  background: var(--line);
}

.wave i.done {
  background: var(--ink);
}
/* #endregion */

/* #region Footer & Responsive */
footer {
  border-top: 1px solid var(--line);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding-block: 1.4rem;
  color: var(--muted);
}

footer p {
  margin: 0;
  align-self: center;
}

footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: 1.2rem;
  color: var(--ink);
  font-weight: 600;
}

@media(max-width: 720px) {
  nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    justify-content: space-around;
    gap: 0;
    padding: .3rem .4rem calc(.3rem + env(safe-area-inset-bottom, 0px));
    background: var(--bg);
    border-top: 1px solid var(--line);
  }
  nav a {
    flex: 1;
    padding: 0 .2rem;
    font-size: .85rem;
  }
  .row .m {
    margin-left: 0;
    text-align: left;
    flex-basis: 100%;
  }
  .bio {
    grid-template-columns: 1fr;
  }
  .portrait {
    max-width: 240px;
  }
  .proj {
    grid-template-columns: 1fr;
  }
  .proj-thumb {
    max-width: 100%;
  }
  .trk {
    grid-template-columns: auto 1fr;
  }
  .wave {
    grid-column: 1 / -1;
  }
  footer {
    padding-bottom: 4.5rem;
  }
}

@media(prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
/* #endregion */

/* #region Pages Projets Dédiées */
.project-hero {
  padding-block: 1rem 3rem;
}

.project-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin: 0 0 1rem;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.project-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 2rem;
}

.project-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  background: var(--line);
  margin-bottom: 3rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--ink);
}

.project-content {
  max-width: 75ch;
  margin: 0 auto;
}

.project-content h2 {
  margin-top: 3rem;
  font-size: 1.8rem;
}

.project-links {
  margin-top: 3rem;
}
/* #endregion */