/* =========================
   PROJECT PAGE STYLES
   Shared by every individual project page (/our-work/<slug>/).
   Loads after styles.css + subpage-styles.css and reuses their tokens,
   the shared subpage hero, breadcrumb, and .cta-btn.
   ========================= */

/* =========================
   HERO — project image swapped into the shared subpage hero
   (background-image is set inline per project; everything else inherited)
   ========================= */
.proj-hero {
  background-position: center 60%;
}

/* Breadcrumb sits where the "Portfolio" label does on Our Work. */
.proj-hero .breadcrumb {
  margin-bottom: 24px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.14em;
  gap: 14px;
}

/* Hero meta line (location · year · status), doubled for legibility. */
.proj-hero .subpage-hero-meta {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.14em;
  flex-wrap: wrap;
  row-gap: 8px;
}

@media (min-width: 768px) {
  .proj-hero .breadcrumb {
    margin-bottom: 32px;
  }
}

/* =========================
   SHARED PROJECT PRIMITIVES
   ========================= */
.proj-eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.proj-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.05;
  text-transform: lowercase;
  color: var(--foreground);
}

.proj-body {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--muted-foreground);
}

.proj-body-lead {
  font-size: 18px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--foreground);
}

/* Image frame — fixed aspect so the layout never jumps while images load. */
.proj-media {
  position: relative;
  overflow: hidden;
  background: var(--muted);
}

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

.proj-media-wide {
  aspect-ratio: 16 / 10;
}

.proj-media-landscape {
  aspect-ratio: 16 / 10;
}

.proj-media-square {
  aspect-ratio: 4 / 5;
}

.proj-media-portrait {
  aspect-ratio: 4 / 5;
}

/* Numbered plate caption: "01 — central courtyard" */
.proj-caption {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(85, 85, 85, 0.7);
}

.proj-caption-num {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--foreground);
}

.proj-caption-num::after {
  content: '';
  width: 24px;
  height: 1px;
  background: rgba(74, 72, 66, 0.35);
}

.proj-caption-light {
  margin-top: 0;
  color: rgba(245, 241, 235, 0.75);
}

.proj-caption-light .proj-caption-num {
  color: #f5f1eb;
}

.proj-caption-light .proj-caption-num::after {
  background: rgba(245, 241, 235, 0.45);
}

/* =========================
   KEY FIGURES BAR
   ========================= */
.proj-facts {
  background: var(--bg-alt-2);
  border-bottom: 1px solid rgba(187, 187, 187, 0.3);
}

.proj-facts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.proj-fact {
  padding: 32px 0 28px;
  border-bottom: 1px solid rgba(187, 187, 187, 0.3);
}

.proj-fact:nth-child(odd) {
  padding-right: 16px;
}

.proj-fact:nth-child(even) {
  padding-left: 20px;
  border-left: 1px solid rgba(187, 187, 187, 0.3);
}

.proj-fact:nth-last-child(-n+2) {
  border-bottom: none;
}

.proj-fact-value {
  display: block;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.proj-fact-label {
  display: block;
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

@media (min-width: 900px) {
  .proj-facts-grid {
    /* One equal column per stat, however many the project lists. */
    grid-template-columns: none;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
  }

  .proj-fact,
  .proj-fact:nth-child(odd),
  .proj-fact:nth-child(even) {
    padding: 48px 32px 44px;
    border-bottom: none;
    border-left: 1px solid rgba(187, 187, 187, 0.3);
  }

  .proj-fact:first-child {
    padding-left: 0;
    border-left: none;
  }

  .proj-fact-value {
    font-size: 72px;
  }
}

/* =========================
   STATEMENT (word scrub)
   ========================= */
.proj-statement {
  background: var(--bg-alt);
  padding: clamp(96px, 12vw, 176px) 0;
}

.proj-statement-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.25rem, 5.5vw, 5rem);
  line-height: 1.15;
  letter-spacing: 0;
  color: var(--foreground);
  /* Spans the full content width, like the homepage definition scrub. */
  width: 100%;
  max-width: 100%;
}

.proj-word {
  display: inline-block;
  margin-right: 0.25em;
}

/* =========================
   OVERVIEW — mission + scope | feature image
   ========================= */
.proj-overview {
  padding: 72px 0;
}

.proj-overview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

.proj-overview-text {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.proj-block {
  padding-top: 28px;
  border-top: 1px solid rgba(187, 187, 187, 0.4);
}

/* Section titles for Mission / Project Scope */
.proj-block-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.05;
  text-transform: lowercase;
  color: var(--foreground);
  margin-bottom: 18px;
}

.proj-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.proj-list li {
  position: relative;
  padding-left: 24px;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--muted-foreground);
}

.proj-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 12px;
  height: 1px;
  background: rgba(74, 72, 66, 0.45);
}

@media (min-width: 1024px) {
  .proj-overview {
    padding: 120px 0;
  }

  .proj-overview-grid {
    grid-template-columns: 5fr 7fr;
    gap: 80px;
    align-items: start;
  }

  .proj-overview-text {
    padding-top: 8px;
  }

  .proj-block-title {
    font-size: 40px;
  }

  .proj-body-lead {
    font-size: 20px;
  }

  .proj-list li {
    font-size: 18px;
  }
}

/* =========================
   PROJECT FILM — autoplaying muted loop (files in /videos/)
   ========================= */
.proj-film {
  padding: 80px 0;
  background: var(--background);
}

.proj-film-header {
  margin-bottom: 40px;
}

.proj-film-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1e1e1e;
}

.proj-film-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proj-film-controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 10px;
  z-index: 2;
}

.proj-film-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(20, 20, 18, 0.45);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.proj-film-btn:hover,
.proj-film-btn:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
}

.proj-film-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.proj-film-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Show the icon for the action the button will take. */
.proj-film-play[data-state="playing"] .icon-play,
.proj-film-play[data-state="paused"] .icon-pause,
.proj-film-sound[data-state="muted"] .icon-sound,
.proj-film-sound[data-state="sound"] .icon-muted {
  display: none;
}

@media (min-width: 768px) {
  .proj-film {
    padding: 112px 0;
  }

  .proj-film-controls {
    right: 24px;
    bottom: 24px;
  }
}

/* =========================
   FULL-BLEED PANORAMA
   ========================= */
.proj-panorama {
  position: relative;
  height: 56vw;
  max-height: 88vh;
  min-height: 320px;
  overflow: hidden;
  background: #1e1e1e;
}

.proj-panorama img {
  position: absolute;
  left: 0;
  top: -10%;
  width: 100%;
  height: 120%;
  object-fit: cover;
  will-change: transform;
}

.proj-panorama-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 20, 18, 0.55), rgba(20, 20, 18, 0) 40%);
}

.proj-panorama-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  z-index: 2;
}

@media (min-width: 768px) {
  .proj-panorama {
    height: 42vw;
  }

  .proj-panorama-caption {
    bottom: 40px;
  }
}

/* =========================
   DESIGN PHILOSOPHY — sticky image | numbered principles
   ========================= */
.proj-philosophy {
  padding: 80px 0;
  background: var(--background);
}

.proj-philosophy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

.proj-philosophy-content .proj-title {
  margin-bottom: 40px;
}

.proj-philosophy-intro {
  margin: -16px 0 40px;
  max-width: 52ch;
}

.proj-principles {
  list-style: none;
  border-top: 1px solid rgba(187, 187, 187, 0.5);
}

.proj-principle {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  padding: 28px 0;
  border-bottom: 1px solid rgba(187, 187, 187, 0.5);
}

.proj-principle-num {
  font-family: var(--font-display);
  line-height: 1;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.14em;
  color: rgba(85, 85, 85, 0.6);
  padding-top: 8px;
}

.proj-principle-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: lowercase;
  color: var(--foreground);
  margin-bottom: 8px;
}

.proj-principle-short .proj-principle-title {
  margin-bottom: 0;
}

.proj-principle-text {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--muted-foreground);
  max-width: 46ch;
}

@media (min-width: 768px) {
  .proj-title {
    font-size: 44px;
  }

  .proj-principle {
    grid-template-columns: 76px 1fr;
    padding: 32px 0;
  }

  .proj-principle-title {
    font-size: 26px;
  }
}

@media (min-width: 1024px) {
  .proj-philosophy {
    padding: 120px 0;
  }

  .proj-philosophy-grid {
    grid-template-columns: 5fr 7fr;
    gap: 80px;
    align-items: start;
  }

  /* Image holds its place while the principles scroll past. */
  .proj-philosophy-sticky {
    position: sticky;
    top: calc(var(--header-height) + 24px);
  }
}

/* =========================
   MILESTONES — staggered two-up
   ========================= */
.proj-milestones {
  padding: 80px 0 64px;
  background: rgba(255, 255, 255, 0.6);
}

.proj-milestones-header {
  margin-bottom: 48px;
}

.proj-milestones-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

@media (min-width: 768px) {
  .proj-milestones-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }

  /* Offset every second image down for an editorial stagger. */
  .proj-milestone:nth-child(even) {
    margin-top: 96px;
  }
}

@media (min-width: 1024px) {
  .proj-milestones {
    padding: 120px 0 96px;
  }

  .proj-milestones-header {
    margin-bottom: 64px;
  }

  .proj-milestones-grid {
    gap: 64px;
  }

  .proj-milestone:nth-child(even) {
    margin-top: 140px;
  }
}

/* =========================
   BACK LINK
   ========================= */
.proj-back {
  padding: 48px 0;
  border-top: 1px solid rgba(187, 187, 187, 0.3);
}

.proj-back-arrow {
  display: inline-block;
  width: 16px;
  height: 1px;
  background: rgba(74, 72, 66, 0.3);
  transition: all 0.3s ease;
}

.proj-back-btn:hover .proj-back-arrow {
  width: 24px;
  background: var(--accent);
  transform: translateX(-4px);
}

/* =========================
   FIGURES — lightbox affordance
   ========================= */
[data-lightbox] {
  cursor: zoom-in;
}

[data-lightbox]:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

.proj-media img {
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}

.proj-media:hover img {
  transform: scale(1.02);
}

/* =========================
   CHAPTERS — image-heavy walkthrough
   Text column beside an image cluster; chapters alternate sides on desktop.
   Cluster frames are sized so every row lines up with no ragged edges:
   a 4:3 frame spanning 4 of 6 columns matches the height of a 2:3 frame
   spanning 2 columns.
   ========================= */
.proj-chapters {
  padding: 80px 0 32px;
  background: var(--bg-alt);
}

.proj-chapters-header {
  margin-bottom: 56px;
}

.proj-chapter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 48px 0;
  border-top: 1px solid rgba(187, 187, 187, 0.45);
}

.proj-chapter-num {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 18px;
}

.proj-chapter-num::after {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.proj-chapter-text .proj-body-lead {
  max-width: 44ch;
}

/* Image cluster grid */
.proj-chapter-media {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  align-items: start;
}

.proj-chapter-media .proj-media {
  aspect-ratio: 4 / 3;
}

/* 1 image: one wide frame */
.proj-layout-count-1 .proj-figure {
  grid-column: span 6;
}

.proj-layout-count-1 .proj-media {
  aspect-ratio: 16 / 10;
}

/* 2 images: wide 4:3 + tall 2:3 side by side (equal heights) */
.proj-layout-count-2 .proj-figure:nth-child(1) {
  grid-column: span 4;
}

.proj-layout-count-2 .proj-figure:nth-child(2) {
  grid-column: span 2;
}

/* The tall frame stretches to exactly match its wide neighbor's height
   (image is absolutely positioned so it can't drive the row height). */
.proj-layout-count-2 .proj-figure:nth-child(2),
.proj-layout-count-4 .proj-figure:nth-child(2) {
  align-self: stretch;
  display: flex;
  flex-direction: column;
}

.proj-layout-count-2 .proj-figure:nth-child(2) .proj-media,
.proj-layout-count-4 .proj-figure:nth-child(2) .proj-media {
  aspect-ratio: auto;
  flex: 1;
  min-height: 0;
}

.proj-layout-count-2 .proj-figure:nth-child(2) .proj-media img,
.proj-layout-count-4 .proj-figure:nth-child(2) .proj-media img {
  position: absolute;
  inset: 0;
}

/* 3 images: one wide on top, two below */
.proj-layout-count-3 .proj-figure:nth-child(1) {
  grid-column: span 6;
}

.proj-layout-count-3 .proj-figure:nth-child(1) .proj-media {
  aspect-ratio: 16 / 9;
}

.proj-layout-count-3 .proj-figure:nth-child(n+2) {
  grid-column: span 3;
}

/* 4 images: wide + tall on top, two equal below */
.proj-layout-count-4 .proj-figure:nth-child(1) {
  grid-column: span 4;
}

.proj-layout-count-4 .proj-figure:nth-child(2) {
  grid-column: span 2;
}

.proj-layout-count-4 .proj-figure:nth-child(n+3) {
  grid-column: span 3;
}

/* Duo: two equal landscape frames side by side (e.g. then & now) */
.proj-layout-duo .proj-figure {
  grid-column: span 3;
}

.proj-layout-duo .proj-media {
  aspect-ratio: 4 / 3;
}

/* Pair: two equal portrait frames, the second dropped for rhythm */
.proj-layout-pair .proj-figure {
  grid-column: span 3;
}

.proj-layout-pair .proj-media {
  aspect-ratio: 4 / 5;
}

@media (min-width: 768px) {
  .proj-layout-pair .proj-figure:nth-child(2) {
    margin-top: 72px;
  }

  .proj-chapter-media {
    gap: 24px;
  }
}

/* Small screens: clusters collapse to two columns */
@media (max-width: 599px) {
  .proj-chapter-media {
    gap: 12px;
  }

  .proj-chapter-media .proj-caption {
    font-size: 18px;
    letter-spacing: 0.1em;
  }

  .proj-chapter-media .proj-caption-num::after {
    width: 12px;
  }
}

@media (min-width: 1024px) {
  .proj-chapters {
    padding: 120px 0 48px;
  }

  .proj-chapters-header {
    margin-bottom: 72px;
  }

  .proj-chapter {
    grid-template-columns: 4fr 8fr;
    gap: 64px;
    padding: 72px 0;
    align-items: start;
  }

  /* Text rides along while its images scroll past. */
  .proj-chapter-text {
    position: sticky;
    top: calc(var(--header-height) + 32px);
  }

  /* Alternate: images left, text right. */
  .proj-chapter-flip {
    grid-template-columns: 8fr 4fr;
  }

  .proj-chapter-flip .proj-chapter-text {
    order: 2;
  }

  .proj-chapter-flip .proj-chapter-media {
    order: 1;
  }
}

/* Philosophy intro paragraphs stacked (e.g. Edison "inspiration") */
.proj-philosophy-intro + .proj-philosophy-intro {
  margin-top: 0;
}

/* =========================
   LIGHTBOX
   Fixed, flex-centered overlay (no JS positioning math).
   ========================= */
.proj-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 72px;
  background: rgba(20, 20, 18, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.proj-lightbox.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0s linear 0s;
}

.proj-lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
}

.proj-lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.proj-lightbox-img.loaded {
  opacity: 1;
}

.proj-lightbox-caption {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 241, 235, 0.7);
}

.proj-lightbox-count {
  color: rgba(245, 241, 235, 0.45);
  white-space: nowrap;
}

.proj-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 18px;
  line-height: 1;
  padding: 8px;
  color: rgba(245, 241, 235, 0.7);
  transition: color 0.2s ease;
}

.proj-lightbox-close:hover,
.proj-lightbox-close:focus-visible {
  color: var(--accent);
}

/* Prev/next: thin line arrows in the brand's cta-arrow language */
.proj-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.proj-lightbox-prev {
  left: 8px;
}

.proj-lightbox-next {
  right: 8px;
}

.proj-lightbox-nav span {
  position: relative;
  display: block;
  width: 24px;
  height: 1px;
  background: rgba(245, 241, 235, 0.6);
  transition: width 0.3s ease, background 0.3s ease;
}

.proj-lightbox-nav span::before {
  content: '';
  position: absolute;
  top: -4px;
  width: 8px;
  height: 8px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  color: rgba(245, 241, 235, 0.6);
  transition: color 0.3s ease;
}

.proj-lightbox-next span::before {
  right: 0;
  transform: rotate(45deg);
}

.proj-lightbox-prev span::before {
  left: 0;
  transform: rotate(-135deg);
}

.proj-lightbox-nav:hover span,
.proj-lightbox-nav:focus-visible span {
  width: 36px;
  background: var(--accent);
}

.proj-lightbox-nav:hover span::before,
.proj-lightbox-nav:focus-visible span::before {
  color: var(--accent);
}

@media (max-width: 767px) {
  .proj-lightbox {
    padding: 64px 16px 88px;
  }

  .proj-lightbox-nav {
    top: auto;
    bottom: 16px;
    transform: none;
  }

  .proj-lightbox-prev {
    left: calc(50% - 64px);
  }

  .proj-lightbox-next {
    right: calc(50% - 64px);
  }
}

/* Phones: labels step down a touch so two-column stats don't crowd. */
@media (max-width: 599px) {
  .proj-caption {
    font-size: 20px;
    letter-spacing: 0.1em;
  }

  .proj-eyebrow,
  .proj-fact-label,
  .proj-lightbox-caption,
  .proj-hero .breadcrumb,
  .proj-hero .subpage-hero-meta {
    font-size: 16px;
    letter-spacing: 0.12em;
  }

  .proj-chapter-num,
  .proj-principle-num {
    font-size: 18px;
  }
}

/* =========================
   DRAWINGS / PLANS ('fit' => 'contain')
   Whole image shown, no crop; transparent scans sit directly on the page.
   ========================= */
.proj-media.proj-media-contain {
  background: transparent;
}

.proj-media.proj-media-contain img {
  object-fit: contain;
}

.proj-lightbox-img.on-paper {
  background: var(--background);
  padding: 24px;
}
