:root {
  color-scheme: light;
  --ipe-paper: #fbfaf4;
  --ipe-ink: #22302b;
  --ipe-footer: #24312b;
  --ipe-footer-text: #fbfaf4;
  --ipe-muted: #5f6b66;
  --ipe-line: rgba(34, 48, 43, 0.14);
  --ipe-line-strong: rgba(34, 48, 43, 0.22);
  --ipe-surface: rgba(255, 255, 255, 0.52);
  --ipe-surface-strong: rgba(255, 255, 255, 0.78);
  --ipe-shot-bg: #ddd8c9;
  --ipe-tint: rgba(34, 48, 43, 0.06);
  --btn-primary-bg: #24312b;
  --btn-primary-text: #fbfaf4;
  --body-glow-1: rgba(181, 31, 36, 0.04);
  --body-glow-2: rgba(34, 48, 43, 0.03);
  --wash-1: rgba(27, 36, 34, 0.42);
  --wash-2: rgba(27, 36, 34, 0.12);
  --wash-3: rgba(27, 36, 34, 0.22);
  --wash-blend: multiply;
  --hanji-line: rgba(34, 48, 43, 0.018);

  --game-red: #b41f24;
  --game-red-deep: #7e1116;
  --game-red-soft: rgba(180, 31, 36, 0.06);
  --game-red-line: rgba(180, 31, 36, 0.18);
  --game-red-text: #7e1116;

  --color-goguryeo: #B5574C;
  --color-baekje: #5079A8;
  --color-silla: #D3AB40;
  --color-gaya: #639C66;

  --font-title: "Lora", "AppleMyungjo", "Noto Serif KR", serif;
  --font-body: "Inter", "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem; --text-lg: 1.375rem;
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem; --space-5: 1.25rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --container: 72rem; --container-wide: 80rem;
  --radius-sm: 10px; --radius-md: 16px; --radius-lg: 24px;
  --hairline: 1px solid var(--ipe-line);
  --shadow-soft: 0 12px 28px rgba(34, 48, 43, 0.08);
  --shadow-ink: 0 24px 50px rgba(27, 36, 34, 0.16);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ipe-paper: #141a18;
    --ipe-ink: #e9e7dc;
    --ipe-footer: #0e1311;
    --ipe-footer-text: #e9e7dc;
    --ipe-muted: #a3aea8;
    --ipe-line: rgba(233, 231, 220, 0.14);
    --ipe-line-strong: rgba(233, 231, 220, 0.24);
    --ipe-surface: rgba(255, 255, 255, 0.04);
    --ipe-surface-strong: rgba(255, 255, 255, 0.07);
    --ipe-shot-bg: #222a27;
    --ipe-tint: rgba(233, 231, 220, 0.08);
    --btn-primary-bg: #e9e7dc;
    --btn-primary-text: #141a18;
    --body-glow-1: rgba(181, 31, 36, 0.10);
    --body-glow-2: rgba(233, 231, 220, 0.03);
    --wash-1: rgba(233, 231, 220, 0.20);
    --wash-2: rgba(233, 231, 220, 0.07);
    --wash-3: rgba(233, 231, 220, 0.10);
    --wash-blend: screen;
    --hanji-line: rgba(233, 231, 220, 0.03);
    --game-red-soft: rgba(220, 90, 95, 0.12);
    --game-red-line: rgba(220, 90, 95, 0.32);
    --game-red-text: #f0a0a2;
    --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.35);
    --shadow-ink: 0 24px 50px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ipe-paper: #141a18;
  --ipe-ink: #e9e7dc;
  --ipe-footer: #0e1311;
  --ipe-footer-text: #e9e7dc;
  --ipe-muted: #a3aea8;
  --ipe-line: rgba(233, 231, 220, 0.14);
  --ipe-line-strong: rgba(233, 231, 220, 0.24);
  --ipe-surface: rgba(255, 255, 255, 0.04);
  --ipe-surface-strong: rgba(255, 255, 255, 0.07);
  --ipe-shot-bg: #222a27;
  --ipe-tint: rgba(233, 231, 220, 0.08);
  --btn-primary-bg: #e9e7dc;
  --btn-primary-text: #141a18;
  --body-glow-1: rgba(181, 31, 36, 0.10);
  --body-glow-2: rgba(233, 231, 220, 0.03);
  --wash-1: rgba(233, 231, 220, 0.20);
  --wash-2: rgba(233, 231, 220, 0.07);
  --wash-3: rgba(233, 231, 220, 0.10);
  --wash-blend: screen;
  --hanji-line: rgba(233, 231, 220, 0.03);
  --game-red-soft: rgba(220, 90, 95, 0.12);
  --game-red-line: rgba(220, 90, 95, 0.32);
  --game-red-text: #f0a0a2;
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.35);
  --shadow-ink: 0 24px 50px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, var(--body-glow-1), transparent 24%),
    radial-gradient(circle at 80% 0%, var(--body-glow-2), transparent 20%),
    var(--ipe-paper);
  background-color: var(--ipe-paper);
  color: var(--ipe-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  overflow-x: hidden;
  word-break: normal;
  overflow-wrap: break-word;
}
img, svg, picture { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--game-red); outline-offset: 3px; }
::selection { background: rgba(180, 31, 36, 0.16); }

.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.container-wide { width: min(100% - 2rem, var(--container-wide)); margin-inline: auto; }
.section { padding-block: clamp(3rem, 6vw, 6rem); }
.section + .section { border-top: var(--hairline); }
.kicker { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ipe-muted); }
.h1, .h2, .h3 { font-family: var(--font-title); font-weight: 500; line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
.h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
.h2 { font-size: clamp(1.8rem, 3vw, 3rem); margin-top: var(--space-2); }
.h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.2rem); }

.skip-link { position: absolute; left: 1rem; top: 1rem; z-index: 100; padding: .75rem 1rem; background: var(--ipe-footer); color: var(--ipe-footer-text); border-radius: 999px; transform: translateY(-180%); transition: transform .18s ease; }
.skip-link:focus { transform: translateY(0); }


/* header */
.site-header { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: color-mix(in srgb, var(--ipe-paper) 84%, transparent); border-bottom: var(--hairline); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 44px; text-decoration: none; }
.brand .seal { width: 2.5rem; height: 2.5rem; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12), 0 6px 14px rgba(180,31,36,0.18); flex: 0 0 auto; }
.brand .seal::before { font-size: 1.35rem; }
.brand__text { display: grid; gap: 0.1rem; }
.brand__name { font-family: var(--font-title); font-size: 1.1rem; line-height: 1.1; }
.brand__sub { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ipe-muted); }
.nav { display: flex; align-items: center; gap: var(--space-2); }
.nav a { min-height: 44px; display: inline-flex; align-items: center; padding-inline: 0.5rem; color: var(--ipe-muted); text-decoration: none; }
.nav a:hover { color: var(--ipe-ink); }

/* seal */
.seal { display: inline-grid; place-items: center; width: 5rem; height: 5rem; border-radius: 18px; background: linear-gradient(180deg, #c63b3f, var(--game-red-deep)); color: #fbfaf4; position: relative; overflow: hidden; }
.seal::before { content: "統"; font-family: var(--font-title); font-size: 2rem; line-height: 1; position: relative; z-index: 1; }
.seal::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.18), transparent 30%), radial-gradient(circle at 30% 20%, rgba(255,255,255,0.16), transparent 24%); opacity: 0.7; }

/* hero */
.hero { padding-block: clamp(2.5rem, 8vw, 7rem); }
.hero__grid { display: grid; gap: var(--space-8); align-items: center; }
.hero__copy { min-width: 0; }
.hero__media { position: relative; order: -1; min-height: 16rem; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-lg); }
.hanji::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(90deg, var(--hanji-line) 0 1px, transparent 1px 11px), repeating-linear-gradient(0deg, var(--hanji-line) 0 1px, transparent 1px 13px); opacity: 0.5; pointer-events: none; }
.ink-wash { position: absolute; inset: 0; pointer-events: none; opacity: 0.95; }
.ink-wash::before, .ink-wash::after { content: ""; position: absolute; border-radius: 999px; background: radial-gradient(circle at 35% 40%, var(--wash-1), var(--wash-2) 40%, transparent 68%), radial-gradient(circle at 65% 60%, var(--wash-3), transparent 62%); transform: rotate(-8deg); mix-blend-mode: var(--wash-blend); }
.ink-wash::before { width: 18rem; height: 9rem; left: 50%; top: 50%; margin: -4.4rem 0 0 -9.5rem; }
.ink-wash::after { width: 12rem; height: 6rem; opacity: 0.68; left: 50%; top: 50%; margin: -1rem 0 0 -3rem; }
.hero__media .icon { position: relative; z-index: 2; width: min(9rem, 34vw); min-width: 7rem; aspect-ratio: 1; border-radius: 22%; overflow: hidden; box-shadow: var(--shadow-ink); }
.hero__media .icon img { width: 100%; height: 100%; object-fit: cover; }
.hero__badge { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 36px; padding: 0.3rem 0.9rem; margin-top: var(--space-3); border-radius: 999px; border: 1px solid var(--game-red-line); background: var(--game-red-soft); color: var(--game-red-text); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; }
.hero__title { margin-top: var(--space-4); }
.hero__title small { display: block; margin-top: var(--space-2); font-size: clamp(1.1rem, 2.4vw, 1.6rem); font-weight: 400; letter-spacing: 0.04em; color: var(--ipe-muted); }
.hero__intro { margin-top: var(--space-5); max-width: 34rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; padding: 0.8rem 1.25rem; border-radius: 999px; border: 1px solid transparent; text-decoration: none; font-family: inherit; font-size: 1rem; cursor: pointer; transition: transform 160ms ease, background-color 160ms ease; }
.btn:hover { transform: translateY(-1px); }
.btn--store { background: var(--btn-primary-bg); color: var(--btn-primary-text); opacity: 0.88; cursor: default; }
.btn--store:hover { transform: none; }
.btn--store small { font-family: var(--font-mono); font-size: var(--text-xs); padding: 0.1rem 0.5rem; border-radius: 999px; background: rgba(128,128,128,0.28); }
.btn--secondary { border-color: var(--ipe-line-strong); background: var(--ipe-surface); color: var(--ipe-ink); }

/* features */
.feature-grid { display: grid; gap: var(--space-4); margin-top: var(--space-8); }
.feature-card { padding: var(--space-6); border: var(--hairline); border-radius: var(--radius-md); background: var(--ipe-surface); box-shadow: var(--shadow-soft); }
.feature-card__tag { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ipe-muted); }
.feature-card__title { margin: var(--space-2) 0 0; font-family: var(--font-title); font-weight: 500; font-size: var(--text-lg); line-height: 1.2; }
.feature-card__text { margin-top: var(--space-3); color: var(--ipe-muted); }
.nations { display: flex; gap: 0.4rem; margin-top: var(--space-4); }
.nations span { width: 1.5rem; height: 1.5rem; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }

/* shots */
.shots { display: grid; gap: var(--space-4); margin-top: var(--space-8); }
.shot { margin: 0; padding: var(--space-3); border: var(--hairline); border-radius: var(--radius-lg); background: var(--ipe-surface-strong); box-shadow: var(--shadow-soft); }
.shot__frame { overflow: hidden; border-radius: calc(var(--radius-lg) - 8px); background: var(--ipe-shot-bg); border: var(--hairline); aspect-ratio: 1200 / 554; }
.shot__frame img { width: 100%; height: 100%; object-fit: cover; }
.shot figcaption { margin-top: var(--space-3); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ipe-muted); }

/* footer */
.site-footer { background: var(--ipe-footer); color: var(--ipe-footer-text); padding-block: var(--space-12); margin-top: var(--space-12); }
.site-footer a { color: inherit; }
.site-footer__inner { display: grid; gap: var(--space-6); }
.site-footer__meta { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-2); opacity: 0.78; font-family: var(--font-mono); font-size: var(--text-xs); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; opacity: 0.9; }

@media (min-width: 760px) {
  .hero__grid { grid-template-columns: 1.1fr 0.9fr; }
  .hero__media { order: 0; min-height: 22rem; }
  .hero__media .icon { width: 10rem; }
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-footer__inner { grid-template-columns: 1fr auto; align-items: end; }
}
@media (max-width: 759px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
}
@media (max-width: 420px) {
  .feature-card, .shot { padding: var(--space-4); }
  .site-footer { padding-block: var(--space-10); }
  .ink-wash::before { width: 15rem; height: 7.5rem; margin: -3.7rem 0 0 -8rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .btn:hover { transform: none; }
}

/* legal / support / 404 */
.doc { padding-block: clamp(2.5rem, 6vw, 5rem); }
.doc__body { max-width: 44rem; }
.doc h1 { font-family: var(--font-title); font-weight: 500; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; letter-spacing: -0.02em; margin: var(--space-2) 0 var(--space-3); }
.doc h2 { font-family: var(--font-title); font-weight: 500; font-size: 1.3rem; margin: var(--space-10) 0 var(--space-3); }
.doc p, .doc li { color: var(--ipe-ink); }
.doc p + p { margin-top: var(--space-3); }
.doc ul { margin: var(--space-3) 0 0; padding-left: 1.25rem; }
.doc li + li { margin-top: var(--space-2); }
.doc .meta { color: var(--ipe-muted); font-size: var(--text-sm); }
.doc a { color: var(--game-red-text); }
.callout { margin-top: var(--space-6); padding: var(--space-5); border: 1px solid var(--game-red-line); background: var(--game-red-soft); border-radius: var(--radius-md); }
.doc__links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-8); }
.doc__links a { min-height: 44px; display: inline-flex; align-items: center; }

/* i18n */
html:lang(ko) body { word-break: keep-all; }
html:lang(ja) { --font-body: "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "Meiryo", -apple-system, sans-serif; --font-title: "Lora", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; }
html:lang(zh) { --font-body: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, sans-serif; --font-title: "Lora", "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif; }
html:lang(ru) .h1, html:lang(de) .h1, html:lang(vi) .h1 { overflow-wrap: anywhere; }
.faq-q { margin-top: var(--space-5); font-size: 1.15rem; }
.nf-list { margin: var(--space-8) 0 0; padding: var(--space-5) 0 0; border-top: var(--hairline); list-style: none; }
.nf-list li { margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.nf-list .msg { color: var(--ipe-muted); margin-right: 0.4rem; }
.nf-list a { display: inline-flex; align-items: center; min-height: 44px; }
.foot-langs { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid rgba(251,250,244,0.14); font-size: var(--text-xs); }
.foot-langs a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; opacity: 0.72; }
.foot-langs a:hover, .foot-langs a[aria-current] { opacity: 1; text-decoration: underline; }
.lang-hint { position: fixed; z-index: 30; left: 50%; bottom: 1rem; transform: translateX(-50%); display: flex; align-items: center; gap: var(--space-2); max-width: calc(100% - 2rem); padding: 0 0.25rem 0 1rem; border-radius: 999px; background: var(--ipe-footer); color: var(--ipe-footer-text); box-shadow: var(--shadow-ink); }
.lang-hint[hidden] { display: none; }
.lang-hint a { color: inherit; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; font-weight: 500; }
.lang-hint button { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: inherit; font-size: 1.25rem; cursor: pointer; }
