@font-face {
  font-family: "Gilda Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/gilda-display-v20-latin.woff2") format("woff2");
}

/* Match the Latin face's x-height and vertical metrics to keep swaps stable. */
@font-face {
  font-family: "Gilda Fallback";
  src: local("Georgia");
  size-adjust: 98.25%;
  ascent-override: 90.79%;
  descent-override: 29.01%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/assets/fonts/figtree-v9-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Figtree Fallback";
  src: local("Arial");
  size-adjust: 96.42%;
  ascent-override: 98.53%;
  descent-override: 25.93%;
  line-gap-override: 0%;
}

:root {
  --beach: url("/assets/hero-beach-2400.jpg");
  --ink: #152f47;
  --muted: #3d5871;
  --accent: #152f47;
  --button-text: #ffffff;
  --font-body: "Figtree", "Figtree Fallback", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Gilda Display", "Gilda Fallback", Georgia, serif;
  --h1-size: clamp(2.25rem, 6vw, 3.5rem);
  --radius: 999px;
}

/* Keep the JPEG fallback valid even in browsers without typed image-set(). */
@supports (background-image: image-set(url("/assets/hero-beach-2400.avif")
  type("image/avif"))) {
  :root {
    --beach: image-set(
      url("/assets/hero-beach-2400.avif") type("image/avif"),
      url("/assets/hero-beach-2400.webp") type("image/webp"),
      url("/assets/hero-beach-2400.jpg") type("image/jpeg")
    );
  }
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  /* page base color = the exact top edge of the hero sky (with wash), so
     overscroll / browser chrome blends instead of showing a darker band */
  background: #c1dbee;
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

body {
  margin: 0;
  background: #fff;
  font-size: 1.0625rem;
}

section {
  width: calc(100% - 3rem);
  max-width: 40rem;
  margin-inline: auto;
}

section {
  padding-block: 2rem;
}

section > :last-child {
  margin-bottom: 0;
}

#mission {
  padding-top: 5rem;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: var(--h1-size);
  /* Gilda has no bold. Instead of browser "fake bold" (which Chrome and
     Safari draw differently), thicken the strokes the same way everywhere. */
  -webkit-text-stroke: 0.02em currentColor;
}

h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 4vw, 2.625rem);
}

p {
  margin: 0 0 1.5rem;
  text-wrap: pretty;
}

a {
  color: var(--ink);
  text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.secondary {
  color: var(--muted);
  font-size: 0.875rem;
}

.hero {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(5.5rem, 11svh, 9rem) 1.5rem 4rem;
  text-align: center;
  background: #a9d3ec;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* smooth fade from the beach into the white page (eased, no hard start) */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 140px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.04) 20%,
    rgba(255, 255, 255, 0.16) 40%,
    rgba(255, 255, 255, 0.38) 60%,
    rgba(255, 255, 255, 0.68) 78%,
    #fff 100%
  );
  pointer-events: none;
}

/* closing: waitlist + footer sit on the beach again, fading in from white */
.closing {
  position: relative;
  isolation: isolate;
  padding-bottom: clamp(9rem, 15vw, 13rem);
  background: #fff var(--beach) center bottom / cover no-repeat;
}

.closing::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  z-index: -1;
  height: 78%;
  background: linear-gradient(to bottom, #fff 0%, #fff 45%, rgba(255, 255, 255,
    0.75) 70%, rgba(255, 255, 255, 0) 100%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent);
  mask-image: linear-gradient(to bottom, #000 75%, transparent);
  pointer-events: none;
}

main:has(.closing) + footer {
  position: relative;
  z-index: 1;
  margin-top: -10rem;
  min-height: 10rem;
  align-content: center;
  padding-block: 1rem;
  border-top: 0;
}

.hero h1 {
  max-width: 1000px;
}

.hero h1.hl {
  /* capped by height too, so the copy ends above the horizon on laptops */
  font-size: clamp(3rem, min(8vw, 9svh), 5.5rem);
  font-weight: 400;
  line-height: 1.05;
}

.hero h1.hl .setup {
  display: block;
  margin-bottom: 0.12em;
  font-size: 0.5em;
  line-height: 1.2;
  /* the h1's 0.02em stroke inherits as pixels, which made the half-size
     setup line twice as heavy; recompute it at this size */
  -webkit-text-stroke-width: 0.02em;
}

.hero h1.hl .main {
  display: inline-flex;
  align-items: center;
  gap: 0.16em;
  white-space: nowrap;
}

.hero h1.hl .main img {
  width: auto;
  height: 1.15em;
  margin: -0.08em 0 0 0.05em;
  filter: drop-shadow(0 0.05em 0.08em rgba(13, 34, 53, 0.18));
}

.hero-description {
  max-width: 38rem;
  margin-bottom: 1.5rem;
  color: #3b566c; /* muted, still passes 4.5:1 on the desktop sky */
  font-size: 1.125rem;
}

.hero .button {
  min-height: 52px;
  padding: 0.875rem 2rem;
  font-size: 1.0625rem;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  color: var(--button-text);
  background: var(--accent);
  border-radius: var(--radius);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  box-shadow:
    inset 0 3px 6px rgba(255, 255, 255, 0.28),
    inset 0 -5px 10px rgba(0, 0, 0, 0.35),
    0 8px 18px rgba(13, 34, 53, 0.3);
  transition: opacity 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.button:hover {
  transform: translateY(-2px) scale(1.02);
}

.button:active {
  transform: scale(0.96);
  box-shadow:
    inset 0 5px 10px rgba(0, 0, 0, 0.35),
    0 3px 8px rgba(13, 34, 53, 0.25);
}

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

  .button:hover,
  .button:active {
    transform: none;
  }
}

.hero-note,
.beta-note {
  margin: 1rem 0 0;
}

/* short laptop windows: no room under the button before the horizon; the
   same note repeats at the waitlist */
@media (min-width: 521px) and (max-height: 760px) {
  .hero-note {
    display: none;
  }
}

details {
  border-bottom: 1px solid #e3e8ee;
}

details:first-of-type {
  border-top: 1px solid #e3e8ee;
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  flex-shrink: 0;
  color: var(--muted);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  transition: transform 200ms ease;
}

details[open] summary::after {
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  summary::after {
    transition: none;
  }
}

details p {
  margin: 0 0 1rem;
}

.beta {
  text-align: center;
}

.beta-zippy {
  display: block;
  width: auto;
  height: clamp(120px, 15vw, 150px);
  background: #fff;
  margin: 0 auto 0.75rem;
}

/* iOS Low Power Mode blocks autoplay and overlays a native play button on
   the poster. The mascot is decorative: show the still poster instead. */
.beta-zippy::-webkit-media-controls,
.beta-zippy::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  max-width: 1000px;
  margin-inline: auto;
  padding: 2rem clamp(1.5rem, 4vw, 2rem);
  border-top: 1px solid #eee;
  font-size: 0.875rem;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

footer nav a {
  color: var(--muted);
  text-decoration: none;
}

footer nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

footer nav a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

footer p {
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html {
  scroll-padding-top: 5rem;
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1000px;
  margin-inline: auto;
  padding: 1.25rem clamp(1.5rem, 4vw, 2rem);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.6875rem;
  font-weight: 400;
  text-decoration: none;
}

/* Gilda's caps sit ~1.5px high in the line box; nudge down so the wordmark
   shares the same center line as the mascot, nav link and button */
.logo-text {
  position: relative;
  top: 1.5px;
}

.logo-mark {
  width: auto;
  height: 2.25rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.9375rem;
}

.site-nav a:not(.button) {
  text-decoration: none;
}

.site-nav a:not(.button):hover {
  text-decoration: underline;
}

.button-small {
  min-height: 40px;
  padding: 0.5rem 1rem;
}

/* phones: the hero already has the main CTA, so the nav shows "Our mission" instead */
@media (max-width: 640px) {
  .site-nav .button {
    display: none;
  }

  /* 44px+ touch target without changing how it looks */
  .site-nav a:not(.button) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.75rem;
    margin-right: -0.75rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.waitlist {
  max-width: 30rem;
  margin: 2rem auto 0;
  text-align: left;
}

.waitlist-row {
  display: flex;
  align-items: stretch;
  padding: 0.3rem;
  border: 1px solid #cfd8e2;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  border-radius: var(--radius);
}

.country-code {
  display: flex;
  align-items: center;
  padding-inline: 1rem 0.5rem;
  font-weight: 600;
}

.waitlist-row input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.5rem;
  border: 0;
  font: inherit;
  background: transparent;
}

.waitlist-row input:focus {
  outline: none;
}

.waitlist-row:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(21, 47, 71, 0.12);
}

.waitlist-row .country-code {
  padding-left: 1rem;
}

.waitlist-row .button {
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.waitlist-row .button[aria-disabled="true"] {
  opacity: 0.5;
}

.consent {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.consent input {
  margin-top: 0.2rem;
  /* browsers differ on the default inset (Chrome 4px, iOS 2px); zero it so
     the box and the hint above line up on the form edge everywhere */
  margin-left: 0;
  flex-shrink: 0;
}

/* sits between the phone row and the checkbox it points to */
.consent-hint {
  display: block;
  margin: 0.85rem 0 0;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
}

.consent-hint:not([hidden]) + .consent {
  margin-top: 0.35rem;
}

.consent-hint[hidden] {
  display: none;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* footer sits on the sand: use full ink + a soft light halo for legibility */
main:has(.closing) + footer,
main:has(.closing) + footer nav a {
  color: var(--ink);
  text-shadow: 0 0 12px rgba(255, 248, 235, 0.9), 0 0 2px rgba(255, 248, 235,
    0.8);
}

/* ---------- Motion ---------- */

/* hero background layer */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* soft white wash over the upper sky (fades out before the horizon) */
  background:
    linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0.27) 20%,
    rgba(255, 255, 255, 0) 36%
  ),
    var(--beach) center bottom / cover no-repeat;
}

/* one simple, standard motion: hero copy fades up on load, staggered */
.hero h1,
.hero .hero-description,
.hero .button,
.hero .hero-note {
  /* "backwards" (not "both") so the finished animation releases transform
     and the button's hover lift works again */
  animation: rise-in 700ms ease-out backwards;
}

.hero .hero-description {
  animation-delay: 100ms;
}

.hero .button {
  animation-delay: 200ms;
}

.hero .hero-note {
  animation-delay: 300ms;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1,
  .hero .hero-description,
  .hero .button,
  .hero .hero-note {
    animation: none;
  }
}

/* ---------- Mobile ---------- */

.phone-field {
  display: flex;
  flex: 1;
  min-width: 0;
}

@media (max-width: 520px) {
  :root {
    --beach: url("/assets/hero-beach-phone-4x3.jpg");
  }

  @supports (background-image:
    image-set(url("/assets/hero-beach-phone-4x3.avif")
    type("image/avif"))) {
    :root {
      --beach: image-set(
        url("/assets/hero-beach-phone-4x3.avif") type("image/avif"),
        url("/assets/hero-beach-phone-4x3.webp") type("image/webp"),
        url("/assets/hero-beach-phone-4x3.jpg") type("image/jpeg")
      );
    }
  }

  .secondary {
    color: #30485d;
  }

  /* hero: shrink the scene to the lower part of the screen so the horizon
     sits below the copy; the top is filled with the image's own sky color */
  .hero {
    /* center the copy in the sky between the header and the horizon,
       instead of leaving a wide empty band under it */
    --hero-top: max(5.5rem, calc(33svh - 7.5rem));
    padding-top: var(--hero-top);
    background: #97c2e2;
  }

  .hero h1.hl {
    font-size: clamp(2.75rem, 13vw, 3.5rem);
  }

  /* the header wordmark shouldn't outrank the headline's setup line */
  .logo {
    font-size: 1.375rem;
  }

  .logo-mark {
    height: 1.875rem;
  }

  .hero::before {
    /* the desktop clouds sit at the image edges, which phones crop off,
       so put them back in the open sky */
    background:
      url("/assets/cloud-right.webp") right -16px top 9svh / 22% auto no-repeat,
      /* beside the button: same offset as the copy (see .hero padding) */
      url("/assets/cloud-left.webp") left -32px
      top calc(var(--hero-top) + 13.5rem) / 26% auto no-repeat,
      /* sized by height, so the horizon lands at the same spot on every
         phone; the asset is a 4:3 center crop of the desktop image, wide
         enough to cover the width at both scene heights below */
      var(--beach) center bottom / auto 72% no-repeat,
      /* soft sky: lighter at the top (like desktop), easing into the image */
      linear-gradient(to bottom, #b4d4ea 0%, #97c2e2 30%);
  }

  /* phone sky behind the subheadline is a deeper blue: keep it legible */
  .hero-description {
    color: #30485d;
    font-size: 1rem;
  }

  /* phone hero top is a slightly deeper sky */
  html {
    background: #b4d4ea;
  }

  /* waitlist: stack the phone field and the button */
  .waitlist-row {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .waitlist-row:focus-within {
    box-shadow: none;
  }

  .phone-field {
    padding: 0.3rem;
    border: 1px solid #cfd8e2;
    border-radius: var(--radius);
    background: #fff;
  }

  .phone-field:focus-within {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(21, 47, 71, 0.12);
  }

  .waitlist-row .button {
    width: 100%;
    min-height: 52px;
  }

  /* keep the form and small print on white before the beach fades in */
  .closing::before {
    height: 88%;
  }
}

/* short phones (iPhone SE etc.): push the scene further down */
@media (max-width: 520px) and (max-height: 720px) {
  /* the horizon sits higher here, so the centered copy needs less offset */
  .hero {
    --hero-top: max(5.5rem, calc(40svh - 10rem));
  }

  .hero::before {
    background-size: 20% auto, 24% auto, auto 58%, auto;
    background-position:
      right -16px top 9svh,
      left -32px top calc(var(--hero-top) + 13.5rem),
      center bottom,
      0 0;
  }
}
