/*
 * ONSOFT DS B — components v0.1
 * 의존: tokens.css, base.css
 * 목록: 버튼 · 배지 · 카드 · 코드 블록 · 내비(헤더) · 섹션 머리 · 핵심가치 띠
 *       · 단계 카드 · 로고 타일 · 행 목록 · 연혁 · 영상 프레임 · 안내 콜아웃 · 푸터
 */

/* ===== 버튼 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.btn--lg {
  min-height: var(--tap-lg);
  padding: 0 var(--sp-6);
  font-size: 16px;
}
.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}
.btn--inverse {
  background: var(--inverse);
  color: var(--on-inverse);
}
.btn--inverse:hover {
  background: var(--inverse-hover);
  color: var(--on-inverse);
}
.btn--outline {
  border-color: var(--line-strong);
  color: var(--text);
  font-weight: var(--fw-regular);
}
.btn--outline:hover {
  border-color: var(--text-muted);
  color: var(--text);
}
.btn svg {
  flex: none;
}

/* ===== 배지 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  line-height: 1.4;
  color: var(--text-muted);
}
.badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-orange);
  flex: none;
}
.badge--private {
  padding: 4px 10px;
  gap: 0;
  border-color: var(--point);
  color: var(--point);
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
}

/* ===== 라벨 (모노 소형) ===== */
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--text-muted);
  line-height: 1.4;
}
.label--point {
  color: var(--point);
}

/* ===== 카드 ===== */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-7);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.card h3 {
  font-size: var(--fs-h3);
}
.card p {
  font-size: var(--fs-body);
  color: var(--text-muted);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--sp-4);
}
@media (min-width: 1100px) {
  .card-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ===== 코드 블록 (diff, "예시" 표기 필수) ===== */
.code {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
}
.code__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--text-muted);
}
.code__tag {
  flex: none;
  padding: 1px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
}
.code pre {
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
  font-size: var(--fs-sm);
  line-height: var(--lh-code);
  color: var(--text-subtle);
  overflow-x: auto;
  word-break: normal;
  overflow-wrap: normal;
}
.code pre:focus-visible {
  outline-offset: -2px;
}
.code__del {
  color: var(--code-del);
}
.code__add {
  color: var(--code-add);
}
.code__comment {
  color: var(--code-comment);
}

/* ===== 헤더·내비 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 72px;
  padding-block: var(--sp-3);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  color: var(--text);
  text-decoration: none;
}
.brand:hover {
  color: var(--text);
}
.brand__mark {
  width: 52px;
  height: 26px;
}
.brand__word {
  font-weight: var(--fw-bold);
  font-size: 18px;
  letter-spacing: var(--ls-wordmark);
}
.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-7);
}
.nav__list {
  display: flex;
  gap: var(--sp-7);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-subtle);
  text-decoration: none;
}
.nav__link:hover,
.nav__link[aria-current='page'],
.nav__link[aria-current='true'] {
  color: var(--text);
}
.nav__link[aria-current='page'],
.nav__link[aria-current='true'] {
  text-decoration: underline;
  text-decoration-color: var(--point);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-btn);
  color: var(--text);
  cursor: pointer;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.nav-toggle__bar {
  position: relative;
}
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: '';
  position: absolute;
  left: 0;
}
.nav-toggle__bar::before {
  top: -6px;
}
.nav-toggle__bar::after {
  top: 6px;
}
.nav-toggle[aria-expanded='true'] .nav-toggle__bar {
  background: transparent;
}
.nav-toggle[aria-expanded='true'] .nav-toggle__bar::before {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded='true'] .nav-toggle__bar::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* 모바일 메뉴: 860px 미만에서 토글 패널로 전환 */
@media (max-width: 859.98px) {
  .nav-toggle {
    display: inline-flex;
  }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--gutter) var(--sp-6);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .nav[data-open='true'] {
    display: flex;
  }
  /* JS 미동작 시 메뉴 펼침 규칙은 nojs.css(<noscript> 로드)로 분리 — JS 켜진 환경의 첫 페인트 CLS 방지 */
  .nav__list {
    flex-direction: column;
    gap: 0;
  }
  .nav__link {
    width: 100%;
    min-height: var(--tap-lg);
    border-bottom: 1px solid var(--line);
    font-size: var(--fs-body);
  }
  .nav .btn {
    width: 100%;
  }
  .site-header__inner {
    flex-wrap: wrap;
  }
}

/* ===== 섹션 머리 ===== */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.section-head--split {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-4);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  color: var(--link);
}

/* ===== 핵심가치 띠 ===== */
.stats {
  border-block: 1px solid var(--line);
  background: var(--bg);
}
.stats__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.stats__item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: 36px var(--sp-6);
}
.stats__item:first-child {
  padding-left: 0;
}
.stats__item + .stats__item {
  border-left: 1px solid var(--line);
}
.stats__value {
  font-size: var(--fs-stat);
  font-weight: var(--fw-bold);
  line-height: 1.3;
}
@media (max-width: 767.98px) {
  .stats__list {
    grid-template-columns: 1fr;
  }
  .stats__item {
    padding: var(--sp-6) 0;
  }
  .stats__item + .stats__item {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

/* ===== 단계 카드 (동작 구조 4단계) ===== */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.step {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-6);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
}
.step__title {
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  line-height: 1.4;
}
.step__desc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* ===== 로고 타일 (고객사 타이포 워드마크) ===== */
.logo-wall {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}
.logo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  text-align: center;
  overflow-wrap: anywhere;
}

/* ===== 행 목록 (특허·인증) ===== */
.rows {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-body);
}
.rows__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-4);
}
.rows__meta {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  color: var(--text-muted);
}
@media (max-width: 479.98px) {
  .rows__item {
    flex-direction: column;
    gap: 2px;
  }
}

/* ===== 연혁 ===== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-body);
}
.timeline__item {
  display: flex;
  gap: var(--sp-5);
}
.timeline__date {
  flex: none;
  min-width: 72px;
  font-family: var(--font-mono);
  color: var(--point);
}

/* ===== 패널 (특허·연혁 상자) ===== */
.panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: var(--sp-8);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.panel h2 {
  font-size: var(--fs-h2-sm);
}
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: var(--sp-4);
}
@media (max-width: 479.98px) {
  .panel {
    padding: var(--sp-6);
  }
}

/* ===== 영상 프레임 ===== */
.video-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-media);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}
.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.video-frame__play {
  position: absolute;
  right: var(--sp-6);
  bottom: var(--sp-6);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap-lg);
  padding: 0 var(--sp-5);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-btn);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  cursor: pointer;
}
.video-frame__play:hover {
  border-color: var(--text-muted);
}
.video-frame__play[hidden] {
  display: none;
}
@media (max-width: 479.98px) {
  .video-frame__play {
    right: var(--sp-3);
    bottom: var(--sp-3);
  }
}

/* ===== 안내 콜아웃 (PRIVATE 데모) ===== */
.callout {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-7) var(--sp-8);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-card);
}
.callout__body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.callout__title {
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
}
@media (max-width: 479.98px) {
  .callout {
    padding: var(--sp-6);
  }
  .callout .btn {
    width: 100%;
  }
}

/* ===== 푸터 ===== */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-6);
  padding-block: var(--sp-12);
}
.site-footer__brand {
  color: var(--text);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wordmark);
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}
