:root {
  --bg: #08080f;
  --bg-alt: #0f0f1c;
  --card-bg: #12121f;
  --text: #f3f2fa;
  --text-muted: #9997b3;
  --border: #23233a;

  --purple: #7c3aed;
  --magenta: #ec4899;
  --orange: #f97316;
  --blue: #3b82f6;
  --indigo: #4338ca;
  --lavender: #c4b5fd;

  --accent-text: #ffffff;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);

  --gradient-brand: linear-gradient(135deg, var(--purple), var(--magenta) 55%, var(--orange));
  --gradient-cool: linear-gradient(135deg, var(--indigo), var(--blue));
  --gradient-hero:
    radial-gradient(circle at 20% 15%, rgba(124, 58, 237, 0.24), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(236, 72, 153, 0.20), transparent 45%),
    radial-gradient(circle at 60% 90%, rgba(59, 130, 246, 0.16), transparent 50%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; }
::selection { background: var(--magenta); color: white; }

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(8, 8, 15, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transform: translateZ(0);
  will-change: transform;
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}

.monogram {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient-brand);
  color: white;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

.brand-name { font-weight: 700; font-size: 0.98rem; color: var(--text); }

.nav-links { display: flex; gap: 26px; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 0.92rem; transition: color 0.15s ease; }
.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* Buttons */
.btn {
  display: inline-block;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  padding: 10px 20px;
  font-size: 0.92rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--gradient-brand);
  color: #ffffff;
  box-shadow: 0 6px 22px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(236, 72, 153, 0.45); transform: translateY(-2px); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--purple); background: rgba(124, 58, 237, 0.08); transform: translateY(-2px); }

.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* Shared type helpers */
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--lavender);
  margin: 0 0 14px;
}
.eyebrow.center { display: block; text-align: center; }

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

.section-title-left { font-size: 2rem; margin: 0 0 20px; letter-spacing: -0.01em; }
.section-title-center {
  font-size: 2.1rem;
  text-align: center;
  margin: 0 auto 12px;
  letter-spacing: -0.01em;
  position: relative;
}
.section-sub-center { text-align: center; color: var(--text-muted); max-width: 560px; margin: 0 auto 48px; }

/* Hero */
.hero { position: relative; padding: 120px 24px 100px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: var(--gradient-hero); z-index: 0; }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.35;
  animation: float 10s ease-in-out infinite;
}
.orb-1 { width: 260px; height: 260px; background: var(--purple); top: -60px; left: 8%; }
.orb-2 { width: 220px; height: 220px; background: var(--magenta); bottom: -40px; right: 10%; animation-delay: -3s; }
.orb-3 { width: 180px; height: 180px; background: var(--blue); top: 30%; right: 30%; animation-delay: -6s; }

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-24px) translateX(12px); }
}

.hero-grid {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; line-height: 1.1; margin: 0 0 14px; letter-spacing: -0.02em; }
.hero-sub-heading { font-size: clamp(1.1rem, 2.4vw, 1.5rem); font-weight: 600; color: var(--text); margin: 0 0 20px; }
.hero-desc { color: var(--text-muted); font-size: 1.05rem; max-width: 520px; margin: 0 0 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-actions.center { justify-content: center; }

/* Hero code panel */
.hero-visual { position: relative; min-width: 0; }
.code-panel {
  background: rgba(18, 18, 31, 0.85);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(124, 58, 237, 0.08);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.code-panel-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.code-panel-title { margin-left: 10px; font-size: 0.78rem; color: var(--text-muted); font-family: "SFMono-Regular", Menlo, Consolas, monospace; }

.code-lines {
  margin: 0;
  padding: 20px 18px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--text);
  overflow-x: auto;
}
.code-lines .cm { color: var(--text-muted); }
.code-lines .kw { color: var(--magenta); }
.code-lines .fn { color: var(--blue); }
.code-lines .va { color: var(--lavender); }
.code-lines .st { color: var(--orange); }

.node {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gradient-brand);
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.7);
  animation: pulse 3s ease-in-out infinite;
}
.node-1 { top: -10px; right: 20%; animation-delay: 0s; }
.node-2 { bottom: 10%; left: -12px; animation-delay: -1s; }
.node-3 { top: 45%; right: -10px; animation-delay: -2s; }
@keyframes pulse { 0%, 100% { opacity: 0.5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.4); } }

/* Sections */
.section { padding: 100px 24px; max-width: 1160px; margin: 0 auto; }
.section-alt { max-width: none; background: var(--bg-alt); }
.section-alt > * { max-width: 1160px; margin-left: auto; margin-right: auto; }
.github-section, .contact-section { text-align: center; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center; }
.about-copy { color: var(--text-muted); font-size: 1.02rem; margin: 0 0 16px; }

.dev-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 340px;
  margin: 0 auto;
}
.dev-card-bar { display: flex; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.dev-card-body { padding: 28px 24px 32px; font-family: "SFMono-Regular", Menlo, Consolas, monospace; }
.dev-card-name { font-size: 0.82rem; letter-spacing: 0.06em; color: var(--text-muted); margin: 0 0 20px; }
.dev-card-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.dev-card-list li { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 12px; letter-spacing: 0.02em; }
.bullet { width: 8px; height: 8px; border-radius: 50%; }
.b1 { background: var(--purple); box-shadow: 0 0 10px var(--purple); }
.b2 { background: var(--magenta); box-shadow: 0 0 10px var(--magenta); }
.b3 { background: var(--orange); box-shadow: 0 0 10px var(--orange); }
.b4 { background: var(--blue); box-shadow: 0 0 10px var(--blue); }

/* Featured project */
.featured-project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 40px;
  position: relative;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.08), 0 30px 60px rgba(0, 0, 0, 0.35);
}
.featured-project::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 22px;
  padding: 1px;
  background: var(--gradient-brand);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.55;
  pointer-events: none;
}

.featured-visual { position: relative; padding: 0 28px 44px 0; min-width: 0; }

.device-frame {
  display: block;
  text-decoration: none;
  overflow: hidden;
  background: #0d0d18;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  cursor: pointer;
}
.device-frame:hover { transform: translateY(-4px); border-color: var(--purple); }
.device-frame img { display: block; width: 100%; height: auto; }

.device-laptop {
  border-radius: 14px;
  border: 1px solid var(--border);
}
.device-laptop:hover { box-shadow: 0 26px 60px rgba(124, 58, 237, 0.3); }

.browser-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: rgba(255, 255, 255, 0.03); border-bottom: 1px solid var(--border); }
.browser-addr { margin-left: 12px; font-size: 0.74rem; color: var(--text-muted); background: rgba(255, 255, 255, 0.04); padding: 4px 10px; border-radius: 999px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.device-phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 38%;
  min-width: 110px;
  border-radius: 22px;
  border: 4px solid #0d0d18;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
.device-phone:hover { box-shadow: 0 24px 48px rgba(236, 72, 153, 0.3); }
.phone-notch { width: 30%; height: 5px; background: rgba(255, 255, 255, 0.15); border-radius: 4px; margin: 7px auto; }

.featured-copy h3 { font-size: 1.6rem; margin: 0 0 12px; }
.project-title-link {
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s ease;
}
.project-title-link:hover { color: var(--lavender); }
.featured-copy p { color: var(--text-muted); margin: 0 0 20px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tag {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.25);
  color: var(--lavender);
}

.featured-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.coming-soon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 24px; }
.coming-soon-card {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
}
.cs-icon { display: block; font-size: 1.6rem; margin-bottom: 10px; opacity: 0.6; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.skill-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.skill-card h3 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin: 0 0 18px; }
.skill-dot { width: 10px; height: 10px; border-radius: 50%; }
.d1 { background: var(--purple); box-shadow: 0 0 10px var(--purple); }
.d2 { background: var(--magenta); box-shadow: 0 0 10px var(--magenta); }
.d3 { background: var(--blue); box-shadow: 0 0 10px var(--blue); }

/* Experiments */
.experiments-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.experiment-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 26px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.experiment-card:hover { transform: translateY(-5px); border-color: var(--purple); box-shadow: 0 16px 40px rgba(124, 58, 237, 0.2); }
.exp-icon { font-size: 1.6rem; display: block; margin-bottom: 14px; }
.experiment-card h3 { font-size: 1.05rem; margin: 0 0 8px; }
.experiment-card p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* Blog */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.blog-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.blog-card:hover { transform: translateY(-4px); border-color: var(--purple); box-shadow: 0 16px 40px rgba(124, 58, 237, 0.2); }
.blog-card-date { display: block; font-size: 0.76rem; color: var(--lavender); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.blog-card h3 { font-size: 1.15rem; margin: 0 0 10px; line-height: 1.35; }
.blog-card p { color: var(--text-muted); font-size: 0.92rem; margin: 0 0 16px; }
.blog-card-cta { font-size: 0.86rem; font-weight: 600; color: var(--text); }
.blog-more { text-align: center; margin-top: 32px; }

.blog-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

.article-hero-image {
  display: block;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  margin-bottom: 40px;
}

.article-body img {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  margin: 8px 0 28px;
}
.article-body figcaption {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  margin: -20px 0 28px;
}

/* Article pages */
.article { max-width: 720px; }
.article-header { margin-bottom: 40px; }
.article-header .blog-card-date { margin-bottom: 16px; }
.article-header h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.2; margin: 0 0 16px; letter-spacing: -0.01em; }
.article-header .tags { margin-top: 20px; }

.article-body { color: var(--text-muted); font-size: 1.05rem; line-height: 1.75; }
.article-body h2 { color: var(--text); font-size: 1.4rem; margin: 44px 0 16px; letter-spacing: -0.01em; }
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { color: var(--text); font-size: 1.15rem; margin: 32px 0 12px; }
.article-body p { margin: 0 0 20px; }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 24px; }
.article-body li { margin-bottom: 10px; }
.article-body strong { color: var(--text); }
.article-body a { color: var(--lavender); }
.article-body code {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(124, 58, 237, 0.12);
  color: var(--lavender);
  padding: 0.15em 0.4em;
  border-radius: 5px;
}
.article-body pre {
  background: #0d0d18;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  margin: 0 0 24px;
}
.article-body pre code { background: none; padding: 0; color: var(--text); font-size: 0.86rem; line-height: 1.6; }
.article-body blockquote {
  margin: 0 0 24px;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--purple);
  color: var(--text);
  font-style: italic;
}
.article-footer { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }

.blog-index-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 20px; }

/* GitHub */
.github-stat { color: var(--text-muted); font-size: 0.9rem; margin: -20px 0 28px; min-height: 1.2em; }

/* Legal pages */
.legal { max-width: 760px; }
.legal .section-title-left { margin-bottom: 8px; }
.legal .section-sub-left { color: var(--text-muted); margin: 0 0 40px; }

.legal-body { color: var(--text-muted); font-size: 1rem; }
.legal-body h3 { color: var(--text); margin: 32px 0 12px; font-size: 1.1rem; }
.legal-body h3:first-child { margin-top: 0; }
.legal-body p { margin: 0 0 16px; }
.legal-body ul { margin: 0 0 16px; padding-left: 22px; }
.legal-body li { margin-bottom: 8px; }
.legal-body a { color: var(--lavender); }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 32px 24px; }
.footer-inner { max-width: 1160px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); font-size: 0.88rem; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .featured-project { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .experiments-grid { grid-template-columns: 1fr 1fr; }
  .blog-grid, .blog-index-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 16px 24px; gap: 16px;
  }
  .hero { padding: 90px 20px 70px; }
  .skills-grid, .experiments-grid, .coming-soon-grid, .blog-grid, .blog-index-grid { grid-template-columns: 1fr; }
  .section { padding: 70px 20px; }
  .code-lines { font-size: 0.76rem; padding: 16px 14px; }
}
