:root {
  --bg: #190c02;
  --bg-soft: #241104;
  --bg-card: #110901;
  --text: #fff7eb;
  --muted: #b6a392;
  --orange: #ff8d00;
  --orange-2: #ffb000;
  --line: rgba(255, 177, 74, 0.16);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 124, 0, .08), transparent 32%),
    linear-gradient(180deg, #180b02 0%, #100700 100%);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .12;
  z-index: 50;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.ambient-neon {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

header, main, footer {
  position: relative;
  z-index: 1;
}

.hero {
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: transparent;
}

.hero::before {
  content: "";
  position: absolute;
  width: 60vw;
  height: 60vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 97, 0, .055), transparent 66%);
  filter: blur(30px);
  z-index: -2;
}

.topbar {
  position: absolute;
  inset: 28px 36px auto 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
  font-size: 12px;
  letter-spacing: .12em;
}

.brand-mini { font-weight: 800; color: #f6d7ba; }
.work-link { color: #c9b7a8; transition: color .25s ease; }
.work-link:hover { color: var(--orange-2); }

.profile {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 120px 24px 80px;
}

.avatar-wrap {
  width: 96px;
  height: 96px;
  position: relative;
  margin-bottom: 22px;
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(255, 185, 85, .22);
  box-shadow: 0 22px 70px rgba(0,0,0,.42), 0 0 0 8px rgba(255, 125, 0, .035);
}

.status-dot {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 15px;
  height: 15px;
  background: #ff9200;
  border-radius: 50%;
  border: 4px solid var(--bg);
  box-shadow: 0 0 18px #ff9200;
}

.eyebrow, .kicker {
  margin: 0 0 9px;
  font-size: 10px;
  letter-spacing: .24em;
  color: #9c806a;
  font-weight: 700;
}

.profile h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(38px, 4.2vw, 64px);
  line-height: .95;
  margin: 0;
  color: var(--orange-2);
  letter-spacing: -.045em;
  text-shadow: 0 0 34px rgba(255, 139, 0, .16);
}

.role-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 12px 0 8px;
  color: #8ba9ff;
  font-size: 14px;
}
.spark { color: #fff8de; }
.role { margin: 0; color: #fff; font-size: 14px; font-weight: 500; }

.socials {
  display: flex;
  gap: 10px;
  margin-top: 23px;
}

.socials a {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  color: #d8ccc1;
  font-size: 9px;
  font-weight: 800;
  transition: .25s ease;
}

.socials a:hover {
  border-color: rgba(255, 159, 0, .55);
  color: #ffb027;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 122, 0, .12);
}

.scroll-indicator {
  margin-top: 54px;
  display: grid;
  gap: 9px;
  justify-items: center;
  color: #745f4f;
  font-size: 8px;
  letter-spacing: .25em;
}

.scroll-indicator i {
  display: block;
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--orange), transparent);
  animation: pulseLine 1.8s ease-in-out infinite;
}

@keyframes pulseLine { 50% { transform: scaleY(.55); opacity: .45; } }

.glow-shape {
  position: absolute;
  border: 4px solid #fff49a;
  filter: drop-shadow(0 0 5px #fff) drop-shadow(0 0 10px #ffe31f) drop-shadow(0 0 18px #ff8c00) drop-shadow(0 0 42px #ff6200);
  box-shadow: inset 0 0 16px rgba(255, 126, 0, .45);
  opacity: .95;
  z-index: -1;
  animation: float 8s ease-in-out infinite alternate;
}

.glow-shape::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: inherit;
  border: 10px solid rgba(255, 100, 0, .16);
  filter: blur(10px);
}

.glow-shape--left {
  width: 380px; height: 540px;
  left: -250px; top: 270px;
  border-radius: 44% 56% 61% 39% / 38% 37% 63% 62%;
  transform: rotate(-18deg);
}
.glow-shape--top {
  width: 110px; height: 230px;
  top: -170px; left: 50%;
  border-radius: 40% 60% 52% 48% / 35% 33% 67% 65%;
  transform: translateX(-50%) rotate(8deg);
  animation-delay: -2s;
}
.glow-shape--right {
  width: 300px; height: 350px;
  right: -235px; top: 230px;
  border-radius: 61% 39% 44% 56% / 38% 60% 40% 62%;
  transform: rotate(24deg);
  animation-delay: -4s;
}
.glow-shape--bottom {
  width: 190px; height: 220px;
  bottom: -170px; left: 43%;
  border-radius: 58% 42% 62% 38% / 47% 61% 39% 53%;
  transform: rotate(-7deg);
  animation-delay: -6s;
}

@keyframes float {
  from { margin-top: -7px; }
  to { margin-top: 8px; }
}

main { background: transparent; }
.projects {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 110px 0 90px;
  background: transparent;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 36px;
  align-items: end;
  margin-bottom: 36px;
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

.section-head h2, .contact h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(38px, 5vw, 74px);
  letter-spacing: -.055em;
  line-height: .95;
  margin: 0;
}
.section-copy { max-width: 420px; color: var(--muted); margin: 0; font-size: 14px; line-height: 1.7; }

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}
.filter {
  appearance: none;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.025);
  color: #9d8b7c;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: .2s ease;
  font-size: 12px;
}
.filter:hover, .filter.is-active {
  color: #1b0c00;
  background: var(--orange-2);
  border-color: var(--orange-2);
}

/* --- MOSAÏQUE TETRIS SANS TROUS --- */
.project-grid {
  --mosaic-gap: 7px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--mosaic-gap);
}

.mosaic-group {
  width: 100%;
  display: grid;
  gap: var(--mosaic-gap);
  min-width: 0;
  overflow: hidden;
}

.mosaic-stack {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--mosaic-gap);
  min-width: 0;
  min-height: 0;
}

.mosaic-slot {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.project-card {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 11px;
  cursor: pointer;
  isolation: isolate;
  background: transparent;
  border: 0;
  transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
}

.project-card:hover { transform: scale(.997); }

.project-media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  border-radius: inherit;
}

.project-media::before { display: none; }

.project-poster,
.project-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-poster {
  z-index: 1;
  opacity: 1;
  transition: transform .55s cubic-bezier(.2,.8,.2,1), filter .3s ease, opacity .25s ease;
}

.project-media video {
  z-index: 2;
  opacity: 0;
  background: transparent;
  transition: opacity .3s ease, transform .55s cubic-bezier(.2,.8,.2,1), filter .3s ease;
}
.project-media video.is-ready { opacity: 0; }
.project-card:hover .project-media video.is-ready { opacity: 1; }
.project-card:hover .project-poster { opacity: 0; }
.project-card:hover .project-media video,
.project-card:hover .project-poster {
  transform: scale(1.012);
  filter: brightness(.82);
}

.project-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  color: rgba(255,255,255,.72);
  font-size: 8px;
  letter-spacing: .12em;
  padding: 0;
  background: transparent;
  border: 0;
  opacity: .55;
  transition: opacity .2s ease;
}
.project-card:hover .project-badge { opacity: 1; }

.play-button {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%) scale(.88);
  z-index: 4;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 154, 0, .94);
  color: #1b0c00;
  border: 0;
  font-size: 15px;
  box-shadow: 0 12px 36px rgba(255, 110, 0, .2);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease, background .25s ease;
}
.project-card:hover .play-button,
.project-card:focus-visible .play-button {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  background: #ffb000;
}

.project-info {
  position: absolute;
  z-index: 5;
  inset: auto 0 0 0;
  min-height: 104px;
  padding: 38px 18px 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  opacity: 1;
  transform: none;
  pointer-events: none;
  text-shadow: 0 2px 16px rgba(0,0,0,.96);
  background: linear-gradient(180deg, transparent 0%, rgba(8,3,0,.16) 28%, rgba(8,3,0,.82) 100%);
}
.project-title {
  margin: 0;
  max-width: 22ch;
  color: #fff8ef;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(16px, 1.25vw, 22px);
  line-height: 1;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.project-type {
  margin: 5px 0 0;
  color: rgba(255,255,255,.68);
  font-size: 10px;
  line-height: 1.25;
}
.project-year {
  flex: 0 0 auto;
  color: rgba(255,255,255,.62);
  font-size: 9px;
  padding-bottom: 1px;
}

/* Sur les cartes verticales, on garde le titre dans une zone sûre en bas. */
.project-card[data-orientation="vertical"] .project-info {
  min-height: 128px;
  padding: 54px 16px 16px;
}
.project-card[data-orientation="vertical"] .project-title {
  max-width: 11ch;
  font-size: clamp(17px, 1.45vw, 24px);
}

.contact {
  /* Aligné sur la galerie resserrée. */
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 90px 0 130px;
  border-top: 1px solid var(--line);
}
.contact h2 { max-width: 930px; }
.contact-cta {
  margin-top: 36px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--orange-2);
  font-size: clamp(18px, 2vw, 30px);
  border-bottom: 1px solid rgba(255, 176, 0, .5);
  padding-bottom: 6px;
}

footer {
  /* Même axe que la galerie et la section contact. */
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: #806a58;
  font-size: 11px;
}

.video-modal {
  width: fit-content;
  max-width: calc(100vw - 28px);
  max-height: calc(100svh - 28px);
  background: #0d0601;
  color: #fff;
  border: 1px solid rgba(255, 170, 54, .24);
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,.72), 0 0 70px rgba(255, 104, 0, .06);
}
.video-modal::backdrop { background: rgba(3, 1, 0, .84); backdrop-filter: blur(12px); }
.modal-inner {
  display: flex;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
}
.modal-player-wrap {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
}
.modal-player-wrap video {
  display: block;
  object-fit: contain;
  background: #000;
}

/* Le cadre du lecteur épouse réellement le ratio de la vidéo. */
.video-modal[data-orientation="vertical"] .modal-player-wrap,
.video-modal[data-orientation="vertical"] .modal-player-wrap video {
  width: min(46svh, calc(100vw - 340px));
  aspect-ratio: 9 / 16;
  height: auto;
  max-height: 82svh;
}
.video-modal[data-orientation="horizontal"] .modal-player-wrap,
.video-modal[data-orientation="horizontal"] .modal-player-wrap video {
  width: min(900px, calc(100vw - 340px));
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 82svh;
}

.modal-meta {
  width: 280px;
  flex: 0 0 280px;
  padding: 42px 30px;
  border-left: 1px solid rgba(255,255,255,.08);
}
.modal-meta span { color: var(--orange-2); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.modal-meta h3 { font-family: "Space Grotesk"; margin: 10px 0 12px; font-size: 28px; letter-spacing: -.04em; }
.modal-meta p { color: #a99585; line-height: 1.6; font-size: 13px; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  background: rgba(10,5,1,.72);
  z-index: 10;
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .topbar { inset: 22px 20px auto; }
  .projects, .contact, footer { width: min(100% - 28px, 1700px); }
  .section-head { display: grid; align-items: start; }
  .video-modal { width: min(100% - 20px, 720px); }
  .modal-inner { flex-direction: column; }
  .video-modal[data-orientation="vertical"] .modal-player-wrap,
  .video-modal[data-orientation="vertical"] .modal-player-wrap video {
    width: min(72vw, 390px);
    max-height: 68svh;
    margin-inline: auto;
  }
  .video-modal[data-orientation="horizontal"] .modal-player-wrap,
  .video-modal[data-orientation="horizontal"] .modal-player-wrap video {
    width: 100%;
    max-height: 62svh;
  }
  .modal-meta { width: 100%; flex-basis: auto; border-left: 0; border-top: 1px solid rgba(255,255,255,.08); padding: 24px; }
}

@media (max-width: 620px) {
  .hero { min-height: 92svh; }
  .work-link { display: none; }
  .profile { padding-top: 100px; }
  .avatar-wrap { width: 82px; height: 82px; }
  .glow-shape--left { left: -310px; }
  .glow-shape--right { right: -265px; }
 .projects { padding-top: 76px; }
  .project-grid { --mosaic-gap: 5px; }
  .project-info { min-height: 88px; padding: 32px 13px 13px; }
  .project-card[data-orientation="vertical"] .project-info { min-height: 104px; padding: 42px 13px 13px; }
  .project-title, .project-card[data-orientation="vertical"] .project-title { font-size: 16px; max-width: 14ch; }
  .play-button { width: 50px; height: 50px; }
  footer { gap: 20px; flex-direction: column; }
}


@media (max-width: 620px) {
  .mosaic-pair,
  .mosaic-triad {
    display: flex;
    flex-direction: column;
    height: auto !important;
  }
  .mosaic-pair .mosaic-slot.slot-horizontal,
  .mosaic-triad .mosaic-slot.slot-horizontal { aspect-ratio: 16 / 9; }
  .mosaic-pair .mosaic-slot.slot-vertical,
  .mosaic-triad > .mosaic-slot.slot-vertical { aspect-ratio: 9 / 16; }
  .mosaic-triad .mosaic-stack { display: contents; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* Une galerie avec un seul projet garde une taille de carte raisonnable. */
.mosaic-single.is-only-project {
  justify-self: start;
  align-self: flex-start;
}
.mosaic-single.is-only-project.only-horizontal {
  width: min(100%, 920px);
}
.mosaic-single.is-only-project.only-vertical {
  width: min(100%, 410px);
}
@media (max-width: 720px) {
  .mosaic-single.is-only-project.only-horizontal { width: 100%; }
  .mosaic-single.is-only-project.only-vertical { width: min(82vw, 410px); }
}
