/* ══════════════════════════════════════════════════════════
   funDesk — Homepage
   Fonts: Bricolage Grotesque (headings) + Outfit (body)
   Theme: Dark hero, colored section boxes, white cards
   ══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;600;700;800&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens ────────────────────────────────────── */
:root {
  --ff-head: 'Bricolage Grotesque', sans-serif;
  --ff-body: 'Outfit', sans-serif;

  --bg: #f9fafb;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --border: #e5e7eb;

  --brand: #6366f1;
  --brand-hover: #4f46e5;

  /* Section colors — soft tints */
  --c-ai: #7c3aed;      --c-ai-bg: #f5f3ff;     --c-ai-border: #ddd6fe;
  --c-tech: #0d9488;     --c-tech-bg: #f0fdfa;    --c-tech-border: #99f6e4;
  --c-gear: #ea580c;     --c-gear-bg: #fff7ed;    --c-gear-border: #fed7aa;
  --c-dsa: #16a34a;      --c-dsa-bg: #f0fdf4;     --c-dsa-border: #bbf7d0;
  --c-code: #2563eb;     --c-code-bg: #eff6ff;    --c-code-border: #bfdbfe;
  --c-ml: #db2777;       --c-ml-bg: #fdf2f8;      --c-ml-border: #fbcfe8;

  --radius: 16px;
  --radius-sm: 10px;
  --max-w: 1200px;
  --side-pad: 24px;      /* consistent horizontal padding */
  --section-gap: 24px;   /* gap between section boxes */
}

/* ── Base ─────────────────────────────────────────────── */
body {
  background: var(--bg);
  background-image: none;
}

main {
  font-family: var(--ff-body);
  color: var(--text);
  margin-bottom: 80px; /* space above fixed footer */
  display: flex;
  flex-direction: column;
}

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

/* Override base.css .content top padding so hero sits right under navbar */
.content:has(.hero) {
  padding-block: 0 !important;
}


/* ══════════════════════════════════════════════════════════
   HERO — dark, animated, immersive
   ══════════════════════════════════════════════════════════ */
.hero {
  padding: 140px var(--side-pad) 60px;
  text-align: center;
  background: #0a0b10;
  position: relative;
  overflow: hidden;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Animated grid ────────────────────────────────────── */
.hero-grid {
  position: absolute;
  inset: -60px; /* oversized so movement doesn't show edges */
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
  pointer-events: none;
}

@keyframes gridMove {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

/* ── Mouse spotlight ──────────────────────────────────── */
.hero-spotlight {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, rgba(99,102,241,0.06) 30%, transparent 60%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

/* ── Floating particles ───────────────────────────────── */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  animation: particleFloat linear infinite;
}

.p1 { background: var(--c-ai);   left: 10%; top: 20%; width: 5px; height: 5px; animation-duration: 14s; animation-delay: 0s; }
.p2 { background: var(--c-tech); left: 85%; top: 30%; width: 4px; height: 4px; animation-duration: 18s; animation-delay: -3s; }
.p3 { background: var(--c-gear); left: 20%; top: 70%; width: 6px; height: 6px; animation-duration: 16s; animation-delay: -6s; }
.p4 { background: var(--c-dsa);  left: 75%; top: 65%; width: 5px; height: 5px; animation-duration: 20s; animation-delay: -2s; }
.p5 { background: var(--c-code); left: 50%; top: 15%; width: 4px; height: 4px; animation-duration: 15s; animation-delay: -8s; }
.p6 { background: var(--c-ml);   left: 90%; top: 80%; width: 5px; height: 5px; animation-duration: 17s; animation-delay: -4s; }
.p7 { background: #a78bfa;       left: 5%;  top: 50%; width: 3px; height: 3px; animation-duration: 22s; animation-delay: -10s; }
.p8 { background: #60a5fa;       left: 65%; top: 10%; width: 4px; height: 4px; animation-duration: 19s; animation-delay: -7s; }

@keyframes particleFloat {
  0%   { transform: translate(0, 0) scale(1);     opacity: 0; }
  10%  { opacity: 0.6; }
  50%  { transform: translate(40px, -80px) scale(1.3); opacity: 0.3; }
  90%  { opacity: 0.5; }
  100% { transform: translate(-30px, -160px) scale(0.8); opacity: 0; }
}

/* ── Hero content ─────────────────────────────────────── */
.hero-inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Eyebrow */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 24px;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34,197,94,0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(34,197,94,0.4); }
  50%      { box-shadow: 0 0 16px rgba(34,197,94,0.7); }
}

/* Title */
.hero-title {
  font-family: var(--ff-head);
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -2px;
  color: #fff;
  margin: 0 0 22px;
}

.title-word {
  display: inline-block;
  animation: wordReveal 0.6s ease both;
}

.tw1 { animation-delay: 0.1s; }
.tw2 { animation-delay: 0.15s; }
.tw3 { animation-delay: 0.2s; }
.tw4 { animation-delay: 0.25s; }
.tw5 { animation-delay: 0.3s; }
.tw6 { animation-delay: 0.4s; }

@keyframes wordReveal {
  from { opacity: 0; transform: translateY(16px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

/* Rotating highlight word */
.hero-highlight {
  display: inline-block;
  color: #a78bfa;
  position: relative;
  animation: wordReveal 0.6s ease both 0.35s;
  transition: transform 0.3s ease;
}

.hero-highlight::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 0;
  height: 35%;
  background: rgba(124, 58, 237, 0.2);
  border-radius: 4px;
  z-index: -1;
}

.hero-highlight.word-out {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
}

/* Subtitle */
.hero-sub {
  font-size: 1.1rem;
  color: #6b7280;
  line-height: 1.65;
  max-width: 460px;
  margin: 0 auto 0;
}

/* ══════════════════════════════════════════════════════════
   CATEGORY PILLS (inside hero)
   ══════════════════════════════════════════════════════════ */
.quick-cats {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px var(--side-pad) 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.qcat {
  font-family: var(--ff-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 60px;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.55);
  transition: all 0.25s;
  white-space: nowrap;
}

.qcat:hover {
  transform: translateY(-2px);
  color: #fff;
}

/* Per-category glow on hover */
.qcat:nth-child(1):hover  { background: var(--c-ai);   border-color: var(--c-ai);   box-shadow: 0 0 20px rgba(124,58,237,0.35); }
.qcat:nth-child(2):hover  { background: var(--c-tech);  border-color: var(--c-tech);  box-shadow: 0 0 20px rgba(13,148,136,0.35); }
.qcat:nth-child(3):hover  { background: var(--c-gear);  border-color: var(--c-gear);  box-shadow: 0 0 20px rgba(234,88,12,0.35); }
.qcat:nth-child(4):hover  { background: var(--c-dsa);   border-color: var(--c-dsa);   box-shadow: 0 0 20px rgba(22,163,74,0.35); }
.qcat:nth-child(5):hover  { background: var(--c-dsa);   border-color: var(--c-dsa);   box-shadow: 0 0 20px rgba(22,163,74,0.35); }
.qcat:nth-child(6):hover  { background: var(--c-code);  border-color: var(--c-code);  box-shadow: 0 0 20px rgba(37,99,235,0.35); }
.qcat:nth-child(7):hover  { background: var(--c-ml);    border-color: var(--c-ml);    box-shadow: 0 0 20px rgba(219,39,119,0.35); }
.qcat:nth-child(8):hover  { background: var(--c-gear);  border-color: var(--c-gear);  box-shadow: 0 0 20px rgba(234,88,12,0.35); }
.qcat:nth-child(9):hover  { background: var(--c-ai);    border-color: var(--c-ai);    box-shadow: 0 0 20px rgba(124,58,237,0.35); }
.qcat:nth-child(10):hover { background: var(--c-tech);  border-color: var(--c-tech);  box-shadow: 0 0 20px rgba(13,148,136,0.35); }

/* ══════════════════════════════════════════════════════════
   SECTIONS WRAPPER — consistent spacing
   ══════════════════════════════════════════════════════════ */
.topic-section {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--section-gap);
  /* Horizontal buffer so boxes never touch viewport edges */
  margin-left: max(var(--side-pad), calc((100% - var(--max-w)) / 2));
  margin-right: max(var(--side-pad), calc((100% - var(--max-w)) / 2));
  padding: 32px 32px;
  border-radius: var(--radius);
  border: 1.5px solid;
}

/* Force visible gap between dark hero and first section — padding avoids margin collapse */
.hero {
  margin-bottom: 0;
}

.hero + .topic-section {
  margin-top: 56px !important;
}

/* Per-section color theming */
.sec-ai    { background: var(--c-ai-bg);   border-color: var(--c-ai-border); }
.sec-tech  { background: var(--c-tech-bg);  border-color: var(--c-tech-border); }
.sec-gear  { background: var(--c-gear-bg);  border-color: var(--c-gear-border); }
.sec-dsa   { background: var(--c-dsa-bg);   border-color: var(--c-dsa-border); }
.sec-code  { background: var(--c-code-bg);  border-color: var(--c-code-border); }
.sec-ml    { background: var(--c-ml-bg);    border-color: var(--c-ml-border); }

/* Section Header */
.sec-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.sec-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.sec-title {
  font-family: var(--ff-head);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.2px;
}

.sec-sub {
  font-size: 0.85rem;
  color: var(--text-2);
  margin: 3px 0 0;
  line-height: 1.4;
}

/* ══════════════════════════════════════════════════════════
   TOPIC CARDS
   ══════════════════════════════════════════════════════════ */
.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tcard {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1.5px solid rgba(0,0,0,0.06);
  transition: all 0.22s ease;
  min-height: 160px;
}

.tcard:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* Badge */
.tcard-badge {
  display: inline-block;
  font-family: var(--ff-head);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 4px;
  width: fit-content;
  margin-bottom: 14px;
}

.tcard-ai .tcard-badge    { background: rgba(124,58,237,0.1);  color: var(--c-ai); }
.tcard-tech .tcard-badge  { background: rgba(13,148,136,0.1);  color: var(--c-tech); }
.tcard-gear .tcard-badge  { background: rgba(234,88,12,0.1);   color: var(--c-gear); }
.tcard-dsa .tcard-badge   { background: rgba(22,163,74,0.1);   color: var(--c-dsa); }
.tcard-code .tcard-badge  { background: rgba(37,99,235,0.1);   color: var(--c-code); }
.tcard-ml .tcard-badge    { background: rgba(219,39,119,0.1);  color: var(--c-ml); }

.tcard-title {
  font-family: var(--ff-head);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.3;
}

.tcard-desc {
  font-size: 0.86rem;
  color: var(--text-2);
  line-height: 1.6;
  flex-grow: 1;
  margin: 0 0 16px;
}

.tcard-arrow {
  font-size: 1.1rem;
  font-weight: 700;
  opacity: 0;
  transform: translateX(-6px);
  transition: all 0.22s;
  margin-top: auto;
  align-self: flex-end;
}

.tcard:hover .tcard-arrow { opacity: 1; transform: translateX(0); }

.tcard-ai:hover .tcard-arrow    { color: var(--c-ai); }
.tcard-tech:hover .tcard-arrow  { color: var(--c-tech); }
.tcard-gear:hover .tcard-arrow  { color: var(--c-gear); }
.tcard-dsa:hover .tcard-arrow   { color: var(--c-dsa); }
.tcard-code:hover .tcard-arrow  { color: var(--c-code); }
.tcard-ml:hover .tcard-arrow    { color: var(--c-ml); }

/* ══════════════════════════════════════════════════════════
   NEWSLETTER — matches section rhythm
   ══════════════════════════════════════════════════════════ */
.nl-band {
  max-width: var(--max-w);
  margin-left: max(var(--side-pad), calc((100% - var(--max-w)) / 2));
  margin-right: max(var(--side-pad), calc((100% - var(--max-w)) / 2));
  margin-bottom: var(--section-gap);
}

.nl-inner {
  background: var(--text);
  border-radius: var(--radius);
  padding: 48px 40px;
  text-align: center;
}

.nl-title {
  font-family: var(--ff-head);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px;
}

.nl-sub {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.5);
  margin: 0 0 24px;
}

.nl-form {
  display: flex;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
}

.nl-input {
  flex: 1;
  font-family: var(--ff-body);
  font-size: 0.9rem;
  padding: 13px 18px;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.07);
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}

.nl-input::placeholder { color: rgba(255,255,255,0.3); }
.nl-input:focus { border-color: var(--brand); }

.nl-btn {
  font-family: var(--ff-head);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.nl-btn:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

/* ══════════════════════════════════════════════════════════
   BOTTOM CTA
   ══════════════════════════════════════════════════════════ */
.cta-bottom {
  text-align: center;
  padding: 48px var(--side-pad) 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.cta-bottom h2 {
  font-family: var(--ff-head);
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0 0 8px;
}

.cta-bottom p {
  font-size: 0.95rem;
  color: var(--text-2);
  margin: 0 0 28px;
}

.cta-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-btn {
  font-family: var(--ff-head);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: inline-block;
}

.cta-btn-primary {
  background: var(--text);
  color: #fff;
}

.cta-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  color: #fff;
}

.cta-btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.cta-btn-outline:hover {
  border-color: var(--text);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow { animation: fadeUp 0.5s ease both 0.05s; }
.hero-title   { animation: fadeUp 0.5s ease both 0.1s; }
.hero-sub     { animation: fadeUp 0.5s ease both 0.4s; }
.quick-cats   { animation: fadeUp 0.5s ease both 0.55s; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --side-pad: 16px;
    --section-gap: 20px;
  }

  .hero {
    padding: 100px var(--side-pad) 0;
    min-height: auto;
  }

  .hero-particles { display: none; }
  .hero-spotlight { display: none; }

  .topic-section {
    padding: 24px 20px;
    border-radius: 12px;
  }

  .card-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sec-header { flex-wrap: wrap; }

  .nl-inner {
    padding: 32px 20px;
  }

  .nl-form { flex-direction: column; }
  .nl-input { min-width: auto; }
}

@media (max-width: 480px) {
  :root { --side-pad: 12px; }

  .hero {
    padding-top: 90px;
  }

  .hero-title { letter-spacing: -1px; }

  .quick-cats { gap: 8px; }
  .qcat { padding: 7px 14px; font-size: 0.78rem; }

  .topic-section { padding: 20px 16px; }

  .cta-btns { flex-direction: column; align-items: center; }
}
