* {
  box-sizing: border-box;
}

:root {
  --bg: #f6f2eb;
  --surface: #ffffff;
  --surface-soft: #fbf8f3;
  --text: #1c1b19;
  --muted: #6d675f;
  --accent: #9a7750;
  --shadow: 0 20px 42px rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.05);
  --max-width: 1240px;
  --radius: 22px;
  --radius-sm: 16px;
  --transition: 0.28s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 30;
}

.navbar {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 36px 0;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-top: 6px;
}

.nav-links a {
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 0.9;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: opacity 0.3s ease;
}

.nav-links a:hover {
  opacity: 0.7;
}

.menu-btn {
  display: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

/* Hero */

.continent-hero {
  min-height: 82vh;
  background:
    linear-gradient(
      to right,
      rgba(10, 12, 16, 0.62) 0%,
      rgba(10, 12, 16, 0.42) 36%,
      rgba(10, 12, 16, 0.22) 66%,
      rgba(10, 12, 16, 0.1) 100%
    ),
    url("../images/africa/africa-hero.jpg") center/cover no-repeat;
  display: flex;
  align-items: center;
}

.continent-hero-short {
  min-height: 62vh;
}

.continent-hero-overlay {
  width: 100%;
}

.continent-hero-content {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding-top: 140px;
  padding-bottom: 80px;
  max-width: 860px;
  text-align: left;
}

.eyebrow {
  margin: 0 0 18px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.9);
}

.continent-hero-content h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.93;
  letter-spacing: -0.06em;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.continent-intro {
  margin: 22px 0 0;
  max-width: 680px;
  font-size: clamp(1.02rem, 2vw, 1.24rem);
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
}

/* Shared sections */

main section:not(.continent-hero) {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 92px 0 0;
  position: relative;
}

main section:not(.continent-hero)::before {
  content: "";
  display: block;
  width: 100%;
  max-width: 260px;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(28, 27, 25, 0.16),
    transparent
  );
  margin: 0 auto 30px;
}

.section-heading {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.section-heading p {
  max-width: 640px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 1.03rem;
}

/* Featured countries */

.featured-country-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 46px;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.featured-country-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.featured-country-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
}

.featured-country-card a {
  display: block;
  position: relative;
}

.featured-country-image img {
  aspect-ratio: 16 / 11;
  object-fit: cover;
}

.featured-country-content {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 22px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72),
    rgba(0, 0, 0, 0.04)
  );
  color: #ffffff;
}

.country-flag {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 1.15rem;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.featured-country-content h3 {
  margin: 0 0 8px;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}

.featured-country-content p {
  margin: 0;
  max-width: 90%;
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.92);
}

/* Country browser */

.country-browser {
  background-image:
    linear-gradient(rgba(246, 242, 235, 0.94), rgba(246, 242, 235, 0.96)),
    url("../images/africa-map-light.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-top: 1px solid rgba(28, 27, 25, 0.08);
  border-bottom: 1px solid rgba(28, 27, 25, 0.08);
}

.country-browser .section-heading {
  margin-bottom: 8px;
}

.region-group {
  margin-top: 40px;
}

.region-header {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}

.region-header h3 {
  margin: 0 0 10px;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.region-header p {
  margin: 0;
  color: var(--muted);
}

.country-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
}

.country-tile {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
}

.country-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}

.country-tile-flag {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 0.25s ease, opacity 0.25s ease;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.country-tile:hover .country-tile-flag {
  opacity: 1;
  transform: scale(1.08);
}

.country-tile-name {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Utility */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Footer */

.site-footer {
  margin-top: 96px;
  padding: 42px 20px 46px;
  background: #111111;
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
}

.footer-contact {
  margin-bottom: 32px;
}

.footer-label {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.72);
}

.footer-contact p,
.footer-meta p {
  margin: 8px 0;
}

.footer-meta {
  font-size: 0.95rem;
}

.site-footer a {
  color: #ffffff;
  text-decoration: underline;
}

/* Back to top */

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.9);
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease,
    background 0.25s ease;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-2px);
  background: #111111;
}

/* Responsive */

@media (max-width: 1024px) {
  .featured-country-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 860px;
  }

  .continent-hero-content {
    max-width: 720px;
  }

  .country-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 22px 0;
    justify-content: center;
  }

  .menu-btn {
    display: inline-flex;
    position: absolute;
    right: 0;
    top: 36px;
    transform: none;
    z-index: 50;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    z-index: 40;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    border-radius: 18px;
    background: rgba(20, 20, 20, 0.94);
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    color: #ffffff;
  }

  .continent-hero,
  .continent-hero-short {
    min-height: 52vh;
    background-position: center;
  }

  .continent-hero-content {
    padding-top: 110px;
    padding-bottom: 54px;
    max-width: 520px;
  }

  main section:not(.continent-hero) {
    padding-top: 72px;
  }

  .featured-country-grid,
  .country-tile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .continent-hero-content h1 {
    font-size: clamp(2.5rem, 12vw, 4.2rem);
  }

  .continent-intro {
    max-width: 320px;
    font-size: 0.96rem;
  }

  .menu-btn {
    top: 34px;
    padding: 10px 16px;
    font-size: 0.95rem;
  }

  .nav-links {
    top: 72px;
    padding: 18px;
    gap: 12px;
  }

  .featured-country-content h3 {
    font-size: 1.5rem;
  }

  .featured-country-content p,
  .region-header p,
  .section-heading p {
    font-size: 0.98rem;
  }

  .country-tile {
    padding: 14px 16px;
  }

  .country-tile-name {
    white-space: normal;
  }
}
