/* bang9.dev 공용 스타일 — 머리·꼬리·첫 화면 상자·앱 페이지 뼈대.
   앱 페이지(/apps/<서비스>/)는 이 파일 위에 그 서비스의 색·글꼴·장난감을 페이지 안 <style> 로 얹는다.
   색은 :root 토큰만 바꾼다 — 앱 페이지는 body 클래스에서 같은 토큰을 다시 정한다. */
:root {
  color-scheme: light dark;
  --bg: #efefec;
  --surface: #ffffff;
  --ink: #18181a;
  --ink2: #4d4d52;
  --ink3: #76767c;
  --line: #d9d9d4;
  --accent: #18181a;
  --accent-ink: #ffffff;
  --radius: 18px;
  --max: 1120px;
  --read: 700px;
  --sans: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141416; --surface: #1d1d20; --ink: #ededea; --ink2: #b4b4b0; --ink3: #8a8a86; --line: #2e2e33;
    --accent: #ededea; --accent-ink: #141416;
  }
}
:root[data-theme="dark"] {
  --bg: #141416; --surface: #1d1d20; --ink: #ededea; --ink2: #b4b4b0; --ink3: #8a8a86; --line: #2e2e33;
  --accent: #ededea; --accent-ink: #141416;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.7 var(--sans);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* 머리 */
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 800; }

main { padding-bottom: 56px; }

/* 글자 */
h1 { font-size: 28px; line-height: 1.3; margin: 0 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 21px; line-height: 1.4; margin: 40px 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 17px; line-height: 1.5; margin: 24px 0 6px; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin: 4px 0; }
.muted { color: var(--ink3); font-size: 14px; }
.lead { font-size: 18px; color: var(--ink2); margin-bottom: 20px; }
.read { max-width: var(--read); padding-top: 24px; }
.links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.links a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: 15px; }
.read a { color: var(--ink); }
.table-wrap { overflow-x: auto; margin: 0 0 16px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 420px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink2); font-weight: 600; }

/* 첫 화면 — 앱마다 상자 하나를 크기를 섞어 빈틈없이 쌓는다(큰 상자 옆에 긴 상자, 그 밑에 작은 상자). 누르면 바로 그 앱(스토어·사이트)으로.
   자리는 상자마다 열·줄 번호로 직접 — 넓은 화면(열 열두 개)·폰(폭이 다른 두 열) 각각. 상자를 더하면 두 곳에 자리를 같이 정한다.
   첫 화면만 너비를 태블릿 폭으로 묶는다(body.home) */
.home .wrap { max-width: 768px; }
.hero { padding: 28px 0 22px; }
.hero h1 { font-size: clamp(30px, 6vw, 48px); line-height: 1.12; letter-spacing: -0.04em; font-weight: 800; margin: 0; }
.boxes { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 10px; gap: 10px; }
/* 자리(열 / 줄) — 줄 하나 = 10px + 틈. 옆 열과 이음매가 겹치지 않게 엇갈려 놓는다 */
.box.randomair { grid-column: 1 / 8; grid-row: 1 / 18; }
.box.viva { grid-column: 8 / 13; grid-row: 1 / 15; }
.box.ttang { grid-column: 8 / 13; grid-row: 15 / 29; }
.box.buddies { grid-column: 1 / 5; grid-row: 18 / 31; }
.box.ponte { grid-column: 5 / 8; grid-row: 18 / 29; }
.box.sajuclub { grid-column: 1 / 5; grid-row: 31 / 50; }
.box.winterlog { grid-column: 5 / 13; grid-row: 29 / 40; }
.box.wooju { grid-column: 5 / 13; grid-row: 40 / 50; }
.box.chalang { grid-column: 1 / 13; grid-row: 50 / 64; }
.box { position: relative; overflow: hidden; border-radius: 24px; text-decoration: none; color: #fff; isolation: isolate; box-shadow: 0 12px 26px -18px rgba(20, 20, 40, .45); transition: transform .35s cubic-bezier(.2, .8, .3, 1.3); }
.box:hover, .box:focus-visible { transform: translateY(-4px) rotate(var(--tilt, -1deg)); }
.box > .art { position: absolute; inset: 0; z-index: -1; }
.box > .art img { width: 100%; height: 100%; object-fit: cover; }
.box .tag { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 17px; background: rgba(255, 255, 255, .95); color: #18181a; }
.box.long .tag { right: auto; max-width: calc(60% - 8px); }
.box.dark .tag { background: rgba(14, 14, 20, .62); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.box.dark .tag small { color: rgba(255, 255, 255, .72); }
.box.big .tag { left: 12px; right: 12px; bottom: 12px; padding: 10px 14px 10px 10px; border-radius: 19px; }
.box.big .tag img { width: 44px; height: 44px; border-radius: 12px; }
.box.big .tag b { font-size: 19px; }
.box.big .tag small { font-size: 13.5px; }
.box .tag img { flex: none; width: 36px; height: 36px; border-radius: 10px; }
.box .tag span { min-width: 0; }
.box .tag b { display: block; font-size: 15.5px; line-height: 1.25; letter-spacing: -0.01em; }
.box .tag small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; line-height: 1.4; color: #5c5c63; }
.box .to { position: absolute; top: 10px; right: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #18181a; font-size: 11.5px; font-weight: 700; line-height: 1.6; }

.box.randomair { --tilt: .8deg; background: #0d2547 linear-gradient(160deg, #0d2547, #1d3f78 70%, #3a5f9e); }
.box.randomair .art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(#fff 1px, transparent 1.6px), radial-gradient(rgba(255, 255, 255, .55) 1px, transparent 1.4px); background-size: 52px 52px, 31px 31px; background-position: 0 0, 17px 11px; opacity: .6; }
.box.randomair .ticket { position: absolute; left: 50%; top: 28%; width: min(80%, 340px); transform: translate(-50%, -50%) rotate(-5deg); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; padding: 16px 18px 18px; border-radius: 14px; background: #fff; color: #0d2547; box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .5); transition: transform .5s cubic-bezier(.2, .8, .3, 1.3); }
.box.randomair .ticket::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 9px; border-top: 2px dashed #c8d3e6; }
.box.randomair .ticket b { font: 800 clamp(26px, 6vw, 40px)/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .02em; }
.box.randomair .ticket b:last-child { text-align: right; color: #2f7de1; }
.box.randomair .ticket i { font-style: normal; font-size: 22px; color: #2f7de1; }
.box.randomair .ticket small { grid-column: 1 / -1; display: flex; justify-content: space-between; font: 700 10px/1 ui-monospace, Menlo, monospace; letter-spacing: .08em; color: #8494b0; margin-top: 2px; }
.box.randomair:hover .ticket, .box.randomair:focus-visible .ticket { transform: translate(-50%, -54%) rotate(-2deg); }

.box.viva { --tilt: -1.2deg; background: #efe7d9; }
.box.viva .art img { position: absolute; left: 50%; top: 6px; width: 112%; height: auto; transform: translateX(-50%) rotate(-4deg); object-fit: contain; transition: transform .6s cubic-bezier(.2, .8, .3, 1.3); }
.box.viva:hover .art img, .box.viva:focus-visible .art img { transform: translateX(-50%) rotate(4deg); }

.box.wooju { --tilt: -.8deg; background: #04060c; background-image: radial-gradient(1px 1px at 12% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 46% 70%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 30% 46%, #cfd9ff 50%, transparent 51%), radial-gradient(1px 1px at 58% 14%, #fff 50%, transparent 51%); background-size: 140px 140px; }
.box.wooju .globe { position: absolute; right: 9%; top: 50%; width: 150px; height: 150px; margin-top: -75px; border-radius: 50%; background: #0b2a5a url(/img/wooju/earth.webp) 0 0 / auto 100% repeat-x; box-shadow: 0 0 40px 2px rgba(94, 160, 255, .35); animation: spin 30s linear infinite; }
.box.wooju .globe::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .2), transparent 42%), radial-gradient(circle, transparent 52%, rgba(2, 6, 16, .6) 74%, rgba(2, 6, 16, .95) 100%), linear-gradient(110deg, transparent 45%, rgba(0, 0, 8, .55) 78%); }
.box.wooju .to { right: auto; left: 10px; }
@keyframes spin { to { background-position-x: -300px; } }

.box.sajuclub { --tilt: 1.2deg; background: #000; }
.box.sajuclub .art img { object-position: 50% 22%; }
.box.sajuclub .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #000 8%, transparent 45%); }

.box.buddies { --tilt: 1.4deg; background: #8ccdff; background-image: conic-gradient(#8ccdff 25%, #a6daff 0 50%, #8ccdff 0 75%, #a6daff 0); background-size: 26px 26px; }
.box.buddies .art img { position: absolute; width: auto; object-fit: contain; image-rendering: pixelated; }
.box.buddies .art .pet { left: 50%; top: 12px; height: 54%; transform: translateX(-50%); }
.box.buddies .art .f1 { left: 7%; top: 22%; height: 24%; transform: rotate(-8deg); }
.box.buddies .art .f2 { right: 6%; top: 32%; height: 22%; transform: rotate(9deg); }

.box.ttang { --tilt: -1.4deg; background: #49b6ff; }
.box.ttang .art img { object-position: 50% 28%; }

.box.ponte { --tilt: 1deg; background: #f1f1fb; }
.box.ponte .keys { position: absolute; top: calc(50% - 56px); left: 0; right: 0; display: flex; justify-content: center; gap: 7px; }
.box.ponte .keys span { display: grid; place-items: center; width: min(44px, 26%); aspect-ratio: 1; border-radius: 11px; background: linear-gradient(#fff, #f0f0f6); border: 1px solid #d8d8e6; box-shadow: 0 3px 0 #cfcfe0; font-size: 19px; color: #2e2b55; transition: transform .2s, box-shadow .2s; }
.box.ponte .keys span:last-child { color: #4f46e5; }
.box.ponte:hover .keys span, .box.ponte:focus-visible .keys span { transform: translateY(2px); box-shadow: 0 1px 0 #cfcfe0; }

.box.winterlog { --tilt: -.8deg; background: #0e1528; }
.box.winterlog .art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(#fff 1px, transparent 1.6px), radial-gradient(rgba(255, 255, 255, .6) 1px, transparent 1.4px); background-size: 46px 46px, 29px 29px; background-position: 0 0, 13px 17px; opacity: .55; }
.box.winterlog .art img { position: absolute; right: 9%; top: 16px; width: 30%; height: auto; object-fit: contain; transform: rotate(7deg); border-radius: 14px; box-shadow: 0 20px 40px rgba(0, 0, 0, .4); transition: transform .5s cubic-bezier(.2, .8, .3, 1.3); }
.box.winterlog:hover .art img, .box.winterlog:focus-visible .art img { transform: rotate(3deg) translateY(-6px); }

.box.chalang { --tilt: .8deg; background: #bfe7f6; }
.box.chalang .art img { object-position: 50% 30%; transition: transform .6s cubic-bezier(.2, .8, .3, 1.3); }
.box.chalang:hover .art img, .box.chalang:focus-visible .art img { transform: scale(1.06) translateY(-2%); }

.apps-more { margin: 18px 0 0; font-size: 13.5px; color: var(--ink3); }
.apps-more a { color: var(--ink2); }

@media (max-width: 600px) {
  .boxes { grid-template-columns: 1.08fr 1fr; gap: 8px; }
  .box.randomair { grid-column: 1 / 3; grid-row: 1 / 14; }
  .box.viva { grid-column: 1; grid-row: 14 / 30; }
  .box.ttang { grid-column: 2; grid-row: 14 / 24; }
  .box.buddies { grid-column: 2; grid-row: 24 / 36; }
  .box.winterlog { grid-column: 1; grid-row: 30 / 48; }
  .box.sajuclub { grid-column: 2; grid-row: 36 / 58; }
  .box.ponte { grid-column: 1; grid-row: 48 / 58; }
  .box.wooju { grid-column: 1 / 3; grid-row: 58 / 66; }
  .box.chalang { grid-column: 1 / 3; grid-row: 66 / 78; }
  .box { border-radius: 20px; }
  .box .tag { left: 6px; right: 6px; bottom: 6px; gap: 8px; padding: 7px 8px 7px 7px; border-radius: 15px; }
  .box .tag img { width: 30px; height: 30px; border-radius: 8px; }
  .box .tag b { font-size: 14px; letter-spacing: -0.02em; }
  .box .tag small { font-size: 11.5px; }
  .box.big .tag { left: 8px; right: 8px; bottom: 8px; padding: 8px 10px 8px 8px; border-radius: 16px; }
  .box.big .tag img { width: 36px; height: 36px; border-radius: 10px; }
  .box.big .tag b { font-size: 16px; }
  .box.big .tag small { font-size: 12px; }
  .box .to { top: 8px; right: 8px; font-size: 10.5px; padding: 2px 8px; }
  .box.wooju .to { left: 8px; }
  .box.wooju .globe { width: 120px; height: 120px; margin-top: -60px; right: 8%; }
  @keyframes spin { to { background-position-x: -240px; } }
  .box.ponte .keys { gap: 6px; top: 36px; }
  .box.ponte .keys span { width: 36px; font-size: 16px; border-radius: 9px; }
  .box.winterlog .art img { left: 50%; right: auto; width: 66%; transform: translateX(-50%) rotate(7deg); }
  .box.winterlog:hover .art img, .box.winterlog:focus-visible .art img { transform: translateX(-50%) rotate(3deg) translateY(-6px); }
  .box.winterlog.long .tag { right: 6px; max-width: none; }
  .box.ttang .tag small, .box.buddies .tag small, .box.ponte .tag small { display: none; }
}

/* 앱 페이지 뼈대 */
.app-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; padding: 28px 0 40px; }
.app-intro .icon { width: 64px; height: 64px; border-radius: 15px; margin-bottom: 20px; }
.app-intro h1 { font-size: clamp(36px, 5.4vw, 60px); line-height: 1.05; letter-spacing: -0.04em; margin: 0 0 14px; }
.app-line { font-size: 18px; line-height: 1.6; color: var(--ink2); margin: 0 0 26px; max-width: 22em; }
.go { display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 22px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; }
.toy { position: relative; min-width: 0; overflow-x: clip; }
.hint { font-size: 13.5px; color: var(--ink3); margin: 10px 2px 0; }

.shots { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; padding: 4px 16px 18px; margin: 0 -16px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.shots img { flex: none; height: 440px; width: auto; border-radius: 16px; scroll-snap-align: start; background: var(--surface); }
.shots.wide img { height: 340px; }

.next { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.next a { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; text-decoration: none; color: var(--ink2); font-size: 15px; }
.next a:hover { color: var(--ink); }
.next img { width: 36px; height: 36px; border-radius: 9px; }
.next small { display: block; font-size: 12.5px; color: var(--ink3); line-height: 1.3; }
.next b { display: block; color: var(--ink); line-height: 1.3; }
.next .to-next { text-align: right; flex-direction: row-reverse; }

@media (max-width: 860px) {
  .app-hero { grid-template-columns: 1fr; gap: 28px; padding-top: 16px; }
  .shots img { height: 380px; }
  .shots.wide img { height: 220px; }
}

/* 꼬리 */
.foot { border-top: 1px solid var(--line); padding: 24px 0 36px; color: var(--ink3); font-size: 13.5px; line-height: 1.7; }
.foot p { margin: 0; }
.foot a { color: var(--ink2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
