/* ==========================================================================
   Project hero
   ========================================================================== */

.project-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-height) + 40px);
  padding-bottom: 40px;
  overflow: hidden;
  color: var(--color-text-light);
  background-color: var(--color-bg-dark);
}

.project-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--color-bg-dark);
  background-size: cover;
  background-position: center;
  transform-origin: center center;
  animation: project-zoom-out 25s ease-out forwards;
}

@keyframes project-zoom-out {
  from {
    transform: scale(1.15);
  }

  to {
    transform: scale(1);
  }
}

.project-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, var(--project-hero-overlay));
}

.project-hero--light {
  color: var(--color-text);
}

.project-hero--light::before {
  background: rgba(255, 255, 255, 0.75);
}

.project-hero__content {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
}

.project-hero h1 {
  font-size: 3.625rem; /* 58px */
  line-height: 1.2;
  margin: 0 0 24px;
}

.project-hero__lead {
  font-size: 1.5rem; /* 24px */
  line-height: 1.5;
  opacity: 0.85;
  letter-spacing: -0.019em;
  margin-bottom: 24px;
}

.project-hero__services {
  font-size: 1.125rem; /* 18px */
  line-height: 1.6;
  opacity: 0.75;
  letter-spacing: -0.019em;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .project-hero h1 {
    font-size: 2.5rem;
  }
}

/* ==========================================================================
   Project meta (services / client / location)
   ========================================================================== */

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-meta p {
  margin: 0;
  font-size: 1.125rem; /* 18px */
  opacity: 0.75;
  letter-spacing: -0.019em;
}

.project-meta strong {
  font-weight: 600;
  opacity: 1;
}

.project-hero__highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 40px;
  margin-top: 40px;
}

.project-hero__highlights h4 {
  font-size: 1.5rem; /* 24px */
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 8px;
}

.project-hero__highlights p {
  font-size: 1.125rem; /* 18px */
  opacity: 0.8;
  letter-spacing: -0.019em;
  line-height: 1.6;
  margin: 0;
}

.project-hero__label {
  font-size: 1.5rem !important;  /* 24px */
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 24px;
  color: var(--color-text-light);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .project-hero__label {
    white-space: normal;
  }
}

@media (max-width: 1024px) {
  .project-hero__highlights {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ==========================================================================
   Project content sections
   ========================================================================== */

.project-section {
  padding: calc(var(--header-height) + 64px) 0;
}

.project-section--media {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  color: var(--color-text-light);
  background-color: var(--color-bg-dark);
  overflow: hidden;
}

.project-section--media .project-hero__media {
  z-index: 0;
}

.project-section--media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(10, 10, 10, 0.55);
}

.project-section--media .container {
  position: relative;
  z-index: 2;
}

.project-section--media .section-intro--light h1,
.project-section--media .section-intro--light h2,
.project-section--media .section-intro--light h3,
.project-section--media .section-intro--light p {
  color: var(--color-text-light);
}

.project-section--media-light {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-color: #e8e4da;
  overflow: hidden;
}

.project-section--media-light .project-hero__media {
  z-index: 0;
}

.project-section--media-light::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.75);
}

.project-section--media-light .container {
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   Project galleries
   ========================================================================== */

/* Wider container on project pages — reduces side margins to ~180px */
.project-section .container {
  max-width: calc(100% - 360px);
  padding: 0 0;
}

@media (max-width: 768px) {
  .project-section .container {
    max-width: var(--container-max-width);
    padding: 0 var(--container-padding);
  }
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 48px;
}

.project-gallery__item {
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-image);
  overflow: hidden;
}

.project-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-gallery__item--full {
  grid-column: 1 / -1;
}

/* ==========================================================================
   Gallery item aspect ratio overrides
   Apply to any .project-gallery__item to override the default 16/10 ratio.
   Usage: <div class="project-gallery__item ar-16-9 reveal">
   The default ratio (16/10) is set on .project-gallery__item above.
   ========================================================================== */

/* Landscape ratios — largest to smallest (value = w/h) */
.ar-9-2     { aspect-ratio: 9 / 2;     }   /* 4.50 — extra-wide strip (1581×354) */
.ar-7-2     { aspect-ratio: 7 / 2;     }   /* 3.50 — extra-wide landscape (1670×470) */
.ar-3-1     { aspect-ratio: 3 / 1;     }   /* 3.00 — banner strip */
.ar-191-68  { aspect-ratio: 191 / 68;  }   /* 2.81 — 1910×678 px source */
.ar-12-5    { aspect-ratio: 12 / 5;    }   /* 2.40 — anamorphic cinema */
.ar-21-9    { aspect-ratio: 21 / 9;    }   /* 2.33 — ultrawide / cinematic */
.ar-21-10   { aspect-ratio: 21 / 10;   }   /* 2.10 — wide banner */
.ar-11-5    { aspect-ratio: 11 / 5;    }   /* 2.20 — wide landscape (3343×1527) */
.ar-2-1     { aspect-ratio: 2 / 1;     }   /* 2.00 — panorama (Univisium) */
.ar-191-100 { aspect-ratio: 191 / 100; }   /* 1.91 — social card (Open Graph 1200×630) */
.ar-50-27   { aspect-ratio: 50 / 27;   }   /* 1.85 — cinema flat (1500×828) */
.ar-16-9    { aspect-ratio: 16 / 9;    }   /* 1.78 — widescreen / video */
.ar-12-7    { aspect-ratio: 12 / 7;    }   /* 1.71 — wide landscape (1594×926) */
.ar-16-10   { aspect-ratio: 16 / 10;   }   /* 1.60 — default (same as base style) */
.ar-3-2     { aspect-ratio: 3 / 2;     }   /* 1.50 — photo standard / DSLR */
.ar-36-25   { aspect-ratio: 36 / 25;   }   /* 1.44 — near-photo landscape (900×625) */
.ar-4-3     { aspect-ratio: 4 / 3;     }   /* 1.33 — classic / interface screenshots */
.ar-13-10   { aspect-ratio: 13 / 10;   }   /* 1.30 — near-classic landscape (800×618) */
.ar-5-4     { aspect-ratio: 5 / 4;     }   /* 1.25 — large format */
.ar-6-5     { aspect-ratio: 6 / 5;     }   /* 1.20 — near-square (756×660) */
.ar-15-13   { aspect-ratio: 15 / 13;   }   /* 1.15 — near-square landscape (600×532) */
.ar-1-1     { aspect-ratio: 1 / 1;     }   /* 1.00 — square */
.ar-29-28   { aspect-ratio: 29 / 28;   }   /* 1.04 — near-square landscape (668×645) */
.ar-127-120 { aspect-ratio: 127 / 120; }   /* 1.06 — near-square landscape (635×600) */
.ar-120-127 { aspect-ratio: 120 / 127; }   /* 0.94 — near-square portrait (600×635) */
.ar-28-29   { aspect-ratio: 28 / 29;   }   /* 0.97 — near-square portrait (645×668) */

/* Portrait ratios — largest to smallest (value = w/h) */
.ar-13-15   { aspect-ratio: 13 / 15;   }   /* 0.87 — near-square portrait (532×600) */
.ar-5-6     { aspect-ratio: 5 / 6;     }   /* 0.83 — near-square portrait (660×756) */
.ar-4-5     { aspect-ratio: 4 / 5;     }   /* 0.80 — social portrait (Instagram) */
.ar-3-4     { aspect-ratio: 3 / 4;     }   /* 0.75 — classic portrait */
.ar-2-3     { aspect-ratio: 2 / 3;     }   /* 0.67 — photo portrait / DSLR */
.ar-10-16   { aspect-ratio: 10 / 16;   }   /* 0.63 — portrait default */
.ar-9-16    { aspect-ratio: 9 / 16;    }   /* 0.56 — vertical video */
.ar-27-50   { aspect-ratio: 27 / 50;   }   /* 0.54 — cinema flat portrait (828×1500) */
.ar-100-191 { aspect-ratio: 100 / 191; }   /* 0.52 — social card portrait */
.ar-1-2     { aspect-ratio: 1 / 2;     }   /* 0.50 — panorama portrait */
.ar-10-21   { aspect-ratio: 10 / 21;   }   /* 0.48 — tall banner (370×771) */
.ar-9-21    { aspect-ratio: 9 / 21;    }   /* 0.43 — ultrawide portrait */
.ar-5-12    { aspect-ratio: 5 / 12;    }   /* 0.42 — anamorphic portrait */
.ar-1-3     { aspect-ratio: 1 / 3;     }   /* 0.33 — skyscraper */

/* ==========================================================================
   Gallery item outline / shadow modifiers
   Apply to any .project-gallery__item alongside ar- classes.
   Usage: <div class="project-gallery__item ar-16-9 img-outline reveal">
   ========================================================================== */

/* ==========================================================================
   Gallery item shadow modifiers
   Apply to any .project-gallery__item alongside ar- classes.
   Usage: <div class="project-gallery__item ar-16-9 img-shadow-sm reveal">
   ========================================================================== */

.project-gallery__item.img-shadow-sm  { overflow: visible; box-shadow: 0 4px 12px rgba(0,0,0,0.30); }
.project-gallery__item.img-shadow     { overflow: visible; box-shadow: 0 8px 24px rgba(0,0,0,0.45); }
.project-gallery__item.img-shadow-lg  { overflow: visible; box-shadow: 0 16px 40px rgba(0,0,0,0.60); }
.project-gallery__item.img-shadow-xl  { overflow: visible; box-shadow: 0 24px 60px rgba(0,0,0,0.75); }

.project-gallery__item:nth-child(2n).is-visible {
  transition-delay: 0.1s;
}

/* Optional 3-across row modifier — reference/test use only as of v41 */
.project-gallery--row3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
  .project-gallery--row3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1 column */
.project-gallery--row1 {
  grid-template-columns: 1fr;
}

/* 4 columns */
.project-gallery--row4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .project-gallery--row4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .project-gallery--row4 {
    grid-template-columns: 1fr;
  }
}

/* 5 columns */
.project-gallery--row5 {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1024px) {
  .project-gallery--row5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .project-gallery--row5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Feature row: 5 images — two stacked pairs flanking a tall center item.
   Markup order: top-left, tall center (with --tall), top-right,
   bottom-left, bottom-right. Grid auto-placement handles the rest. */
.project-gallery--feature5 {
  grid-template-columns: repeat(3, 1fr);
}

.project-gallery__item--tall {
  grid-row: span 2;
  aspect-ratio: auto;
}

@media (max-width: 768px) {
  .project-gallery--feature5 {
    grid-template-columns: 1fr;
  }

  .project-gallery__item--tall {
    grid-row: auto;
    aspect-ratio: 3 / 4;
  }
}

/* 6 columns */
.project-gallery--row6 {
  grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1024px) {
  .project-gallery--row6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .project-gallery--row6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .project-gallery {
    grid-template-columns: 1fr;
  }

  .project-gallery--row3 {
    grid-template-columns: 1fr;
  }

  .project-gallery__item--full {
    grid-column: auto;
  }
}

/* ==========================================================================
   Project video (text + embedded video, side by side)
   ========================================================================== */

.project-video {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 24px 56px;
  align-items: center;
}

.project-video__text h2 {
  font-size: 2.5rem; /* 40px */
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 16px;
}

.project-video__text p {
  font-size: 1.25rem; /* 20px */
  opacity: 0.85;
  letter-spacing: -0.019em;
  line-height: 1.6;
  margin: 0 0 16px;
}

.project-video__text p:last-child {
  margin-bottom: 0;
}

.project-video__text h4 {
  font-size: 1.25rem; /* 20px */
  font-weight: 500;
  line-height: 1.2;
  margin: 24px 0 8px;
}

.project-video__credit {
  font-size: 0.8125rem !important; /* 13px */
  opacity: 0.5 !important;
  margin-top: 16px !important;
}

.project-video--reverse {
  grid-template-columns: 6fr 5fr;
}

@media (max-width: 1024px) {
  .project-video--reverse {
    grid-template-columns: 1fr;
  }

  .project-video--reverse .project-video__media {
    order: -1;
  }
}

.project-video__media {
  width: 100%;
}

.project-video__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-image);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}

@media (max-width: 1024px) {
  .project-video {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ==========================================================================
   Project Media Layout — alias of project-video for non-video sections
   Use .project-media / .project-media__text instead of project-video classes
   when the section contains an image rather than a video.
   ========================================================================== */

.project-media               { display: grid; grid-template-columns: 5fr 6fr; gap: 24px 56px; align-items: center; }
.project-media--reverse      { grid-template-columns: 6fr 5fr; }
.project-media__text h2      { font-size: 2.5rem; font-weight: 500; line-height: 1.2; margin: 0 0 16px; }
.project-media__text p       { font-size: 1.25rem; opacity: 0.85; letter-spacing: -0.019em; line-height: 1.6; margin: 0 0 16px; }
.project-media__text p:last-child { margin-bottom: 0; }
.project-media__text h4      { font-size: 1.25rem; font-weight: 500; line-height: 1.2; margin: 24px 0 8px; }
.project-media__credit       { font-size: 0.8125rem !important; opacity: 0.5 !important; margin-top: 16px !important; }

@media (max-width: 1024px) {
  .project-media             { grid-template-columns: 1fr; gap: 32px; }
  .project-media--reverse    { grid-template-columns: 1fr; }
  .project-media--reverse .project-gallery__item { order: -1; }
}


 /*  ========================================================================== */

.project-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 40px;
  margin-top: 48px;
}

.project-highlights .reveal:nth-child(2).is-visible {
  transition-delay: 0.1s;
}

.project-highlights .reveal:nth-child(3).is-visible {
  transition-delay: 0.2s;
}

.project-highlights h3 {
  font-size: 1.5rem; /* 24px */
  line-height: 1.2;
  margin: 0 0 8px;
}

.project-highlights p {
  font-size: 1.125rem; /* 18px */
  opacity: 0.8;
  letter-spacing: -0.019em;
  line-height: 1.6;
}

@media (max-width: 1024px) {
  .project-highlights {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .project-highlights {
    grid-template-columns: 1fr;
  }
}

.project-highlights--2col {
  grid-template-columns: repeat(2, 1fr);
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .project-highlights--2col {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Bottom navigation (back to projects / back to top)
   ========================================================================== */

.project-nav {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 400;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.project-nav__button {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  color: var(--color-text);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.project-nav__button:hover {
  background: #ffffff;
  transform: scale(1.06);
}

.project-nav__button svg {
  width: 20px;
  height: 20px;
}

.project-nav__pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px 0 6px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: var(--color-text);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.project-nav__pill:hover {
  background: #ffffff;
  transform: scale(1.03);
}

.project-nav__pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg-dark);
  color: var(--color-text-light);
  flex-shrink: 0;
}

.project-nav__pill-icon svg {
  width: 16px;
  height: 16px;
}

.project-nav__pill-label {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.project-nav__button[data-back-to-top] {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.project-nav__button[data-back-to-top].is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ==========================================================================
   Stat / pull-quote line within a section-intro
   ========================================================================== */

.project-stat {
  font-size: 1.75rem; /* 28px */
  font-weight: 600 !important;
  opacity: 1 !important;
  margin-top: 8px;
}

.quote-cite {
  font-size: 1.125rem !important; /* 18px */
  opacity: 0.6 !important;
  margin-top: 8px !important;
}

/* ==========================================================================
   section-intro utility system — alignment & width
   Apply these directly to any .section-intro element.
   They override only text-align and max-width; all other styles unchanged.
   ========================================================================== */

/* --- Alignment --- */
.si-left   { text-align: left;   margin-left: 0; margin-right: auto; }
.si-right  { text-align: right;  margin-left: auto; margin-right: 0; }
/* default (no modifier) = centered, margin: 0 auto */

/* --- Width --- */
.si-w-400  { max-width: 400px;  }
.si-w-600  { max-width: 600px;  }
.si-w-800  { max-width: 800px;  }
.si-w-1000 { max-width: 1000px; } /* matches .project-hero__content */
.si-w-full { max-width: 100%;   }

/* On mobile all width caps lift to full */
@media (max-width: 768px) {
  .si-w-400,
  .si-w-600,
  .si-w-800,
  .si-w-1000 { max-width: 100%; }
}

/* ==========================================================================
   Page-specific overrides
   (font sizes, colors, gradients — layout now handled by si- utilities above)
   ========================================================================== */

/* --- AOT --- */

.page-aot .section-intro--multimedia h2 {
  font-size: 2.8125rem; /* 45px */
  color: #4d4d4d;
  opacity: 1;
}

@media (max-width: 768px) {
  .page-aot .section-intro--multimedia h2 { font-size: 1.6875rem; }
  .page-aot .section-intro--multimedia p  { font-size: 1.25rem;   }
  .page-aot .section-intro--ar h2         { font-size: 1.6875rem; }
  .page-aot .section-intro--ar p          { font-size: 1.25rem;   }
}

/* --- APATO --- */

.page-apato .project-section--gradient-blue {
  background: linear-gradient(135deg, #3947d5 0%, #01d1ff 100%) !important;
}

@media (max-width: 768px) {
  .page-apato .section-intro--exploring p        { font-size: 1.25rem;   }
  .page-apato .project-video__text h2            { font-size: 1.875rem;  }
  .page-apato .project-video__text--mobile-27 h2 { font-size: 1.6875rem; }
  .page-apato .project-media__text h2            { font-size: 1.875rem;  }
  .page-apato .project-media__text--mobile-27 h2 { font-size: 1.6875rem; }
}

/* --- ARVIKING --- */

.page-arviking .project-stat {
  font-size: 2.3125rem; /* 37px */
}

.page-arviking .project-section--gradient-viking {
  background: linear-gradient(135deg, #b59043 0%, #850a21 100%) !important;
}

/* --- CAVES --- */

@media (max-width: 768px) {
  .page-caves .section-intro--uivisitor h2      { font-size: 1.6875rem; }
  .page-caves .project-video__text--watch h2    { font-size: 1.6875rem; }
  .page-caves .project-video__text--adapted h2  { font-size: 1.6875rem; }
  .page-caves .project-media__text--watch h2    { font-size: 1.6875rem; }
  .page-caves .project-media__text--adapted h2  { font-size: 1.6875rem; }
}

/* --- CRM --- */

.page-crm .crm-pullquote {
  font-size: 1.75rem; /* 28px */
  font-weight: 300;
  line-height: 1.5;
  opacity: 1;
  letter-spacing: -0.02em;
}

.page-crm .section-intro--lockdam h2 {
  font-size: 3.625rem; /* 58px */
  opacity: 1;
}

.page-crm .section-intro--lockdam h3 {
  font-size: 1.75rem; /* 28px */
  font-weight: 700;
  margin-top: 40px;
  margin-bottom: 16px;
}

.page-crm .section-intro--lockdam p {
  font-size: 1.25rem; /* 20px */
  opacity: 0.85;
  line-height: 1.6;
}

.page-crm .project-section--world {
  background: linear-gradient(135deg, #5b3fa0 0%, #1a6fa8 55%, #1aada8 100%);
}

.page-crm .section-intro--world h2 {
  font-size: 4rem; /* 64px */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 1;
  color: var(--color-text-light);
}

.page-crm .section-intro--world p {
  color: var(--color-text-light);
  opacity: 0.9;
}

@media (max-width: 768px) {
  .page-crm .crm-pullquote          { font-size: 1.25rem; }
  .page-crm .section-intro--lockdam h2 { font-size: 2.25rem; }
  .page-crm .section-intro--lockdam h3 { font-size: 1.375rem; }
  .page-crm .section-intro--lockdam p  { font-size: 1.125rem; }
  .page-crm .section-intro--world h2   { font-size: 2.25rem;  }
}
