/* ==========================================================================
   WORLD REMIX (yannis.website) - Production Stylesheet
   Aesthetic Direction: Tactile Cartographic Studio & Atlas Atelier
   ========================================================================== */

:root {
  /* Light Theme: Vellum & Brass Atlas */
  --bg-primary: #F5F0E6;
  --bg-secondary: #EBE4D5;
  --bg-surface: #FAF7F0;
  --bg-elevated: #FFFFFF;
  --bg-ocean: #D6E5EA;
  --bg-ocean-deep: #C4D9E0;
  --graticule-line: rgba(29, 107, 115, 0.16);
  --land-default: #EDE8DC;
  --land-hover: #DFD6C3;
  --land-stroke: #7A705E;
  --ink-primary: #181613;
  --ink-secondary: #4E483E;
  --ink-muted: #787062;
  --border-ink: #2C2822;
  --border-subtle: #CFC6B4;
  --accent-vermilion: #D94E34;
  --accent-vermilion-fg: #FFFFFF;
  --accent-teal: #1D6B73;
  --accent-teal-fg: #FFFFFF;
  --accent-ochre: #C88A2B;
  --accent-indigo: #5A4A8C;
  --accent-emerald: #1F7A4C;
  --shadow-hard: 3px 3px 0px #2C2822;
  --shadow-hard-sm: 2px 2px 0px #2C2822;
  --font-serif: 'Fraunces', 'Playfair Display', 'Georgia', Cambria, serif;
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --header-h: 64px;
}

[data-theme="dark"] {
  /* Dark Theme: Nocturnal Observatory */
  --bg-primary: #0D131A;
  --bg-secondary: #131C26;
  --bg-surface: #17222E;
  --bg-elevated: #1E2C3B;
  --bg-ocean: #091017;
  --bg-ocean-deep: #060B10;
  --graticule-line: rgba(44, 224, 200, 0.11);
  --land-default: #1A2634;
  --land-hover: #253649;
  --land-stroke: #3D5269;
  --ink-primary: #F2EFE9;
  --ink-secondary: #B0BECF;
  --ink-muted: #7B8DA1;
  --border-ink: #3E546B;
  --border-subtle: #253545;
  --accent-vermilion: #FF6B4A;
  --accent-vermilion-fg: #0D131A;
  --accent-teal: #2CE0C8;
  --accent-teal-fg: #0D131A;
  --accent-ochre: #F6B93B;
  --accent-indigo: #A57CFF;
  --accent-emerald: #34D399;
  --shadow-hard: 3px 3px 0px #05080C;
  --shadow-hard-sm: 2px 2px 0px #05080C;
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-primary);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Skip Link for Keyboard Accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent-vermilion);
  color: #fff;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.875rem;
  z-index: 9999;
  text-decoration: none;
  border: 2px solid var(--border-ink);
}
.skip-link:focus {
  top: 12px;
}

/* Typography */
h1, h2, h3, h4, .serif-heading {
  font-family: var(--font-serif);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

a {
  color: var(--accent-vermilion);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent-teal);
}

/* Architectural Top Navigation Bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border-ink);
  min-height: var(--header-h);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-primary);
  flex-shrink: 0;
}
.brand-link:hover {
  color: var(--ink-primary);
}
.brand-link svg {
  height: 42px;
  width: auto;
  max-width: 240px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-primary);
  text-decoration: none;
  padding: 8px 12px;
  border: 1.5px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link[aria-current="page"],
.nav-link.active {
  background: var(--bg-secondary);
  border-color: var(--border-ink);
  color: var(--accent-vermilion);
}

.header-utilities {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tactile Buttons (Zero Pill Clichés - Crisp Architectural Corners) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 9px 14px;
  min-height: 40px;
  background: var(--bg-elevated);
  color: var(--ink-primary);
  border: 1.5px solid var(--border-ink);
  box-shadow: var(--shadow-hard-sm);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.15s ease;
  user-select: none;
}
.btn:hover {
  background: var(--bg-secondary);
  color: var(--ink-primary);
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-hard);
}
.btn:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}
.btn:focus-visible {
  outline: 2px solid var(--accent-vermilion);
  outline-offset: 2px;
}
.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--accent-vermilion);
  color: #FFFFFF;
}
[data-theme="dark"] .btn-primary {
  color: #0D131A;
}
.btn-primary:hover {
  background: #c03d24;
  color: #FFFFFF;
}
[data-theme="dark"] .btn-primary:hover {
  background: #ff8266;
  color: #0D131A;
}

.btn-teal {
  background: var(--accent-teal);
  color: #FFFFFF;
}
[data-theme="dark"] .btn-teal {
  color: #0D131A;
}
.btn-teal:hover {
  filter: brightness(1.08);
  color: #FFFFFF;
}
[data-theme="dark"] .btn-teal:hover {
  color: #0D131A;
}

.btn-icon {
  padding: 8px 10px;
  min-width: 40px;
}

.mobile-menu-btn {
  display: none;
}

/* ==========================================================================
   GAME WORKSPACE LAYOUT (Country Fusion Studio)
   ========================================================================== */
.studio-shell {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(350px, 0.95fr);
  gap: 16px;
  align-items: start;
}

/* Left Column: Interactive Cartographic Viewport */
.map-deck {
  background: var(--bg-surface);
  border: 2px solid var(--border-ink);
  box-shadow: var(--shadow-hard);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-toolbar {
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-bottom: 1.5px solid var(--border-ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.search-box-wrap {
  position: relative;
  flex: 1 1 240px;
  min-width: 180px;
}

.country-search-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 34px 8px 12px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  background: var(--bg-elevated);
  color: var(--ink-primary);
  border: 1.5px solid var(--border-ink);
}
.country-search-input:focus {
  outline: 2px solid var(--accent-vermilion);
  outline-offset: -1px;
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 2px solid var(--border-ink);
  box-shadow: var(--shadow-hard);
  z-index: 150;
  list-style: none;
}
.search-results-dropdown[hidden] {
  display: none !important;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 0.875rem;
}
.search-result-item:hover,
.search-result-item:focus,
.search-result-item.highlighted {
  background: var(--bg-secondary);
  outline: none;
}
.search-result-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.search-result-flag {
  width: 24px;
  height: 18px;
  object-fit: contain;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* Interactive Map Canvas Container */
.map-viewport {
  position: relative;
  width: 100%;
  height: 480px;
  background: radial-gradient(circle at 50% 45%, var(--bg-ocean) 0%, var(--bg-ocean-deep) 100%);
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.world-map-svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
.world-map-svg:active {
  cursor: grabbing;
}

.graticule-path {
  fill: none;
  stroke: var(--graticule-line);
  stroke-width: 0.6;
  vector-effect: non-scaling-stroke;
}

.country-path {
  fill: var(--land-default);
  stroke: var(--land-stroke);
  stroke-width: 0.65;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 0.14s ease;
}
.country-path:hover,
.country-path:focus {
  fill: var(--land-hover);
  stroke: var(--ink-primary);
  stroke-width: 1.3;
  outline: none;
}

/* Selected Slots on Map */
.country-path.selected-slot-0 {
  fill: var(--accent-vermilion) !important;
  stroke: #FFFFFF !important;
  stroke-width: 1.5;
}
.country-path.selected-slot-1 {
  fill: var(--accent-teal) !important;
  stroke: #FFFFFF !important;
  stroke-width: 1.5;
}
.country-path.selected-slot-2 {
  fill: var(--accent-ochre) !important;
  stroke: #FFFFFF !important;
  stroke-width: 1.5;
}
.country-path.selected-slot-n {
  fill: var(--accent-indigo) !important;
  stroke: #FFFFFF !important;
  stroke-width: 1.5;
}

/* Microstate / Island Nation Selectable Beacons */
.microstate-marker {
  fill: var(--bg-surface);
  stroke: var(--border-ink);
  stroke-width: 1.1;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
}
.microstate-marker:hover {
  fill: var(--accent-ochre);
  r: 4.5px;
}
.microstate-marker.selected-slot-0 { fill: var(--accent-vermilion); }
.microstate-marker.selected-slot-1 { fill: var(--accent-teal); }
.microstate-marker.selected-slot-2 { fill: var(--accent-ochre); }
.microstate-marker.selected-slot-n { fill: var(--accent-indigo); }

/* Geodesic Connection Arc on Real Map */
.fusion-geodesic-arc {
  fill: none;
  stroke: var(--accent-vermilion);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

/* Floating Map Controls Overlay */
.map-hud-controls {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 25;
}

.map-coords-readout {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-ink);
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-secondary);
  pointer-events: none;
  z-index: 25;
}

/* Floating Hover Tooltip */
.map-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--bg-elevated);
  color: var(--ink-primary);
  border: 2px solid var(--border-ink);
  box-shadow: var(--shadow-hard-sm);
  padding: 8px 10px;
  z-index: 90;
  min-width: 170px;
  max-width: 240px;
  font-size: 0.8rem;
}
.map-tooltip[hidden] {
  display: none !important;
}
.tooltip-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-weight: 700;
}
.tooltip-flag {
  width: 26px;
  height: 19px;
  object-fit: contain;
  border: 1px solid var(--border-subtle);
}
.tooltip-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-secondary);
}

/* Selected Constituent Strip below Map */
.selection-tray {
  padding: 10px 12px;
  background: var(--bg-surface);
  border-top: 1.5px solid var(--border-ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.selected-chips-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.country-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}
.country-chip img {
  width: 22px;
  height: 16px;
  object-fit: contain;
  border: 1px solid var(--border-subtle);
}
.chip-remove-btn {
  background: none;
  border: none;
  color: var(--ink-secondary);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}
.chip-remove-btn:hover {
  color: var(--accent-vermilion);
}

/* ==========================================================================
   RIGHT COLUMN: FUSION CHARTER & SYNTHESIS PANEL
   ========================================================================== */
.fusion-charter {
  background: var(--bg-surface);
  border: 2px solid var(--border-ink);
  box-shadow: var(--shadow-hard);
  display: flex;
  flex-direction: column;
}

.charter-header {
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.charter-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Fused Nation Title Banner */
.fused-identity-banner {
  border: 1.5px solid var(--border-ink);
  background: var(--bg-elevated);
  padding: 14px;
  position: relative;
}

.fused-nation-name {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  color: var(--ink-primary);
  word-break: break-word;
  margin: 4px 0;
}

.fused-subtitle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-teal);
  font-weight: 600;
}

/* Dual Visual Grid: Generated Flag + Fictional Composite Silhouette */
.visual-synthesis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.synthesis-frame {
  border: 1.5px solid var(--border-ink);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
}

.frame-top-bar {
  padding: 6px 10px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.frame-stage {
  padding: 12px;
  min-height: 155px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(120, 112, 98, 0.05) 8px,
    rgba(120, 112, 98, 0.05) 16px
  );
}

.generated-flag-wrap svg,
.silhouette-stage-wrap svg {
  width: 100%;
  max-width: 210px;
  height: auto;
  display: block;
  border: 1.5px solid var(--border-ink);
  box-shadow: var(--shadow-hard-sm);
}

.silhouette-stage-wrap svg {
  background: var(--bg-ocean);
}

.frame-footnote {
  padding: 6px 10px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* Architectural Statistics Ledger Table */
.stats-ledger {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid var(--border-ink);
  background: var(--bg-elevated);
  font-size: 0.85rem;
}
.stats-ledger th,
.stats-ledger td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}
.stats-ledger th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--ink-secondary);
  background: var(--bg-secondary);
  width: 42%;
}
.stats-ledger td {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink-primary);
}
.stat-source-note {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* Constituent Breakdown Cards */
.constituents-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.constituent-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-ink);
}
.constituent-row img {
  width: 36px;
  height: 27px;
  object-fit: contain;
  border: 1px solid var(--border-subtle);
}

/* Action Bar (Share, Export PNG, Export SVG, Save) */
.charter-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* Saved Creations Shelf */
.saved-shelf {
  margin-top: 8px;
  border-top: 1.5px solid var(--border-ink);
  padding-top: 12px;
}
.saved-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.saved-item-card {
  padding: 8px 10px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.saved-item-card:hover {
  background: var(--bg-secondary);
}

/* ==========================================================================
   DAILY WORLD CHALLENGE ARENA
   ========================================================================== */
.challenge-banner {
  max-width: 1440px;
  margin: 12px auto 0;
  padding: 0 16px;
}
.challenge-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-ink);
  box-shadow: var(--shadow-hard);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}
.score-meter-wrap {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-ink);
  padding: 12px 16px;
  text-align: center;
  min-width: 180px;
}
.score-big-num {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-vermilion);
  line-height: 1;
}

/* ==========================================================================
   EDITORIAL & INFORMATION PAGES (About, How to Play, Legal, Sources, 404)
   ========================================================================== */
.page-container {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.editorial-sheet {
  background: var(--bg-surface);
  border: 2px solid var(--border-ink);
  box-shadow: var(--shadow-hard);
  padding: clamp(20px, 4vw, 40px);
}

.editorial-sheet h1 {
  font-size: clamp(1.85rem, 3.5vw, 2.75rem);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-ink);
}
.editorial-sheet h2 {
  font-size: 1.4rem;
  margin: 28px 0 10px;
  color: var(--accent-teal);
}
.editorial-sheet h3 {
  font-size: 1.1rem;
  margin: 18px 0 8px;
}
.editorial-sheet p,
.editorial-sheet li {
  color: var(--ink-secondary);
  margin-bottom: 12px;
  font-size: 0.98rem;
}
.editorial-sheet ul,
.editorial-sheet ol {
  padding-left: 22px;
  margin-bottom: 16px;
}

.breadcrumb-nav {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  margin-bottom: 14px;
  color: var(--ink-muted);
}
.breadcrumb-nav a {
  color: var(--ink-secondary);
}

/* Hero Section on Homepage */
.hero-atlas {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 16px 8px;
}
.hero-strip {
  background: var(--bg-surface);
  border: 2px solid var(--border-ink);
  box-shadow: var(--shadow-hard);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 20px;
  align-items: center;
}
.hero-title {
  font-size: clamp(1.85rem, 3.6vw, 3rem);
  margin: 6px 0 10px;
}
.hero-tagline {
  font-size: 1.08rem;
  color: var(--ink-secondary);
  max-width: 64ch;
  margin-bottom: 16px;
}
.preset-recipes-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

/* ==========================================================================
   MONETIZATION READINESS: CLS-SAFE, NON-INTRUSIVE AD SLOTS
   ========================================================================== */
.ad-slot-wrapper {
  max-width: 1440px;
  width: 100%;
  margin: 20px auto;
  padding: 0 16px;
}
.ad-slot-box {
  width: 100%;
  min-height: 96px;
  background: var(--bg-secondary);
  border: 1.5px dashed var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.ad-slot-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: var(--ink-muted);
}

/* ==========================================================================
   TOAST NOTIFICATION & IN-PAGE MODAL
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast-msg {
  background: var(--ink-primary);
  color: var(--bg-primary);
  border: 2px solid var(--accent-vermilion);
  box-shadow: var(--shadow-hard);
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  pointer-events: auto;
}

/* Fusion Animation Pulse */
@keyframes fusionPulse {
  0% { transform: scale(0.96); opacity: 0.6; }
  50% { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.fusion-animate {
  animation: fusionPulse 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 2px solid var(--border-ink);
  padding: 28px 16px;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 24px;
}
.footer-col h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  color: var(--ink-primary);
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-links a {
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 0.86rem;
}
.footer-links a:hover {
  color: var(--accent-vermilion);
  text-decoration: underline;
}
.footer-bottom {
  max-width: 1440px;
  margin: 20px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (1024px, 768px, 390px, 375px, 320px)
   ========================================================================== */
@media (max-width: 1080px) {
  .studio-shell {
    grid-template-columns: 1fr;
  }
  .hero-strip {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: inline-flex;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 2px solid var(--border-ink);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px;
    box-shadow: var(--shadow-hard);
  }
  .main-nav.open {
    display: flex;
  }
  .map-viewport {
    height: 350px;
  }
  .challenge-card {
    grid-template-columns: 1fr;
  }
  .visual-synthesis-grid {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .header-inner {
    padding: 0 10px;
  }
  .brand-link svg {
    height: 34px;
    max-width: 175px;
  }
  .studio-shell {
    padding: 8px 10px;
  }
  .map-viewport {
    height: 300px;
  }
  .charter-actions-grid {
    grid-template-columns: 1fr;
  }
  .btn {
    padding: 8px 10px;
    font-size: 0.75rem;
  }
}

/* Custom SVG Icon Utilities & Flag Badges (Custom Vector Icons) */
.icon-svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: middle;
}
.btn-flag-pair {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-flag-img {
  width: 18px;
  height: 13px;
  object-fit: contain;
  border: 1px solid var(--border-subtle);
  display: inline-block;
}
.capital-city-dot {
  fill: var(--accent-ochre);
  stroke: var(--ink-primary);
  stroke-width: 0.9;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.capital-city-label {
  font-family: var(--font-mono);
  font-size: 6px;
  fill: var(--ink-primary);
  pointer-events: none;
  user-select: none;
}
/* GDPR / AdSense Cookie & Privacy Consent Bar */
.cookie-consent-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 850;
  background: var(--bg-surface);
  border-top: 2px solid var(--border-ink);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.18);
  padding: 12px 16px;
}
.cookie-consent-bar[hidden] {
  display: none !important;
}
.cookie-consent-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
}
