:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --ink: #1b2430;
  --muted: #627084;
  --line: #d8dee8;
  --accent: #b91f44;
  --accent-dark: #8f1532;
  --focus: rgba(185, 31, 68, 0.24);
  --shadow: 0 18px 46px rgba(28, 36, 48, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

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

.site-hero {
  min-height: 520px;
  background:
    linear-gradient(105deg, rgba(20, 26, 35, 0.88), rgba(20, 26, 35, 0.48)),
    url("img/map.webp") center/cover no-repeat;
  color: #ffffff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  width: 178px;
  height: auto;
}

.topbar-link {
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  padding: 9px 16px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.hero-content {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 88px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: #dce4ef;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-content h1 {
  margin: 0;
  font-size: 58px;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy {
  width: min(680px, 100%);
  margin: 20px auto 0;
  color: #eef3f9;
  font-size: 19px;
}

.country-search {
  width: min(680px, 100%);
  margin: 32px auto 0;
}

.country-search label {
  display: block;
  margin-bottom: 10px;
  color: #ffffff;
  font-weight: 800;
  text-align: left;
}

.search-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.search-control input {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.search-control input:focus {
  box-shadow: 0 0 0 4px var(--focus);
}

.search-control button {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.search-control button:hover,
.search-control button:focus {
  background: var(--accent-dark);
}

.country-count {
  margin: 16px 0 0;
  color: #e8edf5;
  font-size: 14px;
  font-weight: 700;
}

.page-section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 70px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading .eyebrow {
  color: var(--accent);
}

.section-heading h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.country-card {
  min-width: 0;
}

.country-card a {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  min-height: 88px;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(31, 42, 58, 0.07);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.country-card a:hover,
.country-card a:focus {
  border-color: rgba(185, 31, 68, 0.48);
  box-shadow: 0 14px 34px rgba(31, 42, 58, 0.14);
  transform: translateY(-2px);
  outline: none;
}

.flag-wrap {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 34px;
  border-radius: 6px;
  background: var(--surface-soft);
  box-shadow: inset 0 0 0 1px rgba(27, 36, 48, 0.08);
}

.flag-wrap img {
  width: 40px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(27, 36, 48, 0.16);
}

.country-card strong,
.country-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.country-card strong {
  color: var(--ink);
  font-size: 17px;
}

.country-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.site-footer {
  padding: 34px 16px 42px;
  border-top: 1px solid var(--line);
  background: #101722;
  color: #dce4ef;
  text-align: center;
}

.site-footer p {
  width: min(760px, 100%);
  margin: 0 auto 10px;
}

.site-footer a {
  color: #ffffff;
  font-weight: 800;
}

.site-footer img {
  width: 88px;
  margin: 18px auto 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .country-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-content h1 {
    font-size: 46px;
  }
}

@media (max-width: 720px) {
  .site-hero {
    min-height: auto;
  }

  .topbar {
    width: min(100% - 24px, 1120px);
  }

  .brand img {
    width: 148px;
  }

  .hero-content {
    width: min(100% - 24px, 820px);
    padding: 42px 0 58px;
  }

  .hero-content h1 {
    font-size: 36px;
  }

  .hero-copy {
    font-size: 17px;
  }

  .search-control {
    grid-template-columns: 1fr;
  }

  .page-section {
    width: min(100% - 24px, 1120px);
    padding: 38px 0 50px;
  }

  .country-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .country-card a {
    grid-template-columns: 62px 1fr;
    min-height: 86px;
    padding: 14px;
  }

  .flag-wrap {
    width: 50px;
    height: 38px;
  }

  .flag-wrap img {
    width: 44px;
    height: 30px;
  }
}

@media (max-width: 480px) {
  .topbar-link {
    display: none;
  }

  .section-heading h2 {
    font-size: 28px;
  }
}
