#hero {
  --h-ink: #151412;
  --h-muted: #6f6a5f;
  --h-line: rgba(21, 20, 18, 0.1);
  --h-melon: #ff3d57;
  --h-red: #d24a41;
  --h-display: "Unbounded", "Arial Black", sans-serif;
  --h-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --h-gutter: clamp(16px, 4vw, 56px);
  --h-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --melon-size: min(46vh, 44vw, 520px);

  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  min-height: 100svh;
  padding: 36px 0 0;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(to bottom, var(--canvas) 0%, var(--canvas) 52%, var(--surface-card) 100%);
  color: var(--h-ink);
}

.hero-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--h-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--h-line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 80%);
}

#hero .hero-title {
  grid-row: 1;
  align-self: center;
  justify-self: center;
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--h-ink);
  font-family: var(--h-display);
  font-weight: 900;
  font-size: clamp(52px, 13.2vw, 250px);
  line-height: 0.82;
  letter-spacing: -0.055em;
  white-space: nowrap;
  user-select: none;
  text-wrap: nowrap;
}

.hero-word {
  position: relative;
  display: inline-flex;
  font-size: calc(var(--fit, 1) * 1em);
  transition: opacity 0.25s, scale 0.4s var(--h-spring);
}

.hero-word.is-morphing > span {
  animation: none;
}

.hero-word > .hero-gap {
  flex: none;
  animation: none;
}

.hero-word > span.is-leaving {
  position: absolute;
  pointer-events: none;
}

.hero-word > span {
  display: inline-block;
  transition: transform 0.5s var(--h-spring), color 0.3s;
  animation: hero-letter-rise 1.1s var(--h-spring) backwards;
}

.hero-word > span:nth-child(1) { animation-delay: 120ms; }
.hero-word > span:nth-child(2) { animation-delay: 175ms; }
.hero-word > span:nth-child(3) { animation-delay: 230ms; }
.hero-word > span:nth-child(4) { animation-delay: 285ms; }
.hero-word > span:nth-child(5) { animation-delay: 340ms; }
.hero-word > span:nth-child(6) { animation-delay: 395ms; }
.hero-word > span:nth-child(7) { animation-delay: 450ms; }
.hero-word > span:nth-child(8) { animation-delay: 505ms; }
.hero-word > span:nth-child(9) { animation-delay: 560ms; }
.hero-word > span:nth-child(10) { animation-delay: 615ms; }

.hero-word > span.is-accent {
  color: var(--h-melon);
}

.hero-word > span:hover {
  transform: translateY(-10%) rotate(-6deg);
  color: #1e6b3a;
}

@keyframes hero-letter-rise {
  from {
    opacity: 0;
    transform: translateY(60%) rotate(8deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#hero.is-charging .hero-word {
  animation: hero-tremble 0.09s linear infinite;
}

#hero.is-boom {
  animation: hero-quake 0.6s cubic-bezier(0.3, 0.7, 0.4, 1);
}

@keyframes hero-tremble {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, -2px); }
  100% { transform: translate(1px, 2px); }
}

@keyframes hero-quake {
  0% { transform: translate(0, 0); }
  10% { transform: translate(-14px, 8px); }
  20% { transform: translate(12px, -10px); }
  30% { transform: translate(-10px, -6px); }
  45% { transform: translate(8px, 6px); }
  60% { transform: translate(-5px, 3px); }
  80% { transform: translate(3px, -2px); }
  100% { transform: translate(0, 0); }
}

.hero-melon {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hero-melon .melon-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-melon-fallback,
#hero .hero-melon-hit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--melon-size);
  height: var(--melon-size);
  translate: -50% -50%;
}

.hero-melon-fallback {
  object-fit: contain;
  transition: opacity 0.4s;
}

.hero-melon.is-3d .hero-melon-fallback,
.js .hero-melon:not(.is-fallback) .hero-melon-fallback {
  opacity: 0;
}

#hero .hero-melon-hit {
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: none;
}

#hero .hero-melon.is-3d .hero-melon-hit {
  pointer-events: auto;
}

#hero .hero-melon-hit:focus-visible {
  outline: 3px dashed var(--h-ink);
  outline-offset: 8px;
}

#hero .hero-melon.is-busy .hero-melon-hit {
  cursor: default;
}

.hero-bottom {
  grid-row: 2;
  position: relative;
  z-index: 3;
  max-width: calc(520px + var(--h-gutter));
  padding: 0 var(--h-gutter) 56px;
}

#hero .hero-description {
  max-width: none;
  margin: 0 0 20px;
  color: var(--h-ink);
  font-family: var(--h-display);
  font-weight: 500;
  font-size: clamp(18px, 1.8vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

#hero .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.hero-btn {
  --shadow: var(--h-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 26px;
  border: 2px solid var(--h-ink);
  border-radius: 999px;
  font: 600 16px/1.1 var(--font-sans);
  text-decoration: none;
  box-shadow: 0 4px 0 var(--shadow);
  transition: translate 0.35s var(--h-spring), box-shadow 0.25s, background-color 0.2s;
}

.hero-btn:hover {
  translate: 0 -3px;
  box-shadow: 0 7px 0 var(--shadow);
}

.hero-btn:active {
  translate: 0 3px;
  box-shadow: 0 1px 0 var(--shadow);
}

.hero-btn--ink {
  --shadow: var(--h-melon);
  background: var(--h-ink);
  color: #f4f0e6;
}

.hero-btn--ghost {
  background: transparent;
  color: var(--h-ink);
}

.hero-btn--ghost:hover {
  background: #ffcf3a;
}


@media (max-width: 900px) {
  #hero {
    --melon-size: min(60vw, 32svh);
    padding-top: 24px;
  }

  #hero .hero-title {
    align-self: start;
    margin-top: 12svh;
  }

  .hero-melon-fallback,
  #hero .hero-melon-hit {
    top: 52%;
  }


  #hero .hero-title {
    font-size: 13.4vw;
  }

  .hero-bottom {
    padding-bottom: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-word > span,
  #hero.is-boom,
  #hero.is-charging .hero-word {
    animation: none;
  }
}
