/* ============================================================
   Réalisations — section d'accueil + page dédiée
   Cartes projet avec maquette de navigateur dessinée en CSS
   ============================================================ */

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

.projects__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}

@media (min-width: 720px) {
  .projects__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .projects__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.projects__more {
  margin-top: 2.75rem;
  text-align: center;
}

/* ---------- Carte projet ---------- */
.project-card {
  overflow: hidden;
  background: var(--surface-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  transition: border-color 0.3s var(--ease), transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}

.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: 0 24px 44px -28px rgba(0, 38, 36, 0.4);
}

.project-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

a.project-card__link {
  cursor: pointer;
}

.project-card__visual {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-deep);
}

.project-card__visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    60% 70% at 85% 0%,
    rgba(248, 245, 116, 0.22),
    transparent 70%
  );
  pointer-events: none;
}

.project-card__badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--acid);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.project-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.5rem;
  flex: 1;
}

.project-card__meta {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
}

.project-card__body h3 {
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--ink-deep);
}

.project-card__excerpt {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.project-card__tags li {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--muted);
}

.project-card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-ink);
}

.project-card__more .arrow {
  transition: transform 0.25s var(--ease);
}

.project-card:hover .project-card__more .arrow {
  transform: translate(3px, -3px);
}

/* un seul projet : carte horizontale, plus éditoriale */
@media (min-width: 900px) {
  .projects__grid--single {
    grid-template-columns: 1fr;
  }

  .projects__grid--single .project-card__link {
    flex-direction: row;
    align-items: stretch;
  }

  .projects__grid--single .project-card__visual {
    flex: 1.35;
    aspect-ratio: auto;
    min-height: 380px;
  }

  .projects__grid--single .project-card__body {
    flex: 1;
    justify-content: center;
    gap: 0.9rem;
    padding: clamp(2rem, 4vw, 3.5rem);
  }

  .projects__grid--single .project-card__body h3 {
    font-size: clamp(1.75rem, 2.8vw, 2.5rem);
    letter-spacing: -0.04em;
  }

  .projects__grid--single .project-card__excerpt {
    font-size: 16px;
    max-width: 36ch;
  }
}

/* ---------- Maquette de navigateur ---------- */
.mock {
  position: absolute;
  left: 11%;
  right: 11%;
  top: 16%;
  bottom: -14%;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
  background: var(--surface);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
  transition: transform 0.6s var(--ease);
}

.project-card:hover .mock {
  transform: translateY(-8px);
}

.mock__bar {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(0, 38, 36, 0.1);
  background: rgba(0, 38, 36, 0.04);
}

.mock__bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 38, 36, 0.2);
}

.mock__url {
  margin-left: 10px;
  padding: 3px 12px;
  border-radius: 100px;
  background: rgba(0, 38, 36, 0.07);
  font-size: 10px;
  letter-spacing: 0.02em;
  color: rgba(0, 38, 36, 0.55);
}

.mock__body {
  display: grid;
  gap: 14px;
  padding: 14px 16px;
}

.mock__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mock__nav b {
  width: 46px;
  height: 9px;
  margin-right: auto;
  border-radius: 4px;
  background: var(--surface-deep);
}

.mock__nav span {
  width: 22px;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 38, 36, 0.22);
}

.mock__hero {
  display: grid;
  gap: 12px;
  padding: 14px 0 6px;
}

.mock__lines {
  display: grid;
  gap: 7px;
}

.mock__lines span {
  height: 11px;
  border-radius: 5px;
  background: var(--surface-deep);
}

.mock__lines .w80 { width: 80%; }
.mock__lines .w60 { width: 60%; }
.mock__lines .w40 { width: 40%; }

.mock__lines .accent {
  background: var(--acid);
  box-shadow: inset 0 0 0 1px rgba(0, 38, 36, 0.15);
}

.mock__btn {
  width: 64px;
  height: 20px;
  border-radius: 100px;
  background: var(--acid);
  box-shadow: inset 0 0 0 1px rgba(0, 38, 36, 0.2);
}

.mock__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mock__cards span {
  height: 58px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(0, 38, 36, 0.08);
}

/* capture d'écran réelle à la place de la maquette dessinée */
.mock__shot {
  display: block;
  width: 100%;
  height: calc(100% - 30px);
  object-fit: cover;
  object-position: top center;
  background: var(--surface);
}

/* la capture flotte au centre du visuel, site entier visible */
.mock--shot {
  top: 50%;
  bottom: auto;
  left: 9%;
  right: 9%;
  translate: 0 -50%;
  border-radius: 12px;
}

.mock--shot .mock__shot {
  height: auto;
}

/* variante jaune pour les prochains projets */
.mock--acid {
  background: #ffffff;
}

.project-card__visual:has(.mock--acid) {
  background: var(--acid);
}

.project-card__visual:has(.mock--acid)::before {
  background: radial-gradient(60% 70% at 85% 0%, rgba(255, 255, 255, 0.5), transparent 70%);
}

/* ---------- Page dédiée ---------- */
.projects-page .projects {
  border-top: 0;
}

.projects-page .projects__grid {
  margin-top: 0;
}

/* ---------- Page : bande « un projet en tête ? » ---------- */
.projects-cta {
  border-top: 1px solid var(--border);
  text-align: center;
}

.projects-cta .container {
  display: grid;
  justify-items: center;
  gap: 1.5rem;
}

.projects-cta .section__title {
  max-width: 18ch;
}

@media (prefers-reduced-motion: reduce) {
  .mock,
  .project-card {
    transition: none;
  }
}

/* ============================================================
   Responsive
   ============================================================ */

/* un seul projet : toujours pleine largeur (pas de colonne vide) */
.projects__grid--single {
  grid-template-columns: 1fr;
}

/* tablette (720 – 899 px) : carte pleine largeur, visuel large au-dessus */
@media (min-width: 720px) and (max-width: 899px) {
  .projects__grid--single .project-card__visual {
    aspect-ratio: 16 / 9;
  }

  .projects__grid--single .mock--shot {
    left: 16%;
    right: 16%;
  }

  .projects__grid--single .project-card__body {
    padding: 2rem;
  }

  .projects__grid--single .project-card__body h3 {
    font-size: 1.75rem;
  }
}

/* mobile (< 720 px) : la capture occupe toute la largeur de la carte */
@media (max-width: 719px) {
  .projects__grid {
    gap: 1.25rem;
    margin-top: 2rem;
  }

  .project-card:hover {
    transform: none;
  }

  .project-card__visual {
    aspect-ratio: 4 / 3.1;
  }

  /* fenêtre de navigateur plein cadre : on gagne ~25 % de largeur d'image */
  .mock--shot {
    inset: 0;
    translate: none;
    border-radius: 0;
    box-shadow: none;
  }

  .mock--shot .mock__bar {
    height: 28px;
  }

  .mock--shot .mock__shot {
    height: calc(100% - 28px);
    object-fit: cover;
    object-position: center top;
  }

  .project-card:hover .mock {
    transform: none;
  }

  .project-card__badge {
    top: 0.75rem;
    left: 0.75rem;
  }

  .project-card__body {
    gap: 0.6rem;
    padding: 1.25rem 1.25rem 1.5rem;
  }

  .project-card__body h3 {
    font-size: 1.5rem;
  }

  .project-card__excerpt {
    font-size: 15px;
  }

  /* lien : vrai bouton, facile à toucher */
  .project-card__more {
    justify-content: center;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    font-size: 14px;
  }

  .projects__more .btn {
    width: 100%;
  }

  .projects-cta .btn {
    width: 100%;
  }
}


/* ============================================================
   Projet à la une
   ============================================================ */
.projects__stack {
  margin-top: 3rem;
}

.projects-page .projects__stack {
  margin-top: 0;
}

.projects__stack > .project-feature + .project-feature {
  margin-top: 1.5rem;
}

.project-feature {
  position: relative;
  display: grid;
  gap: 2.5rem;
  align-items: center;
  overflow: hidden;
  padding: clamp(1.75rem, 4vw, 3.5rem);
  border-radius: 32px;
  background:
    radial-gradient(60% 80% at 92% 8%, rgba(248, 245, 116, 0.17), transparent 65%),
    radial-gradient(50% 60% at 0% 100%, rgba(40, 190, 160, 0.12), transparent 70%),
    var(--surface-deep);
  color: var(--on-dark);
}

@media (min-width: 960px) {
  .project-feature {
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
    gap: clamp(2.5rem, 5vw, 5rem);
    min-height: 31rem;
  }
}

.project-feature__text {
  display: grid;
  justify-items: start;
  gap: 1rem;
  position: relative;
  z-index: 2;
}

.project-feature__text h3 {
  font-size: clamp(2.5rem, 5.2vw, 4.25rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.055em;
  color: var(--on-dark);
}

.project-feature__excerpt {
  max-width: 36ch;
  color: var(--on-dark-muted);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.55;
}

.project-feature__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.project-feature__tags li {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border-on-dark-strong);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  color: var(--on-dark-muted);
}

.project-feature .btn {
  margin-top: 0.75rem;
}

/* scène : capture en perspective, déborde du cadre à droite */
.project-feature__shot {
  display: block;
}

.project-feature__stage {
  position: relative;
  perspective: 1500px;
}

@media (min-width: 960px) {
  .project-feature__stage {
    margin-right: calc(-1 * clamp(1.75rem, 4vw, 3.5rem) - 3rem);
  }
}

.project-feature .mock {
  position: relative;
  inset: auto;
  translate: none;
  width: 100%;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 60px 90px -30px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(240, 242, 237, 0.08);
  transform: rotateY(-10deg) rotateX(4deg) rotateZ(0.8deg);
  transform-origin: 15% 50%;
  transition: transform 0.9s var(--ease);
  animation: feature-float 7s ease-in-out infinite alternate;
}

.project-feature:hover .mock {
  transform: rotateY(-3deg) rotateX(1deg) rotateZ(0deg);
}

.project-feature .mock--shot .mock__shot {
  height: auto;
}

@keyframes feature-float {
  from { translate: 0 0; }
  to { translate: 0 -10px; }
}

/* une carte sur deux : texte à droite, capture à gauche */
@media (min-width: 960px) {
  .project-feature:nth-child(even) {
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 0.78fr);
    background:
      radial-gradient(60% 80% at 8% 8%, rgba(248, 245, 116, 0.17), transparent 65%),
      radial-gradient(50% 60% at 100% 100%, rgba(40, 190, 160, 0.12), transparent 70%),
      var(--surface-deep);
  }

  .project-feature:nth-child(even) .project-feature__text {
    order: 2;
  }

  .project-feature:nth-child(even) .project-feature__shot,
  .project-feature:nth-child(even) .project-feature__stage {
    order: 1;
  }

  .project-feature:nth-child(even) .project-feature__stage {
    margin-right: 0;
    margin-left: calc(-1 * clamp(1.75rem, 4vw, 3.5rem) - 3rem);
  }

  .project-feature:nth-child(even) .mock {
    transform: rotateY(10deg) rotateX(4deg) rotateZ(-0.8deg);
    transform-origin: 85% 50%;
  }

  .project-feature:nth-child(even):hover .mock {
    transform: rotateY(3deg) rotateX(1deg) rotateZ(0deg);
  }
}

/* mobile / tablette : empilé, moins incliné */
@media (max-width: 959px) {
  .project-feature {
    gap: 2rem;
    border-radius: 26px;
  }

  .project-feature__stage {
    perspective: 1000px;
  }

  .project-feature .mock {
    transform: rotateY(-5deg) rotateX(2deg);
    transform-origin: 20% 50%;
  }

}

@media (max-width: 719px) {
  .project-feature {
    padding: 1.5rem 1.25rem 1.75rem;
  }

  .project-feature .btn {
    width: 100%;
  }


  /* la fenêtre garde son cadre (pas le plein cadre des cartes) */
  .project-feature .mock--shot {
    inset: auto;
    border-radius: 12px;
  }

  .project-feature .mock--shot .mock__shot {
    height: auto;
    object-fit: initial;
  }

  .project-feature .mock--shot .mock__bar {
    height: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-feature .mock {
    animation: none;
    transition: none;
  }
}

.ext-icon {
  display: inline-block;
  flex: none;
  margin-left: 0.4em;
  vertical-align: -0.12em;
}
