@layer reset, base, components, motion;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  html,
  body {
    margin: 0;
    min-height: 100%;
  }

  img {
    display: block;
    max-width: 100%;
  }
}

@layer base {
  :root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #07182a;
    background: #078ef1;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
  }

  body {
    min-width: 320px;
    overflow-x: hidden;
  }
}

@layer components {
  .landing {
    position: relative;
    isolation: isolate;
    display: grid;
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(1.25rem, 3.5vw, 3rem);
    overflow: hidden;
    background-image: url("/assets/greatwhite-blue-background.jpg");
    background-position: center;
    background-size: cover;
  }

  .landing__wash {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
      radial-gradient(circle at 50% 49%, rgb(255 255 255 / 0.18), transparent 42%),
      linear-gradient(180deg, rgb(2 33 71 / 0.03) 0%, rgb(255 255 255 / 0.08) 60%, rgb(232 253 255 / 0.16) 100%);
  }

  .brand {
    position: absolute;
    top: clamp(3rem, 8.5vh, 6rem);
    left: 50%;
    width: min(28vw, 15rem);
    min-width: 10rem;
    transform: translateX(-50%);
  }

  .brand__logo {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 1px 0 rgb(255 255 255 / 0.15));
  }

  .hero {
    align-self: center;
    justify-self: center;
    width: min(100%, 70rem);
    padding: clamp(7rem, 17vh, 10.5rem) 0 clamp(1rem, 4vh, 3rem);
    text-align: center;
  }

  .hero__kicker {
    margin: 0 0 clamp(1rem, 2.4vh, 1.5rem);
    color: rgb(7 24 42 / 0.66);
    font-size: clamp(0.7rem, 0.65rem + 0.22vw, 0.88rem);
    font-weight: 700;
    letter-spacing: 0.19em;
    line-height: 1.4;
    text-transform: uppercase;
  }

  .hero__title {
    margin: 0;
    color: #06172a;
    font-size: clamp(3rem, 7.4vw, 7.2rem);
    font-weight: 760;
    letter-spacing: -0.065em;
    line-height: 0.94;
    text-wrap: balance;
  }

  .hero__title span {
    display: block;
  }

  .hero__rule {
    width: clamp(3rem, 8vw, 6rem);
    height: 2px;
    margin: clamp(1.6rem, 4vh, 2.5rem) auto clamp(1.25rem, 3vh, 2rem);
    background: rgb(6 23 42 / 0.58);
  }

  .hero__description {
    width: min(100%, 47rem);
    margin: 0 auto;
    color: rgb(6 23 42 / 0.7);
    font-size: clamp(0.96rem, 0.88rem + 0.34vw, 1.2rem);
    font-weight: 450;
    letter-spacing: -0.01em;
    line-height: 1.7;
    text-wrap: balance;
  }

  .hero__description a {
    color: inherit;
    text-decoration-color: rgb(6 23 42 / 0.38);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color 180ms ease, text-decoration-color 180ms ease;
  }

  .hero__description a:hover,
  .hero__description a:focus-visible {
    color: #06172a;
    text-decoration-color: currentColor;
  }

  .hero__description a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
  }

  @media (max-width: 640px) {
    .landing {
      padding: 1.25rem;
      background-position: 53% center;
    }

    .brand {
      top: max(3rem, calc(env(safe-area-inset-top) + 1.5rem));
      width: min(48vw, 12rem);
      min-width: 9.5rem;
    }

    .hero {
      padding-top: clamp(8.5rem, 22vh, 11rem);
      padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }

    .hero__title {
      font-size: clamp(3.15rem, 15vw, 5.2rem);
      line-height: 0.98;
    }

    .hero__description {
      max-width: 32rem;
      line-height: 1.62;
    }
  }

  @media (max-height: 650px) and (min-width: 641px) {
    .brand {
      top: 2.25rem;
      width: 10rem;
    }

    .hero {
      padding-top: 5.75rem;
    }

    .hero__kicker {
      margin-bottom: 0.75rem;
    }

    .hero__rule {
      margin-block: 1.15rem 0.9rem;
    }
  }
}

@layer motion {
  @keyframes arrive {
    from {
      opacity: 0;
      transform: translateY(0.8rem);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes logo-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes logo-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
  }

  .brand,
  .hero__kicker,
  .hero__title,
  .hero__rule,
  .hero__description {
    animation: arrive 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .brand {
    animation-name: none;
  }

  .brand__logo {
    animation:
      logo-fade 1200ms ease-out both,
      logo-float 6s ease-in-out infinite;
  }

  .hero__kicker {
    animation-delay: 90ms;
  }

  .hero__title {
    animation-delay: 160ms;
  }

  .hero__rule {
    animation-delay: 250ms;
  }

  .hero__description {
    animation-delay: 310ms;
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      scroll-behavior: auto !important;
      animation: none !important;
    }
  }
}
