/* Typed custom properties so the gradient's position can be smoothly
   animated by a keyframe animation - plain (untyped) custom properties
   can't be interpolated, they'd just snap between values. */
@property --hero-gx {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}
@property --hero-gy {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

@keyframes hero-gradient-drift {
  0% {
    --hero-gx: 0%;
    --hero-gy: 0%;
  }
  50% {
    --hero-gx: 100%;
    --hero-gy: 35%;
  }
  100% {
    --hero-gx: 15%;
    --hero-gy: 100%;
  }
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100svh - 65px);
  display: flex;
  align-items: center;
  padding: clamp(64px, 12svh, 140px) 0;
}

.hero-pixel-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  display: none;
}
.hero.is-pixel-cam-active .hero-pixel-canvas {
  display: block;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(
      circle at var(--hero-gx) var(--hero-gy),
      color-mix(in srgb, var(--accent) 32%, transparent) 0%,
      color-mix(in srgb, var(--accent) 12%, transparent) 32%,
      transparent 62%
    ),
    var(--bg-light);
  animation: hero-gradient-drift 20s ease-in-out infinite alternate;

  @media (prefers-reduced-motion: reduce) {
    animation: none;
    --hero-gx: 0%;
    --hero-gy: 0%;
  }
}
/* Once the camera background is active, lighten/thin the scrim so the
   pixel art reads clearly while keeping the hero's dark text legible
   regardless of what's in frame. */
.hero.is-pixel-cam-active .hero-scrim {
  background:
    radial-gradient(
      circle at var(--hero-gx) var(--hero-gy),
      color-mix(in srgb, var(--accent) 55%, transparent) 0%,
      color-mix(in srgb, var(--accent) 30%, transparent) 45%,
      rgba(248, 250, 252, 0.6) 75%
    ),
    transparent;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: center;
  gap: 48px;

  @media (max-width: 900px) {
    grid-template-columns: 1fr;
  }
}

.title--hero {
  font-size: clamp(2.75rem, 6vw, 3.75rem);
  line-height: 1.02;
  /* "Pasquale" / "Mangialavori" is always 2 lines - preallocate exactly
     that in em units (tied to this element's own responsive font-size)
     so the layout below doesn't jump once type-writer finishes the
     second line. A fixed px height would drift out of sync with the
     clamp()'d font-size at different viewport widths.
     Note: 1.3, not this rule's own 1.02 line-height - the type-writer
     component renders into its own shadow DOM, which hardcodes
     `#type-write { line-height: 1.3; }` internally, ignoring this
     host rule's line-height entirely. */
  min-height: calc(2 * 1.3em);

  & type-writer {
    --font-family: "Space Grotesk", sans-serif;
    --font-size: clamp(2.75rem, 6vw, 3.75rem);
    --text-color: var(--ink-950);
    --playground-background: transparent;
    --cursor-width: 3px;
    --cursor-height: 0.85em;
    --cursor-color: var(--accent-on-light);
    cursor: pointer;
  }
}

.hero-tagline {
  max-width: 460px;
  margin-top: 20px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 26px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 160ms ease;

  &:hover {
    transform: translateY(-1px);
  }
  &:focus-visible {
    outline: 2px solid var(--ink-950);
    outline-offset: 3px;
  }
}
.button-primary {
  background: var(--accent-on-light);
  color: #fff;
}
.button-outline {
  border-color: var(--accent-on-light);
  color: var(--accent-on-light);
}

.card-panel {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.hero-feature {
  position: relative;
  background: linear-gradient(150deg, #0f172a 0%, #1c2b4a 100%);
  color: var(--ink-200);
  box-shadow: var(--shadow-card);
  will-change: transform;

  & h2 {
    margin: 18px 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 24px;
    line-height: 1.15;
  }
  & .accent {
    color: var(--accent);
  }
}

.hero-feature-gloss {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 65%);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.hero-feature-inner {
  position: relative;
  padding: 32px;
}

.status-badge {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-divider {
  height: 1px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  margin-bottom: 20px;
}

.feature-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.feature-metric + .feature-metric {
  border-left: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  padding-left: 14px;
  margin-left: 14px;
}
.feature-value {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 20px;

  & small {
    color: var(--ink-400);
    font-size: 11px;
    font-weight: 500;
  }
}
