/* Hallmark · genre: atmospheric · macrostructure: Bento Grid (2판 10-10 구조를 사용자 요청으로 되살려 스튜디오용으로) · theme: custom (dark / pixel-bitmap / warm) · enrichment: real game frames · nav: N9 · footer: Ft2
 * changes from 2판: 한·영(브라우저 언어 + 전환 버튼), 홍보 버튼 = 게임 홈페이지 + 순위표(ce.data), v0.1.4, 무기 셋이라 "쌍검" 뺌, 맨 아래 = 게임 홈페이지
 * pre-emit critique: P4 H5 E4 S5 R4 V3 (V: user asked for the same structure on purpose)
 * contrast: pass (40–41) · slop: pass (42–45) · honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · mobile: pass (34, 49, 50–57)
 * tokens: tokens.css (index.html loads it first)
 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  overflow-x: clip;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--page-max); margin-inline: auto; padding-inline: var(--page-gutter); }

/* 언어: 고른 쪽만 보인다 */
:root[data-lang="ko"] [data-l="en"], :root[data-lang="en"] [data-l="ko"] { display: none !important; }

/* 도트 글꼴: 자간 0, 줄 간격도 픽셀 단위 */
.px { font-family: var(--font-pixel); font-weight: 700; letter-spacing: 0; -webkit-font-smoothing: none; }
.px-24 { font-size: var(--px-24); line-height: var(--lh-24); }
.px-36 { font-size: var(--px-36); line-height: var(--lh-36); }
.px-48 { font-size: var(--px-48); line-height: var(--lh-48); }

/* ---------- 버튼: 누르는 순간 반응 ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0 var(--space-lg);
  border-radius: var(--radius-pill);
  font: inherit; font-size: var(--text-md); font-weight: 700; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.pill:active { transform: scale(0.97); transition-duration: 0ms; }
.pill:focus-visible { border-radius: var(--radius-pill); }
.pill:disabled, .pill[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.pill--blade { background: var(--color-accent-fill); color: var(--color-accent-ink); }
.pill--blade:hover { background: var(--color-accent-deep); }
.pill--line { border: var(--rule-hair) solid var(--color-rule); background: transparent; color: var(--color-ink); }
.pill--line:hover { background: var(--color-tile); }

/* ---------- 맨 위 줄 (N9: 양 끝만) ---------- */
.top {
  position: absolute; inset: 0 0 auto; z-index: var(--z-raised);
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm);
  padding: var(--space-md) var(--page-gutter);
}
.top__mark { text-decoration: none; white-space: nowrap; }
.top__act { display: flex; align-items: center; gap: var(--space-xs); }

/* ---------- 홍보: 애플 첫 화면의 신제품 자리 ---------- */
.promo {
  position: relative; text-align: center;
  padding: calc(var(--space-3xl) + var(--space-md)) 0 var(--space-2xl);
  background: radial-gradient(60% 55% at 50% 78%, var(--color-tile), var(--color-paper) 70%);
}
.promo__logo {
  font-family: var(--font-logo); font-weight: 400; font-size: var(--text-logo);
  line-height: 1.1; white-space: nowrap; color: var(--color-ink);
  text-shadow: 0 0.04em 0 var(--color-shadow);
}
.promo__line { margin-top: var(--space-sm); }
.promo__sub { max-width: 34rem; margin: var(--space-sm) auto 0; color: var(--color-muted); font-size: var(--text-lg); line-height: 1.5; }
.promo__act { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--space-sm); margin-top: var(--space-xl); }

/* 실제 게임 화면: 96x60 원본을 정수 배율로만 키운 사각 화면 */
.stage {
  --px: 3;
  display: block; position: relative;
  width: calc(96px * var(--px)); height: calc(60px * var(--px));
  margin: var(--space-2xl) auto 0;
  padding: 0; background: var(--color-shadow); cursor: pointer;
  border: 0; border-radius: var(--radius-frame);
  overflow: hidden;
  box-shadow: 0 0 0 var(--rule-hair) var(--color-rule), 0 30px 80px -30px var(--color-accent-deep);
  -webkit-tap-highlight-color: transparent;
}
.stage__strip {
  display: block; width: 3000%; max-width: none; height: 100%;
  image-rendering: pixelated;
  animation: combo-a 870ms steps(29, end) 700ms 1 both;
}
.stage.is-a .stage__strip { animation-name: combo-a; animation-delay: 0ms; }
.stage.is-b .stage__strip { animation-name: combo-b; animation-delay: 0ms; }
@keyframes combo-a { from { transform: translateX(0); } to { transform: translateX(-96.6667%); } }
@keyframes combo-b { from { transform: translateX(0); } to { transform: translateX(-96.6667%); } }
.stage__hint { margin-top: var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); }

@media (min-width: 26rem) { .stage { --px: 4; } }
@media (min-width: 38rem) { .stage { --px: 6; } }
@media (min-width: 56rem) and (min-height: 50rem) { .stage { --px: 8; } }

.promo__logo, .promo__line, .promo__sub, .promo__act { animation: appear var(--dur-long) var(--ease-out) both; }
.promo__line { animation-delay: 120ms; }
.promo__sub  { animation-delay: 180ms; }
.promo__act  { animation-delay: 240ms; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 벤토: 팀이 가장 큰 칸 ---------- */
.bento {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  padding-block: var(--space-2xl) var(--space-3xl);
}
.tile {
  background: var(--color-tile); border-radius: var(--radius-small);
  padding: var(--space-xl);
  display: flex; flex-direction: column; gap: var(--space-sm);
}
.tile__label { color: var(--color-muted); font-size: var(--text-sm); font-weight: 600; }
.tile__text { color: var(--color-muted); max-width: 34rem; }

.t-team    { grid-column: span 2; grid-row: span 2; border-radius: var(--radius-tile); }
.t-studio  { grid-column: span 2; }
.t-mail    { grid-column: span 2; }
.t-pixels  { grid-column: span 2; }
.t-now, .t-next { grid-column: span 1; }

.crew { list-style: none; display: grid; gap: var(--space-lg); margin-top: auto; padding-top: var(--space-xl); }
.crew li { display: flex; flex-direction: column; }
.crew li > span { color: var(--color-muted); font-size: var(--text-sm); }

.t-mail { justify-content: space-between; }
.mail { font-size: var(--text-lg); font-weight: 700; white-space: nowrap; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--color-accent); }
.mail:hover { color: var(--color-accent); }

.poses { display: flex; gap: var(--space-xs); margin-top: auto; padding-top: var(--space-md); }
.poses span {
  --k: 2;
  width: calc(36px * var(--k)); height: calc(36px * var(--k)); flex: none;
  border-radius: var(--space-xs);
  background: url("img/poses.png") 0 0 / calc(216px * var(--k)) calc(36px * var(--k)) no-repeat;
  image-rendering: pixelated;
}
.poses span:nth-child(2) { background-position-x: calc(-36px * var(--k)); }
.poses span:nth-child(3) { background-position-x: calc(-72px * var(--k)); }
.poses span:nth-child(4) { background-position-x: calc(-108px * var(--k)); }
.poses span:nth-child(5) { background-position-x: calc(-144px * var(--k)); }
.poses span:nth-child(6) { background-position-x: calc(-180px * var(--k)); }

.t-now .px, .t-next .px { margin-top: auto; }

/* ---------- 맨 아래 한 줄 (Ft2) ---------- */
.foot { border-top: var(--rule-hair) solid var(--color-rule); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-xs) var(--space-lg); padding-block: var(--space-lg); color: var(--color-muted); font-size: var(--text-sm); }
.foot a:hover { color: var(--color-ink); }

/* ---------- 화면 크기 ---------- */
@media (max-width: 64rem) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-team { grid-row: auto; }
  .crew { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 40rem) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .t-team, .t-studio, .t-mail, .t-pixels, .t-now, .t-next { grid-column: auto; }
  .tile { padding: var(--space-lg); }
  .px-48 { font-size: var(--px-36); line-height: var(--lh-36); }
  .px-36 { font-size: var(--px-24); line-height: var(--lh-24); }
  .poses { gap: var(--space-2xs); }
  .poses span { --k: 1; }
  .crew { grid-template-columns: minmax(0, 1fr); }
  .mail { font-size: var(--text-md); }
  .top__mail { display: none; }   /* 메일은 연락 칸에 있다 */
}
@media (max-width: 22.5rem) {
  .top .pill { padding: 0 var(--space-sm); }
}

/* ---------- 접근성 ---------- */
@media (prefers-reduced-motion: reduce) {
  .promo__logo, .promo__line, .promo__sub, .promo__act { animation: appear 150ms linear both; animation-delay: 0ms; }
  .stage:not(.is-a):not(.is-b) .stage__strip { animation: none; }
  .pill:active { transform: none; }
}
@media (prefers-contrast: more) {
  .tile { outline: var(--rule-hair) solid var(--color-muted); }
}
