/* ============================================================
   base.css — 토큰 · 리셋 · 유틸 (GLOBAL ECHO)
   컨벤션(convention 스킬)의 구현체다. 페이지는 여기 정의된
   토큰·유틸을 쓰고 생값(하드코딩 px·생 clamp)을 쓰지 않는다.

   사이트마다 바꾸는 것: 토큰 값 (:root 블록)
   건드리지 않는 것:     유틸 클래스 정의, 리셋

   폰트 로딩: 각 페이지 <head> 에서 ../_shared/fonts/fonts.css 를 링크한다.
   (Google Fonts 의 unicode-range 분할본을 셀프호스트 — 브라우저가 실제로 쓰는
    글자 조각만 받는다. 해외 접속 속도 요구 대응. 근거: site/tokens.md)
   ============================================================ */

:root {
  /* ── 글꼴 — 시안: 한글 Noto Sans KR · 영문/숫자 Plus Jakarta Sans ── */
  --font-ko:    "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-latin: "Plus Jakarta Sans", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  --font-num:   var(--font-latin);   /* 시안: 숫자(170+, 13.29, 연도)는 Plus Jakarta Sans */

  /* ── 크기 — 시안 1920 최대값 → 390 하한, 사이 유동 (Utopia 방식) ──
     요소에는 이 토큰만 쓴다. 시안 값과 가장 가까운 토큰을 고른다. */
  --fs-88: clamp(40px, calc(27.76px + 3.137vw), 88px);
  --fs-76: clamp(36px, calc(25.80px + 2.614vw), 76px);
  --fs-72: clamp(36px, calc(26.82px + 2.353vw), 72px);
  --fs-64: clamp(34px, calc(26.35px + 1.961vw), 64px);
  --fs-56: clamp(30px, calc(23.37px + 1.699vw), 56px);
  --fs-52: clamp(30px, calc(24.39px + 1.438vw), 52px);
  --fs-48: clamp(28px, calc(22.90px + 1.307vw), 48px);
  --fs-44: clamp(26px, calc(21.41px + 1.176vw), 44px);
  --fs-40: clamp(26px, calc(22.43px + 0.915vw), 40px);
  --fs-36: clamp(24px, calc(20.94px + 0.784vw), 36px);
  --fs-32: clamp(22px, calc(19.45px + 0.654vw), 32px);
  --fs-30: clamp(21px, calc(18.71px + 0.588vw), 30px);
  --fs-28: clamp(20px, calc(17.96px + 0.523vw), 28px);
  --fs-26: clamp(19px, calc(17.22px + 0.458vw), 26px);
  --fs-24: clamp(19px, calc(17.73px + 0.327vw), 24px);
  --fs-22: clamp(18px, calc(16.98px + 0.261vw), 22px);
  --fs-20: clamp(17px, calc(16.24px + 0.196vw), 20px);
  --fs-19: clamp(16px, calc(15.24px + 0.196vw), 19px);
  --fs-18: clamp(16px, calc(15.49px + 0.131vw), 18px);
  --fs-17: clamp(15px, calc(14.49px + 0.131vw), 17px);
  --fs-16: clamp(15px, calc(14.75px + 0.065vw), 16px);
  --fs-15: clamp(14px, calc(13.75px + 0.065vw), 15px);
  --fs-14: 14px;
  --fs-13: 13px;
  --fs-12: 12px;

  /* 별칭 (seed 호환) */
  --fs-body:  var(--fs-16);
  --fs-small: var(--fs-14);
  --fs-lead:  var(--fs-18);
  --fs-h3:    var(--fs-26);
  --fs-h2:    var(--fs-48);
  --fs-h1:    var(--fs-72);

  /* 자간 — 시안: 한글 제목 -2~-3%, 본문 -0.5% */
  --ls-tight: -0.025em;
  --ls-head:  -0.02em;
  --ls-body:  -0.005em;

  /* ── 색 — Figma 변수 "GE Brand" 원본 (site/tokens.md) ── */
  --navy-950: #05121f;
  --navy-900: #071a2e;
  --navy-800: #0c2742;
  --navy-600: #1a4a8c;
  --teal-500: #52b2aa;
  --teal-100: #e7f4f2;
  --green-700: #45832b;
  --green-600: #539535;
  --green-400: #7cc24a;
  --green-100: #e8f2e1;
  --gray-900: #14181d;
  --gray-700: #3a3f45;
  --gray-500: #66707b;
  --gray-400: #8a939c;
  --gray-300: #c5ccd3;
  --gray-200: #e1e6eb;
  --gray-100: #f2f5f8;
  --ink:      #26313d;
  --ink-soft: #4a5560;
  --white:    #ffffff;

  --page:       var(--white);
  --surface:    var(--gray-100);
  --text:       var(--navy-900);
  --text-soft:  var(--gray-500);
  --text-muted: var(--gray-400);
  --line:       #e2e6eb;
  --primary:    var(--green-600);
  --accent:     var(--green-400);

  /* ── 여백 · 레일 — 시안: 1920 에서 좌우 160 = 레일 1600 ── */
  --gutter: 100px;
  --rail:   1600px;
  --sec-pad: clamp(72px, calc(54.67px + 4.444vw), 140px);   /* 섹션 상하 140 */
  --sec-pad-lg: clamp(80px, calc(59.61px + 5.229vw), 160px);   /* 섹션 상하 160 */
  --sec-gap: clamp(36px, calc(28.86px + 1.830vw), 64px);    /* 제목 → 본문 64 */
  --gap-48: clamp(28px, calc(22.90px + 1.307vw), 48px);
  --gap-40: clamp(24px, calc(19.92px + 1.046vw), 40px);
  --gap-32: clamp(20px, calc(16.94px + 0.784vw), 32px);
  --gap-24: clamp(16px, calc(13.96px + 0.523vw), 24px);
  --radius-lg: clamp(18px, calc(16.47px + 0.392vw), 24px);
  --radius-xl: clamp(20px, calc(17.96px + 0.523vw), 28px);
  --radius-md: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  /* ── 모션 — 부드럽게 (2026-10-28 지시) ── */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur:  .35s;
  --dur-reveal: .9s;

  /* ── 터치 ── */
  --hit-min: 44px;
}

@media (max-width: 1600px) {
  :root { --gutter: 5vw; }
}
@media (max-width: 599.98px) {
  :root { --gutter: 20px; }   /* compact: 5vw(19.5px)≈20 — 390 에서 시안 비례 유지 */
}

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

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

body {
  min-width: 320px;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-ko);
  font-size: var(--fs-body);
  line-height: 1.6;
  letter-spacing: var(--ls-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;          /* 한글 단어 중간 개행 방지 */
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.33; letter-spacing: var(--ls-head); }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
table { border-collapse: collapse; }

/* ── 컨테이너 — 좌우 여백은 여기서만 소비한다 ────────────────
   페이지가 px 패딩을 직접 박지 않는다. */
.container,
.container--narrow,
.container--wide {
  margin-inline: auto;
}
.container         { width: min(var(--rail), calc(100% - var(--gutter) * 2)); }
.container--narrow { width: min(1200px,     calc(100% - var(--gutter) * 2)); }
.container--wide   { width: min(1792px,     calc(100% - var(--gutter) * 2)); }   /* Mix H 레일 (좌우 64) */

/* ── 이미지 · 배경 · 썸네일 ──────────────────────────────────
   화면이 바뀌어도 찌그러지지 않게 항상 cover (비율 유지, 잘림 허용) */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.img-contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.bg-cover {
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}
.thumb {
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  aspect-ratio: 4 / 3;           /* 페이지에서 override 가능 */
}

/* ── 타이포 유틸 ─────────────────────────────────────────── */
.lead        { font-family: var(--font-latin); font-size: var(--fs-lead); }
.latin       { font-family: var(--font-latin); letter-spacing: 0; }
.num         { font-family: var(--font-num); letter-spacing: 0; }   /* 비례폭 — Plus Jakarta 고정폭 1 은 받침이 생겨 시안과 다름 (main-mixh 워커 제보) */
[data-num]   { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: 0; }   /* 카운트업 등 폭 고정이 필요할 때만 */
.nobr        { white-space: nowrap; }   /* 수식어+명사·가운뎃점 구가 줄 끝에서 갈리지 않게 */

/* ── 시안 줄바꿈 보존 — 본문 단락용 ──────────────────────────
   본문 단락의 시안 줄바꿈은 <br class="br-wide"> 로 — 시안 폭 등급(xlarge ≥1600)에서만 살아난다.
   제목의 <br> 은 의미 있는 행 분리이므로 페이지가 따로 다룬다.
   .br-pc  : 데스크톱(≥1200)에서만 / .br-mo : 모바일(<600)에서만 */
.br-wide { display: none; }
@media (min-width: 1600px) { .br-wide { display: inline; } }
.br-pc { display: none; }
@media (min-width: 1200px) { .br-pc { display: inline; } }
.br-mo { display: inline; }
@media (min-width: 600px) { .br-mo { display: none; } }

/* ── 접근성 ──────────────────────────────────────────────── */
.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;
}
:where(a, button, [tabindex], input, select, textarea):focus-visible {
  outline: 2px solid var(--green-400);
  outline-offset: 2px;
}
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 1000;
  display: inline-flex; align-items: center; min-height: var(--hit-min);
  padding: 0 16px; border-radius: 8px;
  background: var(--navy-900); color: #fff; font-size: 14px;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 12px; }

/* ── 콘텐츠 높이 원칙 ─────────────────────────────────────────
   흐르는 텍스트 영역에 고정 height 를 박지 않는다.
   내용이 높이를 결정하고, 여백은 padding/margin 으로 만든다.
   고정 height 는 '내용이 흐르지 않는' 곳에만 —
   이미지 박스, 썸네일, 장식 요소.
   ─────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
