:root {
  --bg: #004128;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --font: "Sofia Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-weight: 300;
}

/* Whole-page background turns black while the hero photo crossfades to the portrait. */
body {
  transition: background-color 1s ease;
}

body.bg-alt {
  background: #000000;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: 0.7;
}

/* Nav */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem clamp(1.5rem, 5vw, 5.125rem);
}

.nav-logo {
  font-weight: 400;
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 3.75rem;
}

.nav-link {
  font-weight: 400;
  font-size: 1.5rem;
}

/* Hero */

/* Bottom padding is generous on purpose: the page needs enough scrollable
   room after the stats row for the sticky image to actually reach its
   release point (once the second paragraph has fully scrolled off). */
.hero {
  max-width: 1600px;
  margin: 0 auto;
  padding: 100px clamp(1.5rem, 5vw, 5.125rem) calc(6rem + 50px);
}

/* Text runs full bleed; the image is an absolutely-positioned layer on
   top of it (matches the source design), not a column that narrows the text. */
.hero-lines {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: calc(12rem + 600px);
  margin-bottom: calc((12rem + 100px) * 3);
}

.hero-line {
  position: relative;
  z-index: 2;
  font-weight: 300;
  font-size: clamp(2.275rem, 5.2vw, 7.8rem);
  line-height: 1.2;
  max-width: 1200px;
}

/* First paragraph sits 350px below the top of the image (which itself
   sits 100px below the nav, via .hero's padding-top). */
.hero-line:first-of-type {
  margin-top: 350px;
}

/* Height is set precisely by script.js so the sticky image releases exactly
   when the second paragraph's top reaches the image's top — this 100% is
   just the no-JS fallback. This element is out of flow, so however tall
   it ends up, it never pushes the stats row down. */
.hero-media {
  position: absolute;
  top: 0;
  right: 0;
  width: min(57%, 45rem);
  height: 100%;
  z-index: 1;
}

/* Sticks in place while .hero-lines scrolls past, then releases once it ends. */
.hero-image-wrap {
  position: sticky;
  top: 2rem;
  aspect-ratio: 824 / 888;
  width: 100%;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 15%;
  display: block;
}

/* Primary (Bear) stays fully opaque underneath at all times — only the
   secondary (portrait) fades in on top of it. That way the crossfade never
   has a moment where both are translucent and the page background shows
   through behind them. */
.hero-image-primary {
  opacity: 1;
}

.hero-image-secondary {
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-image-wrap.is-alt .hero-image-secondary {
  opacity: 1;
}

/* Hidden until the hero image releases and starts scrolling, then reveals. */
.stats-row {
  display: flex;
  gap: calc(2.5rem + 200px);
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s ease, transform 1s ease;
}

.stats-row.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Columns hug their own content instead of stretching to fill the row —
   otherwise the "gap" between them is really just leftover stretch space. */
.stats-col {
  flex: 0 0 auto;
  min-width: 10rem;
  display: flex;
  flex-direction: column;
  font-size: clamp(1.5rem, 2.75vw, 2.75rem);
  line-height: 1.4;
}

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

/* Sits after the point where the page background has already turned black
   (.bg-alt, triggered earlier by the hero crossfade and never reverted for
   the rest of the scroll), so it always lands on black, not green. */
.contact {
  margin-top: 300px;
}

.contact-line {
  font-size: 120px;
  line-height: 120px;
  display: block;
}

.contact-label {
  font-weight: 300;
}

.contact-email {
  font-weight: 300;
  opacity: 0.6;
}

@media (max-width: 860px) {
  .nav-links {
    gap: 1.5rem;
  }

  .hero-lines {
    margin-bottom: 6rem;
  }

  .hero-media {
    position: static;
    width: 100%;
    height: auto;
    order: -1;
    margin-bottom: 1.5rem;
  }

  .hero-image-wrap {
    position: static;
    aspect-ratio: 4 / 3;
  }

  .hero-line {
    max-width: none;
  }

  .stats-row {
    gap: 1.5rem;
  }
}
