/* =====================================================================
 * NLOA · Lostark — 공용 스타일
 * 모든 하위 페이지(/, /char, /comp)가 이 파일을 불러와 디자인 토큰과
 * 공통 컴포넌트(헤더·네비·검색·카드·버튼·태그·푸터)를 공유합니다.
 * 페이지별 고유 스타일은 각 디렉터리의 별도 CSS로 분리합니다.
 * ===================================================================== */

/* ---------- 디자인 토큰 ---------- */
:root {
  /* 라이트 모드 (기본) */
  --bg: #fbfaf8;
  --bg-elev: #ffffff;
  --bg-tint: #f0f7fd; /* 옅은 하늘 — 서브 강조 배경 */
  --ink: #1c1a22;
  --ink-soft: #5a5663;
  --ink-faint: #a09ba7;
  --line: #ece8ee;
  --line-soft: #f5f2f6;
  --accent: #e8a5b8; /* 파스텔 핑크 — 메인 액센트 */
  --accent-deep: #c97a92; /* 핑크 텍스트용 */
  --accent-soft: #fce8ee; /* 매우 옅은 핑크 — 배경 강조 */
  --accent-sky: #b5d4e8; /* 하늘색 액센트 */
  --accent-sky-deep: #6a96b8;

  --shadow-sm: 0 1px 2px rgba(28, 26, 34, 0.04);
  --shadow:
    0 1px 2px rgba(28, 26, 34, 0.04), 0 12px 28px -16px rgba(28, 26, 34, 0.1);
  --shadow-hover:
    0 1px 2px rgba(28, 26, 34, 0.04),
    0 22px 50px -22px rgba(201, 122, 146, 0.28);

  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --serif: "IBM Plex Serif", "Apple SD Gothic Neo", serif;
  --sans: "IBM Plex Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg: #14131a;
  --bg-elev: #1c1b24;
  --bg-tint: #1a2630;
  --ink: #ece8f0;
  --ink-soft: #a8a3b3;
  --ink-faint: #6a6675;
  --line: #2a2832;
  --line-soft: #201f28;
  --accent: #e8a5b8;
  --accent-deep: #f0b8c8;
  --accent-soft: #2a1c22;
  --accent-sky: #8eb8d4;
  --accent-sky-deep: #b5d4e8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 36px -18px rgba(0, 0, 0, 0.6);
  --shadow-hover:
    0 1px 2px rgba(0, 0, 0, 0.3), 0 22px 50px -22px rgba(232, 165, 184, 0.2);
}

/* ---------- 리셋 / 베이스 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
  letter-spacing: -0.005em;
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}

a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
button {
  font-family: inherit;
  cursor: pointer;
}

/* 페이지마다 코너에 깔리는 부드러운 글로우 — 분위기 통일 */
body.has-glow::before {
  content: "";
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}
body.has-glow::after {
  content: "";
  position: fixed;
  bottom: -250px;
  left: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--bg-tint) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}
[data-theme="dark"] body.has-glow::before {
  opacity: 0.35;
}
[data-theme="dark"] body.has-glow::after {
  opacity: 0.25;
}

/* ---------- 페이지 래퍼 ---------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 32px 80px;
}
.wrap.wide {
  max-width: 1120px;
} /* 캐릭터 페이지처럼 정보 밀도 높은 페이지용 */

/* ---------- 헤더 (사이트 공통) ---------- */
.site-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 28px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 40px;
}
.site-top .brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
}
.brand-mark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: 0.12em;
  position: relative;
}
.brand-mark::after {
  /* 마커펜 하이라이트처럼 글자 아래 핑크 띠 */
  content: "";
  position: absolute;
  bottom: 2px;
  left: -2px;
  right: -2px;
  height: 6px;
  background: var(--accent);
  opacity: 0.25;
  z-index: -1;
  border-radius: 2px;
}
.brand-section {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav a {
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
  position: relative;
}
.site-nav a:hover {
  color: var(--ink);
}
.site-nav a.active {
  color: var(--ink);
}
.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* 테마 토글 버튼 */
.theme-toggle {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease;
}
.theme-toggle:hover {
  color: var(--accent-deep);
  border-color: var(--accent);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
[data-theme="dark"] .theme-toggle .sun-icon {
  display: block;
}
[data-theme="dark"] .theme-toggle .moon-icon {
  display: none;
}
[data-theme="light"] .theme-toggle .sun-icon {
  display: none;
}
[data-theme="light"] .theme-toggle .moon-icon {
  display: block;
}

/* ---------- 푸터 (사이트 공통) ---------- */
.site-bottom {
  margin-top: 96px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--ink-faint);
}
.site-bottom a {
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.site-bottom a:hover {
  color: var(--accent-deep);
}
.foot-links {
  display: flex;
  gap: 22px;
}
.copy {
  font-family: var(--mono);
  letter-spacing: 0.08em;
  font-size: 11px;
}

/* ---------- 섹션 헤더 ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.01em;
  margin: 0;
}
.section-title em {
  font-style: italic;
  color: var(--accent-deep);
  font-weight: 500;
}
.section-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- 카드 (공용) ---------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.card-head h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  margin: 0;
  letter-spacing: -0.01em;
}

/* "라벨" — 카드 안 작은 섹션 헤더 (특성, 각인 등) */
.label-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.label-pill.sky {
  background: var(--bg-tint);
  color: var(--accent-sky-deep);
}
.label-pill.plain {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

/* ---------- 검색 입력 ---------- */
.search-shell {
  position: relative;
  width: 100%;
}
.search-input {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 22px 16px 50px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.search-input::placeholder {
  color: var(--ink-faint);
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px rgba(232, 165, 184, 0.15),
    var(--shadow-sm);
}
.search-input.large {
  padding: 18px 22px 18px 52px;
  font-size: 16px;
}
.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.search-hint {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  pointer-events: none;
}
.search-hint kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink-soft);
}

/* ---------- 칩 (최근 검색 등) ---------- */
.chip {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--ink-soft);
  font-family: var(--sans);
  transition: all 0.2s ease;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-soft);
}

/* ---------- 태그 ---------- */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
}
.tag.ready {
  color: var(--accent-deep);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.tag.soon {
  color: var(--ink-faint);
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fff;
}
.btn.ghost {
  background: transparent;
}

/* ---------- 진입 애니메이션 ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.rise {
  animation: rise 0.6s ease both;
}
.rise-d1 {
  animation: rise 0.6s 0.08s ease both;
}
.rise-d2 {
  animation: rise 0.6s 0.16s ease both;
}
.rise-d3 {
  animation: rise 0.6s 0.24s ease both;
}
.rise-d4 {
  animation: rise 0.6s 0.32s ease both;
}

/* ---------- 반응형 (공용) ---------- */
@media (max-width: 720px) {
  .wrap {
    padding: 20px 20px 60px;
  }
  .site-top {
    margin-bottom: 32px;
    padding-bottom: 22px;
  }
  .site-nav {
    gap: 18px;
  }
  .site-nav a {
    font-size: 12px;
  }
  .brand-section {
    display: none;
  }
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .search-hint {
    display: none;
  }
}
