/* =========================================
   Distributed Computing 4 Kids – Main CSS
   ========================================= */

/* ---- Variables ---- */
:root {
  --color-bg: #0f0e17;
  --color-bg-2: #1a1a2e;
  --color-surface: #16213e;
  --color-primary: #ff6b35;
  --color-secondary: #7c3aed;
  --color-accent: #06d6a0;
  --color-yellow: #ffd60a;
  --color-text: #fffffe;
  --color-muted: #a7a9be;
  --font-main: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
  --radius: 1rem;
  --radius-sm: 0.5rem;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: 0.3s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ---- Header ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 2rem;
  background: rgba(15, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo-icon {
  font-size: 1.75rem;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--color-text);
}

.logo-accent {
  color: var(--color-primary);
}

.logo-amp {
  color: var(--color-muted);
  font-weight: 700;
}

/* ---- Subscribe CTA ---- */
.cta-wrapper {
  margin: 0 auto 2.5rem;
}

.subscribe-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-primary), var(--color-yellow));
  color: var(--color-bg);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.9rem 2rem;
  border-radius: 2rem;
  text-decoration: none;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.35);
  transition: transform var(--transition), box-shadow var(--transition);
}

.subscribe-btn:hover,
.subscribe-btn:focus {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(255, 107, 53, 0.5);
  outline: none;
}

.subscribe-btn:focus-visible {
  outline: 2px solid var(--color-yellow);
  outline-offset: 3px;
}



@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ---- Hero Section ---- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 7rem 2rem 4rem;
  background: radial-gradient(ellipse at 20% 40%, rgba(124, 58, 237, 0.25) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 60%, rgba(255, 107, 53, 0.2) 0%, transparent 60%),
              var(--color-bg);
}

.hero-title .title {
  display: block;
  margin: 0 auto;
  width: min(100%, 480px);
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Animated background nodes */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.node {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.35;
  box-shadow: 0 0 18px var(--color-accent);
  animation: pulse-node 3s ease-in-out infinite;
}

.node:nth-child(2n) {
  background: var(--color-primary);
  box-shadow: 0 0 18px var(--color-primary);
  animation-delay: 0.8s;
}

.node:nth-child(3n) {
  background: var(--color-yellow);
  box-shadow: 0 0 18px var(--color-yellow);
  animation-delay: 1.6s;
}

.node:nth-child(4n) {
  background: var(--color-secondary);
  box-shadow: 0 0 18px var(--color-secondary);
  animation-delay: 2.4s;
}

@keyframes pulse-node {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.8); opacity: 0.65; }
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
}

.badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.45rem 1.2rem;
  border-radius: 2rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.hero-title {
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 1.5rem;
}

.highlight {
  background: linear-gradient(90deg, var(--color-primary), var(--color-yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.for-kids {
  color: var(--color-accent);
  font-family: var(--font-mono);
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  color: var(--color-muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hero-subtitle strong {
  color: var(--color-text);
}

/* ---- Countdown ---- */
.countdown-wrapper {
  margin-top: 2rem;
}

.countdown-label {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  min-width: 90px;
  box-shadow: var(--shadow);
}

.countdown-num {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
}

.countdown-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-muted);
  margin-top: 0.35rem;
}

.countdown-sep {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-muted);
  opacity: 0.4;
  margin-bottom: 1.2rem;
}

/* ---- Features Section ---- */
.features {
  padding: 5rem 2rem;
  background: var(--color-bg-2);
}

.features-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.features-title {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 107, 53, 0.3);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: var(--color-text);
}

.feature-card p {
  font-size: 0.93rem;
  color: var(--color-muted);
  line-height: 1.6;
}

/* ---- Explainer Section ---- */
.explainer {
  padding: 5rem 2rem;
  background: var(--color-bg);
}

.explainer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.explainer-text h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 900;
  margin-bottom: 1.25rem;
}

.explainer-text p {
  color: var(--color-muted);
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.explainer-text strong {
  color: var(--color-accent);
}

/* ---- Network Diagram ---- */
.explainer-visual {
  display: flex;
  justify-content: center;
}

.network-diagram {
  position: relative;
  width: 260px;
  height: 260px;
}

.net-node {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--color-surface);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 64px;
  height: 64px;
  box-shadow: 0 0 20px rgba(6, 214, 160, 0.2);
  animation: float-node 4s ease-in-out infinite;
}

.main-node {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  font-size: 2.4rem;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  border-color: transparent;
  box-shadow: 0 0 32px rgba(124, 58, 237, 0.5);
  animation: float-node 3s ease-in-out infinite, glow-pulse 2s ease-in-out infinite;
}

.child-node.n1 { top: 0;   left: 50%; transform: translateX(-50%); animation-delay: 0.5s; }
.child-node.n2 { top: 50%; left: 0;   transform: translateY(-50%); animation-delay: 1s; }
.child-node.n3 { bottom: 0; left: 50%; transform: translateX(-50%); animation-delay: 1.5s; }
.child-node.n4 { top: 50%; right: 0; transform: translateY(-50%); animation-delay: 2s; }

@keyframes float-node {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -8px; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 32px rgba(124, 58, 237, 0.5); }
  50% { box-shadow: 0 0 48px rgba(124, 58, 237, 0.8); }
}

/* ---- Footer ---- */
.site-footer {
  padding: 2rem;
  background: var(--color-bg-2);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.footer-inner p {
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero {
    padding: 6rem 1.25rem 3rem;
  }

  .countdown-unit {
    min-width: 72px;
    padding: 1rem 1.1rem;
  }

  .explainer-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .explainer-visual {
    order: -1;
  }

  .network-diagram {
    width: 220px;
    height: 220px;
  }

  .main-node {
    width: 68px;
    height: 68px;
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .countdown-sep {
    display: none;
  }

  .countdown {
    gap: 0.5rem;
  }
}
