/* ============================================================
   BigBoss OS — 공식 웹사이트 스타일
   테마: 마피아/조직 — 진한 배경 + 골드 포인트 + 조직도 강조
   의존성 0: 웹폰트 없이 시스템 폰트 스택만 사용
   ============================================================ */

:root {
  /* beethovain 톤 라이트 테마 — 흰 배경, 어두운 텍스트, 골드 액센트 */
  --bg: #ffffff;
  --bg-elev: #fafaf7;
  --surface: #f5f3ee;
  --surface-2: #ecebe5;
  --border: #d8d5cd;
  --border-gold: #b48a1f;
  --text: #1a1505;
  --text-dim: #555044;
  --text-faint: #8a8478;
  --gold: #b48a1f;            /* 흰 배경에서도 충분히 진한 골드 */
  --gold-bright: #d4af37;
  --blood: #8c2f2f;
  --serif: Georgia, "Times New Roman", "Noto Serif KR", serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --maxw: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

/* ── 언어 토글 ── */
.en { display: none; }
body.lang-en .ko { display: none; }
body.lang-en .en { display: inline; }

/* ── 네비게이션 — 베너 위에 떠 있는 형태로 통합 ── */
.nav {
  position: fixed;            /* fixed: 베너가 진짜로 뒤로 흐름 */
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: transparent;    /* 랜딩 기본 — 완전 투명, 베너가 그대로 보임 */
  border-bottom: none;
  transition: background 0.2s ease, backdrop-filter 0.2s ease;
}
/* 랜딩 — 블러 제거. 깨끗한 반투명 흰 배경 (베너 가독성 유지) */
body.has-banner .nav {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
}
/* 베너 없는 페이지도 동일 */
body:not(.has-banner) .nav {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
}
/* 베너 없는 페이지: main 이 네비 뒤에 가리지 않도록 패딩 */
body:not(.has-banner) main { padding-top: 68px; }
.brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}
.brand-os { color: inherit; }
.nav nav { display: flex; align-items: center; gap: 1.6rem; }
.nav nav a {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.nav nav a:hover, .nav nav a.active { color: var(--gold); }

/* nav 가 이제 흰 배경 — 베너 페이지에서도 동일하게 어두운 텍스트 */
/* (블러 제거 후 nav 는 모든 페이지에서 흰 배경 유지) */
.nav-gh {
  color: var(--gold) !important;
  border: 1px solid var(--border-gold);
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
}
.nav-gh:hover { background: rgba(201, 162, 39, 0.1); }
#lang-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 0.82rem;
  padding: 0.32rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
}
#lang-toggle:hover { color: var(--text); border-color: var(--border-gold); }

/* ── 공통 섹션 ── */
main { display: block; }
.section { padding: 5rem 1.5rem; border-top: 1px solid var(--border); }
.section-inner { max-width: var(--maxw); margin: 0 auto; }
.section h2 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}
.section h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  background: var(--gold);
  margin-bottom: 1rem;
}
.lead {
  color: var(--text-dim);
  font-size: 1.06rem;
  max-width: 680px;
  margin-bottom: 2rem;
}

/* ── 배너 ZStack — 이미지와 오버레이가 같은 frame 안에 겹침 (z축) ── */
.banner-hero {
  width: 100%;
  background: var(--bg);
  overflow: hidden;
  position: relative;
  margin-top: 0;
  padding-top: 0;
}
.banner-frame {
  position: relative;        /* 오버레이의 컨테이닝 블록 */
  width: 100%;
  max-width: 1376px;
  margin: 0;                 /* 좌상단 부착 (centering 제거) */
}
.banner-frame img {
  display: block;
  width: 100%;               /* frame 폭에 맞춤 (≤1376) */
  height: auto;              /* 비율 유지 — 늘어남 없음 */
}
/* 상단 다크 그라데이션 — 네비 글자 가독성 보호 (블러랑 같이) */
.banner-frame::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 140px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(12, 11, 10, 0.4), transparent);
  z-index: 2;
}
/* 하단 비네팅 — 다음 섹션과 부드럽게 이어짐 */
.banner-frame::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 25%;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
  z-index: 2;
}

/* 베너 위 좌측 오버레이 — 이미지 frame 안에 absolute (Don 은 오른쪽, 텍스트는 왼쪽 빈 공간 위) */
.banner-overlay {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 3;
  pointer-events: none;
}
.banner-tagline,
.banner-sub {
  width: 42%;
  margin-left: 6%;
  pointer-events: auto;
}
.banner-tagline {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  line-height: 1.25;
  color: var(--gold-bright);
  font-weight: 700;
  text-shadow: 0 2px 12px rgba(0,0,0,0.85), 0 1px 4px rgba(0,0,0,0.6);
  margin-bottom: 0.8rem;
}
.banner-sub {
  font-size: clamp(0.85rem, 1.05vw, 1rem);
  line-height: 1.55;
  color: var(--text);
  text-shadow: 0 2px 10px rgba(0,0,0,0.85), 0 1px 3px rgba(0,0,0,0.6);
}
/* 모바일 — 오버레이 풀폭 + 가운데 배치 + 어두운 막 */
@media (max-width: 760px) {
  .banner-overlay { background: linear-gradient(to right, rgba(12,11,10,0.7), rgba(12,11,10,0.25)); }
  .banner-tagline, .banner-sub { width: 86%; margin-left: 7%; }
  .banner-tagline { font-size: 1.2rem; }
}

/* ── Hero ── */
.hero {
  padding: 7rem 1.5rem 6rem;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(201, 162, 39, 0.08), transparent),
    var(--bg);
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.badge {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1.6rem;
}
.hero-title {
  font-family: var(--serif);
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.hero-tagline {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--gold-bright);
  margin: 1rem 0 1rem;
}
.hero-sub {
  color: var(--text-dim);
  font-size: 1.08rem;
  max-width: 600px;
  margin: 0 auto 2.2rem;
}
.hero-cta { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

/* ── 버튼 ── */
.btn {
  display: inline-block;
  font-weight: 600;
  font-size: 0.96rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: transform 0.08s ease;
}
.btn:active { transform: translateY(1px); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1a1505;
}
.btn-gold:hover { color: #1a1505; filter: brightness(1.08); }
.btn-ghost {
  border-color: var(--border-gold);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(201, 162, 39, 0.08); color: var(--text); }

/* ── 데이터 테이블 ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-bottom: 1.4rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  color: var(--gold-bright);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table td.num { text-align: right; color: var(--text-dim); font-family: var(--mono); font-size: 0.88rem; }
.data-table .hl { color: var(--gold-bright); font-weight: 600; }
.compare th.hl { color: var(--gold); }
.punch {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--blood);
  font-weight: 700;
}
.section-problem { background: var(--bg-elev); }

/* ── 조직도 ── */
.section-org { background: var(--bg-elev); }
.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 2rem 0 3rem;
}
.org-level {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 0.9rem 1.2rem;
  text-align: center;
}
.org-level-0 { border-left-color: var(--gold-bright); background: var(--surface-2); }
.org-level-4 { border-left-color: var(--text-faint); }
.org-name { font-weight: 700; font-size: 1.02rem; }
.org-role { color: var(--text-dim); font-size: 0.88rem; margin-top: 0.15rem; }
.org-arrow { color: var(--gold); font-size: 0.9rem; padding: 0.35rem 0; }

.family-heading {
  font-family: var(--serif);
  font-size: 1.4rem;
  margin-bottom: 1.2rem;
  text-align: center;
}
.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.family-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.3rem;
}
.family-card h4 {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--gold-bright);
  margin-bottom: 0.4rem;
}
.family-card p { color: var(--text-dim); font-size: 0.92rem; }

/* ── C4I 파이프라인 ── */
.pipe-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}
.pipe-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.pipe-n {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.pipe-name { font-weight: 700; font-size: 1rem; }
.pipe-d { color: var(--text-dim); font-size: 0.86rem; }

/* ── 핵심 기능 ── */
.section-features { background: var(--bg-elev); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.15s ease;
}
.feature-card:hover { border-color: var(--border-gold); }
.feature-card h3 {
  font-family: var(--serif);
  font-size: 1.18rem;
  margin-bottom: 0.5rem;
}
.feature-card p { color: var(--text-dim); font-size: 0.93rem; }

/* ── CTA 밴드 ── */
.cta-band {
  padding: 5rem 1.5rem;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 80% at 50% 100%, rgba(201, 162, 39, 0.1), transparent),
    var(--bg);
  border-top: 1px solid var(--border);
}
.cta-band .section-inner { display: flex; flex-direction: column; align-items: center; }
.cta-band h2 { font-family: var(--serif); font-size: 2.2rem; margin-bottom: 0.6rem; }
.cta-band h2::before { content: none; }

/* ── 푸터 ── */
.footer {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem;
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; text-align: center; }
.footer-brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
.footer-tag { color: var(--text-dim); font-size: 0.92rem; margin: 0.4rem 0 1.2rem; }
.footer-links { display: flex; gap: 1.4rem; justify-content: center; margin-bottom: 1rem; }
.footer-links a { color: var(--text-dim); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }
.footer-meta { color: var(--text-dim); font-size: 0.82rem; font-family: var(--mono); }

/* ── 문서 페이지 (Phase 2) ── */
.doc-layout {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 240px 1fr; gap: 2.5rem;
  padding: 3rem 1.5rem;
  align-items: start;
}
.doc-sidebar {
  position: sticky;
  top: 80px;                /* sticky 네비 아래 */
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 1rem 1rem 1rem 0;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
}
.doc-sidebar h4 {
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gold-bright); margin: 1rem 0 0.4rem; font-weight: 700;
}
.doc-sidebar h4:first-child { margin-top: 0; }
.doc-sidebar a {
  display: block;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 0.4rem 0.7rem;
  border-radius: 5px;
  border-left: 2px solid transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.doc-sidebar a:hover { color: var(--text); background: rgba(201, 162, 39, 0.06); }
.doc-sidebar a.active {
  color: var(--gold-bright);
  background: rgba(201, 162, 39, 0.12);
  border-left-color: var(--gold);
  font-weight: 600;
}
.doc-content { flex: 1 1 auto; min-width: 0; }
.doc-content h1 { font-family: var(--serif); font-size: 2.2rem; margin-bottom: 1rem; }
.doc-content h2 { font-family: var(--serif); font-size: 1.5rem; margin: 2rem 0 0.8rem; }
.doc-content h3 { font-size: 1.15rem; margin: 1.4rem 0 0.6rem; }
.doc-content h4 { font-size: 1rem; margin: 1.2rem 0 0.5rem; color: var(--gold-bright); }
.doc-content p { margin: 0.7rem 0; color: var(--text); }
.doc-content ul, .doc-content ol { margin: 0.7rem 0 0.7rem 1.3rem; }
.doc-content li { margin: 0.25rem 0; color: var(--text); }
.doc-content a { text-decoration: underline; }
.doc-content blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--text-dim);
  background: var(--surface);
}
.doc-content hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.doc-content code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
}
.doc-content pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}
.doc-content pre code { background: none; border: none; padding: 0; font-size: 0.84rem; }
.doc-content table {
  width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem;
}
.doc-content th, .doc-content td {
  border: 1px solid var(--border); padding: 0.5rem 0.8rem; text-align: left;
}
.doc-content th { background: var(--surface); color: var(--gold-bright); font-weight: 700; }

/* 문서 — TS 블록 기반 페이지 */
.doc-cat {
  display: inline-block;
  font-size: 0.74rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  background: rgba(230, 197, 87, 0.1);
  border: 1px solid rgba(230, 197, 87, 0.3);
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.8rem;
}
.doc-content .doc-note {
  background: rgba(230, 197, 87, 0.06);
  border-left: 3px solid var(--gold);
  padding: 0.7rem 1rem;
  margin: 1rem 0;
  color: var(--text);
  border-radius: 0 6px 6px 0;
}
.doc-content ul li a strong { color: var(--gold-bright); }
.doc-content ul li a { color: var(--text); text-decoration: none; display: block; padding: 0.4rem 0; border-bottom: 1px dotted var(--border); }
.doc-content ul li a:hover { color: var(--gold-bright); }
.doc-index-intro { color: var(--text-dim); font-size: 0.92rem; }

/* ── 아키텍처 페이지 ── */
.hero-small { padding: 4.5rem 1.5rem 3rem; }
.hero-small .hero-title { font-size: 2.6rem; }

.section-overview, .section-regions, .section-family-detail, .section-debate-flow {
  background: var(--bg);
}
.section-overview { background: var(--bg-elev); }
.section-family-detail { background: var(--bg-elev); }

.overview-wrap, .debate-wrap {
  width: 100%;
  max-width: 920px;
  margin: 1.5rem auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
}
.overview-svg, .debate-svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 640px;
}

/* ── 아키텍처 페이지 — 좌 vertical 흐름 + 우 :target 상세 뷰 ── */
.arch-layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 2.5rem 1.5rem;
  align-items: start;
}
.arch-flow {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 0.5rem;
}
.arch-flow-group { margin-bottom: 1.5rem; }
.arch-flow-group-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-left: 0.3rem;
}
.arch-flow-line {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.arch-flow-line::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold), var(--gold-bright));
  border-radius: 2px;
}
.arch-flow-line-family::before {
  background: linear-gradient(to bottom, #b48a1f55, #d4af3755);
}
.arch-flow-item {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  padding: 0.55rem 0.4rem;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s ease;
  position: relative;
}
.arch-flow-item:hover { background: rgba(180, 138, 31, 0.08); }
.arch-flow-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--gold);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}
.arch-flow-item:hover .arch-flow-dot {
  background: var(--gold);
  transform: scale(1.1);
}
.arch-flow-dot-branch { border-style: dashed; }       /* 토론 (분기 트랙) */
.arch-flow-dot-family { border-color: var(--text-dim); }
.arch-flow-label { display: flex; flex-direction: column; min-width: 0; }
.arch-flow-keyword {
  color: var(--text);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
}
.arch-flow-sub {
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 우측 detail — 기본은 모든 카드 가려두고 :target 만 표시 */
.arch-detail .region-card,
.arch-detail .family-detail {
  display: none;
}
.arch-detail :target { display: block; }
/* :target 없으면 기본 활성: intake */
.arch-layout:not(:has(.arch-detail :target)) #region-intake { display: block; }

/* 활성 항목 하이라이트 (좌측 점·라벨) */
.arch-layout:has(#region-intake:target) .arch-flow-item-region-intake .arch-flow-dot,
.arch-layout:has(#region-orchestration:target) .arch-flow-item-region-orchestration .arch-flow-dot,
.arch-layout:has(#region-strategy:target) .arch-flow-item-region-strategy .arch-flow-dot,
.arch-layout:has(#region-debate:target) .arch-flow-item-region-debate .arch-flow-dot,
.arch-layout:has(#region-execution:target) .arch-flow-item-region-execution .arch-flow-dot,
.arch-layout:has(#region-memory:target) .arch-flow-item-region-memory .arch-flow-dot,
.arch-layout:has(#family-consigliere:target) .arch-flow-item-family-consigliere .arch-flow-dot,
.arch-layout:has(#family-capomastro:target) .arch-flow-item-family-capomastro .arch-flow-dot,
.arch-layout:has(#family-soldato:target) .arch-flow-item-family-soldato .arch-flow-dot,
.arch-layout:has(#debate-flow:target) .arch-flow-item-debate-flow .arch-flow-dot,
.arch-layout:not(:has(.arch-detail :target)) .arch-flow-item-region-intake .arch-flow-dot {
  background: var(--gold);
  transform: scale(1.15);
  box-shadow: 0 0 0 6px rgba(180, 138, 31, 0.15);
}
.arch-layout:has(#region-intake:target) .arch-flow-item-region-intake .arch-flow-keyword,
.arch-layout:has(#region-orchestration:target) .arch-flow-item-region-orchestration .arch-flow-keyword,
.arch-layout:has(#region-strategy:target) .arch-flow-item-region-strategy .arch-flow-keyword,
.arch-layout:has(#region-debate:target) .arch-flow-item-region-debate .arch-flow-keyword,
.arch-layout:has(#region-execution:target) .arch-flow-item-region-execution .arch-flow-keyword,
.arch-layout:has(#region-memory:target) .arch-flow-item-region-memory .arch-flow-keyword,
.arch-layout:has(#family-consigliere:target) .arch-flow-item-family-consigliere .arch-flow-keyword,
.arch-layout:has(#family-capomastro:target) .arch-flow-item-family-capomastro .arch-flow-keyword,
.arch-layout:has(#family-soldato:target) .arch-flow-item-family-soldato .arch-flow-keyword,
.arch-layout:not(:has(.arch-detail :target)) .arch-flow-item-region-intake .arch-flow-keyword {
  color: var(--gold);
}

/* 우측 detail 컨테이너 */
.arch-detail {
  min-width: 0;          /* grid item overflow 방지 */
}

/* ── 반응형 (모바일에선 위로 쌓임) ── */
@media (max-width: 860px) {
  .arch-layout { grid-template-columns: 1fr; gap: 1rem; }
  .arch-flow { position: static; max-height: none; }
  .arch-detail .region-card,
  .arch-detail .family-detail { display: block; }   /* 모바일에선 전부 표시 (스크롤 탐색) */
}

/* Overview — 5+1 그리드(메인 트랙 5칸 + 분기 1칸) + Consigliere 띠 (legacy, 안 쓰이지만 보존) */
.overview-stage {
  position: relative;
  width: 100%;
  max-width: 1000px;
  min-width: 800px;
  aspect-ratio: 1000 / 640;
  margin: 0 auto;
}
.overview-stage-dual { aspect-ratio: 1000 / 640; }
.overview-paths {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ov-seg {
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  fill: none;
}
.ov-station {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 130px;
  text-decoration: none;
  cursor: pointer;
  z-index: 2;
}
/* 스테이션 = 키워드를 담은 골드 pill */
.ov-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  height: 44px;
  min-width: 96px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1a1505;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 2px solid var(--gold-bright);
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.ov-station:hover .ov-pill,
.ov-station:focus-visible .ov-pill {
  transform: scale(1.12);
  box-shadow: 0 6px 28px rgba(230, 197, 87, 0.55);
}

/* 트랙별 부가 라벨 (24/7 상시 / 충돌 시) */
.ov-annot {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 8px;
  font-size: 10.5px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: rgba(230, 197, 87, 0.08);
  border: 1px solid rgba(230, 197, 87, 0.25);
  border-radius: 999px;
  white-space: nowrap;
}
.ov-station .ov-name {
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);  /* SVG 곡선 위에 떠 있어도 가독성 */
}

/* ── 호버 팝업 — 컴팩트 (라벨 + oneliner + 칩 + Click→) ── */
.ov-popup {
  position: absolute;
  width: 240px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(20, 14, 0, 0.18), 0 0 0 1px rgba(180, 138, 31, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  z-index: 30;
  text-align: left;
}
.ov-popup h4 {
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
}
.ov-pop-line {
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 8px;
}
.ov-chip-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ov-chip {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 7px;
  background: rgba(230, 197, 87, 0.1);
  color: var(--gold-bright);
  border: 1px solid rgba(230, 197, 87, 0.28);
  border-radius: 999px;
  line-height: 1.5;
  white-space: nowrap;
}
.ov-pop-link {
  display: block;
  color: var(--gold-bright);
  font-size: 0.78rem;
  font-weight: 600;
}

/* 팝업 배치: 메인 트랙(상단 5칸) → 팝업 아래로. 토론(분기 트랙) → 팝업 위로. */
.ov-station[data-track="top"] .ov-popup {
  top: 78px; left: 50%;
  transform: translateX(-50%) scale(0.94);
  transform-origin: center top;
}
.ov-station[data-track="bot"] .ov-popup {
  bottom: 78px; left: 50%;
  transform: translateX(-50%) scale(0.94);
  transform-origin: center bottom;
}
.ov-station[data-track="top"]:hover .ov-popup,
.ov-station[data-track="top"]:focus-within .ov-popup { transform: translateX(-50%) scale(1); }
.ov-station[data-track="bot"]:hover .ov-popup,
.ov-station[data-track="bot"]:focus-within .ov-popup { transform: translateX(-50%) scale(1); }

.ov-station:hover .ov-popup, .ov-station:focus-within .ov-popup {
  opacity: 1; visibility: visible; pointer-events: auto;
}

/* ── 호버 시 다른 스테이션·경로 dim, 활성 outgoing 경로 flow 애니메이션 ── */
.ov-station { transition: opacity 0.2s ease; }
.ov-seg { transition: opacity 0.2s ease, stroke-width 0.2s ease; }

.overview-stage:has(.ov-station:hover) .ov-station:not(:hover) { opacity: 0.32; }
.overview-stage:has(.ov-station:hover) .ov-seg { opacity: 0.18; }

/* 호버 시 활성 outgoing 경로 flow 애니메이션 (region id 기반 클래스 매칭) */
.overview-stage:has(.ov-st-intake:hover) .ov-seg-intake,
.overview-stage:has(.ov-st-orchestration:hover) .ov-seg-orch-up,
.overview-stage:has(.ov-st-orchestration:hover) .ov-seg-orch-dn,
.overview-stage:has(.ov-st-strategy:hover) .ov-seg-strategy,
.overview-stage:has(.ov-st-debate:hover) .ov-seg-debate,
.overview-stage:has(.ov-st-execution:hover) .ov-seg-execution {
  opacity: 1;
  stroke-width: 4;
  stroke-dasharray: 8 8;
  animation: ov-flow 1.2s linear infinite;
}
@keyframes ov-flow {
  to { stroke-dashoffset: -32; }
}

/* 활성 스테이션 펄스 (pill) */
.ov-station:hover .ov-pill, .ov-station:focus-visible .ov-pill {
  animation: ov-pulse 1.6s ease-in-out infinite;
}
@keyframes ov-pulse {
  0%, 100% { transform: scale(1.12); box-shadow: 0 8px 36px rgba(230, 197, 87, 0.7); }
  50%      { transform: scale(1.18); box-shadow: 0 8px 56px rgba(230, 197, 87, 1), 0 0 0 8px rgba(230, 197, 87, 0.15); }
}

/* prefers-reduced-motion 존중 */
@media (prefers-reduced-motion: reduce) {
  .overview-stage:has(.ov-station:hover) .ov-seg { animation: none !important; }
  .ov-station:hover .ov-pill { animation: none; transform: scale(1.1); }
}

/* ── Consigliere 가로 띠 — 팝업 없이 깔끔한 정보 띠. 호버 시 점선만 강조 ── */
.ov-cons-band {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 78%;
  height: 60px;
  background: linear-gradient(180deg, #fef9e6, #f7eecf);
  border: 1.5px solid var(--gold-bright);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(201, 162, 39, 0.2), inset 0 1px 0 rgba(230, 197, 87, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 3;
}
.ov-cons-band:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(230, 197, 87, 0.45), inset 0 1px 0 rgba(230, 197, 87, 0.3);
}
.ov-cons-inner {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 16px;
}
.ov-cons-emblem {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}
.ov-cons-sub {
  color: var(--text-dim);
  font-size: 11.5px;
}
.ov-cons-link {
  stroke: var(--text-faint);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
  fill: none;
  opacity: 0.45;
  transition: opacity 0.2s ease, stroke 0.2s ease;
}
.overview-stage:has(.ov-cons-band:hover) .ov-cons-link {
  opacity: 1;
  stroke: var(--gold-bright);
  stroke-width: 2;
  animation: ov-flow 1.2s linear infinite;
}

.ov-foot-note {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 1.2rem;
  font-style: italic;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .ov-popup { width: 240px; padding: 12px; }
  .ov-circle { width: 52px; height: 52px; font-size: 22px; }
}

/* Debate SVG */
.db-node rect, .db-node polygon { fill: var(--surface-2); stroke: var(--border-gold); stroke-width: 1.4; }
.db-trigger rect { fill: rgba(201, 162, 39, 0.12); }
.db-diamond { fill: var(--surface-2); stroke: var(--gold); stroke-width: 1.4; }
.db-ok rect { fill: rgba(73, 145, 79, 0.18); stroke: #4a8b50; }
.db-persist rect { fill: rgba(140, 110, 47, 0.25); stroke: var(--gold); }
.db-guard rect { fill: var(--surface); stroke: var(--gold); stroke-dasharray: 5 3; }
.db-abort rect { fill: rgba(140, 47, 47, 0.25); stroke: var(--blood); }
.db-round-box { fill: none; stroke: var(--border); stroke-dasharray: 6 4; stroke-width: 1; }
.db-round-label { fill: var(--gold-bright); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.db-label { fill: var(--text); font-family: var(--sans); font-size: 13px; font-weight: 600; text-anchor: middle; }
.db-sub { font-size: 11px; font-weight: 400; fill: var(--text-dim); }
.db-arrow { stroke: var(--gold); stroke-width: 1.6; fill: none; }
.db-arrow.db-red { stroke: var(--blood); }
.db-branch { fill: var(--text-dim); font-family: var(--sans); font-size: 11px; font-style: italic; }
.db-foot { fill: var(--text-dim); font-family: var(--sans); font-size: 12px; text-anchor: middle; font-style: italic; }

/* 구간 카드 */
.region-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  padding: 1.4rem 1.6rem;
  margin: 1.2rem 0;
}
.reg-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--border); }
.reg-keyword {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 800;
  color: #1a1505;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  flex-shrink: 0;
  align-self: flex-start;
  white-space: nowrap;
}
.reg-head h3 { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 0.2rem; }
.reg-oneliner { color: var(--text-dim); font-size: 0.93rem; margin: 0; }
.reg-section { margin-top: 1rem; }
.reg-section h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  margin-bottom: 0.55rem;
  font-weight: 700;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  display: inline-block;
  font-size: 0.82rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  line-height: 1.4;
}
.chip-safety { border-color: var(--blood); color: #e09a9a; background: rgba(140, 47, 47, 0.12); }
.chip-region { background: rgba(201, 162, 39, 0.12); border-color: var(--border-gold); color: var(--gold-bright); }
.reg-safety { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px dashed var(--border); display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.reg-safety-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blood);
  font-weight: 700;
  margin-right: 0.3rem;
}

/* 메소드 리스트 */
.method-list { list-style: none; padding: 0; margin: 0; }
.method-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.35rem 0;
  border-bottom: 1px dotted var(--border);
}
.method-list li:last-child { border-bottom: none; }
.m-name {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--gold-bright);
  background: var(--surface-2);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.m-file { font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim); }
.m-note { font-size: 0.86rem; color: var(--text-dim); flex: 1 1 240px; }

.file-row { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; }
.file-row code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--surface-2);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* 패밀리 상세 */
.family-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: 8px;
  padding: 1.6rem 1.8rem;
  margin: 1.2rem 0;
}
.fam-head { margin-bottom: 1rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--border); }
.fam-name { font-family: var(--serif); font-size: 1.7rem; color: var(--gold-bright); margin-bottom: 0.2rem; }
.fam-sub { color: var(--text-dim); font-size: 0.92rem; font-style: italic; margin: 0; }
.fam-what { color: var(--text); font-size: 0.96rem; line-height: 1.7; margin-bottom: 1.2rem; }
.fam-section { margin-top: 1rem; }
.fam-section h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  margin-bottom: 0.55rem;
  font-weight: 700;
}
.how-list { list-style: none; padding: 0; margin: 0; }
.how-list li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.2rem;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
}
.how-list li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--gold);
}
.fam-region { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px dashed var(--border); }

/* ── 다운로드 페이지 ── */
.section-download { background: var(--bg-elev); }
.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.2rem;
}
.dl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: 10px;
  padding: 1.5rem 1.7rem;
  display: flex;
  flex-direction: column;
}
.dl-head { margin-bottom: 0.8rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--border); }
.dl-head h3 {
  font-family: var(--serif); font-size: 1.35rem; margin-bottom: 0.3rem;
  display: flex; align-items: baseline; gap: 0.6rem;
}
.dl-status {
  display: inline-block;
  font-size: 0.66rem;
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: rgba(230, 197, 87, 0.12);
  border: 1px solid var(--border-gold);
  padding: 0.12rem 0.55rem;
  border-radius: 4px;
}
.dl-tagline { color: var(--gold-bright); font-size: 0.9rem; font-style: italic; margin: 0; }
.dl-what { color: var(--text); font-size: 0.94rem; line-height: 1.65; margin-bottom: 1rem; }
.dl-steps { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.dl-steps li {
  display: flex; gap: 0.7rem; align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--border);
}
.dl-steps li:last-child { border-bottom: none; }
.dl-step-n {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(230, 197, 87, 0.14);
  color: var(--gold-bright);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-gold);
}
.dl-steps li code {
  flex: 1 1 auto;
  font-family: var(--mono); font-size: 0.84rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.dl-cta { align-self: flex-start; margin-top: auto; }

/* ── 반응형 ── */
@media (max-width: 720px) {
  .hero-title { font-size: 2.8rem; }
  .hero-tagline { font-size: 1.2rem; }
  .nav { padding: 0.8rem 1rem; }
  .nav nav { gap: 0.9rem; }
  .nav nav a:not(.nav-gh) { display: none; }
  .section { padding: 3.5rem 1.2rem; }
  .doc-layout { flex-direction: column; padding: 2rem 1.2rem; }
  .doc-sidebar { flex: none; }
}
