/* Shared styles for the text pages (소개, 개인정보처리방침, 문의, 404). Tokens mirror index.html. */
:root {
  --bg: #e9edf3;
  --surface: #ffffff;
  --ink: #1b2131;
  --muted: #5b6477;
  --line: #d3d9e4;
  --accent: #4a5bd4;
  --accent-ink: #ffffff;
  --accent-soft: #e3e7fb;
  --empty: #edf0f5;
  --ok: #2b8a5e;
  --f-display: "Silkscreen", "JetBrains Mono", monospace;
  --f-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --f-num: "JetBrains Mono", ui-monospace, "Consolas", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11141c; --surface: #191e2b; --ink: #e6eaf3; --muted: #98a1b4; --line: #2b3245;
    --accent: #8394ff; --accent-ink: #10132a; --accent-soft: #252c4d; --empty: #161a25; --ok: #4cc38a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11141c; --surface: #191e2b; --ink: #e6eaf3; --muted: #98a1b4; --line: #2b3245;
  --accent: #8394ff; --accent-ink: #10132a; --accent-soft: #252c4d; --empty: #161a25; --ok: #4cc38a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.75; }
a { color: var(--accent); text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page { max-width: 1320px; margin: 0 auto; padding-inline: 16px; padding-block: 16px 32px; display: grid; gap: 24px; }

/* header shared with the app */
.site-header { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand strong { display: block; font-size: 20px; line-height: 1.2; letter-spacing: -.01em; }
.brand-sub { display: block; font-family: var(--f-display); font-size: 11px; color: var(--muted); letter-spacing: .06em; line-height: 1.4; }
.site-nav { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: 14px; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.head-tools { margin-left: auto; display: flex; gap: 8px; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.lang button { border: 0; background: transparent; padding: 6px 10px; font-size: 13px; font-weight: 500; color: var(--muted); min-width: 40px; }
.lang button + button { border-left: 1px solid var(--line); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); font-weight: 700; }
.cta { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 7px 14px; font-size: 14px; font-weight: 700; text-decoration: none; }
.icon-btn { width: 36px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--accent); }
.svg-i { width: 16px; height: 16px; }

/* document body */
.doc { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px clamp(20px, 5vw, 56px); }
.doc-inner { max-width: 68ch; margin: 0 auto; min-width: 0; }
.eyebrow { font-family: var(--f-display); font-size: 12px; letter-spacing: .08em; color: var(--accent); margin: 0 0 6px; }
.doc h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.3; margin: 0 0 8px; text-wrap: balance; letter-spacing: -.02em; }
.doc .lede { color: var(--muted); margin: 0 0 28px; }
.doc h2 { font-size: 20px; line-height: 1.4; margin: 36px 0 10px; text-wrap: balance; }
.doc h3 { font-size: 16px; margin: 22px 0 6px; }
.doc p, .doc ul, .doc ol { margin: 0 0 14px; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li + li { margin-top: 4px; }
.doc .meta { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 36px; }
.callout { background: var(--accent-soft); border-radius: 10px; padding: 14px 18px; margin: 0 0 20px; }
.callout p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 10px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; min-width: 520px; }
.doc th, .doc td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { background: var(--empty); font-weight: 700; white-space: nowrap; }
.doc tbody tr:last-child td { border-bottom: 0; }
.doc td:first-child { white-space: nowrap; }
.doc td:nth-child(2), .doc td:nth-child(3) { font-family: var(--f-num); font-size: 13px; white-space: nowrap; }
kbd { font-family: var(--f-num); font-size: 12px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 0; list-style-position: outside; }
.faq summary:hover { color: var(--accent); }
.faq details > *:not(summary) { margin-left: 0; }
.faq details[open] summary { color: var(--accent); }
/* free patterns */
.doc-inner.wide { max-width: 1000px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 8px 0 32px; }
.card { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; color: var(--ink); text-decoration: none; background: var(--surface); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-art { position: relative; display: block; aspect-ratio: 1 / 1; background: repeating-conic-gradient(var(--empty) 0 25%, var(--surface) 0 50%) 0 0 / 14px 14px; }
/* fit any shape (tall or wide) inside the square without pushing the card text down */
.card-art img { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain; image-rendering: pixelated; }
.card-body { display: grid; gap: 4px; padding: 12px 14px 14px; align-content: start; }
.card-cat { font-size: 12px; color: var(--muted); letter-spacing: .03em; }
.card-title { font-size: 16px; line-height: 1.35; }
.card-meta { font-family: var(--f-num); font-size: 12px; color: var(--muted); word-break: keep-all; overflow-wrap: break-word; }
.chip { justify-self: start; display: inline-block; font-size: 12px; font-weight: 700; line-height: 1; padding: 5px 9px; border-radius: 99px; margin-top: 4px; }
.chip-easy { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.chip-normal { background: var(--accent-soft); color: var(--accent); }
.chip-hard { background: color-mix(in srgb, #c2410c 16%, transparent); color: #c2410c; }
:root[data-theme="dark"] .chip-hard { color: #fb923c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip-hard { color: #fb923c; } }
.crumb { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.crumb a { color: var(--muted); }
.pattern-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; margin: 8px 0 8px; }
.pattern-art { margin: 0; display: grid; gap: 8px; justify-items: center; background: repeating-conic-gradient(var(--empty) 0 25%, var(--surface) 0 50%) 0 0 / 14px 14px; border-radius: 10px; padding: 16px; }
.pattern-art img { max-width: 100%; height: auto; image-rendering: pixelated; }
.pattern-art figcaption { font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
.stats div { background: var(--empty); border-radius: 8px; padding: 10px 12px; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-family: var(--f-num); font-size: 18px; font-weight: 700; }
.stats dd .chip { margin-top: 2px; font-family: var(--f-body); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.btn-row .ghost { text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; padding: 7px 14px; }
.palette-table { min-width: 0 !important; }
.palette-table td:nth-child(2) { font-family: var(--f-num); }
.swatch { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; font-family: var(--f-num); font-size: 12px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.pattern-chart { margin: 0 0 24px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.pattern-chart img { display: block; width: 100%; height: auto; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; border-top: 1px solid var(--line); padding-top: 16px; font-size: 14px; }
.pager a { text-decoration: none; }
@media (max-width: 720px) {
  .pattern-top { grid-template-columns: minmax(0, 1fr); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px; }
  .card-title { font-size: 14px; }
}
.mail-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 8px 0 24px; }
.mail-card .addr { font-family: var(--f-num); font-size: 17px; font-weight: 700; user-select: all; word-break: break-all; }
.ghost { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 7px 12px; font-size: 14px; font-weight: 500; }
.ghost:hover { border-color: var(--accent); }
.copy-note { font-size: 13px; color: var(--ok); }

/* footer shared with the app */
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 640px) {
  .head-tools { margin-left: 0; }
  .site-nav { order: 3; flex-basis: 100%; }
  .doc { padding: 24px 18px; }
}
