/* =========================================================
   바른셈 랜딩페이지 — styles.css
   디자인 토큰: 바른셈 브랜드 디자인 가이드북
   (네이비 #1C2C50 / 스카이 #84B9E2)
   글꼴은 기존 디자인 시스템(tokens.json v1)의 IBM Plex Sans KR + IBM Plex Mono 유지
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* color — light */
  --surface: #ffffff;
  --surface-alt: #f3f7fb;
  --surface-deep: #1c2c50;
  --line: #d9e4ef;
  --line-strong: #74849b;
  --ink: #1c2c50;
  --ink-muted: #4a5a78;
  --brand: #1c2c50;
  --brand-strong: #111c36;
  --brand-soft: #e6f0f9;
  --on-brand: #ffffff;
  --sky: #84b9e2;
  --signal: #336c9c;
  --on-deep: #f1f5fa;
  --on-deep-muted: #a9bdd6;
  --success: #127a52;
  --danger: #c2331f;
  --focus: var(--brand);

  /* deep 위 헤어라인 (on-deep-muted 기반) */
  --deep-line: rgba(159, 178, 204, 0.18);
  --deep-line-strong: rgba(159, 178, 204, 0.28);
  --deep-motif: rgba(159, 178, 204, 0.35);

  /* type */
  --font-sans: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;
  --space-32: 128px;

  /* radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* shadow */
  --shadow-card: 0 1px 2px rgba(28, 44, 80, 0.06), 0 8px 24px rgba(28, 44, 80, 0.06);

  /* layout */
  --container-max: 1200px;
  --measure: 680px;
  --gutter: var(--space-6);
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0b1426;
    --surface-alt: #111d36;
    --surface-deep: #0f1830;
    --line: #1e2c42;
    --line-strong: #6b7d98;
    --ink: #f1f5fa;
    --ink-muted: #9aabc3;
    --brand: #84b9e2;
    --brand-strong: #a9d0ee;
    --brand-soft: #1a2d52;
    --on-brand: #111c36;
    --signal: #84b9e2;
    --success: #3ccf91;
    --danger: #ff7a66;
    --focus: var(--brand-strong);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul, pre { margin: 0; }
a { color: var(--brand); }
a:hover { color: var(--brand-strong); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.deep :focus-visible { outline-color: var(--sky); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--ink);
  padding: var(--space-3) var(--space-4); z-index: 10;
}
.skip-link:focus { left: var(--space-4); top: var(--space-4); }

.mono { font-family: var(--font-mono); }

/* ---------- 3. Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + var(--gutter) * 2);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-24); background: var(--surface); }
.section--alt { background: var(--surface-alt); }

.deep { background: var(--surface-deep); color: var(--on-deep); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); }
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-6); }

/* ---------- 4. Typography ---------- */
.display { font-size: 60px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; }
.h1 { font-size: 42px; line-height: 1.25; letter-spacing: -0.015em; font-weight: 600; }
.h2 { font-size: 32px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; }
.h3 { font-size: 21px; line-height: 1.45; font-weight: 600; }
.lead { font-size: 19px; line-height: 1.7; max-width: var(--measure); color: var(--ink-muted); }
.body { font-size: 16px; line-height: 1.75; color: var(--ink-muted); }
.caption { font-size: 13px; line-height: 1.6; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; line-height: 16px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--signal);
}
.deep .eyebrow { color: var(--sky); }
.eyebrow--muted { color: var(--ink-muted); }

/* ---------- 5. Components ---------- */

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 500 16px/1.2 var(--font-sans);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-strong); color: var(--on-brand); }
.btn--secondary { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn--secondary:hover { border-color: var(--ink); color: var(--ink); }
/* deep 위 (brand 대신 sky) */
.btn--on-deep { background: var(--sky); color: #1c2c50; }
.btn--on-deep:hover { background: #a9d0ee; color: #1c2c50; }
.btn--ghost-deep { border-color: var(--on-deep-muted); color: var(--on-deep); background: transparent; }
.btn--ghost-deep:hover { border-color: var(--on-deep); color: var(--on-deep); }
.btn--sm { min-height: 44px; padding: 10px 20px; font-size: 15px; }

/* Tag */
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag {
  display: inline-block; padding: var(--space-1) 10px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft); color: var(--ink);
  font-size: 13px; line-height: 1.5;
}
.tag--mono { font-family: var(--font-mono); font-size: 12px; }
.tag--outline { background: transparent; border: 1px solid var(--line); }

/* Section heading */
.section-heading { display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-12); }
.section-heading .lead { margin-top: var(--space-3); }

/* Card */
.card {
  display: flex; flex-direction: column; gap: var(--space-4);
  padding: var(--space-8);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  transition: box-shadow .2s ease;
}
.card:hover { box-shadow: var(--shadow-card); }
.card .body { flex-grow: 1; }
.card--accent { border: 2px solid var(--brand); padding: calc(var(--space-8) - 1px); }
.card--accent .eyebrow { color: var(--brand); }

/* ---------- 6. Sections ---------- */

/* Header / nav */
.site-header { position: relative; overflow: hidden; }
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-6);
  min-height: 80px; border-bottom: 1px solid var(--deep-line);
}
.nav__brand { min-height: 44px; display: inline-flex; align-items: center; }
.nav__brand img { display: block; height: 32px; width: auto; }
.nav__links { display: flex; align-items: center; gap: var(--space-8); list-style: none; padding: 0; }
.nav__link {
  color: var(--on-deep-muted); text-decoration: none; font-size: 15px;
  min-height: 44px; display: inline-flex; align-items: center;
}
.nav__link:hover { color: var(--on-deep); }

/* Hero */
.hero { padding-top: var(--space-32); padding-bottom: var(--space-32); }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-12); align-items: end;
}
.hero__copy { display: flex; flex-direction: column; gap: var(--space-6); }
.hero__copy .display { color: var(--on-deep); }
.hero__copy .lead { color: var(--on-deep-muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); padding-top: var(--space-4); }
.hero__aside { display: flex; flex-direction: column; gap: var(--space-6); }

/* 이름 정의 패널 */
.definition {
  border: 1px solid var(--deep-line-strong); border-radius: var(--radius-md);
  padding: var(--space-8);
}
.definition .eyebrow { color: var(--on-deep-muted); margin-bottom: 20px; }
.definition__row {
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-4);
  padding: var(--space-4) 0; border-top: 1px solid var(--deep-line);
}
.definition__row:last-child { padding-bottom: 0; }
.definition__term { font-size: 21px; font-weight: 600; color: var(--on-deep); line-height: 1.45; }
.definition__eq { font-family: var(--font-mono); font-size: 14px; color: var(--on-deep-muted); padding-top: var(--space-1); }
.definition__desc { display: flex; flex-direction: column; gap: var(--space-1); }
.definition__en { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; color: var(--sky); }
.definition__text { font-size: 15px; line-height: 1.6; color: var(--on-deep-muted); }
.definition__text--strong { color: var(--on-deep); }

/* 브랜드 패턴 모티프 (가이드북 p.9) */
.pattern {
  height: 180px; opacity: .6;
  background: url("../img/pattern.svg") 0 0 / 88px 60px repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%);
          mask-image: linear-gradient(90deg, transparent, #000 40%);
}

/* About — 회사 개요 표 */
.about__copy { display: flex; flex-direction: column; gap: var(--space-3); }
.about__copy .body { max-width: var(--measure); margin-top: var(--space-2); }
.facts { border-top: 1px solid var(--ink); }
.facts__row {
  display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--space-4);
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.facts dt { padding-top: var(--space-1); }
.facts dd { margin: 0; color: var(--ink); }
.facts__note { color: var(--ink-muted); font-size: 13px; }

/* Process */
.steps { list-style: none; padding: 0; }
.step {
  display: flex; flex-direction: column; gap: var(--space-3);
  border-top: 2px solid var(--line); padding-top: var(--space-6);
}
.step:first-child { border-top-color: var(--ink); }
.step__num { font-family: var(--font-mono); font-size: 32px; font-weight: 500; line-height: 1; color: var(--ink); }
.step .body { font-size: 15px; }

/* Focus — 이관 흐름 */
.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr) 56px minmax(0, 1fr);
  list-style: none; padding: 0;
}
.flow__arrow { display: flex; align-items: center; justify-content: center; color: var(--line-strong); }
.proof { margin-top: var(--space-12); align-items: center; }
.proof__copy { display: flex; flex-direction: column; gap: var(--space-4); }
.proof__copy .body { max-width: 560px; }
.code {
  background: #1c2c50; color: #f1f5fa;
  border-radius: var(--radius-md); padding: var(--space-6) 28px;
  font-family: var(--font-mono); font-size: 14px; line-height: 1.7;
  overflow-x: auto;
}
.code__comment { color: #a9bdd6; }
.code__hl { color: var(--sky); }

/* CTA band */
.cta {
  border-radius: var(--radius-lg);
  padding: var(--space-24) var(--space-8);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
  text-align: center;
}
.cta .h1 { color: var(--on-deep); }
.cta .lead { color: var(--on-deep-muted); }
.cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); padding-top: var(--space-6); }

/* Footer */
.site-footer { color: var(--on-deep-muted); }
.footer__inner { padding-top: var(--space-16); padding-bottom: var(--space-12); display: flex; flex-direction: column; gap: var(--space-12); }
.footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-8); }
.footer__brand { display: flex; flex-direction: column; gap: var(--space-3); max-width: 360px; }
.footer__logo { display: block; height: 32px; width: auto; }
.footer__cols { display: flex; flex-wrap: wrap; gap: var(--space-16); }
.footer__col { font-style: normal; display: flex; flex-direction: column; gap: var(--space-2); font-size: 14px; line-height: 1.6; }
.footer__col .eyebrow { color: var(--on-deep); margin-bottom: var(--space-2); }
.footer__col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.footer__link { color: var(--on-deep-muted); text-decoration: none; }
.footer__link:hover { color: var(--on-deep); }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4);
  border-top: 1px solid var(--deep-line); padding-top: var(--space-6);
}

/* ---------- 7. Responsive ---------- */
@media (max-width: 1023px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-8); }
}

@media (max-width: 767px) {
  :root { --gutter: var(--space-4); }
  .section { padding-block: var(--space-16); }
  .hero { padding-top: var(--space-16); padding-bottom: var(--space-16); }
  /* 모바일에서 한 단계씩 내림 */
  .display { font-size: 42px; line-height: 1.25; }
  .h1 { font-size: 32px; line-height: 1.3; }
  .h2 { font-size: 26px; }
  .hero__grid, .grid-2, .grid-3, .grid-5, .flow { grid-template-columns: minmax(0, 1fr); }
  .flow__arrow { min-height: 40px; transform: rotate(90deg); }
  .nav__item--link { display: none; }
  .pattern { display: none; }
  .facts__row { grid-template-columns: 100px minmax(0, 1fr); }
}

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

/* ---------- 8. Prose (정책 문서 페이지) ---------- */
.nav--page { border-bottom: 0; }
.doc { padding-block: var(--space-16) var(--space-24); }
.doc__inner { max-width: var(--measure); display: flex; flex-direction: column; gap: var(--space-6); }
.doc__meta { color: var(--ink-muted); font-size: 14px; }
.doc h2 { font-size: 21px; line-height: 1.45; font-weight: 600; margin-top: var(--space-6); }
.doc p, .doc li { color: var(--ink-muted); }
.doc ul { margin: 0; padding-left: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: var(--space-3) var(--space-4) var(--space-3) 0; border-bottom: 1px solid var(--line); color: var(--ink-muted); }
.doc th { color: var(--ink); font-weight: 600; white-space: nowrap; }

/* 로고 설명 (가이드북 p.2) */
.about__logo { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--line); }
.about__logo img { width: 56px; height: 56px; flex: none; }
.about__logo p { font-size: 14px; line-height: 1.7; color: var(--ink-muted); }
