/* 여기콕 · 공통 디자인 토큰 + 프리미티브
   모든 화면 CSS는 이 파일을 먼저 불러온 뒤, 화면별 CSS에서 차이만 정의한다.
   화면별 CSS에서 :root 토큰을 재정의하지 말 것 (여기서만 관리). */

:root {
  /* 인주 레드 계열 */
  --brand: #a8412c;
  --brand-dark: #862f1e;
  --brand-tint: #f7e9e3;      /* 배지·연한 강조 배경 */
  --brand-icon-bg: #f1dfd7;   /* 아이콘 타일 배경 */

  /* 텍스트 */
  --ink: #231d1a;             /* 제목 */
  --text: #2a2320;            /* 본문 */
  --text-soft: #5a5049;       /* 메뉴·보조 텍스트 */
  --muted: #6e635c;           /* 설명 문단 */
  --muted-2: #7a6e66;         /* 카드 설명 */
  --faint: #807369;           /* 캡션·비활성. 흰 배경 대비 4.5:1(WCAG AA) 충족 */

  /* 면·선 */
  --bg: #fff;
  --surface: #fbf7f4;         /* 카드 배경 */
  --surface-2: #fcf7f4;       /* 히어로·섹션 배경 */
  --line: #e7ddd6;            /* 기본 경계선 */
  --line-soft: #f0e8e3;       /* 옅은 경계선 */
  --card-line: #efe7e2;

  /* 다크 (지표 바·푸터 등) */
  --dark: #231d1a;
  --dark-accent: #f3c9bc;

  /* 상태 색 (관리자·배치 모니터링 등) */
  --ok: #2f7d5b;
  --ok-bg: #e4f0ea;
  --warn: #b8791f;
  --warn-bg: #f6ecd9;
  --danger: #c0392b;
  --danger-bg: #f7e2df;
  --info: #3a6ea5;
  --info-bg: #e3ecf5;

  /* 형태 */
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 16px;
  --shadow-card: 0 24px 60px rgba(90, 45, 28, .14);
  --shadow-soft: 0 10px 24px rgba(168, 65, 44, .28);
  --maxw: 1160px;
  --mono: ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* 버건디 상단 헤더 위 말풍선 */
  --brand-tag-on-header: #3f3a37;
}

/* 리셋 */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  font-family: Pretendard, "Apple SD Gothic Neo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  line-height: 1.5;
}
h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* 레이아웃 컨테이너 */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* 스크린리더 전용 (접근성) */
.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;
}

/* 키보드 이동 시에만 뜨는 포커스 링 (마우스 클릭엔 안 뜬다) */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 본문 바로가기: 평소 숨겼다가 키보드 포커스 시 노출 */
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--brand); color: #fff;
  padding: 9px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 700;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* 모션 최소화를 선호하면 애니메이션과 부드러운 스크롤을 끈다 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* 브랜드 로고 */
.brand { display: inline-flex; align-items: center; gap: 4px; font-size: 17px; }
.brand-mark {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800; font-size: 13px;
}
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }

/* 로고: "여기" 말풍선 뱃지(버건디) + "콕" 텍스트(검정)
   폰트 크기는 옆의 "콕" 텍스트를 그대로 상속받아 크기가 항상 맞고,
   말풍선·꼬리 치수는 모두 em 기반이라 확대/축소해도 비율이 어긋나지 않음. */
.brand-mark-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  letter-spacing: -.01em;
  padding: .28em .42em .32em;
  border-radius: .55em;
  line-height: 1;
}
.brand-mark-tag::after {
  content: '';
  position: absolute;
  left: .8em;
  bottom: -.34em;
  width: 0; height: 0;
  border-left: .3em solid transparent;
  border-right: .3em solid transparent;
  border-top: .36em solid var(--brand);
}
.brand-name-kok {
  font-weight: 800;
  color: var(--ink);
}

/* 버건디 상단 헤더 위 말풍선: 진한 회색 */
.app-header .brand-mark-tag,
.auth-hero .brand-mark-tag,
.trend-header .brand-mark-tag {
  background: var(--brand-tag-on-header);
  color: #fff;
}
.app-header .brand-mark-tag::after,
.auth-hero .brand-mark-tag::after,
.trend-header .brand-mark-tag::after {
  border-top-color: var(--brand-tag-on-header);
}

/* 사이트 헤더 (index.html · 랜딩 · 요금제 등 공통) */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
}
.header-inner {
  height: 66px;
  display: flex; align-items: center; gap: 14px;
}
.site-nav {
  flex: 1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 30px;
}
.site-nav-slim { justify-content: flex-end; }
.nav-menu {
  flex: 1;
  display: flex; justify-content: center; gap: 30px;
  font-size: 13.5px; font-weight: 600; color: var(--text-soft);
}
.nav-menu a:hover { color: var(--brand); }
.nav-menu a[aria-current="page"] { color: var(--brand); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.link-login { font-size: 13.5px; font-weight: 600; color: var(--text-soft); }
.link-login:hover { color: var(--brand); }

/* 로그인 후: 아바타 버튼(마이페이지) + 닉네임 */
.nav-user { display: inline-flex; align-items: center; gap: 8px; }
.nav-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 800;
  transition: filter .15s ease;
}
.nav-user:hover .nav-avatar { filter: brightness(1.08); }
.nav-user-name { font-size: 13.5px; font-weight: 600; color: var(--text-soft); }
.nav-user:hover .nav-user-name { color: var(--brand); }

/* 햄버거 (기본 숨김, 모바일에서만 노출) */
.nav-toggle-btn { display: none; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
@media (min-width: 641px) { .nav-toggle { display: none; } }

@media (max-width: 640px) {
  .nav-toggle-btn {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; margin-left: auto;
  }
  .nav-toggle-btn span {
    display: block; width: 20px; height: 2px; margin: 0 auto;
    background: var(--ink); border-radius: 2px;
  }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 66px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line-soft);
    box-shadow: 0 16px 30px rgba(90, 45, 28, .08);
    padding: 8px 24px 20px;
    display: none;
  }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .nav-toggle:focus-visible + .nav-toggle-btn { outline: 2px solid var(--brand); outline-offset: 3px; }
  .nav-menu { flex-direction: column; gap: 0; font-size: 15px; }
  .nav-menu li { border-bottom: 1px solid var(--line-soft); }
  .nav-menu a { display: block; padding: 13px 0; }
  .nav-actions { margin-top: 16px; justify-content: space-between; }
}

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  border-radius: 11px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: filter .15s ease, background .15s ease;
}
.btn-sm { height: 38px; padding: 0 18px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { height: 50px; padding: 0 26px; font-size: 15px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-lg.btn-primary { box-shadow: var(--shadow-soft); }
.btn-ghost { background: #fff; color: #4a403a; border-color: #e4d8d1; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }

/* 배지 (상태·태그 공통) */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
  color: var(--brand); background: var(--brand-tint);
}
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-muted { color: var(--muted); background: var(--line-soft); }
