/* Z order: ensō (0) → .hero-fade (1) → .hero-stage (2). The ensō sits OUTSIDE
   .hero-stage so the fade can blend the circle into the page without dimming
   the copy on top of it. */

.hero{
  position: relative;
  display: flex; flex-direction: column;
  min-height: calc(100dvh - var(--topbar-h));
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 44%, var(--hero-glow) 0%, var(--paper) 64%);
}

.hero-stage{
  position: relative; z-index: 2;
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: clamp(18px, 3.2vh, 56px);
  /* The stack is centred vertically, so the extra 20px at the bottom lifts it by
     half that — 10px — and clears the CTA off the fold. Narrow screens only: the
     760px block below overrides padding outright. */
  padding: clamp(20px, 3vh, 48px) 20px clamp(60px, calc(6vh + 20px), 98px);
  text-align: center;
  pointer-events: none;
}
.hero-stage > *{ pointer-events: auto; }

.enso{
  position: absolute; left: 50%; top: 58%;
  width: min(72dvh, 96vw, 820px);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  --px: -52%; --py: -8%; --pz: 1;
}
.enso img{
  position: absolute; left: 50%; top: 50%; width: 100%; height: auto;
  transform: translate(-50%, -50%);
}

/* The conic mask starts at the gap in the brush stroke, which sits at 53°–72°
   in enso.webp — hence `from 73deg`. A new ensō image needs this recomputed. */
.enso-stroke{
  opacity: .9;
  --sweep: 378deg;  /* full circle when the animation never runs */
  -webkit-mask-image: conic-gradient(from 73deg, #000 0deg, #000 var(--sweep), rgba(0,0,0,0) calc(var(--sweep) + 9deg));
          mask-image: conic-gradient(from 73deg, #000 0deg, #000 var(--sweep), rgba(0,0,0,0) calc(var(--sweep) + 9deg));
}

.enso-ghost{ opacity: 0; }
.enso-ghost--1{ --o: .09;  --y: -31px; --rot: -8deg;  --sc: 1.13; --b: 4px;  }
.enso-ghost--2{ --o: .055; --y: -62px; --rot: -26deg; --sc: 1.27; --b: 9px;  }
.enso-ghost--3{ --o: .03;  --y: -92px; --rot: -52deg; --sc: 1.40; --b: 16px; }

.hero-eyebrow{
  display: flex; align-items: center; gap: clamp(12px, 2.6vw, 38px);
  width: 100%; max-width: 1180px;
}
.hero-eyebrow .line{
  flex: 1; height: 1px;
  background: linear-gradient(to right, rgb(var(--paper-rgb) / 0), var(--rule));
  transform-origin: right;
}
.hero-eyebrow .line:last-child{
  background: linear-gradient(to left, rgb(var(--paper-rgb) / 0), var(--rule));
  transform-origin: left;
}
.hero-eyebrow .mono{
  font-family: var(--font-label);
  font-weight: 500;
  font-size: clamp(var(--fs-300), 2.4vw, 30px);
  letter-spacing: .3em;
  color: var(--ink-soft);
  opacity: .85;
  white-space: nowrap;
}

/* The only size on the page derived from vh, deliberately: this is a decorative
   glyph (the block carries role="img" + aria-label) meant to fill the first
   screen. Readable text never scales with vh — it ignores zoom (WCAG 2.2
   SC 1.4.4). Base stacks the characters, they do not fit side by side. */
.kakejiku{
  display: grid; justify-items: center; gap: 0;
  font-family: var(--font-brush);
  font-size: min(clamp(64px, 12.5vh, 120px), 34vw);
  line-height: .94;
  color: var(--ink);
  text-shadow: 0 0 50px rgb(var(--paper-rgb) / .85);
}
.kakejiku .kchar{ display: block; }
.kakejiku .kchar--accent{ color: var(--vermilion); }

.hero-subtitle{
  display: grid; gap: clamp(10px, 1.6vh, 18px);
}
.hero-subtitle h1{
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center;
  gap: clamp(12px, 1.6vw, 22px);
  line-height: 1;
}
.title-aikido{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(48px, 8vw, 88px);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.hero-subtitle h1 .place-name{
  font-family: var(--font-label);
  font-weight: 500;
  font-size: clamp(28px, 5vw, 52px);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
/* Base breaks onto three lines: below ~600px the phrase does not fit on one,
   and letterspaced caps do not take a break mid-phrase. */
.hero-subtitle p{
  font-family: var(--font-label);
  font-weight: 500;
  font-size: var(--fs-200);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: .62;
  line-height: 1.6;
  white-space: normal;
}
.hero-subtitle p .sep{ display: none; }
.hero-subtitle p .pron,
.hero-subtitle p .mean{ display: block; }
.hero-subtitle p .mean{ margin-top: 2px; }

.hero-cta{
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: clamp(14px, 2vw, 28px);
}
.hero-cta-lead{
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--fs-500);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
}

.hero-fade{
  position: absolute; left: 0; right: 0; bottom: 0; height: 26vh; z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgb(var(--paper-rgb) / 0) 0%,
    rgb(var(--paper-rgb) / .8) 60%,
    var(--paper) 100%);
}

/* 601px — the lockup fits one line and the separator comes back. */
@media (min-width: 601px){
  .hero-subtitle p{ white-space: nowrap; }
  .hero-subtitle p .sep{ display: inline; }
  .hero-subtitle p .pron,
  .hero-subtitle p .mean{ display: inline; }
  .hero-subtitle p .mean{ margin-top: 0; }
}

/* 760px — hero takes exactly the rest of the first screen, kanji go horizontal,
   the ensō parks on the right and .hero-stage moves onto a layer above it. */
@media (min-width: 760px){
  .hero{
    display: block;
    height: calc(100dvh - var(--topbar-h));
    min-height: 560px;
  }
  .hero-stage{
    position: absolute; inset: 0;
    gap: clamp(30px, 5.5vh, 56px);
    padding: clamp(24px, 5vh, 56px) clamp(20px, 5vw, 80px) clamp(48px, 7vh, 78px);
  }
  .enso{ --px: 14%; --py: -44%; --pz: 1.08; }
  .kakejiku{
    display: flex; align-items: center; justify-content: center;
    gap: clamp(28px, 4.2vw, 72px);
    font-size: clamp(170px, 30vh, 340px);
    line-height: .82;
    text-shadow: 0 0 60px rgb(var(--paper-rgb) / .85);
  }
}

/* Timeline. All delays run from load with fill-mode `both`; the
   prefers-reduced-motion block in 09-utilities.css cuts it all to 0.01ms. */
.hero-eyebrow{ opacity: 0; animation: hero-rise .9s ease-out .15s both; }
.hero-eyebrow .line{ animation: hero-line-grow 1.6s cubic-bezier(.22,.8,.25,1) .3s both; }

.enso{ animation: enso-park 2.4s cubic-bezier(.3,.7,.2,1) 2.9s both; }
.enso-stroke{
  animation:
    enso-draw  2.1s cubic-bezier(.55,.05,.35,1) .35s both,
    enso-brush 2.6s cubic-bezier(.22,.8,.25,1)  .35s both,
    enso-dim   1.6s ease-out                    2.35s both;
}

/* The drift has no fill-mode on purpose — its from-state would override the
   entry transform before it even starts. */
.enso-ghost--1{
  animation: enso-ghost-in 1.5s cubic-bezier(.22,.85,.25,1) 2.14s both,
             enso-ghost-drift 11s ease-in-out 4.2s infinite alternate;
}
.enso-ghost--2{
  animation: enso-ghost-in 1.5s cubic-bezier(.22,.85,.25,1) 2.32s both,
             enso-ghost-drift 13s ease-in-out 4.3s infinite alternate;
}
.enso-ghost--3{
  animation: enso-ghost-in 1.5s cubic-bezier(.22,.85,.25,1) 2.5s both,
             enso-ghost-drift 15s ease-in-out 4.4s infinite alternate;
}

.kakejiku .kchar{ opacity: 0; animation: hero-kanji-in 1.1s cubic-bezier(.22,.8,.25,1) both; }
.kakejiku .kchar:nth-child(1){ animation-delay: 2.4s; }
.kakejiku .kchar:nth-child(2){ animation-delay: 2.62s; }
.kakejiku .kchar:nth-child(3){ animation-delay: 2.84s; }

.hero-subtitle{ opacity: 0; animation: hero-rise .9s cubic-bezier(.22,.8,.25,1) 3.15s both; }
.hero-cta{ opacity: 0; animation: hero-rise .9s cubic-bezier(.22,.8,.25,1) 3.5s both; }

@keyframes enso-draw{
  from{ --sweep: 0deg; }
  to{ --sweep: 378deg; }
}
@keyframes enso-brush{
  from{ transform: translate(-50%, -50%) rotate(-9deg) scale(1.07); }
  to{ transform: translate(-50%, -50%) rotate(0deg) scale(1); }
}
@keyframes enso-dim{
  from{ opacity: .9; }
  to{ opacity: .16; }
}
@keyframes enso-park{
  from{ transform: translate(-50%, -50%) scale(1); }
  to{ transform: translate(var(--px), var(--py)) scale(var(--pz)); }
}
@keyframes enso-ghost-in{
  from{ opacity: 0; transform: translate(-50%, -50%) rotate(0deg) scale(1); filter: blur(0); }
  to{ opacity: var(--o); transform: translate(-50%, calc(-50% + var(--y))) rotate(var(--rot)) scale(var(--sc)); filter: blur(var(--b)); }
}
@keyframes enso-ghost-drift{
  from{ transform: translate(-50%, calc(-50% + var(--y))) rotate(var(--rot)) scale(var(--sc)); }
  to{ transform: translate(-50%, calc(-50% + var(--y) - 8px)) rotate(calc(var(--rot) - 2deg)) scale(calc(var(--sc) * 1.04)); }
}
@keyframes hero-kanji-in{
  from{ opacity: 0; transform: translateY(26px) scale(.97); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes hero-rise{
  from{ opacity: 0; transform: translateY(12px); }
  to{ opacity: 1; transform: translateY(0); }
}
@keyframes hero-line-grow{
  from{ transform: scaleX(0); }
  to{ transform: scaleX(1); }
}
