/* Hydra Biome — waitlist site
   ------------------------------------------------------------
   Typeface: Sorts Mill Goudy, loaded from Google Fonts in each page's <head>. */

:root {
  --black: #18181a;          /* every dark background */
  --blush: #fff5f5;          /* the logo colour */
  --mist: #b9b0b0;           /* secondary text, 8:1 on black */
  --line: rgba(255, 245, 245, 0.28);
  --pool: #7cb9e8;           /* pulled from the photo; focus only */

  --serif: "Sorts Mill Goudy", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;   /* closest match to BIOME in the logo */

  --step--1: 0.875rem;
  --step-0: 1.125rem;
  --step-1: clamp(1.375rem, 1.1rem + 0.9vw, 1.75rem);
  --step-2: clamp(1.75rem, 1.2rem + 1.8vw, 2.625rem);
  --step-3: clamp(2.25rem, 1.4rem + 3vw, 3.75rem);

  --gutter: clamp(1.25rem, 0.6rem + 3vw, 4rem);
  --nav-height: 3.5rem;
}

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

html {
  scroll-padding-top: var(--nav-height);  /* links and tabbing stop below the strip */
  background: var(--black);
  color: var(--blush);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern", "liga", "onum";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}
a:hover { opacity: 0.7; }

:focus-visible {
  outline: 2px solid var(--pool);
  outline-offset: 4px;
}

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

/* ---------- Top menu ---------- */

/* A strip across the top that stays in view while scrolling. */
.topnav {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(1.5rem, 3vw, 3rem);
  height: var(--nav-height);
  padding-inline: 1rem;
  background: var(--black);
  color: var(--blush);
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topnav a { padding-block: 0.5rem; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 100svh;
  overflow: hidden;
  background: #6d9fcb;
  text-align: center;
}

.hero__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.95);
}

.hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  /* Half the top strip is added so the logo and sign-up stay balanced below it */
  padding: calc(16.1svh + var(--nav-height) / 2) var(--gutter) var(--gutter);
}

.hero__rise {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 40rem);
}

/* Hero intro, seen from above: the logo slowly comes up through the water and
   settles, then the sign-up simply fades in. Motion only lives in the animations,
   so with reduced motion on (see the end of this file) both show in place. */
.hero__logo {
  width: min(100%, clamp(17rem, 42.9vw, 40rem));
  margin: 0;
}
.hero__logo img {
  animation: emerge 2.4s cubic-bezier(0.33, 0, 0.15, 1) 0.2s backwards;
}
.waitlist {
  animation: fade-in 0.9s ease 1.6s backwards;
}

@keyframes emerge {
  0%   { opacity: 0; transform: scale(0.96); filter: blur(10px); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}

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

/* Ripple distortion, removed once it settles. Skipped in Safari, which handles
   SVG filters on page content unreliably, so Safari gets the rise and blur only. */
@supports not (font: -apple-system-body) {
  .hero__logo { animation: refract 2.6s linear; }
}

@keyframes refract {
  0%, 99.9% { filter: url(#water); }
  100%      { filter: none; }
}

.water-filter { position: absolute; }
.hero__logo img { width: 100%; }

.hero :focus-visible { outline-color: var(--blush); }

/* ---------- Waitlist form ---------- */

.waitlist {
  position: relative;
  width: min(100%, 26.25rem);
  margin-top: 22svh;
}

.waitlist__label {
  display: block;
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.waitlist__row {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  border-bottom: 1px solid var(--blush);
}

/* The line becomes a box on hover, while typing and after an error. The box
   extends past the line on each side, so the text inside doesn't move. */
.waitlist__row::before {
  content: "";
  position: absolute;
  inset: 0 -0.875rem -1px;
  border: 1px solid var(--blush);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.waitlist__row:focus-within::before,
.waitlist--error .waitlist__row::before { opacity: 1; }
@media (hover: hover) {
  .waitlist__row:hover::before { opacity: 1; }
}

.waitlist__input {
  flex: 1;
  min-width: 0;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--blush);
  height: 2.75rem;
  font: 300 1rem/1.3 var(--sans);
  padding: 0;
}
.waitlist__input::placeholder {
  color: rgba(255, 245, 245, 0.85);
  opacity: 1;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
}
.waitlist__input:focus { outline: none; }
.waitlist__input:-webkit-autofill {
  -webkit-text-fill-color: var(--blush);
  transition: background-color 9999s;
  caret-color: var(--blush);
}

.waitlist__button {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 2.75rem;
  height: 2.75rem;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--blush);
  padding: 0;
  cursor: pointer;
}
.waitlist__button svg { display: block; transition: transform 0.2s; }
.waitlist__button:hover svg { transform: translateX(4px); }

.waitlist__button:disabled { opacity: 0.5; cursor: default; }

/* Sits below the line so showing it doesn't move anything */
.waitlist__error {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin: 0.625rem 0 0;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.waitlist__done {
  /* Takes the same space as the form it replaces */
  display: flex;
  align-items: center;
  min-height: 4.875rem;
  margin: 22svh 0 0;
  font-size: clamp(1.25rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.3;
  animation: fade-in 0.9s ease backwards;
}
.waitlist__done:focus { outline: none; }

.honeypot { display: none; }

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem var(--gutter);
  padding: clamp(4rem, 14vh, 9rem) var(--gutter);
  background: var(--black);
}

.about__title {
  margin: 0;
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  font-weight: 400;
  line-height: 1.2;
}

.about__text {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  line-height: 1.2;
  text-wrap: pretty;
}

/* ---------- Footer ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
}
.footer nav { display: flex; gap: 1.5rem; }
.footer p { margin: 0; }

.footer--home {
  padding: 0 var(--gutter) var(--gutter);
  background: var(--black);
}

/* ---------- Inner pages (FAQ, privacy, thanks, 404) ---------- */

.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: var(--gutter);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.page__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(3rem, 10vh, 6rem);
}
.page__header a.home {
  position: relative;
  z-index: 11;  /* sits on top of the strip */
  display: block;
  width: 7rem;
}
.page__header a.home img { width: 100%; }

.page__title {
  font-size: var(--step-3);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

.page__lede {
  font-size: var(--step-1);
  line-height: 1.4;
  color: var(--mist);
  margin: 0 0 3rem;
  max-width: 34rem;
}

.page__body { flex: 1; }
.page__body h2 {
  font-size: var(--step-1);
  font-weight: 400;
  line-height: 1.3;
  margin: 2.5rem 0 0.5rem;
}
.page__body p,
.page__body li { max-width: 38rem; }
.page__body p { margin: 0 0 1rem; }
.page__body ul { padding-left: 1.2rem; margin: 0 0 1rem; }

.page .footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* Logo and footer run the full width of the screen, as on the homepage;
   the main column stays centered. */
.page--wide {
  max-width: none;
  padding: 10px var(--gutter) var(--gutter);  /* centers the logo in the top strip */
}
.page--wide .page__header {
  align-items: flex-start;
  margin-inline: calc(1rem - var(--gutter));
}
.page--wide .page__body {
  width: 100%;
  max-width: 38rem;
  margin-inline: auto;
}
.page--wide .footer {
  padding-top: 0;
  border-top: 0;
}

/* FAQ: click a question to slide its answer open (see faq.js) */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: block;
  list-style: none;
  cursor: pointer;
  padding: 1.35rem 0;
  font-size: var(--step-1);
  line-height: 1.3;
  transition: opacity 0.2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { opacity: 0.7; }
.faq__answer { overflow: hidden; }
.faq__answer p:last-child { margin-bottom: 1.5rem; }

.button-link {
  display: inline-block;
  margin-top: 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.8rem 1.4rem;
  text-decoration: none;
  transition: border-color 0.2s;
}
.button-link:hover { border-color: var(--blush); }

/* ---------- Small screens ---------- */

@media (max-width: 40rem) {
  .about { grid-template-columns: 1fr; }
}

@media (max-width: 22.5rem) {
  .topnav { gap: 1.25rem; }
}

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