/* ═══════════════════════════════════════════════
   LIVE RURAL — Shared Stylesheet
   Light/Dark theme via prefers-color-scheme
   ═══════════════════════════════════════════════ */

/* ── Variables ───────────────────────────────── */
:root {
  color-scheme: light dark;

  /* Brand (constant across themes) */
  --navy:    #2A3652;
  --white:   #ffffff;
  --blue-h:  #5F9AC6;
  --blue-lt: #9ECAD6;

  /* Theme-aware */
  --bg:         #ffffff;
  --bg-alt:     #f5f8fc;
  --bg-card:    #ffffff;
  --bg-input:   #f5f8fc;
  --text:       #2A3652;
  --text-muted: #556378;
  --border:     #e0e7ef;
  --nav-bg:     rgba(255,255,255,0.85);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(42,54,82,0.04);
  --shadow-sm: 0 2px 8px rgba(42,54,82,0.06);
  --shadow-md: 0 4px 24px rgba(42,54,82,0.08);
  --shadow-lg: 0 12px 48px rgba(42,54,82,0.10);

  /* Sizing / misc */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --max-w: 1080px;
  --nav-h: 68px;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
}

/* ── Dark theme overrides ────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #1a2438;
    --bg-alt:     #141c2e;
    --bg-card:    #22304a;
    --bg-input:   #192236;
    --text:       #e2e8f0;
    --text-muted: #8b9bb5;
    --border:     rgba(148,163,184,0.12);
    --nav-bg:     rgba(26,36,56,0.9);
    --blue-h:     #6da8d4;

    --shadow-xs: 0 1px 2px rgba(0,0,0,0.15);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 24px rgba(0,0,0,0.25);
    --shadow-lg: 0 12px 48px rgba(0,0,0,0.3);
  }
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::placeholder { color: var(--text-muted); opacity: 0.5; }

/* ── Layout Utilities ────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 32px; }
.section { padding: clamp(56px, 8vw, 104px) clamp(20px, 4vw, 32px); }
.section-inner { max-width: var(--max-w); margin: 0 auto; }

/* ── Reveal Animation ────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: 0.08s; }
.d2 { transition-delay: 0.16s; }
.d3 { transition-delay: 0.24s; }
.d4 { transition-delay: 0.32s; }
.d5 { transition-delay: 0.40s; }

/* ── Label / Eyebrow ─────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue-h);
  margin-bottom: 14px;
}

/* ── Typography ──────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
}
.h-section {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.h-card { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
p { max-width: 68ch; }
.lead { font-size: 17px; line-height: 1.8; color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary { background: var(--blue-h); color: var(--white); }
.btn-primary:hover {
  filter: brightness(0.9);
  box-shadow: 0 4px 16px rgba(95,154,198,0.3);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--border);
}
.btn-outline:hover { box-shadow: inset 0 0 0 1.5px var(--text-muted); }
.btn-white { background: var(--white); color: var(--navy); }
.btn-white:hover { opacity: 0.9; }

/* ── Navigation ──────────────────────────────── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: box-shadow 0.3s;
}
#nav.scrolled { box-shadow: 0 1px 0 var(--border), var(--shadow-xs); }

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 32px);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo-img { height: 36px; width: auto; flex-shrink: 0; }
.nav-logo-light { display: none; }
.nav-logo-dark  { display: block; }
@media (prefers-color-scheme: dark) {
  .nav-logo-light { display: block; }
  .nav-logo-dark  { display: none; }
}

.nav-logo-text { display: flex; flex-direction: column; line-height: 1; gap: 3px; }
.nav-logo-main { font-size: 18px; font-weight: 600; letter-spacing: 0.02em; color: var(--text); }
.nav-logo-sub  { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue-h); }

.nav-links { list-style: none; display: flex; align-items: center; gap: 32px; }
.nav-links a {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* Active page indicator */
.nav-links a[aria-current="page"]:not(.nav-cta-link) {
  color: var(--text);
  font-weight: 600;
}
.nav-links a[aria-current="page"]:not(.nav-cta-link)::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0; right: 0;
  height: 2px;
  background: var(--blue-h);
  border-radius: 1px;
}

.nav-cta-link {
  padding: 10px 22px !important;
  background: var(--blue-h) !important;
  color: var(--white) !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
  transition: all 0.2s !important;
}
.nav-cta-link:hover {
  filter: brightness(0.9) !important;
  box-shadow: 0 2px 8px rgba(95,154,198,0.25) !important;
}

/* ── Burger button ───────────────────────────── */
.burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px; height: 16px;
  background: none; border: none;
  cursor: pointer; padding: 0; flex-shrink: 0;
}
.burger span {
  display: block; width: 100%; height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile drawer ───────────────────────────── */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--bg-card);
  z-index: 99;
  padding: 8px 24px 24px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  border-top: 1px solid var(--border);
}
.mobile-menu.open { opacity: 1; transform: translateY(0); pointer-events: all; }
.mobile-menu ul { list-style: none; }
.mobile-menu ul a {
  display: block;
  padding: 14px 4px;
  font-size: 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  transition: color 0.2s;
}
.mobile-menu ul a:hover { color: var(--blue-h); }
.mobile-menu a[aria-current="page"] { color: var(--blue-h) !important; font-weight: 600; }

.mobile-cta {
  display: block !important;
  margin-top: 12px;
  padding: 14px !important;
  background: var(--blue-h);
  color: var(--white) !important;
  text-align: center;
  font-weight: 600 !important;
  font-size: 14px !important;
  border-radius: var(--radius-sm);
  border-bottom: none !important;
}
.mobile-cta:hover { filter: brightness(0.9) !important; }

/* ── Footer ──────────────────────────────────── */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.5);
  padding: 56px clamp(20px, 4vw, 32px);
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  align-items: center; gap: 32px;
}
footer .footer-inner > div:first-child { display: flex; align-items: center; gap: 10px; }
.footer-logo-img { height: 36px; width: auto; opacity: 0.9; }
.footer-logo-text { display: flex; flex-direction: column; line-height: 1; gap: 3px; }
.footer-logo-main { font-size: 17px; font-weight: 600; color: var(--white); letter-spacing: 0.02em; }
.footer-logo-sub  { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue-lt); }
.footer-center { text-align: center; font-size: 12px; }
.footer-right  { text-align: right; font-size: 13px; }
.footer-right a{ color: rgba(255,255,255,0.45); transition: color 0.2s; display: block; margin-top: 6px; }
.footer-right a:hover { color: var(--blue-lt); }
.footer-right p{
  margin-left: auto
}
/* ── Cards (shared) ──────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: box-shadow 0.25s, transform 0.25s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ── Form Base ───────────────────────────────── */
.form-wrap {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 48px;
  box-shadow: var(--shadow-sm);
}
.form-group { margin-bottom: 22px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
input, textarea, select {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input:focus, textarea:focus, select:focus {
  background: var(--bg-card);
  border-color: var(--blue-h);
  box-shadow: 0 0 0 3px rgba(95,154,198,0.12);
}
input.err, textarea.err, select.err { border-color: #dc4a3a; background: #fef6f5; }
textarea { resize: vertical; min-height: 120px; }

.field-err { display: none; font-size: 13px; color: #dc4a3a; margin-top: 5px; }
.field-err.show { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.btn-submit {
  width: 100%; padding: 16px;
  background: var(--navy); color: var(--white);
  font-family: var(--font); font-size: 15px; font-weight: 600;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.2s; margin-top: 8px;
}
.btn-submit:hover { background: #374a6a; box-shadow: 0 4px 16px rgba(42,54,82,0.2); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.form-status {
  margin-top: 20px; padding: 16px 20px; font-size: 14px;
  border-radius: var(--radius-sm); display: none;
}
.form-status.ok  { display: block; background: #f0faf5; border: 1px solid #b8e6d0; color: #2e7d5e; }
.form-status.fail { display: block; background: #fef6f5; border: 1px solid #f0c0ba; color: #dc4a3a; }

/* Dark mode form overrides */
@media (prefers-color-scheme: dark) {
  input.err, textarea.err, select.err { border-color: #e55b4a; background: rgba(229,91,74,0.1); }
  .form-status.ok  { background: rgba(46,125,94,0.15); border-color: rgba(46,125,94,0.3); color: #6dd4a8; }
  .form-status.fail { background: rgba(229,91,74,0.12); border-color: rgba(229,91,74,0.25); color: #f08878; }
  .btn-submit { background: var(--blue-h); }
  .btn-submit:hover { filter: brightness(0.85); }
}

/* ── Page Hero (inner pages) ─────────────────── */
.page-hero {
  background: var(--bg-alt);
  padding: calc(var(--nav-h) + clamp(48px, 7vw, 88px)) clamp(20px, 4vw, 32px) clamp(48px, 7vw, 80px);
  border-bottom: 1px solid var(--border);
}
.page-hero-inner { max-width: var(--max-w); margin: 0 auto; }
.page-hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 14px;
}
.page-hero h1 em { font-style: italic; color: var(--blue-h); font-weight: 600; }
.page-hero p { font-size: 17px; color: var(--text-muted); line-height: 1.7; max-width: 52ch; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 860px) {
  .nav-links   { display: none; }
  .burger      { display: flex; }
  .mobile-menu { display: block; }

  .footer-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  footer .footer-inner > div:first-child { justify-content: center; }
  .footer-right { text-align: center; }

  .form-wrap { padding: 32px 24px; }
  .form-row  { grid-template-columns: 1fr; }
}
