:root {
  --dark: #090d14;
  --dark-soft: #111823;
  --light: #f8fafc;
  --blue: #087df4;
  --cyan: #00d5e8;
  --text: #18202d;
  --muted: #788394;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  background: var(--dark);
  color: var(--text);
}

h1,
h2,
h3,
.brand {
  font-family: "Space Grotesk", sans-serif;
}

a {
  text-decoration: none;
}
button {
  font-family: inherit;
}

::selection {
  background: var(--cyan);
  color: var(--dark);
}

/* INTRO */

.intro {
  position: relative;
  min-height: 100svh;
  background: var(--dark);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  isolation: isolate;
  transition:
    opacity 0.75s ease,
    transform 0.75s ease;
}

.intro-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(#ffffff08 1px, transparent 1px),
    linear-gradient(90deg, #ffffff08 1px, transparent 1px);
  background-size: 85px 85px;
  mask-image: linear-gradient(to bottom, black, transparent);
}

.intro-glow {
  position: absolute;
  width: 550px;
  height: 550px;
  right: -150px;
  top: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, #087df435, transparent 70%);
  filter: blur(25px);
  z-index: -1;
  animation: glowFloat 9s ease-in-out infinite alternate;
}

.intro-header,
.intro-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 34px 6%;
}

.brand {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -1.5px;
  color: white;
}

.brand span,
.intro-title span,
.about-title span {
  color: var(--blue);
}

.header-label,
.intro-footer {
  color: #9ba7b7;
  font-size: 11px;
  letter-spacing: 2px;
}

.intro-content {
  width: min(100% - 48px, 1100px);
  margin: auto;
  padding: 80px 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 2px;
  color: #b0bdcb;
  animation: fadeUp 0.8s both;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 15px var(--cyan);
}

.intro-title {
  font-size: clamp(65px, 11vw, 155px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.075em;
  margin: 28px 0;
  animation: fadeUp 1s 0.15s both;
}

.intro-title span {
  background: linear-gradient(110deg, var(--blue), var(--cyan));
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.intro-description {
  max-width: 520px;
  font-size: clamp(17px, 2vw, 22px);
  color: #aeb9c8;
  line-height: 1.7;
  animation: fadeUp 1s 0.3s both;
}

.discover-btn {
  margin-top: 35px;
  padding: 10px 10px 10px 28px;
  display: inline-flex;
  align-items: center;
  gap: 45px;
  border: 1px solid #526173;
  border-radius: 50px;
  background: transparent;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  animation: fadeUp 1s 0.45s both;
}

.btn-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue);
  font-size: 21px;
  transition: 0.3s;
}

.discover-btn:hover {
  border-color: var(--cyan);
  transform: translateY(-3px);
}

.discover-btn:hover .btn-arrow {
  background: var(--cyan);
  color: var(--dark);
  transform: rotate(45deg);
}

.intro.is-leaving {
  opacity: 0;
  transform: translateY(-45px);
  pointer-events: none;
}

/* PORTFOLIO */

.portfolio-shell {
  background: var(--light);
  overflow: hidden;
}

.main-nav {
  min-height: 90px;
  padding: 20px 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--light);
}

.dark-brand {
  color: var(--dark);
}

.nav-links {
  display: flex;
  gap: 35px;
}

.nav-links a {
  color: #394454;
  font-size: 13px;
  transition: color 0.25s;
}

.nav-links a:hover {
  color: var(--blue);
}

.about-section {
  padding: 110px 0 140px;
}

.portrait-placeholder {
  min-height: 520px;
  background: linear-gradient(145deg, #e7edf5, #b8c8dc);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 4px 140px 4px 4px;
}

.portrait-placeholder::before {
  content: "";
  width: 360px;
  height: 360px;
  border: 1px solid #ffffffa0;
  border-radius: 50%;
  position: absolute;
}

.portrait-mark {
  font-size: 140px;
  font-weight: 700;
  letter-spacing: -15px;
  color: #ffffffa8;
}

.portrait-caption {
  position: absolute;
  bottom: 25px;
  left: 30px;
  font-size: 11px;
  letter-spacing: 2px;
  color: #455569;
}

.section-label {
  display: inline-block;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 25px;
}

.about-title,
.section-title {
  font-size: clamp(42px, 5vw, 75px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.12;
  margin-bottom: 30px;
}

.about-lead {
  font-size: 20px;
  line-height: 1.7;
  font-weight: 600;
  margin-bottom: 22px;
}

.about-text {
  font-size: 16px;
  color: #667385;
  line-height: 1.9;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 30px;
  margin-top: 25px;
  color: var(--dark);
  font-weight: 700;
  border-bottom: 1px solid var(--blue);
  padding-bottom: 12px;
}

.text-link span {
  color: var(--blue);
}

/* EXPERTISE */

.expertise-section {
  padding: 110px 0 130px;
  background: #edf2f8;
}

.expertise-card {
  background: white;
  padding: 32px;
  min-height: 265px;
  border: 1px solid #e3e9f0;
  transition:
    transform 0.35s,
    box-shadow 0.35s;
}

.expertise-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 50px #152c4712;
}

.card-number {
  color: var(--blue);
  font-size: 13px;
}

.expertise-card h3 {
  font-size: 21px;
  margin: 45px 0 15px;
  font-weight: 700;
}

.expertise-card p {
  font-size: 14px;
  color: #718094;
  line-height: 1.7;
}

/* PROJECTS */

.projects-section {
  background: var(--dark);
  color: white;
  padding: 120px 0;
}

.projects-section .section-title span {
  color: var(--cyan);
}

.featured-project {
  min-height: 370px;
  padding: 55px;
  background: linear-gradient(120deg, #102a4b, #07121e);
  border: 1px solid #244b70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin: 55px 0 45px;
  overflow: hidden;
}

.featured-tag {
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 2px;
}

.featured-project h3 {
  font-size: clamp(55px, 7vw, 95px);
  font-weight: 700;
  letter-spacing: -0.06em;
  margin: 15px 0;
}

.featured-project p {
  color: #b5c8dc;
  max-width: 480px;
  line-height: 1.8;
}

.project-tech {
  display: block;
  margin-top: 25px;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--cyan);
}

.project-symbol {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(100px, 18vw, 250px);
  font-weight: 700;
  letter-spacing: -0.13em;
  color: #ffffff12;
}

.project-symbol span {
  color: #00d5e825;
}

.project-row {
  padding: 30px 10px;
  border-bottom: 1px solid #ffffff25;
  display: grid;
  grid-template-columns: 70px 1fr 220px;
  align-items: center;
  gap: 20px;
  transition:
    padding 0.3s,
    background 0.3s;
}

.project-row:hover {
  padding-left: 25px;
  background: #ffffff08;
}

.project-row h3 {
  font-size: 27px;
  margin: 0;
}

.project-row > span {
  color: #93a4b8;
  font-size: 13px;
}

/* CONTACT */

.contact-section {
  background: #eaf1f9;
  padding: 110px 0 30px;
}

.contact-section h2 {
  font-size: clamp(48px, 7vw, 100px);
  font-weight: 700;
  letter-spacing: -0.06em;
}

.contact-section h2 span {
  color: var(--blue);
}

.contact-section p {
  color: #6d7c8d;
}

.footer-bottom {
  border-top: 1px solid #c9d4e0;
  margin-top: 110px;
  padding-top: 25px;
  display: flex;
  justify-content: space-between;
  color: #7a8797;
  font-size: 12px;
}

/* ANIMATIONS */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(35px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glowFloat {
  to {
    transform: translate(-80px, 80px) scale(1.2);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(45px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .intro-header,
  .intro-footer {
    padding: 25px 6%;
  }
  .intro-footer span:last-child {
    display: none;
  }
  .intro-title {
    font-size: clamp(62px, 14vw, 95px);
  }
  .header-label {
    font-size: 9px;
  }
  .nav-links {
    gap: 12px;
    flex-wrap: wrap;
  }
  .nav-links a {
    font-size: 11px;
  }
  .about-section,
  .expertise-section,
  .projects-section {
    padding: 75px 0;
  }
  .portrait-placeholder {
    min-height: 360px;
  }
  .featured-project {
    padding: 30px;
  }
  .project-symbol {
    display: none;
  }
  .project-row {
    grid-template-columns: 35px 1fr;
  }
  .project-row > span:last-child {
    grid-column: 2;
  }
  .footer-bottom {
    gap: 15px;
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* =====================================
   VERROUILLAGE DE L'ÉCRAN D'ACCUEIL
===================================== */

/* Empêche le défilement avant l'entrée */
body.intro-locked {
  overflow: hidden;
  height: 100dvh;
}

/* Introduction toujours plein écran */
.intro {
  min-height: 100svh;
  height: 100svh;
}

/* Portfolio caché avant l'ouverture */
body.intro-locked .portfolio-shell {
  visibility: hidden;
  pointer-events: none;
}

/* Transition vers le portfolio */
.intro.is-leaving {
  opacity: 0;
  transform: translateY(-60px) scale(1.02);
  transition:
    opacity 0.75s ease,
    transform 0.75s ease;
}

/* Une fois l'entrée effectuée */
body.portfolio-open {
  overflow-x: hidden;
  overflow-y: auto;
}

body.portfolio-open .intro {
  display: none;
}

body.portfolio-open .portfolio-shell {
  visibility: visible;
  animation: portfolioEnter 0.8s ease both;
}

@keyframes portfolioEnter {
  from {
    opacity: 0;
    transform: translateY(35px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   ABOUT SECTION - PREMIUM DESIGN
========================================== */

.about-section {
  background: #f8fafc;
  padding: 110px 0 140px;
}

.about-visual {
  position: relative;
  max-width: 520px;
}

.portrait-frame {
  position: relative;
  height: 570px;
  overflow: hidden;
  background: linear-gradient(145deg, #dbe6f2, #a9c1d9);
  border-radius: 6px 150px 6px 6px;
}

.profile-photo {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.portrait-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-size: 150px;
  font-weight: 700;
  letter-spacing: -15px;
  color: #ffffffa8;
}

.floating-label {
  position: absolute;
  z-index: 3;
  right: -20px;
  bottom: 65px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 18px 24px;
  box-shadow: 0 18px 55px #122d4b18;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.floating-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #00d5e8;
  box-shadow: 0 0 12px #00d5e8;
}

.visual-index {
  display: block;
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 2px;
  color: #8b99a9;
}

.about-content {
  padding-left: 35px;
}

.about-specialties {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0 35px;
}

.about-specialties span {
  padding: 9px 17px;
  border: 1px solid #d8e2ed;
  border-radius: 30px;
  font-size: 12px;
  color: #42546b;
  transition: 0.3s ease;
}

.about-specialties span:hover {
  background: #087df4;
  border-color: #087df4;
  color: white;
  transform: translateY(-3px);
}

.about-cta {
  display: inline-flex;
  align-items: center;
  gap: 35px;
  color: #101820;
  font-size: 14px;
  font-weight: 700;
  transition: 0.3s;
}

.cta-icon {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #087df4;
  color: white;
  font-size: 20px;
  transition: 0.3s;
}

.about-cta:hover {
  color: #087df4;
}

.about-cta:hover .cta-icon {
  background: #00d5e8;
  color: #101820;
  transform: rotate(45deg);
}

@media (max-width: 991px) {
  .about-content {
    padding-left: 0;
  }
  .about-visual {
    margin: auto;
  }
}

@media (max-width: 576px) {
  .portrait-frame {
    height: 420px;
    border-top-right-radius: 100px;
  }
  .floating-label {
    right: 0;
    bottom: 50px;
    padding: 13px;
  }
  .about-section {
    padding: 70px 0;
  }
}

/* ========================================
   EXPERTISES — EDITORIAL LAYOUT
======================================== */

.expertise-section {
  background: #eef3f8;
  padding: 130px 0;
}

.expertise-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 90px;
  align-items: start;
}

.expertise-intro {
  position: sticky;
  top: 90px;
}

.expertise-heading {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(42px, 4.2vw, 68px);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 1.13;
  color: #101820;
  margin-bottom: 30px;
}

.expertise-heading em {
  font-style: normal;
  color: #087df4;
}

.expertise-intro > p {
  max-width: 390px;
  color: #657386;
  font-size: 16px;
  line-height: 1.9;
}

.expertise-decor {
  display: block;
  margin-top: 80px;
  color: #c5d3e3;
  font-size: 75px;
  font-weight: 700;
  letter-spacing: -0.08em;
}

.expertise-list {
  border-top: 1px solid #cbd7e4;
}

.expertise-item {
  display: grid;
  grid-template-columns: 42px 1fr 30px;
  gap: 15px;
  padding: 36px 10px;
  border-bottom: 1px solid #cbd7e4;
  transition:
    background 0.35s ease,
    padding 0.35s ease,
    border-color 0.35s ease;
}

.expertise-item:hover {
  background: #ffffff;
  padding-left: 25px;
  padding-right: 20px;
  border-color: #087df4;
}

.expertise-num {
  color: #087df4;
  font-size: 12px;
  font-weight: 700;
  padding-top: 9px;
}

.expertise-info h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(20px, 2vw, 27px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #172232;
  margin-bottom: 14px;
}

.expertise-info p {
  color: #718094;
  font-size: 14px;
  line-height: 1.8;
  max-width: 410px;
}

.expertise-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.expertise-tags span {
  font-size: 11px;
  padding: 7px 12px;
  border: 1px solid #cbd9e8;
  border-radius: 30px;
  color: #526579;
}

.expertise-arrow {
  color: #087df4;
  font-size: 24px;
  transition: transform 0.3s ease;
}

.expertise-item:hover .expertise-arrow {
  transform: translate(5px, -5px);
}

@media (max-width: 991px) {
  .expertise-layout {
    grid-template-columns: 1fr;
    gap: 45px;
  }

  .expertise-intro {
    position: static;
  }

  .expertise-decor {
    display: none;
  }

  .expertise-section {
    padding: 85px 0;
  }
}

@media (max-width: 576px) {
  .expertise-item {
    grid-template-columns: 28px 1fr 20px;
    gap: 9px;
    padding: 28px 0;
  }

  .expertise-item:hover {
    padding-left: 8px;
    padding-right: 5px;
  }

  .expertise-heading {
    font-size: 43px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .expertise-animate {
    opacity: 0;
    transform: translateY(24px);
    transition:
      opacity 0.65s ease var(--item-delay, 0ms),
      transform 0.65s ease var(--item-delay, 0ms),
      background 0.35s ease,
      padding 0.35s ease;
  }

  .expertise-animate.expertise-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* NEXAFI FEATURED PROJECT */

#projects {
  background: #080f1b;
  color: #fff;
  padding: 110px 0;
}

.projects-heading {
  margin-bottom: 65px;
}

.projects-heading h2 {
  font-size: clamp(38px, 5vw, 70px);
  font-weight: 700;
  letter-spacing: -0.06em;
}

.projects-heading em {
  font-style: normal;
  color: #00c7e8;
}

.projects-heading p {
  color: #94a5b9;
}

.nexafi-feature {
  background: linear-gradient(135deg, #12243a, #091523);
  border: 1px solid #243950;
  border-radius: 28px;
  padding: 75px 55px;
  overflow: hidden;
}

.nexafi-eyebrow {
  color: #00c7e8;
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 700;
}

.nexafi-feature h3 {
  font-size: clamp(65px, 7vw, 105px);
  font-weight: 800;
  letter-spacing: -0.08em;
  margin: 25px 0 10px;
}

.nexafi-feature h3 span {
  color: #00c7e8;
}

.nexafi-subtitle {
  font-size: 20px;
  color: #d6e8f5;
}

.nexafi-description {
  color: #9baec3;
  line-height: 1.9;
  margin: 25px 0;
}

.nexafi-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nexafi-stack span {
  border: 1px solid #36516c;
  border-radius: 30px;
  padding: 8px 13px;
  font-size: 11px;
  color: #b8cadb;
}

.nexafi-link {
  display: inline-flex;
  gap: 25px;
  margin-top: 35px;
  color: #00c7e8;
  text-decoration: none;
  font-weight: 600;
}

/* PHONE MOCKUPS */

.nexafi-devices {
  height: 510px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  isolation: isolate;
}

.device {
  position: absolute;
  width: 190px;
  height: 390px;
  padding: 6px;
  border-radius: 26px;
  background: #202e40;
  border: 2px solid #42566d;
  overflow: hidden;
  box-shadow: 0 25px 65px #0008;
  transition: transform 0.45s ease;
}

.device img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 19px;
}

.device-left {
  transform: translateX(-115px) rotate(-13deg) scale(0.85);
  z-index: 1;
}

.device-center {
  transform: translateY(-20px) scale(1.12);
  z-index: 3;
}

.device-right {
  transform: translateX(115px) rotate(13deg) scale(0.85);
  z-index: 2;
}

.nexafi-devices:hover .device-left {
  transform: translateX(-145px) rotate(-18deg) scale(0.85);
}

.nexafi-devices:hover .device-right {
  transform: translateX(145px) rotate(18deg) scale(0.85);
}

.nexafi-devices:hover .device-center {
  transform: translateY(-35px) scale(1.15);
}

/* DETAILS */

.nexafi-details {
  padding-top: 100px;
  scroll-margin-top: 90px;
}

.detail-heading {
  margin-bottom: 35px;
}

.detail-heading span {
  color: #00c7e8;
  font-size: 11px;
  letter-spacing: 2px;
}

.detail-heading h3 {
  font-size: clamp(26px, 3vw, 42px);
  margin-top: 15px;
}

.nexafi-detail-card {
  background: #111e30;
  border: 1px solid #243950;
  border-radius: 18px;
  padding: 30px;
  height: 100%;
  transition: 0.3s ease;
}

.nexafi-detail-card:hover {
  transform: translateY(-7px);
  border-color: #00c7e8;
}

.nexafi-detail-card span {
  color: #00c7e8;
  font-size: 11px;
  letter-spacing: 1px;
}

.nexafi-detail-card h4 {
  margin: 20px 0 12px;
}

.nexafi-detail-card p {
  color: #9baec3;
  font-size: 14px;
  line-height: 1.8;
}

@media (max-width: 991px) {
  .nexafi-feature {
    padding: 45px 25px;
  }

  .nexafi-devices {
    margin-top: 35px;
    height: 430px;
  }
}

@media (max-width: 576px) {
  #projects {
    padding: 75px 0;
  }

  .device {
    width: 145px;
    height: 310px;
  }

  .device-left {
    transform: translateX(-75px) rotate(-13deg) scale(0.8);
  }

  .device-right {
    transform: translateX(75px) rotate(13deg) scale(0.8);
  }

  .device-center {
    transform: translateY(-10px);
  }

  .nexafi-devices:hover .device-left {
    transform: translateX(-85px) rotate(-15deg) scale(0.8);
  }

  .nexafi-devices:hover .device-right {
    transform: translateX(85px) rotate(15deg) scale(0.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .device,
  .nexafi-detail-card {
    transition: none;
  }
}

/* =========================================
   AUTRES PROJETS
========================================= */

.other-projects {
  padding-top: 130px;
}

.other-projects-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 40px;
}

.other-projects-header h2 {
  font-size: clamp(36px, 4.5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.06em;
  margin: 18px 0;
}

.other-projects-header h2 em {
  color: #00c7e8;
  font-style: normal;
}

.other-projects-header p {
  color: #91a3b8;
}

.project-counter {
  color: #7890a8;
  font-size: 12px;
  letter-spacing: 2px;
  white-space: nowrap;
}

.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 35px;
}

.filter-btn {
  border: 1px solid #2b4059;
  border-radius: 30px;
  padding: 11px 23px;
  background: transparent;
  color: #a6b8cc;
  font-size: 13px;
  cursor: pointer;
  transition: 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: #00c7e8;
  border-color: #00c7e8;
  color: #07111f;
}

.portfolio-project-card {
  height: 100%;
  overflow: hidden;
  border-radius: 20px;
  background: #111d2e;
  border: 1px solid #26394f;
  transition:
    transform 0.4s ease,
    border-color 0.4s ease;
}

.portfolio-project-card:hover {
  transform: translateY(-8px);
  border-color: var(--project-accent);
}

.project-card-media {
  position: relative;
  height: 260px;
  background: linear-gradient(135deg, #1d3450, #0c1727);
  overflow: hidden;
}

.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.portfolio-project-card:hover img {
  transform: scale(1.06);
}

.project-card-number {
  position: absolute;
  top: 20px;
  left: 22px;
  color: #fff;
  font-size: 11px;
  letter-spacing: 2px;
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #06101b99;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.portfolio-project-card:hover .project-card-overlay {
  opacity: 1;
}

.project-card-overlay span {
  padding: 13px 20px;
  border-radius: 30px;
  background: #fff;
  color: #0b1625;
  font-size: 12px;
  font-weight: 700;
}

.project-card-body {
  padding: 30px;
}

.project-card-type {
  color: #00c7e8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.project-card-body h3 {
  font-size: 29px;
  font-weight: 700;
  margin: 14px 0 10px;
}

.project-card-body p {
  color: #9badc2;
  font-size: 14px;
  line-height: 1.8;
}

.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 25px;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.project-card-tags span {
  border: 1px solid #314861;
  border-radius: 20px;
  padding: 6px 11px;
  color: #a9bdd1;
  font-size: 11px;
}

.project-open {
  flex-shrink: 0;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  border: 1px solid #3b536c;
  background: transparent;
  color: #00c7e8;
  font-size: 22px;
  cursor: pointer;
  transition: 0.3s ease;
}

.project-open:hover {
  background: #00c7e8;
  color: #08111e;
}

/* FENÊTRE DÉTAILS */

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #030810dc;
}

.project-modal.is-open {
  display: flex;
}

.project-modal-panel {
  position: relative;
  width: min(100%, 650px);
  max-height: 85vh;
  overflow-y: auto;
  background: #132238;
  color: white;
  border: 1px solid #30445e;
  border-radius: 22px;
  padding: 50px;
  animation: modalEnter 0.35s ease;
}

.project-modal-panel h2 {
  font-size: clamp(35px, 5vw, 55px);
  margin: 18px 0;
}

.project-modal-panel p {
  color: #a9bdd1;
  line-height: 1.9;
}

.project-modal-panel .modal-tagline {
  color: #fff;
  font-size: 18px;
}

.project-modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: translateY(25px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 576px) {
  .other-projects {
    padding-top: 85px;
  }

  .other-projects-header {
    display: block;
  }

  .project-counter {
    display: block;
    margin-top: 18px;
  }

  .project-card-media {
    height: 210px;
  }

  .project-modal-panel {
    padding: 45px 25px 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-project-card,
  .project-card-media img,
  .project-modal-panel {
    animation: none;
    transition: none;
  }
}

/* GALERIE DES PROJETS */

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 18px;
  margin: 30px 0;
}

.project-gallery-item {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  padding: 15px;
  border-radius: 18px;
  background: #0b1728;
  border: 1px solid #2a4058;
  overflow: hidden;
}

.project-gallery-item img {
  display: block;
  width: 100%;
  max-width: 240px;
  max-height: 390px;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.project-gallery-item:hover img {
  transform: scale(1.04);
}

@media (max-width: 480px) {
  .project-gallery {
    gap: 8px;
  }

  .project-gallery-item {
    padding: 6px;
  }
}

/* ==========================================
   CORRECTION FINALE — MODAL & GALERIE
========================================== */

/* Fenêtre masquée par défaut */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 8, 16, 0.88);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

/* Afficher uniquement à l'ouverture */
.project-modal.is-open {
  display: flex;
}

/* Empêcher le défilement de la page */
body.modal-open {
  overflow: hidden !important;
}

/* Panneau central */
.project-modal-panel {
  position: relative;
  width: min(900px, 100%);
  max-height: calc(100dvh - 40px);
  margin: 0;
  padding: 35px 45px;
  background: #132238;
  border: 1px solid #30445e;
  border-radius: 22px;
  color: white;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #344b64 transparent;
}

/* Bouton fermer */
.project-modal-close {
  position: absolute;
  top: 12px;
  right: 18px;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #20344d;
  color: white;
  font-size: 27px;
  cursor: pointer;
}

.project-modal-close:hover {
  background: #00c7e8;
  color: #07111f;
}

/* Titres et descriptions */
.project-modal-panel h2 {
  font-size: clamp(32px, 4vw, 48px);
  margin: 12px 0 18px;
}

.project-modal-panel p {
  line-height: 1.65;
}

/* Galerie des deux captures */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: center;
  justify-items: center;
  width: 100%;
  margin: 22px auto 0;
}

/* Cadres */
.project-gallery-item {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid #294059;
  border-radius: 16px;
  background: #0b1728;
  overflow: hidden;
}

/* Images entières, sans découpage */
.project-gallery-item img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(42dvh, 390px);
  object-fit: contain;
  object-position: center;
  transform: none !important;
}

/* Aperçu des cartes */
.project-card-media {
  position: relative;
  height: 280px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
}

.project-card-media img {
  display: block;
  width: auto;
  height: 390px;
  max-width: 90%;
  object-fit: contain;
  object-position: top center;
  padding-top: 12px;
}

/* Adaptation mobile */
@media (max-width: 600px) {
  .project-modal {
    padding: 12px;
  }

  .project-modal-panel {
    max-height: calc(100dvh - 24px);
    padding: 45px 20px 25px;
  }

  .project-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .project-gallery-item {
    padding: 5px;
  }

  .project-gallery-item img {
    max-height: 280px;
  }
}

/* MODAL TRANSLINK — VERSION COMPACTE */

.project-modal {
  padding: 12px;
}

.project-modal-panel {
  width: min(900px, 100%);
  max-height: calc(100dvh - 24px);
  padding: 24px 35px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Réduire les espaces du texte */
.project-modal-panel h2 {
  margin: 8px 0 10px;
  font-size: clamp(30px, 3vw, 44px);
}

.project-modal-panel p {
  margin: 8px 0;
  line-height: 1.5;
}

/* Captures côte à côte */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 14px;
  margin: 15px 0 0;
}

.project-gallery-item {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  min-width: 0;
  overflow: hidden;
}

/* Afficher les téléphones entièrement */
.project-gallery-item img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(46dvh, 380px);
  object-fit: contain;
  transform: none !important;
}

@media (max-width: 600px) {
  .project-modal-panel {
    padding: 42px 15px 20px;
  }

  .project-gallery {
    gap: 7px;
  }

  .project-gallery-item {
    padding: 4px;
  }

  .project-gallery-item img {
    max-height: 280px;
  }
}

/* SMART HOME - FONCTIONNALITÉS */

.project-features {
  margin: 35px 0;
}

.project-features h3 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 22px;
  color: #fff;
}

.project-features-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.project-feature {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 20px;
  background: #0b1728;
  border: 1px solid #294059;
  border-radius: 15px;
}

.feature-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  margin-top: 8px;
  border-radius: 50%;
  background: #00c7e8;
}

.project-feature h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px;
}

.project-feature p {
  color: #9badc2;
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}

@media (max-width: 600px) {
  .project-features-grid {
    grid-template-columns: 1fr;
  }

  .project-feature {
    padding: 16px;
  }
}
