/* 토큰 = design.md 팔레트(신문 용지·관인). 앱 AppColors 와 같은 계열. */
:root {
  --bg: #DDD2B3;        /* paperDark — 책상 */
  --paper: #EDE4CF;     /* 낱장 */
  --surface: #F4EDDC;   /* 투표용지·편지 */
  --ink: #221D14;
  --muted: #5C5344;     /* inkFaded */
  --line: #8A7A52;
  --edge: #C9BFA6;      /* 낱장 가장자리 */
  --accent: #A6321F;    /* 관인 빨강 */
  --on-accent: #EDE4CF;
  --navy: #2E4256;
  --gold: #D6C38E;
  --serif: 'Noto Serif KR', serif;
  --sans: 'IBM Plex Sans KR', sans-serif;
  --btn-radius: 4px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
img { max-width: 100%; }

/* ---- 지원·방침 공용 ---- */
.site-header { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 3px double var(--ink); max-width: 760px; margin: 0 auto; }
.brand { font-family: var(--serif); font-weight: 900; color: var(--ink); text-decoration: none; letter-spacing: .04em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 12px; font-size: 14px; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
main h1, main h2 { font-family: var(--serif); line-height: 1.35; }
main h2 { margin-top: 2em; font-size: 1.15rem; }
main h3 { font-family: var(--serif); font-size: 1rem; margin: 1.4em 0 .2em; }
.lead { color: var(--muted); }
.faq-list details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq-list summary { cursor: pointer; font-weight: 500; }
.support-form { display: grid; gap: 12px; }
.support-form input, .support-form select, .support-form textarea { width: 100%; max-width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--btn-radius); background: var(--surface); color: var(--ink); font: inherit; }
.support-form button { min-height: 48px; padding: 10px 16px; border: 0; border-radius: var(--btn-radius); background: var(--ink); color: var(--on-accent); font: inherit; font-weight: 500; cursor: pointer; }
.policy .meta { color: var(--muted); }
.policy table { width: 100%; border-collapse: collapse; font-size: 14px; margin: .6em 0; }
.policy th, .policy td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.policy th { background: var(--surface); font-weight: 500; }
.policy .table-wrap { overflow-x: auto; }
footer { padding: 24px 16px; color: var(--muted); text-align: center; font-size: 14px; }
footer a.privacy-link { font-weight: 500; color: var(--ink); }

/* ---- 신문 판(index) : 기본 = 세로 스택 ---- */
.paper-page { padding: 16px; }
.paper-wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.stage { width: 100%; }
.book { display: flex; flex-direction: column; gap: 16px; }
.toc-page, .face, .base { background: var(--paper); border: 1px solid var(--edge); font-family: var(--serif); color: var(--ink); }
.toc-page { padding: 24px 20px; display: flex; flex-direction: column; gap: 18px; }
.sheets { display: flex; flex-direction: column; gap: 16px; }
.sheet { display: flex; flex-direction: column; gap: 16px; }
.face { padding: 24px 20px 32px; display: flex; flex-direction: column; gap: 16px; position: relative; }
.base { display: none; }
.flip-only { display: none; }

.mast { display: flex; align-items: flex-end; gap: 14px; border-bottom: 3px double var(--ink); padding-bottom: 14px; }
.mast .seal { flex: none; width: 40px; height: 40px; background: var(--accent); color: var(--on-accent); font-weight: 900; font-size: 13px; display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; letter-spacing: .1em; border-radius: 2px; }
.mast h1 { margin: 0; font-weight: 900; font-size: 30px; line-height: 1; letter-spacing: .06em; }
.mast .en { display: block; font-family: var(--sans); font-size: 12px; letter-spacing: .24em; color: var(--muted); margin-top: 8px; }
.toc-title { font-weight: 900; font-size: 18px; margin: 0; }
.toc-list { display: flex; flex-direction: column; }
.toc { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dotted var(--line); font-size: 15px; text-decoration: none; color: var(--ink); line-height: 1.5; }
.toc:hover { color: var(--accent); }
.toc-note { margin: 0; font-size: 13px; line-height: 1.8; color: var(--muted); font-family: var(--sans); }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border: 1px solid var(--ink); background: var(--paper); border-radius: var(--btn-radius); font-family: var(--sans); font-size: 14px; color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { color: var(--ink); background: var(--surface); }
.btn.k { background: var(--ink); color: var(--on-accent); }
.btn.k:hover { color: var(--on-accent); background: #3a3224; }
.btn.full { width: 100%; height: 48px; }
.btn:focus-visible, .toc:focus-visible, .play:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.face h2 { margin: 0; font-weight: 900; font-size: 26px; line-height: 1.25; }
.face h2.big { font-size: 30px; line-height: 1.2; letter-spacing: -.01em; }
.face p { margin: 0; font-family: var(--sans); font-size: 14px; line-height: 1.8; }
.face p.muted { color: var(--muted); font-size: 13px; }
.pg { font-family: var(--sans); font-size: 11px; color: var(--muted); }

/* 영상 썸네일 */
.play { position: relative; display: block; width: 100%; border: 1px solid var(--ink); padding: 0; background: var(--ink); cursor: pointer; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 0; }
.play img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; }
.play .tri { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(237, 228, 207, .92); display: flex; align-items: center; justify-content: center; }
.player { position: relative; width: 100%; aspect-ratio: 16 / 10; background: var(--ink); border: 1px solid var(--ink); }
.player video, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }

/* 2면 타일 */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--ink); background: var(--surface); display: flex; flex-direction: column; text-decoration: none; color: var(--ink); }
.tile img { width: 100%; height: 100px; object-fit: cover; display: block; border-bottom: 1px solid var(--ink); }
.tile span { padding: 6px 10px 8px; display: flex; flex-direction: column; font-family: var(--sans); font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.tile b { font-family: var(--serif); font-size: 14px; color: var(--ink); font-weight: 700; }

/* 4면 편지 */
.letter { background: var(--surface); border: 1px solid var(--ink); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.letter .who { font-family: var(--sans); font-size: 11px; color: var(--muted); }
.letter.dev { background: var(--paper); margin-left: 36px; }
.letter.me { margin-right: 36px; }
.chip { position: absolute; right: 14px; top: 12px; padding: 4px 8px; border: 2px solid var(--accent); color: var(--accent); border-radius: 3px; font-weight: 900; font-size: 11px; transform: rotate(-7deg); }

/* 5면 투표용지 */
.ballot { border: 1px solid var(--ink); outline: 2px double var(--ink); outline-offset: -6px; padding: 24px 22px 18px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); }
.ballot-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.ballot-head small { font-family: var(--sans); font-size: 11px; letter-spacing: .26em; color: var(--muted); }
.ballot-head strong { font-weight: 900; font-size: 19px; letter-spacing: .08em; }
.ballot table { width: 100%; border-collapse: collapse; }
.ballot td { border: 1px solid var(--ink); padding: 10px 12px; }
.ballot td.no { text-align: center; font-weight: 900; font-size: 18px; width: 40px; padding: 10px 6px; }
.ballot td.box { width: 70px; padding: 8px; }
.ballot td.box i { display: block; height: 40px; border: 1px solid var(--ink); background: var(--paper); }
.ballot .t { font-weight: 700; font-size: 16px; display: block; }
.ballot .e { font-family: var(--sans); font-size: 11px; color: var(--muted); }
.ballot-foot { display: flex; justify-content: space-between; align-items: center; font-family: var(--sans); font-size: 11px; color: var(--muted); }
.stamp { width: 34px; height: 34px; border: 2px solid var(--accent); border-radius: 50%; color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 15px; }
.stamp.hit { animation: stamp 120ms ease-out both; }
@keyframes stamp { from { transform: scale(1.4); } to { transform: scale(1); } }

/* 6면 받는 곳 */
.apps { display: flex; flex-direction: column; }
.app-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 9px 0; border-bottom: 1px dotted var(--line); min-height: 52px; }
.app-row a.name { font-weight: 700; font-size: 14px; text-decoration: none; line-height: 1.4; }
.app-row a.name:hover { color: var(--accent); }
.badges { display: flex; align-items: center; gap: 8px; }
.badges img { height: 30px; width: auto; display: block; }
.foot-links { font-family: var(--sans); font-size: 12px; color: var(--muted); line-height: 1.7; }
.foot-links a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { .stamp.hit { animation: none; } }

/* ---- 넘기기 판 (JS 가 html.flip 을 붙인다 · 721px 이상) ---- */
html.flip body { overflow-x: hidden; }
html.flip .paper-wrap { max-width: 1200px; }
html.flip .stage { position: relative; }
html.flip .book { display: block; position: absolute; left: 0; top: 0; width: 1200px; height: 800px; transform-origin: 0 0; box-shadow: 0 40px 80px rgba(34, 29, 20, .35); gap: 0; }
html.flip .toc-page { position: absolute; left: 0; top: 0; width: 600px; height: 800px; padding: 40px 44px; gap: 20px; border-right: 1px solid var(--edge); box-shadow: inset -24px 0 30px -28px rgba(34, 29, 20, .45); }
html.flip .mast h1 { font-size: 40px; }
html.flip .base { display: block; position: absolute; left: 600px; top: 0; width: 600px; height: 800px; background: var(--bg); border: 0; padding: 40px 44px; }
html.flip .base p { position: absolute; left: 44px; bottom: 22px; margin: 0; font-family: var(--sans); font-size: 11px; color: var(--muted); }
html.flip .sheets { display: block; position: absolute; left: 600px; top: 0; width: 600px; height: 800px; perspective: 2600px; gap: 0; }
html.flip .sheet { display: block; position: absolute; left: 0; top: 0; width: 600px; height: 800px; transform-origin: left center; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.45, .05, .2, 1); gap: 0; }
html.flip .face { position: absolute; inset: 0; width: 600px; height: 800px; backface-visibility: hidden; padding: 40px 44px; gap: 18px; overflow: hidden; border: 0; }
html.flip .face.front { border-left: 1px solid var(--edge); box-shadow: inset 24px 0 30px -28px rgba(34, 29, 20, .45); }
html.flip .face.back { transform: rotateY(180deg); border-right: 1px solid var(--edge); box-shadow: inset -24px 0 30px -28px rgba(34, 29, 20, .45); }
html.flip .face h2 { font-size: 34px; }
html.flip .face h2.big { font-size: 42px; line-height: 1.16; }
html.flip .flip-only { display: inline-flex; position: absolute; bottom: 44px; }
html.flip .flip-only.next { right: 44px; }
html.flip .flip-only.prev { left: 44px; }
html.flip .pg { position: absolute; bottom: 22px; }
html.flip .face.front .pg { right: 44px; }
html.flip .face.back .pg { left: 44px; }
html.flip .play { max-height: 300px; aspect-ratio: auto; height: 300px; }
html.flip .player { height: 300px; aspect-ratio: auto; }
html.flip .tile img { height: 100px; }

@media (prefers-reduced-motion: reduce) { html.flip .sheet { transition: none; } }
