/* FITMON 웹 레이아웃·컴포넌트. 색과 크기는 tokens.css의 var()만 쓴다. */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.35; margin: 0; }
p { margin: 0; }
a { color: var(--accent-text); }
img { max-width: 100%; height: auto; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section-gap) 0; }
.section-sunken { background: var(--surface-sunken); }
.muted { color: var(--text-secondary); font-size: var(--fs-sub); }

/* 헤더 */
.site-header { border-bottom: 1px solid var(--divider); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.site-header .wrap > a { display: inline-flex; align-items: center; min-height: 48px; }
.site-header img { height: 26px; width: auto; }
.site-nav { display: flex; gap: 28px; align-items: center; }
.site-nav a { display: inline-flex; align-items: center; min-height: 48px; color: var(--text-secondary); text-decoration: none; font-size: var(--fs-sub); }
.site-nav a:hover { color: var(--text); }
.site-menu { display: none; }
.site-menu summary { list-style: none; cursor: pointer; padding: 12px; min-height: 48px; display: flex; align-items: center; }
.site-menu summary::-webkit-details-marker { display: none; }

@media (max-width: 760px) {
  .site-nav { display: none; }
  .site-menu { display: block; }
  .site-menu[open] .site-nav { display: flex; flex-direction: column; gap: 8px; position: absolute; right: var(--gutter); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 16px 24px; box-shadow: var(--card-shadow); }
}

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  border-radius: var(--radius-button); border: 1px solid transparent;
  font-family: var(--font-body); font-size: var(--fs-body); font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-pressed); }
.btn-soft { background: var(--accent-soft); color: var(--accent-text); }
.btn-soft:hover { background: var(--accent-soft-pressed); }

/* 카드 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px;
}
.card h3 { font-size: var(--fs-card-title); margin-bottom: 8px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

/* 문서 본문 */
.doc { max-width: var(--doc-max); margin: 0 auto; padding: 64px var(--gutter); }
.doc h1 { font-size: var(--fs-section); margin-bottom: 8px; }
.doc h2 { font-size: var(--fs-card-title); margin: 40px 0 12px; }
.doc p, .doc li { margin-bottom: 12px; }
/* table-layout: fixed — auto 레이아웃은 word-break: keep-all이 걸린 셀의 최소
   내용 너비를 그대로 열 너비로 반영해서, 표가 .doc 폭을 넘어 가로 스크롤을 만든다
   (320px에서 실측 확인함). fixed는 열 너비를 아래 th 규칙과 100%로만 정하고,
   넘치는 글자는 줄바꿈으로 흡수한다. */
.doc table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: var(--fs-sub); table-layout: fixed; }
.doc th, .doc td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
.doc th { background: var(--surface-sunken); font-weight: 600; }
/* 행 헤더 셀(예: "사업자등록번호")이 한 글자씩 세로로 쌓이는 것을 막는다.
   .doc는 최대 720px로 폭이 고정돼 있어 뷰포트 크기와 무관하게 일어난다 —
   320px과 1440px 모두에서 실측 확인함. scope="col" 헤더 행(구분·항목 같은 표)은
   폭을 강제하지 않는다 — 값 칸이 짧아 굳이 고정할 이유가 없다. */
.doc th[scope="row"] { width: 132px; }
.doc-meta { color: var(--text-secondary); font-size: var(--fs-sub); }

/* 푸터 */
.site-footer { border-top: 1px solid var(--divider); background: var(--surface-sunken); padding: 48px 0; }
.site-footer .company { color: var(--text-secondary); font-size: var(--fs-sub); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 20px; }
.site-footer .links a { display: inline-flex; align-items: center; min-height: 48px; color: var(--text-secondary); text-decoration: none; font-size: var(--fs-sub); }
.site-footer .links a:hover { color: var(--text); }
.site-footer .links a.strong { color: var(--text); font-weight: 600; }

/* 히어로 */
.hero { padding: 80px 0; }
.hero .wrap { display: grid; grid-template-columns: 1fr 380px; gap: 64px; align-items: center; }
.hero h1 { font-size: var(--fs-hero); margin-bottom: 20px; }
.hero-copy p { color: var(--text-secondary); margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
/* color는 일부러 안 준다 — .hero-copy p(0-1-1)가 .hero-note(0-1-0)보다 특정성이 높아
   이 규칙의 color는 죽은 선언이었다. 실제로는 .hero-copy p의 --text-secondary로 렌더링된다
   (경고문 대비가 더 높아지므로 그대로 둔다). */
.hero-note { font-size: var(--fs-sub); }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .phone { justify-self: center; }
}

/* 앱 화면 재현 — 이미지가 아니라 실제 토큰으로 그린다 */
.phone {
  width: 100%;
  max-width: 320px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 36px;
  padding: 12px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
}
.phone-screen {
  background: var(--bg);
  border-radius: 26px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.phone-screen .screen-title { font-family: var(--font-display); font-size: var(--fs-card-title); }

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 16px;
}
.metric-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.metric-badge {
  width: 36px; height: 36px; flex: none;
  border-radius: var(--radius-badge);
  display: flex; align-items: center; justify-content: center;
}
.metric-name { font-size: var(--fs-sub); color: var(--text-secondary); }
.metric-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric-value .unit { font-size: var(--fs-sub); font-weight: 400; color: var(--text-secondary); margin-left: 4px; }

/* CSS만으로 그린 미니 막대 */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 40px; margin-top: 10px; }
.bars span { flex: 1; border-radius: 3px; opacity: 0.85; }

.section h2 { font-size: var(--fs-section); margin-bottom: 12px; }
.lede { color: var(--text-secondary); margin-bottom: 40px; max-width: 640px; }

.steps { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); counter-reset: step; }
.steps .card { position: relative; }
.steps .card h3::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-right: 10px;
  border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text);
  font-family: var(--font-body); font-size: var(--fs-sub); font-weight: 700;
}
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }

.cta-band { text-align: center; }
.cta-band h2 { margin-bottom: 12px; }
.cta-band .hero-actions { justify-content: center; margin-top: 24px; }
