:root {
  --ad-bg: #000000;
  --ad-fg: #ffffff;
  --ad-muted: rgba(255,255,255,.64);
  --ad-accent: #03fe00;
  --ad-gap: 0px;
  --ad-edge: clamp(16px, 2.4vw, 40px);
  --ad-header-h: 96px;
  --ad-max: 1280px;
  --ad-copy-max: 820px;
  --ad-ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ad-bg); }
body.ad-site {
  margin: 0;
  background: var(--ad-bg);
  color: var(--ad-fg);
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.ad-overlay-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
img, video { display: block; max-width: 100%; }

/* HEADER / IDENTITÉ */
.ad-header {
  position: fixed;
  top: 0;
  left: 50%;
  right: auto;
  z-index: 80;
  width: min(calc(100% - (2 * var(--ad-edge))), var(--ad-max));
  transform: translateX(-50%);
  min-height: var(--ad-header-h);
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  color: var(--ad-accent);
  transition: background-color .25s ease, color .25s ease;
  pointer-events: none;
}
body.admin-bar .ad-header { top: 32px; }
.ad-header.is-after-hero {
  background: linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.62) 72%, rgba(0,0,0,0));
}
.ad-brand, .ad-nav { pointer-events: auto; }
.ad-brand { display: flex; flex-direction: column; gap: 6px; line-height: 1; }
.ad-brand-name {
  font-size: clamp(24px, 1.65vw, 32px);
  font-weight: 900;
  letter-spacing: -.03em;
  text-transform: uppercase;
}
.ad-brand-role {
  font-size: 22px;
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -.015em;
}
.ad-nav {
  display: flex;
  gap: clamp(20px, 2.4vw, 38px);
  font-size: 22px;
  line-height: 1;
  font-weight: 300;
  text-transform: uppercase;
}
.ad-nav a { position: relative; }
.ad-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -5px;
  height: 1px;
  background: currentColor;
  transition: right .2s ease;
}
.ad-nav a:hover::after,
.ad-nav a:focus-visible::after { right: 0; }

/* FEATURED */
.ad-hero {
  width: min(calc(100% - (2 * var(--ad-edge))), var(--ad-max));
  margin: 0 auto;
}
.ad-hero-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #090909;
}
.ad-hero video,
.ad-hero img { width: 100%; height: 100%; object-fit: cover; }
.ad-hero-placeholder { width: 100%; height: 100%; background: #090909; }
.ad-sound-toggle {
  position: absolute;
  right: 20px;
  bottom: 18px;
  z-index: 2;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ad-accent);
  cursor: pointer;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 300;
}

/* WORK / FILTRES / GRILLE */
.ad-work { padding-top: clamp(20px, 2.5vw, 36px); }
.ad-filterbar {
  width: min(calc(100% - (2 * var(--ad-edge))), var(--ad-max));
  margin: 0 auto;
  padding: 0 0 clamp(18px, 2vw, 30px);
  display: flex;
  gap: clamp(18px, 2.2vw, 34px);
}
.ad-filterbar button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ad-accent);
  cursor: pointer;
  text-transform: uppercase;
  font-size: 22px;
  line-height: 1;
  font-weight: 300;
  opacity: .5;
  transition: opacity .2s ease;
}
.ad-filterbar button.is-active,
.ad-filterbar button:hover,
.ad-filterbar button:focus-visible { opacity: 1; }

.ad-project-grid {
  width: min(calc(100% - (2 * var(--ad-edge))), var(--ad-max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0;
}
.ad-project-card[hidden] { display: none !important; }
.ad-project-link { display: block; }
.ad-card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
}
.ad-card-media > img,
.ad-card-media > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ad-card-teaser { opacity: 0; transition: opacity .22s ease; }
.ad-project-card.is-playing .ad-card-teaser { opacity: 1; }
.ad-card-shade {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.22);
  opacity: 0;
  transition: opacity .22s ease;
}
.ad-card-copy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  color: var(--ad-accent);
  padding: 24px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .22s ease, transform .22s ease;
}
.ad-project-card:hover .ad-card-copy,
.ad-project-card:focus-within .ad-card-copy,
.ad-project-card:hover .ad-card-shade,
.ad-project-card:focus-within .ad-card-shade {
  opacity: 1;
  transform: none;
}
.ad-card-client {
  font-size: clamp(15px, 1.15vw, 19px);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.ad-card-title {
  font-size: clamp(21px, 1.75vw, 30px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.02em;
}

/* OVERLAYS / PAGES INTÉRIEURES */
.ad-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.995);
  color: var(--ad-fg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s var(--ad-ease), visibility .28s;
}
.ad-overlay.is-open { opacity: 1; visibility: visible; }
.ad-overlay-scroll { width: 100%; height: 100%; overflow: auto; overscroll-behavior: contain; }
.ad-overlay-content {
  width: min(calc(100% - (2 * var(--ad-edge))), var(--ad-max));
  margin: 0 auto;
  padding: clamp(72px, 7vw, 112px) 0 clamp(72px, 8vw, 130px);
}
.ad-overlay-close {
  position: fixed;
  top: 18px;
  right: max(var(--ad-edge), calc((100vw - var(--ad-max)) / 2));
  z-index: 110;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--ad-accent);
  font-size: 38px;
  line-height: 1;
  font-weight: 300;
  cursor: pointer;
}

/* PROJECT */
.ad-project-videos { display: flex; flex-direction: column; gap: clamp(24px, 3vw, 48px); }
.ad-project-video-title {
  margin-bottom: 8px;
  color: var(--ad-fg);
  font-size: 14px;
  font-weight: 300;
}
.ad-video-embed { position: relative; aspect-ratio: 16 / 9; background: #050505; }
.ad-video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ad-project-info {
  width: min(100%, var(--ad-copy-max));
  margin: clamp(46px, 5vw, 82px) 0 0;
}
.ad-project-client {
  margin-bottom: 8px;
  color: var(--ad-fg);
  font-size: 18px;
  font-weight: 300;
  text-transform: uppercase;
}
.ad-project-title {
  margin: 0;
  color: var(--ad-accent);
  font-size: clamp(28px, 3.3vw, 52px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.035em;
}
.ad-project-categories,
.ad-project-roles {
  margin-top: 13px;
  color: var(--ad-fg);
  font-size: 16px;
  line-height: 1.45;
  font-weight: 300;
}
.ad-project-description,
.ad-richtext {
  margin-top: clamp(26px, 3vw, 42px);
  color: var(--ad-fg);
  font-size: 18px;
  line-height: 1.55;
  font-weight: 300;
}
.ad-project-description p:first-child,
.ad-richtext p:first-child { margin-top: 0; }
.ad-project-description a,
.ad-richtext a { color: var(--ad-accent); }
.ad-project-gallery {
  display: grid;
  gap: 0;
  margin-top: clamp(46px, 5vw, 82px);
}
.ad-project-gallery img { width: 100%; height: auto; }
.ad-project-credits {
  width: min(100%, var(--ad-copy-max));
  margin: clamp(44px, 5vw, 80px) 0 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.22);
  color: var(--ad-muted);
  font-size: 14px;
  line-height: 1.65;
  font-weight: 300;
}

/* ABOUT */
.ad-about { display: block; }
.ad-about-image {
  width: 100%;
  margin: 0;
  aspect-ratio: 1280 / 430;
  overflow: hidden;
  background: #0a0a0a;
}
.ad-about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ad-about-copy {
  width: min(100%, var(--ad-copy-max));
  margin-top: clamp(40px, 4.5vw, 70px);
}
.ad-about h1,
.ad-contact h1 {
  margin: 0;
  color: var(--ad-accent);
  font-size: clamp(28px, 3.2vw, 48px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.03em;
  text-transform: uppercase;
}

/* CONTACT */
.ad-contact {
  width: min(100%, var(--ad-copy-max));
  margin: 0;
}
.ad-contact-details {
  margin-top: 32px;
  color: var(--ad-fg);
  font-size: 18px;
  line-height: 1.5;
  font-weight: 300;
}
.ad-contact-details p { margin: 0 0 8px; }
.ad-contact-details a { color: var(--ad-fg); }
.ad-contact-form { margin-top: clamp(42px, 5vw, 72px); }
.ad-contact-form p { margin: 0 0 24px; }
.ad-contact-form label {
  display: block;
  color: var(--ad-fg);
  font-size: 13px;
  font-weight: 300;
  text-transform: uppercase;
}
.ad-contact-form input,
.ad-contact-form textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.58);
  border-radius: 0;
  background: transparent;
  color: var(--ad-fg);
  padding: 10px 0;
  outline: none;
  font-size: 17px;
  font-weight: 300;
}
.ad-contact-form input:focus,
.ad-contact-form textarea:focus { border-bottom-color: var(--ad-accent); }
.ad-contact-form textarea { min-height: 160px; resize: vertical; }
.ad-contact-form button {
  border: 1px solid var(--ad-accent);
  background: transparent;
  color: var(--ad-accent);
  padding: 12px 22px;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 300;
}
.ad-contact-form button:hover,
.ad-contact-form button:focus-visible {
  background: var(--ad-accent);
  color: #000;
}
.ad-contact-success { padding: 12px 0; color: var(--ad-accent); }

.ad-fallback-page {
  max-width: var(--ad-copy-max);
  margin: 120px auto;
  padding: 0 var(--ad-edge);
  color: var(--ad-fg);
}

@media (max-width: 900px) {
  .ad-brand-role,
  .ad-nav,
  .ad-filterbar button { font-size: 18px; }
}

@media (max-width: 720px) {
  :root {
    --ad-edge: 16px;
    --ad-header-h: 76px;
    --ad-copy-max: 100%;
  }

  .ad-header {
    width: calc(100% - (2 * var(--ad-edge)));
    min-height: var(--ad-header-h);
    padding-top: 12px;
  }
  body.admin-bar .ad-header { top: 46px; }
  .ad-brand { gap: 4px; }
  .ad-brand-name { font-size: 17px; }
  .ad-brand-role { font-size: 12px; }
  .ad-nav { gap: 10px; font-size: 12px; }

  /* Médias bord à bord sur mobile */
  .ad-hero { width: 100%; }
  .ad-work { padding-top: 0; }
  .ad-filterbar { display: none; }
  .ad-project-grid {
    width: 100%;
    grid-template-columns: 1fr;
    padding: 0;
    gap: 0;
  }
  .ad-card-copy,
  .ad-card-shade { opacity: 1; transform: none; }
  .ad-card-shade { background: rgba(0,0,0,.18); }
  .ad-card-client { font-size: 12px; }
  .ad-card-title { font-size: 20px; }

  /* Overlays plein écran ; médias bord à bord, texte avec respiration */
  .ad-overlay-content {
    width: 100%;
    padding: 66px 0 70px;
  }
  .ad-overlay-close { top: 10px; right: 10px; }
  .ad-project-videos { gap: 18px; }
  .ad-project-video-title { padding: 0 var(--ad-edge); }
  .ad-project-info,
  .ad-project-credits,
  .ad-about-copy,
  .ad-contact {
    width: 100%;
    padding-left: var(--ad-edge);
    padding-right: var(--ad-edge);
  }
  .ad-project-info { margin-top: 34px; }
  .ad-project-title { font-size: 31px; }
  .ad-project-description,
  .ad-richtext { font-size: 16px; line-height: 1.55; }
  .ad-project-client { font-size: 15px; }
  .ad-project-categories,
  .ad-project-roles { font-size: 14px; }
  .ad-project-gallery { margin-top: 36px; }
  .ad-project-credits { margin-top: 34px; }

  .ad-about-image {
    width: 100%;
    aspect-ratio: 16 / 7;
  }
  .ad-about-copy { margin-top: 30px; }
  .ad-about h1,
  .ad-contact h1 { font-size: 30px; }

  .ad-sound-toggle { right: 14px; bottom: 12px; font-size: 12px; }
}

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