/* ═══════════════════════════════════════════════════════════════════════════
   HOME PAGE — layout, hero, cards, footer
   Depends on main.css for design tokens.
═══════════════════════════════════════════════════════════════════════════ */

/* Fix background so the fixed canvas shows through */
html { background: var(--bg); }
body { background: transparent; display: block; }

/* ── CANVAS ──────────────────────────────────────────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.site-nav, .page, .site-footer { position: relative; z-index: 1; }

/* ── NAV ─────────────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(245,245,247,0.80);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  gap: 24px;
}
.nav-brand {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.nav-brand span { color: var(--blue); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-link:hover { background: rgba(0,0,0,0.05); color: var(--text); }
.nav-link.active { color: var(--blue); background: #f0f6ff; }

/* ── PAGE ────────────────────────────────────────────────────────────────── */
.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 36px 28px 100px;
}

/* ── HERO ────────────────────────────────────────────────────────────────── */
.hero {
  margin-bottom: 64px;
  position: relative;
  isolation: isolate;
  padding: 48px 0 52px;
  /* entrance */
  animation: heroIn 0.6s cubic-bezier(.22,1,.36,1) both;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

#hero-wave-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-blob {
  position: absolute;
  top: -40px; right: -100px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(0,113,227,0.13) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.hero-blob-2 {
  position: absolute;
  bottom: -20px; left: -80px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(175,82,222,0.09) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.hero-blob-3 {
  position: absolute;
  bottom: 10px; right: 120px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(52,199,89,0.07) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 4px 12px 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 22px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  backdrop-filter: blur(4px);
}
.hero-badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #34c759;
  flex-shrink: 0;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(52,199,89,0.25); }
  50%       { box-shadow: 0 0 0 5px rgba(52,199,89,0.12); }
}

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  color: var(--text);
  line-height: 1.08;
  margin-bottom: 18px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--blue) 0%, #af52de 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 30px;
}
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-pill {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 4px 13px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  backdrop-filter: blur(4px);
}

/* ── TOOLS SECTION ───────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
  animation: heroIn 0.6s 0.15s cubic-bezier(.22,1,.36,1) both;
}
.section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.section-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue);
  background: #f0f6ff;
  border-radius: 20px;
  padding: 1px 8px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  animation: heroIn 0.6s 0.25s cubic-bezier(.22,1,.36,1) both;
}

.tool-card {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.22s, border-color 0.22s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  position: relative;
  backdrop-filter: blur(8px);
}
.tool-card:hover {
  box-shadow: 0 12px 36px rgba(0,113,227,0.13);
  border-color: rgba(0,113,227,0.3);
  transform: translateY(-4px);
}
.tool-card:hover .tool-arrow { opacity: 1; transform: translateX(0); }

.tool-card-top {
  background: linear-gradient(135deg, #eef4ff 0%, #e8e8ff 100%);
  padding: 22px 22px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(0,113,227,0.08);
  position: relative;
  overflow: hidden;
}
/* shimmer stripe on top section */
.tool-card-top::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.35) 50%, transparent 60%);
  background-size: 200% 100%;
  background-position: 200% 0;
  transition: background-position 0.5s ease;
  pointer-events: none;
}
.tool-card:hover .tool-card-top::after { background-position: -200% 0; }

.tool-icon {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  box-shadow: 0 2px 10px rgba(0,0,0,0.09);
  flex-shrink: 0;
}
.tool-arrow {
  color: var(--blue);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s, transform 0.2s;
  margin-top: 4px;
  flex-shrink: 0;
}

.tool-card-body {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}
.tool-name {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.tool-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}
.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.tool-tag {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  background: #eef4ff;
  color: var(--blue);
  letter-spacing: 0.02em;
}
.tool-tag.local { background: #f0faf3; color: var(--keep); }

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border-light);
  padding: 28px;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-text {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.6;
}
.footer-text strong { color: var(--text); }

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-nav { padding: 0 16px; height: 48px; gap: 12px; }
  .nav-link { padding: 4px 8px; font-size: 0.75rem; }

  .page { padding: 24px 16px 72px; }

  .hero { padding: 28px 0 32px; margin-bottom: 36px; }
  .hero-blob   { width: 240px; height: 240px; right: -70px; top: -20px; }
  .hero-blob-2 { width: 160px; height: 160px; left: -50px; }
  .hero-blob-3 { display: none; }

  .hero-sub { font-size: 0.92rem; }

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

  .site-footer { padding: 20px 16px; flex-direction: column; align-items: flex-start; }
}

@media (max-width: 900px) and (min-width: 641px) {
  .page { padding: 28px 20px 80px; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
