* {
  box-sizing: border-box;
}

:root {
  --bg: #f6f2eb;
  --surface: #ffffff;
  --surface-soft: #fbf8f3;
  --text: #1c1b19;
  --muted: #6d675f;
  --accent: #8f6d48;
  --border: rgba(28, 27, 25, 0.09);
  --shadow: 0 22px 44px rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.05);
  --max-width: 1240px;
  --content-width: 920px;
  --radius: 24px;
  --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.65;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */

.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  z-index: 40;
}

.navbar {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 34px 0;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links li {
  list-style: none;
}

.nav-links a {
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  opacity: 0.92;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.36);
  transition: opacity 0.28s ease;
}

.nav-links a:hover {
  opacity: 0.72;
}

.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 */

.country-hero {
  min-height: 86vh;
  background:
    linear-gradient(
      to right,
      rgba(10, 12, 16, 0.34) 0%,
      rgba(10, 12, 16, 0.18) 24%,
      rgba(10, 12, 16, 0.08) 52%,
      rgba(10, 12, 16, 0.03) 100%
    ),
    url("../images/africa/kenya/kenya-hero.jpg") center 40% / cover no-repeat;
  display: flex;
  align-items: center;
}

.country-hero-overlay {
  width: 100%;
}

.country-hero-content {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding-top: 132px;
  padding-bottom: 84px;
  display: flex;
  justify-content: flex-start;
}

.hero-title-block {
  max-width: 500px;
  padding: 22px 24px 24px;
  border-radius: 24px;
  background: rgba(14, 15, 18, 0.1);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.eyebrow {
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.94);
}

.country-hero-content h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
  color: #ffffff;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.22);
}

.country-intro {
  margin: 18px 0 0;
  max-width: 470px;
  font-size: clamp(0.96rem, 1.45vw, 1.08rem);
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

/* Shared sections */

main section:not(.country-hero) {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
  padding: 96px 0 0;
  position: relative;
}

main section:not(.country-hero)::before {
  content: "";
  display: block;
  width: 100%;
  max-width: 260px;
  height: 1px;
  margin: 0 auto 30px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(28, 27, 25, 0.16),
    transparent
  );
}

.section-heading {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.section-heading h2 {
  font-size: clamp(2.3rem, 5vw, 4.2rem);
}

.section-heading h3 {
  font-size: clamp(1.9rem, 3.8vw, 2.9rem);
}

.section-heading p {
  max-width: 660px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 1.03rem;
}

/* At a glance */

.country-glance {
  max-width: var(--content-width);
}

.glance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 46px;
}

.glance-card {
  padding: 24px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.glance-card h3 {
  margin: 0 0 10px;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
}

.glance-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.99rem;
}

/* Intro */

.country-gallery-intro {
  max-width: 800px;
}

/* Photo sequence */

.photo-sequence {
  max-width: var(--content-width);
}

.photo-frame {
  margin: 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.photo-sequence > .photo-frame,
.photo-sequence > .photo-pair,
.photo-sequence > .photo-grid-three,
.photo-sequence > .section-heading,
.photo-sequence > .country-gallery-intro {
  margin-top: 34px;
}

.photo-sequence > .photo-frame:first-child,
.photo-sequence > .section-heading:first-child,
.photo-sequence > .country-gallery-intro:first-child {
  margin-top: 0;
}

.photo-frame img {
  aspect-ratio: 16 / 11;
  object-fit: cover;
}

.photo-frame-hero img {
  aspect-ratio: 16 / 10;
}

.photo-frame figcaption {
  padding: 18px 20px 20px;
  font-size: 0.97rem;
  color: var(--muted);
  border-top: 1px solid rgba(28, 27, 25, 0.08);
  background: rgba(255, 255, 255, 0.94);
}

.photo-frame figcaption strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 1rem;
}

.photo-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.photo-grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* Notes */

.country-notes {
  max-width: var(--content-width);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 46px;
}

.note-card {
  padding: 24px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.note-card h3 {
  margin: 0 0 10px;
  font-size: 1.14rem;
  letter-spacing: -0.02em;
}

.note-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* Footer */

.site-footer {
  margin-top: 98px;
  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;
}

/* Floating section navigation */

.floating-section-nav {
  position: fixed;
  right: 18px;
  bottom: 82px;
  z-index: 69;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.section-nav-toggle {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.92);
  color: #ffffff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  margin: 0;
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    opacity 0.25s ease;
}

.section-nav-toggle:hover {
  transform: translateY(-2px);
  background: #111111;
}

.section-nav-toggle.active {
  background: #111111;
}

.section-nav-menu {
  display: none;
  margin-bottom: 0;
  padding: 10px;
  min-width: 190px;
  border-radius: 16px;
  background: rgba(20, 20, 20, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.section-nav-menu.show {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-nav-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.25s ease, opacity 0.25s ease;
}

.section-nav-menu a:hover,
.section-nav-menu a:focus {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}

/* Back to top */

.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.92);
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  z-index: 70;
  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) {
  .country-hero-content {
    padding-top: 126px;
    padding-bottom: 76px;
  }

  .hero-title-block {
    max-width: 500px;
    padding: 20px 22px 22px;
  }

  .glance-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid-three {
    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: 60;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 78px;
    left: 0;
    right: 0;
    z-index: 50;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin: 0;
    padding: 20px;
    list-style: none;
    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 li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    color: #ffffff;
    text-shadow: none;
  }

  .country-hero {
    min-height: 72vh;
    background:
      linear-gradient(
        to top,
        rgba(10, 12, 16, 0.24) 0%,
        rgba(10, 12, 16, 0.1) 46%,
        rgba(10, 12, 16, 0.04) 100%
      ),
      url("../images/africa/kenya/kenya-hero.jpg") center 40% / cover no-repeat;
  }

  .country-hero-content {
    padding-top: 118px;
    padding-bottom: 54px;
    align-items: flex-end;
    justify-content: flex-start;
  }

  .hero-title-block {
    max-width: 420px;
    padding: 18px 18px 20px;
    border-radius: 22px;
    background: rgba(14, 15, 18, 0.08);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
  }

  .country-hero-content h1 {
    font-size: clamp(2.5rem, 10vw, 4.2rem);
    line-height: 0.95;
  }

  .country-intro {
    margin-top: 14px;
    max-width: 100%;
    font-size: 0.94rem;
  }

  main section:not(.country-hero) {
    padding-top: 76px;
  }

  .photo-pair,
  .photo-grid-three {
    grid-template-columns: 1fr;
  }

  .floating-section-nav {
    right: 18px;
    bottom: 82px;
  }

  .section-nav-menu {
    min-width: 180px;
  }
}

@media (max-width: 560px) {
  .country-hero {
    min-height: 74vh;
    background-position: center 42%;
  }

  .country-hero-content {
    width: min(calc(100% - 28px), var(--max-width));
    padding-top: 112px;
    padding-bottom: 48px;
  }

  .hero-title-block {
    max-width: 100%;
    padding: 16px 16px 18px;
    border-radius: 20px;
  }

  .eyebrow {
    margin-bottom: 12px;
    font-size: 0.78rem;
  }

  .country-hero-content h1 {
    font-size: clamp(2.35rem, 12vw, 3.8rem);
  }

  .country-intro {
    max-width: 100%;
    font-size: 0.92rem;
  }

  .menu-btn {
    top: 34px;
    padding: 10px 16px;
    font-size: 0.95rem;
  }

  .nav-links {
    top: 72px;
    padding: 18px;
    gap: 12px;
  }

  .photo-frame figcaption {
    font-size: 0.94rem;
  }

  .glance-card,
  .note-card {
    padding: 22px 20px;
  }

  .floating-section-nav {
    right: 14px;
    bottom: 72px;
  }

  .section-nav-toggle {
    width: 48px;
    height: 48px;
    font-size: 1.05rem;
  }

  .section-nav-menu {
    min-width: 165px;
    margin-bottom: 10px;
    padding: 8px;
  }

  .section-nav-menu a {
    padding: 11px 12px;
    font-size: 0.94rem;
    border-radius: 10px;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
  }
}
