/* ============================================================
   더보다 AI — Shared Design Tokens & Components
   All pages import this file.
============================================================ */

/* ── Fonts ── */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css');

/* ── Theme Tokens ── */
:root {
  --bg-primary:     #070c14;
  --bg-secondary:   #0d1526;
  --bg-card:        #0f1a30;
  --bg-card-hover:  #142040;
  --text-primary:   #f0f4f8;
  --text-secondary: #7a9bbf;
  --brand:          #4a90d9;
  --brand-deep:     #1a3669;
  --brand-light:    #6aaee8;
  --brand-glow:     rgba(74,144,217,0.10);
  --border:         rgba(74,144,217,0.16);
  --border-strong:  rgba(74,144,217,0.35);
  --nav-bg:         rgba(7,12,20,0.90);
  --shadow-sm:      0 2px 12px rgba(0,0,0,0.3);
  --shadow-md:      0 6px 32px rgba(0,0,0,0.4);
  --shadow-brand:   0 8px 40px rgba(74,144,217,0.18);
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --transition:     0.22s ease;
}

[data-theme="light"] {
  --bg-primary:     #f4f7fb;
  --bg-secondary:   #e8eef6;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f0f5fc;
  --text-primary:   #0a1628;
  --text-secondary: #4a6a8a;
  --brand:          #1a3669;
  --brand-deep:     #0d1e3d;
  --brand-light:    #2a5199;
  --brand-glow:     rgba(26,54,105,0.07);
  --border:         rgba(26,54,105,0.13);
  --border-strong:  rgba(26,54,105,0.30);
  --nav-bg:         rgba(244,247,251,0.93);
  --shadow-sm:      0 2px 12px rgba(0,0,0,0.07);
  --shadow-md:      0 6px 28px rgba(0,0,0,0.09);
  --shadow-brand:   0 8px 32px rgba(26,54,105,0.14);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; overflow-x: hidden; }
body {
  font-family: "Pretendard Variable", "Pretendard", -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
  max-width: 100%;
  word-break: keep-all;       /* 한국어: 어절 중간에서 줄바꿈 방지 */
  overflow-wrap: break-word;  /* 아주 긴 단어만 예외 처리 */
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Layout ── */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 80px;
}
section { padding: 100px 0; }

/* ── Typography helpers ── */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-glow);
  margin-bottom: 18px;
}
.section-eyebrow svg { width: 12px; height: 12px; }

.section-title {
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}
.section-title em { font-style: normal; color: var(--brand); }

.section-desc {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-top: 14px;
}

/* ── Divider ── */
.divider {
  width: 1px;
  height: 16px;
  background: var(--border-strong);
  display: inline-block;
  vertical-align: middle;
  margin: 0 10px;
}

/* ============================================================
   NAVIGATION
============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 68px;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}
.nav__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 80px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.nav__logo { display: flex; align-items: center; flex-shrink: 0; }
.nav__logo img { height: 32px; width: auto; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  flex: 1;
  justify-content: center;
}
.nav__links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
  padding-bottom: 2px;
}
.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1.5px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.nav__links a:hover,
.nav__links a.active { color: var(--text-primary); }
.nav__links a:hover::after,
.nav__links a.active::after { transform: scaleX(1); }

.nav__right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: border-color var(--transition), color var(--transition);
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); }
.theme-toggle svg { width: 13px; height: 13px; flex-shrink: 0; }
.icon-sun  { display: none; }
.icon-moon { display: block; }
[data-theme="light"] .icon-sun  { display: block; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .toggle-label::after { content: "라이트 모드"; }
.toggle-label::after { content: "다크 모드"; }

/* Nav CTA button */
.btn-nav-cta {
  display: inline-flex; align-items: center;
  height: 36px; padding: 0 18px;
  background: var(--brand-deep);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  transition: opacity var(--transition);
  white-space: nowrap;
}
[data-theme="light"] .btn-nav-cta { background: var(--brand); }
.btn-nav-cta:hover { opacity: 0.85; }

/* ============================================================
   FOOTER
============================================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 60px 0 44px;
}
.footer__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 80px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 80px;
  align-items: start;
}
.footer__logo img { height: 28px; margin-bottom: 18px; }
.footer__info p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 2;
}
.footer__copy {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.55;
  margin-top: 14px;
}
.footer__right { display: flex; gap: 52px; }
.footer__col strong {
  display: block;
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.footer__col p { font-size: 13px; color: var(--text-secondary); line-height: 2; }
.footer__col b { font-weight: 600; color: var(--text-primary); display: inline-block; min-width: 58px; }

/* ============================================================
   BUTTONS
============================================================ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 32px;
  background: var(--brand-deep);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 700;
  transition: opacity var(--transition);
  text-decoration: none;
}
[data-theme="light"] .btn-primary { background: var(--brand); }
.btn-primary:hover { opacity: 0.88; }

/* ============================================================
   YOUTUBE THUMBNAIL PLAYER (file:// 프로토콜 호환)
============================================================ */
.yt-player {
  display: block; position: relative;
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); aspect-ratio: 16/9;
  box-shadow: var(--shadow-md); cursor: pointer;
  background: #000; text-decoration: none;
  margin-top: 44px;
}
.yt-player__thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.yt-player:hover .yt-player__thumb { transform: scale(1.03); }
.yt-player__overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.32);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  transition: background .2s;
}
.yt-player:hover .yt-player__overlay { background: rgba(0,0,0,0.50); }
.yt-player__play {
  width: 72px; height: 72px;
  background: rgba(255,255,255,0.95); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, background .2s;
}
.yt-player:hover .yt-player__play { transform: scale(1.12); background: #fff; }
.yt-player__play svg { width: 26px; height: 26px; fill: var(--brand-deep); margin-left: 4px; }
.yt-player__label { font-size: 14px; font-weight: 600; color: #fff; letter-spacing: .02em; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 24px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
  transition: border-color var(--transition), color var(--transition);
  text-decoration: none;
}
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-outline svg { width: 16px; height: 16px; }

/* ============================================================
   CTA BANNER (shared module)
============================================================ */
.cta-banner {
  background: var(--brand-deep);
  padding: 100px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(74,144,217,0.22) 0%, transparent 65%);
  pointer-events: none;
}
.cta-banner__title {
  font-size: clamp(28px, 3.5vw, 46px);
  font-weight: 700; line-height: 1.2;
  color: #fff;
  position: relative;
}
.cta-banner__desc {
  font-size: 17px; color: rgba(255,255,255,0.65);
  margin-top: 14px; line-height: 1.75;
  position: relative;
}
.btn-cta-white {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 36px;
  height: 52px; padding: 0 36px;
  background: #fff;
  color: var(--brand-deep);
  border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 700;
  text-decoration: none;
  transition: opacity var(--transition);
  position: relative;
}
.btn-cta-white:hover { opacity: 0.92; }
.btn-cta-white svg { width: 16px; height: 16px; }

/* ============================================================
   MOBILE NAV DRAWER
============================================================ */
.nav__hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}
.nav__hamburger span {
  display: block;
  width: 17px; height: 1.5px;
  background: var(--text-primary);
}
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 10, 20, 0.55);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s, visibility 0.25s;
}
.mobile-nav.is-open { visibility: visible; opacity: 1; }
.mobile-nav__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 260px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.mobile-nav.is-open .mobile-nav__panel { transform: translateX(0); }
.mobile-nav__close {
  align-self: flex-end;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  background: transparent;
  margin-bottom: 24px;
  flex-shrink: 0;
}
.mobile-nav__link {
  display: block;
  padding: 15px 0;
  font-size: 16px; font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: color var(--transition);
}
.mobile-nav__link:hover, .mobile-nav__link.active { color: var(--brand); }
.mobile-nav__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  height: 46px;
  background: var(--brand-deep);
  color: #fff !important;
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700;
  border-bottom: none;
  text-decoration: none;
}
[data-theme="light"] .mobile-nav__cta { background: var(--brand); }

/* ============================================================
   RESPONSIVE — Mobile First
============================================================ */
@media (max-width: 768px) {

  /* Layout */
  .container { padding: 0 20px; }
  section { padding: 60px 0; }

  /* Nav */
  .nav__inner { padding: 0 28px 0 16px; gap: 8px; }
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }
  .theme-toggle .toggle-label { display: none; }
  .theme-toggle { padding: 6px 10px; }
  .btn-nav-cta { display: none; }

  /* Footer */
  .footer__inner { grid-template-columns: 1fr; gap: 36px; padding: 0 20px; }
  .footer__right { flex-direction: column; gap: 28px; }

  /* Section title */
  .section-title { font-size: clamp(22px, 6vw, 32px); }
  .section-desc { font-size: 15px; }

  /* CTA Banner */
  .cta-banner { padding: 60px 0; }
  .cta-banner__title { font-size: clamp(22px, 6vw, 32px); }
  .btn-cta-white { height: 46px; padding: 0 24px; font-size: 15px; }
}
