/* ============================================================
   OBRI Base Styles — 전체 페이지 공통 typography & base
   ============================================================ */

/* Google Fonts — Noto Sans KR (Korean) + Cormorant Garamond (Logo) */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;600&family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --gold: #f97316;
  --green: #16a34a;
  --red: #ef4444;
  --bg: #ffffff;
  --bg2: #f5f3ff;
  --bg3: #ede9fe;
  --text: #1e1b4b;
  --text-dim: #6b7280;
  --border: #e5e7eb;
  --nav-h: 64px;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(124, 58, 237, 0.08);
}

/* ── Reset / Box Model ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── HTML Base — rem 기준 ───────────────────────────────────── */
html {
  font-size: 16px; /* 1rem = 16px */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* ── Body — 기본 폰트 ───────────────────────────────────────── */
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 0.9375rem;   /* 15px */
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ── Heading 계층 ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.025em;
  color: var(--text);
}

h1 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.875rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.375rem); }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

/* ── Paragraph & Small Text ─────────────────────────────────── */
p {
  line-height: 1.75;
  color: var(--text);
}

small {
  font-size: 0.8125rem; /* 13px */
}

/* ── Links ──────────────────────────────────────────────────── */
a {
  color: var(--purple);
  text-decoration: none;
  transition: opacity 0.15s;
}
a:hover { opacity: 0.75; }

/* ── Buttons — 기본 폰트 상속 ───────────────────────────────── */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ── Nav 공통 ───────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.nav-logo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--text);
  text-decoration: none;
}

/* ── Page Main Wrapper ──────────────────────────────────────── */
.page-main, .main {
  max-width: 800px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 24px) 24px 80px;
}

/* ── Card 공통 ──────────────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: rgba(124, 58, 237, 0.3);
  box-shadow: var(--shadow);
}

/* ── Badge / Pill ───────────────────────────────────────────── */
.badge, .pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
}

/* ── Toast / 알림 ───────────────────────────────────────────── */
.obri-toast {
  font-family: 'Noto Sans KR', sans-serif !important;
}

/* ── 언어별 폰트 오버라이드 ─────────────────────────────────── */
:lang(ja), .lang-ja {
  font-family: 'Noto Sans JP', 'Noto Sans KR', sans-serif;
  letter-spacing: 0;
}
:lang(zh), .lang-zh {
  font-family: 'Noto Sans SC', 'Noto Sans KR', sans-serif;
  letter-spacing: 0;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
  html {
    font-size: 15px; /* 모바일은 살짝 작게 */
  }

  body {
    font-size: 0.9375rem;
    line-height: 1.75;
    letter-spacing: -0.005em;
  }

  nav {
    padding: 0 16px;
  }

  .page-main, .main {
    padding: calc(var(--nav-h) + 16px) 16px 80px;
  }

  /* 모바일에서 너무 작은 텍스트 방지 */
  small {
    font-size: 0.8rem;
  }

  /* 터치 타겟 최소 44px */
  button, a {
    min-height: 36px;
  }
}

@media (max-width: 380px) {
  html { font-size: 14px; }
}

/* ── Scrollbar (선택) ───────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-light); }
