/* 술값 저금통 — site styles. Tokens mirror the app (DESIGN.md §2). */
:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --sub: #F2F4F6;
  --ink: #191F28;
  --muted: #6B7684;
  --faint: #B0B8C1;
  --line: #E5E8EB;
  --brand: #12B886;
  --brand-ink: #087F5B; /* brand text on light surfaces (AA contrast) */
  --brand-soft: #E6F8F1;
  --on-brand: #FFFFFF;
  --moderate: #F59F00;
  --heavy: #F03E3E;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1115;
    --surface: #1A1D24;
    --sub: #242833;
    --ink: #F2F4F7;
    --muted: #9AA3B2;
    --faint: #5C6370;
    --line: #2A2F3A;
    --brand: #7CE0B3;
    --brand-ink: #7CE0B3;
    --brand-soft: #1E3A30;
    --on-brand: #0F1115;
    --moderate: #F5C66B;
    --heavy: #F28B82;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Hiragino Sans",
        "Segoe UI", Roboto, "Noto Sans KR", "Noto Sans JP", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}
:lang(ja) body, body:lang(ja) { word-break: normal; line-break: strict; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
b, strong { font-weight: 700; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* header */
header.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
header.nav .wrap { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.langs { margin-left: auto; display: flex; gap: 4px; font-size: 14px; }
.langs a { color: var(--muted); text-decoration: none; padding: 6px 8px; border-radius: 999px; }
.langs a[aria-current="true"] { color: var(--brand-ink); background: var(--brand-soft); font-weight: 700; }

main { padding: 28px 0 40px; }

/* cards & type */
.card { background: var(--surface); border-radius: 20px; padding: 20px; margin: 0 0 12px; }
.card.soft { background: var(--brand-soft); }
h1 { font-size: 28px; line-height: 1.3; letter-spacing: -.02em; margin: 8px 0 6px; }
h2 { font-size: 19px; line-height: 1.4; margin: 36px 0 10px; letter-spacing: -.01em; scroll-margin-top: 72px; }
h3 { font-size: 16px; margin: 20px 0 6px; }
p { margin: 0 0 12px; }
.meta { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.muted { color: var(--muted); }
small, .small { font-size: 13px; color: var(--muted); }
ul, ol { padding-left: 1.3em; margin: 0 0 12px; }
li { margin: 4px 0; }
.summary ul { margin: 0; }
.summary li::marker { color: var(--brand-ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

/* table of contents */
nav.toc { font-size: 15px; }
nav.toc ol { margin: 0; columns: 2 220px; column-gap: 24px; }
nav.toc a { color: var(--ink); text-decoration: none; }
nav.toc a:hover { color: var(--brand-ink); text-decoration: underline; }

/* tables (scroll sideways on narrow phones) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.55; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
tr:last-child th, tr:last-child td { border-bottom: 0; }
th { background: var(--sub); font-weight: 700; white-space: nowrap; }
table.kv th { width: 30%; white-space: normal; }
@media (max-width: 560px) {
  /* key/value tables stack on phones instead of scrolling sideways */
  table.kv th, table.kv td { display: block; width: auto; }
  table.kv th { border-bottom: 0; padding-bottom: 2px; }
  table.kv tr:last-child th { border-bottom: 0; }
  table.kv tr:not(:last-child) td { border-bottom: 1px solid var(--line); }
}

.callout { border-left: 4px solid var(--heavy); background: var(--surface); border-radius: 0 14px 14px 0; padding: 14px 16px; margin: 0 0 12px; }

/* landing */
.hero { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: center; padding: 12px 0 8px; }
.hero h1 { font-size: clamp(30px, 7vw, 42px); line-height: 1.2; margin: 0 0 12px; }
.hero .lede { color: var(--muted); font-size: 17px; margin: 0 0 18px; }
.gani { background: var(--surface); border-radius: 28px; padding: 12px; width: 100%; max-width: 260px; justify-self: center; }
.gani img { width: 100%; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 16px; background: var(--brand); color: var(--on-brand); font-weight: 700; text-decoration: none; }
.pill.ghost { background: var(--surface); color: var(--ink); }
.features { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 24px 0 8px; }
.features .card { margin: 0; }
.features h3 { margin: 0 0 4px; }
.features p { margin: 0; color: var(--muted); font-size: 15px; }
details { background: var(--surface); border-radius: 16px; padding: 14px 16px; margin: 0 0 8px; }
details summary { cursor: pointer; font-weight: 700; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: "–"; }
details p { margin: 10px 0 0; color: var(--muted); }
.contact { text-align: center; }
.contact .email { font-size: 20px; font-weight: 700; }

@media (min-width: 720px) {
  .hero { grid-template-columns: 1.2fr .8fr; gap: 40px; padding: 28px 0 8px; }
  .gani { max-width: 320px; }
  .features { grid-template-columns: repeat(3, 1fr); }
  h1 { font-size: 32px; }
}

/* footer */
footer { border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: 14px; color: var(--muted); }
footer .links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }
footer a { color: var(--muted); }
