/* ===== DEVCON Kids — code.org-inspired design ===== */
:root {
  --purple: #6c3fa0;
  --purple-dark: #4e2a78;
  --teal: #00b3a6;
  --teal-dark: #00857c;
  --orange: #ff8a3d;
  --yellow: #ffc627;
  --navy: #1e1e3f;
  --ink: #29235c;
  --cream: #fff9f2;
  --white: #ffffff;
  --gray: #5b5b7a;
  --radius: 18px;
  --shadow: 0 8px 30px rgba(41, 35, 92, 0.12);
  --font-head: "Fredoka", sans-serif;
  --font-body: "Nunito", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--purple); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; color: var(--navy); }

.container { width: min(1180px, 92%); margin: 0 auto; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.8rem 1.9rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  cursor: pointer;
  border: 3px solid transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--purple); color: var(--white); box-shadow: 0 5px 0 var(--purple-dark); }
.btn-primary:hover { background: var(--purple-dark); box-shadow: 0 3px 0 var(--purple-dark); }
.btn-outline { background: transparent; color: var(--purple); border-color: var(--purple); }
.btn-outline:hover { background: var(--purple); color: var(--white); }
.btn-light { background: var(--white); color: var(--purple); box-shadow: 0 5px 0 rgba(0,0,0,0.18); }
.btn-sm { font-size: 0.95rem; padding: 0.55rem 1.3rem; }
.btn-lg { font-size: 1.2rem; padding: 1rem 2.4rem; white-space: nowrap; }

/* ===== Announcement bar ===== */
.announcement {
  background: linear-gradient(90deg, var(--teal), var(--purple));
  color: var(--white);
  text-align: center;
  font-size: 0.92rem;
  padding: 0.55rem 1rem;
}
.announcement a { color: var(--yellow); font-weight: 700; text-decoration: none; }
.announcement a:hover { text-decoration: underline; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  box-shadow: 0 2px 14px rgba(41, 35, 92, 0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0;
}
.brand img { height: 44px; width: auto; }
.main-nav { display: flex; align-items: center; gap: 1.7rem; }
.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  transition: color 0.15s ease;
}
.main-nav a:hover { color: var(--purple); }
.main-nav .nav-cta { color: var(--white); }
.main-nav .nav-cta:hover { color: var(--white); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 26px; height: 3px;
  background: var(--navy);
  border-radius: 3px;
  transition: 0.25s ease;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  background: linear-gradient(160deg, #fdf3ff 0%, var(--cream) 55%, #eafffb 100%);
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 3rem;
  padding: 4.5rem 0 5.5rem;
}
.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-dark);
  background: rgba(0, 179, 166, 0.12);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}
.eyebrow-purple { color: var(--purple); background: rgba(108, 63, 160, 0.12); }
.eyebrow-orange { color: #d95f02; background: rgba(255, 138, 61, 0.15); }
.eyebrow-teal { color: var(--teal-dark); background: rgba(0, 179, 166, 0.12); }
.eyebrow-yellow { color: #8a6d00; background: rgba(255, 198, 39, 0.22); }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.7rem); font-weight: 700; margin-bottom: 1.2rem; }
.hl-teal { color: var(--teal); }
.hl-purple { color: var(--purple); }
.lede { font-size: 1.18rem; color: var(--gray); max-width: 34rem; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-media img {
  width: 100%;
  filter: drop-shadow(0 18px 40px rgba(41, 35, 92, 0.22));
  animation: float 5s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ===== Stats bar ===== */
.stats-bar { background: var(--navy); padding: 2.6rem 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}
.stat-num {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--yellow);
}
.stat-label { color: rgba(255,255,255,0.85); font-weight: 600; font-size: 0.98rem; }

/* ===== Sections ===== */
.section { padding: 5rem 0; }
.section-alt { background: var(--white); }
.section-dark { background: var(--ink); }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark .section-head p { color: rgba(255,255,255,0.75); }
.section-dark .section-head a { color: var(--yellow); }
.section-head { text-align: center; max-width: 44rem; margin: 0 auto 3rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 0.7rem; }
.section-head p { color: var(--gray); font-size: 1.1rem; }

/* Split (about) */
.split {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3.5rem;
  align-items: center;
}
.split-media img { border-radius: var(--radius); box-shadow: var(--shadow); }
.split-copy h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 1rem; }
.split-copy p { margin-bottom: 1rem; }
.muted { color: var(--gray); }
.check-list { list-style: none; margin: 0 0 1.2rem; }
.check-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.55rem;
  font-weight: 600;
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 0;
  width: 1.35rem; height: 1.35rem;
  background: var(--teal);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 800;
  border-radius: 50%;
  display: grid;
  place-items: center;
  line-height: 1.35rem;
}

/* ===== Cards (programs) ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(41, 35, 92, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(41, 35, 92, 0.18); }
.card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #f3effc; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-badge {
  position: absolute;
  top: 0.9rem; left: 0.9rem;
  z-index: 2;
  background: var(--orange);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
}
.card-body { padding: 1.4rem 1.5rem 1.6rem; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 1.35rem; margin-bottom: 0.5rem; }
.card-body p { color: var(--gray); font-size: 0.99rem; }
.section-alt .card { background: var(--cream); }
.card-cta {
  background: linear-gradient(150deg, var(--purple), var(--teal)) !important;
  text-align: center;
  align-items: center;
  justify-content: center;
}
.card-cta .card-body { align-items: center; justify-content: center; gap: 0.5rem; }
.card-cta h3, .card-cta p { color: var(--white); }
.card-cta p { opacity: 0.9; }
.codey { width: 110px; height: 110px; object-fit: contain; margin: 0 auto 0.4rem; }

/* ===== Chapters ===== */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.6rem;
}
.chapter-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(41, 35, 92, 0.07);
  transition: transform 0.2s ease;
}
.chapter-card:hover { transform: translateY(-5px); }
.chapter-card > img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }
.chapter-info { padding: 1.1rem 1.2rem 1.3rem; }
.chapter-info h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.chapter-info p { font-size: 0.9rem; color: var(--gray); }
.chapter-card-more {
  background: linear-gradient(150deg, var(--yellow), var(--orange));
  display: flex;
  align-items: center;
}
.chapter-card-more .chapter-info h3,
.chapter-card-more .chapter-info p { color: var(--navy); }
.chapter-card-more .btn { margin-top: 0.8rem; }

/* ===== News ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}
.news-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: background 0.2s ease, transform 0.2s ease;
}
.news-card:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-4px); }
.news-date {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.news-card h3 { font-size: 1.2rem; margin: 0.5rem 0 0.6rem; }
.news-card p { color: rgba(255, 255, 255, 0.78); font-size: 0.95rem; margin-bottom: 0.9rem; }
.news-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--teal);
  background: rgba(0, 179, 166, 0.14);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  margin-right: 0.3rem;
}

/* ===== Quote ===== */
.quote-section { background: var(--white); }
blockquote { max-width: 56rem; margin: 0 auto; text-align: center; }
blockquote p {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.4;
  color: var(--navy);
  margin-bottom: 1.3rem;
}
blockquote p::before { content: "“"; color: var(--orange); }
blockquote p::after { content: "”"; color: var(--orange); }
blockquote cite { font-style: normal; color: var(--gray); font-size: 1.02rem; }

/* ===== Join ===== */
.join-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.6rem;
}
.join-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 6px solid var(--purple);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.2s ease;
}
.join-card:nth-child(1) { border-top-color: var(--teal); }
.join-card:nth-child(2) { border-top-color: var(--orange); }
.join-card:nth-child(3) { border-top-color: var(--yellow); }
.join-card:nth-child(4) { border-top-color: var(--purple); }
.join-card:hover { transform: translateY(-5px); }
.join-icon { font-size: 2.4rem; }
.join-card h3 { font-size: 1.25rem; }
.join-card p { font-size: 0.93rem; color: var(--gray); flex: 1; }
.join-card .btn { margin-top: 0.7rem; }

/* ===== Donate banner ===== */
.donate-banner {
  background: linear-gradient(120deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: var(--white);
  padding: 4rem 0;
}
.donate-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
}
.donate-banner h2 { color: var(--white); font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: 0.6rem; }
.donate-banner p { color: rgba(255, 255, 255, 0.88); max-width: 40rem; }

/* ===== Footer ===== */
.site-footer { background: var(--navy); color: rgba(255, 255, 255, 0.8); padding: 3.5rem 0 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.8rem;
}
.footer-brand img { height: 46px; width: auto; margin-bottom: 1rem; filter: brightness(0) invert(1); }
.footer-brand p { font-size: 0.95rem; max-width: 20rem; }
.social-links { display: flex; gap: 0.8rem; margin-top: 1.2rem; }
.social-links a {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  transition: background 0.2s ease, transform 0.2s ease;
}
.social-links a:hover { background: var(--teal); transform: translateY(-3px); }
.footer-col h4 {
  color: var(--white);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}
.footer-col a {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 0.55rem;
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--yellow); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.4rem;
  padding-bottom: 1.6rem;
  font-size: 0.88rem;
  text-align: center;
}
.footer-bottom a { color: var(--yellow); text-decoration: none; }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  .card-grid, .news-grid { grid-template-columns: repeat(2, 1fr); }
  .chapter-grid, .join-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 5%;
    box-shadow: 0 14px 24px rgba(41, 35, 92, 0.14);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .main-nav.open { max-height: 420px; }
  .main-nav a { padding: 0.85rem 0.4rem; border-bottom: 1px solid rgba(41,35,92,0.07); }
  .main-nav .nav-cta { margin: 0.7rem 0 0.9rem; text-align: center; border-bottom: none; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .hero-inner { grid-template-columns: 1fr; padding: 3rem 0 4rem; text-align: center; }
  .hero-copy { order: 2; }
  .hero-media { order: 1; max-width: 420px; margin: 0 auto; }
  .hero-actions { justify-content: center; }
  .lede { margin-left: auto; margin-right: auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem 1rem; }
  .split { grid-template-columns: 1fr; gap: 2rem; }
  .card-grid, .news-grid, .chapter-grid, .join-grid { grid-template-columns: 1fr; }
  .donate-inner { flex-direction: column; text-align: center; }
  .section { padding: 3.5rem 0; }
}
