/* ==========================================================
   DUNBLANE COMMUNITY SPEEDWATCH — Stylesheet
   ----------------------------------------------------------
   Edit colours and fonts in the :root section at the top.
   The rest of the file uses those variables, so changing
   one value updates the whole site consistently.
   ========================================================== */

/* ---------- DESIGN TOKENS (colours, type, spacing) ---------- */
:root {
  /* Brand palette — warm, civic, calm */
  --c-bg:        #f5f1ea;   /* warm off-white background */
  --c-surface:   #fbf8f2;   /* card background */
  --c-ink:       #1d2a3a;   /* deep navy — main text */
  --c-ink-soft:  #4b5b6e;   /* secondary text */
  --c-muted:     #8a8478;   /* tertiary text */
  --c-line:      #e3dccd;   /* hairlines and dividers */

  --c-primary:   #1d3557;   /* deep navy — buttons, headings accent */
  --c-primary-2: #2a4a73;   /* hover */
  --c-accent:    #3d7a5a;   /* muted forest green — positive */
  --c-warn:      #b87333;   /* warm amber — caution */
  --c-danger:    #9b2c2c;   /* deep red — high risk */

  /* Typography */
  --f-display: "Fraunces", "Georgia", serif;
  --f-body:    "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Layout */
  --container: 1180px;
  --radius:    14px;
  --radius-lg: 22px;

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- LAYOUT HELPER ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--c-ink);
  margin: 0 0 .5em;
  line-height: 1.1;
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 400; }
h1 em { font-style: italic; color: var(--c-primary); font-weight: 500; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.15rem; font-weight: 600; }
p  { margin: 0 0 1em; color: var(--c-ink-soft); }

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-body);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-primary);
  background: rgba(29,53,87,.08);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 1.2rem;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: .95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.btn-sm  { padding: 10px 18px; font-size: .88rem; }
.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-2); }

.btn-ghost   { background: transparent; color: var(--c-primary); }
.btn-ghost:hover { background: rgba(29,53,87,.06); }

.btn-outline { background: transparent; color: var(--c-primary); border-color: var(--c-primary); }
.btn-outline:hover { background: var(--c-primary); color: #fff; }

.btn-light   { background: var(--c-surface); color: var(--c-primary); }
.btn-outline-light {
  background: transparent;
  color: var(--c-surface);
  border-color: rgba(255,255,255,.4);
}
.btn-outline-light:hover { background: rgba(255,255,255,.1); }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245,241,234,.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 48px;
  height: 44px;
  object-fit: contain;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; }
.brand-tag  { font-size: .72rem; color: var(--c-muted); letter-spacing: .04em; }

.primary-nav { display: none; gap: 28px; }
.primary-nav a {
  font-size: .92rem;
  color: var(--c-ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color .2s var(--ease);
}
.primary-nav a:hover { color: var(--c-primary); }
.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1.5px;
  background: var(--c-primary);
  transition: width .25s var(--ease);
}
.primary-nav a:hover::after { width: 100%; }

@media (min-width: 880px) {
  .primary-nav { display: flex; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: 80px 0 60px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(29,53,87,.10), transparent 55%),
    radial-gradient(ellipse at 10% 100%, rgba(61,122,90,.08), transparent 50%);
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 48px;
  align-items: center;
}
@media (min-width: 880px) {
  .hero-inner { grid-template-columns: 1.4fr 1fr; gap: 64px; }
}
.hero-text .lede {
  font-size: 1.15rem;
  max-width: 60ch;
  margin-bottom: 28px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.hero-logo {
  width: 100%;
  max-width: 460px;
  height: auto;
  display: block;
  filter: drop-shadow(0 24px 32px rgba(29,42,58,.15));
  animation: floatIn 1s var(--ease) both;
}
@keyframes floatIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- MARQUEE ---------- */
.marquee {
  background: var(--c-primary);
  color: var(--c-surface);
  padding: 16px 0;
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.marquee-track {
  display: flex;
  gap: 36px;
  white-space: nowrap;
  animation: marquee 50s linear infinite;
  width: max-content;
  font-size: .95rem;
  font-weight: 500;
}
.marquee-track span:nth-child(even) { color: rgba(255,255,255,.35); }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---------- INTRO ---------- */
.intro { padding: 80px 0; }
.intro-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.intro-inner p { font-size: 1.2rem; }

/* ---------- SECTION HEADER (reusable) ---------- */
.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
}
.section-header p { font-size: 1.05rem; }

/* ---------- EVIDENCE / CHARTS ---------- */
.evidence { padding: 80px 0; background: var(--c-surface); border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); }
.data-notice {
  background: transparent;
  color: var(--c-muted);
  padding: 0 18px;
  margin: 0 auto 36px;
  max-width: 720px;
  text-align: center;
  font-size: .85rem;
  font-style: italic;
}
.charts-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .charts-grid { grid-template-columns: 1fr 1fr; }
}
.chart-card {
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
}
.chart-card header h3 { margin-bottom: 4px; font-family: var(--f-display); font-size: 1.4rem; font-weight: 500; }
.chart-card header p { margin: 0 0 20px; color: var(--c-muted); font-size: .85rem; }
.chart {
  width: 100%;
  height: 240px;
}
.chart-card footer { margin-top: 16px; }
.chip {
  display: inline-flex;
  align-items: center;
  font-size: .8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
}
.chip-warn { background: rgba(184,115,51,.12); color: #7a4d20; }
.chip-good { background: rgba(61,122,90,.14); color: #2c5a42; }
.chip-bad  { background: rgba(155,44,44,.12);  color: #6e1f1f; }
.evidence-note {
  margin-top: 32px;
  text-align: center;
  font-size: .85rem;
  color: var(--c-muted);
}

/* ---------- HOW IT WORKS ---------- */
.how-it-works { padding: 80px 0; }
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 26px;
  position: relative;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.steps li:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -24px rgba(29,42,58,.20);
}
.step-num {
  display: block;
  font-family: var(--f-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--c-primary);
  opacity: .35;
  margin-bottom: 8px;
}
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; font-size: .92rem; }

/* ---------- WHY MATTERS ---------- */
.why-matters { padding: 80px 0; background: var(--c-surface); border-top: 1px solid var(--c-line); border-bottom: 1px solid var(--c-line); }
.reasons-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  max-width: 880px;
  margin: 0 auto;
}
@media (min-width: 720px) { .reasons-grid { grid-template-columns: 1fr 1fr; } }
.reasons-grid article {
  padding: 24px 26px;
  background: var(--c-bg);
  border-radius: var(--radius);
  border-left: 3px solid var(--c-accent);
}
.reasons-grid h3 { margin-bottom: 6px; }
.reasons-grid p  { margin: 0; font-size: .94rem; }

/* ---------- VOLUNTEER CTA ---------- */
.volunteer-cta {
  padding: 80px 0;
  background: var(--c-primary);
  color: var(--c-surface);
  text-align: center;
}
.volunteer-cta h2 { color: var(--c-surface); max-width: 18ch; margin: 0 auto .6em; }
.volunteer-cta p  { color: rgba(255,255,255,.78); max-width: 56ch; margin: 0 auto 28px; font-size: 1.05rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 18px; }
.fineprint { font-size: .82rem; color: rgba(255,255,255,.55); margin: 0; }

/* ---------- PARTNERS ---------- */
.partners { padding: 50px 0; }
.partners-label {
  text-align: center;
  font-size: .8rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin-bottom: 18px;
}
.partners-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
  justify-content: center;
  gap: 18px 36px;
}
.partners-list li {
  font-family: var(--f-display);
  font-size: 1.05rem;
  color: var(--c-ink-soft);
  font-style: italic;
}

/* ---------- GOVERNANCE ---------- */
.governance { padding: 60px 0 80px; }
.governance-card {
  max-width: 820px;
  margin: 0 auto;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  text-align: center;
}
.governance-card .section-kicker { margin-bottom: 1rem; }
.governance-card p { font-size: 1.02rem; max-width: 56ch; margin: 0 auto 22px; }

/* ---------- CONTACT ---------- */
.contact {
  padding: 80px 0;
  background: var(--c-primary);
  color: var(--c-surface);
}
.contact-inner { text-align: center; max-width: 600px; margin: 0 auto; }
.contact h2 { color: var(--c-surface); }
.contact .section-kicker {
  background: rgba(255,255,255,.12);
  color: var(--c-surface);
}
.contact p { color: rgba(255,255,255,.78); }
.contact-email {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--f-display);
  font-size: 1.5rem;
  color: var(--c-surface);
  border-bottom: 1px solid rgba(255,255,255,.4);
  padding-bottom: 4px;
  transition: border-color .2s var(--ease);
}
.contact-email:hover { border-bottom-color: var(--c-surface); }

/* ---------- FOOTER ---------- */
.site-footer {
  background: #131c28;
  color: rgba(255,255,255,.6);
  padding: 36px 0;
  font-size: .88rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
}
.footer-brand {
  font-family: var(--f-display);
  color: var(--c-surface);
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.footer-meta { margin: 0; }

/* ---------- ACCESSIBILITY: respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
}
