/* Crystal Refined 2.5.2: targeted fixes only; the original palette stays intact. */

/* A fixed-height, intrinsically-sized grid can push a large image outside the
   viewport. Bound the track and the picture, then let the hero fit its content. */
.hero {
  grid-template-columns: minmax(0, 1fr);
  height: auto;
  min-height: max(940px, 100svh);
  padding: 104px 16px 80px;
}
.hero-inner {
  min-width: 0;
  width: min(760px, 100%);
  max-width: 100%;
  margin-top: 0;
}
.hero-inner.reveal { opacity: 1; transform: none; }
.hero-logo-picture {
  display: block;
  width: min(570px, 100%);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto 8px;
}
.hero-logo-picture .hero-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  object-fit: contain;
  object-position: center;
  transform: none;
}
.hero-copy {
  width: auto;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: normal;
  line-break: strict;
  line-height: 1.8;
}
.hero-copy > span { display: inline-block; white-space: nowrap; }
.hero-kicker { max-width: 100%; overflow-wrap: normal; }
.hero-actions { flex-wrap: wrap; }

/* Two equally-sized portraits. No third placeholder is manufactured. */
.hero-member-icons { flex-wrap: wrap; gap: 18px; }
.hero-member-announcement {
  margin: 0 auto 12px;
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-shadow: 0 1px 5px rgba(8,15,44,.85);
}
.hero-member-icon,
.hero-member-icon:nth-child(2n) {
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  margin-top: 0;
  opacity: 1;
  transform: none;
  animation: none;
}
.amasio-ready .hero-member-icon {
  animation: hero-member-pop .6s cubic-bezier(.2, 1.3, .45, 1) calc(.08s + (var(--member-order) * .12s)) both;
}
.member-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 850px;
  margin-inline: auto;
}

/* Mount particles on body, not inside a clipped/filtered hero. */
.seasoning-motion {
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.seasoning-particle {
  position: absolute;
  left: var(--start-x);
  top: var(--start-y);
  width: var(--size);
  height: var(--size);
  opacity: 0;
  filter: drop-shadow(0 0 4px var(--spark-color));
  animation: crystal-dust-fall var(--duration) linear var(--delay) both;
}
.seasoning-particle.sugar {
  border-color: rgba(215, 129, 170, .78);
  background: linear-gradient(145deg, #fff, #efb1cd 58%, #fff);
}
.seasoning-particle.salt {
  border-color: rgba(94, 179, 199, .8);
  background: linear-gradient(145deg, #fff, #93dbe9 58%, #fff);
}
.seasoning-particle.lemon-drop {
  border-color: rgba(205, 175, 74, .8);
  background: linear-gradient(145deg, #fff, #edd572 58%, #fff);
}
.seasoning-particle::before {
  content: "";
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 5px 1px rgba(255, 255, 255, .9);
  animation: crystal-dust-glimmer var(--twinkle) ease-in-out var(--spark-delay) infinite alternate;
}
@keyframes crystal-dust-fall {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(.65) rotate(0deg); }
  5% { opacity: var(--alpha); }
  32% { transform: translate3d(var(--sway-a), calc(var(--fall-distance) * .32), 0) scale(1) rotate(var(--turn-a)); }
  65% { opacity: var(--alpha); transform: translate3d(var(--sway-b), calc(var(--fall-distance) * .65), 0) scale(.9) rotate(var(--turn-b)); }
  100% { opacity: 0; transform: translate3d(var(--drift), var(--fall-distance), 0) scale(.7) rotate(var(--turn)); }
}
@keyframes crystal-dust-glimmer {
  from { opacity: .18; transform: scale(.55); }
  to { opacity: .95; transform: scale(1.05); }
}

/* A failed/blocked script must not leave an opaque loading screen forever. */
.site-loader { animation: crystal-loader-failsafe 0s 3s forwards; }
@keyframes crystal-loader-failsafe {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

@media (max-width: 800px) {
  .hero { min-height: max(760px, 100svh); padding: 82px 10px 72px; }
  .hero-inner { width: 100%; max-width: 100%; margin-top: 0; padding: 18px 12px 28px; }
  .hero-logo-picture { width: min(500px, 86vw, 100%); }
  .hero-copy { width: auto; max-width: 100%; white-space: normal; }
  .hero-member-icons { gap: 16px; min-height: 68px; }
  .hero-member-icon,
  .hero-member-icon:nth-child(2n) { flex-basis: 64px; width: 64px; height: 64px; margin-top: 0; }
  .member-grid { grid-template-columns: minmax(0, 1fr); max-width: 410px; }
}
@media (max-width: 360px) {
  .hero-kicker { font-size: 9px; letter-spacing: .24em; }
  .hero-actions { gap: 8px; padding-inline: 4px; }
  .hero-button { flex: 1 1 110px; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .seasoning-motion { display: none; }
  .hero-member-icon,
  .amasio-ready .hero-member-icon { animation: none; opacity: 1; transform: none; }
}

/* 2.7.9 — Twilight Crystal: darken only the first-view hero on the homepage.
   Keep the CONCEPT/MEMBER sections luminous so the real members remain primary. */
body.home .hero {
  background:
    radial-gradient(ellipse at 12% 18%, rgba(236,139,196,.24), transparent 40%),
    radial-gradient(ellipse at 88% 25%, rgba(83,190,227,.27), transparent 42%),
    radial-gradient(ellipse at 54% 76%, rgba(151,120,230,.18), transparent 47%),
    linear-gradient(180deg, rgba(13,24,51,.78), rgba(21,32,63,.86)),
    url('assets/images/hero-light.jpg') center / cover no-repeat;
}
body.home .hero::before {
  border-color: rgba(224,236,255,.17);
  background: radial-gradient(circle, rgba(225,230,255,.11) 0 17%, rgba(139,183,234,.13) 43%, rgba(255,255,255,.025) 66%, transparent 71%);
  box-shadow: 0 0 0 22px rgba(255,255,255,.022), 0 35px 110px rgba(59,138,213,.13);
}
body.home .hero::after {
  background:
    linear-gradient(112deg, transparent 35%, rgba(231,222,255,.095) 50%, transparent 65%),
    radial-gradient(circle at 50% 42%, rgba(235,236,255,.19), rgba(188,213,255,.05) 31%, transparent 57%),
    linear-gradient(90deg, rgba(225,230,255,.07), transparent 22% 78%, rgba(225,230,255,.07));
}
body.home .stage-light-left {
  background: linear-gradient(103deg, transparent 15%, rgba(242,137,197,.22) 46%, rgba(255,222,244,.22) 52%, transparent 64%);
}
body.home .stage-light-right {
  background: linear-gradient(77deg, transparent 15%, rgba(91,201,235,.23) 46%, rgba(204,241,255,.25) 52%, transparent 64%);
}
body.home .hero-inner::before {
  border-color: rgba(255,255,255,.25);
  background: linear-gradient(135deg, rgba(244,238,255,.13), rgba(193,226,249,.07));
  box-shadow: 0 24px 70px rgba(5,12,37,.23), inset 0 1px rgba(255,255,255,.24);
}
body.home .hero-copy {
  color: #fff9ff;
  text-shadow: 0 2px 20px rgba(8,15,44,.64), 0 0 22px rgba(233,235,255,.19);
}
body.home .hero-kicker, body.home .hero-stage-line { color: #e5e9ff; text-shadow: 0 1px 12px rgba(7,12,29,.5); }
body.home .hero-idol {
  border-color: rgba(215,229,255,.4);
  color: #fff;
  background: linear-gradient(100deg, rgba(234,151,201,.42), rgba(107,195,225,.41), rgba(235,214,142,.32));
  box-shadow: 0 10px 30px rgba(8,14,48,.22);
}
body.home .hero-button:not(:first-child) {
  background: rgba(235,242,255,.13);
  border-color: rgba(236,242,255,.44);
  color: #fff;
  box-shadow: 0 10px 28px rgba(8,14,43,.22);
}
body.home .hero-scroll { color: rgba(238,241,255,.77); }
body.home .hero-scroll::after { background: linear-gradient(#d7edff, transparent); }
body.home .site-header:not(.is-scrolled) .brand-text,
body.home .site-header:not(.is-scrolled) .main-nav a,
body.home .site-header:not(.is-scrolled) .menu-toggle { color: #fff; text-shadow: 0 1px 12px rgba(12,20,53,.5); }
@media (max-width: 800px) {
  /* Mobile navigation opens on a light glass card even above the dark hero. */
  body.home .site-header:not(.is-scrolled) .main-nav a { color: var(--ink); text-shadow: none; }
}

/* 2.7.10 — Mobile hero edge fix. The crystal microphone motif was set
   right:-5px and could protrude from the right edge on narrow screens.
   Keep the motif on desktop, but hide it in the mobile hero and clip
   any remaining purely decorative overflow to the hero itself. */
@media (max-width: 800px) {
  body.home .hero { overflow: clip; }
  body.home .hero-idol-motif { display: none !important; }
  body.home .stage-light-right { right: 0; }
}
