/* 밤티 컴퍼니 — 한지 · 장터 톤, 모바일 우선
   스크롤은 브라우저 기본 그대로 둔다 (scroll-snap · 화면 고정 효과 없음). */

/* 글꼴: 저장소의 OFL 글꼴을 사이트에 쓰는 글자만 남겨 woff2 로 줄였다 (tool/fonts.py, 라이선스는 /fonts/) */
@font-face {
  font-family: "BamtiKo";
  src: url("/fonts/display-ko.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "BamtiLatin";
  src: url("/fonts/display-latin.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #4a2c1c;
  --ink-soft: #8a5a3c;
  --ink-text: #5e4030;
  --paper: #fff4dc;
  --card: rgba(255, 252, 244, 0.72);
  --hair: rgba(74, 44, 28, 0.13);
  --link: #b4532a;
  --display: "BamtiKo", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Hiragino Maru Gothic ProN",
    "Noto Sans KR", "Noto Sans JP", "Segoe UI", sans-serif;
  /* 한지 결 — 화면에 고정된 덧칠 레이어 대신 각 배경의 한 겹으로 (스크롤 중 다시 그리지 않음) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .3 0 0 0 0 .18 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  --pad-x: 24px;
  --section-y: clamp(80px, 16vw, 132px);
}
:lang(en) { --display: "BamtiLatin", "Arial Rounded MT Bold", sans-serif; }
:lang(ja) { --display: "BamtiLatin", "Hiragino Maru Gothic ProN", "Noto Sans JP", sans-serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; } /* "게임 보기 ↓" 같은 페이지 안 링크에만 적용된다 */
}
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(74, 44, 28, 0.08);
}
:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
p, li, h1, h2 { text-wrap: pretty; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid #e0913f; outline-offset: 3px; border-radius: 8px; }

/* 언어 — 첫 화면 오른쪽 위에만 (스크롤하면 같이 올라가서 내용을 가리지 않는다) */
.langs {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 10;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 250, 238, 0.78);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 2px 10px rgba(74, 44, 28, 0.1);
  font-size: 13px;
  line-height: 1;
}
.langs a {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-soft);
}
.langs a[aria-current] { background: var(--ink); color: #fff6e6; }
.langs-sm { position: static; box-shadow: none; background: rgba(255, 255, 255, 0.5); }

/* ───── 첫 화면 ───── */
.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px); /* 다음 섹션이 아래에 살짝 보이게 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 92px var(--pad-x) 96px;
  text-align: center;
  background:
    var(--grain),
    radial-gradient(circle at 50% 64%, #ffd9a0 0, #ffe6bd 32%, rgba(255, 236, 200, 0) 62%),
    var(--paper);
}
.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(50px, 14.5vw, 124px);
  line-height: 1.04;
  margin: 0;
  letter-spacing: -0.01em;
  word-break: keep-all;
}
:lang(en) .hero h1, :lang(ja) .hero h1 { font-size: clamp(38px, 10.5vw, 88px); line-height: 1.12; }
.tagline {
  font-family: var(--display);
  font-size: clamp(19px, 5vw, 28px);
  line-height: 1.4;
  color: var(--ink-soft);
  margin: 12px 0 0;
  word-break: keep-all;
}
:lang(en) .tagline, :lang(ja) .tagline { font-size: clamp(15px, 4.2vw, 22px); }
.hero-art { position: relative; width: min(86vw, 440px); }
.bamti { width: 82%; margin: 0 auto; filter: drop-shadow(0 14px 18px rgba(120, 70, 20, 0.18)); }
.friends { display: flex; justify-content: center; margin-top: -9%; }
.friend { width: 17%; margin: 0 -1.2%; filter: drop-shadow(0 6px 8px rgba(120, 70, 20, 0.16)); }
.friend.f1, .friend.f4 { transform: translateY(14%); }
.friend.f2, .friend.f3 { transform: translateY(26%); }
.scroll {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}

/* ───── 게임 섹션 ───── */
.game {
  position: relative;
  overflow: hidden;
  padding: var(--section-y) var(--pad-x);
}
.game .inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 40px;
  justify-items: center;
  text-align: center;
}
.text { display: grid; justify-items: center; position: relative; z-index: 2; max-width: 32rem; }
.icon {
  width: 84px;
  border-radius: 23%;
  box-shadow: 0 8px 20px rgba(74, 44, 28, 0.2), 0 0 0 3px rgba(255, 255, 255, 0.75);
  margin-bottom: 18px;
}
.game h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(42px, 11.5vw, 68px);
  line-height: 1.08;
  margin: 0;
  word-break: keep-all;
}
:lang(en) .game h2, :lang(ja) .game h2 { font-size: clamp(32px, 9vw, 54px); }
.logo-title { margin: 0; }
.logo { width: min(70vw, 340px); filter: drop-shadow(0 6px 10px rgba(120, 70, 20, 0.15)); }
.line {
  font-family: var(--display);
  font-size: clamp(20px, 5.4vw, 26px);
  line-height: 1.35;
  color: var(--accent, var(--ink));
  margin: 12px 0 0;
  word-break: keep-all;
}
:lang(en) .line, :lang(ja) .line { font-size: clamp(16px, 4.4vw, 21px); }
.desc {
  margin: 14px 0 0;
  max-width: 26em;
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-text);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
:lang(en) .desc { word-break: normal; }
.cta { display: grid; justify-items: center; gap: 6px; margin-top: 26px; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.store {
  display: inline-grid;
  justify-items: center;
  align-content: center;
  min-width: 180px;
  min-height: 56px;
  padding: 8px 24px;
  border-radius: 14px;
  background: #2b1a10;
  color: #fff6e6;
  text-decoration: none;
  line-height: 1.15;
  box-shadow: 0 5px 0 rgba(43, 26, 16, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.store small { font-size: 11px; opacity: 0.8; letter-spacing: 0.02em; }
.store b { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
@media (hover: hover) {
  .store:hover { transform: translateY(-2px); box-shadow: 0 7px 0 rgba(43, 26, 16, 0.22); }
}
.store:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(43, 26, 16, 0.22); }
.policy {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--ink-soft);
  text-underline-offset: 3px;
}

.arts {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: min(90vw, 460px);
}
.art { width: 31%; filter: drop-shadow(0 10px 12px rgba(60, 40, 20, 0.16)); }
.art1 { width: 40%; margin: 0 -3%; position: relative; z-index: 1; }

/* 게임별 색 — 각자 개성, 같은 종이결 · 같은 글꼴 · 같은 버튼 */
.theme-pang {
  --accent: #c2492f;
  background:
    var(--grain),
    radial-gradient(circle, rgba(255, 255, 255, 0.55) 0 3px, transparent 4px) 0 0 / 34px 34px,
    linear-gradient(180deg, #ffd9c7, #ffeadf);
}
.theme-go {
  --accent: #2f6a9e;
  padding-bottom: calc(var(--section-y) + 24px);
  background:
    var(--grain),
    radial-gradient(ellipse 120% 72px at 50% 100%, #a9dc8c 98%, transparent 100%),
    linear-gradient(180deg, #bfe4ff, #e6f5ff 70%);
}
.theme-market {
  --accent: #a8422c;
  padding-top: calc(var(--section-y) + 40px);
  background: var(--grain), #ffefc8;
}
.theme-market::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  background: repeating-linear-gradient(90deg, #d9483b 0 44px, #fff6e8 44px 88px);
  -webkit-mask: radial-gradient(22px 14px at 22px 54px, transparent 98%, #000) 0 0 / 44px 100%;
  mask: radial-gradient(22px 14px at 22px 54px, transparent 98%, #000) 0 0 / 44px 100%;
}
.theme-onepath {
  --accent: #3a63b8;
  background:
    var(--grain),
    linear-gradient(rgba(70, 140, 220, 0.1) 2px, transparent 2px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgba(70, 140, 220, 0.1) 2px, transparent 2px) 0 0 / 44px 44px,
    #e8f4ff;
}

/* ───── 움직임 ───── */
@media (prefers-reduced-motion: no-preference) {
  .hero-text { animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-art { animation: rise 0.9s 0.12s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .scroll { animation: fade 0.8s 0.6s both; }
  .bamti { animation: bob 3.2s ease-in-out infinite; }
  .friend { animation: hop 2.6s ease-in-out infinite; }
  .friend.f1 { animation-delay: -0.4s; } .friend.f2 { animation-delay: -0.8s; }
  .friend.f3 { animation-delay: -1.2s; } .friend.f4 { animation-delay: -1.6s; }
  .friend.f5 { animation-delay: -2s; }
  .art1 { animation: bob 3.6s ease-in-out infinite; }
  .scroll span { display: inline-block; animation: bob 1.6s ease-in-out infinite; }

  /* 스크롤로 들어올 때 살짝 떠오르기 (JS 가 html.rv-on 을 붙였을 때만 — JS 가 없으면 그냥 보인다) */
  .rv-on .rv {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
    transition:
      opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--d, 0) * 80ms),
      transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--d, 0) * 80ms);
  }
  .rv-on .rv.in { opacity: 1; transform: none; }
}
@keyframes bob { 50% { translate: 0 -8px; } }
@keyframes hop { 50% { translate: 0 -6px; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }

/* ───── 푸터 ───── */
.site-foot {
  background: var(--ink);
  color: #f7e6cc;
  text-align: center;
  padding: 36px var(--pad-x) calc(32px + env(safe-area-inset-bottom));
  font-size: 13px;
}
.site-foot p { margin: 0; }
.site-foot .copy { font-family: "BamtiKo", var(--body); font-size: 18px; margin-bottom: 6px; }
.foot-links { display: flex; justify-content: center; align-items: center; gap: 2px; }
.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 8px;
  color: #f7e6cc;
  text-decoration: none;
  opacity: 0.85;
}
.foot-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot-links .sup { opacity: 0.6; }
.foot-links span { opacity: 0.4; }

/* ───── 문서 페이지 (정책 · 지원 · 404) ───── */
.plain { background: var(--grain), var(--paper); }
.topbar {
  max-width: 760px;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px;
  font-family: var(--display);
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
}
.back span { color: var(--ink-soft); }
.page { max-width: 760px; margin: 0 auto; padding: 28px 22px 88px; min-height: 70vh; }
.page h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 9vw, 46px);
  line-height: 1.15;
  margin: 0;
}
.page .sub { color: var(--ink-soft); margin: 6px 0 0; font-size: 15px; }
.meta { color: var(--ink-soft); font-size: 14px; margin: 10px 0 0; }
.meta span { display: block; }

/* 정책 */
.doc-head { padding: 8px 0 28px; border-bottom: 1px dashed rgba(74, 44, 28, 0.25); }
.doc-icon { width: 60px; border-radius: 23%; box-shadow: 0 4px 12px rgba(74, 44, 28, 0.16); margin-bottom: 16px; }
.eyebrow { font-family: var(--display); font-size: 18px; color: var(--ink-soft); margin: 0 0 4px; }
.toc {
  margin: 28px 0 8px;
  padding: 16px 20px 12px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 2px 10px rgba(74, 44, 28, 0.06);
}
.toc p { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.04em; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li a {
  display: block;
  padding: 6px 0;
  font-size: 14.5px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hair);
}
.toc li:last-child a { border-bottom: 0; }
.toc.jump div { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 6px; }
.toc.jump a, .chips a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--hair);
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
}
.prose { font-size: 16px; line-height: 1.8; color: var(--ink-text); word-break: keep-all; overflow-wrap: anywhere; }
.prose :is(h2, h3, h4) { color: var(--ink); line-height: 1.4; scroll-margin-top: 20px; }
.prose h2 { font-size: 20px; margin: 44px 0 10px; letter-spacing: -0.01em; }
.prose h3 { font-size: 17px; margin: 28px 0 6px; }
.prose h4 { font-size: 16px; margin: 22px 0 4px; }
.prose p { margin: 10px 0; }
.prose ul { padding-left: 1.2em; margin: 10px 0; }
.prose li { margin: 6px 0; }
.prose strong, .prose b { color: var(--ink); }
.prose a { color: var(--link); text-underline-offset: 3px; }
.prose .lead { font-size: 17px; color: var(--ink); margin-top: 28px; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 15px;
  line-height: 1.6;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
}
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--hair); }
.prose tr:last-child > * { border-bottom: 0; }
.prose th { color: var(--ink); font-weight: 600; background: rgba(255, 230, 190, 0.45); }
.prose td:first-child { white-space: nowrap; color: var(--ink); }
.lang-sec { padding-top: 8px; }
.lang-sec + .lang-sec { margin-top: 56px; border-top: 1px dashed rgba(74, 44, 28, 0.25); }
.lang-sec > h2 { font-size: 23px; margin-top: 36px; }
.lang-sec > .meta { margin-top: -2px; }

/* 지원 · 정책 목록 */
.support .lead { font-size: 18px; color: var(--ink); margin: 18px 0 18px; line-height: 1.6; }
.mail {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff6e6;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.note { color: var(--ink-text); font-size: 15px; line-height: 1.7; margin: 14px 0 0; }
.note a { color: var(--link); text-underline-offset: 3px; }
.support h2 { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 52px 0 14px; }
.game-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.policies { margin-top: 28px; }
.game-list li {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 2px 10px rgba(74, 44, 28, 0.06);
}
.mini-icon { width: 56px; flex: none; border-radius: 23%; box-shadow: 0 3px 8px rgba(74, 44, 28, 0.15); }
.game-list b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; line-height: 1.3; }
.game-list li span { display: block; font-size: 14px; color: var(--ink-soft); }
.game-list .links a { display: inline-block; padding: 6px 0; color: var(--ink); text-underline-offset: 3px; }
.chips { display: flex !important; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* 404 */
.nf { text-align: center; }
.nf-bamti { width: 200px; margin: 20px auto 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff6e6;
  text-decoration: none;
}

/* ───── 데스크톱 ───── */
@media (min-width: 900px) {
  :root { --pad-x: 6vw; --section-y: 128px; }
  .hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    text-align: left;
    gap: 3vw;
    min-height: min(calc(100svh - 72px), 900px);
    padding: 96px var(--pad-x);
  }
  .hero-text { justify-self: end; }
  .hero-art { justify-self: start; width: min(42vw, 580px); }
  .game .inner { grid-template-columns: 1fr 1fr; align-items: center; gap: 72px; }
  .text { justify-items: start; text-align: left; }
  .cta { justify-items: start; }
  .stores { justify-content: flex-start; }
  .policy { padding-left: 2px; }
  .game:nth-of-type(odd) .text { order: 2; }
  .icon { width: 104px; }
  .game h2 { white-space: nowrap; }
  :lang(ja) .game h2 { font-size: 50px; }
  .arts { width: 100%; max-width: 580px; }
  .art1 { width: 44%; }
  .logo { width: 380px; }
  .theme-market { padding-top: calc(var(--section-y) + 30px); }
  .page { padding-top: 40px; }
  .prose { font-size: 16.5px; }
}
