/* ==========================================================================
   Hero — nav, wordmark + bishop, tagline, scroll cue
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Nav (fixed): brand mark + wordmark | motion toggle. Nothing else.
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  border-radius: 6px;
}

.brand__mark {
  height: 14px;
  width: auto;
  flex: none;
  filter: drop-shadow(0 0 7px rgba(250, 95, 196, .5));
}

.brand__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(.6rem, 1.35vw, .72rem);
  letter-spacing: var(--track-wordmark);
  color: #fff;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   2. Motion toggle — liquid-glass pill
   -------------------------------------------------------------------------- */
.motion-toggle {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .52rem .92rem;
  border-radius: 999px;
  cursor: pointer;

  background: rgba(255, 255, 255, .045);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid var(--hairline);
  box-shadow:
    0 6px 22px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(255, 255, 255, .08);

  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .58rem;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  font-variant-caps: all-small-caps;
  color: var(--ink-soft);

  transition:
    transform    .3s var(--ease-ui),
    box-shadow   .3s var(--ease-ui),
    border-color .3s var(--ease-ui),
    background   .3s var(--ease-ui),
    color        .3s var(--ease-ui);
}

/* top sheen */
.motion-toggle::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 52%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, .17),
    rgba(255, 255, 255, .02) 60%,
    rgba(255, 255, 255, 0)
  );
  pointer-events: none;
  z-index: -1;
}

.motion-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .075);
  border-color: rgba(250, 95, 196, .42);
  color: var(--whitehot);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, .6),
    0 0 24px rgba(250, 95, 196, .26),
    inset 0 1px 0 rgba(255, 255, 255, .14);
}

.motion-toggle:active { transform: translateY(0); }

.motion-toggle:focus-visible {
  outline: 2px solid var(--icy);
  outline-offset: 3px;
}

.motion-toggle__dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 8px rgba(250, 95, 196, .9);
}

/* dot reads as "resting" while motion is off */
:root[data-motion='off'] .motion-toggle__dot {
  background: rgba(250, 95, 196, .42);
  box-shadow: none;
}

.motion-toggle__label { white-space: nowrap; }

/* --------------------------------------------------------------------------
   3. Hero shell — row 1 centres the stage, row 2 pins the scroll cue
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  gap: clamp(1rem, 3vh, 2rem);
  padding:
    calc(var(--nav-h) + 1.25rem)
    var(--gutter)
    clamp(1.25rem, 4vh, 2.25rem);
  overflow: hidden;                 /* the wordmark is wider than the viewport */
}

.hero__center {
  position: relative;
  z-index: 10;              /* above the halos */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 4.5vh, 3rem);
  width: 100%;
}

/* --------------------------------------------------------------------------
   4. The piece.
   Geometry, glow and wordmark treatment are taken from the Claude Design
   export ("Bishop Landing.dc.html") so this matches the original hero. The
   page background stays a flat --bg: the export paints a radial gradient
   there, which the brand rules rule out. Its midpoint is #07060c anyway.
   -------------------------------------------------------------------------- */

/* 4a. Dusk halos — the glow is these, not a drop-shadow on the piece. */
.hero__halo {
  position: absolute;
  left: 50%;
  /* Centred via `transform`, NOT the standalone `translate` property: GSAP
     takes over `transform` to animate scale and writes `translate:none`
     alongside it. Keeping the centring inside `transform` means GSAP folds
     it into its own matrix instead of cancelling it. */
  transform: translate(-50%, -50%);
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: .6;            /* parked value; the pulse rides 0.5 -> 0.78 */
}

.hero__halo--violet {
  top: 48%;
  width: 46vh;
  height: 60vh;
  min-width: 460px;
  min-height: 560px;
  background: radial-gradient(50% 50% at 50% 50%,
    rgba(158, 88, 197, .40) 0%,
    rgba(120, 60, 230, .16) 40%,
    rgba(80, 40, 180, 0)    72%);
  filter: blur(22px);
}

.hero__halo--pink {
  top: 54%;
  width: 30vh;
  height: 40vh;
  min-width: 300px;
  min-height: 380px;
  background: radial-gradient(50% 50% at 50% 50%,
    rgba(250, 95, 196, .24) 0%,
    rgba(250, 95, 196, 0)  66%);
  filter: blur(28px);
}

/* 4b. Stage */
.hero__stage {
  position: relative;
  z-index: 10;
  /* Export says min(1180px, 96vw); 100% is the same 1180 at desktop widths but
     measures the content box, so it respects the gutter and ignores the
     scrollbar instead of overflowing narrow viewports by a few px. */
  width: min(1180px, 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__wordmark {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  z-index: 1;

  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(96px, 16.5vw, 236px);
  letter-spacing: .02em;
  line-height: .9;
  white-space: nowrap;
  user-select: none;

  /* Already muted at full opacity — this is the export's exact ramp. */
  background-image: linear-gradient(178deg, #4d4575 0%, #372f58 50%, #241f3c 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* contact shadow under the piece */
.hero__ground {
  position: absolute;
  left: 50%;
  top: 58%;
  translate: -50% -50%;
  z-index: 2;
  width: 360px;
  height: 150px;
  background: radial-gradient(50% 50% at 50% 50%,
    rgba(0, 0, 0, .6) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(8px);
  pointer-events: none;
}

/* 4c. The piece itself. The media is deliberately taller than the frame and
   top-aligned; the frame clips it and .hero__fade dissolves the base. */
.hero__figure {
  position: relative;
  z-index: 3;
  height: var(--piece-h);
  max-width: 100%;          /* backstop: crop before overflowing the stage */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.hero__media {
  height: 132%;
  width: auto;
  object-fit: contain;
  object-position: top center;
  display: block;
  transform: translateY(-2%);
  background: transparent;
  pointer-events: none;
  filter: url(#blackKey);
}

.hero__fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background: linear-gradient(180deg,
    rgba(7, 6, 12, 0)   0%,
    rgba(7, 6, 12, .85) 70%,
    var(--bg)          100%);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   5. Rotating tagline — both lines share one grid cell, so no layout shift
   -------------------------------------------------------------------------- */
.tagline {
  display: grid;
  place-items: center;
  max-width: 44ch;
  text-align: center;
  text-wrap: balance;
}

.tagline__line {
  grid-area: 1 / 1;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(.875rem, 1.65vw, 1.06rem);
  line-height: 1.55;
  letter-spacing: .005em;
  color: var(--icy);
  opacity: 0;
}

/* no-JS / pre-boot fallback: first line visible */
.tagline__line:first-child { opacity: 1; }

/* --------------------------------------------------------------------------
   6. Scroll cue — board, notation, SCROLL, chevron
   -------------------------------------------------------------------------- */
.scroll-cue {
  position: relative;
  z-index: 10;              /* above the halos */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .72rem;
}

/* 6a. 5x5 board, drawn as a CSS checker tile (no square elements needed) */
.board {
  --sq: calc(var(--board-size) / var(--board-cells));
  position: relative;
  width: var(--board-size);
  height: var(--board-size);
  border-radius: 3px;
  overflow: hidden;
  background-color: var(--square-dark);
  background-image: conic-gradient(
    var(--square-light) 0 25%,
    var(--square-dark)  0 50%,
    var(--square-light) 0 75%,
    var(--square-dark)  0
  );
  background-size: calc(var(--sq) * 2) calc(var(--sq) * 2);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .05),
    0 6px 18px rgba(0, 0, 0, .5);
}

/* the b-file column: index 1 from the left */
.board__moon,
.board__trail {
  position: absolute;
  top: 0;
  left: calc(var(--sq) * 1);
  width: var(--sq);
  height: var(--sq);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.board__moon { z-index: 2; }

.board__moon img {
  height: 8px;
  width: auto;
  filter: drop-shadow(0 0 5px rgba(250, 95, 196, .85));
}

/* fading dusk trail left behind on each square; --r is the rank index 0..3 */
.board__trail {
  top: calc(var(--sq) * var(--r, 0));
  z-index: 1;
  opacity: 0;
}

.board__trail::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(250, 95, 196, .85) 0%,
    rgba(174, 62, 129, .45) 45%,
    rgba(174, 62, 129, 0) 72%
  );
}

/* 6b. notation — both "b" characters hot pink, the rest muted twilight blue */
.notation {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: .6rem;
  letter-spacing: var(--track-label);
  color: var(--ink-muted);
}

.notation__file { color: var(--pink); }

/* 6c. SCROLL — slow signature-gradient specular sweep */
.scroll-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .62rem;
  letter-spacing: var(--track-scroll);
  text-indent: var(--track-scroll);
  user-select: none;

  background-image: linear-gradient(
    100deg,
    rgba(171, 200, 255, .45)  0%,
    rgba(171, 200, 255, .45) 38%,
    var(--pink)              45%,
    var(--orchid)            50%,
    var(--violet)            55%,
    var(--twilight)          60%,
    rgba(171, 200, 255, .45) 67%,
    rgba(171, 200, 255, .45) 100%
  );
  /* At 300% the sweep must stay inside 0%-100% of background-position, or the
     image slides off the word and the uncovered letters vanish entirely. */
  background-size: 300% 100%;
  background-position: 50% 0;        /* parked = motion-off state */
  background-repeat: no-repeat;

  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* 6d. double chevron */
.chevron {
  width: 16px;
  height: 13px;
  color: var(--orchid);
  opacity: .45;
  overflow: visible;
}

.chevron path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   7. Wayfinding placeholder — reserved space, nothing visible
   -------------------------------------------------------------------------- */
#wayfinding {
  min-height: 40vh;
}

/* --------------------------------------------------------------------------
   8. Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  /* The wordmark stays next to the crescent on mobile. It is tightened, not
     dropped — see the narrow breakpoint below for where it finally gives up. */
  .brand__word {
    font-size: .58rem;
    letter-spacing: .26em;
  }

  .hero__wordmark {
    font-size: clamp(2.75rem, 22vw, 7rem);
  }

  .motion-toggle {
    /* Never let the pill be squeezed: it has overflow:hidden and nowrap copy,
       so shrinking it silently chops "TURN OFF MOTION" mid-word. The brand
       lockup yields instead. */
    flex: none;
    padding: .46rem .78rem;
    font-size: .54rem;
  }

  .tagline { max-width: 32ch; }
}

/* Narrow phones: tighten the lockup so the wordmark keeps its place beside
   the pill rather than being dropped. Measured to fit at 320px. */
@media (max-width: 400px) {
  :root { --gutter: 1rem; }

  .brand { gap: .45rem; }

  .brand__word {
    font-size: .55rem;
    letter-spacing: .2em;
  }
}

/* Narrower than any real device. Past here the two cannot coexist without
   clipping, so the crescent carries the brand on its own. */
@media (max-width: 309px) {
  .brand__word { display: none; }
}
