/* BaseSeal — CONDERI 디자인 시스템
   · 4px 간격 규칙: 모든 padding/margin/gap 은 4의 배수
   · WCAG AA 대비 · 다크/라이트 · 4뷰포트(1440·1280·390·375)
   · 인라인 스타일 금지(CSP style-src 'self') — 상태는 클래스로만 바꾼다
   · AI 티 배제: 그라데이션·글로우·라벨 이모지 없음, 헤어라인과 여백으로 위계 */

@font-face {
  font-family: "Paperlogy";
  src: url("./fonts/Paperlogy-4Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("./fonts/Paperlogy-6SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("./fonts/Paperlogy-7Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("./fonts/Paperlogy-8ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --ink-navy: #102a56;
  --ink: #17191d;
  --ivory: #f7f5f0;
  --white: #ffffff;
  --seal: #0e6b63;
  --seal-soft: #e6f0ee;
  --danger: #a3242b;
  --danger-soft: #fbeceb;
  --warn: #7a4a00;
  --warn-soft: #fdf3e2;

  --bg: var(--ivory);
  --surface: var(--white);
  --surface-2: #f1eee7;
  --line: #ddd8cc;
  --line-strong: #c4bdad;
  --text: #1b1d21;
  --text-soft: #4a4f57;
  --text-mute: #5b6068;
  --link: #123a72;
  --focus: #1f6feb;
  --shadow: 0 1px 2px rgba(23, 25, 29, 0.06), 0 8px 24px rgba(23, 25, 29, 0.05);
}

[data-theme="dark"] {
  --bg: #0b1017;
  --surface: #121924;
  --surface-2: #17202c;
  --line: #26313f;
  --line-strong: #3a4757;
  --text: #eef1f5;
  --text-soft: #c2cad4;
  --text-mute: #a3adba;
  --link: #9dc2f5;
  --seal: #5fc3b6;
  --seal-soft: #102a2a;
  --danger: #ff9d9d;
  --danger-soft: #2b1416;
  --warn: #f0c073;
  --warn-soft: #2a1f0c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Paperlogy", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  word-break: keep-all;
}

img, svg { max-width: 100%; }

p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  padding: 8px 16px;
  background: var(--ink-navy);
  color: var(--white);
  border-radius: 4px;
  z-index: 50;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── 상단 ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 8px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand img { height: 28px; width: auto; display: block; }
/* 상위 브랜드 라벨 — 로고 옆 헤어라인 + 작은 서체(제품 로고가 주인공) */
.brand .product {
  padding: 0 0 0 12px;
  border: 0;
  border-left: 1px solid var(--line-strong);
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-mute);
  white-space: nowrap;
}
/* 브랜드 마크 — 인증·포털·대시보드 히어로 */
.page-mark { margin: 0 0 16px; }
.page-mark img { display: block; width: 40px; height: 40px; }
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { color: var(--ink-navy); background: var(--surface-2); }
[data-theme="dark"] .nav a[aria-current="page"] { color: var(--text); }

.tools { display: flex; align-items: center; gap: 8px; }
.icon-button {
  min-width: 40px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.icon-button:hover { border-color: var(--ink-navy); color: var(--text); }
.menu-button { display: none; }

/* ── 히어로 ───────────────────────────────────────────── */
.hero { padding: 64px 0 48px; }
.eyebrow {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--seal);
}
h1, h2, h3 { color: var(--text); letter-spacing: -0.02em; }
h1 {
  margin: 0 0 16px;
  font-size: 44px;
  line-height: 1.25;
  font-weight: 800;
}
h2 {
  margin: 0 0 16px;
  font-size: 30px;
  line-height: 1.35;
  font-weight: 700;
}
h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.45; font-weight: 700; }
.lead { margin: 0 0 24px; font-size: 18px; color: var(--text-soft); max-width: 720px; }
.muted { color: var(--text-mute); }
.small { font-size: 14px; }
.mono {
  font-family: "SFMono-Regular", ui-monospace, "Cascadia Mono", Menlo, monospace;
  font-size: 13px;
  letter-spacing: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 20px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button.primary { background: var(--ink-navy); color: var(--white); }
.button.primary:hover { background: #0a1f42; }
[data-theme="dark"] .button.primary { background: #2b5ea8; color: var(--white); }
.button.ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.button.ghost:hover { border-color: var(--ink-navy); }
.button.small { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.button.danger { background: var(--danger); color: var(--white); }
.button:disabled { opacity: 0.55; cursor: not-allowed; }

/* 제품 화면 목업(Discord 임베드) */
.mock {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-mute);
}
.mock-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.mock-brand { display: inline-flex; align-items: center; gap: 8px; }
.mock-brand img { display: block; width: 16px; height: 16px; }
.mock-body { padding: 16px; }
.embed {
  border-left: 4px solid var(--seal);
  border-radius: 4px;
  background: var(--surface-2);
  padding: 16px;
}
.embed-title { margin: 0 0 8px; font-weight: 700; }
.embed-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.embed-row:first-of-type { border-top: 0; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--seal-soft);
  color: var(--seal);
  font-size: 12px;
  font-weight: 700;
}
[data-theme="dark"] .pill { color: #8fe0d4; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }

/* ── 섹션 ─────────────────────────────────────────────── */
.section { padding: 48px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-num { font-size: 13px; font-weight: 700; color: var(--seal); letter-spacing: 0.08em; }

.grid > *, .market-grid > *, .split > * { min-width: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
}
.card p { margin: 0; color: var(--text-soft); }
.card .kv { display: grid; gap: 4px; margin: 16px 0 0; }
.card .kv div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.card .kv dt { color: var(--text-mute); }
.card .kv dd { margin: 0; font-weight: 600; }

.kpi {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}
.kpi strong { display: block; font-size: 28px; font-weight: 800; line-height: 1.2; }
.kpi span { font-size: 14px; color: var(--text-mute); }

.steps { counter-reset: step; display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.steps li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: var(--ink-navy);
  color: var(--white);
  font-weight: 700;
}
[data-theme="dark"] .steps li::before { background: #2b5ea8; }
.steps b { display: block; margin-bottom: 4px; }
.steps span { color: var(--text-soft); font-size: 15px; }

/* ── 표 ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; color: var(--text-soft); background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }

/* ── 폼 ───────────────────────────────────────────────── */
.form { display: grid; gap: 16px; }
.form.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; font-weight: 700; }
.field .hint { font-size: 13px; color: var(--text-mute); }
input[type="text"], input[type="password"], input[type="number"], input[type="url"],
input[type="datetime-local"], input[type="file"], select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink-navy); outline: 2px solid var(--focus); outline-offset: 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.check input { min-height: auto; width: 20px; height: 20px; margin: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--seal);
  border-radius: 4px;
  background: var(--surface-2);
  padding: 16px;
  font-size: 15px;
}
.notice.danger { border-left-color: var(--danger); background: var(--danger-soft); }
.notice.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.notice + .notice { margin-top: 12px; }
.notice h3 { font-size: 16px; margin-bottom: 4px; }
.notice p { margin: 0; color: var(--text); }

.result { margin-top: 16px; }
.result:empty { margin: 0; }

/* ── 안내 카드 ───────────────────────────────────────── */
.market-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.item {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.item-media {
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--text-mute);
  font-size: 13px;
}
.item-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-body { display: grid; gap: 8px; padding: 16px; flex: 1; }
.item-body h3 { font-size: 18px; margin: 0; }
.item-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--text-mute); }
.item-price { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ── 푸터 ─────────────────────────────────────────────── */
.site-footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: grid; gap: 24px; padding: 48px 0 24px; }
.family { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.family img { height: 20px; width: auto; opacity: 0.92; }
.brand .on-dark, .family .on-dark { display: none; }
[data-theme="dark"] .brand .on-dark, [data-theme="dark"] .family .on-dark { display: block; }
[data-theme="dark"] .brand .on-light, [data-theme="dark"] .family .on-light { display: none; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.row-actions a.button { text-decoration: none; }
.footer-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: var(--text-mute); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.footer-legal { padding: 16px 0 32px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-mute); }

/* ── 문서(약관) ───────────────────────────────────────── */
.doc { max-width: 840px; padding: 48px 0; }
.doc h1 { font-size: 34px; }
.doc h2 { font-size: 22px; margin-top: 40px; }
.doc h3 { font-size: 17px; margin-top: 24px; }
.doc p, .doc li { color: var(--text-soft); font-size: 15px; }
.doc ul, .doc ol { padding-left: 20px; }
.doc table { margin: 16px 0; }
.toc { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 16px 24px; }
.toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.toc a { text-decoration: none; }
.meta-line { font-size: 13px; color: var(--text-mute); }

/* ── 유틸 ─────────────────────────────────────────────── */
.stack { display: grid; gap: 16px; }
.stack.tight { gap: 8px; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.hidden { display: none !important; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── 반응형: 1440 / 1280 / 390 / 375 ─────────────────── */
@media (max-width: 1200px) {
  .wrap { max-width: 1040px; }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  h1 { font-size: 38px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid, .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .nav { display: none; }
  .nav.open {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .menu-button { display: inline-flex; align-items: center; }
  .brand img { height: 24px; }
  .brand .product { font-size: 12px; padding: 0 0 0 8px; }
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  .hero { padding: 40px 0 32px; }
  .section { padding: 32px 0; }
  .grid, .grid.two, .grid.four, .market-grid, .form.two-col { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .doc { padding: 32px 0; }
  .toc ol { columns: 1; }
  .family { gap: 16px; }
}
@media (max-width: 400px) {
  h1 { font-size: 27px; }
  .lead { font-size: 16px; }
  .button { width: 100%; }
  .form-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* 배너 광고 슬롯 — 활성 광고가 없거나 실패하면 아무것도 그리지 않는다 */
.ad-slot { position: relative; margin: 40px auto; max-width: 1200px; padding: 0 20px; }
.ad-slot:empty { display: none; }
.ad-slot-label { position: absolute; top: 8px; left: 32px; z-index: 1; padding: 4px 8px; border-radius: 4px; background: rgba(16, 42, 86, 0.72); color: #fff; font-size: 11px; letter-spacing: 0.04em; }
.ad-slot-link { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.ad-slot-link img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 1; object-fit: cover; }
