/* css/base.css
   Design tokens (:root), reset, base typography, header/nav/mega-menu, footer, .btn.
   Split from styles.css (Phase 4, boundary-corrected); linked in source order to preserve the cascade.
   NOTE: Pretendard is loaded via a <link> in index.html <head> (not @import here) so the
   font CSS downloads in parallel with this stylesheet rather than chained behind it. */

:root {
  --bg: #f4f5f0;
  --surface: #ffffff;
  --surface-2: #f8f8f4;
  --cream: #ebe7dc;
  --beige: #d6cdbd;
  --line: #deddd2;
  --line-strong: #bab6a6;
  --ink: #171713;
  --ink-2: #2f312a;
  --muted: #686b5f;
  --muted-2: #8c8d82;
  --brand: #1f3b33;
  --brand-2: #3d5a50;
  --brand-soft: #dfe8e1;
  --accent: #a88b5b;
  --accent-2: #315f8c;
  --on-brand: #ffffff;
  --danger: #b43a2c;
  --kakao: #fee500;
  --font-sans: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --nav-h: 72px;
  --header-action-h: 40px;
  --shadow-sm: 0 1px 2px rgba(23, 23, 19, 0.05), 0 1px 5px rgba(23, 23, 19, 0.06);
  --shadow-md: 0 10px 28px rgba(23, 23, 19, 0.09);
  --shadow-lg: 0 28px 70px rgba(23, 23, 19, 0.2);
}

/* Theme presets — keep in sync with THEME_PRESETS in data/site.js.
   These [data-theme] blocks override the :root palette tokens above and MUST
   stay in this render-blocking <head> stylesheet (css/base.css) so the
   admin-selected theme is correct on first paint. Moving them to a deferred or
   non-critical stylesheet reintroduces the theme flash (FOUC). */
:root[data-theme="premium"] {
  --bg: #f4f5f0;
  --surface: #ffffff;
  --surface-2: #f8f8f4;
  --cream: #ebe7dc;
  --beige: #d6cdbd;
  --line: #deddd2;
  --line-strong: #bab6a6;
  --ink: #171713;
  --ink-2: #2f312a;
  --muted: #686b5f;
  --muted-2: #8c8d82;
  --brand: #1f3b33;
  --brand-2: #3d5a50;
  --brand-soft: #dfe8e1;
  --accent: #a88b5b;
  --accent-2: #315f8c;
  --on-brand: #ffffff;
}
:root[data-theme="gold"] {
  --bg: #faf6e9;
  --surface: #ffffff;
  --surface-2: #fcf8ec;
  --cream: #f3ecd3;
  --beige: #e2d2a4;
  --line: #ece1c2;
  --line-strong: #cdb983;
  --ink: #15140f;
  --ink-2: #2b2823;
  --muted: #6b6357;
  --muted-2: #8c8478;
  --brand: #3f360f;
  --brand-2: #7a6312;
  --brand-soft: #f7ebbf;
  --accent: #e3a813;
  --accent-2: #2f6e7d;
  --on-brand: #ffffff;
}
:root[data-theme="navy"] {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --cream: #eaeff8;
  --beige: #c8d2e4;
  --line: #dde3f0;
  --line-strong: #b8c2d8;
  --ink: #14181d;
  --ink-2: #2a2e33;
  --muted: #5c636b;
  --muted-2: #828a93;
  --brand: #0a2a4f;
  --brand-2: #1456c9;
  --brand-soft: #dde6f5;
  --accent: #c9a66b;
  --accent-2: #1456c9;
  --on-brand: #ffffff;
}
:root[data-theme="clay"] {
  --bg: #f6f1e9;
  --surface: #ffffff;
  --surface-2: #faf5ec;
  --cream: #efe6d6;
  --beige: #d8c8ae;
  --line: #e2d5bc;
  --line-strong: #c0ac85;
  --ink: #1a1410;
  --ink-2: #322620;
  --muted: #6e6055;
  --muted-2: #94837a;
  --brand: #5b3a2e;
  --brand-2: #8e5c45;
  --brand-soft: #efdfd0;
  --accent: #c68a43;
  --accent-2: #6e7a4a;
  --on-brand: #ffffff;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
  overscroll-behavior-y: none;
  background: var(--ink);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--ink);
  font-size: 16px;
  line-height: 1.58;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow-x: clip;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
}

img,
svg {
  max-width: 100%;
  display: block;
}

.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;
}

#app:focus {
  outline: none;
}

#app {
  flex: 1 0 auto;
  background: var(--bg);
}

.page-loading {
  min-height: 64vh;
  background: var(--bg);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: 1.18;
}

.container,
.container-wide {
  width: min(100% - 48px, 1280px);
  margin: 0 auto;
}

.container-wide {
  width: min(100% - 48px, 1440px);
}

.topbar {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 12px;
}

.topbar__inner {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar__meta {
  display: flex;
  gap: 18px;
  color: #cfc8b9;
}

.status-dot,
.eyebrow-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
  vertical-align: 1px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 245, 240, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.accent-strip {
  height: 3px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand) 62%, var(--accent) 62%, var(--accent) 100%);
}

.nav-shell {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.logo-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
}

.logo strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1;
}

.logo small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-sans);
  font-size: 9px;
  color: var(--muted);
}

.logo--image {
  gap: 0;
}

.logo-image {
  display: block;
  height: 40px;
  width: auto;
  max-width: 240px;
}

.logo--image-footer {
  gap: 0;
  margin-bottom: 18px;
}

.logo-image--footer {
  height: 56px;
  max-width: 320px;
}

.logo--footer .logo-mark {
  background: #fff;
  color: var(--brand);
}

.footer-grid .logo--footer {
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  opacity: 1;
  white-space: nowrap;
}

.logo--footer strong {
  white-space: nowrap;
}

.logo--footer small {
  color: #cfc8b9;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 100%;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--header-action-h);
  gap: 6px;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
}

.nav-link:hover {
  background: rgba(31, 59, 51, 0.07);
}

.nav-badge {
  padding: 2px 6px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-group {
  position: relative;
}

/* 메뉴 안에 무엇이 있는지 미리 보여주는 역할만 — 설명 카피는 서브탭과
   중복되고 큰 패널은 히어로를 덮는다. 항목 리스트만 담은 작은 패널로 둔다. */
.mega-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: -16px;
  z-index: 60;
  min-width: 268px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(23, 23, 19, 0.13);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.nav-group:hover .mega-menu,
.nav-group:focus-within .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* 버튼과 패널 사이 10px 틈에서 hover가 끊기지 않도록 다리를 놓는다. */
.mega-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.mega-menu__items {
  display: grid;
  gap: 2px;
}

.mega-menu__items a {
  display: block;
  min-height: 42px;
  padding: 11px 12px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.mega-menu__items a:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* 지금 보고 있는 화면을 메뉴에서도 표시한다. */
.mega-menu__items a.is-current {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}


/* 헤더 우측 액션 영역: 시각 위계는 오른쪽부터 [상담신청 CTA] > [프로필 아이콘] > [캠퍼스 링크].
   요란한 pill을 없애고 톤을 맞춰 세 요소가 서로 부딪히지 않게 정리한다. */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
  height: 100%;
}

/* 온라인 캠퍼스: 텍스트 링크 스타일(테두리·배경 제거). ↗로 외부 이동만 힌트. */
.campus-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 2px;
  background: transparent;
  color: var(--ink-2, var(--ink));
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.campus-link:hover {
  color: var(--brand);
}

/* 주 메뉴가 아닌 보조 진입(헤드헌팅 2027) — 메뉴 4축을 흐리지 않게 약하게 둔다. */
.nav-secondary-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  color: var(--ink-2, var(--ink));
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.nav-secondary-link:hover {
  color: var(--brand);
}

/* 로그인/프로필: 비로그인은 텍스트 버튼, 로그인 후에는 프로필 아이콘 버튼. */
.user-auth-link {
  min-width: 78px;
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2, var(--ink));
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.user-menu__button {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2, var(--ink));
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.user-auth-link:hover,
.user-menu__button:hover,
.user-auth-link:focus-visible,
.user-menu__button:focus-visible {
  background: rgba(31, 59, 51, 0.08);
  color: var(--brand);
  outline: none;
}

/* SVG 사용자 실루엣 아이콘(비로그인 상태) */
.user-auth-icon {
  display: block;
}

/* 로그인 후 프로필 이미지/이니셜용 아바타 — 아이콘 자리를 그대로 채운다 */
.user-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.user-avatar span {
  color: var(--on-brand);
  font-size: 12px;
  font-weight: 800;
}

/* 스크린리더 전용 라벨 */
.user-menu__button strong {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  position: relative;
}

.user-menu__panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 30;
  width: 260px;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.user-menu.is-open .user-menu__panel,
.user-menu:hover .user-menu__panel,
.user-menu:focus-within .user-menu__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.user-menu__profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid var(--line);
}

.user-menu__profile strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.user-menu__profile small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.user-menu__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 4px;
}

.user-menu__badges span {
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
}

.user-menu__badges .is-complete {
  background: var(--brand-soft);
  color: var(--brand);
}

.user-menu__badges .is-required {
  background: #fff4df;
  color: #9a650d;
}

.user-menu__panel a,
.user-menu__panel button {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.user-menu__panel a:hover,
.user-menu__panel button:hover {
  background: var(--surface-2);
  color: var(--brand);
}

.user-menu__logout {
  color: var(--danger) !important;
}

.mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.mobile-toggle span {
  width: 20px;
  height: 1.5px;
  background: var(--ink);
  margin: 0 auto;
}

.mobile-menu {
  display: none;
  background: var(--surface);
  border-top: 1px solid var(--line);
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  padding: 12px 24px 22px;
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu__group {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.mobile-menu__title {
  display: block;
  margin-bottom: 6px;
  color: var(--brand);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 800;
}

.mobile-menu a,
.mobile-menu button {
  display: block;
  width: 100%;
  padding: 10px 0;
  text-align: left;
  font-weight: 600;
}

.mobile-menu__action {
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.mobile-menu__action > button {
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--ink);
  color: var(--cream);
  text-align: center;
}

.mobile-menu__action .user-auth-link,
.mobile-menu__action .user-menu__button,
.mobile-menu__action .user-menu__logout {
  display: inline-flex;
  height: 44px;
  width: 100%;
  min-height: 0;
  justify-content: center;
  align-items: center;
  padding: 11px 14px;
  text-align: center;
}

.mobile-menu__action .user-menu__logout {
  position: static;
  min-width: 0;
  box-shadow: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.mobile-menu__action .user-auth-link__label,
.mobile-menu__action .user-menu__button strong {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  border: 0;
}

.mobile-menu__action .user-menu {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  height: auto;
}

.mobile-menu__action .user-menu__panel {
  position: static;
  width: 100%;
  box-shadow: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-sm {
  min-height: 40px;
  padding: 10px 16px;
  font-size: 14px;
}

.btn-lg {
  min-height: 56px;
  padding: 16px 26px;
  font-size: 16px;
}

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
}

.btn-primary:hover {
  background: var(--ink);
}

.btn-outline {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-kakao {
  background: var(--kakao);
  color: #181600;
}

/* 다크 배경 위의 주 버튼 — brand(딥그린)는 ink 위에서 거의 안 보인다. */
.btn-accent {
  background: var(--accent);
  color: var(--ink);
}

.btn-accent:hover {
  background: var(--cream);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-2);
  text-transform: uppercase;
}

.section {
  padding: 96px 0;
}

.section-cream {
  background: var(--cream);
}

.section-dark {
  background: var(--ink);
  color: var(--cream);
}

/* 다크 섹션이 연달아 올 때("대표" → "인파워 사람들") 한 장으로 읽히도록
   경계의 위쪽 여백만 줄인다. */
.section-dark--tight {
  padding-top: 0;
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: var(--cream);
}
