/* RNG ARENA 홈페이지. 게임 UI 와 같은 어두운 팔레트(scripts/ui/ui_theme.gd)와 Galmuri 글꼴. 글꼴은 fonts.css(build_fonts.py 산출물). */

:root {
  --bg: #0a0b0d;
  --panel: #121418;
  --panel-hi: #1a1d23;
  --panel-lo: #0d0e11;
  --border: #3b414a;
  --border-hi: #6c7684;
  --text: #cfd3d9;
  --dim: #8b919c;
  --steel: #8296ad;
  --red: #a8372f;
  --red-hi: #d4493f;
  --btn: #3a1613;
  --btn-hi: #4d1c18;
  --gold: #bfa45e;
  --green: #6e9a78;
  --focus: #e6c978;
  --font: "Galmuri11", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --wrap: 1160px;
  --gutter: 16px;
  --bar: 64px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 8px); scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.75; word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: none; font-smooth: never;
}
/* 한자·가나는 띄어쓰기가 없어 keep-all 이면 줄이 한 덩어리가 된다. 중국어·일본어는 글자 사이에서 줄을 바꾼다(금칙 처리는 line-break). */
html:lang(zh) body, html:lang(ja) body { word-break: normal; line-break: strict; }
/* Galmuri11 에는 간체자 전용 글자가 없다(build_fonts.py 머리말). zh 는 라틴·한글만 Galmuri 로 그리고 한자는 시스템 중국어 글꼴로 그린다. */
html:lang(zh) { --font: "Galmuri11 Western", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif; }
html:lang(ja) { --font: "Galmuri11", "Hiragino Sans", "Yu Gothic", "Noto Sans CJK JP", "Noto Sans JP", sans-serif; }
/* 언어 선택 링크의 "简体中文"은 어느 언어 페이지에서나 시스템 중국어 글꼴로 그린다. */
a[lang="zh"] { font-family: "Galmuri11 Western", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif; }
img { max-width: 100%; height: auto; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--steel); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
h1, h2, h3 { font-weight: 700; line-height: 1.35; margin: 0 0 .5em; color: #e8ebef; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
p { margin: 0 0 1em; }
small { font-size: 14px; color: var(--dim); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 8px; top: -80px; z-index: 100; padding: 8px 14px; background: var(--gold); color: var(--bg); font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 6px 18px;
  font: 700 16px/1.3 var(--font); color: var(--text); text-decoration: none; text-align: center; cursor: pointer;
  background: var(--panel-hi); border: 1px solid var(--border-hi);
}
.btn:hover { color: #fff; border-color: var(--steel); background: #232830; }
.btn.primary { background: var(--btn); border-color: var(--red); color: #f0d4d0; }
.btn.primary:hover { background: var(--btn-hi); border-color: var(--red-hi); color: #fff; }
.btn.primary[aria-disabled="true"] { cursor: default; background: var(--btn); border-color: var(--red); color: #f0d4d0; }
.btn-col { flex-direction: column; gap: 0; }
.btn-col .sub { font-weight: 400; font-size: 14px; color: #c9a8a3; }

/* ---------- 머리글 ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(10, 11, 13, .94); border-bottom: 1px solid var(--border); }
.bar { display: flex; align-items: center; gap: 12px 20px; min-height: var(--bar); flex-wrap: wrap; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: #e8ebef; text-decoration: none; min-height: 44px; }
.brand:hover { color: #fff; }
.nav ul, .lang ul, .site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 4px; }
.nav a, .lang a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--text); text-decoration: none; border-bottom: 3px solid transparent; }
.nav a:hover, .lang a:hover { color: var(--gold); }
.nav a[aria-current], .lang a[aria-current] { border-bottom-color: var(--red-hi); color: #fff; }
.nav { margin-right: auto; }
.lang a { padding: 0 10px; }
@media (max-width: 700px) {
  .bar { gap: 0 12px; padding-block: 4px 0; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; border-top: 1px solid #1a1d23; }
  .nav ul { flex-wrap: nowrap; }
  .nav a { white-space: nowrap; padding: 0 12px; }
  .nav li:first-child a { padding-left: 0; }
}
.lang-hint { background: var(--panel-hi); border-bottom: 1px solid var(--border); font-size: 14px; }
.lang-hint a { display: inline-block; padding: 6px 0; }

/* ---------- 첫 화면 ---------- */
.hero { position: relative; isolation: isolate; display: flex; align-items: flex-end; overflow: hidden; background: #000;
  height: min(86svh, 62vw); min-height: 520px; max-height: 920px; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 40%; z-index: -2; }
.hero-shade { position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(10, 11, 13, .96) 0, rgba(10, 11, 13, .62) 30%, rgba(10, 11, 13, 0) 62%),
              linear-gradient(to right, rgba(10, 11, 13, .6), rgba(10, 11, 13, 0) 55%); }
.hero-copy { padding-block: 32px 40px; }
.eyebrow { margin: 0 0 6px; color: var(--gold); font-size: 14px; letter-spacing: .04em; }
.hero .eyebrow { text-shadow: 0 2px 0 rgba(0, 0, 0, .85), 0 0 6px rgba(0, 0, 0, .9); }
.hero h1 { font-size: 44px; line-height: 1.05; margin: 0 0 14px; color: #f2f4f6; text-shadow: 0 3px 0 rgba(0, 0, 0, .55); }
.tagline { max-width: 26em; margin: 0 0 22px; font-size: 18px; color: #e1e4e8; text-shadow: 0 2px 0 rgba(0, 0, 0, .7); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.hero .status { margin: 16px 0 0; font-size: 14px; color: var(--gold); text-shadow: 0 2px 0 rgba(0, 0, 0, .7); }
@media (min-width: 701px) { .hero h1 { font-size: 66px; } .tagline { font-size: 22px; } }
@media (min-width: 1100px) { .hero h1 { font-size: 88px; } }
@media (max-width: 700px) { .hero { height: min(84svh, 680px); } .hero-img { object-position: 50% 40%; }
  .hero-shade { background: linear-gradient(to top, rgba(10, 11, 13, .96) 0, rgba(10, 11, 13, .7) 45%, rgba(10, 11, 13, 0) 80%); } }

.pitch { padding: 44px 0; border-bottom: 1px solid #1a1d23; }
.pitch p { max-width: 44em; margin: 0; font-size: 18px; line-height: 1.85; color: #dde0e5; text-wrap: pretty; }

/* ---------- 구역 ---------- */
.section { padding: 56px 0; }
.section.alt { background: var(--panel-lo); border-block: 1px solid #1a1d23; }
.section h2 { font-size: 22px; }
.intro { max-width: 46em; color: var(--dim); margin-bottom: 24px; }
@media (min-width: 900px) { .section h2 { font-size: 33px; } }

/* ---------- 갤러리 ---------- */
.gallery, .downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1000px) {
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .downloads { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.shot, .downloads a { position: relative; display: block; height: 100%; background: #000; border: 1px solid var(--border); color: var(--text); text-decoration: none; overflow: hidden; }
.shot:hover, .downloads a:hover { border-color: var(--steel); color: #fff; }
.shot img, .downloads img { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 7px; font-size: 14px; line-height: 1.4; color: #eef0f3;
  background: linear-gradient(to top, rgba(10, 11, 13, .94), rgba(10, 11, 13, 0)); }
.downloads a { display: flex; flex-direction: column; }
.downloads .cap { position: static; padding: 8px 10px 0; background: none; font-size: 14px; }
.downloads .meta { padding: 0 10px 8px; font-size: 14px; color: var(--dim); }
.downloads img { height: auto; }

/* ---------- 출시 안내 ---------- */
.status-band { border-top: 1px solid var(--border); background: linear-gradient(to bottom, #15110f, var(--bg)); }
.status-band .lead { font-size: 18px; max-width: 40em; color: #e1e4e8; }

/* ---------- 바닥글 ---------- */
.site-footer { margin-top: 0; padding: 36px 0; background: #07080a; border-top: 1px solid var(--border); }
.foot { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.foot p { margin: 0 0 4px; }
.brand-line { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #e8ebef; margin-bottom: 8px !important; }
.site-footer ul { flex-direction: column; gap: 0; }
.site-footer li a { display: inline-block; padding: 4px 0; font-size: 14px; }
@media (min-width: 700px) { .foot { grid-template-columns: minmax(0, 1fr) auto; } }

/* ---------- 확대 보기 ---------- */
.lightbox { padding: 0; border: 0; background: transparent; color: var(--text); max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; }
.lightbox::backdrop { background: rgba(5, 6, 8, .94); }
.lb { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 10px; height: 100%; padding: 12px; }
.lb-stage { display: flex; align-items: center; justify-content: center; min-height: 0; }
#lb-img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border: 1px solid var(--border); background: #000; }
.lb-cap { margin: 0; text-align: center; font-size: 14px; color: var(--text); min-height: 1.75em; }
.lb-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.lb-count { min-width: 5em; text-align: center; color: var(--dim); font-size: 14px; }

/* ---------- 프레스 ---------- */
.press-head h1 { font-size: 33px; }
.facts-table { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; border: 1px solid var(--border); }
.facts-table dt { padding: 10px 14px 0; color: var(--dim); background: var(--panel); font-size: 14px; }
.facts-table dd { margin: 0; padding: 0 14px 10px; background: var(--panel); border-bottom: 1px solid #1d2026; }
@media (min-width: 700px) {
  .facts-table { grid-template-columns: max-content minmax(0, 1fr); }
  .facts-table dt, .facts-table dd { padding: 10px 14px; border-bottom: 1px solid #1d2026; }
  .facts-table dt { padding-right: 28px; }
}
.copy-block { margin-bottom: 24px; max-width: 52em; }
.copy-block p { padding: 14px; margin: 0 0 10px; background: var(--panel); border: 1px solid var(--border); text-wrap: pretty; }
.logo-sample { display: inline-block; padding: 28px; background: #000; border: 1px solid var(--border); }
.logo-sample img { display: block; max-width: 100%; height: auto; }
.credit-list { padding-left: 18px; }
.credit-list li { font-size: 14px; margin-bottom: 8px; line-height: 1.6; }

/* ---------- 404 ---------- */
.lost { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 68svh; text-align: center; overflow: hidden; }
.lost-bg { position: absolute; inset: 0; z-index: -1; opacity: .32; }
.lost-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lost .big { margin: 0; font-size: 88px; font-weight: 700; color: var(--red-hi); line-height: 1.1; text-shadow: 0 4px 0 rgba(0, 0, 0, .6); }
.lost h1 { font-size: 22px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
