:root {
  color-scheme: dark;
  --bg: #303033;
  --bg-deep: #242426;
  --panel: #39393c;
  --panel-soft: #454548;
  --text: #f7f5ef;
  --muted: #c8c4bc;
  --line: rgba(255, 255, 255, 0.16);
  --accent: #f1a45b;
  --accent-strong: #ffbf7a;
  --danger: #f06f62;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --radius: 8px;
  --screen-pad-x: 6vw;
  --screen-pad-top: 42px;
  --panel-title-top: 52px;
  font-family: "Inter Tight", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(29, 29, 31, 0.34), transparent 36%, rgba(29, 29, 31, 0.24)),
    var(--bg);
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: var(--screen-pad-top) var(--screen-pad-x) 0;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.brand-button,
.admin-link,
.tab-button,
.close-detail,
.primary-button,
.secondary-button,
.danger-button,
.filter-button {
  border: 0;
  color: var(--text);
}

.brand-button {
  justify-self: start;
  background: transparent;
  padding: 0;
  font-weight: 500;
  font-size: clamp(1.8rem, 3vw, 3rem);
  letter-spacing: 0;
}

.section-tabs {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(22px, 4vw, 58px);
}

.tab-button {
  position: relative;
  background: transparent;
  padding: 8px 0 12px;
  color: rgba(255, 255, 255, 0.75);
  font-size: clamp(1.55rem, 2.7vw, 3rem);
  font-weight: 300;
}

.tab-button.active {
  color: var(--text);
  font-weight: 500;
}

.tab-button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: currentColor;
}

.admin-link {
  justify-self: end;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 44px;
  padding: 0 18px;
  opacity: 0.7;
}

.admin-link:hover {
  opacity: 1;
}

main {
  min-height: 100vh;
}

.global-stage,
.local-stage {
  display: none;
}

.global-stage.active,
.local-stage.active {
  display: block;
}

.map-panel {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.world-map {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform-origin: 0 0;
  --focus-scale: 1;
  --focus-shift-x: 0px;
  --focus-shift-y: 0px;
  transition: transform 650ms cubic-bezier(0.2, 0.9, 0.2, 1), opacity 450ms ease;
}

.map-panel[data-state="region"] .world-map {
  transform: translate(var(--focus-shift-x), var(--focus-shift-y)) scale(var(--focus-scale));
}

.map-art {
  width: min(94vw, 1740px);
  min-width: 900px;
  opacity: 0.95;
}

.country-map path {
  fill: #4b4b4d;
  stroke: #343437;
  stroke-width: 0.78;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.country-map path[data-country="aq"] {
  display: none;
}

.region-hotspot {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 260ms ease, opacity 260ms ease;
  outline: none;
}

.region-hotspot button,
.region-hotspot circle,
.country-hotspot circle {
  cursor: pointer;
}

.region-hotspot .bubble,
.country-hotspot .bubble {
  fill: url("#bubbleGradient");
  stroke: none;
  stroke-width: 0;
  filter: none;
}

.country-hotspot .bubble {
  filter: none;
}

.country-hotspot.selected .bubble {
  fill: rgba(255, 255, 255, 0.94);
  stroke: none;
  filter: none;
}

.region-hotspot .count {
  fill: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.region-hotspot:hover,
.region-hotspot:focus-within {
  transform: scale(1.05);
}

.map-panel[data-state="region"] .region-hotspot:not(.selected) {
  opacity: 0.18;
}

.country-hotspot {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 220ms ease;
  outline: none;
}

.region-hotspot:focus,
.region-hotspot:focus-visible,
.country-hotspot:focus,
.country-hotspot:focus-visible {
  outline: none;
}

.country-hotspot:hover,
.country-hotspot:focus-within {
  transform: scale(1.08);
}

.global-intro {
  position: absolute;
  left: var(--screen-pad-x);
  right: var(--screen-pad-x);
  bottom: 56px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.global-intro p {
  max-width: 430px;
  margin: 0;
  font-size: clamp(1.25rem, 1.8vw, 1.85rem);
  line-height: 1.18;
}

.region-drawer {
  position: relative;
  z-index: 30;
  width: 50vw;
  min-height: 100vh;
  padding: var(--panel-title-top) 0 72px var(--screen-pad-x);
  background: rgb(52, 52, 55);
  transform: translateX(-105%);
  transition: transform 520ms cubic-bezier(0.2, 0.9, 0.2, 1);
  box-shadow: 32px 0 72px rgba(0, 0, 0, 0.18);
}

.map-panel[data-state="region"] .region-drawer {
  transform: translateX(0);
}

.map-panel[data-state="region"] .global-intro {
  opacity: 0;
  pointer-events: none;
}

.region-drawer h1,
.local-heading h1 {
  margin: 0 0 48px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  letter-spacing: 0;
  font-weight: 500;
}

.partner-list {
  display: grid;
  gap: 46px;
}

.partner-card {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  width: 100%;
  min-height: 148px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--text);
  text-align: left;
}

.partner-card img,
.local-card img {
  width: 148px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: #f3f0ea;
}

.partner-card strong {
  display: block;
  font-size: clamp(1.7rem, 2.7vw, 3rem);
  font-weight: 500;
  line-height: 1;
}

.partner-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.55rem);
}

.local-layout {
  min-height: 100vh;
  padding: 150px var(--screen-pad-x) 80px;
  background:
    linear-gradient(90deg, rgba(36, 36, 38, 0.9), rgba(48, 48, 51, 0.82)),
    radial-gradient(circle at 82% 34%, rgba(242, 164, 91, 0.12), transparent 30%),
    var(--bg);
}

.local-heading {
  max-width: 760px;
}

.local-heading h1 {
  margin-bottom: 12px;
}

.local-heading p {
  margin: 0 0 42px;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.5rem);
  line-height: 1.35;
}

.local-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.local-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  min-height: 144px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  text-align: left;
}

.local-card img {
  width: 112px;
}

.local-card h2 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}

.local-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.4;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.detail-view {
  position: absolute;
  z-index: 35;
  top: 0;
  left: 0;
  width: 50vw;
  height: 100vh;
  display: block;
  background: var(--panel);
  overflow-y: auto;
  pointer-events: none;
  transform: translateX(-105%);
  transition: transform 520ms cubic-bezier(0.2, 0.9, 0.2, 1);
  box-shadow: 34px 0 76px rgba(0, 0, 0, 0.28);
}

.detail-view.open {
  pointer-events: auto;
  transform: translateX(0);
}

.admin-view[hidden] {
  display: none;
}

.detail-media {
  position: relative;
  height: min(52vh, 610px);
  min-height: 360px;
  overflow: hidden;
  background: #1d1d1f;
}

.detail-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.36));
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.close-detail {
  position: absolute;
  z-index: 3;
  top: 52px;
  right: 42px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  font-size: 3.2rem;
  line-height: 1;
}

.detail-title {
  position: absolute;
  z-index: 2;
  left: var(--screen-pad-x);
  right: var(--screen-pad-x);
  top: var(--panel-title-top);
}

.detail-title h1 {
  margin: 0 0 min(34vh, 360px);
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 500;
  line-height: 1;
}

.detail-title p {
  margin: 0;
  font-size: clamp(1.25rem, 1.8vw, 1.7rem);
  font-weight: 500;
}

.detail-body {
  padding: 64px var(--screen-pad-x) 80px;
}

.detail-body section {
  margin-bottom: 42px;
}

.detail-body h2 {
  margin: 0 0 22px;
  font-size: clamp(1.4rem, 2vw, 2rem);
  font-weight: 500;
}

.rich-copy {
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1rem, 1.25vw, 1.25rem);
  line-height: 1.7;
}

.rich-copy p:first-child {
  margin-top: 0;
}

.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 58%);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}

.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  scroll-snap-align: start;
}

.video-frame iframe,
.video-frame video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
  background: #111;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 24px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #201712;
  font-weight: 500;
  text-decoration: none;
}

.admin-view {
  position: fixed;
  z-index: 80;
  inset: 0;
  overflow: auto;
  background: #f5f2ec;
  color: #1d1d1f;
}

.admin-header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  border-bottom: 1px solid #ddd7cd;
  background: rgba(245, 242, 236, 0.96);
  backdrop-filter: blur(12px);
}

.admin-header p,
.editor-head p {
  margin: 0 0 4px;
  color: #726b61;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.admin-header h1,
.editor-head h2,
.admin-list h2 {
  margin: 0;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: calc(100vh - 89px);
}

.admin-list {
  border-right: 1px solid #ddd7cd;
  background: #ebe6dc;
  padding: 22px;
}

.admin-list-head,
.editor-head,
.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-filter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 18px 0;
}

.filter-button,
.secondary-button,
.primary-button,
.danger-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-weight: 500;
}

.filter-button,
.secondary-button {
  border: 1px solid #d4ccc0;
  background: #fffaf2;
  color: #292521;
}

.filter-button.active,
.primary-button {
  background: #28231f;
  color: #fffaf2;
}

.danger-button {
  background: #ffe3df;
  color: #8a1f17;
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.file-label input {
  display: none;
}

.admin-partners {
  display: grid;
  gap: 8px;
}

.admin-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #1d1d1f;
  text-align: left;
}

.admin-row.active,
.admin-row:hover {
  border-color: #d2c5b6;
  background: #fffaf2;
}

.admin-row img {
  width: 48px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

.admin-row strong,
.admin-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row small {
  color: #766e64;
}

.editor {
  padding: 30px 32px 60px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0;
}

label,
.wide-label {
  display: grid;
  gap: 8px;
  color: #3e3832;
  font-weight: 500;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cfc7bc;
  border-radius: var(--radius);
  background: #fffdf8;
  color: #1d1d1f;
  padding: 0 12px;
}

.wide-label {
  margin-bottom: 20px;
}

.wysiwyg-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.wysiwyg-toolbar button {
  min-width: 38px;
  min-height: 34px;
  border: 1px solid #cec4b6;
  border-radius: 6px;
  background: #fffaf2;
  color: #1d1d1f;
  font-weight: 500;
}

.wysiwyg {
  min-height: 150px;
  padding: 14px;
  border: 1px solid #cfc7bc;
  border-radius: var(--radius);
  background: #fffdf8;
  color: #1d1d1f;
  line-height: 1.5;
  outline: none;
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.image-preview figure {
  margin: 0;
  position: relative;
}

.image-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
}

.image-preview button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: white;
}

[data-local-only][hidden],
[data-global-only][hidden] {
  display: none;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: minmax(150px, 1fr) auto;
    align-items: start;
    padding-top: 24px;
  }

  .section-tabs {
    justify-self: end;
  }

  .admin-link {
    justify-self: start;
  }

  .region-drawer {
    width: 100%;
    padding: 150px var(--screen-pad-x) 72px;
    background: rgb(52, 52, 55);
  }

  .map-panel[data-state="region"] .world-map {
    opacity: 0.32;
    transform: scale(1.35);
  }

  .detail-view {
    width: 100%;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .detail-media {
    height: 58vh;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-list {
    border-right: 0;
    border-bottom: 1px solid #ddd7cd;
  }
}

@media (max-width: 640px) {
  .topbar {
    position: absolute;
    gap: 14px;
  }

  .brand-button {
    font-size: clamp(1.35rem, 7vw, 1.9rem);
  }

  .tab-button {
    font-size: clamp(1.2rem, 6vw, 1.7rem);
  }

  .map-art {
    min-width: 760px;
  }

  .global-intro {
    display: grid;
  }

  .partner-card,
  .local-card {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
  }

  .partner-card img,
  .local-card img {
    width: 92px;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
