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

:root {
  --bg: #050508;
  --bg-raised: #0c0c12;
  --bg-card: #10101a;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text: #9a9ab0;
  --text-bright: #e2e2f0;
  --text-muted: #4a4a60;
  --accent-1: #6c63ff;
  --accent-2: #00d4aa;
  --accent-3: #ff6b9d;
  --gradient-1: linear-gradient(135deg, #6c63ff, #00d4aa);
  --gradient-2: linear-gradient(135deg, #ff6b9d, #ffa64d);
  --gradient-3: linear-gradient(135deg, #6c63ff, #ff6b9d);
  --glow-1: rgba(108, 99, 255, 0.15);
  --glow-2: rgba(0, 212, 170, 0.15);
  --radius: 12px;
  --radius-lg: 20px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---- Noise overlay ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

a { color: var(--accent-2); text-decoration: none; transition: color 0.2s; }
a:hover { color: #33e0bc; }

::selection { background: rgba(108,99,255,0.3); color: #fff; }

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Navigation ---- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.2rem 0;
  background: rgba(5,5,8,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

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

/* ---- Hero ---- */
.hero {
  position: relative;
  padding: 10rem 0 6rem;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  z-index: 0;
}

.hero-glow-1 {
  background: var(--accent-1);
  top: -200px;
  left: -100px;
  opacity: 0.12;
}

.hero-glow-2 {
  background: var(--accent-2);
  bottom: -300px;
  right: -200px;
  opacity: 0.08;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-bright);
  margin-bottom: 1rem;
}

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

.hero p {
  font-size: 1.05rem;
  color: var(--text);
  max-width: 480px;
  line-height: 1.7;
}

/* ---- Section headings ---- */
.section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Article cards ---- */
.articles {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-card {
  position: relative;
  display: block;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s ease;
  overflow: hidden;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-1);
  opacity: 0;
  transition: opacity 0.3s;
}

.article-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3), 0 0 40px var(--glow-1);
}

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

.article-card .tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25em 0.7em;
  border-radius: 20px;
  margin-bottom: 0.8rem;
}

.tag-guide { background: rgba(0,212,170,0.12); color: var(--accent-2); }
.tag-tutorial { background: rgba(108,99,255,0.12); color: var(--accent-1); }
.tag-thoughts { background: rgba(255,107,157,0.12); color: var(--accent-3); }

.article-card h3 {
  color: var(--text-bright);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.article-card:hover h3 { color: #fff; }

.article-card .excerpt {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.article-card .meta-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.article-card .meta-row .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* ---- Footer ---- */
footer {
  margin-top: 6rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer p {
  color: var(--text-muted);
  font-size: 0.78rem;
}

footer .footer-links {
  display: flex;
  gap: 1.5rem;
}

footer .footer-links a {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ---- Article page ---- */
.article-header {
  padding: 8rem 0 3rem;
  position: relative;
}

.article-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.article-header .back-link:hover { color: var(--text-bright); }

.article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  margin-bottom: 1rem;
}

.article-header .article-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.article-header .article-meta .dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

.article-body {
  padding-bottom: 4rem;
}

.article-body h2 {
  color: var(--text-bright);
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.article-body h2 .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  font-size: 0.75em;
  font-weight: 700;
  border-radius: 50%;
  background: var(--gradient-1);
  color: #fff;
  margin-right: 0.5rem;
  vertical-align: middle;
}

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

.article-body strong {
  color: var(--text-bright);
  font-weight: 600;
}

.article-body ul, .article-body ol {
  margin-bottom: 1.2rem;
  padding-left: 1.4rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body li ul {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

.article-body pre {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  overflow-x: auto;
  margin: 1rem 0 1.4rem;
  font-size: 0.85rem;
  line-height: 1.65;
}

.article-body pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-1);
  opacity: 0.3;
  border-radius: var(--radius) var(--radius) 0 0;
}

.article-body code {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: #c8c8e0;
}

.article-body p code, .article-body li code {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  font-size: 0.84em;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 1em;
}

.article-body hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 3rem 0;
}

.article-body .callout {
  background: rgba(108,99,255,0.06);
  border: 1px solid rgba(108,99,255,0.15);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1.2rem 0 1.4rem;
  font-size: 0.92rem;
}

.article-body .callout-green {
  background: rgba(0,212,170,0.06);
  border-color: rgba(0,212,170,0.15);
}

.article-body .callout strong {
  color: var(--accent-1);
}

.article-body .callout-green strong {
  color: var(--accent-2);
}

/* ---- About page ---- */
.about-section {
  padding: 8rem 0 4rem;
}

.about-section h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-bright);
  margin-bottom: 1.5rem;
}

.about-section .intro {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 540px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.3s;
}

.about-card:hover { border-color: var(--border-hover); }

.about-card .icon {
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.about-card .icon-purple { background: rgba(108,99,255,0.12); color: var(--accent-1); }
.about-card .icon-green { background: rgba(0,212,170,0.12); color: var(--accent-2); }
.about-card .icon-pink { background: rgba(255,107,157,0.12); color: var(--accent-3); }
.about-card .icon-orange { background: rgba(255,166,77,0.12); color: #ffa64d; }

.about-card h3 {
  color: var(--text-bright);
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .hero { padding: 8rem 0 4rem; }
  .about-grid { grid-template-columns: 1fr; }
  nav .nav-links { gap: 1.2rem; }
}

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

.fade-up {
  animation: fadeUp 0.6s ease forwards;
  opacity: 0;
}

.fade-up-d1 { animation-delay: 0.1s; }
.fade-up-d2 { animation-delay: 0.2s; }
.fade-up-d3 { animation-delay: 0.3s; }
.fade-up-d4 { animation-delay: 0.4s; }
