/* 공개 사이트 공통 스타일 — design/PATTERNS.md 기준
   8px 그리드, M3 글자 크기 단계, 무채색 + 강조색 1개, 1px 경계선(그림자 없음) */

:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-2: #ebebef;
  --text: #1b1b1f;
  --text-2: #5c5c66;
  --text-3: #8b8b95;
  --line: #e3e3e8;
  --accent: #c2185b;          /* 흰 배경 대비 5.9:1 */
  --accent-weak: #c2185b14;
  --on-accent: #ffffff;
  --focus: #1a73e8;

  --font: "Pretendard Variable", Pretendard, "Noto Sans JP", "Segoe UI", "Apple SD Gothic Neo", "Hiragino Sans", system-ui, sans-serif;
  --r-sm: 8px;
  --r-md: 12px;
  --gutter: 16px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --surface: #1c1c20;
    --surface-2: #26262b;
    --text: #ececf1;
    --text-2: #a9a9b4;
    --text-3: #74747e;
    --line: #2d2d33;
    --accent: #f06292;
    --accent-weak: #f0629220;
    --on-accent: #1b0a12;
    --focus: #8ab4f8;
    color-scheme: dark;
  }
}

@media (min-width: 840px) { :root { --gutter: 24px; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.icon { width: 24px; height: 24px; fill: currentColor; flex: none; }
.icon.sm { width: 20px; height: 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- 앱 바 ---- */
.appbar {
  height: 56px; display: flex; align-items: center; gap: 16px;
  padding: 0 var(--gutter); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-height: 44px; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-mark .bm-bg { fill: var(--accent); }
.brand-mark .bm-fg { fill: var(--on-accent); }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -.03em; line-height: 1; }
.appbar .spacer { flex: 1; }
/* 언어 전환: 앱 바 오른쪽 텍스트 버튼 (M3 Text button) */
.lang-switch {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 14px; font-weight: 600; text-decoration: none;
}
.lang-switch:hover { background: var(--surface); color: var(--text); }

.container { max-width: 960px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---- 글자 단계 (M3) ---- */
.headline { font-size: 28px; line-height: 36px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.title-lg { font-size: 20px; line-height: 28px; font-weight: 600; margin: 0; }
.title-md { font-size: 16px; line-height: 24px; font-weight: 600; margin: 0; }
.body-md { font-size: 14px; line-height: 20px; }
.label { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .02em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

/* ---- 버튼 ---- */
.btn {
  min-height: 40px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg);
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 14px; font-weight: 600;
}
.btn:hover { background: var(--surface); }
.btn.filled { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent;
  display: inline-grid; place-items: center; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface); color: var(--text); }
.icon-btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-weak); }

/* 세그먼트 버튼 (M3 Segmented button) */
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.segmented button {
  min-height: 40px; min-width: 56px; padding: 0 14px; border: 0; background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px;
}
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button[aria-pressed="true"] { background: var(--accent-weak); color: var(--accent); }
.segmented button[aria-pressed="true"]::before {
  content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* 필터 칩 (M3 Filter chip) */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 32px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: transparent; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { background: var(--accent-weak); border-color: transparent; color: var(--accent); }
.chip .icon { width: 18px; height: 18px; }
.chip .count { font-weight: 400; color: var(--text-3); }
.chip[aria-pressed="true"] .count { color: inherit; }

/* 검색 (M3 Outlined text field) */
.search {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg);
}
.search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 16px; min-width: 0; }
.search .icon { color: var(--text-3); }

/* ---- 푸터 ---- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 64px; padding: 32px var(--gutter) 40px;
  background: var(--surface); color: var(--text-3); font-size: 12px; line-height: 18px;
}
.footer-inner { max-width: 960px; margin: 0 auto; display: grid; gap: 16px; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-2); font-weight: 800; font-size: 16px; letter-spacing: -.03em; }
.footer-brand .brand-mark { width: 22px; height: 22px; }
.footer-text p { margin: 0 0 4px; }
.copyright { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--text-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

:lang(ja) { font-family: "Noto Sans JP", var(--font); }
