/* 바른매매(BAREUN) — 공통 UI 토큰 + chrome (다크 네이비 기준)
 * fint.co.kr 류 핀테크 다크 랜딩: 딥 네이비 배경, 얕은 서피스, 읽기용 대비 */
:root {
  /* 배경 계열 — 앱 다크 네이비에 맞춘 기본값 (필요 시 한 곳만 조정) */
  --bg-deep: #070b14;
  --bg: #0c1222;
  --surface: #121a2e;
  --surface-muted: #0f1628;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #e8edf4;
  --text-muted: #9fb0c8;
  --text-subtle: #7a8ba8;

  /* 액센트: 본문 링크·포커스에도 쓰이므로 배경 대비 확보 */
  --accent: #6eb6ff;
  --accent-hover: #9bccff;
  --accent-soft: rgba(110, 182, 255, 0.12);
  --accent-on-accent: #061018;

  --radius: 12px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 24px rgba(0, 0, 0, 0.35);
  --max-content: 72rem;
  --max-prose: 40rem;
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --header-h: 3.25rem;
  --focus-ring: 2px solid var(--accent);
  --focus-offset: 2px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(0.9375rem, 2.8vw, 1rem);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(120% 80% at 50% -20%, rgba(110, 182, 255, 0.08), transparent 55%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 32%, var(--bg) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 모바일 한글·긴 URL 줄바꿈 */
p,
li,
dd {
  overflow-wrap: anywhere;
  word-break: keep-all;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--accent-on-accent);
  font-weight: 600;
}

.skip-link:focus,
.skip-link:focus-visible {
  left: 1rem;
  top: 1rem;
}

/* —— 헤더 (모든 페이지 공통 chrome) —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  background: color-mix(in srgb, var(--bg-deep) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: clamp(1rem, 3.5vw, 1.05rem);
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand:focus-visible {
  border-radius: 6px;
}

.brand small {
  display: block;
  font-weight: 500;
  font-size: max(0.6875rem, 0.65em);
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: max(0.8125rem, 0.8rem);
  align-items: center;
  justify-content: flex-end;
}

.nav-inline a {
  color: var(--text-muted);
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-inline a:hover {
  color: var(--accent-hover);
  text-decoration: none;
  background: var(--accent-soft);
}

.nav-inline a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
}

main {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 1.75rem 1rem 3.5rem;
}

.hero {
  padding: 2rem 0 1.5rem;
  text-align: center;
}

.hero__badge {
  display: inline-block;
  font-size: max(0.6875rem, 0.72rem);
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 5.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.28;
}

.hero__sub {
  margin: 0 auto;
  max-width: 28rem;
  color: var(--text-muted);
  font-size: clamp(0.9375rem, 3.2vw, 1.02rem);
  line-height: 1.7;
}

.section {
  margin-top: 2.25rem;
}

.section h2 {
  font-size: clamp(1.05rem, 3vw, 1.125rem);
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.card-grid {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.card p {
  margin: 0;
  font-size: max(0.875rem, 0.9rem);
  color: var(--text-muted);
  line-height: 1.7;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
}

.store-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 160px);
  min-height: 48px;
  padding: 0.5rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  font-size: max(0.75rem, 0.78rem);
  color: var(--text-muted);
  background: var(--surface-muted);
  text-align: center;
  line-height: 1.5;
}

/* 랜딩: 분석 방식(모델·파이프라인) 강조 패널 */
.method-panel {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 1.35rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.method-panel h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.05rem, 3vw, 1.2rem);
  font-weight: 650;
  color: var(--text);
}

.method-panel > p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.75;
}

.method-panel > p:last-child {
  margin-bottom: 0;
}

.method-panel ul {
  margin: 0.5rem 0 0.85rem;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.method-panel li + li {
  margin-top: 0.5rem;
}

.method-panel .method-note {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  color: var(--text-subtle);
  line-height: 1.65;
}

.disclaimer-box {
  margin-top: 2.25rem;
  padding: 1.2rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: max(0.8125rem, 0.8rem);
  color: var(--text-muted);
  line-height: 1.75;
}

.disclaimer-box a:focus-visible {
  border-radius: 2px;
}

.disclaimer-box strong {
  color: var(--text);
}

/* —— 정책 페이지: 목차 + 본문 가독성 —— */
.page-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.page-meta {
  font-size: max(0.8125rem, 0.85rem);
  color: var(--text-subtle);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.draft-badge {
  display: inline-block;
  font-size: max(0.6875rem, 0.72rem);
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.prose {
  max-width: var(--max-prose);
  margin: 0 auto;
}

.prose h2 {
  margin: 2.25rem 0 0.85rem;
  font-size: clamp(1.02rem, 2.8vw, 1.12rem);
  font-weight: 700;
  padding-top: 0.35rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
  color: var(--text);
  line-height: 1.35;
}

.prose h2:first-of-type {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1rem;
  line-height: 1.8;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose li {
  color: var(--text-muted);
  font-size: max(0.9rem, 0.92rem);
  line-height: 1.8;
  margin: 0.4rem 0;
}

.prose ul {
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

.prose strong {
  color: var(--text);
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.toc h2 {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.toc ol {
  margin: 0;
  padding-left: 1.2rem;
  font-size: max(0.8125rem, 0.85rem);
}

.toc li {
  margin: 0.4rem 0;
  line-height: 1.55;
}

.toc a {
  color: var(--text-muted);
}

.toc a:hover {
  color: var(--accent-hover);
}

.placeholder {
  color: var(--text-subtle);
  font-style: italic;
}

/* —— 푸터 (모든 페이지 공통) —— */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  padding: 1.75rem 1rem 2.25rem;
}

.site-footer__inner {
  max-width: var(--max-content);
  margin: 0 auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: max(0.78rem, 0.8125rem);
  margin-bottom: 1.25rem;
}

.footer-nav a {
  color: var(--text-muted);
  padding: 0.35rem 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-nav a:hover {
  color: var(--accent-hover);
}

.biz-info {
  font-size: max(0.7rem, 0.75rem);
  line-height: 1.75;
  color: var(--text-subtle);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.biz-info dt {
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.biz-info dt:first-child {
  margin-top: 0;
}

.biz-info dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-wrap main {
  flex: 1;
}

.error-page {
  text-align: center;
  padding: 2.5rem 1rem;
}

.error-page h1 {
  font-size: clamp(3rem, 14vw, 4rem);
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--border-strong);
}

.error-page p {
  color: var(--text-muted);
  margin: 1rem 0 1.75rem;
  line-height: 1.7;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-on-accent);
  background: var(--accent);
  border-radius: 8px;
  border: none;
  cursor: pointer;
  min-height: 44px;
  line-height: 1.2;
}

.btn:hover {
  text-decoration: none;
  background: var(--accent-hover);
  color: var(--accent-on-accent);
}

.btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}
