/* The opening scene. hero.js drives the drawing; this file lays out the stage
   and the words over it. Without JavaScript the scene rests in its last frame. */
.hero {
  position: relative;
  min-height: max(620px, 100svh);
  display: grid;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--sumi, #0c0c0e);
  color: var(--on-dark, #f8f7f4);
}
.hero-stage {
  position: absolute;
  inset: 0;
}
.hero-svg {
  display: block;
  width: 100%;
  height: 100%;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(12, 12, 14, 0.9) 0%, rgba(12, 12, 14, 0.6) 30%, rgba(12, 12, 14, 0) 54%),
    linear-gradient(0deg, rgba(12, 12, 14, 0.75) 0, rgba(12, 12, 14, 0) 20%);
  transition: opacity 0.9s ease;
}

/* drawing details */
.h-trail {
  stroke: var(--shu, #e3232c);
  stroke-width: 40;
}
#h-kanji {
  color: var(--shu, #e3232c);
}
.h-core {
  stroke: #ffd2c8;
  stroke-width: 9;
}
.h-trail,
.h-core,
.h-kj {
  opacity: 0;
}
.h-doll,
#h-eyes,
.h-bob {
  transform-box: fill-box;
  transform-origin: center;
}

/* words */
.hero-copy {
  position: relative;
  z-index: 2;
  width: min(47%, 780px);
  padding: 128px 0 150px var(--pad, 22px);
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  font-size: clamp(0.69rem, 0.91vw, 0.8rem);
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-mute, #b5b1a8);
}
.hero-eyebrow span {
  width: 34px;
  height: 2px;
  background: var(--shu, #e3232c);
}
.hero h1 {
  margin: 0;
  font-size: clamp(46px, 5.9vw, 104px);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.072em;
}
.hero h1 span {
  color: var(--shu, #e3232c);
}
.hero-intro {
  max-width: 37ch;
  margin: 26px 0 32px;
  font-size: clamp(16px, 1.2vw, 21px);
  line-height: 1.65;
  letter-spacing: -0.025em;
  color: #d9d6ce;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}
.hero-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 15px 26px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
  background: var(--shu-deep, #b4161f);
  box-shadow: 0 0 0 1px rgba(255, 106, 92, 0.35), 0 14px 40px -12px rgba(227, 35, 44, 0.7);
  transition:
    background 0.2s,
    transform 0.2s;
}
.hero-button:hover {
  background: #c81c26;
  transform: translateY(-2px);
}
.hero-play {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}
.hero-replay {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 2px;
  border: 0;
  background: none;
  color: var(--on-dark, #f8f7f4);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(248, 247, 244, 0.35);
  text-underline-offset: 6px;
  transition: text-decoration-color 0.2s;
}
.hero-replay:hover {
  text-decoration-color: currentColor;
}
.hero-replay svg {
  color: var(--shu-glow, #ff6a5c);
}
.hero-replay[hidden],
.hero-skip[hidden] {
  display: none;
}
.hero a:focus-visible,
.hero button:focus-visible {
  outline: 3px solid #7fb4ea;
  outline-offset: 5px;
}

.hero-plate {
  position: absolute;
  z-index: 2;
  right: var(--pad, 22px);
  bottom: 92px;
  max-width: 30ch;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: right;
}
.hero-plate span {
  margin-right: 8px;
  font-family: var(--mincho, serif);
  font-size: 1.12rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--shu-glow, #ff6a5c);
}
.hero-plate small {
  display: block;
  margin-top: 4px;
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--on-dark-mute, #b5b1a8);
}

.hero-foot {
  position: absolute;
  z-index: 2;
  left: var(--pad, 22px);
  right: var(--pad, 22px);
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 0 22px;
  border-top: 1px solid var(--rule-dark, rgba(248, 247, 244, 0.16));
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.095em;
  text-transform: uppercase;
  color: var(--on-dark-mute, #b5b1a8);
}
.hero-foot b {
  padding: 0 7px;
  color: var(--shu-glow, #ff6a5c);
}
.hero-chant {
  display: flex;
  gap: 0.62em;
  font-family: var(--mincho, serif);
  font-size: 1.02rem;
  font-weight: 400;
  letter-spacing: 0;
  color: #e9e5dc;
}
.hero-chant i {
  font-style: normal;
  transition:
    color 0.5s,
    opacity 0.3s,
    transform 0.3s;
}

.hero-card {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  display: none;
  margin: 0;
  writing-mode: vertical-rl;
  transform: translate(calc(-50% - min(34vw, 430px)), -50%);
  font-family: var(--mincho, serif);
  font-size: clamp(34px, 4.6vw, 70px);
  letter-spacing: 0.22em;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: none;
}
.hero-card b {
  font-family: var(--sans, sans-serif);
  font-size: 0.2em;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--shu-glow, #ff6a5c);
}

.hero-skip {
  position: absolute;
  z-index: 3;
  top: 22px;
  right: var(--pad, 22px);
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid rgba(248, 247, 244, 0.35);
  background: rgba(12, 12, 14, 0.5);
  color: var(--on-dark, #f8f7f4);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.hero-skip:hover {
  border-color: var(--on-dark, #f8f7f4);
}

/* While the scene plays, the words wait. `intro-pending` is set in the page
   head so nothing flashes before hero.js takes over. */
.intro-pending .hero-stage {
  opacity: 0;
}
.intro-pending .mast {
  opacity: 0;
  pointer-events: none;
}
.intro-pending .hero-copy,
.intro-pending .hero-plate,
.intro-pending .hero-scrim,
.intro-pending .hero-foot,
.hero--intro .hero-copy,
.hero--intro .hero-plate,
.hero--intro .hero-scrim,
.hero--intro .hero-foot > span:first-child {
  opacity: 0;
  pointer-events: none;
}
.hero--intro .hero-foot {
  justify-content: center;
  border-top-color: transparent;
}
.hero--intro .hero-foot > span:first-child {
  display: none;
}
.hero--intro .hero-chant {
  font-size: clamp(1.15rem, 2.6vw, 2rem);
  gap: clamp(0.4em, 1.6vw, 0.8em);
}
.hero--intro .hero-chant i {
  opacity: 0.22;
}
.hero--intro .hero-chant i.on {
  opacity: 1;
}
.hero--intro .hero-chant i.now {
  color: var(--shu-glow, #ff6a5c);
  transform: scale(1.35);
}
.hero--intro .hero-card {
  display: block;
  opacity: 0;
  transition: opacity 0.5s;
}
.hero--intro[data-scene="wide"] .hero-card {
  opacity: 1;
  transition-delay: 0.25s;
}

@media (prefers-reduced-motion: no-preference) {
  .hero--done .hero-copy > *,
  .hero--done .hero-plate {
    animation: hero-arrive 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero--done .hero-copy > :nth-child(2) {
    animation-delay: 0.08s;
  }
  .hero--done .hero-copy > :nth-child(3) {
    animation-delay: 0.16s;
  }
  .hero--done .hero-copy > :nth-child(4) {
    animation-delay: 0.24s;
  }
  .hero--done .hero-plate {
    animation-delay: 0.4s;
  }
  .hero--done .h-bob {
    animation: hero-bob 5.5s ease-in-out infinite alternate;
  }
  .hero--done .h-doll:nth-child(2) .h-bob {
    animation-duration: 6.8s;
    animation-delay: -2s;
  }
  .hero--done .h-doll:nth-child(3) .h-bob {
    animation-duration: 7.4s;
    animation-delay: -4s;
  }
  .hero--done .h-doll:nth-child(4) .h-bob {
    animation-duration: 6.1s;
    animation-delay: -1s;
  }
  .hero--done #h-latglow-c {
    animation: hero-breathe 4.2s ease-in-out infinite alternate;
  }
  .hero--done #h-eyes {
    animation: hero-blink 6.5s infinite;
  }
  .hero--done .h-star-tw {
    animation: hero-twinkle 3.6s ease-in-out infinite alternate;
  }
  .hero--away * {
    animation-play-state: paused !important;
  }
}
@keyframes hero-arrive {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}
@keyframes hero-bob {
  from {
    transform: translateY(-9px) rotate(-5deg);
  }
  to {
    transform: translateY(9px) rotate(6deg);
  }
}
@keyframes hero-breathe {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}
@keyframes hero-blink {
  0%,
  95.5%,
  100% {
    transform: scaleY(1);
  }
  97.5% {
    transform: scaleY(0.08);
  }
}
@keyframes hero-twinkle {
  from {
    opacity: 0.2;
  }
}

@media (max-width: 820px), (max-aspect-ratio: 1/1) {
  .hero {
    align-items: end;
  }
  .hero-scrim {
    background: linear-gradient(0deg, rgba(12, 12, 14, 0.97) 0, rgba(12, 12, 14, 0.9) 36%, rgba(12, 12, 14, 0) 60%);
  }
  .hero-copy {
    width: auto;
    padding: 0 var(--pad, 22px) 84px;
  }
  .hero-eyebrow {
    gap: 9px;
    margin-bottom: 16px;
    font-size: 0.66rem;
  }
  .hero-eyebrow span {
    width: 22px;
  }
  .hero h1 {
    font-size: clamp(42px, 11vw, 72px);
  }
  .hero-intro {
    margin: 16px 0 20px;
    max-width: 40ch;
    font-size: 0.98rem;
    line-height: 1.56;
  }
  .hero-button {
    min-height: 46px;
    padding: 12px 18px;
    font-size: 0.84rem;
  }
  .hero-plate {
    display: none;
  }
  .hero-foot {
    padding: 12px 0 14px;
    font-size: 0.6rem;
  }
  .hero-foot b {
    padding: 0 3px;
  }
  .hero-chant {
    gap: 0.3em;
    font-size: 0.8rem;
  }
  .hero-card {
    top: 13%;
    left: var(--pad, 22px);
    transform: none;
    font-size: clamp(30px, 9vw, 46px);
  }
  .hero-skip {
    top: 14px;
  }
}
@media (max-width: 345px) {
  .hero-chant {
    display: none;
  }
  .hero--intro .hero-chant {
    display: flex;
  }
}
