@font-face {
  font-family: "Helvetica Neue Roman";
  src:
    local("Helvetica Neue"),
    local("HelveticaNeue-Roman"),
    url("public/fonts/HelveticaNeue-Roman.woff2") format("woff2"),
    url("public/fonts/HelveticaNeue-Roman.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --white: #f9fbfc;
  --white-muted: rgba(249, 251, 252, 0.88);
  --blue: #336699;
  --blue-hover: #3d75ad;
  --blue-pressed: #2a5783;
  --field: rgba(245, 250, 253, 0.96);
  --field-text: #24465e;
  --error: #ffe0d5;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  background: #9ab4c4;
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.font-helvetica-neue {
  font-family: "Helvetica Neue Roman", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
}

::selection {
  background: rgba(46, 111, 159, 0.8);
  color: #fff;
}

.hero {
  isolation: isolate;
  min-height: max(100svh, 40rem);
  position: relative;
  overflow: hidden;
  background-image: url("public/images/criterium-hero.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.hero-motion-plane {
  position: absolute;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-motion {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
}

.hero-motion.is-ready {
  opacity: 1;
}

.hero-motion-source {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.hero.is-motion-resizing .hero-motion-plane {
  display: none;
}

.hero-motion-disabled .hero-motion-plane,
.hero-motion-failed .hero-motion-plane {
  display: none;
}

.hero-scrim {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(21, 49, 66, 0.16) 0%, transparent 25%),
    linear-gradient(90deg, rgba(21, 49, 66, 0.05), transparent 35%, rgba(21, 49, 66, 0.05));
}

.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.35rem, 2.2vw, 2rem) clamp(1.4rem, 2.2vw, 2rem);
}

.wordmark {
  color: var(--white);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2rem, 2.7vw, 2.75rem);
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  letter-spacing: -0.035em;
  text-shadow: 0 1px 18px rgba(20, 43, 58, 0.18);
}

.wordmark span {
  color: #dfe8ec;
}

.build-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(54, 87, 105, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.69rem;
  line-height: 1;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pulse-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.pulse-dot {
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}

.pulse-dot-2 { animation-delay: 0.15s; }
.pulse-dot-3 { animation-delay: 0.3s; }

@keyframes pulse {
  0%, 60%, 100% { transform: scale(1); opacity: 0.45; }
  30% { transform: scale(1.35); opacity: 1; }
}

.hero-content {
  position: absolute;
  top: clamp(5.5rem, 9vh, 7rem);
  right: 1rem;
  bottom: 46%;
  left: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-title {
  max-width: none;
  margin-bottom: clamp(1.15rem, 2.3vh, 1.6rem);
  color: var(--white);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(3.35rem, 5.2vw, 5.05rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 28px rgba(20, 43, 58, 0.2);
}

.title-line {
  display: block;
  white-space: nowrap;
}

.hero-subtitle {
  margin-bottom: clamp(2rem, 3.7vh, 2.6rem);
  color: var(--white-muted);
  font-size: clamp(1rem, 1.38vw, 1.28rem);
  line-height: 1.45;
  text-shadow: 0 1px 18px rgba(20, 43, 58, 0.35);
}

.waitlist {
  width: min(100%, 31rem);
  container: waitlist / inline-size;
}

.signup-shell {
  width: 12.1rem;
  min-height: 3.65rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 12px 34px rgba(29, 73, 105, 0.15);
  transition: width 0.65s var(--ease), background-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.waitlist.is-open .signup-shell {
  width: min(100%, 31rem);
  background: var(--field);
  box-shadow: 0 16px 40px rgba(29, 73, 105, 0.19);
}

.signup-shell input {
  width: 0;
  min-width: 0;
  opacity: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--field-text);
  font-size: 1rem;
  line-height: 1;
  transform: translateX(1rem);
  pointer-events: none;
  transition: width 0.6s var(--ease), opacity 0.25s ease 0.08s, transform 0.55s var(--ease);
}

.waitlist.is-open .signup-shell input {
  width: 100%;
  opacity: 1;
  padding: 0 0.35rem 0 1.35rem;
  transform: translateX(0);
  pointer-events: auto;
}

.signup-shell input::placeholder {
  color: rgba(36, 70, 94, 0.5);
}

.cta {
  position: relative;
  flex: none;
  min-width: 12.1rem;
  min-height: 3.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1.35rem;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 400;
  line-height: 1;
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease), width 0.55s var(--ease), min-width 0.55s var(--ease), padding 0.35s var(--ease);
}

.cta::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.cta:hover {
  background: var(--blue-hover);
}

.cta:active {
  background: var(--blue-pressed);
  transform: scale(0.975);
}

.cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.cta:disabled {
  cursor: default;
  opacity: 0.72;
}

.waitlist.is-open .cta {
  min-width: 10.25rem;
}

.cta-coffee {
  position: absolute;
  top: 50%;
  left: 50%;
  display: none;
  width: 1rem;
  height: 1rem;
  overflow: visible;
  transform: translate(-50%, -50%);
  transform-origin: center;
}

.cta-coffee .steam {
  transform-origin: center;
  transition: transform 0.5s var(--ease), opacity 0.5s var(--ease);
}

.cta:hover .cta-coffee .steam {
  transform: translateY(-2px);
  opacity: 0;
}

.cta-check {
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  flex: none;
  pointer-events: none;
}

.cta-check .check-circle { fill: #fff; }
.cta-check .check-mark { fill: var(--blue); }

.waitlist.is-success .signup-shell {
  width: 12.1rem;
  background: transparent;
  box-shadow: none;
}

.waitlist.is-success .signup-shell input,
.waitlist.is-success .cta-coffee {
  display: none;
}

.waitlist.is-success .cta {
  min-width: 12.1rem;
  padding-inline: 0;
}

.waitlist.is-success .cta:hover {
  transform: none;
}

.waitlist.is-success .cta-check {
  width: 1rem;
  height: 1rem;
  opacity: 0;
  overflow: visible;
}

.form-status {
  min-height: 1.2rem;
  margin-top: 0.75rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.78rem;
  line-height: 1.4;
  text-shadow: 0 1px 12px rgba(20, 43, 58, 0.55);
}

.form-status.error { color: var(--error); }

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html.js .reveal {
  opacity: 0;
  transform: translateY(1.1rem);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

html.js .reveal[data-delay="1"] { transition-delay: 0.08s; }
html.js .reveal[data-delay="3"] { transition-delay: 0.48s; }
html.js .reveal[data-delay="4"] { transition-delay: 0.68s; }
html.js .reveal.is-visible { opacity: 1; transform: translateY(0); }
html.js [data-word-reveal]:not(.is-ready) { opacity: 0; }

.word-reveal__word {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 1.6rem, 0);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(0.14s + var(--word-index) * 0.065s);
  will-change: opacity, transform;
}

.is-visible .word-reveal__word {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (max-width: 700px) {
  .hero {
    min-height: max(100svh, 38rem);
    background-position: 50% center;
  }

  .hero-header {
    padding: 1.25rem;
  }

  .build-status {
    padding: 0.52rem 0.68rem;
    font-size: 0.59rem;
  }

  .hero-content {
    top: 4.75rem;
    right: 0.75rem;
    bottom: 46%;
    left: 0.75rem;
  }

  .hero-title {
    margin-bottom: clamp(0.8rem, 2vh, 1.1rem);
    font-size: min(8.9vw, 2.8rem);
    line-height: 1.01;
  }

  .hero-subtitle {
    max-width: 25ch;
    margin-bottom: clamp(1.25rem, 3vh, 1.8rem);
  }

  .waitlist.is-open .signup-shell {
    width: 100%;
  }

  .waitlist.is-open .cta {
    min-width: 8.6rem;
    padding-inline: 1rem;
  }
}

@media (max-width: 520px) {
  .hero-header {
    padding: 1.1rem;
  }

  .wordmark {
    font-size: 1.85rem;
  }

  .build-status {
    display: none;
  }

  .cta,
  .signup-shell {
    min-height: 3.25rem;
  }

  .cta {
    min-width: 10.75rem;
    font-size: 0.9rem;
  }

  .signup-shell,
  .waitlist.is-success .signup-shell,
  .waitlist.is-success .cta {
    width: 10.75rem;
    min-width: 10.75rem;
  }

  .waitlist.is-open .signup-shell {
    width: 100%;
  }
}

@media (max-height: 730px) and (min-width: 701px) {
  .hero-content {
    top: 4.75rem;
    bottom: 46%;
  }

  .hero-title {
    margin-bottom: 0.7rem;
    font-size: clamp(2.65rem, 7vh, 3.4rem);
  }

  .hero-subtitle {
    margin-bottom: 1rem;
    font-size: 1rem;
  }

  .signup-shell,
  .cta {
    min-height: 3.25rem;
  }

  .form-status {
    margin-top: 0.45rem;
  }
}

@media (max-height: 620px) {
  .hero-content {
    top: 4.3rem;
    bottom: 46%;
  }

  .hero-title {
    margin-bottom: 0.55rem;
    font-size: clamp(2rem, 7.5vh, 2.75rem);
  }

  .hero-subtitle {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
  }

  .signup-shell,
  .cta {
    min-height: 3rem;
  }

  .form-status {
    min-height: 1rem;
    margin-top: 0.3rem;
  }
}

@media (max-height: 420px) {
  .hero-header {
    padding: 0.75rem 0.9rem;
  }

  .wordmark {
    font-size: 1.5rem;
  }

  .build-status,
  .hero-subtitle {
    display: none;
  }

  .hero-content {
    top: 3.6rem;
    bottom: auto;
    justify-content: flex-start;
  }

  .hero-title {
    margin-bottom: 2rem;
    font-size: min(7.6vh, 2.25rem);
    line-height: 1;
  }

  .waitlist {
    width: min(100%, 18rem);
  }

  .signup-shell,
  .waitlist.is-success .signup-shell,
  .cta,
  .waitlist.is-open .cta,
  .waitlist.is-success .cta {
    width: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding-inline: 0;
  }

  .waitlist.is-open .signup-shell {
    width: 100%;
  }

  .btn-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .cta-coffee {
    display: block;
  }

  .waitlist.is-success .cta-coffee {
    display: none;
  }

  .form-status {
    min-height: 0.9rem;
    margin-top: 0.25rem;
    font-size: 0.7rem;
  }
}

@container waitlist (max-width: 17rem) {
  .signup-shell,
  .waitlist.is-success .signup-shell {
    width: 2.75rem;
    min-width: 2.75rem;
  }

  .waitlist.is-open .signup-shell {
    width: 100%;
  }

  .cta,
  .waitlist.is-open .cta,
  .waitlist.is-success .cta {
    width: 2.75rem;
    min-width: 2.75rem;
    padding-inline: 0;
  }

  .btn-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .cta-coffee {
    display: block;
  }

  .waitlist.is-success .cta-coffee {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero {
    background-image: url("public/images/criterium-hero.png");
  }

  .hero-motion-plane {
    display: none;
  }

  html.js .reveal,
  html.js [data-word-reveal]:not(.is-ready),
  .word-reveal__word {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .pulse-dot { animation: none; }

  .signup-shell,
  .signup-shell input,
  .cta,
  .cta-coffee .steam {
    transition: none;
  }

  .cta:hover .cta-coffee .steam {
    transform: none;
    opacity: 1;
  }
}
