/* =============================================================
   MEDISO redesign v2 — SHARED CLINICAL FOUNDATION (invariant)
   두 시안(concept-1 클리니컬 트러스트 / concept-2 서플라이 카탈로그)이
   공유하는 불변식: 컨테이너 1개 + 클리니컬 팔레트 + 타이포 + 프리미티브.
   ────────────────────────────────────────────────────────────
   근거: design-os/style-archetypes.md §R1~R4 (컨테이너/컬러/토큰상속/공유불변식)
   팔레트 정본: 04-design/DESIGN.md (clinical teal/navy) — 새 팔레트 발명 금지.
   차별화는 레이아웃·밀도·컴포넌트·타이포·이미지톤 축에서만(컬러축 잠금).
   ============================================================= */

:root {
  /* ---- Surfaces ---- */
  --bg:          #f6fafa;   /* page background */
  --surface:     #ffffff;   /* cards, panels */
  --surface-2:   #edf5f4;   /* alternating band */
  --ink-deep:    #062c39;   /* single deep break-section bg (contrast rhythm) */

  /* ---- Text ---- */
  --ink:    #08323f;        /* headings + primary text (on white ~13:1) */
  --muted:  #47606a;        /* body copy (~7:1) */
  --soft:   #7a939a;        /* labels / metadata */
  --on-dark:      #f4fbfb;  /* text on --ink-deep */
  --on-dark-soft: #b7d3d3;

  /* ---- Lines ---- */
  --line:   #dceae8;
  --line-2: #eaf2f1;
  --line-dark: #23515c;     /* dividers on deep band */

  /* ---- Brand: ONE primary + ONE accent (R2: 고채도 ≤2) ---- */
  --primary:      #06495f;  /* navy-teal — CTA fill, key numerals (white text ~7.4:1) */
  --primary-600:  #0a5d75;
  --primary-ink:  #ffffff;
  --accent:       #12a594;  /* clinical teal — active states, thin markers, small icons */
  --accent-strong:#0c6e68;  /* teal for TEXT/links needing AA (~5:1 on white) */
  --accent-wash:  #e2f3f0;  /* teal tint fill (chips, strips) */

  /* ---- Radius ---- */
  --r-tag:   8px;
  --r-card:  14px;
  --r-panel: 24px;
  --r-pill:  999px;

  /* ---- Shadow (DESIGN.md) ---- */
  --shadow-1: 0 10px 30px rgba(6, 36, 45, .08);
  --shadow-2: 0 18px 48px rgba(6, 36, 45, .12);
  --shadow-3: 0 28px 80px rgba(6, 36, 45, .18);

  /* ---- Layout ---- */
  --max:      1180px;
  --max-wide: 1320px;
  --gutter:   clamp(20px, 5vw, 40px);

  /* ---- Motion ---- */
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Pretendard Variable";
  src: local("Pretendard");
  font-display: swap;
}

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

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

body {
  margin: 0;
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo",
               "Noto Sans KR", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }

/* ===========================================================
   §R1  CONTAINER — 단 하나. 전 섹션이 상속.
   섹션마다 calc((100vw-Npx)/2) 유사컨테이너 반복 금지.
   =========================================================== */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--max-wide); }

/* full-bleed는 배경밴드/배경이미지에만. 텍스트·카드는 컨테이너 안. */
.band { width: 100%; }
.band--alt  { background: var(--surface-2); }
.band--deep { background: var(--ink-deep); color: var(--on-dark); }
.band--deep h1, .band--deep h2, .band--deep h3 { color: var(--on-dark); }
.band--deep p { color: var(--on-dark-soft); }

.section { padding-block: clamp(56px, 8vw, 104px); }
.section--tight { padding-block: clamp(40px, 6vw, 72px); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { margin: 0; color: var(--ink); letter-spacing: 0; line-height: 1.18; font-weight: 800; }
p { margin: 0; }

.display { font-size: clamp(34px, 5.2vw, 56px); font-weight: 800; line-height: 1.1; }
.h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; line-height: 1.16; }
.h2 { font-size: clamp(25px, 3.1vw, 34px); font-weight: 780; line-height: 1.22; }
.h3 { font-size: clamp(19px, 2vw, 24px); font-weight: 720; line-height: 1.32; }
.lead { font-size: clamp(17px, 1.5vw, 19px); line-height: 1.72; color: var(--muted); font-weight: 500; }
.body { font-size: 16px; line-height: 1.72; color: var(--muted); }
.small { font-size: 14px; line-height: 1.6; color: var(--muted); }

/* eyebrow — 조용한 라벨(브루탈 올캡스 모노 아님) */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
  color: var(--accent-strong);
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; border-radius: 2px;
  background: var(--accent); display: inline-block;
}
.band--deep .eyebrow { color: #7fd8cc; }
.band--deep .eyebrow::before { background: #7fd8cc; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 700; cursor: pointer;
  border: 1px solid transparent; transition: transform .12s var(--ease),
    background .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-600); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn-ghost { background: transparent; color: var(--accent-strong); padding-inline: 6px; }
.btn-ghost:hover { color: var(--primary); }
.band--deep .btn-secondary { background: transparent; color: var(--on-dark); border-color: var(--line-dark); }
.band--deep .btn-secondary:hover { border-color: #7fd8cc; color: #7fd8cc; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 250, 250, .82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px; gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: .01em; }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; background: var(--primary); color: #fff; font-weight: 800; font-size: 16px;
}
.brand small { display: block; font-size: 11px; font-weight: 600; color: var(--soft); letter-spacing: .04em; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { font-size: 15px; font-weight: 600; color: var(--muted); position: relative; padding-block: 6px; }
.nav-links a:hover { color: var(--ink); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--accent); transition: width .2s var(--ease);
}
.nav-links a:hover::after { width: 100%; }
.header-cta { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }

/* ---------- Proof strip ---------- */
.proof {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-card); overflow: hidden;
}
.proof > div { background: var(--surface); padding: 26px 24px; }
.proof .num { font-size: clamp(26px, 3vw, 34px); font-weight: 800; color: var(--primary); line-height: 1.1; }
.proof .lbl { margin-top: 6px; font-size: 14px; color: var(--muted); font-weight: 500; }
.band--deep .proof { background: var(--line-dark); border-color: var(--line-dark); }
.band--deep .proof > div { background: #0a3745; }
.band--deep .proof .num { color: #7fd8cc; }
.band--deep .proof .lbl { color: var(--on-dark-soft); }

/* ---------- Card (base) ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-1);
  transition: transform .18s var(--ease), box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--accent); }

/* category strip = 단일 teal 톤 (핑크/그린 다색 금지 — R2 절제) */
.cat-strip { height: 3px; border-radius: 3px; background: var(--accent); width: 40px; }

/* ---------- Tag / chip ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--r-tag);
  font-size: 12.5px; font-weight: 700; letter-spacing: .01em;
  background: var(--accent-wash); color: var(--accent-strong);
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line);
  transition: all .16s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip[aria-selected="true"], .chip[aria-pressed="true"], .chip.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.field input, .field select, .field textarea {
  padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-size: 15px; transition: border-color .16s ease, box-shadow .16s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(18,165,148,.16);
}
.field .hint { font-size: 12.5px; color: var(--soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-deep); color: var(--on-dark); padding-block: 48px 40px; }
.site-footer a { color: var(--on-dark-soft); }
.site-footer a:hover { color: #fff; }
.site-footer .foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.site-footer .muted { color: var(--on-dark-soft); font-size: 14px; line-height: 1.75; }
.site-footer hr { border: 0; border-top: 1px solid var(--line-dark); margin: 32px 0 20px; }

/* placeholder note — 미확인 자료 표시(반-날조) */
.todo-note {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--r-pill);
  background: #fff7e8; color: #8a6414; border: 1px solid #f0dcae;
  font-size: 13px; font-weight: 600;
}
.band--deep .todo-note { background: rgba(255,255,255,.06); color: #f0d9a6; border-color: #6a5a2e; }

/* image example caption */
.img-note {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(6,44,57,.82); color: #e9f6f4; backdrop-filter: blur(4px);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  padding: 6px 11px; border-radius: var(--r-pill);
}

/* ---------- Reveal (IntersectionObserver + 3중 안전망; ScrollTrigger once 금지) ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .site-footer .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .proof { grid-template-columns: repeat(2, 1fr); }
  .site-footer .foot-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 480px) {
  .proof { grid-template-columns: 1fr; }
}
