/* chain2d.com — 한 파일. 밝은 화면이 기본, 어두운 화면은 기기 설정을 따른다. */
:root {
  --bg: #ffffff; --fg: #111111; --muted: #6f6f73; --faint: #9a9aa0; --line: #e8e8eb; --soft: #f5f5f7;
  --bar: #000000; --bar-fg: #ffffff; --accent: #111111; --link: #1f5ad1; --warn: #fff3cf;
  --wide: 1120px; --doc: 760px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121214; --fg: #ececee; --muted: #a3a3aa; --faint: #7c7c84; --line: #2a2a2f; --soft: #1b1b1f;
    --link: #8fb2ff; --warn: #3b3218;
  }
}
:root[data-theme="dark"] {
  --bg: #121214; --fg: #ececee; --muted: #a3a3aa; --faint: #7c7c84; --line: #2a2a2f; --soft: #1b1b1f;
  --link: #8fb2ff; --warn: #3b3218;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.7 "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
img { max-width: 100%; display: block; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 8px; z-index: 20; background: var(--bg); color: var(--fg); padding: 8px 12px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* 머리 띠 */
.bar { position: sticky; top: 0; z-index: 10; background: var(--bar); color: var(--bar-fg); }
.bar-in { max-width: var(--wide); margin: 0 auto; padding: 0 16px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { color: var(--bar-fg); text-decoration: none; font-weight: 900; font-size: 1.35rem; letter-spacing: .12em; }
.bar nav { display: flex; gap: 22px; }
.bar nav a { color: #d6d6da; text-decoration: none; font-size: .78rem; font-weight: 600; letter-spacing: .14em; }
.bar nav a:hover { color: #fff; }

/* 넓은 쪽 (첫 화면·게임) */
main.wide { max-width: var(--wide); margin: 0 auto; padding: 0 16px; }
.hero { margin: 32px 0 0; background: #0f0f10; color: #fff; border-radius: 20px; overflow: hidden; display: grid; grid-template-columns: 5fr 7fr; align-items: center; }
.hero-text { padding: 40px 40px 40px 48px; }
.hero .eyebrow { margin: 0 0 12px; font-size: .74rem; font-weight: 700; letter-spacing: .2em; color: #a8a8b0; }
.hero h1, .hero h2 { margin: 0; font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.15; font-weight: 900; letter-spacing: -.01em; }
.hero p.tag { margin: 14px 0 0; color: #c9c9cf; font-size: 1.02rem; }
.hero .cta { display: inline-block; margin-top: 26px; padding: 11px 22px; border-radius: 999px; background: #fff; color: #111; text-decoration: none; font-weight: 700; font-size: .92rem; }
.hero img { width: 100%; height: 100%; aspect-ratio: 16 / 7; object-fit: cover; }

.section { padding: 88px 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section h2.label { margin: 0; font-size: .82rem; font-weight: 800; letter-spacing: .22em; color: var(--fg); }
.section .lead { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; line-height: 1.35; max-width: 760px; }
.section .body { color: var(--muted); max-width: 680px; margin: 16px 0 0; }

.games { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 28px; }
.game { text-decoration: none; color: var(--fg); display: block; }
.game .shot { position: relative; border-radius: 16px; overflow: hidden; background: var(--soft); aspect-ratio: 16 / 7; }
.game .shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.game:hover .shot img { transform: scale(1.03); }
.game .chip { position: absolute; left: 14px; bottom: 14px; background: rgba(0, 0, 0, .72); color: #fff; font-weight: 800; font-size: .86rem; padding: 6px 12px; border-radius: 8px; letter-spacing: .02em; }
.game h3 { margin: 16px 0 2px; font-size: 1.3rem; font-weight: 900; letter-spacing: .01em; }
.game p { margin: 0; color: var(--faint); font-size: .88rem; letter-spacing: .04em; }

.contact-mail { display: inline-block; margin-top: 18px; font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 800; color: var(--fg); text-decoration: none; border-bottom: 2px solid var(--fg); }

/* 게임 쪽 */
.game-intro { padding: 40px 0 0; }
.game-intro .genre { margin: 0; color: var(--faint); font-size: .82rem; font-weight: 700; letter-spacing: .18em; }
.game-intro h1 { margin: 6px 0 4px; font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; line-height: 1.2; }
.game-intro .en { color: var(--muted); font-weight: 600; font-size: .5em; margin-left: 8px; letter-spacing: .04em; }
.game-intro p.tag { margin: 0; color: var(--muted); font-size: 1.05rem; }
.keyart { margin: 28px 0 0; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 7; background: var(--soft); }
.keyart img { width: 100%; height: 100%; object-fit: cover; }
.status { display: inline-block; margin: 16px 0 0; padding: 4px 12px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: .84rem; font-weight: 600; }
.status:empty { display: none; }
.stores { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0 0; }
.btn { display: inline-block; padding: 10px 20px; border-radius: 10px; background: var(--fg); color: var(--bg); text-decoration: none; font-weight: 700; }
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 20px 0 0; padding: 0; list-style: none; }
.links a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--fg); font-weight: 700; }
.links a span { display: block; color: var(--faint); font-weight: 500; font-size: .84rem; margin-top: 2px; }
.links a:hover { border-color: var(--fg); }

/* 문서 쪽 (방침·약관·공시) */
main.doc { max-width: var(--doc); margin: 0 auto; padding: 8px 16px 0; }
.crumb { margin: 36px 0 0; font-size: .86rem; }
.crumb a { color: var(--muted); text-decoration: none; font-weight: 600; }
main.doc h1 { font-size: 1.9rem; line-height: 1.3; margin: 6px 0 12px; font-weight: 900; }
main.doc h1:first-child { margin-top: 40px; }
main.doc h2 { font-size: 1.2rem; margin: 44px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); font-weight: 800; }
main.doc h3 { font-size: 1.02rem; margin: 28px 0 6px; font-weight: 800; }
.date, .sum, .note-list { color: var(--muted); font-size: .9rem; }
.draft, .callout { background: var(--warn); padding: 10px 14px; border-radius: 10px; font-size: .92rem; }
mark.todo { background: var(--warn); color: inherit; padding: 0 4px; border-radius: 4px; }
code { font-size: .86em; background: var(--soft); padding: 1px 5px; border-radius: 4px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.toc a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--fg); font-size: .86rem; font-weight: 600; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 10px 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-weight: 700; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
details { border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; padding: 4px 14px; }
summary { cursor: pointer; font-weight: 700; padding: 6px 0; }

/* 바닥 */
.foot { margin-top: 120px; border-top: 1px solid var(--line); color: var(--faint); font-size: .8rem; line-height: 1.75; }
.foot-in { max-width: var(--wide); margin: 0 auto; padding: 36px 16px 48px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 10px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--fg); text-decoration: underline; }
.foot-title { color: var(--fg); font-weight: 700; margin-right: 4px; }
.biz { margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 0 18px; }
.biz div { display: flex; gap: 6px; }
.biz dt { flex: none; }
.biz dd { margin: 0; color: var(--muted); }
.copy { margin: 14px 0 0; }

@media (max-width: 760px) {
  .bar-in { height: 54px; }
  .bar nav { gap: 14px; }
  .bar nav a { font-size: .7rem; letter-spacing: .1em; }
  .wordmark { font-size: 1.15rem; }
  .hero { grid-template-columns: 1fr; border-radius: 16px; margin-top: 20px; }
  .hero img { order: -1; }
  .hero-text { padding: 26px 22px 30px; }
  .section { padding-top: 64px; }
  .games { grid-template-columns: 1fr; gap: 36px; }
  .keyart { border-radius: 14px; }
  .foot { margin-top: 80px; }
}
@media (prefers-reduced-motion: reduce) { .game .shot img { transition: none; } }
