@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&display=swap');

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

:root {
  --bg: #f8f9fa; --surface: #ffffff; --surface-hover: #f1f3f5;
  --primary: #6c5ce7; --primary-light: #a29bfe; --secondary: #00cec9;
  --text: #1a1a24; --text-secondary: #4a4a5a; --text-muted: #8b8b9e;
  --border: rgba(0,0,0,0.08); --glow: rgba(108,92,231,0.15);
  --radius: 16px; --radius-sm: 10px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text);
  line-height: 1.6; overflow-x: hidden; min-height: 100vh;
}

/* === PARTICLES CANVAS === */
#particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* === NAVBAR === */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 2rem; height: 64px; display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.8); backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border); transition: all 0.3s;
}
.navbar.scrolled { background: rgba(255,255,255,0.95); box-shadow: 0 4px 30px rgba(0,0,0,0.05); }
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem; font-weight: 800;
  color: var(--text);
  text-decoration: none; letter-spacing: -0.5px;
  transition: opacity 0.3s;
}
.nav-logo:hover .logo-icon {
  transform: scale(1.15) rotate(10deg);
}
.logo-icon {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.logo-icon .bolt {
  stroke-dasharray: 60;
  animation: draw-bolt 3s linear infinite alternate, glow-bolt 2s ease-in-out infinite alternate;
}

@keyframes draw-bolt {
  0% { stroke-dashoffset: 60; }
  100% { stroke-dashoffset: 0; }
}
@keyframes glow-bolt {
  0% { filter: drop-shadow(0 0 2px rgba(108,92,231,0.5)); }
  100% { filter: drop-shadow(0 0 8px rgba(0,206,201,0.8)); }
}
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  color: var(--text-secondary); text-decoration: none; font-size: 0.875rem;
  font-weight: 500; transition: color 0.25s; position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px;
  background: var(--primary); transition: width 0.3s; border-radius: 2px;
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.mobile-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 32px; height: 32px; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.mobile-toggle span {
  display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px;
  transition: all 0.3s;
}

/* === HERO === */
.hero {
  position: relative; z-index: 1; padding: 140px 2rem 60px;
  text-align: center; max-width: 800px; margin: 0 auto;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 50px; font-size: 0.75rem; font-weight: 600;
  background: rgba(108,92,231,0.12); color: var(--primary-light); border: 1px solid rgba(108,92,231,0.2);
  margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 1.5px;
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--secondary); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.5); } }

.hero h1 {
  font-family: 'Space Grotesk', sans-serif; font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800; line-height: 1.15; margin-bottom: 1rem;
  background: linear-gradient(135deg, #1a1a24 0%, var(--primary) 50%, var(--secondary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  font-size: 1.1rem; color: var(--text-secondary); max-width: 550px;
  margin: 0 auto 2.5rem; line-height: 1.7;
}
.hero-subtitle .typed-cursor { animation: blink 1s infinite; color: var(--primary-light); }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* === SEARCH === */
.search-wrap {
  position: relative; max-width: 520px; margin: 0 auto;
}
.search-wrap svg {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; stroke: var(--text-muted); pointer-events: none;
}
.search-input {
  width: 100%; padding: 14px 20px 14px 48px; border-radius: 50px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: 0.95rem; font-family: inherit; outline: none; transition: all 0.3s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: rgba(108,92,231,0.4); box-shadow: 0 0 0 4px rgba(108,92,231,0.08);
}
.search-count {
  text-align: center; margin-top: 12px; font-size: 0.8rem; color: var(--text-muted);
  min-height: 20px; transition: opacity 0.3s;
}

/* === AD ZONE === */
.ad-zone {
  position: relative; z-index: 1; max-width: 728px; margin: 2rem auto;
  padding: 1.5rem; border-radius: var(--radius-sm); text-align: center;
  background: rgba(240,240,245,0.6); border: 1px dashed rgba(0,0,0,0.1);
  color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px;
}

/* === PAGE CONTENT (About, Terms, Privacy) === */
.page-content {
  position: relative; z-index: 1; padding: 120px 2rem 60px;
  max-width: 800px; margin: 0 auto;
}
.page-content h1 {
  font-family: 'Space Grotesk', sans-serif; font-size: 2.5rem; font-weight: 800;
  margin-bottom: 2rem; color: var(--primary);
}
.page-content h2 {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 700;
  margin: 2rem 0 1rem; color: var(--text);
}
.page-content p { margin-bottom: 1.5rem; color: var(--text-secondary); line-height: 1.8; }
.page-content ul { margin-bottom: 1.5rem; color: var(--text-secondary); padding-left: 1.5rem; line-height: 1.8; }
.page-content a { color: var(--secondary); text-decoration: none; font-weight: 600; }
.page-content a:hover { text-decoration: underline; }

/* === ARTICLES GRID === */
.section-header {
  position: relative; z-index: 1; text-align: center; padding: 1rem 2rem 2rem;
}
.section-header h2 {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 700;
  margin-bottom: 0.5rem;
}
.section-header p { color: var(--text-secondary); font-size: 0.9rem; }

.articles-grid {
  position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 0 2rem 2rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem;
}

/* === CARD === */
.article-card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); transition: all 0.4s cubic-bezier(0.25,0.46,0.45,0.94);
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
  opacity: 0; transform: translateY(30px);
}
.article-card.visible { opacity: 1; transform: translateY(0); }
.article-card:hover {
  transform: translateY(-6px); border-color: rgba(108,92,231,0.25);
  box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 0 40px var(--glow);
}

.card-thumb {
  height: 140px; display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; position: relative; overflow: hidden;
  background: var(--surface-hover);
}
.card-thumb::before {
  content: ''; position: absolute; inset: 0; opacity: 0.15;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transition: opacity 0.4s;
}
.article-card:hover .card-thumb::before { opacity: 0.25; }

.card-body { padding: 1rem 1.25rem 1.25rem; flex: 1; display: flex; flex-direction: column; }
.card-tag {
  display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: 0.65rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
  width: fit-content;
}
.tag-security { background: rgba(255,71,87,0.12); color: #ff4757; }
.tag-money { background: rgba(46,213,115,0.12); color: #2ed573; }
.tag-tech { background: rgba(108,92,231,0.12); color: var(--primary-light); }
.tag-psychology { background: rgba(255,165,2,0.12); color: #ffa502; }
.tag-ai { background: rgba(0,206,201,0.12); color: var(--secondary); }
.tag-privacy { background: rgba(255,107,129,0.12); color: #ff6b81; }
.tag-health { background: rgba(123,237,159,0.12); color: #7bed9f; }
.tag-finance { background: rgba(255,211,42,0.12); color: #ffd32a; }

.card-title {
  font-family: 'Space Grotesk', sans-serif; font-size: 1rem; font-weight: 700;
  line-height: 1.35; margin-bottom: 8px; transition: color 0.3s;
}
.article-card:hover .card-title { color: var(--primary-light); }

.card-snippet { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; flex: 1; margin-bottom: 1rem; }

.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-muted); padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.card-meta .read-time { display: flex; align-items: center; gap: 4px; }
.card-meta .arrow {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(108,92,231,0.1); color: var(--primary-light); font-size: 0.8rem;
  transition: all 0.3s;
}
.article-card:hover .arrow { background: var(--primary); color: #fff; transform: translateX(3px); }

/* === NO RESULTS === */
.no-results {
  display: none; text-align: center; padding: 4rem 2rem; color: var(--text-muted);
  grid-column: 1 / -1;
}
.no-results.show { display: block; }
.no-results .emoji { font-size: 3rem; margin-bottom: 1rem; }

/* === FOOTER === */
.footer {
  position: relative; z-index: 1; margin-top: 4rem; padding: 3rem 2rem;
  border-top: 1px solid var(--border); text-align: center;
}
.footer-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.footer-links a {
  color: var(--text-secondary); text-decoration: none; font-size: 0.85rem;
  font-weight: 500; transition: color 0.25s;
}
.footer-links a:hover { color: var(--primary-light); }
.footer-copy { font-size: 0.75rem; color: var(--text-muted); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-links {
    position: fixed; top: 64px; left: 0; right: 0; background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px); flex-direction: column; padding: 1.5rem; gap: 1.25rem;
    border-bottom: 1px solid var(--border); transform: translateY(-110%); transition: transform 0.35s;
  }
  .nav-links.open { transform: translateY(0); }
  .mobile-toggle { display: flex; }
  .hero { padding: 120px 1.25rem 40px; }
  .hero h1 { font-size: 2rem; }
  .articles-grid { grid-template-columns: 1fr; padding: 0 1rem 2rem; }
  .card-thumb { height: 150px; }
  .section-header { padding: 1rem 1rem 1.5rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.7rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .search-input { padding: 12px 16px 12px 42px; font-size: 0.875rem; }
}
