:root {
  --primary: #2c3e50;
  --primary-dark: #1a252f;
  --off-white: #f7f8fb;
  --white: #ffffff;
  --accent: #c1502e;
  --accent-deep: #a13f22;
  --charcoal: #16192a;
  --gray: #5c6270;
  --line: #e4e6ee;

  --radius: 8px;
  --max-width: 1120px;
  --font-sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

/* ---------- Scroll progress ---------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 100;
  transition: width 0.1s linear;
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.pillar-row .reveal:nth-child(2),
.card-grid .reveal:nth-child(2),
.needs-grid .reveal:nth-child(2),
.subject-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
.pillar-row .reveal:nth-child(3),
.card-grid .reveal:nth-child(3),
.subject-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
.card-grid .reveal:nth-child(4),
.subject-grid .reveal:nth-child(4) { transition-delay: 0.3s; }

.timeline li.reveal:nth-child(1) { transition-delay: 0s; }
.timeline li.reveal:nth-child(2) { transition-delay: 0.1s; }
.timeline li.reveal:nth-child(3) { transition-delay: 0.2s; }
.timeline li.reveal:nth-child(4) { transition-delay: 0.3s; }
.timeline li.reveal:nth-child(5) { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Scroll cue ---------- */

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 12px;
}

.scroll-cue span {
  display: block;
  width: 4px;
  height: 8px;
  margin: 6px auto 0;
  border-radius: 2px;
  background: var(--accent);
  animation: scroll-cue-move 1.8s ease infinite;
}

@keyframes scroll-cue-move {
  0% { opacity: 0; transform: translateY(0); }
  35% { opacity: 1; }
  70% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 0; transform: translateY(0); }
}

@media (max-width: 640px) {
  .scroll-cue { display: none; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--charcoal);
  background: var(--off-white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  margin-bottom: 0.7em;
}

h3 { font-size: 1.08rem; font-weight: 600; }

p { margin: 0 0 1em; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.75em;
}

.lede {
  font-size: 1.1rem;
  color: var(--gray);
  max-width: 68ch;
}
.lede.small { font-size: 0.98rem; }

.statement {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  font-weight: 600;
  color: var(--primary);
  max-width: none;
  text-align: center;
  margin: 2.5rem 0 0;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 248, 251, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}

.wordmark {
  display: flex;
  align-items: center;
}

.wordmark-main {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  gap: 28px;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--charcoal);
}

.site-nav a:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover { background: var(--accent-deep); }

.btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.5);
  color: var(--white);
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); border-color: var(--white); }

.section .btn-ghost {
  border-color: var(--primary);
  color: var(--primary);
}
.section .btn-ghost:hover { background: var(--primary); color: var(--white); }

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background: linear-gradient(155deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 110px 0 110px;
}

.hero-inner { max-width: 760px; }

.hero .eyebrow { color: var(--accent); filter: brightness(1.25); }

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.3rem);
  color: var(--white);
  margin-bottom: 0.4em;
  font-weight: 800;
}

.hero-sub {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.85);
  max-width: 56ch;
  margin-bottom: 2em;
}

.hero-badge {
  margin-top: 32px;
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 6px 14px;
  border-radius: 999px;
}

/* ---------- Sections ---------- */

.section {
  padding: 76px 0;
}

.section-alt {
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-dark {
  background: var(--primary);
  color: var(--white);
}
.section-dark .eyebrow { color: var(--accent); filter: brightness(1.3); }
.section-dark .lede { color: rgba(255,255,255,0.85); }

/* ---------- Pillars (compact, no card chrome) ---------- */

.pillar-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 2.25rem 0 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.pillar h3 {
  color: var(--primary);
  margin-bottom: 0.4em;
}

.pillar p {
  color: var(--gray);
  font-size: 0.96rem;
  margin: 0;
}

/* ---------- Subject grid (NCAA / Olympics / RWC) ---------- */

.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 2rem;
}

.subject-grid.four {
  grid-template-columns: repeat(4, 1fr);
}

.subject {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.subject-logo {
  height: 52px;
  width: auto;
  max-width: 100%;
  margin-bottom: 18px;
}

.subject-logo-wide {
  height: 58px;
}

.subject p {
  color: var(--gray);
  font-size: 0.94rem;
  margin: 0;
}

/* ---------- Icon badges ---------- */

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(193, 80, 46, 0.1);
  color: var(--accent);
  margin-bottom: 16px;
}

.icon-badge svg {
  width: 22px;
  height: 22px;
}

.icon-badge-good {
  background: rgba(46, 139, 87, 0.12);
  color: #2e8b57;
}

.icon-badge-bad {
  background: rgba(92, 98, 112, 0.12);
  color: var(--gray);
}

/* ---------- Needs grid (Easy to Play) ---------- */

.needs-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 1fr;
  margin-top: 2.5rem;
}

.needs-col {
  background: var(--off-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
}

.needs-col h4 {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1em;
}

.needs-col ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--gray);
}

.needs-col li { margin-bottom: 0.55em; }
.needs-col li:last-child { margin-bottom: 0; }

/* ---------- Existing Infrastructure (banner) ---------- */

.infra-band {
  background: var(--primary-dark);
  color: var(--white);
}

.infra-band .eyebrow { color: var(--accent); filter: brightness(1.3); }
.infra-band h2 { color: var(--white); }

.infra-lede {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.88);
  max-width: 72ch;
}

.infra-inline {
  color: var(--accent);
  filter: brightness(1.35);
  font-weight: 800;
}

/* ---------- Montana program map ---------- */

.map-wrap {
  margin: 2.75rem auto 0;
  max-width: 720px;
}

.montana-map {
  width: 100%;
  height: auto;
  overflow: visible;
}

.map-outline {
  fill: rgba(255, 255, 255, 0.05);
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 2;
}

.map-city {
  cursor: pointer;
  outline: none;
}

.map-radius {
  fill: var(--accent);
  fill-opacity: 0;
  stroke: var(--accent);
  stroke-opacity: 0;
  stroke-width: 1.5;
  transition: fill-opacity 0.25s ease, stroke-opacity 0.25s ease;
}

.map-city:hover .map-radius,
.map-city:focus .map-radius,
.map-city.active .map-radius {
  fill-opacity: 0.22;
  stroke-opacity: 0.6;
}

.map-dot {
  fill: var(--accent);
  stroke: var(--primary-dark);
  stroke-width: 2;
  transition: r 0.2s ease;
}

.map-city:hover .map-dot,
.map-city:focus .map-dot,
.map-city.active .map-dot {
  r: 8;
}

.map-label {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  fill: rgba(255, 255, 255, 0.6);
  text-anchor: middle;
  pointer-events: none;
  transition: fill 0.2s ease;
}

.map-city:hover .map-label,
.map-city:focus .map-label,
.map-city.active .map-label {
  fill: var(--white);
}

.map-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  gap: 22px;
  margin-top: 2.25rem;
  grid-template-columns: 1fr;
}

.card-grid.two { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--off-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
}

.section-alt .card { background: var(--off-white); }

.card h3 { color: var(--primary); }

.card p:last-child { margin-bottom: 0; }
.card p { color: var(--gray); font-size: 0.96rem; }

/* ---------- Timeline ---------- */

.timeline {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  border-left: 2px solid var(--line);
}

.timeline li {
  position: relative;
  padding: 0 0 2rem 32px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--off-white);
}

.timeline li:last-child { padding-bottom: 0; }

.timeline-date {
  display: block;
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 0.2em;
}

.timeline-desc {
  display: block;
  color: var(--gray);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 60px 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding-bottom: 44px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.footer-brand .wordmark-main { color: var(--white); font-size: 1.15rem; font-weight: 700; }

.footer-contact h3 {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  filter: brightness(1.3);
  margin-bottom: 0.9em;
}

.footer-contact dl {
  margin: 0;
  display: grid;
  gap: 10px;
}

.footer-contact dl > div {
  display: flex;
  gap: 10px;
  font-size: 0.92rem;
}

.footer-contact dt {
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  min-width: 70px;
}

.footer-contact dd {
  margin: 0;
  color: rgba(255,255,255,0.8);
}

.footer-contact dd a:hover { color: var(--accent); filter: brightness(1.4); }

.footer-bottom {
  padding: 20px 24px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .pillar-row { grid-template-columns: 1fr 1fr; }
  .needs-grid { grid-template-columns: 1fr; }
  .subject-grid,
  .subject-grid.four { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--off-white);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
  }

  .site-nav.open { display: flex; }

  .site-nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .site-nav a:last-child { border-bottom: none; }

  .hero { padding: 76px 0 56px; }

  .section { padding: 52px 0; }

  .infra-lede { font-size: 1.08rem; }

  .pillar-row { grid-template-columns: 1fr; gap: 24px; }

  .subject-grid,
  .subject-grid.four { grid-template-columns: 1fr; gap: 28px; }

  .card-grid.two { grid-template-columns: 1fr; }

  .hero-actions { flex-direction: column; }
  .hero-actions .btn { text-align: center; }
}
