/*##############################################################################
# Script:        styles-hero.css     (stylesheet, part of styles.css, loaded by frontend/index.html)
# Version:       1.01
# Created by:    Matthew Boucher
# Start date:    2026-09-10
# Location:      <project root>/frontend/css/styles-hero.css   (main script: <project root>/aiacolyte.py; subscripts: <project root>/subscripts/aiacolyte/)
# Description:   The hero of the AI Acolyte home page, the second of its three stylesheets (after
#                styles.css, before styles-sections.css): the wizard's workshop with the ambient
#                backdrop and star-dust, the heading with the two buttons beside it, the wizard, the
#                golden glows, the rune circle, the four holograms and the arcane terminal with its
#                spell colours, laid out for wide screens, tablets and phones. Uses the tokens and
#                keyframes of styles.css. Works with the main script, which serves it as
#                /static/css/styles-hero.css.
# Reads:         ../assets/img/ambient.webp; the tokens and keyframes of styles.css
# Writes:        nothing
# Sensitive:     none needed
# Arguments:     none (a stylesheet cannot take flags); aiacolyte.py --checkup confirms it is in place
# Changelog (last 15):
#   1.01  2026-09-10  First version: the hero part of styles.css 1.09, unchanged, moved here when styles.css was split (rule 9).
##############################################################################*/

/* ==========================================================================
   Hero: the wizard's workshop
   ========================================================================== */

.hero {
  --hero-h: clamp(700px, 100svh, 980px);
  position: relative;
  isolation: isolate;
  height: var(--hero-h);
  overflow: hidden;
  background: var(--ink-0);
}

.hero__ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(10, 8, 7, 0.7) 0%, transparent 18%, transparent 72%, var(--ink-1) 100%),
    linear-gradient(90deg, rgba(10, 8, 7, 0.94) 0%, rgba(10, 8, 7, 0.74) 34%, rgba(10, 8, 7, 0.38) 62%, rgba(10, 8, 7, 0.6) 100%),
    url("../assets/img/ambient.webp") center / cover no-repeat;
}

/* star-dust, borrowed from the wizard's hat */
.hero__ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, rgba(246, 216, 139, 0.9), transparent),
    radial-gradient(1px 1px at 140px 90px, rgba(246, 216, 139, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 80px 190px, rgba(255, 244, 214, 0.8), transparent),
    radial-gradient(1px 1px at 210px 150px, rgba(140, 200, 255, 0.8), transparent),
    radial-gradient(1px 1px at 250px 40px, rgba(246, 216, 139, 0.6), transparent);
  background-size: 280px 260px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%);
  mask-image: linear-gradient(180deg, #000, transparent 70%);
}

.hero__inner {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 1600px;
  margin-inline: auto;
  padding: var(--nav-h) var(--gutter) 0;
}

/* heading and intro on the left, the two buttons in a column to their right */
.hero__copy {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: auto auto;
  align-items: end;
  justify-content: start;
  column-gap: clamp(28px, 3vw, 48px);
  padding-bottom: 4vh;
}

.hero__text {
  max-width: min(540px, 40vw);
}

.hero h1 {
  margin-top: 18px;
  font-size: clamp(2.9rem, 5vw, 4.8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--parchment);
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

.hero h1 em {
  display: block;
}

.lede {
  max-width: 34ch;
  margin-top: 22px;
  font-size: clamp(1.2rem, 1.45vw, 1.42rem);
  line-height: 1.55;
  color: var(--text-dim);
}

.hero__cta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding-bottom: 0.3em;
}

.hero__runes {
  grid-column: 1 / -1;
  width: 0;          /* spans both columns without widening them */
  min-width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.hero__runes li + li::before {
  content: "✦";
  margin-inline: 0.9em;
  color: var(--gold-deep);
}

/* The scene is laid out in percentages of its own box, so the wizard,
   terminal and holograms keep their relationships at every size. */
.hero__scene {
  --scene-h: calc(var(--hero-h) - var(--nav-h));
  position: absolute;
  right: 0;
  bottom: 0;
  width: calc(var(--scene-h) * 1.18);
  height: var(--scene-h);
  container-type: inline-size; /* lets the terminal text scale with the scene (cqw) */
}

.hero__wizard {
  position: absolute;
  right: -8%;
  bottom: 0;
  z-index: 1;
  width: auto;
  max-width: none;
  height: 100%;
}

.hero__sparks {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}

.glow--pool {
  top: 64%;
  left: 27%;
  z-index: 1;
  width: 62%;
  aspect-ratio: 1.3;
  background: radial-gradient(closest-side, rgba(240, 190, 95, 0.3), rgba(227, 176, 75, 0.09) 50%, transparent 100%);
}

.glow--hand {
  top: 70%;
  left: 47.5%;
  z-index: 2;
  width: 16%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 222, 150, 0.5) 0%, rgba(227, 176, 75, 0.18) 38%, transparent 70%);
  animation: breathe 5s ease-in-out infinite;
}

.rune-circle {
  position: absolute;
  top: 87%;
  left: 5%;
  z-index: 1;
  width: 44%;
  aspect-ratio: 1;
  pointer-events: none;
  transform: translateY(-50%) perspective(900px) rotateX(74deg);
}

.rune-circle svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: rgba(246, 216, 139, 0.55);
  stroke-width: 0.8;
  filter: drop-shadow(0 0 4px rgba(227, 176, 75, 0.8));
  animation: spin 60s linear infinite;
}

.rune-circle text {
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 700;
  fill: rgba(246, 216, 139, 0.85);
  stroke: none;
}

/* Holograms */
.holo {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  animation: float 8s ease-in-out infinite, flicker 6s linear infinite;
}

.holo svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  fill: rgba(246, 216, 139, 0.06);
  stroke: #f8dd98;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px rgba(246, 216, 139, 0.9)) drop-shadow(0 0 14px rgba(227, 176, 75, 0.55));
}

.holo .fill {
  fill: #f8dd98;
  stroke: none;
}

.holo .soft {
  fill: rgba(246, 216, 139, 0.35);
  stroke: none;
}

.holo .soft-stroke {
  fill: none;
  stroke-opacity: 0.45;
}

.holo .arcane {
  fill: var(--arcane);
  stroke: none;
}

.holo--browser {
  top: 8%;
  left: 17%;
  width: 16%;
  animation-delay: 0s, -1s;
}

.holo--chat {
  top: 5%;
  left: 36%;
  width: 9%;
  animation-delay: -3s, -2.5s;
}

.holo--code {
  top: 32%;
  left: 13%;
  width: 10%;
  animation-delay: -5s, -4s;
}

.holo--neural {
  top: 30%;
  left: 31%;
  width: 10%;
  animation-delay: -2s, -1.5s;
}

/* The arcane terminal */
.terminal {
  position: absolute;
  top: 57%;
  left: 12%;
  z-index: 3;
  width: 30%;
  font-size: 1.15cqw;
  animation: hover-float 7s ease-in-out infinite;
}

/* wide screens: the terminal floats a little lower, clear of the hero buttons */
@media (min-width: 1101px) {
  .terminal {
    top: 66%;
    left: 15%;
  }
}

.terminal__frame {
  position: relative;
  padding: 0.85em 0.9em 1em;
  border-radius: 1em;
  background:
    linear-gradient(160deg, rgba(255, 226, 160, 0.35), transparent 30%),
    linear-gradient(145deg, #7a5a2c 0%, #3d2b15 38%, #24180b 68%, #5e4521 100%);
  box-shadow:
    inset 0 0 0 1px rgba(246, 216, 139, 0.35),
    0 0 3em rgba(227, 176, 75, 0.35),
    0 2.2em 3.5em rgba(0, 0, 0, 0.65);
}

.terminal__frame::before {
  content: "";
  position: absolute;
  inset: 0.35em;
  border: 1px solid rgba(246, 216, 139, 0.18);
  border-radius: 0.75em;
  pointer-events: none;
}

.terminal.is-cast .terminal__frame {
  animation: cast 1.4s var(--ease);
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0 0.2em 0.65em;
  font-family: var(--font-display);
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.terminal__bar i {
  width: 0.75em;
  height: 0.75em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffeab0, #c08a35 55%, #4a3210);
  box-shadow: 0 0 0.4em rgba(227, 176, 75, 0.6);
}

.terminal__bar span {
  margin-left: auto;
  opacity: 0.8;
}

.terminal__screen {
  position: relative;
  height: calc(6 * 1.55em + 1.7em);
  margin: 0;
  padding: 0.85em 1em;
  overflow: hidden;
  font: 500 1em/1.55 var(--font-mono);
  color: #e6dcc6;
  white-space: pre;
  text-shadow: 0 0 0.5em rgba(246, 216, 139, 0.35);
  background: radial-gradient(120% 100% at 50% 0%, rgba(91, 84, 201, 0.28), transparent 60%), #0b0a14;
  border-radius: 0.45em;
  box-shadow: inset 0 0 0 1px rgba(140, 200, 255, 0.18), inset 0 0 2.5em rgba(10, 8, 40, 0.9), 0 0 1.5em rgba(140, 200, 255, 0.12);
}

.terminal__screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px);
}

#spell {
  font: inherit;
  transition: opacity 0.5s;
}

#spell.is-fading {
  opacity: 0;
}

.terminal__caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: -0.2em;
  background: var(--gold-bright);
  box-shadow: 0 0 0.6em var(--gold);
  animation: blink 1s steps(1) infinite;
}

.tk-c { color: #9c8f75; font-style: italic; }
.tk-k { color: var(--arcane); }
.tk-s { color: var(--gold-bright); }
.tk-f { color: #f2b8a0; }
.tk-v { color: #efe6d2; }
.tk-p { color: #a99d86; }
.tk-a { color: #d6a8ff; }
.tk-o { color: var(--gold); }
.tk-g { color: #9fe0a8; }

@media (max-width: 1100px) {
  .hero {
    height: auto;
  }

  .hero__ambient {
    background:
      linear-gradient(180deg, rgba(10, 8, 7, 0.92) 0%, rgba(10, 8, 7, 0.62) 45%, rgba(10, 8, 7, 0.35) 75%, var(--ink-1) 100%),
      url("../assets/img/ambient.webp") center / cover no-repeat;
  }

  .hero__inner {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding-top: calc(var(--nav-h) + clamp(24px, 6vw, 56px));
  }

  .hero__copy {
    grid-template-columns: minmax(min-content, 620px) max-content;
    padding-bottom: 0;
  }

  .hero__text {
    max-width: none;
  }

  .hero__scene {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 780px;
    height: auto;
    aspect-ratio: 1.18;
    margin: 12px auto 0;
  }
}

@media (max-width: 640px) {
  .hero__copy {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__cta {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 30px;
    padding-bottom: 0;
  }

  .hero__scene {
    aspect-ratio: 0.95;
  }

  .hero__wizard {
    right: -10%;
  }

  .terminal {
    top: 70%;
    left: 1%;
    width: 42%;
    font-size: 1.58cqw;
  }

  .glow--hand {
    top: 70%;
    left: 36%;
    width: 26%;
  }

  .glow--pool {
    top: 80%;
    left: 22%;
    width: 70%;
  }

  .rune-circle {
    top: 94%;
    left: -4%;
    width: 58%;
  }

  .holo--browser {
    top: 8%;
    left: 2%;
    width: 26%;
  }

  .holo--chat {
    display: none;
  }

  .holo--code {
    top: 42%;
    left: 4%;
    width: 15%;
  }

  .holo--neural {
    top: 30%;
    left: 21%;
    width: 15%;
  }
}

/*##############################################################################
# End of styles-hero.css  v1.01
##############################################################################*/
