/* Shared chrome for the studio's legal pages — Terms and Privacy.
 * Paper aesthetic, single readable column. The brand fonts come from
 * the home page's @font-face declarations (defined inline in each
 * legal HTML head so the page is self-contained even without the home
 * page being loaded first). */

:root {
  --legal-paper:    #F5F1E8;
  --legal-ink:      #1F2128;
  --legal-ink-soft: rgba(31, 33, 40, 0.70);
  --legal-ink-mute: rgba(31, 33, 40, 0.45);
  --legal-rule:     rgba(31, 33, 40, 0.12);
  --legal-sage:     #6B8F60;
  --legal-amber-soft: rgba(232, 165, 61, 0.16);
  --font-latin:  'Cafe24 Decobox', 'Geist', system-ui, -apple-system, sans-serif;
  --font-korean: 'Cafe24 Ssurround', 'Pretendard Variable', 'Pretendard',
                 -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --font-mono:   'Geist Mono', ui-monospace, monospace;
  --legal-col:   720px;
}

html, body { margin: 0; padding: 0; background: var(--legal-paper); }
body {
  font-family: var(--font-korean);
  color: var(--legal-ink);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}
body *  { box-sizing: border-box; }
img     { max-width: 100%; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--legal-sage);
  outline-offset: 3px;
}

/* ── Top nav — minimal back link + studio mark ───────────────── */
.legal-topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(245, 241, 232, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1.5px solid var(--legal-rule);
}
.legal-topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex; align-items: center; gap: 20px;
}
.legal-back {
  /* Logo lockup sized to match the home nav (home-paper.jsx HomeNav):
     48×43 mark, 2px gap, 18px uppercase wordmark. */
  display: inline-flex; align-items: center; gap: 2px;
  text-decoration: none;
  color: var(--legal-ink);
  font-family: var(--font-latin);
  font-weight: 700; font-size: 18px; letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.legal-back:hover { color: var(--legal-sage); }
.legal-back-mark {
  width: 48px; height: 43px;
  background-color: var(--legal-ink);
  -webkit-mask: url('/assets/logos/logo_no_letter.png') center / contain no-repeat;
  mask: url('/assets/logos/logo_no_letter.png') center / contain no-repeat;
  transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.legal-back:hover .legal-back-mark { background-color: var(--legal-sage); }

/* Terms / Privacy nav links — styled to match the home nav's
   Works / Connect links (home-paper.jsx PaperNavLink). */
.legal-navlink {
  text-decoration: none;
  color: var(--legal-ink);
  font-family: var(--font-latin);
  font-weight: 500; font-size: 14px; letter-spacing: -0.005em;
  transition: color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.legal-navlink:hover { color: var(--legal-sage); }

/* ── Document column ─────────────────────────────────────────── */
.legal-main {
  padding: 64px 32px 96px;
}
.legal-article {
  max-width: var(--legal-col);
  margin: 0 auto;
  font-size: 16px; line-height: 1.75;
  color: var(--legal-ink);
  text-wrap: pretty;
}

/* ── Headings ────────────────────────────────────────────────── */
.legal-article h1 {
  font-family: var(--font-korean);
  font-weight: 700;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  color: var(--legal-ink);
}
.legal-article h2 {
  font-family: var(--font-korean);
  font-weight: 700;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 56px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--legal-rule);
  color: var(--legal-ink);
}
.legal-article h2:first-of-type { /* first section under metadata */
  margin-top: 56px;
}
.legal-article h3 {
  font-family: var(--font-korean);
  font-weight: 700;
  font-size: 18px;
  margin: 32px 0 12px;
  color: var(--legal-ink);
}

/* ── Body — paragraphs, lists, emphasis ──────────────────────── */
.legal-article p {
  margin: 12px 0;
  color: var(--legal-ink-soft);
}
.legal-article p strong,
.legal-article li strong { color: var(--legal-ink); font-weight: 700; }
.legal-article em { font-style: normal; color: var(--legal-ink); }
.legal-article a {
  color: var(--legal-sage);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.legal-article a:hover { color: var(--legal-ink); }

.legal-article ul, .legal-article ol { padding-left: 24px; margin: 12px 0; }
.legal-article ul li, .legal-article ol li {
  margin: 6px 0;
  color: var(--legal-ink-soft);
}
.legal-article ul li::marker { color: var(--legal-sage); }
.legal-article ol li::marker { color: var(--legal-sage); font-variant-numeric: tabular-nums; }

/* Strong-prefixed list items (often bold short label, then desc) */
.legal-article li > strong:first-child { color: var(--legal-ink); }

/* ── Tables (privacy.md has three) ───────────────────────────── */
.legal-table-wrap {
  margin: 20px 0 28px;
  overflow-x: auto;
  border: 1px solid var(--legal-rule);
  border-radius: 8px;
}
.legal-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.legal-article th, .legal-article td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--legal-rule);
}
.legal-article th {
  background: rgba(31, 33, 40, 0.04);
  font-weight: 700;
  color: var(--legal-ink);
  font-size: 13px;
}
.legal-article tr:last-child td { border-bottom: none; }

/* ── Horizontal rule (markdown ---) ──────────────────────────── */
.legal-article hr {
  border: none;
  border-top: 1px dashed var(--legal-rule);
  margin: 40px 0;
}

/* ── Document metadata block (top of doc, paragraphs of **버전**) */
.legal-article > p:first-of-type {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--legal-ink-mute);
  background: rgba(31, 33, 40, 0.03);
  border-left: 3px solid var(--legal-sage);
  padding: 14px 16px;
  margin: 24px 0 0;
  border-radius: 0 6px 6px 0;
}
.legal-article > p:first-of-type strong {
  color: var(--legal-ink);
  font-weight: 700;
}

/* The metadata block ends with the first --- (hr). Cluster all leading
 * paragraphs into the same visual group by removing the gap and the
 * underline rule on the first h2 after the hr — handled visually by
 * the existing h2 border-top. */
