/* ============================================================
   CPES — Conestoga Power & Energy Society
   Theme: dark "energy control room" with electric accents
   ============================================================ */

:root {
  /* Brand / energy palette */
  --navy-900: #060d18;
  --navy-850: #081222;
  --navy-800: #0a1628;
  --navy-700: #0f2138;
  --navy-600: #16304f;
  --blue-600: #1657c0;   /* Conestoga blue */
  --blue-500: #1e6fe0;
  --blue-400: #3b8aff;
  --cyan-400: #22d3ee;   /* energy */
  --teal-300: #5eead4;
  --amber-400: #fbbf24;  /* spark */

  --text: #e9eff7;
  --muted: #9fb0c5;
  --muted-dim: #6e7f96;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --card: rgba(255, 255, 255, 0.035);
  --card-hover: rgba(255, 255, 255, 0.06);

  --grad: linear-gradient(120deg, var(--cyan-400), var(--blue-400) 55%, var(--blue-500));
  --grad-warm: linear-gradient(120deg, var(--teal-300), var(--cyan-400) 40%, var(--amber-400));

  --radius: 16px;
  --radius-sm: 10px;
  --container: 1180px;

  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --glow: 0 0 0 1px rgba(34, 211, 238, 0.35), 0 12px 40px -10px rgba(34, 211, 238, 0.35);

  --font-head: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--navy-900);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Layered background glows behind the canvas */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60rem 40rem at 80% -10%, rgba(30, 111, 224, 0.18), transparent 60%),
    radial-gradient(50rem 40rem at 0% 10%, rgba(34, 211, 238, 0.12), transparent 55%),
    radial-gradient(40rem 30rem at 50% 110%, rgba(251, 191, 36, 0.08), transparent 60%),
    var(--navy-900);
}

#grid-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}
.container.narrow { max-width: 820px; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  background: var(--blue-500);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { left: 16px; }

/* ===== Typography ===== */
h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1rem; }

.grad-text {
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kicker {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cyan-400);
  margin: 0 0 0.75rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 999px;
  padding: 0.7em 1.4em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--cyan-400); outline-offset: 3px; }
.btn-lg { padding: 0.85em 1.7em; font-size: 1rem; }
.btn-sm { padding: 0.5em 1.05em; font-size: 0.85rem; }

.btn-primary {
  background: var(--grad);
  color: #04111f;
  box-shadow: 0 10px 30px -10px rgba(34, 211, 238, 0.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(34, 211, 238, 0.7); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); transform: translateY(-2px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 600;
  color: var(--cyan-400);
  font-family: var(--font-head);
  font-size: 0.92rem;
}
.link-arrow span { transition: transform 0.2s ease; }
.link-arrow:hover span { transform: translateX(4px); }

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(6, 13, 24, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--font-head); font-size: 1.15rem; letter-spacing: 0.02em; }
.brand-text small { color: var(--muted); font-size: 0.72rem; }

.nav-menu { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav-menu a { font-size: 0.95rem; color: var(--muted); font-weight: 500; transition: color 0.2s ease; }
.nav-menu a:hover, .nav-menu a.active { color: var(--text); }
.nav-menu .btn { color: #04111f; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero { position: relative; padding: clamp(64px, 12vh, 130px) 0 70px; overflow: hidden; }
.hero-inner { max-width: 880px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-head);
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.45em 1em;
  border-radius: 999px;
  margin-bottom: 1.6rem;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan-400);
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}
.hero h1 { margin-bottom: 1.4rem; }
.lede { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--muted); max-width: 640px; margin-bottom: 2rem; }
.lede strong { color: var(--text); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 3rem; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 720px;
}
.hero-stats li {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.hero-stats strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.7rem;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-stats span { font-size: 0.82rem; color: var(--muted); }

.hero-glow {
  position: absolute;
  right: -10%;
  top: 0;
  width: 50vw;
  height: 100%;
  background: radial-gradient(40rem 30rem at 70% 30%, rgba(34, 211, 238, 0.16), transparent 60%);
  pointer-events: none;
}

/* ===== Marquee ===== */
.marquee {
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  padding: 14px 0;
}
.marquee-track {
  display: flex;
  gap: 28px;
  width: max-content;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  animation: marquee 38s linear infinite;
}
.marquee-track span { white-space: nowrap; }
.marquee-track span:nth-child(odd) { color: var(--text); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== Sections ===== */
.section { padding: clamp(72px, 10vh, 120px) 0; }
.section-alt { background: linear-gradient(180deg, rgba(255,255,255,0.018), transparent); border-block: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head h2 { margin-bottom: 0.6rem; }
.section-sub { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* ===== Cards (generic) ===== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); background: var(--card-hover); }

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: start; }
.about-lead p { font-size: 1.08rem; color: var(--muted); }
.about-lead p:first-child { color: var(--text); }
.about-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.about-points li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  color: var(--muted);
}
.about-points .dot {
  flex: none;
  width: 9px; height: 9px; margin-top: 7px;
  border-radius: 50%;
  background: var(--grad-warm);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.7);
}

/* ===== Pillars ===== */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.pillar-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--cyan-400);
  margin-bottom: 18px;
}
.pillar-icon svg { width: 24px; height: 24px; }
.pillar h3 { margin-bottom: 0.5rem; }
.pillar p { color: var(--muted); font-size: 0.95rem; margin: 0; }

/* ===== Timeline ===== */
.timeline { display: grid; gap: 36px; }
.timeline-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0 4px;
}
.timeline-line {
  position: absolute;
  left: 0; right: 0; top: 22px;
  height: 3px;
  background: var(--line-strong);
  border-radius: 3px;
  overflow: hidden;
}
.timeline-progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.7);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.tl-node {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  color: var(--muted);
  font-family: var(--font-body);
}
.tl-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--navy-700);
  border: 2px solid var(--line-strong);
  transition: all 0.25s ease;
}
.tl-node:hover .tl-dot { border-color: var(--cyan-400); }
.tl-node[aria-selected="true"] .tl-dot {
  background: var(--grad);
  border-color: transparent;
  box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.18), 0 0 18px rgba(34, 211, 238, 0.7);
  transform: scale(1.15);
}
.tl-label { font-size: 0.78rem; font-weight: 600; text-align: center; line-height: 1.25; }
.tl-node[aria-selected="true"] .tl-label { color: var(--text); }
.tl-node:focus-visible { outline: none; }
.tl-node:focus-visible .tl-dot { outline: 2px solid var(--cyan-400); outline-offset: 3px; }

.timeline-detail {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  min-height: 180px;
}
.td-status {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-head); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 0.35em 0.85em; border-radius: 999px;
  margin-bottom: 14px;
}
.td-status.now { color: var(--cyan-400); background: rgba(34, 211, 238, 0.12); }
.td-status.upcoming { color: var(--blue-400); background: rgba(59, 138, 255, 0.12); }
.td-status.goal { color: var(--amber-400); background: rgba(251, 191, 36, 0.12); }
.td-date { font-family: var(--font-head); color: var(--muted); font-size: 0.95rem; margin-bottom: 4px; }
.timeline-detail h3 { font-size: 1.5rem; margin-bottom: 10px; }
.timeline-detail p { color: var(--muted); margin: 0; max-width: 60ch; }
.td-enter { animation: fadeUp 0.4s ease; }

/* ===== Team ===== */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.member { text-align: center; }
.avatar {
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 1.4rem;
  color: #04111f;
  background: var(--grad);
}
.avatar-open {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}
.member h3 { margin-bottom: 4px; }
.member-role { font-family: var(--font-head); font-size: 0.85rem; color: var(--cyan-400); margin-bottom: 12px; }
.member-open .member-role { color: var(--amber-400); }
.member-bio { color: var(--muted); font-size: 0.9rem; margin-bottom: 14px; }

/* ===== Events ===== */
.events-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.event { display: flex; flex-direction: column; }
.event-tag {
  align-self: flex-start;
  font-family: var(--font-head); font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0.3em 0.7em; border-radius: 999px; margin-bottom: 14px;
}
.tag-meeting { color: var(--muted); background: rgba(255,255,255,0.06); }
.tag-event { color: var(--cyan-400); background: rgba(34, 211, 238, 0.12); }
.tag-gather { color: var(--amber-400); background: rgba(251, 191, 36, 0.12); }
.event-month { font-size: 0.8rem; color: var(--muted-dim); margin-bottom: 6px; font-family: var(--font-head); }
.event h3 { margin-bottom: 8px; }
.event p { color: var(--muted); font-size: 0.92rem; margin: 0; }
.events-note { text-align: center; color: var(--muted); margin-top: 32px; }

/* ===== FAQ ===== */
.faq { display: grid; gap: 12px; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); overflow: hidden; }
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: none; border: 0; cursor: pointer;
  padding: 20px 22px;
  font-family: var(--font-head); font-weight: 600; font-size: 1.02rem;
  color: var(--text); text-align: left;
}
.faq-icon { position: relative; flex: none; width: 16px; height: 16px; }
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; top: 50%; left: 0;
  width: 16px; height: 2px; background: var(--cyan-400); border-radius: 2px;
  transition: transform 0.25s ease;
}
.faq-icon::after { transform: rotate(90deg); }
.faq-q[aria-expanded="true"] .faq-icon::after { transform: rotate(0); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-a p { padding: 0 22px 20px; color: var(--muted); margin: 0; }
.faq-a a { color: var(--cyan-400); text-decoration: underline; text-underline-offset: 3px; }

/* ===== Join ===== */
.join-section { padding-bottom: clamp(80px, 12vh, 130px); }
.join-card {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: clamp(28px, 5vw, 56px);
  background:
    radial-gradient(40rem 24rem at 100% 0%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(30rem 24rem at 0% 100%, rgba(30, 111, 224, 0.14), transparent 60%),
    rgba(255, 255, 255, 0.025);
  position: relative;
  overflow: hidden;
}
.join-text h2 { margin-bottom: 0.7rem; }
.join-text > p { color: var(--muted); font-size: 1.1rem; max-width: 46ch; }
.join-cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 16px; }
.join-fine { font-size: 0.82rem; color: var(--muted-dim); margin: 0; max-width: 44ch; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; align-content: start; }
.contact-list li { display: flex; flex-direction: column; gap: 3px; border-left: 2px solid var(--line-strong); padding-left: 16px; }
.contact-label { font-family: var(--font-head); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted-dim); }
.contact-list a, .contact-list span:not(.contact-label) { color: var(--text); font-size: 0.98rem; }
.contact-list a:hover { color: var(--cyan-400); }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 32px; background: rgba(6, 13, 24, 0.6); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; margin-bottom: 32px; }
.footer-brand { display: flex; gap: 14px; max-width: 420px; align-items: flex-start; }
.footer-brand strong { font-family: var(--font-head); }
.footer-brand p { color: var(--muted-dim); font-size: 0.85rem; margin: 4px 0 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }
.footer-nav a { color: var(--muted); font-size: 0.92rem; }
.footer-nav a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted-dim); font-size: 0.85rem; }
.footer-bottom p { margin: 0; }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .pillars, .team-grid, .events-grid { grid-template-columns: repeat(2, 1fr); }
  .join-card { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: rgba(8, 18, 34, 0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 16px 24px 24px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
  }
  .nav-menu.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-menu li a { padding: 12px 4px; display: block; }
  .nav-menu .btn { text-align: center; justify-content: center; margin-top: 8px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .timeline-track { overflow-x: auto; gap: 28px; padding-bottom: 14px; scrollbar-width: thin; }
  .tl-node { min-width: 92px; }
  .tl-label { font-size: 0.72rem; }
}
@media (max-width: 480px) {
  .pillars, .team-grid, .events-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .marquee-track, .pulse-dot { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .td-enter { animation: none; }
  * { scroll-behavior: auto !important; }
}
