/* ================================================================
   shared-v2.css — Indonesian NAATI design system
   Editorial style: DM Sans + Newsreader + JetBrains Mono
   Accent: terracotta #b4471f  |  Background: warm cream
   ================================================================ */

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== DESIGN TOKENS ===== */
:root {
  /* Typography */
  --sans:  'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --serif: 'Newsreader', Georgia, serif;
  --mono:  'JetBrains Mono', 'Fira Mono', monospace;

  /* Ink (text) */
  --ink:      #14222f;
  --ink-2:    #2c3e50;
  --ink-soft: #6b7a86;

  /* Paper (backgrounds) */
  --paper:   #f7f3eb;
  --paper-3: #f0ebe0;
  --white:   #ffffff;

  /* Rules (borders) */
  --rule:      #ddd9d0;
  --rule-soft: #e8e4da;

  /* Accent (terracotta) */
  --accent:      #b4471f;
  --accent-soft: #d4694a;

  /* Semantic (backward-compat with old shared.css) */
  --primary:       #b4471f;
  --primary-light: #d4694a;
  --primary-dark:  #14222f;
  --bg:            #f7f3eb;
  --card:          #ffffff;
  --text:          #14222f;
  --muted:         #6b7a86;
  --border:        #ddd9d0;
  --radius:        12px;
  --shadow:        0 1px 3px rgba(20,34,47,0.06), 0 4px 16px -4px rgba(20,34,47,0.12);
  --shadow-lg:     0 8px 32px -8px rgba(20,34,47,0.18);

  /* Misc */
  --green: #2e6f4a;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --ink:      #e8e4da;
  --ink-2:    #c8c2b4;
  --ink-soft: #8a8278;
  --paper:    #0f1a22;
  --paper-3:  #141f28;
  --white:    #1a2530;
  --rule:     #263340;
  --rule-soft:#1e2c38;
  --accent:      #d4694a;
  --accent-soft: #e88a6a;
  --primary:       #d4694a;
  --primary-light: #e88a6a;
  --primary-dark:  #e8e4da;
  --bg:    #0f1a22;
  --card:  #1a2530;
  --text:  #e8e4da;
  --muted: #8a8278;
  --border:#263340;
}

[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] .topbar { background: #141f28; border-color: #263340; }
[data-theme="dark"] .mobile-nav { background: #141f28; border-color: #263340; }
[data-theme="dark"] .mobile-nav a { border-color: #263340; }
[data-theme="dark"] .brand-name { color: var(--ink); }
[data-theme="dark"] .nav a { color: var(--ink-soft); }
[data-theme="dark"] .nav a:hover, [data-theme="dark"] .nav a.active { color: var(--ink); }
[data-theme="dark"] .btn-ghost { color: var(--ink-2); border-color: var(--rule); }
[data-theme="dark"] .btn-ink { background: var(--paper); color: #14222f; border-color: var(--paper); }
[data-theme="dark"] .btn-ink:hover { background: var(--rule-soft); border-color: var(--rule-soft); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.3); }
[data-theme="dark"] .site-foot { background: #090f14; border-color: #1e2c38; }
[data-theme="dark"] .site-foot-bottom { border-color: #1e2c38; }
[data-theme="dark"] .page-hero { background: var(--paper-3); border-color: var(--rule); }
[data-theme="dark"] .stats-strip { background: var(--paper-3); border-color: var(--rule); }
[data-theme="dark"] .scoring { background: var(--paper-3); border-color: var(--rule); }
/* Cards */
[data-theme="dark"] .card { background: var(--card); border-color: var(--rule); }
[data-theme="dark"] .overview-card { background: var(--card); border-color: var(--rule); }
[data-theme="dark"] .tip-item { background: var(--card); border-color: var(--rule); }
[data-theme="dark"] .official-link-item { border-color: var(--rule); }
[data-theme="dark"] .faq-list { background: var(--card); border-color: var(--rule); }
[data-theme="dark"] .faq-item { border-color: var(--rule); }
[data-theme="dark"] .faq-question:hover { background: var(--paper-3); }
[data-theme="dark"] .offer-card { background: var(--card); border-color: var(--rule); }
[data-theme="dark"] .overview-table td { border-color: var(--rule); }
[data-theme="dark"] .story-aside { background: var(--card); border-color: var(--rule); }
[data-theme="dark"] h1, [data-theme="dark"] h2,
[data-theme="dark"] h3, [data-theme="dark"] h4 { color: var(--ink); }
[data-theme="dark"] .section-title { color: var(--ink); }
/* History page */
[data-theme="dark"] .session-card { background: var(--card); border-color: var(--rule); }
/* Auth page */
[data-theme="dark"] .auth-page { background: var(--bg); }
[data-theme="dark"] .auth-card { background: var(--card); border-color: var(--rule); }
[data-theme="dark"] .auth-input { background: var(--paper-3); border-color: var(--rule); color: var(--ink); }
[data-theme="dark"] .auth-input::placeholder { color: var(--ink-soft); }
[data-theme="dark"] .btn-google { background: var(--paper-3); border-color: var(--rule); color: var(--ink); }

/* ===== GLOBAL TYPOGRAPHY ===== */
/* Marketing pages: headings use Newsreader serif */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
}
/* Preserve legibility — if a page sets font-weight: 700+ and only 400/500/600 are loaded,
   the browser maps 700 → 600 which looks fine in Newsreader */

/* ===== BASE ===== */
/* Both html + body — iOS Safari ignores overflow-x on body alone */
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

.hidden { display: none !important; }

/* ===== LAYOUT ===== */
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 720px) {
  .wrap { padding: 0 20px; }
}

/* ===== TOPBAR / NAV ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  transition: box-shadow 0.2s;
}

.topbar.scrolled {
  box-shadow: 0 2px 20px rgba(20,34,47,0.08);
}

.topbar-inner {
  display: flex;
  align-items: center;
  height: 68px;
  gap: 32px;
}

/* Brand / Logo */
.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
}

.brand-name {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand-name em {
  font-style: italic;
  color: var(--accent);
}

.brand-sub {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Nav links */
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  justify-content: center;
  list-style: none;
}

.nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

.nav a:hover,
.nav a.active {
  color: var(--ink);
}

/* Nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.2s;
}

/* Mobile nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 12px 20px 20px;
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule-soft);
  transition: color 0.15s;
}

.mobile-nav a:hover,
.mobile-nav a.active { color: var(--accent); }

.mobile-nav-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
  border: none;
  white-space: nowrap;
  letter-spacing: -0.005em;
}

.btn-ink {
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid var(--ink);
}

.btn-ink:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(20,34,47,0.22);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--rule);
}

.btn-ghost:hover {
  border-color: var(--ink);
  background: rgba(20,34,47,0.04);
}

.btn-paper {
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--rule);
}

.btn-paper:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 13px 30px;
  font-size: 0.95rem;
  border-radius: 9px;
}

/* Backward-compat button names */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1.5px solid var(--accent);
}
.btn-primary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(180,71,31,0.3);
}
.btn-secondary {
  background: var(--rule-soft);
  color: var(--ink);
  border: 1.5px solid var(--rule);
}
.btn-secondary:hover {
  background: var(--rule);
}

/* ===== NAV BACKWARD-COMPAT ===== */
/* Some pages still use old site-nav / nav-btn classes */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 68px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  gap: 24px;
  transition: box-shadow 0.2s;
}
.site-nav.scrolled { box-shadow: 0 2px 20px rgba(20,34,47,0.08); }
.nav-logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
}
.logo-main {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.logo-main em { font-style: italic; color: var(--accent); }
.logo-sub {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  flex: 1;
  justify-content: center;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}
.nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 12px 24px 20px;
}
.nav-mobile.open {
  display: flex;
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  z-index: 99;
  max-height: calc(100vh - 68px);
  overflow-y: auto;
}
.nav-mobile a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule-soft);
  transition: color 0.15s;
}
.nav-mobile a:hover, .nav-mobile a.active { color: var(--accent); }
.nav-mobile .nav-mobile-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.nav-btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.nav-btn-ghost:hover { border-color: var(--ink); background: rgba(20,34,47,0.04); }
.nav-btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.nav-btn-primary:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(20,34,47,0.22);
}

/* ===== PAGE HERO ===== */
.page-hero {
  background: var(--paper-3);
  border-bottom: 1px solid var(--rule);
  padding: 40px 0 36px;
}

.page-hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
}

.page-hero-eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 14px;
}

.page-hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 16px;
  text-wrap: balance;
}

.page-hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.page-hero-sub {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 560px;
}

.page-hero-aside {
  display: flex;
  gap: 28px;
  flex-shrink: 0;
  padding-left: 40px;
  border-left: 1px solid var(--rule);
}

.page-hero-aside > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.page-hero-aside strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2rem;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
}

.ph-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Old page-hero styles for backward compat */
.page-hero-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ===== TYPOGRAPHY UTILITIES ===== */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.section-eyebrow::before {
  content: "";
  display: block;
  width: 20px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  letter-spacing: -0.018em;
  line-height: 1.12;
  color: var(--ink);
  margin-bottom: 18px;
  text-wrap: balance;
}

.section-title em { font-style: italic; color: var(--accent); }

.section-sub {
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: 36px;
}

/* ===== SECTION / PAGE-CONTENT ===== */
.section {
  padding: 56px 0;
}

.section:last-child { padding-bottom: 0; }

.page-content {
  max-width: 1160px;
  margin: 0 auto;
  padding: 44px 40px;
}

/* ===== CARD ===== */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

/* ===== CTA STRIP ===== */
.cta-strip {
  background: var(--ink);
  border-radius: var(--radius);
  padding: 44px 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 60px;
}

.cta-strip h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.012em;
  color: var(--paper);
  margin-bottom: 8px;
}

.cta-strip h3 em { font-style: italic; color: var(--accent-soft); }

.cta-strip p {
  font-size: 0.95rem;
  color: rgba(247,243,235,0.65);
  line-height: 1.6;
}

/* ===== BTN-CTA (backward-compat) ===== */
.btn-cta {
  display: inline-flex;
  align-items: center;
  padding: 13px 30px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.18s;
  cursor: pointer;
  border: none;
  font-family: var(--sans);
}
.btn-cta:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(180,71,31,0.35);
}

/* ===== GRID HELPERS ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

/* ===== FOOTER ===== */
.site-foot {
  background: var(--ink);
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 80px;
}

.site-foot-inner {
  display: flex;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 36px;
  flex-wrap: wrap;
}

.site-foot-brand-block {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-foot-brand-block .brand-name,
.site-foot-brand-block .logo-main {
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--paper);
  letter-spacing: -0.01em;
}

.site-foot-brand-block .brand-name em,
.site-foot-brand-block .logo-main em {
  font-style: italic;
  color: var(--accent-soft);
}

.site-foot-brand-block .brand-sub,
.site-foot-brand-block .logo-sub {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247,243,235,0.4);
  margin-bottom: 14px;
}

.site-foot-blurb {
  font-size: 0.85rem;
  color: rgba(247,243,235,0.45);
  line-height: 1.6;
  max-width: 280px;
  margin-top: 8px;
}

.site-foot-cols {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.site-foot-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 100px;
}

.site-foot-col h5 {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247,243,235,0.4);
  margin-bottom: 4px;
}

.site-foot-col a {
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(247,243,235,0.65);
  text-decoration: none;
  transition: color 0.15s;
}

.site-foot-col a:hover { color: var(--paper); }

.site-foot-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 20px;
  padding-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.site-foot-bottom span {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247,243,235,0.3);
}

/* Old footer backward-compat */
.site-footer {
  background: var(--ink);
  color: rgba(247,243,235,0.7);
  padding: 36px 0;
  margin-top: 80px;
}

.site-footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer p { font-size: 0.88rem; color: rgba(247,243,235,0.5); }
.site-footer p a { color: rgba(247,243,235,0.5); }

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

.site-footer-links a {
  color: rgba(247,243,235,0.55);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}
.site-footer-links a:hover { color: var(--paper); }

/* ===== THEME SWITCHER ===== */
.theme-switcher { position: relative; }
.theme-switcher-btn {
  display: flex; align-items: center; gap: 6px;
  background: none;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: border-color 0.15s;
  white-space: nowrap;
}
.theme-switcher-btn:hover { border-color: var(--ink); }
.theme-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20,34,47,0.12);
  overflow: hidden;
  min-width: 120px;
  z-index: 200;
}
.theme-switcher.open .theme-dropdown-menu { display: block; }
.theme-option {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 14px;
  background: none; border: none;
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500;
  color: var(--ink);
  cursor: pointer; transition: background 0.15s; text-align: left;
}
.theme-option:hover { background: var(--paper-3); }
.theme-option.active { color: var(--accent); font-weight: 700; }
[data-theme="dark"] .theme-dropdown-menu { background: var(--white); border-color: var(--rule); }
[data-theme="dark"] .theme-option { color: var(--ink); }
[data-theme="dark"] .theme-option:hover { background: var(--paper-3); }

/* ===== LANG SWITCHER ===== */
.lang-switcher { position: relative; }
.lang-switcher-btn {
  display: flex; align-items: center; gap: 6px;
  background: none;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer; font-family: var(--sans);
  transition: border-color 0.15s;
  white-space: nowrap;
}
.lang-switcher-btn:hover { border-color: var(--ink); }
.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20,34,47,0.12);
  overflow: hidden;
  min-width: 150px;
  z-index: 200;
}
.lang-switcher.open .lang-dropdown-menu { display: block; }
.lang-option {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 14px;
  background: none; border: none;
  font-size: 0.875rem; color: var(--ink);
  cursor: pointer; transition: background 0.15s; text-align: left;
  font-family: var(--sans);
}
.lang-option:hover { background: var(--paper-3); }
.lang-option.active { color: var(--accent); font-weight: 700; }
[data-theme="dark"] .lang-dropdown-menu { background: var(--white); border-color: var(--rule); }
[data-theme="dark"] .lang-option { color: var(--ink); }
[data-theme="dark"] .lang-option:hover { background: var(--paper-3); }

/* ===== RESPONSIVE ===== */

/* Hide optional nav items early to prevent overflow */
@media (max-width: 1100px) {
  .theme-switcher, .lang-switcher { display: none !important; }
}

/* Tablet (~900px) */
@media (max-width: 900px) {
  .wrap { padding: 0 24px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .page-hero-grid { grid-template-columns: 1fr; }
  .page-hero-aside {
    flex-direction: row;
    border-left: none;
    border-top: 1px solid var(--rule);
    padding-left: 0;
    padding-top: 20px;
    justify-content: flex-start;
  }
  /* Nav */
  .site-nav { padding: 0 20px; }
  .nav-links, .nav-actions { display: none; }
  .nav-hamburger { display: flex; }
  /* Spacing */
  .page-hero { padding: 32px 0 28px; }
  .page-hero-inner { padding: 0 20px; }
  .page-content { padding: 32px 20px; }
  .section { padding: 44px 0; }
  .card { padding: 20px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  /* Footer */
  .site-footer { padding: 28px 0; margin-top: 48px; }
  .site-footer-inner { padding: 0 20px; flex-direction: column; align-items: flex-start; }
  .site-foot-inner { padding-top: 36px; padding-bottom: 24px; gap: 28px; flex-direction: column; }
  .site-foot-cols { flex-direction: row; flex-wrap: wrap; gap: 24px 36px; }
  .site-foot-col { min-width: 100px; }
  /* CTA */
  .cta-strip { padding: 28px 24px; flex-direction: column; align-items: flex-start; }
}

/* Large phones */
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .topbar-inner { height: 60px; }
  .nav { display: none; }
  .hamburger { display: flex; }
  .nav-actions { display: none; }
  /* Mobile nav buttons: full width */
  .mobile-nav-actions { flex-direction: column; }
  .mobile-nav-actions .nav-btn,
  .nav-mobile-actions .nav-btn { width: 100%; text-align: center; justify-content: center; }
}

/* Small phones (375–480px) */
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .nav-logo .logo-sub,
  .brand .brand-sub { display: none; }
  .page-hero h1 { font-size: 1.65rem; }
  .page-hero-sub { font-size: 0.95rem; }
  /* Footer: stack brand then 2-col then 1-col links */
  .site-foot-cols { gap: 20px 24px; }
  .site-foot-col { min-width: 110px; }
  /* Stats: center single-column items */
  .stat-v2 { align-items: center; text-align: center; }
  /* Section title */
  .section-title { font-size: 1.5rem; }
  /* CTA strip */
  .cta-strip { padding: 24px 20px; }
  .cta-strip h3 { font-size: 1.25rem; }
}
