@charset "UTF-8";
@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=Noto+Serif+KR:wght@400;600;700&display=swap");

/* ==========================================================
   ORDEL EMPIRE · WORLD GUIDE
   세계관 안내서 인라인 HTML과 같은 톤으로 맞춘 스타일시트
   ========================================================== */


/* ----------------------------------------------------------
   TOKENS
---------------------------------------------------------- */
:root {
  /* 바탕 */
  --bg:          #0a0a0f;
  --bg-hero:     #12101a;
  --panel:       #111015;
  --panel-deep:  #13111a;
  --panel-end:   #0f0e14;

  /* 선 */
  --line:        #2a2520;
  --line-soft:   #1e1c1a;
  --line-faint:  #1a1815;

  /* 글자 */
  --text:        #d4cfc4;
  --text-sub:    #9e9688;
  --text-body:   #8a8378;
  --text-faint:  #7a756c;
  --text-label:  #6b6358;
  --text-ghost:  #3a3530;
  --eyebrow:     #8a7d6b;

  /* 제국 금색 */
  --gold:        #c9b87a;
  --gold-dim:    rgba(201, 184, 122, 0.22);

  /* 지역색 */
  --central:     #c9b87a;
  --north:       #a0b8c8;
  --south:       #d4a0a0;
  --east:        #b8b0d0;
  --west:        #a0c4b0;

  /* 서체 — 한글은 반드시 Noto Serif KR로 떨어지게 */
  --font-kr:     "Noto Serif KR", serif;
  --font-latin:  "Cormorant Garamond", "Noto Serif KR", serif;

  --nav-offset:  84px;
}


/* ----------------------------------------------------------
   BASE
---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--line) var(--bg);
}

body {
  margin: 0;
  background: #07070b;
  color: var(--text);
  font-family: var(--font-kr);
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p {
  margin: 0;
  font-weight: 400;
}

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

a:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

::selection {
  background: var(--gold-dim);
  color: var(--text);
}

strong {
  color: var(--gold);
  font-weight: 600;
}

em {
  color: var(--text-sub);
}


/* ----------------------------------------------------------
   PAGE FRAME
---------------------------------------------------------- */
.world-guide {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg);
  border-left: 1px solid var(--line-faint);
  border-right: 1px solid var(--line-faint);
  text-align: left;
}


/* ----------------------------------------------------------
   HERO
---------------------------------------------------------- */
.hero {
  padding: 54px 18px 34px;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(201, 184, 122, 0.05), transparent 70%),
    linear-gradient(var(--bg-hero), var(--bg));
  border-bottom: 1px solid var(--line);
}

.hero__eyebrow {
  margin-bottom: 14px;
  font: 12px var(--font-latin);
  letter-spacing: 5px;
  color: var(--eyebrow);
}

.hero__title {
  font: 700 38px/1.1 var(--font-latin);
  letter-spacing: 1.5px;
  color: var(--gold);
}

.hero__subtitle {
  margin-top: 12px;
  font-size: 13px;
  letter-spacing: 0.8px;
  color: var(--text-label);
}

.hero__description {
  font-size: 14px;
  color: var(--text-sub);
}

/* 부제와 설명 사이의 금색 한 줄 */
.hero__description::before {
  content: "";
  display: block;
  width: 56px;
  margin: 24px auto;
  border-top: 1px solid var(--gold);
}


/* ----------------------------------------------------------
   QUICK NAV — 인라인 탭(I · II · III)과 같은 모양
---------------------------------------------------------- */
.quick-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  padding: 0 18px;
  background: rgba(10, 10, 15, 0.94);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  counter-reset: nav;
}

.quick-nav a {
  counter-increment: nav;
  display: block;
  padding: 14px 0 10px;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 1px;
  text-align: center;
  color: var(--gold);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.quick-nav a::before {
  content: counter(nav, upper-roman);
  display: block;
  font: 11px/1.6 var(--font-latin);
  letter-spacing: 3px;
  color: var(--text-label);
}

.quick-nav a:hover,
.quick-nav a:focus-visible {
  border-bottom-color: var(--line);
  outline: none;
}


/* ----------------------------------------------------------
   SECTIONS
---------------------------------------------------------- */
.guide-section {
  min-height: calc(100vh - var(--nav-offset));
  padding: 38px 18px;
  scroll-margin-top: var(--nav-offset);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
}

.section-heading__number {
  flex: none;
  padding-right: 16px;
  border-right: 1px solid var(--line);
  font: 600 30px/1 var(--font-latin);
  color: var(--gold);
}

.section-heading__eyebrow {
  font: 11px/1.6 var(--font-latin);
  letter-spacing: 3px;
  color: var(--text-label);
}

.section-heading h2 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 1px;
  color: var(--gold);
}


/* ----------------------------------------------------------
   01 · OVERVIEW
   index.html <head>의 <style>보다 우선하도록 .world-guide를 앞에 붙임
---------------------------------------------------------- */
.world-guide .overview-card {
  display: block;
  padding: 28px 26px 26px;
  text-align: left;
  background: linear-gradient(135deg, var(--panel-deep), var(--panel-end));
  border: 1px solid var(--line);
  border-radius: 10px;
}

.world-guide .overview-card strong {
  color: var(--gold);
  font-weight: 600;
}

/* 도입 문단 — 카드 안에서 가장 밝은 글자 */
.world-guide .overview-card__lead {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--text);
}

.world-guide .overview-card__divider {
  width: 42px;
  height: 0;
  margin: 22px 0;
  background: none;
  border-top: 1px solid var(--gold);
}

.world-guide .overview-card__body {
  display: block;
}

.world-guide .overview-card__body p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--text-sub);
}

.world-guide .overview-card__body p + p {
  margin-top: 12px;
}

/* 요약 — 인라인 인물 카드의 스탯 줄과 같은 모양 */
.world-guide .overview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.world-guide .overview-summary__item {
  padding: 10px 6px;
  text-align: center;
  background: none;
  border: 0;
}

.world-guide .overview-summary__item + .overview-summary__item {
  border-left: 1px solid var(--line);
}

.world-guide .overview-summary .overview-summary__label {
  display: block;
  margin-bottom: 2px;
  font: 10.5px/1.6 var(--font-latin);
  letter-spacing: 2px;
  color: var(--text-label);
}

.world-guide .overview-summary .overview-summary__value {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--gold);
}


/* ----------------------------------------------------------
   02 · GEOGRAPHY
---------------------------------------------------------- */

/* 지역색 연결 — 카드와 탭이 같은 변수를 씀 */
[data-region="central"], .region-nav a[href="#central"] { --accent: var(--central); --accent-dim: rgba(201, 184, 122, 0.18); }
[data-region="north"],   .region-nav a[href="#north"]   { --accent: var(--north);   --accent-dim: rgba(160, 184, 200, 0.18); }
[data-region="south"],   .region-nav a[href="#south"]   { --accent: var(--south);   --accent-dim: rgba(212, 160, 160, 0.18); }
[data-region="east"],    .region-nav a[href="#east"]    { --accent: var(--east);    --accent-dim: rgba(184, 176, 208, 0.18); }
[data-region="west"],    .region-nav a[href="#west"]    { --accent: var(--west);    --accent-dim: rgba(160, 196, 176, 0.18); }

.region-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.region-nav a {
  display: block;
  padding: 8px 0;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  color: var(--accent);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: border-color 0.2s ease;
}

.region-nav a:hover,
.region-nav a:focus-visible {
  border-bottom-color: var(--line);
  outline: none;
}

.region-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.region-card {
  padding: 20px 18px 18px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-top: 2px solid var(--accent);
  scroll-margin-top: calc(var(--nav-offset) + 171px);
}

.region-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.region-card__label {
  font: 11px/1.6 var(--font-latin);
  letter-spacing: 3px;
  color: var(--text-label);
}

.region-card h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent);
}

.region-card__city {
  font: 13px/1.6 var(--font-latin);
  letter-spacing: 3px;
  color: var(--text-body);
}

.region-card__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 12px;
}

.info-block {
  min-height: 48px;
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--line);
  transition: border-color 0.2s ease;
}

.info-block:hover {
  border-left-color: var(--accent);
}

.info-block h4,
.region-card__lifestyle h4 {
  margin-bottom: 4px;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 2px;
  color: var(--text-label);
}

.info-block p {
  font-size: 12.8px;
  line-height: 1.75;
  color: var(--text-body);
}

/* 원본 안내서처럼 '주요 산업'만 지역색으로 (세 번째 칸) */
.info-block:nth-child(3) p {
  font-size: 11.5px;
  color: var(--accent);
}

.region-card__lifestyle {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.region-card__lifestyle p {
  font-size: 12.8px;
  line-height: 1.9;
  color: var(--text-body);
}

.info-block p + p,
.region-card__lifestyle p + p {
  margin-top: 6px;
}


/* ----------------------------------------------------------
   03 · ECONOMY
---------------------------------------------------------- */
.economy-block {
  padding: 22px 0;
}

.economy-block + .economy-block {
  border-top: 1px solid var(--line-soft);
}

.economy-block:first-of-type {
  padding-top: 0;
}

.economy-block:last-of-type {
  padding-bottom: 0;
}

.economy-block > header {
  margin-bottom: 14px;
}

.economy-block__label {
  font: 11px/1.6 var(--font-latin);
  letter-spacing: 3px;
  color: var(--text-label);
}

.economy-block h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.5px;
  color: var(--gold);
}

/* 화폐 체계 */
.currency-display {
  display: flex;
  align-items: flex-start;
  padding: 20px 12px 18px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.currency-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.currency-card::before {
  content: "";
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.currency-card:nth-of-type(1)::before { background: radial-gradient(at 35% 30%, #f3e4a8, #a8872e); }
.currency-card:nth-of-type(2)::before { background: radial-gradient(at 35% 30%, #eceef2, #8a8c98); }
.currency-card:nth-of-type(3)::before { background: radial-gradient(at 35% 30%, #e8b48a, #7a4424); }

.currency-card strong {
  font: 600 15px/1.4 var(--font-latin);
  letter-spacing: 2px;
  color: var(--gold);
  white-space: nowrap;
}

.currency-card span {
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-label);
}

.currency-equals {
  flex: none;
  padding: 7px 4px 0;
  font: 16px/1 var(--font-latin);
  color: var(--text-label);
}

.economy-copy {
  margin-top: 16px;
  font-size: 12.8px;
  line-height: 1.85;
  color: var(--text-body);
}

.economy-copy p + p {
  margin-top: 6px;
}

/* 주요 산업 — 원본의 '자원의 흐름' 행 모양 */
.economy-region-grid > section {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 14px;
  align-items: baseline;
  padding: 9px 0;
  font-size: 12.8px;
  line-height: 1.75;
  color: var(--text-body);
  border-top: 1px solid var(--line-soft);
}

.economy-region-grid > section > :first-child {
  grid-column: 1;
  font-size: 12.5px;
  color: var(--accent, var(--gold));
}

.economy-region-grid > section > :not(:first-child) {
  grid-column: 2;
}

/* 특산물 — 원본 가문 타일처럼 윗선만 지역색 */
.specialty-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
}

.specialty-grid > section {
  min-height: 72px;
  padding: 12px 10px;
  background: var(--panel);
  border-top: 2px solid var(--accent, var(--gold));
}

.specialty-grid h4 {
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--accent, var(--gold));
}

.specialty-grid p {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-body);
}

/* 산업 · 특산물 — 순서(중앙 북부 남부 동부 서부)대로 지역색 */
.economy-region-grid > section:nth-child(1), .specialty-grid > section:nth-child(1) { --accent: var(--central); }
.economy-region-grid > section:nth-child(2), .specialty-grid > section:nth-child(2) { --accent: var(--north); }
.economy-region-grid > section:nth-child(3), .specialty-grid > section:nth-child(3) { --accent: var(--south); }
.economy-region-grid > section:nth-child(4), .specialty-grid > section:nth-child(4) { --accent: var(--east); }
.economy-region-grid > section:nth-child(5), .specialty-grid > section:nth-child(5) { --accent: var(--west); }

/* 무역 구조 — p, div, li 어느 걸로 채워도 같은 행 모양 */
.trade-list {
  font-size: 12.8px;
  line-height: 1.8;
  color: var(--text-body);
}

.trade-list ul,
.trade-list ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.trade-list > p,
.trade-list > div,
.trade-list li {
  position: relative;
  margin: 0;
  padding: 8px 0 8px 16px;
  border-top: 1px solid var(--line-soft);
}

.trade-list > p::before,
.trade-list > div::before,
.trade-list li::before {
  content: "·";
  position: absolute;
  left: 2px;
  top: 8px;
  color: var(--gold);
}


/* ----------------------------------------------------------
   FOOTER
---------------------------------------------------------- */
.world-footer {
  padding: 26px 18px 30px;
  text-align: center;
  border-top: 1px solid var(--line-faint);
}

.world-footer::before {
  content: "";
  display: block;
  width: 24px;
  margin: 0 auto 16px;
  border-top: 1px solid var(--line);
}

.world-footer a {
  font: 11px/1.6 var(--font-latin);
  letter-spacing: 3px;
  color: var(--text-label);
  transition: color 0.2s ease;
}

.world-footer a:hover,
.world-footer a:focus-visible {
  color: var(--gold);
}


/* ==========================================================
   TABS
   HTML은 그대로 두고 주소의 #해시(:target)로 탭을 전환
   - 빠른 메뉴 4개 = 큰 탭 / 지리 안의 지역 5개 = 작은 탭
   - 아무 탭도 고르지 않았을 땐 '제국 개요', 지역은 '중앙'이 기본
   ========================================================== */

/* 큰 탭 — 선택된 섹션만 보이기 */
.world-guide:has(.guide-section:target, .guide-section :target) .guide-section:not(:target):not(:has(:target)),
.world-guide:not(:has(.guide-section:target, .guide-section :target)) .guide-section:not(#overview) {
  display: none;
}

/* 작은 탭 — 선택된 지역 카드만 보이기 */
.region-list:has(.region-card:target) .region-card:not(:target),
.region-list:not(:has(.region-card:target)) .region-card:not(#central) {
  display: none;
}

/* 큰 탭 선택 표시 */
.world-guide:not(:has(.guide-section:target, .guide-section :target)) .quick-nav a[href="#overview"],
.world-guide:has(#overview:target, #overview :target)     .quick-nav a[href="#overview"],
.world-guide:has(#geography:target, #geography :target)   .quick-nav a[href="#geography"],
.world-guide:has(#economy:target, #economy :target)       .quick-nav a[href="#economy"] {
  border-bottom-color: var(--gold);
  background: var(--panel);
}

.world-guide:not(:has(.guide-section:target, .guide-section :target)) .quick-nav a[href="#overview"]::before,
.world-guide:has(#overview:target, #overview :target)     .quick-nav a[href="#overview"]::before,
.world-guide:has(#geography:target, #geography :target)   .quick-nav a[href="#geography"]::before,
.world-guide:has(#economy:target, #economy :target)       .quick-nav a[href="#economy"]::before {
  color: var(--gold);
}

/* 작은 탭 선택 표시 */
.guide-section--geography:not(:has(.region-card:target)) .region-nav a[href="#central"],
.guide-section--geography:has(#central:target) .region-nav a[href="#central"],
.guide-section--geography:has(#north:target)   .region-nav a[href="#north"],
.guide-section--geography:has(#south:target)   .region-nav a[href="#south"],
.guide-section--geography:has(#east:target)    .region-nav a[href="#east"],
.guide-section--geography:has(#west:target)    .region-nav a[href="#west"] {
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* 탭을 바꿨을 때만 짧게 떠오르기 */
.guide-section:target,
.guide-section:has(:target),
.region-card:target {
  animation: tab-in 0.35s ease both;
}

@keyframes tab-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}


/* ----------------------------------------------------------
   RESPONSIVE
---------------------------------------------------------- */
@media (max-width: 560px) {
  .hero {
    padding: 44px 16px 30px;
  }

  .hero__title {
    font-size: 32px;
  }

  .quick-nav,
  .guide-section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .quick-nav a {
    font-size: 13px;
    letter-spacing: 0.5px;
  }

  .section-heading__number {
    font-size: 26px;
    padding-right: 14px;
  }

  .section-heading h2 {
    font-size: 20px;
  }

  .region-card {
    padding: 18px 14px 16px;
  }

  .region-card__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 특산물: 중앙을 한 줄 전체로, 나머지 넷은 2×2 */
  .specialty-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .specialty-grid > section:first-child {
    grid-column: 1 / -1;
  }

  .world-guide .overview-card {
    padding: 22px 18px 20px;
  }

  .world-guide .overview-card__lead {
    font-size: 14.5px;
    line-height: 1.9;
  }

  .world-guide .overview-card__divider {
    margin: 18px 0;
  }

  .world-guide .overview-card__body p {
    font-size: 13px;
    line-height: 1.9;
  }

  /* 요약 2×2 — 선이 겹치지 않게 다시 긋기 */
  .world-guide .overview-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .world-guide .overview-summary__item:nth-child(3) {
    border-left: 0;
  }

  .world-guide .overview-summary__item:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 380px) {
  .currency-display {
    padding: 18px 6px 16px;
  }

  .currency-card strong {
    font-size: 13px;
    letter-spacing: 1px;
  }

  .currency-equals {
    padding: 8px 2px 0;
    font-size: 14px;
  }

  .region-card__header {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
