:root {
  --bg: #070b13;
  --panel: #0d131d;
  --panel-2: #0b1018;
  --text: #f3f7ff;
  --muted: #9ea8ba;
  --blue: #1c55ff;
  --blue-soft: #6f95ff;
  --line: #1a2434;
  --clients-bg: #080e17;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 12px;
  overflow-x: clip;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Smooth scroll souvent saccade au doigt : desactive sur tactile / petits ecrans */
@media (max-width: 1100px) {
  html {
    scroll-behavior: auto;
  }
}

/* Theme scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #35538d #09111c;
}

*::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

*::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #08111c, #0a1421);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #2f4f8f, #1f3560);
  border: 2px solid #09111c;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #4169bb, #294577);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  max-width: 100%;
}

body.menu-open,
body.modal-open {
  overflow: hidden;
  touch-action: none;
}

.page *:focus-visible {
  outline: 2px solid #6d94ff;
  outline-offset: 2px;
}

.page {
  width: 100%;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% -10%, rgba(46, 91, 196, 0.14), transparent 35%),
    linear-gradient(180deg, #050a11 0%, #07111d 100%);
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: min(720px, 100dvh);
  height: auto;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.5) saturate(0.95);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(4, 9, 15, 0.9) 4%, rgba(4, 9, 15, 0.58) 42%, rgba(4, 9, 15, 0.8) 100%),
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.08), transparent 35%),
    linear-gradient(180deg, transparent 0%, rgba(6, 11, 18, 0.3) 100%);
}

.topbar {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 38px;
  padding-top: max(18px, env(safe-area-inset-top));
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(8, 13, 21, 0.55), rgba(8, 13, 21, 0.18));
}

.brand {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.brand-has-logo {
  flex-direction: row;
  align-items: center;
}

.brand-logo {
  display: block;
  height: clamp(34px, 4.8vw, 52px);
  width: auto;
  max-width: min(240px, 58vw);
  object-fit: contain;
  object-position: left center;
}

.brand-main {
  display: block;
  font: 700 38px/0.9 "Barlow Condensed", sans-serif;
  letter-spacing: 0.5px;
}

.brand-main span {
  color: var(--blue);
}

.brand-sub {
  display: block;
  font: 500 10px/1.2 Inter, sans-serif;
  letter-spacing: 4px;
  opacity: 0.88;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  padding: 10px 12px;
  font: 700 12px/1 Inter, sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 60;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.menu-toggle[aria-expanded="true"] {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.menu {
  display: flex;
  gap: 26px;
}

.menu a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font: 600 13px/1 Inter, sans-serif;
  letter-spacing: 1.2px;
  transition: color 0.2s ease;
}

.menu a:hover {
  color: #fff;
}

.menu a.active {
  color: var(--blue);
}

.cta {
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  text-decoration: none;
  font: 600 12px/1 Inter, sans-serif;
  letter-spacing: 0.9px;
  padding: 14px 22px;
  transition: border-color 0.24s ease, background-color 0.24s ease, transform 0.24s ease;
}

.cta:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.hero-content {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(760px, 92%);
  margin: 40px 0 56px 86px;
}

.eyebrow {
  font: 700 11px/1 Inter, sans-serif;
  letter-spacing: 3.4px;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 24px;
}

h1,
h2 {
  margin: 0;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.9;
  max-width: 800px;
  text-wrap: balance;
}

h1 span,
h2 span {
  color: var(--blue);
}

.desc {
  color: #d5dde9;
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.45;
  max-width: 530px;
  margin: 24px 0 36px;
  text-wrap: pretty;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn-primary,
.btn-ghost {
  text-decoration: none;
  font: 700 12px/1 Inter, sans-serif;
  letter-spacing: 0.9px;
  padding: 15px 23px;
  text-transform: uppercase;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background-color 0.24s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 8px 26px color-mix(in srgb, var(--blue) 35%, transparent);
}

.btn-ghost {
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.48);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--blue) 45%, transparent);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.clients {
  background: var(--clients-bg, #080e17);
  border-bottom: 1px solid var(--line);
  padding: 20px 32px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.clients-title {
  font: 700 11px/1 Inter, sans-serif;
  letter-spacing: 2.5px;
  color: #9ba6b8;
  margin-bottom: 16px;
}

.clients-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px 28px;
  align-items: center;
  color: rgba(255, 255, 255, 0.62);
  font: 700 clamp(24px, 4vw, 38px)/1 "Barlow Condensed", sans-serif;
  letter-spacing: 1px;
}

.client-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: clamp(36px, 5vw, 52px);
  width: auto;
  flex: 0 0 auto;
  min-width: 0;
}

.client-logo img {
  display: block;
  height: 100%;
  width: auto;
  max-height: 100%;
  max-width: min(280px, 55vw);
  object-fit: contain;
  object-position: center;
  opacity: 0.88;
}

.client-logo-text {
  height: auto;
  min-height: clamp(36px, 5vw, 52px);
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  white-space: nowrap;
  overflow: visible;
  line-height: 1;
}

.about {
  display: grid;
  gap: 28px;
  align-items: center;
  grid-template-columns: 160px 1fr;
  border-bottom: 1px solid var(--line);
  padding: 34px 40px;
  background: #08101a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.about .eyebrow {
  margin: 0;
}

.about p {
  margin: 0;
  color: #c9d3e4;
  font-size: 19px;
  line-height: 1.55;
  max-width: 860px;
}

.projects {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 26px;
  padding: 34px 34px 28px;
  background: #060b12;
  border-bottom: 1px solid var(--line);
}

.projects-intro {
  background: #0a111a;
  border: 1px solid var(--line);
  padding: 30px 28px;
  height: fit-content;
  position: sticky;
  top: 14px;
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(2, 6, 12, 0.35);
}

h2 {
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.95;
  margin-bottom: 16px;
}

.projects-intro p {
  color: #d5dbe5;
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  min-height: clamp(260px, 42vw, 340px);
  border: 1px solid #263349;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(2, 6, 12, 0.28);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  background:
    linear-gradient(180deg, rgba(4, 8, 15, 0.1), rgba(4, 8, 15, 0.92)),
    radial-gradient(circle at 56% 18%, rgba(255, 255, 255, 0.1), transparent 36%),
    #111822;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #4f74b6;
  box-shadow: 0 18px 36px rgba(2, 6, 12, 0.36);
}

.card.has-thumb::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: 0;
  background-image: var(--card-thumb);
  background-size: cover;
  background-position: center;
  filter: blur(5px) saturate(0.9) brightness(0.7);
  transform: scale(1.08);
  pointer-events: none;
}

.card.has-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(4, 8, 15, 0.28) 0%,
    rgba(4, 8, 15, 0.38) 40%,
    rgba(4, 8, 15, 0.72) 100%
  );
  pointer-events: none;
}

.card > * {
  position: relative;
  z-index: 2;
}

.card-1 {
  background:
    linear-gradient(180deg, rgba(5, 10, 18, 0.2), rgba(5, 10, 18, 0.94)),
    radial-gradient(circle at 45% 18%, rgba(47, 113, 255, 0.44), transparent 42%),
    #101726;
}

.card-2 {
  background:
    linear-gradient(180deg, rgba(16, 9, 4, 0.2), rgba(16, 9, 4, 0.94)),
    radial-gradient(circle at 50% 15%, rgba(255, 143, 47, 0.44), transparent 40%),
    #2a1b14;
}

.card-3 {
  background:
    linear-gradient(180deg, rgba(7, 10, 15, 0.2), rgba(7, 10, 15, 0.94)),
    radial-gradient(circle at 52% 18%, rgba(173, 211, 255, 0.2), transparent 40%),
    #111921;
}

.card-4 {
  background:
    linear-gradient(180deg, rgba(4, 12, 18, 0.2), rgba(4, 12, 18, 0.94)),
    radial-gradient(circle at 56% 20%, rgba(87, 222, 255, 0.22), transparent 40%),
    #0f1a23;
}

.card-5 {
  background:
    linear-gradient(180deg, rgba(6, 8, 17, 0.2), rgba(6, 8, 17, 0.94)),
    radial-gradient(circle at 48% 18%, rgba(176, 130, 255, 0.28), transparent 42%),
    #111325;
}

.card-6 {
  background:
    linear-gradient(180deg, rgba(8, 8, 8, 0.2), rgba(8, 8, 8, 0.94)),
    radial-gradient(circle at 48% 18%, rgba(245, 202, 102, 0.24), transparent 40%),
    #242018;
}

.play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(7, 11, 19, 0.45);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 18px;
  transition: transform 0.2s ease, background-color 0.2s ease;
  z-index: 3;
}

.play:hover {
  transform: translate(-50%, -50%) scale(1.04);
  background: rgba(10, 17, 28, 0.65);
}

.type {
  margin: 0;
  color: var(--blue-soft);
  font-size: 13px;
  letter-spacing: 1.3px;
}

h3 {
  margin: 8px 0 6px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 0.95;
}

.meta {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 15px;
}

.portfolio-empty {
  grid-column: 1 / -1;
  min-height: 280px;
  display: grid;
  place-items: center;
  border: 1px dashed #2a3d57;
  border-radius: 10px;
  background: rgba(10, 17, 26, 0.6);
  padding: 40px 24px;
}

.portfolio-empty p {
  margin: 0;
  color: #9ba6b8;
  font-size: 17px;
  letter-spacing: 0.3px;
  text-align: center;
}

.services {
  display: grid;
  /* Une seule ligne : autant de colonnes que de services */
  grid-template-columns: repeat(var(--services-count, 4), minmax(0, 1fr));
  gap: 0;
  padding: 0;
  background: #080f18;
  border-bottom: 1px solid #182132;
}

.services article {
  border-right: 1px solid #182132;
  padding: clamp(18px, 2.2vw, 30px) clamp(12px, 1.6vw, 24px);
  min-height: 170px;
  min-width: 0;
  background: #0a111b;
  transition: background-color 0.24s ease;
}

.services article:last-child {
  border-right: none;
}

.services article:hover {
  background: #0d1521;
}

h4 {
  margin: 0 0 14px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(22px, 2.4vw, 38px);
  letter-spacing: 0.7px;
}

.services p {
  margin: 0;
  color: #cad2e0;
  font-size: clamp(13px, 1.15vw, 16px);
  line-height: 1.45;
}

.contact {
  display: grid;
  grid-template-columns: 1.15fr repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 0;
  border-top: 1px solid var(--line);
  background: #09111b;
}

.contact-title {
  padding: 36px 28px;
  border-right: 1px solid #182132;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 50%, rgba(65, 108, 203, 0.1), transparent 55%),
    #09111b;
}

.contact-title .eyebrow {
  margin: 0 0 8px;
}

.contact-title h2 {
  margin: 0;
  font-size: clamp(32px, 3.2vw, 46px);
  line-height: 0.95;
}

.contact-title h2 span {
  color: var(--blue-soft);
}

.contact-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 28px 24px;
  text-decoration: none;
  color: inherit;
  border-right: 1px solid #182132;
  background: #0a111b;
  transition: background-color 0.2s ease;
  min-width: 0;
}

a.contact-item:hover {
  background: #0d1521;
}

/* Tel cliquable uniquement mobile / tablette */
.contact-phone-mobile {
  display: none;
}

.contact-phone-desktop {
  display: flex;
}

@media (max-width: 900px), ((hover: none) and (pointer: coarse)) {
  .contact-phone-desktop {
    display: none !important;
  }

  .contact-phone-mobile {
    display: flex !important;
  }
}

.contact-item:last-child {
  border-right: none;
}

.contact-item-label {
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #9eb0c9;
}

.contact-item-value {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 700;
  color: #e8eef8;
  word-break: break-word;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.footer {
  text-align: center;
  padding: 16px;
  color: #8e9bb2;
  font-size: 13px;
  border-top: 1px solid #131e2d;
  background: #070d16;
  letter-spacing: 0.3px;
}

.video-modal {
  border: 1px solid #2f425d;
  background: #0a131f;
  color: #ecf3ff;
  width: min(96vw, 1600px);
  max-width: 96vw;
  /* dvh + marge dialog : evite que le bas (HUD) soit coupe hors ecran */
  height: min(94vh, calc(100dvh - 2rem));
  max-height: min(94vh, calc(100dvh - 2rem));
  margin: auto;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  box-sizing: border-box;
}

/* display:flex uniquement quand ouvert — sinon le dialog reste visible dans le flux */
.video-modal[open] {
  display: flex;
  flex-direction: column;
}

.video-modal::backdrop {
  background: rgba(2, 5, 9, 0.88);
}

.video-modal-content {
  padding: 18px 22px 20px;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.video-modal-content .eyebrow {
  margin: 0 0 4px;
  flex-shrink: 0;
}

.video-modal-content h3 {
  margin: 0 0 10px;
  flex-shrink: 0;
  font-size: clamp(22px, 3vw, 36px);
}

.video-modal-content p {
  color: #d6deec;
  line-height: 1.45;
}

.video-modal-content .close-modal {
  flex: 0 0 auto;
  align-self: flex-start;
  width: auto;
  max-width: 100%;
  min-height: 44px;
  margin-top: 12px;
  padding: 12px 18px;
  line-height: 1;
}

#modal-player {
  margin: 0;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  position: relative;
  background: #050a11;
  border: 1px solid #223047;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Le media se dimensionne dans la zone dispo : le HUD reste dans le modal */
#modal-player iframe,
#modal-player video,
#modal-player img,
#modal-player .yt-host {
  display: block;
  border: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* iframe / host YT : remplit la zone */
#modal-player iframe,
#modal-player.is-youtube .yt-host,
#modal-player.is-youtube iframe {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  pointer-events: auto;
}

/* Couche 360 au centre seulement : haut + bas YouTube restent cliquables */
.yt-360-drag {
  position: absolute;
  top: 64px;
  right: 12px;
  bottom: 92px;
  left: 12px;
  z-index: 4;
  cursor: grab;
  touch-action: none;
  background: transparent;
}

.yt-360-drag.is-dragging {
  cursor: grabbing;
}

.yt-360-hint {
  position: absolute;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%);
  z-index: 5;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(5, 10, 17, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e8eef8;
  font: 600 12px/1 Inter, sans-serif;
  letter-spacing: 0.4px;
  pointer-events: none;
  white-space: nowrap;
}

.yt-360-toggle {
  position: absolute;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  z-index: 5;
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: color-mix(in srgb, var(--blue) 88%, #000);
  color: #fff;
  font: 700 12px/1 Inter, sans-serif;
  letter-spacing: 0.4px;
  cursor: pointer;
}

#modal-player:empty {
  display: none;
}

/* ========== RESPONSIVE ========== */

/* Tablette / petit desktop : menu burger + portfolio en colonne */
@media (max-width: 1100px) {
  .topbar {
    padding: 14px 20px;
    padding-top: max(14px, env(safe-area-inset-top));
    background: rgba(7, 11, 19, 0.92);
  }

  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
    position: relative;
    z-index: 120;
  }

  body.menu-open .menu-toggle {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    z-index: 120;
  }

  .cta {
    display: none;
  }

  /* Ferme = display:none (sinon le calque plein ecran bloque les taps) */
  .menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 110;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 10px;
    padding:
      max(88px, calc(env(safe-area-inset-top) + 64px))
      max(20px, env(safe-area-inset-right))
      max(28px, env(safe-area-inset-bottom))
      max(20px, env(safe-area-inset-left));
    margin: 0;
    background: #070d16;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .menu.is-open {
    display: flex;
  }

  .menu::before {
    content: "NAVIGATION";
    display: block;
    margin: 0 0 8px;
    font: 700 11px/1 Inter, sans-serif;
    letter-spacing: 3px;
    color: #8fa0b8;
  }

  .menu a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 18px 16px;
    border: 1px solid #24344c;
    border-radius: 8px;
    background: #0c1421;
    font-size: 14px;
    letter-spacing: 1.6px;
    text-align: left;
    color: #eef3ff;
  }

  .menu a.active {
    border-color: color-mix(in srgb, var(--blue) 60%, #24344c);
    background: color-mix(in srgb, var(--blue) 16%, #0c1421);
    color: #fff;
  }

  .hero-bg {
    /* filter lourd = lag au scroll mobile */
    filter: brightness(0.48);
  }

  .card.has-thumb::before {
    inset: 0;
    filter: none;
    transform: none;
    opacity: 0.85;
  }

  .card:hover {
    transform: none;
  }

  .hero-content {
    margin: 32px auto 40px;
    width: min(720px, 92%);
  }

  .projects {
    grid-template-columns: 1fr;
    padding: 28px 20px;
    gap: 18px;
  }

  .projects-intro {
    position: static;
  }

  .about {
    grid-template-columns: 1fr;
    padding: 28px 20px;
    gap: 12px;
  }

  .clients {
    padding: 18px 20px;
  }
}

/* Tablette étroite */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .services article {
    border-right: 1px solid #182132;
    border-bottom: 1px solid #182132;
    min-height: 150px;
  }

  .services article:nth-child(2n) {
    border-right: none;
  }

  .services article:last-child {
    border-right: none;
  }

  /* Si nombre impair : derniere case pleine largeur propre */
  .services article:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    border-right: none;
  }

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

  .contact-title {
    grid-column: 1 / -1;
    border-right: none;
    border-bottom: 1px solid #182132;
    padding: 28px 20px;
  }

  .contact-item {
    border-right: 1px solid #182132;
  }

  .contact-item:nth-child(odd) {
    border-right: 1px solid #182132;
  }

  .contact-item:nth-child(even) {
    border-right: none;
  }

  .contact-item:last-child {
    border-right: none;
  }
}

/* Mobile */
@media (max-width: 720px) {
  .brand-main {
    font-size: 28px;
  }

  .brand-sub {
    letter-spacing: 2.5px;
    font-size: 9px;
  }

  .hero {
    min-height: 100svh;
    min-height: 100dvh;
  }

  .hero-content {
    margin: 28px 16px 36px;
    width: auto;
  }

  .eyebrow {
    letter-spacing: 2.4px;
    margin-bottom: 16px;
    font-size: 10px;
  }

  .desc {
    margin: 18px 0 28px;
  }

  .hero-buttons {
    gap: 10px;
  }

  .hero-buttons .btn-primary,
  .hero-buttons .btn-ghost {
    flex: 1 1 auto;
    min-height: 48px;
    padding: 14px 16px;
  }

  .clients-title {
    text-align: center;
  }

  .clients-logos {
    justify-content: center;
    text-align: center;
    gap: 14px 22px;
  }

  .about p {
    font-size: 16px;
    line-height: 1.55;
  }

  .projects {
    padding: 22px 14px 24px;
  }

  .projects-intro {
    padding: 22px 18px;
  }

  .projects-intro p {
    font-size: 15px;
  }

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

  .card {
    min-height: 280px;
  }

  .play {
    width: 52px;
    height: 52px;
  }

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

  .services article {
    border-right: none;
    border-bottom: none;
    border-top: 1px solid #182132;
    min-height: 0;
    padding: 22px 18px;
    grid-column: auto;
  }

  .services article:first-child {
    border-top: none;
  }

  .services article:last-child:nth-child(odd) {
    grid-column: auto;
  }

  h4 {
    font-size: 28px;
  }

  .services p {
    font-size: 15px;
  }

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

  .contact-title {
    padding: 28px 18px;
  }

  .contact-item {
    border-right: none;
    border-bottom: 1px solid #182132;
    padding: 22px 18px;
  }

  .contact-item:last-child {
    border-bottom: none;
  }

  .contact-item-value {
    font-size: 22px;
  }

  .footer {
    padding: 16px 14px max(16px, env(safe-area-inset-bottom));
  }

  .video-modal {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    border: 0;
  }

  .video-modal-content {
    padding: 14px 14px max(16px, env(safe-area-inset-bottom));
  }

  .video-modal-content h3 {
    font-size: clamp(20px, 6vw, 28px);
  }

  .video-modal-content .close-modal {
    flex: 0 0 auto;
    width: auto;
    align-self: flex-start;
  }

  .yt-360-hint,
  .yt-360-toggle {
    bottom: 64px;
    font-size: 11px;
    white-space: normal;
    text-align: center;
    max-width: calc(100% - 24px);
  }

  .yt-360-drag {
    inset: 0 0 64px;
  }
}

/* Tres petits telephones */
@media (max-width: 400px) {
  .topbar {
    padding: 12px 12px;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .brand-main {
    font-size: 24px;
  }

  .hero-content {
    margin: 24px 12px 32px;
  }

  .hero-buttons .btn-primary,
  .hero-buttons .btn-ghost {
    width: 100%;
  }

  .projects {
    padding: 18px 12px 20px;
  }
}

/* Hover uniquement souris : evite sticky hover sur tactile */
@media (hover: none) {
  .card:hover {
    transform: none;
    border-color: #263349;
    box-shadow: 0 10px 30px rgba(2, 6, 12, 0.28);
  }

  .btn-primary:hover,
  .btn-ghost:hover {
    transform: none;
  }
}
