/* ============================================================
   StarCloudGames — 디자인 시스템 v2 (taste-skill 리터치)
   - 타이포: Pretendard 단일 체계 (디스플레이 폰트 없음)
   - 액센트: 저채도 스타 블루 #6F84E8 하나만. 그라디언트 텍스트 금지
   - 모서리 규칙: 소형 컨트롤 8px / 버튼·입력 10px / 카드 16px
   - 별 배경(canvas)과 성운은 v1에서 보존
   ============================================================ */

:root {
  --bg: #06070D;
  --bg-elev: #0B0E1A;
  --surface: #10131F;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #F2F4FD;
  --muted: #9AA3BC;
  --faint: #5E6478;
  --accent: #6F84E8;

  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;

  --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 40px; --s6: 48px; --s8: 64px; --s10: 80px; --s15: 120px;

  --r-card: 16px;
  --r-ctrl: 10px;
  --r-sm: 8px;
  --container: 1200px;
}

/* ---------- 베이스 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  animation: page-in 0.6s ease both;
}

@keyframes page-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

::selection { background: rgba(111, 132, 232, 0.35); color: #fff; }

img, svg { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--s3);
}

/* 별 배경 canvas */
#starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

/* 성운 블롭 */
.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.4;
}
.nebula--blue   { background: radial-gradient(circle, rgba(93, 124, 255, 0.32), transparent 70%); }
.nebula--violet { background: radial-gradient(circle, rgba(164, 92, 255, 0.24), transparent 70%); }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(40px, -30px) scale(1.08); }
}
.nebula { animation: drift 26s ease-in-out infinite; }
.nebula:nth-child(2) { animation-duration: 34s; animation-delay: -12s; }

/* ---------- 헤더 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-block: 18px;
  transition: padding 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  padding-block: 12px;
  background: rgba(6, 7, 13, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { height: 28px; width: 28px; }
.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.nav { display: flex; gap: var(--s4); }
.nav a {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding-block: 6px;
  transition: color 0.25s ease;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav a:hover, .nav a.active { color: var(--text); }
.nav a:hover::after, .nav a.active::after { width: 100%; }

.header-right { display: flex; align-items: center; gap: var(--s2); }

.lang-toggle {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.lang-toggle button {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease;
}
.lang-toggle button.active { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.lang-toggle button:hover:not(.active) { color: var(--text); }

/* 햄버거 */
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  align-items: center;
}
.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s4);
  background: rgba(6, 7, 13, 0.92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.mobile-nav.open { opacity: 1; visibility: visible; }
.mobile-nav a {
  font-size: 26px;
  font-weight: 700;
  color: var(--muted);
  transition: color 0.25s ease;
}
.mobile-nav a:hover, .mobile-nav a.active { color: var(--text); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--r-ctrl);
  font-size: 15px;
  font-weight: 600;
  min-height: 48px;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--text);
  color: #0B0E1A;
}
.btn--primary:hover { background: #fff; transform: translateY(-1px); }
.btn--ghost {
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ---------- 히어로 (메인) ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 96px;
}
.hero .nebula--blue   { width: 560px; height: 560px; top: -10%; right: -8%; }
.hero .nebula--violet { width: 480px; height: 480px; bottom: -16%; left: -10%; }

.hero h1 {
  font-weight: 800;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero .line { display: block; overflow: hidden; }
.hero .line > span {
  display: inline-block;
  transform: translateY(112%);
  animation: line-up 0.9s cubic-bezier(0.2, 0.65, 0.2, 1) forwards;
}
.hero .line:nth-child(2) > span { animation-delay: 0.12s; }
@keyframes line-up { to { transform: translateY(0); } }

.hero-sub {
  max-width: 520px;
  margin-top: var(--s3);
  color: var(--muted);
  font-size: 18px;
  animation: fade-up 0.8s ease 0.45s both;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s5);
  animation: fade-up 0.8s ease 0.6s both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 섹션 공통 ---------- */
.section { position: relative; padding-block: var(--s15); }
.section--tight { padding-block: var(--s10); }
.section-head { margin-bottom: var(--s6); }

.section-title {
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.section-sub {
  color: var(--muted);
  max-width: 620px;
  margin-top: var(--s2);
  font-size: 16px;
}

.more-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.25s ease;
}
.more-link::after { content: '→'; transition: transform 0.25s ease; }
.more-link:hover { color: var(--text); }
.more-link:hover::after { transform: translateX(4px); }

/* ---------- 게임 소개 카드 ---------- */
.game-feature {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden;
}
a.game-feature { transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease; }
a.game-feature:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 20px 48px rgba(4, 6, 16, 0.55);
}
.game-feature__art img { width: 100%; height: 100%; aspect-ratio: 1024 / 500; object-fit: cover; }
.game-feature__body { padding: var(--s5); display: grid; align-content: center; justify-items: start; gap: var(--s2); }
.game-feature__head { display: flex; align-items: center; gap: var(--s2); }
.game-feature__icon { width: 64px; height: 64px; border-radius: 14px; }
.game-feature h3 { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.game-feature p { color: var(--muted); font-size: 15px; max-width: 48ch; }
.game-status {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.game-meta { color: var(--faint); font-size: 13px; }
.game-feature__head > div { display: grid; gap: 2px; }
.game-info { margin-top: var(--s6); }
.link-row { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.def-row p a { color: var(--accent); }
.def-row p a:hover { text-decoration: underline; text-underline-offset: 3px; }
.game-entry { scroll-margin-top: 96px; }
.game-entry + .game-entry { margin-top: var(--s10); }
.game-feature--next { margin-top: var(--s3); }

/* ---------- 스튜디오 소개 (메인) ---------- */
.studio-block { max-width: 640px; }
.studio-block .more-link { margin-top: var(--s4); }

/* ---------- CTA 밴드 ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  padding: var(--s10) var(--s5);
  text-align: center;
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(111, 132, 232, 0.1), transparent 60%),
    var(--bg-elev);
}
.cta-band h2 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.cta-band p { color: var(--muted); margin-top: var(--s2); }
.cta-band .btn { margin-top: var(--s4); }

/* ---------- 서브페이지 히어로 ---------- */
.page-hero {
  position: relative;
  padding-top: 180px;
  padding-bottom: var(--s8);
  overflow: hidden;
}
.page-hero .nebula--blue { width: 480px; height: 480px; top: -20%; right: -6%; }
.page-hero h1 {
  font-weight: 800;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.page-hero .section-sub { font-size: 17px; }

/* ---------- 정의형 리스트 (가치, 문화) ---------- */
.def-list { border-top: 1px solid var(--line); max-width: 860px; }
.def-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--s3);
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--line);
}
.def-row h3 { font-size: 18px; font-weight: 700; }
.def-row p { color: var(--muted); font-size: 15px; max-width: 56ch; }

/* ---------- 비전 ---------- */
.vision-title {
  font-size: clamp(24px, 3.4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  max-width: 720px;
}
.vision-body { max-width: 620px; margin-top: var(--s3); color: var(--muted); font-size: 16px; }

/* ---------- 타임라인 ---------- */
.timeline {
  position: relative;
  border-left: 1px solid var(--line-strong);
  padding-left: var(--s5);
  display: grid;
  gap: var(--s5);
  max-width: 640px;
}
.t-item { position: relative; }
.t-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--s5) - 4.5px);
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.t-item time {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.t-item p { margin-top: 4px; color: var(--muted); }
.history-note { margin-top: var(--s3); color: var(--faint); font-size: 13px; }

/* ---------- 문의 ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--s8);
  align-items: start;
}
.info-card {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  padding: var(--s4);
  display: grid;
  gap: var(--s3);
}
.info-item span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  margin-bottom: 4px;
}
.info-item a { color: var(--accent); }
.info-item p, .info-item a { font-size: 15px; }

/* ---------- 푸터 ---------- */
.site-footer {
  margin-top: var(--s15);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  padding: var(--s8) 0 var(--s5);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: var(--s6);
  flex-wrap: wrap;
}
.footer-brand { max-width: 320px; }
.footer-brand .brand { margin-bottom: var(--s2); }
.footer-brand p { color: var(--muted); font-size: 14px; }
.footer-col span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  margin-bottom: var(--s2);
}
.footer-col nav { display: grid; gap: 10px; }
.footer-col a { color: var(--muted); font-size: 14px; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--text); }
.footer-col p { color: var(--muted); font-size: 14px; }
.fine {
  margin-top: var(--s6);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  color: var(--faint);
  font-size: 13px;
}
.biz { display: flex; flex-wrap: wrap; gap: 4px 20px; }

/* ---------- 약관 · 방침 ---------- */
.legal { max-width: 760px; }
.legal > * + * { margin-top: 12px; }
.legal h2 {
  margin-top: var(--s6);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
}
.legal h2:first-child { margin-top: 0; }
.legal h3 { margin-top: var(--s3); font-size: 16px; font-weight: 600; }
.legal p, .legal li { color: var(--muted); font-size: 15px; }
.legal ul, .legal ol { padding-left: 1.2em; display: grid; gap: 6px; }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.table-wrap { overflow-x: auto; }
.legal table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 14px; }
.legal th, .legal td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  color: var(--muted);
}
.legal th { color: var(--text); font-size: 13px; font-weight: 600; }

/* 확률 정보: 등급별 항목 표는 접어 둔다 */
.rates-date { color: var(--faint); font-size: 14px; }
.rate-group { border-bottom: 1px solid var(--line); }
.rate-group summary {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}
.rate-group summary::-webkit-details-marker { display: none; }
.rate-group summary::after { content: '+'; color: var(--muted); }
.rate-group[open] summary::after { content: '\2212'; }
.rate-group table { min-width: 0; margin-bottom: 12px; }

/* 한/영 블록 전환: i18n.js 가 <html lang> 을 바꾼다 */
html[lang="en"] [data-only="ko"],
html:not([lang="en"]) [data-only="en"] { display: none !important; }

/* ---------- 리빌 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.65, 0.2, 1);
}
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 반응형 ---------- */
@media (max-width: 900px) {
  .nav { display: none; }
  .menu-btn { display: flex; }
  .section { padding-block: var(--s10); }
  .contact-grid { grid-template-columns: 1fr; gap: var(--s6); }
  .page-hero { padding-top: 150px; }
  .game-feature { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .def-row { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 560px) {
  .hero-ctas .btn { width: 100%; }
  .cta-band { padding: var(--s8) var(--s3); }
  .game-feature__body { padding: var(--s3); }

  /* 좁은 화면 헤더 압축 */
  .header-inner { gap: var(--s2); }
  .brand { gap: 8px; }
  .brand-mark { height: 24px; width: 24px; }
  .brand-name { font-size: 14px; }
  .lang-toggle button { padding: 5px 10px; font-size: 11px; }
  .menu-btn { width: 36px; height: 40px; }
}

/* ---------- 모션 최소화 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero .line > span { transform: none; animation: none; }
  .hero-sub, .hero-ctas { animation: none; opacity: 1; }
  .reveal { opacity: 1; transform: none; }
}
