/* ============================================================
   온빛 프로토콜 — 통합 디자인 시스템 v1.0
   /onvit_protocol_guide.pdf의 톤(호텔식 프리미엄 검진센터)을
   모든 페이지(index/screening/app/report)에 일관 적용한다.
============================================================ */

:root {
  /* ===== Navy Scale ===== */
  --navy-900: #071529;
  --navy-800: #0B1F3A;
  --navy-700: #162D52;
  --navy-600: #1F3D6B;
  --navy-500: #284878;

  /* ===== Gold Scale ===== */
  --gold-700: #A88A38;
  --gold-600: #B0903E;
  --gold-500: #C9A84C;
  --gold-400: #D9BC68;
  --gold-300: #E8C96A;
  --gold-100: #F5EDD4;
  --gold-soft: rgba(201, 168, 76, 0.15);
  --gold-border: rgba(201, 168, 76, 0.28);

  /* ===== Neutral ===== */
  --cream:  #F8F5EE;
  --warm:   #FDFBF7;
  --white:  #FFFFFF;
  --ink:    #0B1F3A;
  --text-mid:   #4A5670;
  --text-soft:  #6B7488;
  --text-faint: #9CA3B8;
  --line:      rgba(11, 31, 58, 0.08);
  --line-mid:  rgba(11, 31, 58, 0.16);
  --line-dark: rgba(255, 255, 255, 0.08);

  /* ===== 5 Risk Types ===== */
  --type-1: #C0392B;  /* 1형 염증형 */
  --type-2: #8E44AD;  /* 2형 영양결핍형 */
  --type-3: #D68910;  /* 3형 당독소형 */
  --type-4: #1E8449;  /* 4형 독소형 */
  --type-5: #21618C;  /* 5형 정서형 */

  /* ===== 7 Korean Guides ===== */
  --guide-bapsang: #C0392B;
  --guide-georeum: #D68910;
  --guide-jam:     #21618C;
  --guide-maeum:   #8E44AD;
  --guide-baeum:   #1E8449;
  --guide-bium:    #4A5568;
  --guide-chaeum:  #B0903E;

  /* ===== Typography ===== */
  --font-body:    'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif:   'Noto Serif KR', serif;
  --font-display: 'Montserrat', sans-serif;
  --font-italic:  'Cormorant Garamond', serif;

  /* ===== Text Sizes ===== */
  --text-xs:   0.72rem;
  --text-sm:   0.82rem;
  --text-base: 0.95rem;
  --text-md:   1.05rem;
  --text-lg:   1.25rem;
  --text-xl:   1.55rem;
  --text-2xl:  2rem;
  --text-3xl:  clamp(2.2rem, 4vw, 3.4rem);
  --text-hero: clamp(2.4rem, 5.5vw, 4.6rem);

  /* ===== Radius ===== */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* ===== Spacing ===== */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.85rem;
  --space-4: 1.2rem;
  --space-5: 1.8rem;
  --space-6: 2.5rem;
  --space-7: 3.5rem;
  --space-8: 5rem;

  /* ===== Layout ===== */
  --container-max: 1280px;
  --section-py: 6rem;
  --header-h: 70px;

  /* ===== Shadow ===== */
  --shadow-sm:   0 4px 12px rgba(11, 31, 58, 0.06);
  --shadow-md:   0 10px 30px rgba(11, 31, 58, 0.10);
  --shadow-lg:   0 20px 50px rgba(11, 31, 58, 0.15);
  --shadow-gold: 0 8px 24px rgba(201, 168, 76, 0.25);
  --shadow-gold-hover: 0 12px 32px rgba(201, 168, 76, 0.40);
  --blur-glass: blur(18px) saturate(140%);
}

/* ============================================================
   Reset & Base
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--warm);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ============================================================
   HEADER (공통)
============================================================ */
.hdr {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(11, 31, 58, 0.78);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border-bottom: 1px solid rgba(201, 168, 76, 0.18);
  transition: background 0.3s, box-shadow 0.3s;
}
.hdr.scrolled {
  background: rgba(7, 21, 41, 0.94);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
}
.hdr-nav {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}
.brand {
  display: flex; align-items: center; gap: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
}
.brand-logo {
  width: 42px; height: 42px;
  border-radius: 9px;
  background: white;
  padding: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  object-fit: contain;
}
.brand-txt {
  display: flex; flex-direction: column;
  line-height: 1.15;
}
.brand-kr {
  font-family: var(--font-serif);
  font-size: 1rem; font-weight: 700;
  color: white;
  letter-spacing: -0.01em;
}
.brand-en {
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: var(--gold-300);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 1px;
}

.nav-list {
  display: flex; align-items: center; gap: 0.25rem;
  list-style: none;
}
.nav-list a {
  display: inline-block;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: 7px;
  transition: all 0.2s;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.nav-list a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.07);
}

.cta-group {
  display: flex; align-items: center; gap: 0.5rem;
  flex-shrink: 0;
}
.btn-nav {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.55rem 1.05rem;
  border-radius: 7px;
  transition: all 0.25s;
  border: 1px solid transparent;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.btn-nav-ghost {
  color: white;
  border-color: rgba(255, 255, 255, 0.22);
}
.btn-nav-ghost:hover {
  border-color: var(--gold-500);
  color: var(--gold-300);
}
.btn-nav-gold {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-400) 100%);
  color: var(--navy-900);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(201, 168, 76, 0.25);
}
.btn-nav-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(201, 168, 76, 0.4);
}

.hbg {
  display: none;
  flex-direction: column; gap: 5px;
  padding: 0.4rem;
}
.hbg span {
  display: block;
  width: 22px; height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s;
}
.hbg.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hbg.open span:nth-child(2) { opacity: 0; }
.hbg.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   COMMON SECTIONS
============================================================ */
section { padding: var(--section-py) 2rem; position: relative; }
.sec-inner { max-width: var(--container-max); margin: 0 auto; }

.sec-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--gold-500);
}
.sec-tag.on-dark {
  color: var(--gold-300);
  border-bottom-color: var(--gold-400);
}

.sec-title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
}
.sec-title.on-dark { color: white; }

.sec-lead {
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.85;
  max-width: 680px;
}
.sec-lead.on-dark { color: rgba(255, 255, 255, 0.6); }

/* ============================================================
   BUTTONS (4종)
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 1rem 1.85rem;
  border-radius: 10px;
  letter-spacing: -0.01em;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-400) 100%);
  color: var(--navy-900);
  box-shadow:
    0 10px 30px rgba(201, 168, 76, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow:
    0 16px 40px rgba(201, 168, 76, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-secondary {
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}
.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.btn-ghost-light {
  background: transparent;
  color: var(--navy-800);
  border: 1px solid var(--navy-500);
}
.btn-ghost-light:hover {
  background: var(--navy-800);
  color: white;
}
.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
}
.btn-ghost-dark:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-3px);
}

/* ============================================================
   FOOTER (공통)
============================================================ */
footer {
  background: var(--navy-900);
  padding: 4rem 2rem 2rem;
  color: rgba(255, 255, 255, 0.42);
  position: relative;
}
footer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.3), transparent);
}
.foot-inner { max-width: var(--container-max); margin: 0 auto; }
.foot-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 1.8rem;
}
.foot-brand .foot-logo {
  width: 50px; height: 50px;
  border-radius: 10px;
  background: white;
  padding: 4px;
  margin-bottom: 1rem;
  object-fit: contain;
}
.foot-brand-name {
  font-family: var(--font-serif);
  font-size: 1rem; font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.4rem;
}
.foot-brand-desc {
  font-size: 0.76rem;
  line-height: 1.75;
  max-width: 240px;
}
.foot-col-ttl {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 1rem;
}
.foot-links {
  list-style: none;
  display: flex; flex-direction: column;
  gap: 0.5rem;
}
.foot-links a, .foot-links li {
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.8rem;
  transition: color 0.2s;
}
.foot-links a:hover { color: var(--gold-300); }

.foot-credits {
  display: flex; flex-direction: column; gap: 0.85rem;
}
.credit-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.credit-logo {
  width: 32px; height: 32px;
  flex-shrink: 0;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 5px;
  padding: 2px;
}
.credit-name {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.02em;
}
.credit-role {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.42);
  margin-top: 1px;
}

.foot-bot {
  display: flex; justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap; gap: 1rem;
  font-size: 0.72rem;
}
.foot-bot > div { line-height: 1.7; }
.foot-disclaimer {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.32);
  font-style: italic;
  margin-top: 0.3rem;
}

/* ============================================================
   MOBILE & RESPONSIVE
============================================================ */

/* 모든 화면에서 가로 스크롤 방지 (모바일 필수) */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* 태블릿 + 모바일 (960px 이하) — 헤더 모바일 모드 시작 */
@media (max-width: 960px) {
  .hdr-nav { padding: 0.65rem 1rem; }
  .nav-list, .cta-group { display: none; }
  .hbg { display: flex; }

  .nav-mobile-open .nav-list,
  .nav-mobile-open .cta-group {
    display: flex; flex-direction: column;
    position: absolute; left: 0; right: 0;
    background: var(--navy-900);
    padding: 1rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-mobile-open .nav-list {
    top: 100%;
    gap: 0.4rem;
  }
  .nav-mobile-open .cta-group {
    top: calc(100% + 50px);
    gap: 0.55rem;
    padding-top: 0.5rem;
    padding-bottom: 1.4rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  }
  .nav-mobile-open .nav-list a,
  .nav-mobile-open .btn-nav {
    width: 100%; text-align: center;
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  section { padding: 4rem 1.2rem; }

  .foot-top { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .foot-bot { flex-direction: column; align-items: flex-start; }
}

/* 일반 모바일 (768px 이하) */
@media (max-width: 768px) {
  :root {
    --section-py: 3.5rem;
    --container-max: 100%;
  }
  .hdr-nav { padding: 0.55rem 0.9rem; }
  .brand-logo { width: 38px; height: 38px; }
  .brand-kr { font-size: 0.95rem; }
  .brand-en { font-size: 0.58rem; }

  section { padding: 3rem 1rem; }

  .sec-tag { font-size: 0.65rem; letter-spacing: 0.22em; }
  .sec-title { font-size: 1.55rem; }
  .sec-lead { font-size: 0.92rem; }

  /* 푸터 */
  .foot-top {
    grid-template-columns: 1fr;
    gap: 1.8rem;
    padding-bottom: 2rem;
  }
  .foot-brand .foot-logo { width: 44px; height: 44px; }
  .foot-brand-desc { max-width: 100%; }
  .credit-item { padding: 0.6rem 0.8rem; }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
  .hdr-nav { padding: 0.5rem 0.75rem; gap: 0.5rem; }
  .brand-logo { width: 34px; height: 34px; padding: 2px; border-radius: 7px; }
  .brand-kr { font-size: 0.88rem; }
  .brand-en { font-size: 0.52rem; letter-spacing: 0.14em; }

  section { padding: 2.8rem 0.9rem; }

  .sec-title { font-size: 1.35rem; }
  .sec-lead { font-size: 0.88rem; line-height: 1.75; }

  .btn { padding: 0.85rem 1.4rem; font-size: 0.88rem; }

  /* 헤더 너무 비좁을 때 영문 라벨 숨기기 */
  .brand-en { display: block; }

  /* 모바일 메뉴 안의 버튼 사이즈 미세 조정 */
  .nav-mobile-open .nav-list a,
  .nav-mobile-open .btn-nav {
    font-size: 0.85rem;
    padding: 0.65rem;
  }
}

/* 매우 작은 화면 (360px 이하 — 구형 폰) */
@media (max-width: 360px) {
  .brand-en { display: none; } /* 영문 라벨 숨김 */
  .brand-kr { font-size: 0.82rem; }
}

/* ============================================================
   ACCESSIBILITY
============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
*:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}
