/* =========================================================
   Click Circuits — Design System
   White + blue, tech-themed. Tokens first, components reuse them.
   ========================================================= */
:root {
  /* Color */
  --white: #ffffff;
  --bg-alt: #f2f7fc;
  --ink: #0b1d33;
  --ink-soft: #4c6079;
  --blue-900: #0a2c5c;
  --blue-700: #0d47a1;
  --blue-600: #1565c0;
  --blue-400: #4c9be8;
  --cyan: #00c2ff;
  --line: #dbe6f2;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;

  /* Shape */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(10, 44, 92, 0.10);
  --max-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    linear-gradient(rgba(13, 71, 161, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 71, 161, 0.05) 1px, transparent 1px),
    var(--white);
  background-size: 42px 42px, 42px 42px, auto;
  background-attachment: fixed;
  animation: grid-drift 30s linear infinite;
  line-height: 1.55;
}
@keyframes grid-drift {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 42px 42px, 42px 42px, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
}
img { max-width: 100%; display: block; }
a { color: var(--blue-700); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 var(--space-2); color: var(--ink); }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
p { margin: 0 0 var(--space-2); color: var(--ink-soft); }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-3); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--blue-700);
  color: var(--white);
}
.btn-primary:hover { background: var(--blue-900); }
.btn-ghost {
  background: transparent;
  color: var(--blue-700);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--blue-600); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.1rem;
}
.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--blue-600), var(--cyan));
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}
.brand-name strong { color: var(--blue-700); }

.brand-text {
  color: var(--blue-700);
  font-weight: 800;
}

.site-nav {
  display: flex;
  gap: var(--space-3);
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--blue-700); }
.site-nav a[aria-current="page"] { color: var(--blue-700); font-weight: 700; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(600px 300px at 85% -10%, rgba(0, 194, 255, 0.10), transparent),
    var(--bg-alt);
  padding: calc(var(--space-5) + 1.25rem) 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: calc(var(--space-4) + 1rem);
  align-items: center;
}
.eyebrow {
  color: var(--blue-700);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}
.lead { font-size: 1.25rem; }
.hero-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
  flex-wrap: wrap;
}

/* Hero image */
.hero-visual { display: flex; justify-content: center; }
.hero-image {
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 24px;
  box-shadow: var(--shadow), 0 0 0 6px rgba(0, 194, 255, 0.12);
  border: 3px solid var(--white);
  background: var(--white);
  padding: var(--space-2);
}

/* Larger hero heading for presence */
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.05;
}
.hero .btn {
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
}

/* ---------- Stats ---------- */
.stats { border-bottom: 1px solid var(--line); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  padding: var(--space-4) 0;
  text-align: center;
}
.stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue-700);
}
.stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ---------- Sections ---------- */
.section { padding: var(--space-5) 0; }
.section.impact { padding: var(--space-3) 0; }
.section.impact .section-head { margin-bottom: var(--space-2); }
.section.impact .section-head h2 {
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.4px;
  margin: 0 0 0.25rem 0;
}
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: var(--space-3); }
.section-sub { color: var(--ink-soft); }
kbd {
  display: inline-block;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.05rem 0.4rem;
  font-size: 0.85em;
  background: var(--white);
}

/* Donate section (homepage) */
.donate-section {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 100%);
  color: var(--white);
}
.donate-section .section-head h2 {
  color: var(--white);
}
.donate-section .donate-copy {
  color: rgba(255,255,255,0.95);
}
.donate-section .donate-copy p {
  color: rgba(255,255,255,0.92);
}
.donate-section .btn-primary {
  background: var(--cyan);
  color: var(--ink);
  border-color: rgba(255,255,255,0.06);
}
.donate-section .btn-primary:hover {
  background: #00b6f2;
}

/* ---------- Kit contents ---------- */
.kit-contents {
  margin: var(--space-4) 0;
  padding: var(--space-4);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--white) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.kit-contents-head h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.kit-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--blue-700);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.kit-item-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: var(--space-3);
}
.kit-item-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.kit-item-row:hover {
  border-color: var(--blue-400);
  box-shadow: 0 6px 16px rgba(10, 44, 92, 0.08);
}
.kit-item-image {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--blue-700);
  flex-shrink: 0;
}
.kit-item-image svg {
  width: 38px;
  height: 38px;
}
.kit-item-desc {
  min-width: 0;
}
.kit-item-desc h4 {
  margin: 0 0 0.15rem;
  color: var(--ink);
  font-size: 1rem;
}
.kit-item-desc p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.kit-item-price {
  font-weight: 700;
  color: var(--blue-700);
  font-size: 1.05rem;
  white-space: nowrap;
}
.kit-item-total {
  grid-template-columns: 1fr auto;
  margin-top: 0.3rem;
  background: var(--bg-alt);
  border-color: var(--blue-400);
}
.kit-item-total h4 {
  font-size: 1.05rem;
}
.kit-item-total .kit-item-price {
  font-size: 1.3rem;
}

.kit-bulk-note {
  margin: var(--space-2) 0 0;
  padding-top: var(--space-2);
  border-top: 1px dashed var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

@media (max-width: 560px) {
  .kit-item-row {
    grid-template-columns: 48px 1fr auto;
    gap: 0.7rem;
    padding: 0.7rem 0.8rem;
  }
  .kit-item-image { width: 48px; height: 48px; }
  .kit-item-image svg { width: 28px; height: 28px; }
  .kit-item-price { font-size: 0.95rem; }
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--space-4);
  align-items: center;
}
.about-photo-frame {
  position: relative;
  padding: 14px;
}
.about-photo-frame img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(10, 44, 92, 0.25), 0 0 0 6px rgba(0, 194, 255, 0.12);
  border: 3px solid var(--white);
  outline: 1px solid var(--line);
}
.about-photo-frame img.img-missing {
  background: var(--bg-alt);
  color: var(--ink-soft);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2);
}
.about-photo-caption {
  text-align: center;
  margin-top: var(--space-2);
  font-weight: 600;
  color: var(--ink-soft);
}

/* ---------- Impact banner ---------- */
.impact-banner {
  background: linear-gradient(135deg, rgba(0, 194, 255, 0.12) 0%, rgba(0, 112, 192, 0.12) 100%);
  border: 1px solid rgba(0, 194, 255, 0.25);
  border-top: 2px solid var(--cyan);
  border-bottom: 2px solid var(--cyan);
  padding: 8px 0;
}
.banner-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2);
}
.banner-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
}
.banner-num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
}
.banner-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.4px;
  text-align: center;
}

/* ---------- Impact highlights ---------- */
/* ---------- Impact highlights ---------- */
.impact-highlights {
  padding: calc(var(--space-2) + 64px) 0 0.5rem 0;
}
.impact-highlights .section-head {
  text-align: center;
  margin-bottom: 0;
  transform: translateY(-40px);
}
.impact-highlights .section-head h2 {
  font-size: clamp(2.8rem, 5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -0.6px;
  margin: 0;
}
.impact-wrapper {
  display: grid;
  grid-template-columns: minmax(520px, 62%) 1fr;
  gap: 0.75rem;
  align-items: stretch;
  max-width: 1200px;
  margin: 0 auto 0;
}
.impact-logo {
  display: block;
  overflow: hidden;
  border-radius: 14px;
  height: 100%;
  align-self: stretch;
  background: linear-gradient(180deg,#f7fbff,#ffffff);
}
.impact-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: none;
  display:block;
}
.impact-content {
  display:flex;
  flex-direction:column;
  gap: 0.4rem;
  align-items: stretch;
  justify-content: flex-start;
  padding-left: var(--space-4);
}
.impact-content p {
  margin:0;
  color: var(--ink-soft);
  line-height:1.55;
  font-size:1.2rem;
  border-left: 3px solid var(--cyan);
  padding-left: 0.75rem;
  max-width: 760px;
  text-align: left;
}
.impact-content p:first-child {
  border-left-color: var(--cyan);
}
.impact-content p:nth-child(2) {
  border-left-color: rgba(0, 194, 255, 0.7);
}
.impact-content p:nth-child(3) {
  border-left-color: rgba(0, 194, 255, 0.5);
}
.impact-content p:nth-child(4) {
  border-left-color: rgba(0, 194, 255, 0.3);
}

@media (max-width: 1024px) {
  .impact-wrapper {
    grid-template-columns: minmax(360px, 50%) 1fr;
  }
  .impact-logo { min-height: 640px; }
}
@media (max-width: 768px) {
  .impact-wrapper {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .impact-logo {
    aspect-ratio: 16 / 9;
    min-height: 360px;
    order: 0;
  }
  .impact-logo img {
    width: 100%;
    height: 100%;
    transform: none;
    object-position: center;
  }
  .impact-content p {
    max-width: 100%;
    padding-left: var(--space-3);
    text-align: center;
    border-left: none;
  }
  .impact-highlights .section-head h2 {
    font-size: clamp(1.6rem, 5vw, 2rem);
  }
}

/* ---------- Contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: start;
}
.contact-content h2 {
  margin-top: 0;
}
.contact-content p {
  color: var(--ink-soft);
  line-height: 1.6;
}
.contact-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.contact-photo {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--space-4);
  box-shadow: 0 16px 40px rgba(10, 44, 92, 0.25), 0 0 0 6px rgba(0, 194, 255, 0.12);
  border: 3px solid var(--white);
}
.contact-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.contact-logo {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: 12px;
  padding: var(--space-3);
}
.contact-logo img {
  max-width: 100%;
  max-height: 100%;
}
/* Founder bio next to contact photo */
.founder-bio {
  max-width: 720px;
  color: var(--ink-soft);
}
.founder-bio .founder-title {
  margin: 0 0 var(--space-2) 0;
  color: var(--blue-700);
  font-weight: 800;
  font-size: 1.05rem;
}
.founder-bio h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  color: var(--ink);
}
.founder-bio p {
  margin: 0 0 0.75rem 0;
  line-height: 1.6;
}
@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .contact-media {
    flex-direction: column;
    align-items: center;
  }
  .founder-bio { text-align: center; padding: 0 var(--space-2); }
}

.frame-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid var(--cyan);
}
.frame-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.frame-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.frame-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.frame-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; }

/* ---------- Video player ---------- */
.video-player {
  display: grid;
  grid-template-columns: 50px minmax(0, 820px) 50px;
  justify-content: center;
  justify-items: center;
  align-items: center;
  gap: 0px;
  outline: none;
}
.video-player:focus-visible .video-stage {
  box-shadow: 0 0 0 3px var(--blue-400);
}
.video-stage {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  justify-self: center;
  background: linear-gradient(135deg, #0a2c5c 0%, #001a3d 100%);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(10, 44, 92, 0.35), 0 0 0 1px rgba(0, 194, 255, 0.15);
  border: 1px solid rgba(0, 194, 255, 0.2);
}
.video-stage video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 560px;
  background: #000;
  margin: 0 auto;
}
.video-frame {
  position: relative;
  width: fit-content;
  margin: 0 auto;
}
.video-pause-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0, 194, 255, 0.2);
  border: 3px solid rgba(0, 194, 255, 0.8);
  color: var(--white);
  font-size: 2rem;
  pointer-events: none;
  box-shadow: 0 0 30px rgba(0, 194, 255, 0.3);
  backdrop-filter: blur(4px);
}
.video-pause-icon::before {
  content: '▶';
}
.video-pause-icon[hidden] { display: none; }
.video-stage video[hidden] { display: none; }
.video-empty {
  margin: 0;
  padding: var(--space-4) var(--space-2);
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  font-size: 0.9rem;
}
.video-empty code {
  color: var(--white);
}
.video-caption {
  margin: 0;
  padding: var(--space-2) var(--space-2) 0;
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}
.video-count {
  margin: 0;
  padding: 0 var(--space-2) var(--space-2);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
  text-align: center;
}
.video-nav {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: rgba(0, 194, 255, 0.1);
  color: var(--cyan);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.video-nav:hover {
  background: var(--cyan);
  color: var(--ink);
  box-shadow: 0 0 20px rgba(0, 194, 255, 0.5);
  transform: scale(1.1);
}
.video-nav:active {
  transform: scale(0.95);
}

/* ---------- Photo strip ---------- */
.photo-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
}
.photo-strip img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- Impact CTA + Impact ---------- */
.impact-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.impact-cta-inner h2 { margin-bottom: 0.35rem; }
.impact-cta-inner p { margin: 0; }
.impact-stats { padding-top: 0; margin-bottom: var(--space-3); }

/* ---------- Contact ---------- */
.contact-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
}
.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .about-grid { grid-template-columns: 1fr; text-align: center; }
  .about-photo-frame { max-width: 280px; margin: 0 auto; }
  .stats-grid { grid-template-columns: 1fr; }
  .photo-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  /* Keep the full navigation visible on small screens per user request */
  .site-nav {
    display: flex !important;
    position: static;
    top: auto;
    left: auto;
    right: auto;
    background: transparent;
    border-bottom: none;
    flex-direction: row;
    padding: 0;
    gap: var(--space-2);
  }
  .site-nav.open { display: flex; }
  /* Hide the mobile toggle since the nav is always visible */
  .nav-toggle { display: none; }
  .impact-highlights .section-head { transform: none; }
}

/* ---------- Email popup (intercepts mailto: clicks) ---------- */
.email-popup {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 9999;
  background: rgba(2,6,23,0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.email-popup.visible {
  opacity: 1;
  pointer-events: auto;
}
.email-popup-card {
  position: relative;
  background: var(--white);
  color: var(--ink);
  padding: calc(var(--space-3) + 0.5rem);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(2,6,23,0.35);
  max-width: 420px;
  width: calc(100% - 48px);
  text-align: center;
}
.email-popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--ink-soft);
}
.email-popup-address {
  font-weight: 700;
  color: var(--blue-700);
  margin: var(--space-2) 0;
  word-break: break-all;
}
.email-popup-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-2);
}
.email-popup .btn-ghost { border-color: transparent; }
.email-popup .btn-primary { background: var(--blue-700); color: var(--white); }
