/* The barrel scene. Without motion (no JS, no WebGL, reduced motion) everything flows as ordinary blocks.
   html.is-motion pins the stage and stacks hero, the ask screen and the exit inside it. */

/* Nav: a floating glass pill (Apple's Liquid Glass: a lens of blurred, lightly refracted backdrop with a bright rim
   and a specular top edge). It stays readable on the dark wave and on the light grounds: page.js sets data-on
   from the ground under it. The refraction filter is Chromium only; other browsers keep the blur. */
.nav {
  position: fixed;
  top: calc(var(--s-200) + env(safe-area-inset-top, 0px));
  left: 50%;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--s-50);
  max-width: calc(100% - 2 * var(--s-200));
  padding: 6px;
  border-radius: var(--pill);
  transform: translateX(-50%);
  isolation: isolate;
  --glass-tint: rgba(194, 208, 239, 0.1);
  --glass-rim: rgba(238, 243, 255, 0.34);
  --glass-ink: var(--foam);
  --glass-shadow: rgba(3, 10, 23, 0.32);
  color: var(--glass-ink);
  background: linear-gradient(180deg, rgba(238, 243, 255, 0.14), var(--glass-tint) 55%, rgba(238, 243, 255, 0.04));
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: url(#glass-refract) blur(14px) saturate(180%);
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 -1px 1px rgba(238, 243, 255, 0.08),
    inset 0 0 0 1px rgba(194, 208, 239, 0.16),
    0 10px 30px -8px var(--glass-shadow),
    0 2px 6px -2px var(--glass-shadow);
  transition: color 400ms var(--ease), background-color 400ms var(--ease), box-shadow 400ms var(--ease);
}
/* Specular sheen across the upper half, like light caught in the curve of the lens. */
.nav::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(120% 140% at 30% -40%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}
.nav[data-on="light"] {
  --glass-tint: rgba(255, 255, 255, 0.34);
  --glass-rim: rgba(255, 255, 255, 0.9);
  --glass-ink: var(--midnight);
  --glass-shadow: rgba(6, 21, 77, 0.18);
}
.nav__home {
  display: grid;
  place-items: center;
  width: 52px;
  height: 40px;
  border-radius: var(--pill);
  color: inherit;
}
.nav__home .logo {
  width: 30px;
}
.nav__links {
  display: flex;
}
.nav__links a,
.nav__cta {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding-inline: var(--s-200);
  border-radius: var(--pill);
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 300ms var(--ease), color 300ms var(--ease);
}
.nav__links a {
  opacity: 0.82;
}
.nav__links a:hover {
  opacity: 1;
  background: rgba(238, 243, 255, 0.1);
}
.nav[data-on="light"] .nav__links a:hover {
  background: rgba(6, 21, 77, 0.06);
}
.nav__cta {
  margin-left: var(--s-50);
  background: var(--foam);
  color: var(--abyss);
}
.nav__cta:hover {
  background: var(--foam-hi);
}
.nav[data-on="light"] .nav__cta {
  background: var(--midnight);
  color: var(--foam);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--s-75) var(--s-300);
  border-radius: var(--pill);
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 300ms var(--ease), background-color 300ms var(--ease);
}
.pill--foam {
  background: var(--foam);
  color: var(--abyss);
}
.pill--foam:hover {
  background: var(--foam-hi);
  transform: translateY(-1px);
}
.pill--ink {
  background: var(--midnight);
  color: var(--foam);
}
.pill--ink:hover {
  background: var(--cobalt);
  transform: translateY(-1px);
}
.pill:active {
  transform: scale(0.98);
}

/* Scene */
.scene {
  position: relative;
  background: var(--abyss);
}
.stage {
  position: relative;
}
/* The wave: a generated still (img/CREDITS.md). object-position pins the bright opening to the same
   point of the viewport at every size, so scene.js can push the camera into it. */
.sea {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100svh;
  overflow: hidden;
  pointer-events: none;
  --fx: 0.5;
  --fy: 0.54;
}
.sea picture,
.sea__img {
  display: block;
  width: 100%;
  height: 100%;
}
.sea__img {
  max-width: none;
  object-fit: cover;
  object-position: calc(var(--fx) * 100%) calc(var(--fy) * 100%);
  transform-origin: calc(var(--fx) * 100%) calc(var(--fy) * 100%);
}
.sea__shade,
.sea__bloom,
.sea__flash {
  position: absolute;
  inset: 0;
}
/* Keeps the copy and the facts on dark water. */
/* Round 3: the copy sits centered under the light, so the shade rises from the bottom and the corners. */
.sea__shade {
  background:
    linear-gradient(0deg, rgba(3, 10, 23, 0.94) 0%, rgba(3, 10, 23, 0.78) 20%, rgba(3, 10, 23, 0.25) 34%, var(--abyss-0) 42%),
    linear-gradient(180deg, rgba(3, 10, 23, 0.6) 0%, var(--abyss-0) 16%),
    radial-gradient(120% 90% at 50% 46%, var(--abyss-0) 40%, rgba(3, 10, 23, 0.55) 100%);
}
/* The light at the end of the tube; scene.js centres it on the opening and grows it. */
.sea__bloom {
  inset: auto;
  left: 0;
  top: 0;
  width: 100vmax;
  height: 100vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--foam) 0%, rgba(194, 208, 239, 0.9) 22%, var(--spray-58) 48%, rgba(127, 169, 232, 0) 100%);
  opacity: 0;
}
.sea__flash {
  background: var(--foam);
  opacity: 0;
}
/* Unpinned (reduced motion, no JS): the still melts into the dark ground below the hero. */
html:not(.is-motion) .sea {
  -webkit-mask-image: linear-gradient(#000 72%, transparent);
  mask-image: linear-gradient(#000 72%, transparent);
}
.is-motion .sea__img,
.is-motion .sea__bloom {
  will-change: transform, opacity;
}

/* Hero: one line, centred, under the light. */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  place-items: end center;
  padding: var(--s-900) var(--gutter) calc(18svh + env(safe-area-inset-bottom, 0px));
  text-align: center;
}
.hero__title {
  max-width: 14em;
  font-family: var(--font-head);
  font-weight: 700; /* brand: Bold for heroes, set in caps on the site */
  text-transform: uppercase;
  font-size: clamp(44px, 6.4vw, 104px);
  line-height: 0.94;
  letter-spacing: -0.025em;
  text-wrap: balance;
  color: var(--foam);
  will-change: transform, opacity;
}
.hero__muted {
  color: var(--spray);
}
.textlink {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 5px;
  transition: text-decoration-color 300ms var(--ease);
}
.textlink:hover {
  text-decoration-color: currentColor;
}

/* "Get waived?" comes forward out of the light: words only, midnight on the foam light. */
.ask-wrap {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: var(--s-900) var(--gutter);
  background: var(--foam);
}
.ask {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(48px, 7vw, 112px);
  line-height: 0.94;
  letter-spacing: -0.025em;
  white-space: nowrap;
  color: var(--midnight);
  transform-origin: 50% 50%;
}

/* Where you come out: foam ground, the wordmark surfacing. */
.exit {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  min-height: 70vh;
  padding: var(--s-900) var(--gutter);
  background: var(--foam);
  color: var(--midnight);
}
.exit__mark {
  width: min(720px, 80vw);
}
.exit__mark > .logo {
  width: 100%;
}

/* Pinned travel */
.is-motion .scene {
  height: calc(100svh + 240vh);
}
.is-motion .stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}
.is-motion .ask-wrap,
.is-motion .exit {
  position: absolute;
  inset: 0;
  padding: 0;
  background: none;
  pointer-events: none;
  min-height: 0;
}
.is-motion .ask {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  will-change: transform, opacity;
}
.is-motion .exit {
  opacity: 0;
  will-change: opacity;
}
.is-motion .exit__mark {
  transform: translateY(-4%);
}

@media (max-width: 760px) {
  .sea {
    --fx: 0.47;
    --fy: 0.4;
  }
  .sea__shade {
    background: linear-gradient(0deg, rgba(3, 10, 23, 0.94) 0%, rgba(3, 10, 23, 0.8) 26%, rgba(3, 10, 23, 0.3) 42%, var(--abyss-0) 54%), linear-gradient(180deg, rgba(3, 10, 23, 0.55) 0%, var(--abyss-0) 14%);
  }
}
@media (max-width: 760px) {
  .nav__links {
    display: none;
  }
  .nav {
    left: var(--s-200);
    right: var(--s-200);
    justify-content: space-between;
    transform: none;
    max-width: none;
  }
}
@media (max-width: 640px) {
  .is-motion .scene {
    height: calc(100svh + 140vh);
  }
  .hero {
    padding-bottom: calc(14svh + env(safe-area-inset-bottom, 0px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .pill,
  .textlink,
  .nav,
  .nav__links a,
  .nav__cta {
    transition: none;
  }
}
