/*
 * SynapseWorks 홈페이지 공통 셸 — 토큰 · 기본 · 컨트롤 · 상단바 · 푸터
 * (H0, docs/homepage-plan.md §1 · 시안 docs/design-sian-homepage-2026-09/Homepage-1c.dc.html)
 *
 * ★앱(client/)과 다른 디자인이다. 앱의 2b 토큰(진한 인디고 · 반경 3px)을 가져오지 않는다 —
 *   홈페이지는 CI 원본(#4F46E5 · 알약형 · 종이색)이다. 섞지 않는다.
 * ★밝은 화면 하나만 둔다(의도적으로 한 가지 모습에 맞춘 디자인). 대신 배경·글자색을 전부 명시한다.
 */

/* ── 1. 토큰 ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* 면 — 바탕은 순백이 아니라 따뜻한 종이색(딱딱함을 빼는 핵심) */
  --paper: #FFFDFB;
  --surface: #F4F2EF;
  --line: #EAE6E0;
  --line-soft: #F0ECE6;
  --line-input: #DDD8D0;
  --line-faint: #D3CEC6;

  /* 주색 · 보조 — #0EA5E9는 최신/활성 "하나에만" */
  --primary: #4F46E5;
  --primary-hover: #3730A3;
  --tint: #F2F3FF;
  --on-tint: #312A9E;
  --node: #818CF8;
  --node-soft: #A5B4FC;
  --sky: #0EA5E9;

  /* 어두운 면 — 페이지당 하나 */
  --dark: #1F2333;
  --dark-hover: #2C3147;
  --hero: #14142B;
  --on-dark-sub: #A8AFC6;

  /* 글자 */
  --title: #1F2333;
  --text-strong: #3A3F52;
  --text: #57534E;
  --sub: #8B8579;
  --faint: #A8A29A;
  --required: #DB2777;

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui,
    "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;

  /* 배치 — 시안의 판 폭 1180 · 좌우 56 */
  --wrap: 1180px;
  --gutter: clamp(16px, 4.75vw, 56px);
  --header-h: 70px;
  --r-card: 5px;
}

/* ── 2. 기본 ─────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--title);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums; /* 숫자는 전역 tabular-nums(§1) */
  -webkit-font-smoothing: antialiased;
  word-break: keep-all; /* 한국어 어절 단위 줄바꿈 */
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
}

h1, h2, h3, h4, p, figure, blockquote {
  margin: 0;
}

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

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--primary-hover);
}

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

/* hidden 속성은 display를 이긴다 — 필터로 숨기는 카드 · 칩이 flex여도 확실히 사라지게 */
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
}
.skip-link:focus {
  top: 12px;
  color: #fff;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(40px, 6vw, 64px);
}

/* ── 3. 활자 — Display 68 · Heading 34 · Body 15 · Kicker 12 ──────────────── */
.t-display {
  font-size: clamp(40px, 6.2vw, 68px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
}
.t-h1 {
  font-size: clamp(32px, 4.4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.t-heading {
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.t-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
}
.t-lead {
  font-size: 16px;
  color: var(--text);
  line-height: 1.8;
}
.t-body {
  color: var(--text);
}
.t-small {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.75;
}
.kicker {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sub);
}

/* ── 4. 컨트롤 — 알약형(radius = height/2), 높이 48 / 40 / 36 / 34 ─────────── */
/* ★솔리드 인디고(.btn--primary)는 한 화면에 하나(§1.1). */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-strong);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn--lg {
  height: 48px;
  padding: 0 26px;
  font-size: 15px;
  font-weight: 700;
}
.btn--sm {
  height: 36px;
  padding: 0 17px;
}
.btn--xs {
  height: 34px;
  padding: 0 15px;
  font-size: 13px;
}
.btn--primary {
  background: var(--primary);
  color: #fff;
}
.btn--primary:hover {
  background: var(--primary-hover);
  color: #fff;
}
.btn--dark {
  background: var(--dark);
  color: #fff;
}
.btn--dark:hover {
  background: var(--dark-hover);
  color: #fff;
}
.btn--outline {
  border-color: var(--line-input);
  color: var(--text-strong);
}
.btn--outline:hover {
  background: var(--surface);
  color: var(--title);
}
.btn--light {
  background: #fff;
  color: var(--dark);
  font-weight: 700;
}
.btn--light:hover {
  background: var(--tint);
  color: var(--dark);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-input);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover {
  background: var(--surface);
  color: var(--title);
}

/* 칩 — 선택 여부는 aria-pressed(버튼) 또는 안에 든 input:checked(폼)로 */
.chip {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-input);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.chip--sm {
  height: 34px;
  padding: 0 15px;
  font-size: 13px;
}
.chip:hover {
  border-color: var(--line-faint);
  color: var(--title);
}
.chip[aria-pressed="true"],
.chip:has(input:checked) {
  /* 시안의 1.5px 테두리 — 두께를 바꾸면 글자가 밀리므로 그림자로 0.5px를 더한다 */
  border-color: var(--primary);
  box-shadow: inset 0 0 0 0.5px var(--primary);
  background: var(--tint);
  color: var(--on-tint);
  font-weight: 600;
}
.chip:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 입력 */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.field__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-strong);
}
.field__label .req {
  color: var(--required);
}
.field__hint {
  font-weight: 400;
  color: var(--faint);
}
.input {
  width: 100%;
  height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line-input);
  border-radius: 999px;
  background: #fff;
  color: var(--title);
  font: inherit;
  font-size: 14.5px;
}
.input::placeholder {
  color: var(--faint);
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 0.5px var(--primary);
}
textarea.input {
  height: auto;
  min-height: 110px;
  padding: 16px 20px;
  border-radius: 18px;
  line-height: 1.75;
  resize: vertical;
}

/* 카드 — 반경 4~5px(컨트롤만 알약형) */
.card {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 26px 28px;
}
.card--surface {
  border-color: transparent;
  background: var(--surface);
}
.card--dark {
  border-color: transparent;
  background: var(--dark);
  color: #fff;
}
.card--dark .t-small {
  color: var(--on-dark-sub);
}

/* ── 5. 상단바 ──────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 253, 251, 0.92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}
/* 홈은 히어로가 상단바에서 바로 이어진다(시안 01) — 선을 긋지 않는다 */
.page-home .site-header {
  border-bottom-color: transparent;
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 22px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  color: var(--title);
  font-size: 15px;
  line-height: 1;
}
.brand:hover {
  color: var(--title);
}
.brand__word b {
  font-weight: 800;
}
.brand__word span {
  color: var(--sub);
  font-weight: 400;
}

.site-nav {
  display: flex;
  gap: 26px;
  font-size: 13.5px;
}
.site-nav a {
  color: var(--text);
}
.site-nav a:hover {
  color: var(--title);
}
.site-nav a[aria-current="page"] {
  color: var(--title);
  font-weight: 700;
}

/* 좁은 화면의 메뉴 — JS 없이 <details>로 연다 */
.site-menu {
  display: none;
  position: relative;
}
.site-menu > summary {
  list-style: none;
}
.site-menu > summary::-webkit-details-marker {
  display: none;
}
.site-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: min(280px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--paper);
  box-shadow: 0 18px 40px -20px rgba(31, 35, 51, 0.35);
}
.site-menu__panel a {
  padding: 10px 12px;
  border-radius: 4px;
  color: var(--text);
  font-size: 14.5px;
}
.site-menu__panel a:hover {
  background: var(--surface);
  color: var(--title);
}
.site-menu__panel a[aria-current="page"] {
  color: var(--title);
  font-weight: 700;
}
.site-menu__sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

@media (max-width: 880px) {
  .site-header__inner {
    gap: 10px;
  }
  .site-nav {
    display: none;
  }
  .site-menu {
    display: block;
  }
}

/* ── 6. 푸터 ────────────────────────────────────────────────────────────── */
.site-footer__inner {
  padding-block: 0 56px;
}
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.site-footer__copy {
  margin-right: auto;
  font-size: 12.5px;
  color: var(--faint);
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 12.5px;
}
.site-footer__links a {
  color: var(--sub);
}
.site-footer__links a:hover {
  color: var(--title);
}
.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 14px;
  font-size: 12px;
}
.site-footer__legal a {
  color: var(--sub);
}
/* ★개인정보 처리방침은 다른 링크보다 눈에 띄게 표시한다(개인정보 보호법 시행령 제31조) */
.site-footer__legal a.is-privacy {
  color: var(--text-strong);
  font-weight: 700;
}
.site-footer__legal a:hover {
  color: var(--title);
}

/* ── 7. 움직임 줄이기 — 노드 애니메이션 포함 전부 정지(§2.1) ─────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
