/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --text: #e4e4ed;
  --text-muted: #8888a0;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-gradient: linear-gradient(135deg, #6c5ce7, #a29bfe, #fd79a8);
  --radius: 12px;
  --radius-lg: 20px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  touch-action: pan-x pan-y;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Cursor Glow ===== */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108,92,231,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width 0.3s;
  border-radius: 1px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:active {
  opacity: 0.6;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: orbFloat 8s ease-in-out infinite;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: #6c5ce7;
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.orb-2 {
  width: 350px;
  height: 350px;
  background: #fd79a8;
  bottom: -10%;
  right: -10%;
  animation-delay: -3s;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: #00cec9;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -6s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(20px, 30px) scale(1.02); }
}

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

.badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
  background: rgba(108,92,231,0.15);
  border: 1px solid rgba(108,92,231,0.25);
  margin-bottom: 1.5rem;
  letter-spacing: 0.5px;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(108,92,231,0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108,92,231,0.5);
}

.btn:active {
  transform: scale(0.96);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
}

.btn-outline:hover {
  border-color: var(--accent);
  background: rgba(108,92,231,0.1);
  transform: translateY(-2px);
}

/* ===== Features ===== */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: rgba(108,92,231,0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

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

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer p + p {
  margin-top: 0.25rem;
}

#timestamp {
  color: var(--accent-light);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1.25rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10,10,15,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0.5rem 0;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 1.25rem;
  }

  .nav-links a::after {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .hero {
    padding: 5rem 1.25rem 3rem;
  }

  .orb-1 { width: 250px; height: 250px; }
  .orb-2 { width: 200px; height: 200px; }
  .orb-3 { width: 150px; height: 150px; }

  .features {
    grid-template-columns: 1fr;
    padding: 0 1.25rem 3rem;
  }

  .btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===== Articles Section ===== */
.articles {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.article-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  border-color: rgba(108,92,231,0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.article-card:active {
  transform: scale(0.97);
}

.article-category {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-light);
  background: rgba(108,92,231,0.12);
  margin-bottom: 0.75rem;
  align-self: flex-start;
  letter-spacing: 0.3px;
}

.article-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.article-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.article-readmore {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
}

.article-card:hover .article-readmore {
  opacity: 1;
}

/* ===== Article Modal ===== */
.article-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.article-modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 2rem;
  animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 210;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text);
}

.modal-close:active {
  transform: scale(0.88);
}

.modal-body .article-category {
  margin-bottom: 1rem;
}

.modal-body h2 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.modal-body .modal-summary {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-footer {
  margin-top: 1.5rem;
  text-align: center;
}

.modal-close-btn {
  padding: 0.6rem 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(108,92,231,0.1);
}

.modal-close-btn:active {
  transform: scale(0.96);
}

.modal-body .modal-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
}

.modal-text h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-text h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
}

.modal-text p {
  margin-bottom: 0.75rem;
}

.modal-text strong {
  color: #fff;
  font-weight: 700;
}

.modal-text ul {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.25rem;
}

.modal-text li {
  margin-bottom: 0.3rem;
  list-style: disc;
}

.modal-text code {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: #a29bfe;
}

.modal-text pre {
  margin: 0.75rem 0;
  padding: 1rem;
  border-radius: 8px;
  background: #0d0d14;
  border: 1px solid rgba(255,255,255,0.06);
  overflow-x: auto;
}

.modal-text pre code {
  background: none;
  padding: 0;
  color: #e4e4ed;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ===== Articles Responsive ===== */
@media (max-width: 768px) {
  .articles {
    padding: 0 1.25rem 3rem;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-modal {
    padding: 1rem;
    align-items: flex-end;
  }

  .modal-content {
    max-height: 85vh;
    padding: 1.5rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .article-readmore {
    opacity: 1;
  }
}
