/* The hero: full-bleed, the headline on the start side, the live drawing's stage on the end side (stacked on narrow screens).
   The canvas sits behind it all and fades in; nothing waits for it. */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  /* A screen tall, less the header: the tap-tall row, its padding and its rule */
  min-block-size: clamp(600px, calc(100svh - var(--tap) - 2 * var(--space-3) - 1px), 900px);
  margin-inline: calc(-1 * var(--gutter));
  padding-block: 0;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}
.hero-cv {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  inline-size: 100%;
  block-size: 100%;
  opacity: 0;
  transition: opacity var(--dur-slower) var(--ease);
}
.hero.on .hero-cv { opacity: 1; }

.hero-in {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: var(--space-fluid-m);
  inline-size: 100%;
  max-inline-size: calc(var(--page-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.hero-text { align-self: center; padding-block: var(--space-fluid-xl); }
.hero-kicker { margin-block-end: var(--space-5); text-wrap: balance; }
.hero-sub {
  margin-block: var(--space-6) 0;
  max-inline-size: 38ch;
  font-size: var(--text-lead-lg);
  line-height: var(--leading-body);
  color: var(--muted);
}
.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  margin-block: var(--space-8) 0;
}
.hero-links a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--tap);
  font-size: var(--text-lg);
  text-decoration: none;
}
.hero-hello {
  padding-inline: var(--space-5);
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--bg);
  font-weight: var(--weight-semibold);
  transition: background-color var(--dur-fast) var(--ease);
}
.hero-hello:hover { background: var(--accent-text); }
.hero-links .hero-more {
  color: var(--text);
  font-weight: var(--weight-medium);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: var(--space-1-5);
  transition: text-decoration-color var(--dur-fast) var(--ease);
}
.hero-links .hero-more:hover { text-decoration-color: currentColor; }

/* The stage: where the product sits in the drawing. The hint and the error message lie on it */
.hero-stage { position: relative; min-block-size: 440px; }
.hero-hint, .hero-msg {
  position: absolute;
  margin: 0;
  font-family: var(--mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--muted);
}
.hero-hint {
  inset-block-end: var(--space-4);
  inset-inline-end: 0;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease);
}
.hero.on .hero-hint { opacity: 1; transition-delay: var(--delay-hint); }
.hero.touched .hero-hint { opacity: 0; transition-delay: 0s; }
.hero-hint .t { display: none; }
@media (hover: none) {
  .hero-hint .m { display: none; }
  .hero-hint .t { display: inline; }
}
.hero-msg { inset-inline: 0; inset-block-end: 50%; text-align: center; }

@media (prefers-reduced-motion: no-preference) {
  .hero-text > * { animation: hero-up var(--dur-slower) var(--ease) both; }
  .hero-text > :nth-child(2) { animation-delay: var(--dur-stagger); }
  .hero-text > :nth-child(3) { animation-delay: calc(2 * var(--dur-stagger)); }
  .hero-text > :nth-child(4) { animation-delay: calc(3 * var(--dur-stagger)); }
}
@keyframes hero-up { from { opacity: 0; transform: translateY(var(--space-4)); } }

@media (width < 900px) {
  .hero { min-block-size: 0; }
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero-text { padding-block: var(--space-fluid-l) 0; }
  .hero-stage { min-block-size: 0; block-size: min(122vw, 560px); }
  .hero-hint { inset-block: var(--space-2) auto; }
}
