:root {
  --bg: #05070b;
  --panel: #11151b;
  --panel-alt: #161b23;
  --border: #242a34;
  --border-strong: #394252;

  --text: #f2f2f2;
  --muted: #8f97a3;
  --muted-soft: #6f7782;

  --accent: #f2f2f2;
  --shadow: 0 0 0 rgba(0, 0, 0, 0);

  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --space-xs: 6px;
  --space-sm: 10px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 56px;

  --max-width: 1400px;

  --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  font-family: var(--font-system);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.page-header,
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.page-title,
h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.page-subtitle,
.subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 52rem;
}

.btn,
.back-link,
.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover,
.back-link:hover,
.filter-btn:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.btn.active,
.filter-btn.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.card-link {
  display: block;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.card-link:hover {
  transform: translateY(-2px);
}

.card-link:hover .card {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
}

.grid {
  display: grid;
  gap: var(--space-md);
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack > * + * {
  margin-top: var(--space-md);
}

.section {
  margin-top: var(--space-xl);
}

.section-title {
  margin: 0 0 14px;
  font-size: 1.1rem;
  color: var(--text);
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

.error-message {
  background: #2a1616;
  border: 1px solid #5a2a2a;
  color: #f5c2c2;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}

.empty-state {
  color: var(--muted);
  padding: 18px 0;
  font-size: 0.95rem;
}

/* Index page */

.home-intro {
  margin-bottom: 36px;
}

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

.home-card-title {
  margin: 0 0 12px;
  font-size: 1.15rem;
  line-height: 1.3;
}

.home-card-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

/* Travel page */

.travel-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 20px;
  color: var(--muted);
}

.travel-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.travel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.travel-dot.been {
  background: #57c271;
}

.travel-dot.want {
  background: #6f9df5;
}

.travel-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
  max-width: 620px;
}

.stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.stat-value {
  display: block;
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.stat-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.map-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel);
}

#map {
  width: 100%;
  height: 620px;
  background: #c9ddeb;
}

/* Photography page */

.gallery-meta {
  margin-bottom: 24px;
  font-size: 0.95rem;
  color: var(--muted);
}

.gallery {
  column-count: 3;
  column-gap: 16px;
}

.photo-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 22px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.photo-frame {
  margin: 0;
}

.photo-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.photo-image-wrap {
  background: #0d1015;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.photo-image {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(100%) contrast(108%);
  transition: transform 0.28s ease, filter 0.28s ease;
}

.photo-link:hover .photo-image {
  transform: scale(1.012);
  filter: grayscale(100%) contrast(116%);
}

.photo-meta {
  padding-top: 10px;
}

.photo-caption {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text);
  font-weight: 500;
}

.photo-detail-row {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.photo-detail {
  white-space: nowrap;
}

/* Utility spacing */

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}

/* Responsive */

@media (max-width: 1100px) {
  .gallery {
    column-count: 2;
  }

  .travel-stats {
    max-width: none;
  }
}

@media (max-width: 800px) {
  .home-grid,
  .travel-stats,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  #map {
    height: 520px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 24px 16px 40px;
  }

  .page-header,
  .topbar {
    margin-bottom: 26px;
  }

  .gallery {
    column-count: 1;
    column-gap: 0;
  }

  .photo-card {
    margin-bottom: 26px;
  }

  .btn,
  .back-link {
    width: 100%;
  }

  #map {
    height: 440px;
  }
}
