/* ==========================================================================
   Sections: page-level layout, in document order
   ========================================================================== */

.container {
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
}

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  background: rgba(11, 12, 14, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  z-index: 100;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links {
  display: none;
  gap: 2rem;
  font-size: var(--nav-font-size);
  letter-spacing: var(--nav-letter-spacing);
  text-transform: uppercase;
}

@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  color: var(--nav-color);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 120px var(--gutter) 2rem;
  background-image:
    linear-gradient(to top, rgba(11, 12, 14, 0.96) 0%, rgba(11, 12, 14, 0.45) 55%, rgba(11, 12, 14, 0.75) 100%),
    url("https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=2400&q=80");
  background-size: cover;
  background-position: center;
}

.hero__inner {
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
}

.kicker {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero__title {
  font-size: clamp(2.1rem, 4vw, 3.8rem);
  font-weight: 350;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  max-width: 950px;
  margin-bottom: 1.75rem;
}

.hero__subtext {
  font-size: clamp(0.95rem, 1.1vw, 1.125rem);
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 640px;
  margin-bottom: 2.5rem;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 3px;
  color: var(--text);
  border-bottom: 1px solid var(--text);
  transition: opacity 0.2s;
}

.link-arrow:hover {
  opacity: 0.8;
}

.link-muted {
  color: var(--text-muted);
  transition: color 0.2s;
}

.link-muted:hover {
  color: var(--text);
}

.hero__meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 2.5rem;
  /* Extra space above the line drops this block toward the bottom of the hero */
  margin-top: 6rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
  .hero__meta {
    /* Size each item to its text and spread the four evenly across the row */
    grid-template-columns: repeat(4, max-content);
    justify-content: space-between;
  }
}

.meta-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.meta-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.meta-val {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

/* --- Light content area ------------------------------------------------- */

.section-light {
  background-color: var(--surface-light);
  color: var(--ink);
  padding: 7rem var(--gutter);
  border-top: 1px solid var(--line-faint);
}

/*
 * Menu jumps: the page already stops one header-height from the top (see
 * scroll-padding-top in base.css). #about targets the whole light area, whose
 * own padding supplies the gap. The inner sections get an explicit gap so
 * their content doesn't sit hard against the header.
 */
#capabilities,
#projects {
  scroll-margin-top: var(--anchor-gap);
}

/* --- About -------------------------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
}

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 5fr 7fr;
    gap: 6rem;
  }
}

.about-lead {
  font-size: clamp(1.4rem, 2vw, 1.95rem);
  font-weight: 350;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-muted);
}

.about-content strong {
  color: var(--ink);
  font-weight: 500;
}

/* --- Capabilities ------------------------------------------------------- */

.capabilities-grid {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin-top: 5rem;
  margin-bottom: 7rem;
}

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

@media (min-width: 1100px) {
  .capabilities-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cap-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
  padding: 2.25rem 2rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s;
}

.cap-card:hover {
  background-color: var(--surface-light-hover);
}

.cap-num {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--ink-subtle);
  margin-bottom: 2rem;
}

.cap-title {
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.cap-body {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink-muted);
}

/* --- Projects ----------------------------------------------------------- */

.projects-header {
  margin-bottom: 3.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.projects-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 350;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  /* No bottom margin: this is the last block in the light area, whose own 7rem
     padding already sets the gap, the same as the top of the area */
}

@media (min-width: 900px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 3.5rem 2rem; /* row gap, column gap: room between stacked rows (up to six tiles) */
  }
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

/* Stretched link: the title link covers the whole tile, so the entire card is clickable */
.project-card__open {
  color: inherit;
}

.project-card__open::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.project-card__open:focus-visible {
  outline: none;
}

.project-card__open:focus-visible::after {
  outline: 2px solid var(--ink);
  outline-offset: 6px;
}

.project-image {
  position: relative;
  width: 100%;
  height: 280px;
  margin-bottom: 1rem;
  overflow: hidden;
  background-color: var(--surface-light);
}

/*
 * Overshoot the frame by 1px: cover scaling can leave a sub-pixel gap at the
 * bottom edge on some widths, which showed as a hairline of background.
 */
.project-image img {
  width: calc(100% + 1px);
  height: calc(100% + 1px);
  object-fit: cover;
  transition: transform 0.6s var(--ease-out-expo);
}

.project-card:hover .project-image img {
  transform: scale(1.03);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}

.project-name {
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
  color: var(--ink);
}

.project-desc {
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--ink-muted);
  margin-bottom: 1.1rem;
}

/* "View project" cue; margin-top:auto lines the cue up across a row of tiles */
.project-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.project-card__arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-out-expo);
}

.project-card:hover .project-card__arrow {
  transform: translateX(6px);
}

/* --- Project detail view ------------------------------------------------ */

.project-detail {
  /* Same as the projects grid: the light area's 7rem padding sets the gap below */
  margin-bottom: 0;
}

/* Single "back" button: above the heading on mobile, level with the title on wider screens */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.8rem 1.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  transition: background-color 0.2s, color 0.2s;
}

.back-btn:hover,
.back-btn:focus-visible {
  background-color: var(--ink);
  color: var(--surface-light);
}

.back-btn__arrow {
  display: inline-block;
  transition: transform 0.3s var(--ease-out-expo);
}

.back-btn:hover .back-btn__arrow {
  transform: translateX(-5px);
}

@media (min-width: 700px) {
  /* Tag on its own row; title and button share the next row, centred on each other */
  .project-detail .projects-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 2rem;
  }

  .project-detail .section-tag {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .project-detail .projects-title {
    grid-column: 1;
    grid-row: 2;
  }

  .back-btn {
    grid-column: 2;
    grid-row: 2;
    margin-bottom: 0;
  }
}

.project-detail .projects-title:focus {
  outline: none;
}

.project-detail__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 900px) {
  .project-detail__body {
    grid-template-columns: 5fr 7fr;
    gap: 4rem;
  }
}

/* On small screens the photos lead; on wide screens they sit beside the text */
.project-detail__media {
  order: -1;
}

@media (min-width: 900px) {
  .project-detail__media {
    order: 0;
  }

  /* Text stays in view while a longer photo column scrolls past */
  .project-detail__info {
    position: sticky;
    top: calc(var(--header-height) + var(--anchor-gap));
    align-self: start;
  }
}

.project-detail__lead {
  margin-bottom: 1.75rem;
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);
  font-weight: 350;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.project-detail__text {
  margin-bottom: 2.5rem;
}

.project-facts {
  border-bottom: 1px solid var(--line);
}

.project-facts > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

.project-facts dt {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}

.project-facts dd {
  font-size: 0.9rem;
  font-weight: 400;
  text-align: right;
  color: var(--ink);
}

.project-facts dd.is-tbc {
  color: var(--ink-subtle);
}

.project-detail__media {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* An odd photo out spans the full width rather than leaving a gap */
.project-gallery .project-figure:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* Image credit line under the photos */
.project-credit {
  display: flex;
  flex-wrap: wrap;
  align-items: center; /* vertically centred in the row */
  gap: 0.35rem 0.6rem;
  margin: 0;
  /* Ruled top and bottom, exactly like the last (Scope) row of the facts list, whose
     height is 2 x 0.9rem padding + a 0.9rem line at 1.5 + its top rule + the list's
     bottom rule. The bottom rule lines up with the facts underline when the sticky
     text column finishes. */
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: calc(3.15rem + 2px);
  align-content: center;
  /* Label and value share one type style; only the colour differs */
  font-size: 0.7rem;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-credit__label {
  color: var(--ink-subtle);
}

.project-credit__value {
  color: var(--ink);
}

.project-credit__value.is-tbc {
  color: var(--ink-subtle);
}

.project-figure {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background-color: var(--surface-light-media);
}

/* Same 1px overshoot as the tiles, so no hairline shows at the bottom edge */
.project-figure img {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% + 1px);
  height: calc(100% + 1px);
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project-figure img.is-loaded {
  opacity: 1;
}

/* --- Impact ------------------------------------------------------------- */
/* Light band: photo panel on the left, text and numbers on the right */

.impact {
  background-color: var(--surface-light-media);
  color: var(--ink);
  padding: 5rem var(--gutter);
}

.impact__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 900px) {
  .impact__inner {
    grid-template-columns: 5fr 7fr;
    gap: 4.5rem;
    align-items: stretch; /* photo matches the height of the content */
  }
}

.impact__media {
  position: relative;
  overflow: hidden;
  min-width: 0;
  aspect-ratio: 3 / 2;
  background-color: var(--line);
}

/* Side by side: the photo stretches to the height of the content instead.
   (A min-height on the stacked layout would force the 3:2 box wider than the
   column on phones and push the photo past the page margin.) */
@media (min-width: 900px) {
  .impact__media {
    aspect-ratio: auto;
    min-height: 16rem;
  }
}

.impact__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%; /* keeps the work cage in frame when the panel is cropped */
}

.impact__content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
}

.impact__title {
  margin-bottom: 1.25rem;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 350;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.impact__text {
  max-width: 44rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-muted);
}

.impact__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 1rem;
}

/* Four equal columns only where each is wide enough for its label on one line */
@media (min-width: 1280px) {
  .impact__stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.impact-stat {
  display: flex;
  /* Markup is label then value (correct for <dl>); value displays on top */
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-strong);
}

.impact-stat__val {
  font-variant-numeric: tabular-nums; /* digits keep one width while counting */
  font-size: clamp(1.75rem, 2.3vw, 2.15rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.impact-stat__label {
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
/* --- Footer ------------------------------------------------------------- */

.site-footer {
  background-color: var(--bg);
  color: var(--text);
  padding: 6rem var(--gutter) 3rem;
  border-top: 1px solid var(--border);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  margin-bottom: 5rem;
}

@media (min-width: 900px) {
  .footer-top {
    grid-template-columns: 6fr 6fr;
    align-items: flex-start;
  }
}

.footer-headline {
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 350;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.footer-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (min-width: 600px) {
  .footer-nav-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Side-by-side with the headline: pack the link columns against the right edge */
@media (min-width: 900px) {
  .footer-nav-grid {
    grid-template-columns: repeat(3, auto);
    justify-content: end;
    column-gap: 4rem;
  }
}

.footer-col-title {
  margin-bottom: 1.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.75rem;
  color: var(--text-dim);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-legal-links {
  display: flex;
  gap: 2rem;
}

.footer-legal-links a {
  color: var(--text-dim);
  transition: color 0.2s;
}

.footer-legal-links a:hover {
  color: var(--text);
}

/* --- Legal pages (privacy policy) -------------------------------------- */

/* The header is fixed, so these pages start one header-height lower */
.legal-page {
  padding-top: calc(var(--header-height) + 5rem);
  padding-bottom: 6rem;
}

.legal {
  max-width: 44rem;
}

.legal__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

.legal__updated {
  margin: 1rem 0 2.5rem;
  font-size: 0.8rem;
  color: var(--ink-subtle);
}

.legal h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
}

.legal p,
.legal li {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ink-muted);
}

.legal p {
  margin-bottom: 1rem;
}

.legal ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.legal li {
  margin-bottom: 0.35rem;
}

.legal a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal a:hover {
  opacity: 0.7;
}

/* Footer on the legal pages: just the bottom bar, no contact block above it */
.site-footer--slim {
  padding-top: 3rem;
}

.footer-bottom--plain {
  border-top: 0;
  padding-top: 0;
}
