.hero {
  --hbop: 0.13;
  --amp: 7px;
  --fdur: 3.4s;
  --fdur2: 4s;
  --fishop: 0.8;
  position: relative;
  overflow: hidden;
  /* full-bleed: break out of the 900px .page column so the panel, scanlines and
     glow span the viewport; the column is restored on .hero__inner. body has
     overflow-x: clip to absorb the scrollbar-width overshoot of 50vw */
  margin-inline: calc(50% - 50vw);
  padding: 20px 0 44px;
  background: var(--hero-backdrop);
}

.hero__inner {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 28px;
  box-sizing: border-box;
}

.hero__scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--hero-scanlines-op, 1);
  background: repeating-linear-gradient(
    120deg,
    transparent 0,
    transparent 3px,
    var(--fg) 2px,
    var(--accent) 5px
  );
  mix-blend-mode: overlay;
}

.hero__bubbles {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 46%;
  height: 60%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero__bubble {
  position: absolute;
  bottom: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent2);
  opacity: 0;
  pointer-events: none;
  animation: hrise 10s linear infinite;
}

.hero__fish-school {
  position: absolute;
  right: 60px;
  bottom: 30px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  opacity: var(--fishop, 0.8);
  pointer-events: none;
}

.hero__fish {
  display: inline-block;
  transform-origin: center;
  white-space: nowrap;
}

.hero__fish--big {
  --r: -7deg;
  animation: snooze var(--fdur, 3.4s) ease-in-out infinite;
  font: 700 24px var(--font-mono);
  color: var(--fish-big);
  text-shadow: var(--fish-big-shadow);
}

.hero__fish--small {
  --r: 6deg;
  /* backwards fill holds the rest pose through the delay so the bob eases in
     instead of snapping from the untransformed state 0.6s after load */
  animation: snooze var(--fdur2, 4s) ease-in-out 0.6s infinite backwards;
  font: 700 15px var(--font-mono);
  color: var(--fish-small);
  text-shadow: var(--fish-small-shadow);
  margin-right: 22px;
}

.hero__content {
  position: relative;
}

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

.hero__title {
  --hero-title-size: 92px;
  --hero-title-spacing: 0.06em;
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-size: var(--hero-title-size);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: var(--hero-title-spacing);
  color: var(--hero-title-fill);
  text-shadow: var(--hero-title-glow);
}

.hero__title-line {
  position: relative;
  display: block;
  /* own stacking context so the z-index:-1 channel pseudos stay behind the fill
     but never fall behind an ancestor background */
  isolation: isolate;
}

/* the static headline keeps only the LOOK of the old glitch: night is fill +
   glow over the resting colour fringe (old idle state: ±0.035em channel
   copies at 0.95), day swaps the fringe for the outline copy */
.hero__title-line::before,
.hero__title-line::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.95;
}

.hero__title-line::before {
  color: var(--accent);
  transform: translate(-0.035em, 0);
}

.hero__title-line::after {
  color: var(--accent2);
  transform: translate(0.035em, 0);
}

/* day headline per the owner ref: pale blue fill with a thick pink outline
   copy shifted up-left, so the fill peeks out at the bottom right; the cyan
   channel is off */
/* keep in sync with the [data-theme="light"] twin block below */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .hero__title-line::before {
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 0.04em var(--accent);
    z-index: 3;
    transform: translate(-0.05em, -0.04em);
    opacity: 1;
  }

  :root:not([data-theme]) .hero__title-line::after {
    display: none;
  }
}

/* keep in sync with the prefers-color-scheme: light twin block above */
:root[data-theme="light"] .hero__title-line::before {
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0.04em var(--accent);
  z-index: 3;
  transform: translate(-0.05em, -0.04em);
  opacity: 1;
}

:root[data-theme="light"] .hero__title-line::after {
  display: none;
}

.hero__tagline {
  margin: 22px 0 0;
  max-width: 525px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg);
  opacity: 0.86;
}

/* the packaged word highlighters pick the site palette through their public
   vars */
.hero__tagline--live {
  /* reserve for the JS-injected editor so the page does not jump on init */
  min-height: 55px;
  /* the editor's inline font styles read these instead of `inherit`, which on
     the root would resolve against .hero__content and skip the mobile override */
  --tagline-font-size: 16px;
  --tagline-line-height: 1.7;
  --yace-shimmer-base: var(--muted);
  --yace-shimmer-band: var(--hero-shimmer-band);
  --yace-slice-a: var(--accent);
  --yace-slice-b: var(--accent2);
}

.hero__tagline--live .yace-slice-word {
  color: var(--accent);
}

.hero__size {
  color: var(--accent2);
}

.hero__tag {
  color: var(--accent);
}

.hero__token {
  border-radius: 4px;
}

.hero__token--a {
  background: color-mix(in srgb, var(--accent2) 42%, transparent);
}

.hero__token--b {
  background: color-mix(in srgb, var(--fish-small) 48%, transparent);
}

.hero__actions {
  display: flex;
  gap: 14px;
  margin-top: 30px;
  align-items: center;
}

.hero__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 13px 20px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  transition:
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.hero__button--primary {
  background: var(--accent);
  color: var(--bg);
  /* night glows, day gets a soft reflex under the button (tokens.css) */
  box-shadow: var(--hero-button-shadow);
}

.hero__button--primary:hover {
  background: var(--hero-button-hover-bg);
  box-shadow: var(--hero-button-shadow-hover);
}

.hero__button--ghost {
  background: transparent;
  color: var(--accent2);
  box-shadow: inset 0 0 0 1px var(--accent2);
  text-shadow: var(--hero-ghost-shadow);
}

.hero__button--ghost:hover {
  background: color-mix(in srgb, var(--accent2) 12%, transparent);
}

.hero__arrow {
  flex: none;
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}

.hero__copy {
  flex: none;
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

@keyframes hrise {
  0% {
    transform: translateY(0) scale(0.7);
    opacity: 0;
  }
  16% {
    opacity: var(--hbop, 0.08);
  }
  84% {
    opacity: calc(var(--hbop, 0.08) * 0.55);
  }
  100% {
    transform: translateY(-150px) scale(1.1);
    opacity: 0;
  }
}

@keyframes snooze {
  0%,
  100% {
    transform: translateY(0) rotate(calc(var(--r, 0deg) - 2deg));
  }
  50% {
    transform: translateY(calc(-1 * var(--amp, 7px)))
      rotate(calc(var(--r, 0deg) + 3deg));
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 34px 0 30px;
  }

  .hero__inner {
    padding: 0 22px;
  }

  .hero__bubbles {
    display: none;
  }

  .hero__fish-school {
    display: none;
  }

  .hero__title {
    --hero-title-size: 46px;
    --hero-title-spacing: 0.04em;
    margin: 12px 0 0;
  }

  .hero__tagline {
    margin: 18px 0 0;
    font-size: 14px;
    line-height: 1.65;
  }

  .hero__tagline--live {
    min-height: 70px;
    --tagline-font-size: 14px;
    --tagline-line-height: 1.65;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 24px;
  }

  .hero__button {
    justify-content: center;
    padding: 14px 18px;
  }
}
