:root {
  --color-white: #ffffff;
  --color-light: #f5f5f5;
  --color-dark: #1a1a1a;
  --color-text: #333333;
  --color-text-light: #666666;
  --font-sans:
    "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  --max-width: 2000px;
  --spacing-x: 60px;
  --spacing-y: 40px;
  --grid-gap: 20px;
}

/* Page transition overlay */
.page-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
}

.page-transition-overlay.active {
  pointer-events: all;
}

.transition-band {
  position: absolute;
  left: 0;
  width: 100%;
  background-color: #60b55e;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Top band - covers hero image area, slides LEFT */
.transition-band-top {
  top: 0;
  height: 70vh; /* Fallback, will be set by JS */
}

.transition-band-top.reveal {
  transform: translateX(-100%);
}

/* Bottom band - covers rest of page, slides RIGHT */
.transition-band-bottom {
  top: 70vh; /* Fallback, will be set by JS */
  height: 30vh; /* Fallback, will be set by JS */
}

.transition-band-bottom.reveal {
  transform: translateX(100%);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ================================
   PROJECT PAGE
   ================================ */

.project > *:not(.project-hero) {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.project.loaded > *:not(.project-hero) {
  opacity: 1;
  transform: translateY(0);
}

.project-navigation {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.project-navigation.loaded {
  opacity: 1;
  transform: translateY(0);
}

.project {
  width: 100%;
}

/* ================================
   HERO SECTION
   ================================ */

.project-hero {
  width: 100%;
  margin-bottom: var(--spacing-y);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project.loaded .project-hero {
  opacity: 1;
}

.project-hero-image {
  margin: 0;
  width: 100%;
}

.project-hero-image img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: cover;
}

/* ================================
   INTRO SECTION (Titre + Description + Meta)
   ================================ */

.project-intro {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-x);
  margin-bottom: 60px;
}

.project-intro-content {
  width: 100%;
}

.project-title {
  font-size: clamp(2.5rem, 7vw, 10rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 90px 0;
  color: var(--primary, #203c21);
  line-height: 1;
}

.project-intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.project-description {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
}

.project-description p {
  margin-bottom: 1rem;
}

.project-description p:last-child {
  margin-bottom: 0;
}

/* Meta informations */
.project-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: end;
}

.meta-item {
  display: block;
}

.meta-text {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--accent, #6aade1);
  letter-spacing: 0.02em;
  line-height: 1.3;
}

/* ================================
   LAYOUT GRID (Contenu flexible)
   ================================ */

.project-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-x);
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
  margin-bottom: 80px;
}

.layout-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--grid-gap);
  background: var(--bg, transparent);
  align-items: stretch;
}

.layout-row.light {
  background: var(--color-light);
  padding: var(--spacing-y) var(--spacing-x);
  margin-left: calc(-1 * var(--spacing-x));
  margin-right: calc(-1 * var(--spacing-x));
  padding-left: var(--spacing-x);
  padding-right: var(--spacing-x);
}

.layout-row.dark {
  background: var(--color-dark);
  color: var(--color-white);
  padding: var(--spacing-y) var(--spacing-x);
  margin-left: calc(-1 * var(--spacing-x));
  margin-right: calc(-1 * var(--spacing-x));
  padding-left: var(--spacing-x);
  padding-right: var(--spacing-x);
}

.layout-column {
  grid-column: span var(--span, 12);
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

/* Blocks styling */
.layout-column .blocks {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}

.layout-column figure {
  width: 100%;
  height: 100%;
  margin: 0;
}

.layout-column figure picture {
  display: block;
  width: 100%;
  height: 100%;
}

.layout-column figure picture img,
.layout-column figure > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.layout-column h2 {
  font-size: 1.75rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.layout-column h3 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.layout-column p {
  margin-bottom: 1rem;
}

.layout-column blockquote {
  font-size: 1.5rem;
  font-style: italic;
  border-left: 3px solid var(--color-dark);
  padding-left: 1.5rem;
  margin: 1rem 0;
}

/* Text blocks alignment in 2-column layouts */
.layout-column.column-left .blocks {
  justify-content: flex-end;
}

.layout-column.column-left p,
.layout-column.column-left .block-type-text {
  text-align: right;
  font-size: 0.85rem;
  color: var(--accent, #6aade1);
  margin-top: auto;
}

.layout-column.column-right .blocks {
  justify-content: flex-end;
}

.layout-column.column-right p,
.layout-column.column-right .block-type-text {
  text-align: left;
  font-size: 0.85rem;
  color: var(--accent, #6aade1);
  margin-top: auto;
}

/* ================================
   PROJECT NAVIGATION
   ================================ */

.project-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px var(--spacing-x);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-link:hover {
  transform: translateY(-2px);
}

.nav-link:hover .nav-arrow {
  background-color: var(--accent, #6aade1);
}

.nav-link:hover .nav-label,
.nav-link:hover .nav-text {
  color: var(--accent, #6aade1);
}

.nav-arrow {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary, #203c21);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.nav-arrow svg {
  width: 24px;
  height: 24px;
  stroke: var(--background, #fefef6);
  stroke-width: 2.5;
}

.nav-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.nav-text {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 600;
  color: var(--primary, #203c21);
  letter-spacing: -0.02em;
  line-height: 1;
  transition: color 0.2s ease;
}

.nav-prev .nav-content {
  align-items: flex-start;
}

.nav-prev .nav-label {
  padding-left: 5px;
}

.nav-next {
  margin-left: auto;
}

.nav-next .nav-content {
  align-items: flex-end;
}

/* ================================
   PROJECTS LIST PAGE
   ================================ */

.projects-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-y) var(--spacing-x);
}

.projects-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
}

.project-card {
  text-decoration: none;
  color: var(--color-text);
  display: block;
  transition: transform 0.3s ease;
}

.project-card:hover {
  transform: translateY(-4px);
}

.project-card-image {
  overflow: hidden;
  margin-bottom: 1rem;
}

.project-card-image img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-card-image img {
  transform: scale(1.03);
}

.project-card-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.project-card-location {
  font-size: 0.875rem;
  color: var(--color-text-light);
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 1024px) {
  :root {
    --spacing-x: 40px;
    --spacing-y: 30px;
  }

  .project-intro-grid {
    gap: 40px;
  }
}

.mobile-contact-bar {
  display: none;
}

@media (max-width: 768px) {
  :root {
    --spacing-x: 20px;
    --spacing-y: 20px;
    --grid-gap: 15px;
  }

  .transition-band-top {
    height: 40vh;
  }

  .transition-band-bottom {
    top: 40vh;
    height: 60vh;
  }

  .project-hero-image img {
    height: 40vh;
    max-height: none;
    object-fit: cover;
  }

  .project-title {
    font-size: 4rem;
    margin: 0 0 20px 0;
    line-height: 1.1;
  }

  .project-intro-content {
    display: flex;
    flex-direction: column;
  }

  .project-intro-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .project-meta {
    order: -1;
    align-self: start;
  }

  .project-description {
    order: 1;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .layout-row {
    display: flex;
    flex-direction: column;
    gap: var(--grid-gap);
  }

  .layout-column {
    width: 100%;
    min-height: auto;
  }

  .layout-column figure {
    aspect-ratio: 4/3;
    height: auto;
  }

  .layout-column figure picture img,
  .layout-column figure > img {
    aspect-ratio: 4/3;
    height: auto;
  }

  .layout-row:has(.layout-column:only-child) .layout-column figure,
  .layout-row:has(.layout-column:only-child) .layout-column figure picture img,
  .layout-row:has(.layout-column:only-child) .layout-column figure > img {
    aspect-ratio: auto;
  }

  .layout-column.column-text {
    order: 2 !important;
    min-height: auto;
    padding: 10px 0;
  }

  .layout-column.column-image {
    order: 1 !important;
  }

  .layout-column.column-left p,
  .layout-column.column-left .block-type-text,
  .layout-column.column-right p,
  .layout-column.column-right .block-type-text {
    text-align: left;
  }

  .project-navigation {
    padding: 40px var(--spacing-x) 72px;
  }

  .nav-arrow svg {
    width: 28px;
    height: 28px;
  }

  .nav-text {
    font-size: 1rem;
  }

  /* Mobile contact bar */
  .mobile-contact-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--background, #FEFEF6);
    border-top: 1px solid rgba(32, 60, 33, 0.15);
    z-index: 100;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .mobile-contact-bar.loaded {
    opacity: 1;
    transform: translateY(0);
  }

  .mobile-contact-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary, #203C21);
    text-decoration: none;
  }

  .mobile-contact-action + .mobile-contact-action {
    border-left: 1px solid rgba(32, 60, 33, 0.15);
  }

  .mobile-contact-action:active {
    background: rgba(32, 60, 33, 0.06);
  }

  .mobile-contact-action svg {
    flex-shrink: 0;
  }

  .footer {
    padding-bottom: 60px;
  }
}
