/* ============================================================
   พัฒนาการของเอเชียตะวันออกเฉียงใต้ — Editorial Heritage theme
   Fonts: Prompt (display) + Sarabun (body)
   ============================================================ */

:root {
  --paper: #FAF5EC;
  --paper-deep: #F3EBDB;
  --surface: #FFFFFF;
  --ink: #2B2317;
  --ink-soft: #5C5142;
  --line: #E6DAC4;
  --line-soft: #EFE6D3;
  --terra: #A8431F;
  --terra-deep: #8A3517;
  --terra-tint: #F7E8DE;
  --teal: #15646B;
  --teal-deep: #0E4046;
  --teal-tint: #E3EEEC;
  --gold: #B98A1C;
  --gold-deep: #8F6A12;
  --gold-tint: #F7EDD6;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(43, 35, 23, .08), 0 4px 14px rgba(43, 35, 23, .06);
  --shadow-md: 0 2px 6px rgba(43, 35, 23, .08), 0 10px 28px rgba(43, 35, 23, .1);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: "Prompt", "Sarabun", sans-serif;
  --font-body: "Sarabun", "Prompt", sans-serif;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
.nowrap { white-space: nowrap; }

a { color: var(--terra); text-underline-offset: 3px; }
a:hover { color: var(--terra-deep); }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 200;
  background: var(--teal-deep); color: #fff;
  padding: 10px 18px; border-radius: 0 0 10px 10px;
  font-weight: 600; text-decoration: none;
  transition: top .2s ease-out;
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 245, 236, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 16px;
  padding-top: 10px; padding-bottom: 10px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.02rem;
  color: var(--terra-deep);
  text-decoration: none;
  white-space: nowrap;
}
.brand svg { width: 22px; height: 22px; color: var(--terra); flex: none; }
.site-nav { min-width: 0; flex: 1; }
.nav-links {
  display: flex; gap: 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-end;
}
.nav-links a {
  display: block;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .2s ease-out, color .2s ease-out;
}
.nav-links a:hover { background: var(--paper-deep); color: var(--ink); }
.nav-links a.active { background: var(--terra); color: #fff; }
.progress {
  height: 3px; background: var(--line-soft);
}
#progressBar {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--terra), var(--gold));
  transition: width .1s linear;
}

/* ---------------- Hero ---------------- */
.hero {
  padding: 64px 0 40px;
  background:
    radial-gradient(60rem 24rem at 110% -10%, rgba(185, 138, 28, .1), transparent 60%),
    radial-gradient(50rem 22rem at -10% 0%, rgba(21, 100, 107, .08), transparent 60%),
    var(--paper);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: center;
}
.kicker {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.kicker-num {
  background: var(--teal);
  color: #fff;
  padding: 3px 12px;
  border-radius: 999px;
  letter-spacing: .06em;
  white-space: nowrap;
}
.kicker-light { color: #D8E8E4; }
.kicker-light .kicker-num { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); color: #fff; }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal;
  color: var(--terra);
  background: linear-gradient(transparent 68%, var(--gold-tint) 68%);
}
.lead {
  font-size: 1.13rem;
  color: var(--ink-soft);
  max-width: 34em;
  margin-bottom: 26px;
}
.lead strong { color: var(--terra-deep); }

.era-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.era-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: .9rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.era-chip small { font-weight: 400; color: var(--ink-soft); }
.era-chip svg { width: 16px; height: 16px; color: var(--terra); flex: none; }
.era-arrow { color: var(--gold-deep); font-weight: 700; }

.hero-figure { position: relative; }
.hero-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(43, 35, 23, .12);
}
.hero-caption {
  position: absolute;
  left: 14px; bottom: 14px; right: 14px;
  background: rgba(14, 64, 70, .78);
  color: #F4EFE3;
  font-size: .85rem;
  padding: 8px 14px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-top: 44px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px 12px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.stat dt {
  font-size: .82rem;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 2px;
}
.stat dd {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--terra);
  line-height: 1.2;
}
.stat dd span {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink-soft);
}

/* ---------------- Sections ---------------- */
.section { padding: 84px 0; }
.section-tint { background: var(--paper-deep); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-dark {
  background: linear-gradient(180deg, var(--teal-deep) 0%, #0B3439 100%);
  color: #F2EDE0;
  border-top: 1px solid rgba(255,255,255,.08);
}
.section-quiz { background: var(--paper-deep); border-top: 1px solid var(--line); }

.section-head { max-width: 780px; margin-bottom: 44px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.28;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -.01em;
}
.section-lead { font-size: 1.06rem; color: var(--ink-soft); }
.section-lead strong, .section-lead-light strong { color: inherit; }
.section-dark .section-head h2 { color: #fff; }
.section-lead-light { color: #D9E4DE; }
.section-dark :focus-visible { outline-color: var(--gold); }

.sub-title {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  margin: 46px 0 20px;
  padding-left: 14px;
  border-left: 4px solid var(--gold);
  line-height: 1.5;
}
.sub-title:first-of-type { margin-top: 0; }

/* ---------------- Country cards ---------------- */
.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
}
.country-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease-out, box-shadow .25s ease-out;
}
.country-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.country-card figure { aspect-ratio: 16 / 10; overflow: hidden; }
.country-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease-out;
}
.country-card:hover img { transform: scale(1.04); }
.country-body { padding: 16px 18px 18px; position: relative; }
.country-no {
  position: absolute; top: -18px; right: 14px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--gold);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  border: 3px solid var(--paper);
}
.country-body h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
}
.country-cap { font-size: .9rem; color: var(--ink-soft); margin: 2px 0 8px; }
.country-landmark {
  display: flex; align-items: center; gap: 6px;
  font-size: .9rem; font-weight: 600;
  color: var(--terra-deep);
}
.country-landmark svg { width: 15px; height: 15px; flex: none; }

/* ---------------- Geography ---------------- */
.geo-top {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 36px;
  align-items: start;
}
.framed-img img {
  border-radius: var(--radius);
  border: 1px solid rgba(43,35,23,.14);
  box-shadow: var(--shadow-md);
  width: 100%;
}
.framed-img figcaption, .wide-figure figcaption, .eco-img figcaption {
  font-size: .85rem;
  color: var(--ink-soft);
  margin-top: 10px;
  text-align: center;
}
.geo-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.fact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.fact-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
  color: var(--terra-deep);
}
.fact-card h3 svg { width: 18px; height: 18px; flex: none; color: var(--gold-deep); }
.fact-card p { font-size: .95rem; color: var(--ink-soft); }
.fact-card p strong { color: var(--ink); }

.split-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 36px;
}
.group-panel {
  border-radius: var(--radius);
  padding: 22px 24px;
  border: 1px solid var(--line);
}
.group-mainland { background: var(--terra-tint); border-color: #EBD3C4; }
.group-island { background: var(--teal-tint); border-color: #CFE0DD; }
.group-panel h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.group-panel h3 small { font-weight: 400; color: var(--ink-soft); }
.chip-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  list-style: none;
}
.chip-list li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: .9rem;
  font-weight: 500;
}
.chip-list li.dual { border-style: dashed; color: var(--ink-soft); }
.footnote { font-size: .88rem; color: var(--ink-soft); margin-top: 12px; font-style: italic; }

.terrain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.terrain-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease-out, box-shadow .25s ease-out;
}
.terrain-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.terrain-card figure { aspect-ratio: 16 / 9; overflow: hidden; }
.terrain-card img { width: 100%; height: 100%; object-fit: cover; }
.terrain-body { padding: 18px 20px 20px; }
.terrain-tag {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-tint);
  border-radius: 999px;
  padding: 2px 12px;
  margin-bottom: 8px;
}
.terrain-body h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.terrain-body p { font-size: .94rem; color: var(--ink-soft); }

.monsoon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.monsoon-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.monsoon-sw { border-top-color: var(--terra); }
.monsoon-ne { border-top-color: var(--teal); }
.monsoon-res { border-top-color: var(--gold); }
.monsoon-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  margin-bottom: 12px;
  color: #fff;
}
.monsoon-sw .monsoon-icon { background: var(--terra); }
.monsoon-ne .monsoon-icon { background: var(--teal); }
.monsoon-res .monsoon-icon { background: var(--gold); }
.monsoon-icon svg { width: 22px; height: 22px; }
.monsoon-card h4 { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; }
.monsoon-period {
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 2px 0 8px;
}
.monsoon-card p:last-child { font-size: .95rem; color: var(--ink-soft); }
.monsoon-card strong { color: var(--ink); }

/* ---------------- Politics ---------------- */
.influence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.influence-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.influence-card p { font-size: .95rem; color: var(--ink-soft); }
.influence-card p strong { color: var(--ink); }
.influence-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 14px;
  margin-bottom: 10px;
  color: #fff;
}
.badge-india { background: var(--terra); }
.badge-china { background: var(--teal); }
.badge-islam { background: var(--gold-deep); }
.badge-west { background: #6B5D8C; }

.colonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}
.colonial-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.colonial-power {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--teal-deep);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.colonial-power svg { width: 18px; height: 18px; color: var(--gold-deep); flex: none; }
.colonial-card ul { list-style: none; }
.colonial-card li {
  font-size: .93rem;
  color: var(--ink-soft);
  padding: 4px 0 4px 16px;
  position: relative;
}
.colonial-card li::before {
  content: "";
  position: absolute; left: 0; top: 13px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.colonial-thai {
  background: linear-gradient(160deg, var(--gold-tint), #FBF3DF);
  border: 1.5px solid var(--gold);
}
.colonial-thai .colonial-power { color: var(--gold-deep); font-size: 1.15rem; }
.thai-note { font-size: .95rem; color: var(--ink); }

.postwar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.postwar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.postwar-card h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 8px;
}
.postwar-card p { font-size: .94rem; color: var(--ink-soft); }
.postwar-card strong { color: var(--ink); }
.num-dot {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  background: var(--terra);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  border-radius: 50%;
}

.gov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.gov-card {
  border-radius: var(--radius);
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.gov-card h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  display: flex; align-items: flex-start; gap: 9px;
  line-height: 1.45;
  margin-bottom: 4px;
}
.gov-card h4 svg { width: 20px; height: 20px; flex: none; margin-top: 3px; }
.gov-count {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.gov-king { border-top: 4px solid var(--terra); }
.gov-king h4 svg { color: var(--terra); }
.gov-king .gov-count { color: var(--terra-deep); }
.gov-president { border-top: 4px solid var(--teal); }
.gov-president h4 svg { color: var(--teal); }
.gov-president .gov-count { color: var(--teal); }
.gov-absolute { border-top: 4px solid var(--gold); }
.gov-absolute h4 svg { color: var(--gold-deep); }
.gov-absolute .gov-count { color: var(--gold-deep); }
.gov-socialist { border-top: 4px solid #A03A3A; }
.gov-socialist h4 svg { color: #A03A3A; }
.gov-socialist .gov-count { color: #A03A3A; }

/* ---------------- Economy ---------------- */
.eco-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: start;
}
.eco-img img { border-radius: var(--radius); border: 1px solid rgba(43,35,23,.14); box-shadow: var(--shadow-md); }
.eco-points { display: grid; gap: 16px; }
.eco-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.eco-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.eco-card p { font-size: .97rem; color: var(--ink-soft); }
.eco-card strong { color: var(--ink); }
.eco-pill {
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  background: var(--terra);
  border-radius: 999px;
  padding: 3px 12px;
}
.eco-card:nth-child(2) .eco-pill { background: var(--teal); }
.eco-card:nth-child(3) .eco-pill { background: var(--gold-deep); }

/* ---------------- Society ---------------- */
.soc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.soc-points { display: grid; gap: 16px; }
.soc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.soc-card h3 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  display: flex; align-items: flex-start; gap: 9px;
  margin-bottom: 8px;
}
.soc-card h3 svg { width: 19px; height: 19px; flex: none; margin-top: 3px; color: var(--terra); }
.soc-card p { font-size: .96rem; color: var(--ink-soft); }
.soc-card strong { color: var(--ink); }

.culture-quiz {
  background: linear-gradient(165deg, var(--surface), #FFFDF8);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-md);
}
.culture-quiz-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--terra-deep);
  margin-bottom: 4px;
}
.culture-hint { font-size: .88rem; color: var(--ink-soft); margin-bottom: 16px; }
.flip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.flip {
  position: relative;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-deep);
  cursor: pointer;
  font-family: var(--font-body);
  overflow: hidden;
  padding: 0;
  transition: box-shadow .2s ease-out, transform .2s ease-out;
}
.flip:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.flip-face {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 12px;
  text-align: center;
  transition: opacity .25s ease-out, transform .25s ease-out;
  border-radius: inherit;
}
.flip-front {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
}
.flip-back {
  background: var(--teal-deep);
  color: #F0EBDD;
  font-size: .9rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
}
.flip-back strong { color: #F3D98B; display: block; }
.flip[aria-pressed="true"] .flip-front { opacity: 0; transform: translateY(-8px); }
.flip[aria-pressed="true"] .flip-back { opacity: 1; transform: none; }
.flip-alt .flip-front { color: var(--terra-deep); }

/* ---------------- Ancient ---------------- */
.ancient-intro {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.ancient-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.ancient-tag {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 10px;
  background: var(--paper-deep);
  color: var(--ink-soft);
}
.ancient-card h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.ancient-card p { font-size: .95rem; color: var(--ink-soft); }
.ancient-card p strong { color: var(--ink); }
.card-india { border-top: 4px solid var(--terra); }
.card-india .ancient-tag { background: var(--terra-tint); color: var(--terra-deep); }
.card-china { border-top: 4px solid var(--teal); }
.card-china .ancient-tag { background: var(--teal-tint); color: var(--teal); }

.timeline {
  list-style: none;
  position: relative;
  padding-left: 0;
  max-width: 720px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 17px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--line);
}
.timeline-item {
  position: relative;
  padding: 0 0 26px 56px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: 8px; top: 6px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gold);
  border: 4px solid var(--paper-deep);
  box-shadow: 0 0 0 2px var(--gold);
}
.timeline-era {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  color: var(--terra-deep);
  margin-bottom: 4px;
}
.timeline-body h4 {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
}
.timeline-body p { font-size: .96rem; color: var(--ink-soft); }
.timeline-body strong { color: var(--ink); }

.influence-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 40px;
}
.influence-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.influence-panel h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--terra-tint);
}
.panel-china h3 { border-bottom-color: var(--teal-tint); }
.dot-list { list-style: none; }
.dot-list li {
  position: relative;
  padding: 6px 0 6px 24px;
  font-size: .98rem;
  color: var(--ink-soft);
}
.dot-list li strong { color: var(--ink); }
.dot-list li::before {
  content: "";
  position: absolute;
  left: 4px; top: 17px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--terra);
}
.panel-china .dot-list li::before { background: var(--teal); }

/* ---------------- Kingdoms accordion ---------------- */
.wide-figure { margin-bottom: 36px; }
.wide-figure img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid rgba(43,35,23,.14);
  box-shadow: var(--shadow-md);
}
.acc-list { display: grid; gap: 14px; }
.acc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.acc-heading { margin: 0; }
.acc-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: none;
  border: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  padding: 18px 22px;
  cursor: pointer;
  transition: background-color .2s ease-out;
}
.acc-btn:hover { background: var(--paper-deep); }
.acc-icon {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--terra-deep);
  transition: transform .25s ease-out, background-color .2s ease-out;
}
.acc-icon svg { width: 18px; height: 18px; }
.acc-btn[aria-expanded="true"] .acc-icon { transform: rotate(180deg); background: var(--terra); color: #fff; }
.acc-panel {
  padding: 4px 22px 20px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 16px;
  animation: fadeDown .25s ease-out;
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.kgd {
  padding: 14px 16px;
  background: var(--paper);
  border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0;
}
.kgd h4 { font-family: var(--font-display); font-size: 1.02rem; font-weight: 600; color: var(--terra-deep); }
.kgd-loc { font-size: .88rem; font-weight: 600; color: var(--teal); margin: 2px 0 6px; }
.kgd p:last-child { font-size: .95rem; color: var(--ink-soft); }
.kgd strong { color: var(--ink); }

.aspect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.aspect-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.aspect-card h4 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 10px;
}
.aspect-card h4 svg { width: 20px; height: 20px; color: var(--terra); flex: none; }
.aspect-card .dot-list li::before { background: var(--teal); }

/* ---------------- Modern ---------------- */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}
.pros, .cons {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.pros { border: 1.5px solid #BFDCB9; border-top: 5px solid #4F7D46; }
.cons { border: 1.5px solid #E8C6BC; border-top: 5px solid var(--terra); }
.pros h3, .cons h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 14px;
}
.pros h3 { color: #3C6534; }
.cons h3 { color: var(--terra-deep); }
.pros h3 svg, .cons h3 svg { width: 21px; height: 21px; flex: none; }
.pc-list { padding-left: 22px; display: grid; gap: 8px; }
.pc-list li { font-size: .97rem; color: var(--ink-soft); }
.pc-list li strong { color: var(--ink); }

.modern-aspects { display: grid; gap: 18px; }
.modern-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  display: flex; gap: 22px; align-items: center;
}
.modern-card figure { flex: none; width: 200px; }
.modern-card figure img { border-radius: var(--radius-sm); border: 1px solid var(--line); }
.modern-card h4 {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 6px;
}
.modern-card h4 svg { width: 19px; height: 19px; color: var(--terra); flex: none; }
.modern-card p { font-size: .97rem; color: var(--ink-soft); }
.modern-card strong { color: var(--ink); }

/* ---------------- Present / ASEAN (dark) ---------------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  background: rgba(255,255,255,.04);
}
.country-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: .95rem;
}
.country-table caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  color: #F3D98B;
  padding: 16px 18px 10px;
}
.country-table th, .country-table td {
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.1);
  vertical-align: top;
}
.country-table thead th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .04em;
  color: #F3D98B;
  background: rgba(255,255,255,.06);
}
.country-table tbody th { font-weight: 700; color: #fff; white-space: nowrap; }
.country-table td { color: #DDE7E1; }
.country-table tbody tr:hover { background: rgba(255,255,255,.05); }
.country-table tbody tr:last-child th, .country-table tbody tr:last-child td { border-bottom: 0; }

.asean-head {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 30px;
  align-items: center;
  margin: 44px 0 26px;
}
.asean-flag img {
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.asean-intro h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.asean-intro p { color: #D9E4DE; font-size: 1.04rem; }
.asean-intro strong { color: #F3D98B; }

.co-op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.coop-card {
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-sm);
  padding: 22px;
  transition: background-color .2s ease-out, transform .25s ease-out;
}
.coop-card:hover { background: rgba(255,255,255,.09); transform: translateY(-3px); }
.coop-card h4 {
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 600;
  color: #fff;
  display: flex; align-items: flex-start; gap: 9px;
  margin-bottom: 8px;
}
.coop-card h4 svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: #F3D98B; }
.coop-card p { font-size: .95rem; color: #CFDCD5; }
.coop-card strong { color: #F3D98B; }

/* ---------------- Heritage ---------------- */
.heritage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.heritage-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease-out, box-shadow .25s ease-out;
}
.heritage-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.heritage-card figure { aspect-ratio: 16 / 9; overflow: hidden; }
.heritage-card img { width: 100%; height: 100%; object-fit: cover; }
.heritage-body { padding: 18px 22px 22px; }
.heritage-place {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--teal);
}
.heritage-body h3 {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  margin: 4px 0 6px;
}
.heritage-body h3 small { font-weight: 400; font-size: .85rem; color: var(--ink-soft); }
.heritage-body p { font-size: .95rem; color: var(--ink-soft); margin-bottom: 10px; }
.heritage-body p strong { color: var(--ink); }
.heritage-year {
  display: inline-block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--gold-deep);
  background: var(--gold-tint);
  border-radius: 999px;
  padding: 3px 14px;
}

/* ---------------- Quiz ---------------- */
.quiz-container { max-width: 860px; }
.quiz-score {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--terra-deep);
  background: var(--surface);
  border: 1.5px solid var(--terra);
  border-radius: 999px;
  padding: 6px 20px;
}
.quiz-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.quiz-item h3 {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 16px;
  display: flex; gap: 10px; align-items: baseline;
}
.q-no {
  flex: none;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
  background: var(--teal);
  border-radius: 999px;
  padding: 3px 13px;
}
.quiz-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.choice {
  font-family: var(--font-body);
  font-size: .97rem;
  color: var(--ink);
  text-align: left;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color .15s ease-out, background-color .15s ease-out, transform .15s ease-out;
}
.choice:hover { border-color: var(--terra); transform: translateY(-1px); }
.choice.correct {
  background: #EDF6E8;
  border-color: #4F7D46;
  color: #2E4D28;
  font-weight: 600;
}
.choice.wrong {
  background: #FBEAE5;
  border-color: #C05621;
  color: #7A3211;
}
.quiz-choices.answered .choice { cursor: default; pointer-events: none; opacity: .75; }
.quiz-choices.answered .choice.correct { opacity: 1; }
.quiz-explain {
  margin-top: 14px;
  background: var(--gold-tint);
  border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  font-size: .95rem;
  color: var(--ink);
  animation: fadeDown .25s ease-out;
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: #241C11;
  color: #C9BFA9;
  padding: 44px 0 50px;
  font-size: .93rem;
}
.footer-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: #F0E8D5;
  margin-bottom: 8px;
}
.footer-inner { display: grid; gap: 6px; }
.site-footer a { color: #E3C878; }
.footer-credit { margin-top: 10px; font-size: .85rem; }

/* ---------------- Reveal on scroll ---------------- */
.reveal { opacity: 0; transform: translateY(24px); }
.reveal.visible {
  opacity: 1; transform: none;
  transition: opacity .5s ease-out, transform .5s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .geo-top { grid-template-columns: 1fr; }
  .eco-grid, .soc-grid, .influence-detail, .pros-cons { grid-template-columns: 1fr; }
  .ancient-intro { grid-template-columns: 1fr; }
  .split-groups { grid-template-columns: 1fr; }
  .asean-head { grid-template-columns: 1fr; }
  .asean-flag { max-width: 420px; }
}
@media (max-width: 640px) {
  .section { padding: 60px 0; }
  .hero { padding: 40px 0 32px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .topbar-inner { flex-wrap: wrap; gap: 8px; }
  .site-nav { flex-basis: 100%; position: relative; }
  .site-nav::after {
    content: "";
    position: absolute; right: 0; top: 0; bottom: 0; width: 34px;
    background: linear-gradient(to left, #FAF5EC, rgba(250, 245, 236, 0));
    pointer-events: none;
  }
  .nav-links { justify-content: flex-start; padding-right: 8px; }
  .brand span { font-size: .95rem; }
  .geo-facts { grid-template-columns: 1fr; }
  .modern-card { flex-direction: column; align-items: flex-start; }
  .modern-card figure { width: 100%; }
  .quiz-item { padding: 20px 18px; }
  .quiz-choices { grid-template-columns: 1fr; }
}
