/* M4 Eternal — the home page: the client's title screen as the hero (the forest loop, the logo, the eight classes
   lined up like the class select screen), then the news, the world, the classes, the champions, a gallery of loading
   screens and a last invitation. Shared pieces (buttons, panels, news, showcase, podium) live in site.css. */

/* ---------- hero ---------- */
.hero {
  --gutter: clamp(16px, 2.5vw, 72px);
  position: relative; isolation: isolate;
  min-height: max(720px, 100svh);
  display: grid; grid-template-rows: 1fr auto;
  overflow: hidden;
}
.hero__media, .hero__media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -3;
}
.hero__media { background: #0b1018 url("/assets/official/keyart/title.jpg") center / cover; }
.hero__media video { animation: hero-in 2.4s var(--ease) both; }
@keyframes hero-in { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
.hero__veil {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 70% at 72% 52%, rgba(116, 212, 242, 0.12), transparent 70%),
    radial-gradient(40% 50% at 70% 92%, rgba(196, 42, 28, 0.18), transparent 70%),
    linear-gradient(90deg, rgba(5, 7, 11, 0.94) 0%, rgba(5, 7, 11, 0.72) 34%, rgba(5, 7, 11, 0.28) 62%, rgba(5, 7, 11, 0.5) 100%),
    linear-gradient(0deg, var(--ink) 0%, rgba(5, 7, 11, 0) 30%),
    linear-gradient(180deg, rgba(5, 7, 11, 0.75), transparent 20%);
}

/* Embers drifting up from the forest floor. */
.hero__embers { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero__embers i {
  position: absolute; bottom: -20px; left: var(--x); width: var(--s, 4px); height: var(--s, 4px); border-radius: 50%;
  background: radial-gradient(circle, #ffd9a0 0%, #ff8a3d 45%, transparent 70%);
  box-shadow: 0 0 10px 2px rgba(255, 140, 60, 0.45);
  opacity: 0; animation: ember var(--d, 11s) linear var(--w, 0s) infinite;
}
.hero__embers i:nth-child(1) { --x: 8%; --d: 13s; --w: 0s; }
.hero__embers i:nth-child(2) { --x: 18%; --d: 10s; --w: 3s; --s: 3px; }
.hero__embers i:nth-child(3) { --x: 27%; --d: 15s; --w: 6s; }
.hero__embers i:nth-child(4) { --x: 39%; --d: 12s; --w: 1.5s; --s: 5px; }
.hero__embers i:nth-child(5) { --x: 48%; --d: 14s; --w: 8s; --s: 3px; }
.hero__embers i:nth-child(6) { --x: 57%; --d: 11s; --w: 4.5s; }
.hero__embers i:nth-child(7) { --x: 64%; --d: 16s; --w: 2s; --s: 6px; }
.hero__embers i:nth-child(8) { --x: 72%; --d: 12.5s; --w: 7s; --s: 3px; }
.hero__embers i:nth-child(9) { --x: 80%; --d: 10.5s; --w: 5s; }
.hero__embers i:nth-child(10) { --x: 87%; --d: 14.5s; --w: 9s; --s: 5px; }
.hero__embers i:nth-child(11) { --x: 93%; --d: 12s; --w: 0.8s; --s: 3px; }
.hero__embers i:nth-child(12) { --x: 33%; --d: 17s; --w: 10s; --s: 4px; }
@keyframes ember {
  0% { opacity: 0; transform: translate(0, 0) scale(1); }
  10% { opacity: 0.9; }
  60% { opacity: 0.7; }
  100% { opacity: 0; transform: translate(60px, -92vh) scale(0.4); }
}

.hero__inner {
  width: min(1720px, 100% - 2 * var(--gutter)); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(32px, 4.5vw, 96px); align-items: center;
  padding: clamp(100px, 11vh, 170px) 0 clamp(24px, 3vh, 56px);
}
.hero__copy { max-width: 700px; }
/* The logo is the title: its own glow reaches ~4% past the letters on the left, hence the negative margin. */
.hero__logo { margin: 0 0 18px -3%; line-height: 0; animation: rise 1.2s 0.2s var(--ease) both; }
.hero__logo img { width: clamp(300px, min(31vw, 44vh), 640px); height: auto; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.7)); }
.hero .kicker { animation: rise 1s 0.35s var(--ease) both; }
.hero__headline {
  margin: 0 0 20px; max-width: 17ch;
  font-size: clamp(30px, 3.3vw, 64px); line-height: 1.06; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff8e4 0%, var(--gold-hi) 42%, var(--gold) 78%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.7)) drop-shadow(0 0 30px rgba(210, 171, 103, 0.2));
  animation: rise 1.1s 0.45s var(--ease) both;
}
:lang(ko) .hero__headline, :lang(ja) .hero__headline, :lang(zh-Hant) .hero__headline, :lang(zh-Hans) .hero__headline, :lang(th) .hero__headline { max-width: 20ch; line-height: 1.2; }
.hero__lede {
  max-width: 580px; margin: 0; font-size: clamp(16px, 1.05vw, 20px); color: #d9d3c5; text-shadow: 0 1px 12px #000;
  animation: rise 1.1s 0.6s var(--ease) both;
}
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: clamp(24px, 3.4vh, 40px); animation: rise 1.1s 0.75s var(--ease) both; }

/* ---------- lineup: the eight classes as slanted banners, one opened at a time ---------- */
.lineup {
  display: flex; gap: clamp(6px, 0.6vw, 12px);
  height: clamp(300px, 54vh, 680px);
  padding-inline: 18px;
  animation: rise 1.3s 0.5s var(--ease) both;
}
.slat {
  --skew: -9deg;
  position: relative; flex: 1 1 0; min-width: 0; overflow: hidden;
  transform: skewX(var(--skew));
  border: 1px solid var(--gold-hair);
  background: linear-gradient(180deg, rgba(24, 34, 49, 0.85), rgba(5, 7, 11, 0.95));
  box-shadow: 0 30px 60px -30px #000;
  color: var(--text);
  transition: flex-grow 0.8s var(--ease), border-color 0.4s, box-shadow 0.4s;
}
.slat:hover { color: var(--text); border-color: var(--gold-line); }
.slat.is-active { flex-grow: 4.4; border-color: var(--cyan-line); box-shadow: 0 0 0 1px rgba(116, 212, 242, 0.15), 0 0 40px -8px rgba(116, 212, 242, 0.45), 0 30px 60px -30px #000; }
/* Everything inside is skewed back upright, and a bit wider so the slanted edges never show a gap. */
.slat > * { transform: skewX(calc(-1 * var(--skew))); }
.slat__scene { position: absolute; inset: 0 -30%; }
.slat__scene img { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; filter: saturate(0.9); transition: opacity 0.6s; }
.slat.is-active .slat__scene img { opacity: 0.85; }
.slat__hero { position: absolute; inset: 0 -40%; display: flex; justify-content: center; align-items: flex-end; }
.slat__hero img {
  height: 94%; width: auto; max-width: none;
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 98%); mask-image: linear-gradient(180deg, #000 72%, transparent 98%);
  filter: grayscale(0.55) brightness(0.62);
  transition: filter 0.6s, transform 0.9s var(--ease);
  transform: scale(1.02); transform-origin: 50% 100%;
}
.slat:hover .slat__hero img { filter: grayscale(0.2) brightness(0.85); }
.slat.is-active .slat__hero img { filter: none; transform: scale(1.06); }
.slat::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(5, 7, 11, 0.95) 0%, rgba(5, 7, 11, 0.2) 34%, transparent 55%);
}
.slat__label {
  position: absolute; left: 0; right: 0; bottom: 16px; z-index: 1;
  display: grid; justify-items: center; gap: 2px; text-align: center; padding: 0 10px;
}
.slat__label .emblem { width: clamp(30px, 2.4vw, 46px); height: auto; opacity: 0.75; transition: opacity 0.3s, filter 0.3s; }
.slat.is-active .slat__label .emblem { opacity: 1; filter: drop-shadow(0 0 10px rgba(116, 212, 242, 0.6)); }
.slat__name, .slat__role { display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.slat__name { font-size: clamp(16px, 1.3vw, 24px); letter-spacing: 0.14em; text-transform: uppercase; color: #fff; text-shadow: 0 2px 10px #000; }
.slat__role { white-space: normal; line-height: 1.4; font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cyan); }
.slat.is-active .slat__name, .slat.is-active .slat__role { display: block; animation: rise 0.6s 0.25s var(--ease) both; }
.slat:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- stats ---------- */
.hero__stats {
  position: relative; z-index: 1;
  width: min(1720px, 100% - 2 * var(--gutter)); margin: 0 auto clamp(40px, 6vh, 84px);
  display: flex; justify-content: center; align-items: stretch;
  border-block: 1px solid var(--gold-hair);
  background: linear-gradient(90deg, transparent, rgba(10, 15, 23, 0.72) 18%, rgba(10, 15, 23, 0.72) 82%, transparent);
  backdrop-filter: blur(6px);
  animation: rise 1.1s 0.9s var(--ease) both;
}
.hero__stats::before {
  content: ""; position: absolute; left: 50%; top: -1px; width: min(520px, 60%); height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--gold-hi), transparent);
}
.stat { display: flex; align-items: center; gap: 14px; padding: 18px clamp(22px, 4vw, 72px); }
.stat + .stat { border-left: 1px solid var(--gold-hair); }
.stat b {
  font-size: clamp(32px, 2.8vw, 54px); font-weight: 600; line-height: 1;
  background: linear-gradient(180deg, #fff6dc, var(--gold) 70%, var(--gold-lo)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { font-size: clamp(11.5px, 0.8vw, 14px); letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); max-width: 12ch; line-height: 1.3; }
:lang(ko) .stat span, :lang(ja) .stat span, :lang(zh-Hant) .stat span, :lang(zh-Hans) .stat span, :lang(th) .stat span { letter-spacing: 0.08em; }
.hero__scroll {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 6px;
  font-size: 10.5px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--faint);
}
.hero__scroll::after { content: ""; width: 1px; height: 26px; background: linear-gradient(180deg, var(--gold), transparent); animation: drip 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* The masthead lines up with the hero on the home page. */
@media (min-width: 961px) {
  .page-home .masthead__inner { width: min(1720px, 100% - 72px); }
}

/* ---------- bands of the home page ---------- */
.page-home .wrap { width: min(1640px, 100% - 48px); }
.page-home .showcase__stage { min-height: clamp(520px, 34vw, 640px); }
.page-home .showcase__portrait img { max-height: 600px; width: auto; margin-inline: auto; }
.band--news { padding-top: clamp(40px, 5vw, 80px); }

/* ---------- world: four systems on loading screens ---------- */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: clamp(280px, 24vw, 420px); gap: 20px; }
.feat {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: flex-end;
  border: 1px solid var(--gold-hair); background: var(--steel);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.35s;
}
.feat--wide { grid-column: span 2; }
.feat:hover { color: var(--text); border-color: var(--gold-line); }
.feat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 78% 40%; z-index: -2; transition: transform 1.4s var(--ease); }
.feat:nth-child(1) img { object-position: 50% 35%; }
.feat:nth-child(2) img { object-position: 84% 30%; }
.feat:nth-child(3) img { object-position: 44% 30%; }
.feat:nth-child(4) img { object-position: 50% 40%; }
.feat:hover img { transform: scale(1.05); }
.feat::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(0deg, rgba(5, 7, 11, 0.96) 0%, rgba(5, 7, 11, 0.6) 38%, rgba(5, 7, 11, 0) 70%), linear-gradient(90deg, rgba(5, 7, 11, 0.55), transparent 60%);
}
.feat::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold-hi) 50%, var(--gold) 70%, transparent);
  transform: scaleX(0.2); opacity: 0.4; transition: transform 0.6s var(--ease), opacity 0.4s;
}
.feat:hover::after { transform: none; opacity: 1; }
.feat__body { padding: clamp(22px, 2.2vw, 36px); max-width: 620px; }
.feat__num {
  display: block; margin-bottom: 8px;
  font-size: 13px; letter-spacing: 0.3em; color: var(--gold);
}
.feat__num::after { content: ""; display: inline-block; width: 38px; height: 1px; margin-left: 12px; vertical-align: middle; background: var(--gold-line); }
.feat h3 { font-size: clamp(22px, 1.9vw, 32px); text-transform: uppercase; letter-spacing: 0.06em; color: #fff; margin-bottom: 8px; text-shadow: 0 2px 12px #000; }
.feat p { margin: 0; color: #cfcabd; font-size: 15.5px; text-shadow: 0 1px 8px #000; }

/* ---------- gallery ---------- */
.band--gallery { padding-bottom: clamp(56px, 7vw, 100px); }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 12vw, 250px); gap: 12px; }
.shot {
  position: relative; overflow: hidden; padding: 0; cursor: zoom-in;
  border: 1px solid var(--gold-hair); background: var(--steel);
  transition: border-color 0.3s;
}
.shot:first-child { grid-column: span 2; grid-row: span 2; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; transition: transform 1.2s var(--ease), filter 0.4s; filter: brightness(0.82); }
.shot::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(246, 226, 174, 0); transition: box-shadow 0.3s; pointer-events: none; }
.shot:hover, .shot:focus-visible { border-color: var(--gold-line); }
.shot:hover img, .shot:focus-visible img { transform: scale(1.06); filter: none; }
.shot:hover::after { box-shadow: inset 0 0 0 1px rgba(246, 226, 174, 0.35); }

.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(3, 4, 7, 0.94); color: var(--text);
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }
.lightbox img { max-width: min(94vw, 2040px); max-height: 86vh; width: auto; height: auto; border: 1px solid var(--gold-line); box-shadow: 0 40px 80px -20px #000; }
.lightbox__btn, .lightbox__close {
  position: absolute; width: 52px; height: 52px; border: 1px solid var(--gold-line); background: rgba(10, 15, 23, 0.8);
  cursor: pointer; color: var(--gold-hi);
}
.lightbox__btn:hover, .lightbox__close:hover { background: rgba(36, 50, 70, 0.9); }
.lightbox__btn { top: 50%; transform: translateY(-50%); }
.lightbox__btn--prev { left: clamp(8px, 2vw, 32px); }
.lightbox__btn--next { right: clamp(8px, 2vw, 32px); }
.lightbox__btn::before { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border: solid currentColor; border-width: 0 0 2px 2px; transform: translateX(3px) rotate(45deg); }
.lightbox__btn--next::before { transform: translateX(-3px) rotate(-135deg); }
.lightbox__close { top: clamp(8px, 2vw, 28px); right: clamp(8px, 2vw, 28px); }
.lightbox__close::before, .lightbox__close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 2px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.lightbox__close::after { transform: translate(-50%, -50%) rotate(-45deg); }

/* ---------- call to action ---------- */
.call {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: clamp(520px, 44vw, 780px);
  display: grid; align-items: center;
  border-top: 1px solid var(--gold-hair);
}
.call__art { position: absolute; inset: 0; z-index: -2; background: radial-gradient(70% 80% at 50% 40%, #1d2a3d, var(--ink)); }
.call__art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; animation: pan 28s ease-in-out infinite alternate; }
.call__art::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(46% 60% at 50% 52%, rgba(5, 7, 11, 0.62), rgba(5, 7, 11, 0.5) 60%, rgba(5, 7, 11, 0.85) 100%),
    linear-gradient(180deg, var(--ink), rgba(5, 7, 11, 0) 22%, rgba(5, 7, 11, 0) 70%, var(--ink));
}
.call__heroes { position: absolute; inset: auto 0 0; z-index: -1; display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none; padding-inline: clamp(0px, 4vw, 120px); }
.call__heroes img {
  height: clamp(300px, 30vw, 520px); width: auto; max-width: none; opacity: 0.9;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent);
  filter: drop-shadow(0 0 40px rgba(0, 0, 0, 0.8));
}
.call__heroes img:nth-child(2) { display: none; }
.call__heroes img:last-child { transform: scaleX(-1); }
.call__inner { display: grid; justify-items: center; text-align: center; padding: clamp(64px, 8vw, 120px) 0; }
.call__seal { width: clamp(120px, 9vw, 180px); height: auto; margin-bottom: 22px; filter: drop-shadow(0 10px 30px rgba(255, 120, 40, 0.35)); }
.call__title { font-size: clamp(32px, 4.4vw, 72px); margin-bottom: 16px; max-width: 18ch; }
.call__lede { max-width: 620px; color: #ddd6c6; font-size: clamp(16px, 1.1vw, 19px); text-shadow: 0 1px 10px #000; }
.call__cta { justify-content: center; margin-top: 18px; animation: none; }
.hero__note { max-width: 580px; margin: 14px 0 0; font-size: 13px; color: #b9b2a3; text-shadow: 0 1px 8px #000; animation: rise 1.1s 0.85s var(--ease) both; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .call__heroes img { opacity: 0.45; }
}
@media (max-width: 1100px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__copy { max-width: 720px; }
  .lineup { height: clamp(280px, 44vw, 440px); padding-inline: 10px; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feat--wide { grid-column: span 2; }
  .call__heroes { display: none; }
}
@media (max-width: 640px) {
  .hero { min-height: 0; }
  .hero__inner { padding: 96px 0 24px; gap: 30px; }
  .hero__logo img { width: min(320px, 84vw); }
  .hero__headline { font-size: clamp(26px, 7.4vw, 34px); }
  .hero__lede { font-size: 16px; }
  .hero__cta { gap: 14px; margin-top: 28px; }
  .hero__cta .btn { flex: 1 1 auto; }
  .btn--start { padding: 0 12px; font-size: 15px; letter-spacing: 0.14em; }
  .lineup { height: 300px; gap: 4px; padding-inline: 8px; }
  .slat { --skew: -6deg; }
  .slat.is-active { flex-grow: 7; }
  .slat__label { bottom: 10px; }
  .slat__label .emblem { width: 24px; }
  .slat:not(.is-active) .slat__label .emblem { width: 18px; }
  .slat__role { display: none; }
  .slat__name { font-size: 12.5px; letter-spacing: 0.08em; white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
  .hero__stats { margin-bottom: 40px; width: calc(100% - 32px); }
  .stat { flex: 1; flex-direction: column; gap: 4px; padding: 14px 6px; text-align: center; }
  .stat span { letter-spacing: 0.12em; font-size: 10.5px; }
  .hero__scroll { display: none; }
  .page-home .wrap { width: calc(100% - 32px); }
  .bento { grid-template-columns: 1fr; grid-auto-rows: 300px; gap: 14px; }
  .feat--wide { grid-column: auto; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 120px; gap: 8px; }
  .shot:first-child { grid-row: span 2; }
  .lightbox__btn { top: auto; bottom: 20px; transform: none; }
  .call__inner { padding: 72px 0; }
}
@media (max-height: 1000px) {
  .hero__scroll { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__embers { display: none; }
}
