/* --- 1. Variables & Reset --- */
:root {
  /* 더 깊은 블랙과 세련된 그레이 */
  --bg: #030304;
  --fg: #ffffff;
  --muted: #8899a6;

  /* 포인트 컬러: 톤다운 일렉트릭 블루 */
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.5);

  /* 카드와 유리 효과 */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-highlight: rgba(255, 255, 255, 0.1);

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Space Grotesk", sans-serif;

  /* 배너 높이 */
  --banner-height: 60px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.2s;
}

ul,
li {
  list-style: none;
  padding: 0;
  margin: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* --- 2. Background Effects --- */
.bg-video {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4; /* 비디오 조금 더 어둡게 */
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(3, 3, 4, 0.8), var(--bg));
}

/* 모던한 격자 무늬 */
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--glass-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--glass-border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.15;
  mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
}

/* --- 3. Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  z-index: 100;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(3, 3, 4, 0.7);
  backdrop-filter: blur(12px);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-mark {
  color: var(--accent);
}

.menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.menu a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.menu a:hover,
.menu a.active {
  color: var(--fg);
}

.btn-nav {
  padding: 8px 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--fg) !important;
  transition: 0.3s;
}

.btn-nav:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.menu-toggle {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
}

/* --- 4. Hero Section --- */
.landing {
  padding-top: 100px; /* 네비게이션 공간 */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-header {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px 0 80px;
}

.landing-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.landing-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 20px;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-sub {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 540px;
  margin: 0 auto 40px;
}

.cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.btn {
  padding: 14px 32px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn .arrow {
  transition: transform 0.2s;
}

.btn:hover .arrow {
  transform: translateX(4px);
}

.btn.primary {
  background: var(--accent) !important;
  border-color: color-mix(in srgb, var(--accent) 70%, rgba(255,255,255,0.18)) !important;
  box-shadow:
    0 10px 26px var(--accent-glow) !important;
  color: #ffffff;
  border: 2px solid var(--fg);
}

/* hover: 어두운 배경에서 "빛나는 느낌" 확실히 */
.btn.primary:hover{
  background: color-mix(in srgb, var(--accent) 86%, #ffffff 14%) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 14px 34px var(--accent-glow),
    0 0 26px color-mix(in srgb, var(--accent) 30%, rgba(255,255,255,0.0)) !important;
  transform: translateY(-1px);
  filter: brightness(1.03);
}
/* active: 눌림 느낌 */
.btn.primary:active{
  transform: translateY(0px);
  filter: brightness(0.98);
}

/* white 테마는 버튼 텍스트 흰색이 더 깔끔 */
body[data-bg-theme="white"] .btn.primary{
  color: #ffffff !important;
}
.btn.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--glass-border);
}

.btn.ghost:hover {
  border-color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
}

/* --- 5. Cards (Grid) --- */
.landing-body {
  margin-bottom: 60px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  position: relative;
  background: rgba(10, 10, 12, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 32px;
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--glass-highlight);
}

.card .icon {
  font-size: 2rem;
  margin-bottom: 16px;
  opacity: 0.8;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 8px;
  color: var(--fg);
}

.card p {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* --- 6. Content board (Latest / Service / Signal) --- */

/* 섹션 전체를 약간 좁게 중앙 정렬 */
.content-section {
  margin: 32px auto 12px;
  max-width: 900px; /* 카드 2개 + 여백 정도 */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  justify-content: center;
}

/* 각 패널 틀은 최대한 라이트하게 */
.content-panel {
  background: transparent;
  border-radius: 0;
  border: 0;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* 제목: 라벨 느낌 */
.content-panel-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* 본문 기본 */
.content-panel-body {
  font-size: 0.85rem;
  color: var(--fg);
  line-height: 1.5;
}

/* 게시판-style 목록 공통 */
.content-list {
  margin: 0.15rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.content-item {
  padding: 2px 0;
  font-size: 0.88rem;
  color: var(--fg);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.content-item:last-child {
  border-bottom: none;
}

.content-item a {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--fg);
  opacity: 0.95;
  text-decoration: none;
}

.content-item a:hover {
  color: var(--accent);
}

/* ...more 링크 */
.content-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.content-more a {
  font-size: 0.78rem;
  color: inherit;
  text-decoration: underline;
}

.content-more:hover {
  color: var(--accent);
}

/* Signal of the Day badge 사이즈 */
.content-panel-title .badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.6rem;
}

/* Signal of the Day: 한 장 카드로 중앙 */
.content-panel[data-content="quote"] {
  grid-column: 1 / -1;   /* 그리드 전체 span */
  max-width: 480px;
  margin: 8px auto 0;
  text-align: center;
}

.content-panel[data-content="quote"] .content-panel-body {
  font-size: 0.95rem;
  font-weight: 500;
}

/* React Area */
.react-area {
  margin-bottom: 80px;
}

/* --- 7. Smart Banner System --- */
.ad-container {
  position: fixed;
  z-index: 900;
  background: #000;
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

/* 위치 옵션들 */
.ad-container.bottom {
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--banner-height);
  border-top: 1px solid var(--glass-border);
}

.ad-container.top {
  top: 72px; /* 네비게이션 아래 */
  left: 0;
  right: 0;
  height: var(--banner-height);
  border-bottom: 1px solid var(--glass-border);
}

/* 좌우 사이드 배너 (데스크탑 전용) */
.ad-container.left,
.ad-container.right {
  display: none;
}

@media (min-width: 1200px) {
  .ad-container.left {
    display: flex;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--banner-height);
    flex-direction: column;
    writing-mode: vertical-lr;
    border-right: 1px solid var(--glass-border);
  }

  .ad-container.right {
    display: flex;
    top: 0;
    bottom: 0;
    right: 0;
    width: var(--banner-height);
    flex-direction: column;
    writing-mode: vertical-lr;
    border-left: 1px solid var(--glass-border);
  }
}

/* Fallback Content (배너 없을 때) */
.ad-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.ad-text {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-link {
  color: var(--fg);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ad-link:hover {
  color: var(--accent);
}

/* Scrolling Marquee */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  box-sizing: content-box;
}

.ticker-move {
  display: inline-block;
  padding-left: 100%;
  animation: ticker 30s linear infinite;
}

.ticker-move:hover {
  animation-play-state: paused;
}

@keyframes ticker {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-100%, 0, 0);
  }
}

.aff {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  margin: 0 24px;
  opacity: 0.5;
  filter: grayscale(100%);
  transition: 0.3s;
}

.aff img {
  max-height: 100%;
  width: auto;
}

.aff:hover {
  opacity: 1;
  filter: grayscale(0%);
}

/* --- 8. Footer --- */
.footer {
  border-top: 1px solid var(--glass-border);
  padding: 40px 0;
  background: rgba(3, 3, 4, 0.9);
  font-size: 0.9rem;
  color: var(--muted);
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a:hover {
  color: var(--fg);
}

/* --- 9. Infra tag badge row --- */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.1rem 0 0.75rem;
}

.infra-pill {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  backdrop-filter: blur(12px);
  white-space: nowrap;
}

/* Signal of the Day badge 공통 */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  backdrop-filter: blur(10px);
}

/* ALLIANCE_LABEL 비어 있으면 헤더 pill/푸터 문구 숨김 */
body[data-alliance-label=""] .landing-pill {
  display: none;
}

body[data-alliance-label=""] .footer-alliance {
  display: none;
}

/* --- 10. Mobile Responsive --- */
@media (max-width: 768px) {
  .menu {
    display: none; /* 심플: 토글 미구현이라 숨김 */
  }

  .menu-toggle {
    display: block;
    color: var(--fg);
  }

  .landing-title {
    font-size: 2.5rem;
  }

  .ad-container.left,
  .ad-container.right {
    display: none;
  }

  .footer .container {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}
