/* Deother — 사이트 스타일
   격투게임 스튜디오답게 어둡고 대비가 강한 화면. 붉은 강조색 하나만 쓴다.
   RTL(아랍어)은 html[dir="rtl"] 로 방향만 뒤집으면 되도록 논리 속성을 썼다. */

:root {
  --bg: #0a0a0c;
  --bg-2: #121217;
  --bg-3: #1a1a22;
  --fg: #f2f2f4;
  --fg-dim: #a0a0ad;
  --fg-faint: #6a6a78;
  --accent: #e63030;
  --accent-dim: #8f1d1d;
  --line: #26262f;
  --max: 1080px;
  --pad: clamp(20px, 5vw, 48px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", "Pretendard", -apple-system, BlinkMacSystemFont,
               "Segoe UI", "Noto Sans KR", "Noto Sans SC", "Noto Sans JP",
               "Noto Sans Arabic", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* 아랍어는 글자가 작아 보여서 살짝 키운다 */
html[dir="rtl"] body { font-size: 18px; line-height: 1.9; }

a { color: inherit; }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--pad); }

/* ---------- 상단 바 ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 24px; height: 64px; }

.logo {
  font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase;
  font-size: 15px; text-decoration: none; white-space: nowrap;
  display: flex; align-items: center; gap: 9px;
}
.logo img { display: block; }
.logo span { color: var(--accent); }

nav { display: flex; gap: 22px; margin-inline-start: auto; }
nav a {
  color: var(--fg-dim); text-decoration: none; font-size: 14px;
  padding: 6px 0; border-bottom: 1px solid transparent; transition: .18s;
}
nav a:hover { color: var(--fg); border-bottom-color: var(--accent); }

/* 언어 선택 */
.lang { position: relative; }
.lang-btn {
  background: var(--bg-3); color: var(--fg); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 12px; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; font-family: inherit;
}
.lang-btn:hover { border-color: var(--accent-dim); }
.lang-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  min-width: 168px; padding: 6px; display: none;
  box-shadow: 0 18px 40px rgba(0,0,0,.6);
  max-height: 60vh; overflow-y: auto;
}
.lang-menu.open { display: block; }
.lang-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: start;
  background: none; border: 0; color: var(--fg-dim); padding: 9px 12px;
  border-radius: 5px; cursor: pointer; font-size: 14px; font-family: inherit;
}
.lang-menu button:hover { background: var(--bg-3); color: var(--fg); }
.lang-menu button[aria-current="true"] { color: var(--accent); font-weight: 600; }

/* 언어 국기 — assets/flags/<code>.svg. 이모지 국기가 안 뜨는 환경(윈도우 등) 대비 SVG */
.flag {
  width: 20px; height: 15px; flex: none; border-radius: 2px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14);
}
.lang-btn .caret { font-size: 10px; opacity: .55; margin-inline-start: 2px; }

/* ---------- 히어로 ---------- */
.hero {
  padding: clamp(72px, 13vw, 148px) 0 clamp(56px, 9vw, 104px);
  border-bottom: 1px solid var(--line);
  position: relative; overflow: hidden;
}
/* 배경에 은은한 붉은 광원 — 이미지 없이 분위기만 */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(720px 380px at 22% 0%, rgba(230,48,48,.14), transparent 66%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
/* 히어로: 왼쪽 글, 오른쪽 커버 아트 */
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(28px, 5vw, 64px); align-items: center;
}
.hero-art {
  width: 100%; height: auto; border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 26px 70px rgba(0,0,0,.6);
}

.eyebrow {
  color: var(--accent); font-size: 13px; letter-spacing: .2em;
  text-transform: uppercase; font-weight: 700; margin: 0 0 18px;
}
h1 {
  font-size: clamp(42px, 9vw, 88px); line-height: 1.02; margin: 0 0 22px;
  font-weight: 800; letter-spacing: -0.025em;
}
.tagline {
  font-size: clamp(18px, 2.4vw, 24px); color: var(--fg-dim);
  max-width: 30ch; margin: 0 0 40px;
}
.cta {
  display: inline-flex; flex-direction: column; gap: 4px;
  background: var(--accent); color: #fff; text-decoration: none;
  padding: 16px 32px; border-radius: 8px; font-weight: 700;
  transition: .18s;
}
.cta:hover { background: #ff3c3c; transform: translateY(-2px); }
.cta small { font-weight: 400; opacity: .82; font-size: 13px; }

/* ---------- 섹션 공통 ---------- */
section { padding: clamp(64px, 10vw, 112px) 0; border-bottom: 1px solid var(--line); }
h2 {
  font-size: clamp(28px, 4.2vw, 42px); margin: 0 0 14px;
  font-weight: 800; letter-spacing: -0.02em;
}
.lead { color: var(--accent); font-size: clamp(17px, 2vw, 20px); margin: 0 0 36px; max-width: 46ch; }
.prose p { color: var(--fg-dim); max-width: 62ch; margin: 0 0 20px; }

/* 배경을 한 단계 밝혀 강조하는 섹션 (개인 이야기·팀) */
section.alt { background: var(--bg-2); }

/* 창업자의 1인칭 이야기 — 왼쪽에 붉은 선을 그어 인용처럼 */
.quote {
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: 26px;
}
.quote p { color: var(--fg); font-size: 18px; }

/* 세계관: 글 + 소설 표지 */
.world-grid {
  display: grid; grid-template-columns: 1fr 260px;
  gap: clamp(28px, 5vw, 56px); align-items: start;
}
.book { display: block; transition: .2s; }
.book:hover { transform: translateY(-4px); }
.book img {
  width: 100%; height: auto; border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0,0,0,.65);
}

/* 바깥으로 나가는 링크 (소설·자료) */
.link-out {
  display: inline-block; margin-top: 10px; color: var(--accent);
  text-decoration: none; font-weight: 600; border-bottom: 1px solid transparent;
}
.link-out:hover { border-bottom-color: var(--accent); }

/* ---------- 특징 카드 ---------- */
.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 26px 24px; transition: .18s;
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.card h3 { margin: 0 0 10px; font-size: 18px; font-weight: 700; }
.card p { margin: 0; color: var(--fg-dim); font-size: 15px; }

/* 만든 것 카드 — 카드 안에 링크가 둘(제품·SNS)이라 카드 자체는 링크가 아니다 */
.card.work { display: flex; flex-direction: column; }
.card.work .work-tag {
  color: var(--fg-faint); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; margin-bottom: 10px;
}
.card.work .work-logo {
  display: block; width: 78px; height: auto; margin-bottom: 16px;
  opacity: .95; transition: .2s;
}
.card.work:hover .work-logo { opacity: 1; transform: scale(1.06); }
.work-title { text-decoration: none; }
.work-title:hover { color: var(--accent); }
.work-links {
  margin-top: auto; padding-top: 16px; display: flex; gap: 16px; flex-wrap: wrap;
}
.work-sns, .work-more { font-size: 13px; text-decoration: none; }
.work-sns  { color: var(--fg-faint); }
.work-more { color: var(--accent); font-weight: 600; }
.work-sns:hover, .work-more:hover { text-decoration: underline; }

/* ---------- 게임 상세 페이지 ---------- */
/* 상세 페이지 언어 선택 — 메인과 같은 .lang / .lang-btn / .lang-menu 를 쓴다.
   여기서는 헤더 오른쪽으로 밀어주기만 한다. */
.doc-lang { margin-inline-start: auto; }

.doc-hero {
  padding: clamp(48px, 8vw, 88px) 0 clamp(40px, 6vw, 64px);
  border-bottom: 1px solid var(--line); position: relative; overflow: hidden;
}
.doc-hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(680px 340px at 18% 0%, rgba(230,48,48,.12), transparent 65%);
  pointer-events: none;
}
.doc-hero .wrap { position: relative; }
/* 상세 히어로에 게임 아트를 옆에 두는 배치 (장보고). 좁은 화면에선 아래로 쌓인다 */
.doc-hero-grid { display: grid; gap: clamp(24px, 4vw, 48px); align-items: center; }
.doc-hero-art {
  width: 100%; max-width: 300px; height: auto; display: block;
  border-radius: 16px; border: 1px solid var(--line); justify-self: center;
}
@media (min-width: 900px) {
  .doc-hero-grid { grid-template-columns: 1fr 300px; }
  .doc-hero-art { justify-self: end; }
}
.doc-back { display: inline-block; margin-bottom: 22px; font-size: 14px; }
.doc-intro { color: var(--fg-dim); max-width: 62ch; margin: 0 0 34px; font-size: 17px; }

/* 본문이 길어서 목차를 옆에 고정해 둔다 */
.doc-wrap {
  display: grid; grid-template-columns: 220px 1fr;
  gap: clamp(32px, 5vw, 64px); padding-block: clamp(48px, 7vw, 80px);
}
.doc-toc {
  position: sticky; top: 90px; align-self: start;
  display: flex; flex-direction: column; gap: 10px;
  border-inline-start: 1px solid var(--line); padding-inline-start: 18px;
}
.doc-toc a {
  color: var(--fg-faint); text-decoration: none; font-size: 14px; line-height: 1.4;
}
.doc-toc a:hover { color: var(--accent); }

.doc-section { padding-bottom: 44px; }
.doc-section h2 {
  font-size: clamp(22px, 3vw, 30px); margin: 0 0 18px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.doc-section h3 {
  font-size: 15px; color: var(--accent); margin: 28px 0 12px;
  letter-spacing: .04em; text-transform: uppercase; font-weight: 700;
}
.doc-section p { color: var(--fg-dim); max-width: 68ch; margin: 0 0 16px; }
.doc-list { margin: 0; padding-inline-start: 20px; color: var(--fg-dim); max-width: 68ch; }
.doc-list li { margin-bottom: 10px; }

@media (max-width: 860px) {
  .doc-wrap { grid-template-columns: 1fr; }
  .doc-toc {
    position: static; flex-direction: row; flex-wrap: wrap; gap: 14px;
    border-inline-start: 0; padding-inline-start: 0;
    border-bottom: 1px solid var(--line); padding-bottom: 18px;
  }
}

/* ---------- 슬라이드쇼 ---------- */
.slideshow { margin-top: 40px; }
/* 히어로 안에서는 위 여백 없이 커버 이미지 자리를 그대로 차지한다 */
.hero-slides { margin-top: 0; }
.hero-slides .slide-track { box-shadow: 0 26px 70px rgba(0,0,0,.6); }
.slide-track {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px;
  overflow: hidden; border: 1px solid var(--line); background: #000;
}
.slide-track img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .7s ease;
}
.slide-track img.on { opacity: 1; }

.slide-dots { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.slide-dots button {
  width: 8px; height: 8px; padding: 0; border-radius: 50%;
  border: 0; background: var(--line); cursor: pointer; transition: .2s;
}
.slide-dots button:hover { background: var(--fg-faint); }
.slide-dots button.on { background: var(--accent); transform: scale(1.3); }

/* 움직임을 불편해하는 사용자를 위해 전환을 끈다 */
@media (prefers-reduced-motion: reduce) {
  .slide-track img { transition: none; }
}

/* ---------- 연표 ---------- */
.events { margin-top: 44px; display: grid; gap: 2px; }
.event {
  display: grid; grid-template-columns: 175px 1fr; gap: 24px;
  padding: 16px 0; border-top: 1px solid var(--line);
}
.event:last-child { border-bottom: 1px solid var(--line); }
.event .when { color: var(--accent); font-size: 13px; font-weight: 700; }
.event .what { color: var(--fg-dim); font-size: 15px; }

/* ---------- 팀 ---------- */
.person { font-size: 26px; font-weight: 800; margin: 0 0 4px; }
.role { color: var(--accent); font-weight: 600; margin: 0 0 26px; font-size: 15px; }
.bullets { margin: 0 0 26px; padding-inline-start: 20px; color: var(--fg-dim); max-width: 66ch; }
.bullets li { margin-bottom: 10px; }
.partners { color: var(--fg-dim); max-width: 66ch; margin: 0; }

/* ---------- 발표 자료 ---------- */
.deck-links { display: flex; flex-wrap: wrap; gap: 14px; }
.deck {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px;
  padding: 15px 26px; text-decoration: none; font-weight: 600; transition: .18s;
}
.deck:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 여정(영상) ---------- */
.videos { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.video-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; transition: .18s;
}
.video-card:hover { border-color: var(--accent-dim); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-meta { padding: 14px 18px 18px; }
.video-meta .t { font-weight: 600; font-size: 15px; }
.video-meta .d { color: var(--fg-faint); font-size: 13px; margin-top: 3px; }
.note { color: var(--fg-faint); font-size: 14px; margin-top: 28px; }

/* 언어별 주제가는 개수가 많아 카드를 작게 — 한 화면에 여러 나라가 보이는 게 요점이다 */
.videos.small { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.videos.small .video-meta { padding: 10px 14px 13px; }
.videos.small .video-meta .t { font-size: 14px; }

/* ---------- 로드맵 ---------- */
.timeline { display: grid; gap: 4px; }
.step {
  display: grid; grid-template-columns: 190px 1fr; gap: 28px;
  padding: 30px 0; border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step .when {
  color: var(--accent); font-weight: 700; font-size: 14px;
  letter-spacing: .05em; text-transform: uppercase; padding-top: 3px;
}
.step h3 { margin: 0 0 8px; font-size: 21px; font-weight: 700; }
.step p { margin: 0; color: var(--fg-dim); max-width: 60ch; }

/* ---------- 푸터 ---------- */
footer { padding: 52px 0; color: var(--fg-faint); font-size: 14px; }
.foot { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.foot a { color: var(--fg-dim); text-decoration: none; }
.foot a:hover { color: var(--accent); }
.foot .sp { margin-inline-start: auto; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 460px; }
  .world-grid { grid-template-columns: 1fr; }
  .book { max-width: 220px; }
}

@media (max-width: 760px) {
  /* 예전엔 메뉴를 통째로 숨겼는데, 그러면 모바일에서 섹션 이동을 아예 못 한다.
     대신 두 줄로 나누고 메뉴는 가로로 밀어서 보게 한다. */
  .bar { flex-wrap: wrap; height: auto; padding-block: 12px; row-gap: 10px; }
  .lang { margin-inline-start: auto; }
  nav {
    order: 3; width: 100%; margin-inline-start: 0;
    gap: 18px; overflow-x: auto; padding-bottom: 4px;
    scrollbar-width: none;              /* 스크롤바는 숨기고 손가락으로만 민다 */
  }
  nav::-webkit-scrollbar { display: none; }
  nav a { white-space: nowrap; font-size: 13px; }

  .step, .event { grid-template-columns: 1fr; gap: 8px; }
  .tagline { max-width: none; }
}

/* 키보드 사용자를 위한 포커스 표시 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* 세 게임을 관통하는 관점 — 카드 아래 한 문단. 인용처럼 보이게 왼쪽에 선을 둔다 */
.works-note { margin: 34px 0 0; padding-inline-start: 18px; border-inline-start: 2px solid var(--accent);
  color: var(--muted); font-size: clamp(15px, 1.7vw, 17px); line-height: 1.75; max-width: 62ch; }

/* 슬라이드 설명 — 무슨 화면인지 알려준다. 그림만 있으면 심사자가 해석을 해야 한다 */
.slide-cap { margin: 12px 0 0; text-align: center; color: var(--muted);
  font-size: 14px; line-height: 1.6; min-height: 1.6em; }

/* 소설 표지 — 책장처럼 늘어놓는다. 표지는 세로로 긴 그림(2:3)이다 */
.covers { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.cover { margin: 0; }
.cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block;
  border-radius: 8px; border: 1px solid var(--line); background: #000;
  transition: transform .25s ease, box-shadow .25s ease; }
.cover:hover img { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0,0,0,.55); }
.cover figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .cover img { transition: none; } }

/* 하드커버 전개도 — 뒤표지·책등·앞표지가 한 장에 있다. 격자보다 크게 둔다 */
.book-wrap { margin: 0 0 40px; }
.book-wrap img { width: 100%; display: block; border-radius: 10px;
  border: 1px solid var(--line); box-shadow: 0 22px 60px rgba(0,0,0,.5); }
.book-wrap figcaption { margin-top: 14px; color: var(--muted); font-size: 14px;
  line-height: 1.6; max-width: 62ch; }

/* 영상이 있는 표지 — 재생 표시를 얹는다 */
.cover-play { position: relative; display: block; }
.cover-play .play { position: absolute; inset-block-end: 10px; inset-inline-end: 10px;
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(0,0,0,.66); color: #fff; font-size: 13px; line-height: 1;
  border: 1px solid rgba(255,255,255,.35); transition: background .2s ease; }
.cover-play:hover .play { background: var(--accent); }

/* 링크 여러 개인 표지 — 아래에 라벨 버튼(웹툰/영상/노래 등) */
.cover-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cover-link {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-3); color: var(--fg-dim); border: 1px solid var(--line);
  text-decoration: none; white-space: nowrap; line-height: 1.4;
}
.cover-link:hover { color: var(--fg); border-color: var(--accent-dim); }

/* 상세 페이지 소개 영상 — 슬라이드쇼 바로 위 */
/* 상세 페이지 영상 — 폴백(킹덤워즈): 여러 개면 넓은 화면에서 나란히, 좁으면 세로로 쌓인다 */
.page-videos { margin: 40px 0 0; display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.page-videos .page-video { margin: 0; }
.page-video { margin: 34px 0; }
.page-video .video-frame { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
/* 세로 영상(쇼츠) — 9:16 프레임, 폭 제한 + 가운데 정렬 */
.page-video.vertical .video-frame { aspect-ratio: 9 / 16; max-width: 300px; margin-inline: auto; }
.page-video figcaption { margin-top: 12px; text-align: center; color: var(--muted); font-size: 14px; }

/* 본문 사이에 끼우는 스크린샷 (밀리버스 인터리브 배치) */
.doc-shot { margin: 34px 0; }
.doc-shot img { width: 100%; display: block; border-radius: 12px; border: 1px solid var(--line); }
.doc-shot figcaption { margin-top: 10px; text-align: center; color: var(--muted); font-size: 14px; }

/* 자막 없는 시네마틱 아트 밴드 (콘셉트 아트로 텍스트 사이를 끊어준다) */
.doc-band { margin: 40px 0; }
.doc-band img { width: 100%; display: block; border-radius: 14px; border: 1px solid var(--line); }

/* 작품 카드의 숫자 — 얼마나 만들었는지가 설명보다 빨리 읽힌다 */
.work-stats { list-style: none; margin: 16px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px; }
.work-stats li { font-size: 12px; color: var(--fg-faint); letter-spacing: .02em;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
/* FN 은 가로로 긴 워드마크라 엠블럼보다 넓게 */
.card.work .work-logo.wide { width: 150px; }

/* 주제가 토글 — kwonline.html 전용. 우하단 고정. RTL 을 위해 left/right 대신 논리 속성. */
.audio-toggle {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-end: 20px;
  z-index: 60;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(18, 18, 23, .85);
  color: var(--accent);
  font-size: 17px; line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.audio-toggle:hover { transform: scale(1.08); }
.audio-toggle.playing { color: #fff; background: var(--accent); border-color: var(--accent); }
