/* ---------- Tokens ---------- */
:root {
  --navy: #001a40;
  --navy-soft: #182a45;
  --grey-light: #f2f4f7;
  --blue-grey: #dde5ee;
  --blue-mid: #4a6a8f;
  --white: #ffffff;
  --mist: #f4f4f2;                   /* About background and hero fade: off-white with a slight grey */
  --mist-0: rgba(244, 244, 242, 0);  /* same color, fully transparent (keep in sync with --mist) */
  --text-body: #4d5660;              /* body text on light backgrounds */
  --text-grey: #c3c9d2;              /* About text before it highlights, and text on navy */
  --load-bg: #2b2f33;                /* neutral grey shown behind the hero until the poster/video paint (set to the poster's average colour if you like) */

  --font: "DM Sans", system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --fade: 1.2s;                      /* video crossfade, keep in sync with FADE_MS in main.js */
  --logo-w: min(520px, 78vw, 95vh);  /* width of the big hero logo (also shrinks on short windows) */
  --logo-top: clamp(90px, 28vh, 250px);   /* distance from the top to the big logo: 250px on tall screens, less on short ones (phones: see mobile block) */

  /* Which part of the video stays in frame on wide screens (x y).
     Vertical clips: a higher y shows more creek, a lower y shows more sky.
     With a landscape clip this barely matters. */
  --video-pos: 50% 45%;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--load-bg);        /* never navy: this is all that shows before the poster arrives */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: transparent;           /* must stay transparent: a body background would paint over the fixed hero layers */
  -webkit-font-smoothing: antialiased;

  /* Body text */
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 23px;
  color: var(--text-body);
}
body.is-loading,
body.menu-open,
body.modal-open { overflow: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* Skip link: only visible when focused with the keyboard */
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--white);
  color: var(--navy);
  font-size: 0.85rem;
  transform: translateY(-120%);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Header (transparent) ---------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem clamp(1.25rem, 4vw, 3.5rem);
  opacity: 0;
  transition: opacity 1.4s var(--ease) 0.6s, padding 0.4s var(--ease);
}
.is-loading .header { pointer-events: none; }
.is-ready .header { opacity: 1; }

/* Background lives on a pseudo-element so backdrop-filter
   doesn't trap the fixed mobile menu inside the header */
.header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 26, 64, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.header.is-scrolled { padding-top: 1rem; padding-bottom: 1rem; }
.header.is-scrolled::before { opacity: 1; }

/* Header logo: hidden at the top of the page, appears with the navy band */
.header__logo {
  position: relative;
  z-index: 3;            /* stays visible above the mobile menu */
  display: block;
  flex-shrink: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
}
.header.is-scrolled .header__logo {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.header__logo img {
  width: 190px;
  height: auto;
  /* the PNG has empty space above and below the text; this trims it */
  margin: -1.25rem 0 -1.4rem;
}

/* All four links share one plain style */
.header__menu {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.75rem);
}
.header__menu a {
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.3s ease;
}
.header__menu a:hover { color: var(--white); }

/* Hamburger (mobile only) */
.header__toggle {
  display: none;
  position: relative;
  z-index: 3;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.header__toggle span {
  position: absolute;
  left: 10px; right: 10px;
  height: 1px;
  background: var(--white);
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.header__toggle span:nth-child(1) { top: 18px; }
.header__toggle span:nth-child(2) { top: 26px; }
.header.is-open .header__toggle span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.header.is-open .header__toggle span:nth-child(2) { top: 22px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
/* --p (0 to 1) is set on :root by main.js as you scroll through the hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  /* no background or overflow:hidden here, so the fixed video behind shows through */
}

/* Backdrop layer 0: the poster frame, fixed behind the video. It paints as soon as the CSS and
   the poster image arrive, so the page opens on the river instead of a navy screen, and the
   video fades in over it. The dark green is only the fallback color if the poster is slow or can't load. */
.hero::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background: transparent url("assets/img/hero-poster.jpg") var(--video-pos) / cover no-repeat;
  transition: opacity 0.6s ease;
}
/* No colour while loading. A tiny script in the <head> of index.html adds the class "hero-wait" to <html> only while
   it waits for the poster image, then removes it (after 2.5 seconds at the latest). Everything is visible by default,
   so if that script is ever missing or out of date, the hero simply shows normally: it can never stay hidden. */
html.hero-wait .hero::before,
html.hero-wait .hero__overlay { opacity: 0; }
html.hero-wait .hero * { animation-play-state: paused !important; }   /* logo draws in when the backdrop appears */
/* The navy tint only appears once the poster or video is actually showing (html.media-ok, set by the head script and main.js) */
html:not(.media-ok) .hero__overlay { opacity: 0; }

/* Backdrop layer 1: the video, fixed to the screen (two stacked copies crossfade for a seamless loop) */
.hero__video {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--video-pos);
  opacity: 0;
  transform: scale(1.06);            /* slow settle-in on load */
  transition: opacity var(--fade) ease, transform 4s var(--ease);
}
.hero__video.is-active { opacity: 1; }

/* Never show the phone's own play button or controls on the background video
   (iOS draws a big play button when it blocks autoplay, e.g. in Low Power Mode). */
.hero__video { pointer-events: none; }
.hero__video::-webkit-media-controls,
.hero__video::-webkit-media-controls-panel,
.hero__video::-webkit-media-controls-play-button,
.hero__video::-webkit-media-controls-start-playback-button,
.hero__video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0 !important;
}
.is-ready .hero__video { transform: scale(1); }

/* Backdrop layer 2: navy tint for legibility, also fixed.
   The river behind it goes out of focus as you scroll (desktop only, see mobile block). */
.hero__overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.6s ease;
  background:
    linear-gradient(to bottom,
      rgba(0, 26, 64, 0.55) 0%,
      rgba(0, 26, 64, 0.18) 35%,
      rgba(0, 26, 64, 0.28) 65%,
      rgba(0, 26, 64, 0.70) 100%),
    rgba(24, 42, 69, 0.18);
  -webkit-backdrop-filter: blur(calc(var(--p, 0) * 8px));
  backdrop-filter: blur(calc(var(--p, 0) * 8px));
}
/* Veil: the hero washes out to the exact color of the About section.
   Opacity above 1 is treated as 1, so it is fully covered by about two thirds of the way through. */
.hero__overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--mist);
  opacity: calc(var(--p, 0) * 1.5);
}

/* Layer 3: content. Fixed to the screen. The logo stays put and dissolves as you scroll;
   the About section covers it. */
.hero__content {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: start center;         /* logo is placed from the top: see --logo-top */
  padding: 0 1.5rem;
  pointer-events: none;
  /* dissolves as you scroll: fades, blurs, drifts up and shrinks slightly */
  opacity: calc(1 - var(--p, 0) * 1.8);
  transform: translateY(calc(var(--p, 0) * -60px)) scale(calc(1 - var(--p, 0) * 0.05));
  filter: blur(calc(var(--p, 0) * 8px));
  will-change: opacity, transform, filter;
}
.hero__title {
  margin: 0;
  line-height: 0;
}

/* Container around the logo: on phones its top margin sets where the logo sits (see mobile block). */
.hero__logo-box { margin-top: 0; }

/* The hero logo draws itself in once when the page opens, then stays as the finished image.
   Two layers stacked in exactly the same spot, both using the full logo image:
   1) the trees, hills and river rise from the ground line upward, then
   2) the "Whitewater Capital" wordmark wipes in from left to right.
   The logo image is 1040 x 316 px; the empty gap between the trees and the wordmark is at row 223,
   which is where the two layers are split (223 / 316 = 70.57%). */
.hero__logo {
  position: relative;
  width: var(--logo-w);
  margin-top: var(--logo-top);       /* 250px on desktop, 110px on phones */
  display: grid;                     /* both layers occupy the same cell */
}
.hero__logo img {
  width: 100%;
  height: auto;
}

/* Layer 1: the trees. A box cut off at the split line; the image inside is the full logo. */
.hero__trees {
  grid-area: 1 / 1;
  align-self: start;
  aspect-ratio: 1040 / 223;
  overflow: hidden;
  clip-path: inset(100% 0 0 0);
  transform: translateY(8px);
  /* speed: 2.2s, starts after 0.3s */
  animation: treesRise 2.2s cubic-bezier(0.22, 0.8, 0.25, 1) 0.3s forwards;
}
@keyframes treesRise {
  to { clip-path: inset(0 0 0 0); transform: none; }
}

/* Layer 2: the wordmark. Same full-logo image, cut to the part below the split line. */
.hero__word {
  grid-area: 1 / 1;
  clip-path: inset(70.57% 100% 0 0);
  /* speed: 1.8s, starts at 1.5s (just before the trees finish) */
  animation: wordWipe 1.8s ease-out 1.5s forwards;
}
@keyframes wordWipe {
  to { clip-path: inset(70.57% 0 0 0); }
}

/* Scroll arrow (circle) */
.hero__scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  z-index: 2;
  margin-left: -28px;                /* half of the width, centers the circle */
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  color: var(--white);
  opacity: 0;
  transition:
    background 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}
/* Fades in on load (animation), then fades out on scroll (--p) */
.is-ready .hero__scroll {
  opacity: calc(1 - var(--p, 0) * 3);
  animation: arrowIn 1.4s var(--ease) 0.9s backwards;
}
@keyframes arrowIn {
  from { opacity: 0; }
}
.hero__scroll svg { animation: arrowBob 2.2s ease-in-out infinite; }
.hero__scroll:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--navy);
}
@keyframes arrowBob {
  0%, 100% { transform: translateY(-2px); }
  50%      { transform: translateY(3px); }
}

/* ---------- About ---------- */
.about {
  position: relative;
  z-index: 1;                        /* sits above the fixed video and the fixed logo */
  background: var(--mist);
  color: var(--text-body);
  text-align: center;
  padding:
    clamp(5rem, 12vw, 9rem)
    clamp(1.5rem, 4vw, 3.5rem)
    clamp(4rem, 9vw, 7rem);
}
/* Soft edge: ends in the same color as the section.
   Invisible at the top of the page (--p is 0), and fades in over the first bit of scrolling,
   so the hero stays clean until you start to scroll. */
.about::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: calc(100% - 1px);
  height: 22vh;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--mist-0), var(--mist));
  opacity: calc(var(--p, 0) * 5);
}
.about__inner {
  max-width: 900px;
  margin: 0 auto;
}
.about__title {
  margin: 0 0 clamp(2.5rem, 6vw, 4.5rem);
  padding-left: 0.3em;               /* offsets trailing letter-spacing so it centers */
  font-size: clamp(1.15rem, 2.6vw, 1.9rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--navy);
}
.about__text {
  /* font size and line-height come from the body text (16px / 23px) */
  max-width: 820px;
  margin: 0 auto 2.25rem;
}
.about__body .about__text:last-child { margin-bottom: 0; }

/* Opening paragraph: narrower */
.about__body > .about__text:first-child {
  max-width: 520px;
  text-wrap: balance;
}

.about__login {
  display: inline-block;
  margin-top: clamp(4rem, 10vw, 7rem);
  padding: 0.5rem 0;                 /* bigger tap target */
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--navy);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  transition: color 0.3s ease;
}
.about__login:hover { color: var(--blue-mid); }

/* Scroll highlight: each word starts light grey, main.js blends it to the final color */
.word { color: var(--text-grey); }
.is-static .word { color: var(--text-body); }   /* used when reduced motion is on */

/* ---------- Contact (short band with a button) ---------- */
.contact {
  position: relative;
  z-index: 1;                        /* sits above the fixed video */
  background: var(--navy-soft);
  color: var(--white);
  text-align: center;
  padding: clamp(3.5rem, 7vw, 5rem) clamp(1.25rem, 4vw, 3.5rem);
}
.contact__inner {
  max-width: 680px;
  margin: 0 auto;
}
.contact__title {
  margin: 0 0 0.9rem;
  padding-left: 0.3em;               /* offsets trailing letter-spacing so it centers */
  font-size: clamp(1.15rem, 2.6vw, 1.9rem);   /* same size as the About title */
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--white);
}
.contact__intro {
  max-width: 34em;
  margin: 0 auto 1.75rem;
  color: var(--text-grey);
}
.contact__button {
  padding: 0.9rem 2.25rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.7);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--white);
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.contact__button:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--navy);
}

/* ---------- Contact pop-up ---------- */
.modal {
  width: min(560px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  border: 0;
  background: var(--mist);
  color: var(--navy);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 30px 80px rgba(0, 12, 32, 0.45);
}
.modal[open] { animation: modalIn 0.4s var(--ease); }
.modal::backdrop {
  background: rgba(0, 26, 64, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px); }
}
.modal__panel {
  position: relative;
  padding: clamp(2rem, 5vw, 3rem);
}
.modal__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  border: 0;
  color: var(--navy);
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.modal__close:hover { opacity: 1; }
.modal__title {
  margin: 0 0 2rem;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--navy);
}

/* Form (inside the pop-up) */
.form {
  display: grid;
  gap: 1.5rem;
}
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem 1.75rem;
}
.form__field {
  display: grid;
  gap: 0.3rem;
}
.form__field label {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(0, 26, 64, 0.65);
}
.form__field input,
.form__field textarea {
  width: 100%;
  padding: 0.6rem 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(0, 26, 64, 0.3);
  border-radius: 0;
  outline: none;
  font: inherit;
  font-size: 16px;                   /* 16px minimum stops phones zooming in on tap */
  line-height: 1.5;
  color: var(--navy);
  transition: border-color 0.3s ease;
}
.form__field textarea {
  min-height: 7rem;
  resize: vertical;
}
.form__field input:focus,
.form__field textarea:focus { border-bottom-color: var(--navy); }

/* Keep browser autofill from changing the field color */
.form__field input:-webkit-autofill {
  -webkit-text-fill-color: var(--navy);
  box-shadow: 0 0 0 1000px var(--mist) inset;
  caret-color: var(--navy);
}

.form__submit {
  justify-self: start;
  padding: 0.9rem 2rem;
  background: var(--navy);
  border: 1px solid var(--navy);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.4;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--white);
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}
.form__submit:hover:not(:disabled) {
  background: transparent;
  color: var(--navy);
}
.form__submit:disabled { opacity: 0.6; cursor: default; }

.form__status {
  min-height: 1.5em;
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}
.form__status.is-success { color: #2d5f94; }
.form__status.is-error { color: #a33a3a; }

/* Spam trap: invisible to people */
.form__hp {
  position: absolute;
  left: -9999px;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;                        /* sits above the fixed video */
  background: var(--navy);
  color: var(--white);
  padding: 1.5rem clamp(1.25rem, 4vw, 3.5rem) 1.1rem;   /* slimmer footer band */
}
.footer__inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;            /* stacked instead of side by side */
  align-items: flex-start;
  gap: 2rem;
}

/* Left block: logo and disclaimer */
.footer__left {
  flex: none;                        /* was flex: 0 1 760px, which would turn into a height in a column */
  min-width: 0;
}
.footer__logo { display: block; width: 230px; }
.footer__logo img {
  width: 230px;
  height: auto;
  /* trims the empty space built into the logo PNG */
  margin: -1.1rem 0 -0.75rem;
}
.footer__disclaimer {
  max-width: 760px;
  margin: 1.1rem 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  text-wrap: balance;                /* evens out the line lengths */
}

.footer__right {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 1.1rem;
  text-align: right;
}

/* Name block: Wesley Simons, company, mobile number */
.footer__person {
  display: grid;
  gap: 0.15rem;
  text-align: right;
}
.footer__name {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
}
.footer__role {
  margin: 0 0 0.35rem;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
}
.footer__role {
  margin: 0 0 0.35rem;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
}
.footer__person .footer__item { justify-content: flex-end; }

.footer__contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: start;
  align-items: baseline;             /* email and office sit on the same text line */
  gap: 0.75rem 2.5rem;
}
.footer__item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 15px;
  line-height: 1.5;
}
.footer__label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}
.footer__item address { font-style: normal; }
.footer__item a {
  display: inline-block;
  padding: 0.4rem 0;                 /* bigger tap target... */
  margin: -0.4rem 0;                 /* ...that doesn't push the text out of line */
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition: color 0.3s ease;
}
.footer__item a:hover { color: var(--blue-grey); }
.footer__copy {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
}

/* ---------- Footer layout: one centered column (all screen sizes) ----------
   logo, then name block, then email and office, then a full-width divider, the disclaimer, the copyright.
   The two wrapper columns are dissolved (display: contents) so each piece can be ordered on its own. */
.footer { text-align: center; }

.footer__inner {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.footer__left,
.footer__right { display: contents; }

.footer__logo {
  order: 1;
  margin: 0 auto 1rem;
}

/* Name block, centered */
.footer__person {
  order: 2;
  justify-items: center;
  text-align: center;
  margin-bottom: 1.75rem;
}
.footer__person .footer__item { justify-content: center; }

/* Email and office on one centered row, with the full-width divider underneath */
.footer__contact {
  order: 3;
  justify-content: center;
  gap: 0.5rem 2.5rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer__item { text-align: center; }

/* Disclaimer: a centered block of about three lines */
.footer__disclaimer {
  order: 4;
  max-width: 1400px;                 /* wider, so the text spreads out in 1-2 lines instead of 3 */
  margin: 0.9rem auto 0.6rem;
  text-align: center;
}

.footer__copy {
  order: 5;
  text-align: center;
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  /* Logo stays upper centre on phones too (a fixed distance from the top, so it never moves). */
  :root { --logo-top: 110px; }

  .header__toggle { display: block; }
  .header__logo img { width: 150px; margin: -1rem 0 -1.2rem; }

  /* footer logo back to the smaller size on phones */
  .footer__logo { width: 150px; }
  .footer__logo img { width: 150px; margin: -0.75rem 0 -0.5rem; }

  /* The navy band on phones: solid navy, no blur. Blur effects can fail to paint on some phone
     browsers until the page is redrawn, which made the band show up late. Solid always paints. */
  .header::before {
    background: var(--navy);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  /* Header gets its own GPU layer so it stays pinned while the fixed video and hero logo repaint
     underneath it on phones. Because a transformed parent becomes the reference box for fixed
     children, the full-screen menu below is absolute (the header sits at top: 0, so it still
     covers the whole screen). */
  .header {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  /* Hero logo on phones: no animated blur (very heavy on phone GPUs and can make the fixed
     header lag or drop out while scrolling). It still fades, drifts and shrinks. */
  .hero__content {
    filter: none;
    will-change: opacity, transform;
  }

  .header__menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 2;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    background: var(--navy);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s;
  }
  .header.is-open .header__menu {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }
  .header__menu a {
    display: inline-block;
    padding: 0.6rem 0;               /* bigger tap target */
    font-size: 0.95rem;
  }

  .hero__scroll { bottom: 2rem; }

  /* Performance on phones: no animated full-screen blur */
  .hero__overlay {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  /* About on phones: lighter and less bulky */
  .about { padding-top: 4.5rem; padding-bottom: 4rem; }
  .about__title {
    font-size: 1rem;
    letter-spacing: 0.18em;
    padding-left: 0.18em;
    margin-bottom: 2.25rem;
  }
  .about__text {
    font-size: 15px;
    line-height: 23px;
    margin-bottom: 1.5rem;
  }

  .contact__title { font-size: 1rem; letter-spacing: 0.18em; padding-left: 0.18em; }

  .modal__panel { padding: 2rem 1.25rem 1.75rem; }
  .form__row { grid-template-columns: 1fr; }
  .form__submit { width: 100%; justify-self: stretch; }
}

/* ---------- Small phones: label above value, each centered ---------- */
@media (max-width: 600px) {
  .footer__item { overflow-wrap: anywhere; }   /* long email or address wraps instead of overflowing */
  .footer__contact {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .footer__item {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
}

/* ---------- Short screens (phones turned sideways) ---------- */
@media (max-height: 520px) {
  :root { --logo-top: 3.5rem; }
  .hero__scroll { bottom: 0.75rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  /* the logo just appears, with no waiting for its delays */
  .hero__trees,
  .hero__word { animation-delay: 0s !important; }
  .hero__scroll svg { animation: none; }
}
