/* ============================================================================
   Toloka Gopher TSR — Hero (ASCII 3D model + white/black ripple)
   ----------------------------------------------------------------------------
   Layout + chrome for the hero whose centrepiece is a GLB rendered as ASCII art
   on Toloka yellow, with a ripple of white/black glyphs travelling through it.
   The pixels are drawn by src/hero/ascii-hero.js into <canvas data-hero-canvas>.
   Colours come exclusively from tokens.css (--hero-* / --color-*).
   ========================================================================== */

.hero {
  position: relative;
  width: 100%;
  min-height: 100svh;
  background: var(--hero-bg);            /* yellow shows through empty glyph cells */
  overflow: hidden;
  isolation: isolate;                    /* keep the ASCII stage behind the copy   */
}

/* The ASCII stage fills the section; the renderer appends its canvas here. */
.hero__stage {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Loading + fallback states the renderer toggles via [data-hero-state]. */
.hero__status {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: var(--fs-ui);
  letter-spacing: .08em;
  color: var(--color-ink);
  text-align: center;
  white-space: pre;
  pointer-events: none;
  transition: opacity .4s ease;
}
.hero__status[hidden] { display: none; }

/* Hero copy sits above the ASCII stage. Kept minimal on the test page. */
.hero__content {
  position: relative;
  z-index: 2;
  max-width: var(--container-max);
  margin-inline: auto;
  padding: clamp(48px, 12vh, 160px) var(--container-pad) var(--space-12);
  pointer-events: none;                  /* clicks fall through to the stage       */
}
.hero__content > * { pointer-events: auto; }

.hero__eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-ink);
  background: rgba(255, 255, 255, .55);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(2px);
}

.hero__headline {
  margin: var(--space-5) 0 0;
  max-width: 16ch;
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  font-size: clamp(var(--fs-h1), 7vw, var(--fs-display-m));
  line-height: var(--lh-tight);
  color: var(--color-ink);
  /* Lift the headline off the busy ASCII field for legibility. */
  text-shadow: 0 1px 0 rgba(255, 225, 106, .9), 0 2px 18px rgba(255, 225, 106, .9);
}

.hero__sub {
  margin: var(--space-5) 0 0;
  max-width: 46ch;
  font-family: var(--font-sans);
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
  color: var(--color-ink);
  text-shadow: 0 1px 10px rgba(255, 225, 106, .9);
}

/* Dev HUD (test page only) — tiny tuner for the ripple/grid params. */
.hero__hud {
  position: absolute;
  right: var(--space-4);
  bottom: calc(var(--space-4) + 52px); /* float above the toggle icon */
  z-index: 3;
  display: grid;
  gap: 6px;
  padding: var(--space-3) var(--space-4);
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 12px;
  color: var(--color-ink);
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(30, 31, 39, .15);
  border-radius: var(--radius-md);
  backdrop-filter: blur(3px);
}
.hero__hud label { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.hero__hud input[type="range"] { width: 130px; }
.hero__hud select { font: inherit; }
.hero__hud[hidden] { display: none; }

/* Character-set editor — full-width monospace field. */
.hero__hud-wide { flex-direction: column; align-items: stretch; gap: 4px; }
.hero__hud input[type="text"] {
  width: 100%;
  padding: 5px 7px;
  font: 13px "Courier New", ui-monospace, monospace;
  letter-spacing: .12em;
  color: var(--color-ink);
  background: #fff;
  border: 1px solid rgba(30, 31, 39, .25);
  border-radius: 6px;
}

/* Save-preset button. */
.hero__hud-save {
  margin-top: 4px;
  padding: 7px 10px;
  font: var(--fw-semibold) 13px var(--font-sans);
  color: var(--color-ink);
  background: var(--color-accent);
  border: 1px solid rgba(30, 31, 39, .25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--btn-transition);
}
.hero__hud-save:hover { filter: brightness(.97); }
.hero__hud-save:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Toggle icon — reveals the render-options panel. Reposition on the final page. */
.hero__hud-toggle {
  position: absolute;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 4;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--color-ink);
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(30, 31, 39, .15);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(3px);
  cursor: pointer;
  transition: var(--btn-transition);
}
.hero__hud-toggle:hover { background: rgba(255, 255, 255, .85); }
.hero__hud-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }

@media (prefers-reduced-motion: reduce) {
  .hero__status { transition: none; }
}
