/* One Stone Games — 단일 스타일시트. 외부 폰트도 스크립트도 없다.
   다크 단일 테마: 전시장 방향은 어두운 바닥 위에서만 성립한다. 키 아트 타일과
   배너는 밝은 바닥에서 색이 튀고 대비가 무너지므로, 두 세계를 어중간하게
   지원하는 대신 하나를 제대로 한다. */

:root {
  color-scheme: dark;

  --bg: #0b0e1a;
  --bg-alt: #10152a;
  --surface: #161d36;
  --surface-2: #1c2544;
  --border: #2a3555;
  --text: #eef1fa;
  --text-muted: #a9b2cd;
  --accent: #74b0ff;
  --accent-strong: #2a63d8;
  --accent-strong-2: #6a35d9;
  --on-accent: #ffffff;
  --focus: #ffd166;

  /* Minimum activation area for standalone links (WCAG 2.1 AA target size). */
  --tap: 44px;

  --wrap: 68rem;
  --wrap-narrow: 44rem;
  --radius: 14px;
  --radius-lg: 22px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--text);
}

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

h1,
h2,
h3 {
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.wrap--narrow {
  width: min(100% - 2.5rem, var(--wrap-narrow));
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg); /* fallback where color-mix is unsupported */
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
}

.brand__mark {
  border-radius: 9px;
  width: 36px;
  height: 36px;
}

.site-nav {
  margin-inline-start: auto;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

.site-nav__list a {
  color: var(--text-muted);
  text-decoration: none;
  padding-inline: 0.5rem;
}

.site-nav__list a:hover {
  color: var(--text);
  text-decoration: underline;
}

.lang-switch {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding-inline: 1rem;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  background: var(--surface-2);
}

.lang-switch:hover {
  border-color: var(--accent);
}

@media (max-width: 46rem) {
  .site-nav {
    order: 3;
    width: 100%;
    margin-inline-start: 0;
  }
  .lang-switch {
    margin-inline-start: auto;
  }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn--primary {
  background-image: linear-gradient(120deg, var(--accent-strong), var(--accent-strong-2));
  color: var(--on-accent);
}

.btn--primary:hover {
  filter: brightness(1.12);
  color: var(--on-accent);
}

.btn--ghost {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(3rem, 9vw, 6rem) clamp(2rem, 6vw, 4rem);
  background:
    radial-gradient(60rem 28rem at 50% -8rem, color-mix(in srgb, var(--accent-strong) 26%, transparent), transparent 70%),
    var(--bg);
  text-align: center;
}

.hero__icon {
  width: clamp(56px, 8vw, 72px);
  height: auto;
  border-radius: 24px;
}

.hero__eyebrow {
  margin: 1.25rem 0 0.5rem;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
}

.hero__title {
  font-size: clamp(2rem, 6vw, 3.4rem);
  margin-bottom: 0.5em;
  /*
   * Roughly the 12ch (Korean) / 15ch (Latin) measure the copy was written for,
   * expressed in em so it scales with the heading and stays wide enough for the
   * intended two-line break to hold in both languages — ch differs too much
   * between the Hangul and Latin faces to be safe here.
   */
  max-width: min(100%, 10em);
  margin-inline: auto;
  text-wrap: balance;
}

.hero__lead {
  max-width: 33rem;
  margin-inline: auto;
  color: var(--text-muted);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: 1.65;
  text-wrap: pretty;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
}

/* The hero centres its badges; the pricing claims sit in a left-aligned section. */
.badges--start {
  justify-content: flex-start;
  margin-top: 0.5rem;
}

.badge {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero__cta {
  margin-top: 1.5rem;
}

/* ---------- sections ---------- */

.section {
  padding-block: clamp(2.75rem, 7vw, 4.5rem);
  border-top: 1px solid var(--border);
}

.section--alt {
  background: var(--bg-alt);
}

.section--stores {
  text-align: center;
}

.section--contact {
  text-align: center;
}

.section__title {
  font-size: clamp(1.5rem, 3.6vw, 2.1rem);
}

.section__lead {
  color: var(--text-muted);
  max-width: 46rem;
}

.section--stores .section__lead,
.section--contact .section__lead {
  margin-inline: auto;
}

.section__note {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 1.5rem;
}

.section__action {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section--contact .section__action {
  justify-content: center;
}

/* ---------- scene ---------- */

.scene {
  margin: 2rem 0 0;
}

.scene img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: block;
  width: 100%;
  height: auto;
}

.scene figcaption {
  margin-top: 0.65rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  text-align: center;
}

/* ---------- store buttons ---------- */

.store-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 1.75rem;
}

.store-btn,
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
}

.download-btn {
  border-color: var(--accent);
}

.download-btn:hover,
.download-btn:focus-visible {
  background: var(--surface-2);
}

.downloads {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.downloads__title {
  margin: 0;
  font-size: 1.25rem;
}

.store-btn--soon {
  width: 10rem;
  min-height: 3.25rem;
  color: var(--text-muted);
  border-style: dashed;
  cursor: default;
}

.store-btn__badge {
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* ---------- cards ---------- */

.cards {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
}

.card__title {
  font-size: 1.1rem;
  margin-bottom: 0.4em;
}

.card__body {
  color: var(--text-muted);
  margin: 0;
}

/* ---------- other apps ---------- */

.apps__list-title {
  font-size: 1.15rem;
  margin-top: 2.5rem;
}

/* ---------- steps ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.step__label {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.step__title {
  font-size: 1.1rem;
}

.step__shot {
  margin-top: 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: block;
  width: 100%;
  height: auto;
}

.step__body {
  color: var(--text-muted);
  margin: 0;
}

/* ---------- donation ---------- */

.donate {
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1.6rem;
  max-width: 46rem;
}

.donate__title {
  font-size: 1.15rem;
}

.donate__body {
  color: var(--text-muted);
}

.donate__pending {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.donate__action {
  margin: 0;
}

/* ---------- hotspot guide ---------- */

.hotspot {
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1.6rem;
  max-width: 46rem;
}

.hotspot__title {
  font-size: 1.15rem;
  margin: 0;
}

.hotspot__lead {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.hotspot__list {
  margin: 1rem 0 0;
  padding-left: 1.4rem;
  display: grid;
  gap: 0.45rem;
}

.hotspot__tip {
  margin-top: 1.25rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hotspot__tip strong {
  color: var(--text);
}

/* ---------- screenshots ---------- */

.shots {
  margin-top: 2rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.shot {
  margin: 0;
}

.shot img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: block;
  width: 100%;
}

.shot__frame {
  aspect-ratio: 9 / 19.5;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: grid;
  place-items: center;
}

.shot__badge {
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  background: var(--surface-2);
}

.shot figcaption {
  margin-top: 0.65rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  text-align: center;
}

/* ---------- faq ---------- */

.faq {
  margin-top: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.faq__item + .faq__item {
  border-top: 1px solid var(--border);
}

.faq__q {
  cursor: pointer;
  padding: 1.1rem 1.35rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q::after {
  content: "+";
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
  flex: none;
}

.faq__item[open] .faq__q::after {
  content: "\2212";
}

.faq__q:hover {
  background: var(--surface-2);
}

.faq__a {
  padding: 0 1.35rem 1.25rem;
  color: var(--text-muted);
}

.faq__a p {
  margin: 0;
}

/* ---------- long-form pages ---------- */

.section--page {
  border-top: none;
}

.page__title {
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
}

.page__meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.page__lead {
  color: var(--text-muted);
}

.prose h2 {
  font-size: 1.25rem;
  margin-top: 2.25rem;
}

.prose ul {
  padding-inline-start: 1.2rem;
  color: var(--text-muted);
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose strong {
  color: var(--text);
}

.prose code {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 0.1em 0.4em;
  font-size: 0.92em;
}

.page__back {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.notfound__block + .notfound__block {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding-block: 2.5rem 1.75rem;
  font-size: 0.93rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
}

.site-footer__tagline {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.site-footer__meta {
  color: var(--text-muted);
  margin: 0.15rem 0;
}

.site-footer__nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.site-footer__nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding-inline: 0.25rem;
}

.site-footer__nav a:hover {
  color: var(--text);
  text-decoration: underline;
}

.site-footer__legal {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer__legal p {
  margin: 0.2rem 0;
}

/* ---------- target size ---------- */

/*
 * Standalone links get at least a 44x44 CSS px activation area. Short labels
 * such as "홈", "지원" or "기능" are only a couple of characters wide, so the
 * box — not the text — has to carry the minimum, in both directions. Declared
 * last so it wins over the per-component rules above, and using min-* only, so
 * longer labels still size to their content and nothing overflows at 320px.
 * Inline links inside prose are deliberately excluded (WCAG inline exception);
 * `.prose-link` opts in the ones that stand alone in their own paragraph.
 */
.brand,
.site-nav__list a,
.lang-switch,
.site-footer__nav a,
.site-footer__meta a,
.page__back a,
.prose-link,
.tile__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  min-width: var(--tap);
}

@media print {
  .site-header,
  .site-footer__nav,
  .skip-link {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
}

/* 앱마다 다른 것은 강조색 하나뿐이다. 문서는 <body class="app-<id>">만 들고 오고,
   실제 .app-<id> { --accent: ... } 규칙은 src/lib/theme.mjs가 앱 레지스트리에서
   생성해 /assets/css/app-accents.css로 낸다 — CSP가 style-src 'self'라 인라인
   스타일을 쓸 수 없고, 손으로 여기 추가하면 다섯 번째 앱은 "설정 하나·문구 두 개·
   이미지·등록 한 줄"이라는 약속을 못 지킨다. */

/* ── 타일 ─────────────────────────────────────────────────────
   키 아트가 카드를 채우고 글이 아래에 겹친다. 그림은 생성 스타일시트의
   .app-<id> .keyart 규칙이 넣는다 — CSP가 인라인 스타일을 막기 때문이다. */
.tiles {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.tile {
  position: relative; aspect-ratio: 3 / 4.1; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.tile__art {
  position: absolute; inset: 0;
  background-size: cover; background-repeat: no-repeat;
}
.tile__veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(4,6,14,.66) 64%, rgba(4,6,14,.94) 100%);
}
.tile__body { z-index: 1; padding: 1.1rem 1.1rem 1.2rem; }
.tile__name { font-size: 1.05rem; font-weight: 800; letter-spacing: -.015em; margin: 0 0 .3rem; }
.tile__link { color: #fff; text-decoration: none; }
/* 카드 전체를 누를 수 있게 링크를 넓힌다. 접근 가능한 이름은 글자에서 온다. */
.tile__link::after { content: ""; position: absolute; inset: 0; }
.tile__link:hover, .tile__link:focus-visible { text-decoration: underline; }
.tile__out { font-size: .85em; opacity: .8; }
.tile__line { font-size: .82rem; color: rgba(255,255,255,.76); margin: 0 0 .7rem; line-height: 1.45; }
.tile__state {
  display: inline-block; margin: 0; font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; padding: .22rem .6rem; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent);
}
.tile::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  pointer-events: none; box-shadow: inset 0 -3px 0 0 var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .tile__art { transition: transform .45s cubic-bezier(.2,.7,.3,1); }
  .tile:hover .tile__art { transform: scale(1.04); }
}

/* ── 허브 히어로 ──────────────────────────────────────────── */
.hero--hub { position: relative; overflow: hidden; }
.hero--hub .hero__art {
  position: absolute; inset: 0; background-size: cover; background-repeat: no-repeat;
  opacity: .34; filter: saturate(.8);
}
.hero--hub .hero__veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,14,26,.55) 0%, rgba(11,14,26,.88) 62%, var(--bg) 100%);
}
.hero--hub .hero__inner { position: relative; z-index: 1; }

/* ── 앱 페이지 배너 ───────────────────────────────────────────
   허브 히어로와 같은 얼개지만 더 낮고, 그림을 더 진하게 보여준다.
   앱 페이지에서는 그 앱의 세계가 주인공이기 때문이다. */
.hero--banner { position: relative; overflow: hidden; }
.hero--banner .hero__art {
  position: absolute; inset: 0; background-size: cover; background-repeat: no-repeat;
  opacity: .42;
}
.hero--banner .hero__veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(11,14,26,.35) 0%, rgba(11,14,26,.8) 70%),
    linear-gradient(180deg, rgba(11,14,26,.4) 0%, rgba(11,14,26,.9) 68%, var(--bg) 100%);
}
.hero--banner .hero__inner { position: relative; z-index: 1; }
.hero--banner .hero__icon {
  border-radius: 18px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.8);
}
