:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  color: #171819;
  background: #f2f2f2;
  --landing-lime: #a6ce00;
  --page-width: 88.6%;
}

* { box-sizing: border-box; }
body { margin: 0; overflow-wrap: anywhere; }
a { color: inherit; }
a:focus-visible { outline: 3px solid #171819; outline-offset: 5px; }

.landing-header {
  width: var(--page-width);
  min-height: 5rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.wordmark {
  grid-column: 2;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  text-decoration: none;
  white-space: nowrap;
}

/* Column 1 of the header grid, which the wordmark leaves empty. Keeping the
   wordmark centred is the point of `1fr auto 1fr`, so the nav goes beside it
   rather than in place of it. */
.landing-nav {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.25rem;
}

.landing-nav a,
.login-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.875rem;
  color: #626262;
  text-decoration: none;
  text-underline-offset: 4px;
}

.login-link { justify-self: end; }

.landing-nav a:hover,
.login-link:hover { color: #171819; text-decoration: underline; }

.landing-hero {
  width: var(--page-width);
  min-height: max(38rem, calc(100svh - 6.25rem));
  margin: 0 auto 1.25rem;
  display: grid;
  grid-template-columns: 3fr 4fr;
  background: #161616;
}

.hero-portrait,
.hero-invitation {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  isolation: isolate;
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-portrait h1 {
  width: 77.5%;
  justify-self: start;
  margin: 0 0 3.4rem;
  text-align: right;
  color: var(--landing-lime);
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: clamp(2.5rem, 3.35vw, 5.5rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.hero-portrait h1 span { display: block; }

.invitation-content {
  min-width: 0;
  width: clamp(20rem, 46.3%, 36rem);
  max-width: calc(100% - 3rem);
  justify-self: center;
  margin-bottom: 3.4rem;
  padding: 2rem 0;
}

.invitation-card {
  padding: clamp(1.25rem, 1.4vw, 2.25rem);
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: clamp(1.25rem, 1.5vw, 2.25rem);
  background: linear-gradient(120deg, rgb(18 18 18 / 88%), rgb(88 88 88 / 87%));
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: #fff;
}

.invitation-card h2 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: clamp(1.375rem, 1.63vw, 2.625rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.invitation-card h2 span { color: var(--landing-lime); }

.invitation-card p {
  margin: clamp(1.75rem, 2.1vw, 3.25rem) 0 0;
  font-size: clamp(1rem, 1.05vw, 1.5rem);
  line-height: 1.2;
}

.start-link {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  margin-top: 0.875rem;
  padding: 0.625rem 1rem;
  border-radius: 100px;
  background: var(--landing-lime);
  color: #192000;
  font-size: clamp(1rem, 0.95vw, 1.375rem);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background 150ms ease;
}

.start-link:hover { background: #b9e500; }
.start-link:focus-visible { outline-color: #fff; }

@media (max-width: 900px) {
  :root { background: #111; color: #fff; }
  body { position: relative; }

  /* The header sits over the photograph instead of above it, so there is no
     seam between a solid bar and the image. It scrolls with the page — the
     hero is one composition, not a fixed chrome the portrait slides under. */
  .landing-header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    width: 100%;
    min-height: 4.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.25rem 1rem;
    padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1.5rem 1.75rem;
    /* Opaque enough behind the wordmark to keep it legible, gone by the time
       it reaches the swimmer. The hero's own gradient takes over from there. */
    background: linear-gradient(
      180deg,
      rgb(17 17 17 / 92%) 0%,
      rgb(17 17 17 / 78%) 38%,
      rgb(17 17 17 / 38%) 72%,
      rgb(17 17 17 / 0%) 100%
    );
  }

  .wordmark {
    grid-column: 1;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 1.25rem;
  }
  .login-link, .login-link:hover { color: #fff; }
  .landing-header a:focus-visible { outline-color: var(--landing-lime); }

  /* Two rows on a phone: the wordmark keeps the login link beside it, and the
     nav wraps underneath on its own line. `order` rather than a DOM change, so
     the desktop grid keeps the nav in column 1 without a second markup path. */
  .wordmark { order: 1; }
  .login-link { order: 2; }
  .landing-nav {
    order: 3;
    flex-basis: 100%;
    gap: 0 1rem;
  }
  .landing-nav a { min-height: 2.25rem; color: rgb(255 255 255 / 82%); }
  .landing-nav a:hover { color: #fff; }

  .landing-hero {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-height: 100svh;
    margin: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(16rem, 1fr) auto;
    background: #111;
  }

  .landing-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgb(0 0 0 / 5%) 10%, rgb(0 0 0 / 24%) 40%, #111 95%);
    pointer-events: none;
  }

  .hero-portrait {
    position: static;
    isolation: auto;
    align-items: end;
    padding: 2rem 1.5rem;
  }

  .hero-portrait .hero-image {
    z-index: -2;
    object-position: center 28%;
  }

  .hero-portrait h1 {
    width: 100%;
    max-width: 34rem;
    justify-self: center;
    margin: 0;
    text-align: left;
    font-size: clamp(2.5rem, 11vw, 5rem);
  }

  .hero-invitation {
    padding: 0 1.5rem calc(clamp(4.5rem, 10svh, 6rem) + env(safe-area-inset-bottom, 0px));
  }

  .hero-invitation > .hero-image { display: none; }

  .invitation-content {
    width: 100%;
    max-width: 34rem;
    margin: 0;
    padding: 0;
  }

  .invitation-card {
    padding: 1.25rem;
    border-color: rgb(255 255 255 / 20%);
    border-radius: 1.25rem;
    background: rgb(28 28 28 / 72%);
  }

  .invitation-card h2 {
    font-size: clamp(1.25rem, 5.4vw, 1.75rem);
    line-height: 1.05;
  }

  .invitation-card p { margin-top: 1rem; line-height: 1.4; }

  .start-link {
    min-height: 3.25rem;
    margin-top: 0.75rem;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .start-link { transition: none; }
}
