/* =================================================================
   Start Young: Building a More Involved Bluffdale
   Shared stylesheet — change the design here, once, for every page.

   Sections:
     1. Design tokens (colors, type, spacing)   <- tweak the look here
     2. Base / reset
     3. Layout helpers (container, sections)
     4. Header + navigation
     5. Hero
     6. Buttons + links
     7. Cards + grids (organizations, events, sections)
     8. Prose (About page, intros)
     9. Footer
    10. Motion + accessibility
   ================================================================= */

/* ---------- 1. DESIGN TOKENS ------------------------------------ */
:root {
  /* Palette — a Utah-sunrise civic poster.
     Deep dusk sky, a rising gold sun, western clay, foothill sage. */
  --sky:        #1c2541;   /* deep dusk indigo — dark surfaces, headings */
  --sky-2:      #2c3a66;   /* lighter indigo — gradients */
  --sun:        #f5a524;   /* sunrise gold — primary accent / buttons */
  --sun-soft:   #ffd884;   /* light gold — glows, highlights */
  --clay:       #c0492f;   /* western clay red — secondary accent */
  --sage:       #6f8466;   /* foothill sage — tertiary accent */
  --cream:      #fbf5e9;   /* paper — page background */
  --cream-2:    #f4ebd8;   /* slightly deeper cream — cards, panels */
  --ink:        #20232f;   /* warm near-black — body text */
  --muted:      #5b6373;   /* muted text — captions, meta */
  --line:       rgba(28, 37, 65, 0.14);  /* hairlines / borders */

  /* Typography */
  --font-display: "Archivo", system-ui, "Segoe UI", sans-serif;
  --font-body:    "Public Sans", system-ui, "Segoe UI", sans-serif;

  /* Fluid type scale */
  --step--1: clamp(0.83rem, 0.79rem + 0.18vw, 0.94rem);
  --step-0:  clamp(1rem, 0.95rem + 0.25vw, 1.13rem);
  --step-1:  clamp(1.2rem, 1.12rem + 0.4vw, 1.5rem);
  --step-2:  clamp(1.44rem, 1.3rem + 0.7vw, 2rem);
  --step-3:  clamp(1.73rem, 1.5rem + 1.15vw, 2.7rem);
  --step-4:  clamp(2.4rem, 1.9rem + 2.5vw, 4.5rem);

  /* Spacing + shape */
  --container: 1120px;
  --gap: clamp(1rem, 0.7rem + 1.5vw, 2rem);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28, 37, 65, 0.06),
            0 10px 30px -12px rgba(28, 37, 65, 0.22);
}

/* ---------- 2. BASE / RESET ------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--sky);
}

a { color: var(--clay); text-underline-offset: 3px; }
a:hover { color: var(--sun); }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 3. LAYOUT HELPERS ----------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 0.6rem + 2.5vw, 2.5rem);
}

.section { padding-block: clamp(3rem, 2rem + 5vw, 6rem); }
.section--tight { padding-block: clamp(2rem, 1.4rem + 3vw, 3.5rem); }

/* An eyebrow label that encodes real context (page / category) */
.eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clay);
  margin: 0 0 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 2px;
  background: var(--sun);
}

.section-title { font-size: var(--step-3); max-width: 18ch; }
.section-lead {
  max-width: 60ch;
  margin-top: 1rem;
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.5;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--sky);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- 4. HEADER + NAVIGATION ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--sky);
  text-decoration: none;
}
.brand:hover { color: var(--sky); }
.brand__mark { flex: none; width: 30px; height: 30px; }
.brand__text small {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--sky);
  color: #fff;
  border: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }

.nav { display: none; }

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.nav-list a {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--sky);
  text-decoration: none;
  padding: 0.7rem 0.4rem;
  border-radius: var(--radius-sm);
}
.nav-list a:hover { background: var(--cream-2); color: var(--sky); }
.nav-list a[aria-current="page"] { color: var(--clay); }
.nav-list a[aria-current="page"]::after {
  content: "";
  display: block;
  height: 2px;
  width: 1.4rem;
  margin-top: 2px;
  background: var(--sun);
}

/* Open state (mobile) */
.nav.is-open {
  display: block;
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 0.75rem clamp(1.1rem, 0.6rem + 2.5vw, 2.5rem) 1.25rem;
}

@media (min-width: 820px) {
  .nav-toggle { display: none; }
  .nav { display: block; }
  .nav-list { flex-direction: row; align-items: center; gap: 0.4rem; }
  .nav-list a { padding: 0.5rem 0.85rem; }
}

/* ---------- 5. HERO --------------------------------------------- */
.hero {
  position: relative;
  background:
    radial-gradient(120% 90% at 72% 8%, var(--sky-2) 0%, var(--sky) 55%);
  color: var(--cream);
  overflow: hidden;
  isolation: isolate;
}
.hero__inner {
  position: relative;
  z-index: 2;
  padding-block: clamp(3rem, 2rem + 7vw, 7rem) clamp(8rem, 6rem + 12vw, 14rem);
  max-width: 40rem;
}
.hero .eyebrow { color: var(--sun-soft); }
.hero .eyebrow::before { background: var(--sun); }
.hero__title {
  color: var(--cream);
  font-size: var(--step-4);
  font-weight: 900;
  letter-spacing: -0.03em;
}
.hero__title em {
  font-style: normal;
  color: var(--sun);
}
.hero__lead {
  margin-top: 1.25rem;
  font-size: var(--step-1);
  line-height: 1.5;
  color: color-mix(in srgb, var(--cream) 86%, transparent);
  max-width: 44ch;
}
.hero__cta {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}
/* The signature: a rising sun over layered foothills, anchored to the horizon */
.hero__scene {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* Compact header band for inner pages */
.page-hero {
  background: radial-gradient(130% 120% at 80% 0%, var(--sky-2) 0%, var(--sky) 60%);
  color: var(--cream);
  padding-block: clamp(2.5rem, 1.8rem + 4vw, 4.5rem);
}
.page-hero .eyebrow { color: var(--sun-soft); }
.page-hero .eyebrow::before { background: var(--sun); }
.page-hero h1 { color: var(--cream); font-size: var(--step-3); max-width: 20ch; }
.page-hero p {
  margin-top: 1rem;
  max-width: 60ch;
  color: color-mix(in srgb, var(--cream) 86%, transparent);
  font-size: var(--step-1);
  line-height: 1.5;
}

/* ---------- 6. BUTTONS ------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.8rem 1.3rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--sun); color: var(--sky); }
.btn--primary:hover { background: var(--sun-soft); color: var(--sky); }
.btn--ghost {
  background: transparent;
  color: var(--cream);
  border-color: color-mix(in srgb, var(--cream) 45%, transparent);
}
.btn--ghost:hover { color: var(--cream); border-color: var(--sun); }
.btn--ink { background: var(--sky); color: var(--cream); }
.btn--ink:hover { background: var(--sky-2); color: var(--cream); }
.btn .arrow { transition: transform 0.15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- 7. CARDS + GRIDS ------------------------------------ */
.grid {
  display: grid;
  gap: var(--gap);
  margin-top: clamp(1.75rem, 1rem + 3vw, 3rem);
  grid-template-columns: 1fr;
}
@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* Quick-link poster cards on the home page */
.tiles {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
  margin-top: clamp(1.75rem, 1rem + 3vw, 3rem);
}
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.6rem 1.5rem 1.4rem;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent, var(--sun));
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.tile__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.tile h3 { font-size: var(--step-2); }
.tile p { margin: 0; color: var(--muted); }
.tile__go {
  margin-top: auto;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--clay);
  display: inline-flex;
  gap: 0.4rem;
}

/* Content cards (organizations + events) */
.card {
  display: flex;
  flex-direction: column;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card__media {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--sky-2), var(--sky));
  overflow: hidden;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card__body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.35rem 1.4rem 1.5rem;
  flex: 1;
}
.card h3 { font-size: var(--step-1); }
.card p { margin: 0; color: var(--ink); }
.card__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  align-self: flex-start;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sky);
  background: var(--sun-soft);
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
}
.card__meta svg { width: 13px; height: 13px; }
.card__link {
  margin-top: auto;
  padding-top: 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ---------- 8. PROSE -------------------------------------------- */
.prose { max-width: 68ch; }
.prose h2 {
  font-size: var(--step-2);
  margin-top: 2.5rem;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 {
  font-size: var(--step-1);
  margin-top: 2rem;
  color: var(--clay);
}
.prose p { margin: 1rem 0; }
.prose strong { color: var(--sky); }

/* Bio block on the home page */
.bio {
  display: grid;
  gap: var(--gap);
  align-items: center;
  grid-template-columns: 1fr;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.bio__photo {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--sky-2), var(--sky));
}
.bio__photo img { width: 100%; height: 100%; object-fit: cover; }
.bio__text { padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.bio__text h2 { font-size: var(--step-2); }
.bio__text p { color: var(--ink); }
@media (min-width: 760px) {
  .bio { grid-template-columns: 0.85fr 1.15fr; }
  .bio__photo { aspect-ratio: auto; height: 100%; min-height: 320px; }
}

/* Get-involved action list */
.actions {
  display: grid;
  gap: var(--gap);
  margin-top: clamp(1.75rem, 1rem + 3vw, 3rem);
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .actions { grid-template-columns: repeat(2, 1fr); } }
.action {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.5rem 1.5rem 1.6rem;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-top: 4px solid var(--sun);
}
.action h3 { font-size: var(--step-1); }
.action p { margin: 0; color: var(--ink); }
.action a.card__link { color: var(--clay); }

/* A simple panel used for the contact / call-to-action strip */
.panel {
  background: var(--sky);
  color: var(--cream);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 1.2rem + 3vw, 3rem);
  text-align: center;
}
.panel h2 { color: var(--cream); font-size: var(--step-2); }
.panel p { color: color-mix(in srgb, var(--cream) 85%, transparent); max-width: 50ch; margin-inline: auto; }
.panel .btn { margin-top: 1.25rem; }

/* ---------- 9. FOOTER ------------------------------------------- */
.site-footer {
  background: var(--sky);
  color: color-mix(in srgb, var(--cream) 80%, transparent);
  padding-block: clamp(2.5rem, 2rem + 3vw, 4rem);
}
.footer-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.site-footer h2 { color: var(--cream); font-size: var(--step-1); }
.site-footer a { color: var(--sun-soft); }
.site-footer a:hover { color: var(--sun); }
.footer-nav { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.footer-nav a { font-family: var(--font-display); font-weight: 600; text-decoration: none; }
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.14);
  font-size: var(--step--1);
  color: color-mix(in srgb, var(--cream) 65%, transparent);
}

/* ---------- 10. MOTION + ACCESSIBILITY -------------------------- */
/* Reveal-on-scroll. The hidden start state only applies when JS is on
   (html gets a .js class), so content is always visible without JS. */
.js .reveal { opacity: 0; transform: translateY(16px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 0.6s ease, transform 0.6s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}
