/* HM-TOKENS v1 · full — 반응형 토큰과 기본 규칙 (Homepage Maker 가 새 프로젝트에 넣은 파일)
   글자 크기·여백·터치는 이 파일의 변수(--fs-*, --space-*)만 쓴다. 새 크기가 필요하면 이 파일에 변수를 더한다.
   값은 CLAUDE.md 14번 규칙 A 표(모바일 기본값) — 768px 이상에서 clamp 로 데스크톱 크기까지 커진다.
   기본 규칙은 모두 :where() 로 특이도 0 — 사이트 CSS 가 언제나 이긴다(디자인을 덮지 않는다).
   모든 쪽 <head> 에서 사이트 CSS 보다 먼저 정적 <link> 로 부른다. 이 파일이 이미 있으면 앱은 다시 쓰지 않는다(고친 값 보존). */
:root {
  /* 글자 크기(모바일 기본) · 행간 · 자간 */
  --fs-display: 32px;
  --fs-h2: 26px;
  --fs-h3: 19px;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-caption: 13px;
  /* Studio Hailey 추가 — 첫 화면 소개(lead)·영문 라벨 */
  --fs-lead: 17px;
  --fs-label: 15px;
  --fs-en-title: 22px;
  --fs-watermark: 150px; /* 첫 화면 뒤 장식 글자(SVG 안 단위 — 화면 폭에 맞춰 줄어듦) */
  --lh-display: 1.25;
  --lh-h2: 1.25;
  --lh-h3: 1.35;
  --lh-body: 1.65;
  --lh-small: 1.5;
  --lh-caption: 1.5;
  --lh-lead: 1.7;      /* 소개 글(lead) */
  --lh-label: 1.2;     /* 영문 라벨·태그라인·채널 이름 */
  --lh-ui: 1.3;        /* 버튼·알약 안 글 */
  --lh-field: 1.6;     /* 여러 줄 입력칸 */
  --ls-heading: -0.02em;
  --ls-h3: -0.01em;
  --ls-body: 0;
  --ls-label: 0.08em;  /* 영문 섹션 라벨 */
  --ls-nav: 0.06em;    /* 데스크톱 영문 메뉴 */
  --ls-watermark: 0.04em;
  /* 간격 — 4px 배수만 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --section-y: 72px;
  --header-h: 60px;
  --gutter: 20px;
  --container: 1200px;
  /* 겹침 순서(z-index) — 장식 < 사진 < 첫 화면 서비스 목록 < 고정 머리글 < 창(modal) */
  --z-base: 0;
  --z-raised: 1;
  --z-overlay: 2;
  --z-header: 1000;
  --z-modal: 1100;
  /* 글자색 — 대비 AA 이상(흰 바탕에 #111 18.9:1 · #555 7.5:1). 색은 사이트가 정한다 — 바꿀 때도 4.5:1 이상(24px 이상 큰 글씨 3:1) */
  --color-text: #111111;
  --color-text-muted: #555555;
  --color-bg: #f7f5f0;
  /* 터치 · 안전 영역(노치·홈바 — viewport-fit=cover 일 때 값이 생긴다) */
  --tap-min: 44px;
  --tap-gap: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
@media (min-width: 768px) {
  :root {
    --fs-display: clamp(32px, 1.7857vw + 18.2857px, 44px);
    --fs-h2: clamp(26px, 1.4881vw + 14.5714px, 36px);
    --fs-h3: clamp(19px, 0.4464vw + 15.5714px, 22px);
    --fs-lead: clamp(17px, 0.2976vw + 14.7143px, 19px);
    --fs-en-title: clamp(22px, 0.8929vw + 15.1429px, 28px);
    --header-h: 72px;
    --fs-body: clamp(16px, 0.2976vw + 13.7143px, 18px);
    --section-y: clamp(72px, 7.1429vw + 17.1429px, 120px);
  }
}

/* 기본 규칙(규칙 B) — :where() 특이도 0 */
:where(html) { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
:where(body) { font-size: var(--fs-body); line-height: var(--lh-body); letter-spacing: var(--ls-body); color: var(--color-text); background-color: var(--color-bg); }
:where(h1) { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--ls-heading); }
:where(h2) { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--ls-heading); }
:where(h3) { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-heading); }
:where(small) { font-size: var(--fs-small); line-height: var(--lh-small); }
/* 입력칸 16px 이상(iOS 자동 확대 방지) · 높이 44px 이상 */
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="hidden"], [type="file"], [type="image"]), select, textarea) { font-size: max(16px, 1em); min-height: var(--tap-min); }
/* 누르는 대상 44px 이상 — 글 속 링크는 그대로(줄 높이를 바꾸지 않는다), 아이콘·작은 링크는 class="hm-tap" */
:where(button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]) { min-height: var(--tap-min); }
:where(.hm-tap) { display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap-min); min-height: var(--tap-min); }
:where(a, button, [role="button"], label, summary) { touch-action: manipulation; }
/* 이미지·영상은 칸을 넘지 않는다(비율 유지) */
:where(img, video) { max-width: 100%; height: auto; }
:where(svg, iframe, canvas) { max-width: 100%; }
:where(canvas) { height: auto; }
/* 화면 높이 — 100vh 대신(모바일 주소창 대응) */
:where(.hm-full-h) { min-height: 100vh; min-height: 100svh; min-height: 100dvh; }
/* 움직임 줄이기 설정이면 장식 애니메이션 끄기(규칙 B5) */
@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; }
}
