/* =====================================================================
 * Aware — Hero Chess "Next Move" composition
 * Quiet visual aid — sits beside hero copy, never competes with it.
 * Digital · Intelligence · Strategy.
 * ===================================================================== */

#hero-chess {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  margin-left: auto;          /* hug the right edge */
  margin-right: 0;
  /* Quiet atmosphere — barely-there gold rim */
  filter: drop-shadow(0 0 40px rgba(255, 194, 51, 0.06));
  /* Overall opacity to keep the artifact subdued */
  opacity: 0.92;
}

#hero-chess .hc-stage {
  position: absolute; inset: 0;
}

/* ─── Outer frame: thin hairline, terminal-style corner ticks ─── */
#hero-chess .hc-frame {
  position: absolute; inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  pointer-events: none;
}
#hero-chess .hc-frame::before,
#hero-chess .hc-frame::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid rgba(255, 194, 51, 0.5);
}
#hero-chess .hc-frame::before { top: -1px; left: -1px;  border-right: 0; border-bottom: 0; }
#hero-chess .hc-frame::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* ─── Top HUD readout (kept very small) ─── */
#hero-chess .hc-hud {
  position: absolute;
  top: -22px; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #555;
  pointer-events: none;
  white-space: nowrap;
}
#hero-chess .hc-hud > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#hero-chess .hc-hud .live {
  display: inline-flex; align-items: center; gap: 6px;
  color: #ffc233;
}
#hero-chess .hc-hud .live .blink {
  width: 5px; height: 5px; border-radius: 50%;
  background: #ffc233;
  box-shadow: 0 0 6px rgba(255, 194, 51, 0.6);
  animation: hc-blink 1.6s steps(2, jump-none) infinite;
}
@keyframes hc-blink { 50% { opacity: 0.2; } }

/* ─── Board SVG container ─── */
#hero-chess svg.hc-svg {
  width: 100%; height: 100%;
  display: block;
  overflow: visible;
}

/* ─── Cell pulse (scanned squares) — opacity is RAF-driven from JS ─── */
#hero-chess .hc-scan {
  pointer-events: none;
}

/* (sweep rect removed in v2 — radial sonar wave does this now) */

/* ─── Piece glyphs ─── */
#hero-chess .hc-piece {
  /* JS controls transform during glide; no CSS transition (would fight RAF) */
}
#hero-chess .hc-piece .ring {
  stroke-width: 1;
  fill: none;
}

#hero-chess .hc-piece.threat .core { fill: #0b0b0b; }
#hero-chess .hc-piece.threat .ring { stroke: rgba(192, 57, 43, 0.5); }
#hero-chess .hc-piece.threat .glyph { fill: rgba(192, 57, 43, 0.95); }

#hero-chess .hc-piece.support .core { fill: #0b0b0b; }
#hero-chess .hc-piece.support .ring { stroke: rgba(105, 186, 201, 0.45); }
#hero-chess .hc-piece.support .glyph { fill: rgba(105, 186, 201, 0.95); }

#hero-chess .hc-piece.neutral .core { fill: #0b0b0b; }
#hero-chess .hc-piece.neutral .ring { stroke: rgba(255,255,255,0.18); }
#hero-chess .hc-piece.neutral .glyph { fill: #888; }

#hero-chess .hc-piece.aware .ring { stroke: rgba(255, 194, 51, 0.4); }
#hero-chess .hc-piece.aware .glyph { fill: #0b0b0b; }

#hero-chess .hc-piece .ring.r2 { opacity: 0.5; }
#hero-chess .hc-piece .ring.r3 { opacity: 0.16; }

/* Soft ambient breathing for ALL pieces — slight scale */
#hero-chess .hc-piece {
  transform-box: fill-box;
  transform-origin: center;
  animation: hc-breathe 5.2s ease-in-out infinite;
}
#hero-chess .hc-piece.threat   { animation-delay: -0.6s; }
#hero-chess .hc-piece.support  { animation-delay: -1.4s; }
#hero-chess .hc-piece.neutral  { animation-delay: -2.1s; }
@keyframes hc-breathe {
  0%, 100% { opacity: 0.92; }
  50%      { opacity: 1; }
}
/* Aware piece overrides the ambient — it has its own sonar rings */
#hero-chess .hc-piece.aware { animation: none; }

/* Aware sonar rings — continuous expanding pulse */
#hero-chess .hc-piece.aware .ring.r2,
#hero-chess .hc-piece.aware .ring.r3 {
  animation: hc-aware-ring 3.4s cubic-bezier(0.2, 0, 0, 1) infinite;
  transform-origin: center;
  transform-box: fill-box;
}
#hero-chess .hc-piece.aware .ring.r3 { animation-delay: -1.1s; }
@keyframes hc-aware-ring {
  0%   { transform: scale(0.75); opacity: 0.45; }
  70%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ─── Threat lines: tendrils — opacity & dash driven by JS RAF ─── */
#hero-chess .hc-threat,
#hero-chess .hc-threat-line {
  /* Tendrils are now plain <path> elements rendered + animated from JS;
   * keep these selectors as a no-op safety net. */
}

/* ─── Move arc (drawn during anticipation, fades during glide) ─── */
#hero-chess .hc-arc {
  /* JS sets stroke + filter inline */
}
#hero-chess .hc-arc-head { fill: #ffc233; }

/* ─── Floating eval ticks ─── */
#hero-chess .hc-tick {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  fill: #888;
  opacity: 0;
  animation: hc-tick-rise 2.4s cubic-bezier(0.2, 0, 0, 1) forwards;
}
#hero-chess .hc-tick.pos { fill: rgba(97, 196, 137, 0.9); }
#hero-chess .hc-tick.neg { fill: rgba(192, 57, 43, 0.9); }
@keyframes hc-tick-rise {
  0%   { opacity: 0; transform: translateY(4px); }
  20%  { opacity: 0.9; }
  80%  { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-14px); }
}

/* ─── Coordinate labels ─── */
#hero-chess .hc-coord {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 8px;
  font-weight: 500;
  fill: #3a3a3a;
  letter-spacing: 0.06em;
}

/* ─── Side label tags — quieter, smaller, lower contrast ─── */
#hero-chess .hc-tag {
  position: absolute;
  padding: 2px 7px;
  border-radius: 2px;
  background: rgba(11, 11, 11, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 2;
  opacity: 0.78;
}
#hero-chess .hc-tag.policy  { color: rgba(105,186,201,0.85); border-color: rgba(105,186,201,0.25); top: 22%;  left: 4px; }
#hero-chess .hc-tag.geo     { color: rgba(192,57,43,0.85);  border-color: rgba(192,57,43,0.25);   top: 52%;  right: 4px; }
#hero-chess .hc-tag.supply  { color: rgba(212,160,23,0.85); border-color: rgba(212,160,23,0.25);  bottom: 18%; left: 4px; }
#hero-chess .hc-tag.next    {
  color: #ffc233; border-color: rgba(255,194,51,0.4);
  top: -22px; right: 0;
  background: transparent;
  opacity: 1;
}

html[data-locale="ja"] #hero-chess .hc-tag,
html[data-locale="ja"] #hero-chess .hc-hud {
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 10px;
}

/* Hide noisy interior tags below a comfortable width to keep the artifact
 * legible when it slides under the CTA. */
@media (max-width: 1240px) {
  #hero-chess .hc-tag.policy,
  #hero-chess .hc-tag.geo,
  #hero-chess .hc-tag.supply { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #hero-chess *,
  #hero-chess *::before,
  #hero-chess *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* =====================================================================
 * Hero layout coupling — kept here so the chess + hero structure ship
 * together. The hero row holds eyebrow → CTA on the left and the chess
 * on the right; meta-strip lives outside the row, full-width.
 * ===================================================================== */
.hero .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 48px;
  align-items: start;
}
.hero .col-l { padding-top: 4px; }
.hero .col-r {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-top: 8px;
}

/* When narrow, stack: chess drops below the CTA, above meta-strip. */
@media (max-width: 880px) {
  .hero .row {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .hero .col-r {
    justify-content: center;
    padding-top: 0;
  }
  #hero-chess {
    max-width: 320px;
    margin: 0 auto;
  }
}

@media (max-width: 520px) {
  #hero-chess { max-width: 280px; }
}
