:root {
  --bg: #f7fbff;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #06b6d4;
  --border: #e5e7eb;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 28px 60px rgba(37, 99, 235, 0.18);
  --gradient: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

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

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 72px;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.brand {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--gradient);
  vertical-align: middle;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

.site-nav a.active::after {
  transform: scaleX(1);
}

/* Hero stats */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin: 2.5rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero-stats div {
  display: grid;
  gap: 0.25rem;
}

.hero-stats dt {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.hero-stats dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Route badges */
.route-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-easy {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
}

.badge-medium {
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
}

.badge-hard {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
}

.route-distance {
  font-weight: 700;
  color: var(--muted);
}

.route-card-actions {
  margin-top: 1.5rem;
}

.route-choose {
  width: 100%;
  color: var(--primary-strong);
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.18);
}

.route-choose:hover {
  background: rgba(37, 99, 235, 0.08);
}

/* Testimonials */
.section-voices {
  background: var(--bg);
}

.voice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.voice-card {
  margin: 0;
  padding: 1.8rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.voice-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.voice-card blockquote {
  position: relative;
  margin: 0 0 1.5rem;
  padding-top: 1.75rem;
  line-height: 1.8;
}

.voice-card blockquote::before {
  content: "\201C";
  position: absolute;
  top: -0.6rem;
  left: -0.25rem;
  font-size: 3.5rem;
  line-height: 1;
  font-family: Georgia, serif;
  color: rgba(37, 99, 235, 0.18);
}

.voice-card figcaption {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.voice-card figcaption strong {
  color: var(--text);
}

.voice-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-strong);
  font-weight: 700;
  flex-shrink: 0;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 30;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.back-to-top:hover {
  background: var(--primary-strong);
}

/* Form error state */
.join-form input.invalid,
.join-form select.invalid,
.join-form textarea.invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-message.error {
  color: #b91c1c;
}

.hero {
  position: relative;
  padding: 4rem 0 3rem;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 55%;
  height: 120%;
  background: radial-gradient(circle at center, rgba(6, 182, 212, 0.18), transparent 65%);
  pointer-events: none;
  z-index: -1;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 45%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(37, 99, 235, 0.15), transparent 65%);
  pointer-events: none;
  z-index: -1;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 2rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 4vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--text) 30%, var(--primary) 70%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  max-width: 42rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
  box-shadow: none;
}

.primary {
  color: #ffffff;
  background: var(--gradient);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.25);
}

.primary:hover {
  box-shadow: 0 22px 48px rgba(37, 99, 235, 0.35);
}

.secondary {
  color: var(--primary-strong);
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.15);
}

.secondary:hover {
  background: rgba(37, 99, 235, 0.14);
}

.hero-image {
  position: relative;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero-image img {
  width: 100%;
  transition: transform 0.6s ease;
}

.hero-image:hover img {
  transform: scale(1.05);
}

.section {
  padding: 3rem 0;
}

.section-features,
.section-routes,
.section-join {
  background: var(--surface);
}

.section h2 {
  position: relative;
  margin: 0 0 1.5rem;
  font-size: 2rem;
  letter-spacing: -0.01em;
}

.section h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 0.75rem;
  border-radius: 4px;
  background: var(--gradient);
}

.feature-grid,
.route-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.feature-card,
.route-card {
  position: relative;
  padding: 1.8rem;
  background: #f8fbff;
  border-radius: var(--radius);
  border: 1px solid rgba(37, 99, 235, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.feature-card::before,
.route-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.feature-card:hover,
.route-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}

.feature-card:hover::before,
.route-card:hover::before {
  transform: scaleX(1);
}

.feature-card h3,
.route-card h3 {
  margin-top: 0;
}

.feature-card p,
.route-card p {
  color: var(--muted);
  line-height: 1.85;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
}

.join-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

.join-form {
  display: grid;
  gap: 1rem;
  max-width: 28rem;
}

.join-form label {
  display: grid;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.join-form input,
.join-form select,
.join-form textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.join-form textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.join-form input:focus,
.join-form select:focus,
.join-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.join-form input::placeholder,
.join-form textarea::placeholder {
  color: #9ca3af;
}

.consent-label {
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 0.7rem;
  line-height: 1.6;
}

.consent-label input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.3rem;
  accent-color: var(--primary);
}

.hidden-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-message {
  margin: 0;
  color: var(--primary-strong);
  min-height: 1.5rem;
}

.site-footer {
  padding: 2.5rem 0;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* Visible keyboard focus for interactive elements */
a:focus-visible,
button:focus-visible,
.button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.4);
  outline-offset: 3px;
  border-radius: 8px;
}

@media (max-width: 860px) {
  .hero-content,
  .feature-grid,
  .route-grid,
  .voice-grid {
    grid-template-columns: 1fr;
  }

  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    gap: 0.75rem;
  }
}

@media (max-width: 600px) {
  .site-nav {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .hero {
    padding-top: 2.5rem;
  }

  .button {
    width: 100%;
  }

  .hero-stats {
    gap: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .feature-card:hover,
  .route-card:hover,
  .voice-card:hover,
  .button:hover,
  .hero-image:hover img {
    transform: none;
  }
}
