/* base.css — 리셋·레이아웃·컴포넌트 (공통)
 * 모든 색·폰트 크기는 tokens.css 의 CSS 변수를 참조한다.
 * 하드코딩된 hex / font-size px 를 여기 두지 않는다.
 * 하드코딩 rgba(0,0,0,…) 그림자는 build-brief §5 가 지정한 표 고정열 1건뿐.
 * 구분선/테두리는 --hairline 을 쓴다(--surface 는 면 색이라 같은 면 위에서 사라짐).
 * 배경은 컨텍스트 변수(--section-bg / --card-bg)로 처리해 섹션 배치 변경에 안 흔들린다. */

/* ── 폰트 ─────────────────────────────────────────────── */
/* Pretendard Variable. CDN 링크만 걸지 않고 font-display: swap 을 명시 —
 * 폰트 로딩 중 텍스트가 안 보이면 첫인상이 무너진다(build-brief §6). */
@font-face {
  font-family: 'Pretendard Variable';
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/woff2/PretendardVariable.woff2') format('woff2-variations');
}

/* ── 리셋 ─────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

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

body,
h1, h2, h3, h4, p,
ul, ol, li,
figure, blockquote { margin: 0; padding: 0; }

ul, ol { list-style: none; }

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

button { font: inherit; color: inherit; cursor: pointer; }

a { color: inherit; }

/* ── 본문 기본 조판 ───────────────────────────────────── */
/* 한글 가독성 우선: line-height 1.75, word-break keep-all, 왼쪽 정렬 고정 */
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system,
               BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;
  text-align: left;
}

/* 문단 간 여백 24px (design-brief §6) */
p + p { margin-top: 24px; }

/* ── 섹션 레이아웃 ────────────────────────────────────── */
/* 섹션 상하 여백 112px(모바일 64px). 구간 구분은 배경색으로만.
 * 배경을 컨텍스트 변수로 두면 섹션 배치를 바꿔도 CSS를 안 고쳐도 된다:
 * 카드·표 고정열이 --section-bg / --card-bg 를 따라 자동으로 반전된다. */
/* 상하 56px → 인접 섹션 여백 합산 112px(모바일 32+32=64). */
.section {
  padding: 56px 0;
  --section-bg: var(--bg);
  --card-bg: var(--surface);
  background: var(--section-bg);
}

/* 구간 배경 교차: surface 구간에서는 섹션/카드 배경을 서로 반전 */
.section--surface {
  --section-bg: var(--surface);
  --card-bg: var(--bg);
}

/* 본문 컬럼 660px, 표·카드 영역 880px. 중앙 1컬럼 고정, 좌우 패딩 20px. */
.container {
  max-width: 660px;
  margin-inline: auto;
  padding-inline: 20px;
}

.container--wide { max-width: 880px; }

/* ── 카드 (블록 02·05) ────────────────────────────────── */
/* 배경은 --card-bg(컨텍스트 변수), 그림자·테두리·radius 없음, padding 28px.
 * ★ 반전 규칙: surface 구간에서는 --card-bg 가 --bg 로 바뀌어 자동 반전된다. */
.card {
  background: var(--card-bg);
  padding: 28px;
}

/* 0호 케이스 카드: 강조색 테두리 1px (허용된 accent 테두리 2곳 중 하나) */
.card--accent { border: 1px solid var(--accent); }

/* ── 비교표 (블록 03) ─────────────────────────────────── */
/* 래퍼 가로 스크롤 + 첫 열 고정 */
.table-wrap { overflow-x: auto; }

.compare {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
}

/* 헤더: Label 크기, Muted, 하단 hairline */
.compare thead th {
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
}

/* 셀: Body 크기, 상하 padding 14px. 세로 구분선 없음, 가로선만. */
.compare th,
.compare td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
}

/* 첫 열 고정: sticky + 섹션 배경과 동일한 불투명 배경 + 오른쪽 그림자.
 * --section-bg 를 쓰므로 표가 어느 배경 구간에 놓여도 자동으로 맞는다. */
.compare th:first-child,
.compare td:first-child {
  position: sticky;
  left: 0;
  background: var(--section-bg);
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

/* 강조행(바이브프리토타이핑): 배경 --accent-soft + weight 600.
 * 첫 열까지 강조행 배경으로 덮는다(sticky 배경보다 우선). */
.compare tbody tr.is-highlight td {
  background: var(--accent-soft);
  font-weight: 600;
}

/* ── 케이스 목록 (30여 개) ────────────────────────────── */
/* 테두리 없이 한 줄씩, 항목 사이 1px hairline, 긴 항목 자연 줄바꿈 */
.case-list li { padding: 14px 0; }        /* 박스·테두리 없음. 긴 항목은 자연 줄바꿈. */
.case-list li + li { border-top: 1px solid var(--hairline); }

/* 케이스 카테고리 아코디언 (<details>/<summary>) */
.case-groups { border-top: 1px solid var(--hairline); }
.case-group { border-bottom: 1px solid var(--hairline); }

.case-group__title {
  display: block;
  min-height: 44px;          /* 모바일 탭 영역 44px 이상 */
  padding: 10px 0;
  cursor: pointer;
  list-style: none;          /* Firefox 기본 마커 제거 */
}
.case-group__title::-webkit-details-marker { display: none; } /* Safari/Chrome 마커 제거 */

/* 제목 행: 이름 + 개수(바로 옆) … 셰브론(우측 고정) */
.case-group__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-body);
  font-weight: 700;
}
.case-group__count {
  font-weight: 400;
  font-size: var(--fs-label);
  color: var(--muted);
}
/* 셰브론 — margin-left:auto 로 우측 유지. 닫힘 ▼ / 열림 ▲ */
.case-group__head::after {
  content: '';
  margin-left: auto;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.case-group[open] .case-group__head::after { transform: rotate(-135deg); }

/* 접힘 상태 3개 미리보기(· 구분, 한 줄 말줄임). 열리면 숨김. */
.case-group__preview {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-label);
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.case-group[open] .case-group__preview { display: none; }

.case-group .case-list { padding-bottom: 8px; }

/* ── 버튼 (컴포넌트) ──────────────────────────────────── */
/* Primary 는 페이지 전체에 2개(히어로 CTA·문의 폼 제출)뿐 — accent 배경면. */
.btn {
  display: inline-block;
  font-weight: 600;
  /* 투명 1px 테두리를 기본값으로 둬 primary/outline 크기를 동일하게 유지 */
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 16px 32px;
  text-decoration: none;
  white-space: nowrap;   /* 버튼 텍스트 줄바꿈 방지 */
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
}

/* Hover: 명도 낮춤(그림자·확대 없음) */
.btn--primary:hover { background: var(--accent-dark); }

.btn--primary:disabled {
  opacity: 0.5;
  cursor: default;
}

/* 아웃라인 버튼: 배경 없음 / --ink 테두리·텍스트. primary 와 크기·패딩 동일. */
.btn--outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn--outline:hover { background: var(--surface); }

/* 아웃라인 + accent: 테두리·텍스트를 --accent 로 (딥그린 배경면 아님). */
.btn--accent {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--accent:hover { background: var(--accent-soft); }

/* ── 세로 흐름(문단·블록 간격) ────────────────────────── */
.container > * + * { margin-top: 24px; }
.section > .container + .container { margin-top: 32px; }

/* ── 제목 ─────────────────────────────────────────────── */
h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-weight: 700;
}
h3 {
  font-size: var(--fs-punch);
  line-height: var(--lh-normal);
  font-weight: 700;
}

/* 섹션 라벨 ("01 · 문제") */
.section-label {
  font-size: var(--fs-label);
  letter-spacing: var(--ls-wide);
  color: var(--muted);
}

/* 강조 단문 */
.punch {
  font-size: var(--fs-punch);
  line-height: var(--lh-normal);
  font-weight: 600;
}

/* 보조/캡션 문단 */
.note { color: var(--muted); }

/* ── 링크 ─────────────────────────────────────────────── */
.link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link:hover { color: var(--ink); }
.link--sm { font-size: var(--fs-label); }

/* ── 히어로 ───────────────────────────────────────────── */
/* 상하 여백 = 기존 160/120 의 2/3 (≈107 / 80). .section 은 건드리지 않음. */
.hero { padding: 107px 0 80px; }
.hero__title {
  font-size: var(--fs-hero);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-weight: 700;
}
.hero__sub {
  font-size: var(--fs-punch);
  line-height: var(--lh-normal);
  color: var(--muted);
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: var(--fs-label);
  color: var(--muted);
}
.hero__actions { margin-top: 40px; }

/* 우측 정렬 서명 */
.signature {
  text-align: right;
  font-size: var(--fs-label);
  color: var(--muted);
}

/* ── 카드 내부 ────────────────────────────────────────── */
.card > * + * { margin-top: 16px; }
.card__title {
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: var(--lh-normal);
}
.card__meta { font-size: var(--fs-label); color: var(--muted); }

/* 시나리오 카드: 라벨(Muted) 위, 내용(Ink) 아래 — 이 대비가 핵심 */
.card__label {
  display: block;
  font-size: var(--fs-label);
  color: var(--muted);
  margin-bottom: 4px;
}
.card__value { display: block; }

/* 카드 그리드 (데스크톱 3열 / 모바일 1열) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;   /* 3장 높이 통일 */
}
/* 카드 높이 맞춤. 하단 CTA 가 없으므로 짧은 카드는 아래 여백이 남는 게 정상. */
.output-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* 0호 케이스 카드 상태 배지 — 카드 흐름 안, 제목 바로 위(넓은 화면도 동일).
 * 나중에 "측정 완료" 로 바뀔 자리다. */
.status-badge {
  display: inline-block;
  font-size: var(--fs-label-sm);
  color: var(--muted);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px 12px;
}

/* ── 스텝 리스트(프로세스) ────────────────────────────── */
.step { display: flex; gap: 20px; padding: 16px 0; }
.step + .step { border-top: 1px solid var(--hairline); }
.step__no {
  flex: 0 0 auto;
  min-width: 1.6em;
  font-size: var(--fs-num);
  line-height: var(--lh-tight);
  font-weight: 700;
  color: var(--muted);
}
.step__body { margin-top: 0; }
.step__name { font-weight: 600; }
.step__when {
  margin-left: 10px;
  font-size: var(--fs-label);
  font-weight: 400;
  color: var(--muted);
}
.step__what { margin-top: 4px; }

/* 하단 note 박스 */
.note-box {
  background: var(--card-bg);
  padding: 20px 24px;
}
.note-box > * + * { margin-top: 8px; }

/* 이론 근거 */
.evidence { font-size: var(--fs-label); color: var(--muted); }
.evidence__label { font-weight: 600; }

/* ── 정의 목록(서비스 스펙 · 워크숍 스펙) ─────────────── */
.specs, .service-specs { display: grid; gap: 8px; }
.specs > div, .service-specs > div { display: flex; gap: 12px; }
.specs dt, .service-specs dt {
  flex: 0 0 auto;
  min-width: 5em;
  color: var(--muted);
  font-size: var(--fs-label);
}

/* ── 서비스 섹션(04) — 2+1 레이아웃 (섹션 02 .card-grid 와 별개) ── */
.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
/* 케이스 참가 카드: 아래 한 줄 전체 폭 */
.service-card--full { grid-column: 1 / -1; }

/* 위 두 카드: 높이 통일(grid stretch) + 버튼 하단 정렬 */
.service-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card__cta { margin-top: auto; }

/* 좁은 카드: 스펙을 라벨 위 / 값 아래 세로 스택 */
.service-specs > div { flex-direction: column; gap: 2px; }
.service-specs dt { min-width: 0; }
/* dd 기본 들여쓰기 제거 — dt 와 같은 x 에서 시작 (가로 3열 스펙도 동일) */
.service-specs dd { margin: 0; margin-inline-start: 0; }

/* 케이스(전폭) 카드: 결과물·규모·비용 가로 3열 */
.service-card--full .service-specs {
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
/* 전폭 카드 버튼만 우측 정렬 + 위 여백(두 좁은 카드는 좌측 정렬 유지) */
.service-card--full .card__cta {
  margin-top: 32px;
  text-align: right;
}

@media (max-width: 720px) {
  .service-grid { grid-template-columns: 1fr; }
  .service-card--full .service-specs { grid-template-columns: 1fr; }
  /* 1열로 접히면 폭이 좁아 우측 정렬이 어색 → 좌측으로 되돌림 */
  .service-card--full .card__cta { text-align: left; }
}

/* ── 대상 리스트 ──────────────────────────────────────── */
.audience-list li { padding: 14px 0; }
.audience-list li + li { border-top: 1px solid var(--hairline); }
.audience-list strong { font-weight: 600; }

.author-name { font-weight: 600; }

/* 프로필 사진 — 이미 원형으로 마스킹된 이미지. radius·테두리·그림자 넣지 말 것.
 * width/height 를 명시해 로딩 중 레이아웃 밀림(CLS) 방지. */
.author-photo {
  width: 140px;
  height: 140px;
  display: block;
  margin-top: 32px;
  margin-bottom: 20px;
}

/* ── 폼 ───────────────────────────────────────────────── */
.form { display: grid; gap: 24px; margin-top: 8px; }
.form > * + * { margin-top: 0; }        /* grid gap 이 간격을 담당 */
.field { display: grid; gap: 8px; }
.field--radio { border: 0; padding: 0; margin: 0; min-width: 0; }
.field__label { font-size: var(--fs-label); font-weight: 600; }
.req { color: var(--muted); font-weight: 400; }
.field__input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 8px 14px;      /* 세로 축소 */
  min-height: 44px;       /* 터치 타겟 44px 유지 */
}
.field__input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea.field__input { resize: vertical; }
.radio-group { display: grid; gap: 8px; margin-top: 4px; }
.radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  padding: 8px 10px;
  border-radius: 6px;
}
/* 사전 선택(또는 사용자 선택)된 항목을 알아볼 수 있게 강조 */
.radio:has(:checked) { background: var(--accent-soft); }
.form-status { font-weight: 600; }

/* 필드 오류: 경고색 없이 Ink + 굵게 (강조색은 CTA 전용) */
.field-error {
  font-size: var(--fs-label);
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
}
.field__input[aria-invalid="true"] { border-color: var(--ink); }

/* 제출 성공: 폼 자리를 대체하는 메시지 */
.form-success {
  font-size: var(--fs-punch);
  line-height: var(--lh-normal);
  font-weight: 600;
}

/* 허니팟: 화면 밖으로. 봇만 채운다. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── 푸터 ─────────────────────────────────────────────── */
.footer {
  padding: 48px 0;
  font-size: var(--fs-label);
  color: var(--muted);
}

/* ── 반응형: 모바일 ───────────────────────────────────── */
@media (max-width: 768px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* 좁은 화면에서는 H1 줄바꿈을 자연 흐름에 맡긴다(강제 <br> 제거). */
@media (max-width: 720px) {
  .hero__title br { display: none; }
  /* 히어로 여백 = 기존 모바일 96/72 의 2/3 = 64 / 48 */
  .hero { padding: 64px 0 48px; }
  /* 비교표를 좁혀 첫 화면에 검증·속도 열까지 들어오게. sticky·shadow 는 유지.
   * 셀 max-width 는 table-layout:auto 에서 무시되므로 표 min-width 를 줄인다.
   * 첫 열의 긴 이름(바이브프리토타이핑)은 overflow-wrap 으로 여러 줄 허용
   * (keep-all 은 공백 없는 이 단어의 줄바꿈을 오히려 막는다). */
  .compare { min-width: 440px; }
  .compare th:first-child,
  .compare td:first-child { overflow-wrap: anywhere; }
}

@media (max-width: 720px) {
  .author-photo { width: 120px; height: 120px; }
}

@media (max-width: 640px) {
  .section { padding: 32px 0; }
}
