*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f8f6f3;
  --surface: #ffffff;
  --text: #1c1917;
  --text-muted: #78716c;
  --accent: #b95c2c;
  --accent-light: #fdf1eb;
  --border: #e7e4e0;
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-lg: 0 4px 20px rgba(0,0,0,.09);
  --radius: 3px;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --max: 1080px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: normal;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.4rem, 2.8vw, 2.1rem); }
h3 { font-size: clamp(1rem, 1.8vw, 1.3rem); }

p { max-width: 65ch; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ── Layout ── */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.site-logo em { color: var(--accent); font-style: normal; }

.site-nav {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.site-nav a:hover,
.site-nav a.active { color: var(--accent); text-decoration: none; }

/* ── Hero ── */
.hero {
  padding: 6rem 0 5rem;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 { margin-bottom: 1.5rem; }

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 52ch;
}

.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.btn-primary:hover {
  background: #a04e24;
  border-color: #a04e24;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--text-muted); text-decoration: none; }

/* ── Sections ── */
.section { padding: 4rem 0; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: none; }

.section-header { margin-bottom: 3rem; }

.section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.section-header h2 { margin-bottom: 0.6rem; }
.section-header p { color: var(--text-muted); font-size: 0.9375rem; }

/* ── Region Cards ── */
.regions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.region-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 3 / 5;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
}

.region-card-bg {
  position: absolute;
  inset: 0;
  transition: transform 0.4s ease;
}

.region-card:hover .region-card-bg { transform: scale(1.05); }

.region-north .region-card-bg {
  background: linear-gradient(150deg, #2d5a47 0%, #152e22 100%);
}
.region-coast .region-card-bg {
  background: linear-gradient(150deg, #1b5070 0%, #0a2a3d 100%);
}
.region-sierra .region-card-bg {
  background: linear-gradient(150deg, #4a6e3f 0%, #233620 100%);
}
.region-south .region-card-bg {
  background: linear-gradient(150deg, #8b4a2b 0%, #3e1f0e 100%);
}

.region-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.80) 0%, rgba(0,0,0,.12) 50%, transparent 100%);
  transition: opacity 0.35s ease;
}

.region-card:hover .region-card-overlay { opacity: 0.55; }

.region-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  background: rgba(255,255,255,0.15);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  color: rgba(255,255,255,0.9);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  font-family: var(--font-sans);
}

.region-card-body {
  position: relative;
  z-index: 1;
  padding: 1.25rem;
  color: #fff;
  width: 100%;
}

.region-card-body h3 {
  color: #fff;
  font-size: 1.15rem;
  margin-bottom: 0.2rem;
}

.region-card-body > span:not(.region-card-cta) {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  display: block;
}

.region-card-desc {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.55;
  margin: 0;
  padding-top: 0.5rem;
  margin-top: 0.4rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  transition: color 0.35s ease;
}

.region-card:hover .region-card-desc { color: rgba(255,255,255,0.95); }

.region-card-cta {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-sans);
  transition: color 0.35s ease;
}

.region-card:hover .region-card-cta { color: rgba(255,255,255,0.85); }
.region-card:hover { text-decoration: none; }

/* ── Attraction Cards ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: #d1cdc8;
}

.card-badge {
  display: inline-block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 7px;
  border-radius: 2px;
  margin-bottom: 0.75rem;
}

.card h3 { margin-bottom: 0.3rem; font-size: 1.05rem; }

.card-route-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.card-route-link:hover { text-decoration: underline; }

.card .card-location {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Region Divider (attractions page) ── */
.region-section { margin-bottom: 4rem; }

.region-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.region-heading h2 { font-size: 1.5rem; }

.region-heading .count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── Resource Page ── */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
}

.resource-block h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.resource-block ul { list-style: none; }

.resource-block li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.resource-block li:last-child { border-bottom: none; }

.resource-block li strong {
  display: block;
  color: var(--text);
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.tip-box {
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 2rem 0;
}

.tip-box p { font-size: 0.9rem; margin: 0; }
.tip-box strong { color: var(--accent); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.info-item {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.info-item .info-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.info-item .info-value {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text);
}

/* ── Page Hero (inner pages) ── */
.page-hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.page-hero h1 { margin-bottom: 0.75rem; }

.page-hero p { font-size: 1.0625rem; color: var(--text-muted); }

/* ── CTA Strip ── */
.cta-strip {
  background: var(--accent);
  padding: 4rem 0;
}

.cta-strip h2 { color: #fff; margin-bottom: 1rem; }

.cta-strip p {
  color: rgba(255,255,255,.75);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.btn-white {
  background: #fff;
  color: var(--accent);
  border: 1px solid #fff;
}
.btn-white:hover { background: rgba(255,255,255,.9); text-decoration: none; }

/* ── Footer ── */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,.5);
  padding: 3rem 0 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: start;
  margin-bottom: 2rem;
}

.footer-brand .site-logo { color: rgba(255,255,255,.85); display: block; margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.8rem; line-height: 1.75; max-width: 38ch; }

.footer-nav { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; text-align: right; }
.footer-nav a { color: rgba(255,255,255,.45); font-size: 0.8rem; }
.footer-nav a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 0.73rem;
}

/* ── 404 ── */
.error-page {
  min-height: 55vh;
  display: flex;
  align-items: center;
  padding: 4rem 0;
}

.error-number {
  font-family: var(--font-serif);
  font-size: clamp(5rem, 18vw, 9rem);
  color: var(--border);
  line-height: 1;
  margin-bottom: 1rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero { padding: 3.5rem 0 3rem; }
  .site-nav { gap: 1.25rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-nav { text-align: left; flex-direction: row; flex-wrap: wrap; gap: 1rem; }
  .btn-row { flex-direction: column; align-items: flex-start; }
}

/* ── Route page ── */
.route-map-wrap {
  position: relative;
  height: calc(100vh - 60px);
}

.route-map-wrap #map {
  width: 100%;
  height: 100%;
}

.route-info-card {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .75rem 1rem;
  box-shadow: var(--shadow-lg);
  min-width: 190px;
  pointer-events: none;
}

.route-info-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .25rem;
}

.route-info-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: .15rem;
}

.route-info-meta {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.route-info-bar-wrap {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: .25rem;
}

.route-info-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width .3s ease;
}

.route-info-progress {
  font-size: .65rem;
  color: var(--accent);
}

.car-icon {
  width: 28px;
  height: 28px;
  background: #2563eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  overflow: hidden;
}
