/* @import must be first — before any other rules */
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400&display=swap');

/* ============================================================
   ADAM POOLE STUDIO — Global Styles
   ============================================================ */

@font-face {
  font-family: 'NeueHaasDisplay';
  src: url('../fonts/NeueHaasDisplayBold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'NeueHaasDisplay';
  src: url('../fonts/NeueHaasDisplayRoman.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'NeueHaasDisplay';
  src: url('../fonts/NeueHaasDisplayLight.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

/* ── Spacing system (HdM-style gap variable) ── */
:root {
  --gap: 1.5rem;
  --nav-height: 150px;
  --nav-freeze: 101px;          /* px visible when scrolled down */
  --nav-hide: 49px;             /* nav-height − nav-freeze */
}
@media (min-width: 768px)  { :root { --gap: 2rem; } }
@media (min-width: 1280px) { :root { --gap: 2.5rem; } }

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: #fff;
  color: #000;
  font-family: 'Courier Prime', 'Courier New', monospace;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Typography ── */
.t-heading {
  font-family: 'NeueHaasDisplay', 'Arial Black', sans-serif;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.t-label {
  font-family: 'Courier Prime', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.t-body {
  font-family: 'Courier Prime', monospace;
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ── Section label: 36pt ALL CAPS Neue Haas Display Bold ── */
.section-label {
  font-family: 'NeueHaasDisplay', sans-serif;
  font-weight: 700;
  font-size: 2.25rem;         /* 36px */
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
}


/* ── Nav ── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;          /* anchors contents to bottom */
  padding: 0 var(--gap) 15px;    /* 15px above bottom */
  background: transparent;
  will-change: transform;
}
.nav-logo-img {
  display: block;
  flex-shrink: 0;
}
.nav-logo-img img {
  width: 125px;
  height: auto;
  object-fit: contain;
  display: block;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-family: 'Courier Prime', 'Courier New', monospace;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}
.nav-links a {
  text-decoration: none;
  color: #000;
}
.nav-links a:hover { text-decoration: underline; }
.nav-links a.active { font-weight: 700; }
.nav-links .nav-sep { color: #000; }

/* ── Fade-in on scroll ── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Fade only — no vertical shift (for full-bleed images etc.) */
.reveal-fade {
  opacity: 0;
  transition: opacity 1s ease;
}
.reveal-fade.visible { opacity: 1; }

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.55s; }

/* ============================================================
   WORK — Project Grid
   ============================================================ */
.work-header {
  padding: calc(var(--nav-height) + 4rem) var(--gap) 3rem;
  border-bottom: 1px solid #000;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.work-header__title {
  font-family: 'NeueHaasDisplay', sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
}
.work-header__count {
  font-size: 0.75rem;
  opacity: 0.4;
  letter-spacing: 0.05em;
}

/* ── Image grid ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: calc(var(--gap) * 2.5);
  padding: 0 var(--gap);
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
  /* Center all rows collectively in the viewport height */
  align-content: center;
  /* Center each tile vertically within its row track */
  align-items: center;
}

.project-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  /* Shrink tile to its image's rendered width so the label
     always aligns to the image's left edge, not the column edge.
     max-width: 100% prevents overflow of the grid cell. */
  width: fit-content;
  max-width: 100%;
  justify-self: center;
}
.project-tile:hover .project-tile__name { text-decoration: underline; }

.project-tile__name {
  font-family: 'Courier Prime', monospace;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-top: 0.5rem;
}

.project-tile__img-wrap {
  /* No explicit width — lets the tile determine width from the image */
  max-width: 100%;
}
.project-tile__img-wrap img {
  /* Landscape: max-width: 100% caps at column width.
     Portrait: max-height: 40vh constrains height; width scales
     proportionally, becoming narrower than the column.
     The tile then shrinks to that narrower width so the label aligns. */
  max-width: 100%;
  max-height: 40vh;
  width: auto;
  height: auto;
  object-fit: initial;
  display: block;
  filter: grayscale(100%);
  opacity: 1;
  transition: opacity 0.3s ease;
}
.project-tile:hover .project-tile__img-wrap img {
  opacity: 0.9;
}

/* ── Legacy row styles (kept for project pages that still use them) ── */
.project-list { padding: 0 var(--gap) 8rem; }

.project-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  padding: 3rem 0;
  align-items: start;
  text-decoration: none;
  transition: opacity 0.2s;
}
.project-row:hover { opacity: 0.7; }

.project-row__img {
  aspect-ratio: 16/9;
  overflow: hidden;
}
.project-row__img img {
  transition: transform 0.6s ease;
}
.project-row:hover .project-row__img img { transform: scale(1.03); }

.project-row__info { padding-top: 0.5rem; }
.project-row__index {
  font-size: 0.7rem;
  opacity: 0.35;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}
.project-row__name {
  font-family: 'NeueHaasDisplay', sans-serif;
  font-weight: 700;
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  line-height: 1;
  margin-bottom: 0.75rem;
}
.project-row__location {
  font-size: 0.8125rem;
  opacity: 0.45;
  margin-bottom: 1rem;
}
.project-row__desc {
  font-size: 0.8125rem;
  line-height: 1.6;
  max-width: 38ch;
  opacity: 0.8;
}

/* ============================================================
   PROJECT — Individual Page
   ============================================================ */

.project-info {
  padding: calc(var(--nav-height) + 200px) var(--gap) 4rem;
}
.project-info__title {
  font-family: 'NeueHaasDisplay', sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin-bottom: 50px;
}
.project-info__meta-item {
  margin-bottom: 0.1rem;
}
.project-info__meta-label {
  font-family: 'Courier Prime', monospace;
  font-weight: 700;
  font-size: 0.9375rem;
}
.project-info__meta-value {
  font-family: 'Courier Prime', monospace;
  font-weight: 400;
  font-size: 0.9375rem;
}
.project-info__desc {
  font-family: 'Courier Prime', monospace;
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: 700px;
  margin-top: 30px;
}

/* Image gallery — natural aspect ratios, full width to margins */
.project-gallery { padding: 0 var(--gap) 2rem; }

/* Override global img styles for all gallery images */
.project-gallery img,
.project-section__grid img {
  width: 100%;
  height: auto;
  object-fit: initial;
  display: block;
}

.gallery-full { margin-bottom: var(--gap); }

.gallery-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
/* Same height, natural widths — images size themselves, not the grid */
.gallery-half--match {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
  margin-bottom: var(--gap);
}
.gallery-half--match img {
  height: 42vw;
  width: auto;
  object-fit: initial;
  display: block;
}
/* Full-width pair — images fill the row at same height, natural-ish widths */
.gallery-pair-fill {
  display: flex;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.gallery-pair-fill img {
  flex: 1 1 auto;
  height: 55vh;
  min-width: 0;
  object-fit: cover;
  display: block;
}
/* Justified pair — each image at natural proportions, same height, fills full width */
.gallery-pair-fill--left-lead {
  display: flex;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.gallery-pair-fill--left-lead img:first-child {
  flex: 0.665 1 0;
  min-width: 0;
  aspect-ratio: 4000 / 6016;
  object-fit: cover;
  display: block;
}
.gallery-pair-fill--left-lead img:last-child {
  flex: 0.75 1 0;
  min-width: 0;
  aspect-ratio: 896 / 1195;
  object-fit: cover;
  display: block;
}

.gallery-tall {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
/* Collage strip — images share a row height and grow to fill the full width */
.gallery-photos {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.gallery-photos img {
  flex: 1 1 auto;
  height: 32vh;
  width: auto;
  min-width: 120px;
  object-fit: cover;
  display: block;
}

/* ── Crossfade image pair ── */
.gallery-crossfade {
  position: relative;
  margin-bottom: var(--gap);
  line-height: 0; /* prevents gap below inline img */
}
.gallery-crossfade img:first-child {
  width: 100%;
  height: auto;
  display: block;
  object-fit: initial;
}
.gallery-crossfade .crossfade-top {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: crossfade-loop 6s ease-in-out infinite;
}
@keyframes crossfade-loop {
  0%,  35% { opacity: 1; }
  50%, 85% { opacity: 0; }
  100%      { opacity: 1; }
}

/* ── Optional sub-sections: Drawings, Construction Photos, etc. ── */
.project-section {
  padding: 3rem var(--gap) 2rem;
}
.project-section__heading {
  font-family: 'NeueHaasDisplay', sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
  margin-bottom: 2rem;
}
/* Thumbnail strip — fixed 300px cards that wrap */
.project-section__grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}
.drawing-thumb {
  width: 300px;
  flex-shrink: 0;
  cursor: zoom-in;
  transition: opacity 0.2s;
}
.drawing-thumb:hover { opacity: 0.75; }
.drawing-thumb img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: initial;
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 500;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}
.lightbox.active { display: flex; }
.lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Project navigation */
.project-nav {
  display: flex;
  justify-content: space-between;
  margin: 4rem var(--gap) 3rem;
}
.project-nav__link {
  font-family: 'Courier Prime', monospace;
  font-size: 0.9375rem;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}
.project-nav__link:hover { opacity: 0.5; }
.project-nav__link--next { text-align: right; }

/* ============================================================
   ABOUT
   ============================================================ */

/* ── Section 1: Practice statement — full viewport, vertically centered ── */
.about-practice {
  height: 100vh;
  display: flex;
  align-items: center;
  padding: var(--nav-height) var(--gap) 0;
}
.about-practice__text {
  font-family: 'NeueHaasDisplay', sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 1.35;
  max-width: 60ch;
}
.about-practice__text p + p { margin-top: 1em; }

/* ── Section 2: Adam Poole — natural-proportion image left, text right ── */
.about-person {
  padding-left: var(--gap);
  padding-top: calc(var(--nav-height) + var(--gap));
}
.about-person__grid {
  display: grid;
  grid-template-columns: auto 1fr;  /* left col = image natural width */
  column-gap: 100px;
  height: 80vh;
}
.about-person__portrait {
  height: 80vh;
}
.about-person__portrait img {
  height: 80vh;
  width: auto;
  object-fit: initial;
  display: block;
}
.about-person__content {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 110px;
  padding-right: var(--gap);
}
.about-person__name {
  display: block;
  font-family: 'NeueHaasDisplay', sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
  text-transform: uppercase;
  line-height: 1.1;
  letter-spacing: 0.01em;
}
.about-person__credentials {
  display: block;
  font-family: 'Courier Prime', monospace;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.about-person__bio {
  font-family: 'Courier Prime', monospace;
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: 700px;
}
.about-person__bio a {
  text-decoration: underline;
  color: inherit;
}
.about-person__bio a:hover { opacity: 0.55; }

/* ── Section 3: Contact ── */
.contact {
  min-height: calc(100vh - 4rem);  /* 4rem ≈ footer height */
  padding: 20rem var(--gap) 6rem;
}
.contact__heading {
  font-family: 'NeueHaasDisplay', sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1;
  margin-bottom: 2.5rem;
}
.contact__form {
  max-width: 40rem;
}
.form-row { margin-bottom: 1.5rem; }
.form-row label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  opacity: 0.5;
  font-family: 'Courier Prime', monospace;
}
.form-row input,
.form-row textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid #000;
  padding: 0.5rem 0;
  font-family: 'Courier Prime', monospace;
  font-size: 0.9rem;
  background: transparent;
  outline: none;
  -webkit-appearance: none;
}
.form-row input::placeholder,
.form-row textarea::placeholder {
  font-family: 'Courier Prime', monospace;
  color: #000;
  opacity: 0.35;
}
.form-row textarea { resize: none; height: 120px; }
.form-submit {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.9rem 2.5rem;
  background: #000;
  color: #fff;
  font-family: 'Courier Prime', monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}
.form-submit:hover { opacity: 0.7; }
.form-success {
  display: none;
  padding: 1rem 0;
  font-size: 0.875rem;
  font-family: 'Courier Prime', monospace;
  opacity: 0.6;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 1.5rem var(--gap);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
footer .t-label {
  opacity: 0.35;
  font-size: 0.7rem;
  font-family: 'Courier Prime', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .project-grid { grid-template-columns: 1fr; gap: calc(var(--gap) * 1.5); align-content: start; padding-top: calc(var(--nav-height) + var(--gap)); }
  .project-tile__img-wrap img { max-height: 50vh; }
  .project-row { grid-template-columns: 1fr; }
  .project-row__img { aspect-ratio: 16/9; }
  .project-info { grid-template-columns: 1fr; }
  .gallery-half, .gallery-tall { grid-template-columns: 1fr; }
  .about-person__grid { grid-template-columns: 1fr; column-gap: 0; height: auto; }
  .about-person__portrait { height: 60vh; }
  .about-person__portrait img { height: 60vh; width: 100%; object-fit: cover; }
  .about-person__content { justify-content: flex-start; padding-bottom: 0; padding-top: 2.5rem; padding-right: 0; }
}
