@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&family=Playfair+Display:ital,wght@0,700;1,700&display=swap');

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

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-serif: 'Playfair Display', Georgia, serif;
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
  --content-width: 780px;
  --bg-primary: #050505;
  --bg-secondary: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #161616;
  --border: #1a1a1a;
  --border-hover: #2a2a2a;
  --text-primary: #f0f0f0;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent-1: #00d4aa;
  --accent-2: #00b4d8;
  --accent-3: #7c3aed;
  --gradient-accent: linear-gradient(135deg, #00d4aa, #00b4d8);
  --gradient-accent-2: linear-gradient(135deg, #7c3aed, #00b4d8);
  --gradient-subtle: linear-gradient(135deg, rgba(0,212,170,0.08), rgba(0,180,216,0.08));
  --code-bg: #0d1117;
  --code-text: #e6edf3;
  --nav-bg: rgba(5, 5, 5, 0.8);
  --grain-opacity: 0.03;
  --orb-opacity: 0.15;
  --selection-bg: rgba(0, 212, 170, 0.3);
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f7fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f2f5;
  --border: #e2e5e9;
  --border-hover: #ccd0d5;
  --text-primary: #1a1a2e;
  --text-secondary: #555770;
  --text-muted: #8b8fa3;
  --accent-1: #00997a;
  --accent-2: #0088a8;
  --accent-3: #6d28d9;
  --gradient-accent: linear-gradient(135deg, #00997a, #0088a8);
  --gradient-accent-2: linear-gradient(135deg, #6d28d9, #0088a8);
  --gradient-subtle: linear-gradient(135deg, rgba(0,153,122,0.06), rgba(0,136,168,0.06));
  --code-bg: #f6f8fa;
  --code-text: #24292f;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --grain-opacity: 0.015;
  --orb-opacity: 0.08;
  --selection-bg: rgba(0, 153, 122, 0.2);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

::selection {
  background: var(--selection-bg);
  color: var(--text-primary);
}

a {
  color: var(--accent-1);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-2);
}

/* ─── Grain 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='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 2rem;
  transition: all var(--transition);
}

.nav::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.nav.scrolled::before {
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  position: relative;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: inline-block;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--transition);
  position: relative;
}

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

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

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

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: all var(--transition);
  border-radius: 1px;
}

/* ─── Hero ─── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 0 2rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: var(--orb-opacity);
  animation: float 20s ease-in-out infinite;
}

.hero-bg .orb-1 {
  width: 600px;
  height: 600px;
  background: var(--accent-1);
  top: -200px;
  right: -100px;
}

.hero-bg .orb-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-3);
  bottom: -200px;
  left: -100px;
  animation-delay: -7s;
}

.hero-bg .orb-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-2);
  top: 50%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s ease forwards 0.2s;
}

.hero-label .line {
  width: 40px;
  height: 1px;
  background: var(--accent-1);
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s ease forwards 0.4s;
}

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

.hero-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s ease forwards 0.6s;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s ease forwards 0.8s;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #000;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 170, 0.3);
  color: #000;
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
  color: var(--text-primary);
}

/* ─── Sections ─── */
.section {
  padding: 8rem 2rem;
  position: relative;
}

.section-header {
  max-width: var(--max-width);
  margin: 0 auto 4rem;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  max-width: 600px;
}

/* ─── Project Cards ─── */
.projects-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

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

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

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

.project-card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--gradient-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
}

.project-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.project-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  background: rgba(0, 212, 170, 0.08);
  color: var(--accent-1);
  border: 1px solid rgba(0, 212, 170, 0.15);
}

.tag.purple {
  background: rgba(124, 58, 237, 0.08);
  color: var(--accent-3);
  border-color: rgba(124, 58, 237, 0.15);
}

.tag.blue {
  background: rgba(0, 180, 216, 0.08);
  color: var(--accent-2);
  border-color: rgba(0, 180, 216, 0.15);
}

/* ─── Stats strip ─── */
.stats {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* ─── Blog Cards ─── */
.blog-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.blog-card-image {
  height: 200px;
  background: var(--gradient-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.blog-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, var(--bg-card));
}

.blog-card-body {
  padding: 1.5rem 2rem 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.blog-card-meta .reading-time {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.blog-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.blog-card h3 a {
  color: var(--text-primary);
}

.blog-card h3 a:hover {
  color: var(--accent-1);
}

.blog-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  flex: 1;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.blog-card-footer .read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-1);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.blog-card-footer .read-more svg {
  transition: transform var(--transition);
}

.blog-card:hover .read-more svg {
  transform: translateX(4px);
}

/* ─── Blog listing page ─── */
.page-header {
  padding: 10rem 2rem 4rem;
  position: relative;
}

.page-header-content {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-header h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.page-header p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  max-width: 550px;
}

.blog-filters {
  max-width: var(--max-width);
  margin: 0 auto 3rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0 2rem;
}

.filter-btn {
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.filter-btn:hover,
.filter-btn.active {
  background: rgba(0, 212, 170, 0.1);
  border-color: rgba(0, 212, 170, 0.3);
  color: var(--accent-1);
}

/* ─── Article page ─── */
.article-header {
  padding: 10rem 2rem 4rem;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.article-header .article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.article-header h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.article-header .article-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.article-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.article-content h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 3rem 0 1.25rem;
  letter-spacing: -0.02em;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.article-content h3 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  color: var(--accent-1);
}

.article-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.article-content p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.85;
}

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

.article-content ul, .article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-content li {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 0.5rem;
}

.article-content li strong {
  color: var(--text-primary);
}

.article-content a {
  color: var(--accent-1);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(0, 212, 170, 0.3);
}

.article-content a:hover {
  text-decoration-color: var(--accent-1);
}

.article-content blockquote {
  border-left: 3px solid var(--accent-1);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--gradient-subtle);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.article-content blockquote p {
  margin-bottom: 0;
  color: var(--text-primary);
  font-style: italic;
}

.article-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 2rem 0;
  border: 1px solid var(--border);
}

/* Code blocks */
.article-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  position: relative;
}

.article-content pre code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--code-text);
  background: none;
  padding: 0;
  border-radius: 0;
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(0, 212, 170, 0.08);
  color: var(--accent-1);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

.code-label {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  background: rgba(255,255,255,0.03);
  border-radius: 0 var(--radius) 0 8px;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Callout boxes */
.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  margin: 2rem 0;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.callout p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.callout-info {
  background: rgba(0, 180, 216, 0.08);
  border: 1px solid rgba(0, 180, 216, 0.2);
}

.callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.callout-tip {
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.2);
}

.callout-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Table of contents */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem 0 3rem;
}

.toc h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.toc ol {
  list-style: none;
  padding: 0;
  counter-reset: toc;
}

.toc ol li {
  counter-increment: toc;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.toc ol li::before {
  content: counter(toc, decimal-leading-zero) ".";
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-1);
  margin-right: 0.75rem;
  font-weight: 600;
}

.toc ol li a {
  color: var(--text-secondary);
  text-decoration: none;
}

.toc ol li a:hover {
  color: var(--text-primary);
}

.toc ol ol {
  margin-left: 2rem;
  margin-top: 0.5rem;
}

/* ─── About Section ─── */
.about-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.skill-pill {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.skill-pill:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}

.about-visual {
  position: relative;
}

.terminal-window {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-left: 0.5rem;
}

.terminal-body {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
}

.terminal-body .prompt {
  color: var(--accent-1);
}

.terminal-body .comment {
  color: var(--text-muted);
}

.terminal-body .output {
  color: var(--text-secondary);
}

.terminal-body .highlight {
  color: var(--accent-2);
}

/* ─── Footer ─── */
.footer {
  padding: 4rem 2rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

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

.footer-links a:hover {
  color: var(--text-primary);
}

/* ─── Theme toggle ─── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
  transform: rotate(30deg);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

[data-theme="light"] .btn-primary {
  color: #fff;
}

[data-theme="light"] .btn-primary:hover {
  color: #fff;
}

[data-theme="light"] .hero h1 .gradient-text {
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .project-card,
[data-theme="light"] .blog-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

[data-theme="light"] .project-card:hover,
[data-theme="light"] .blog-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

[data-theme="light"] .terminal-header {
  background: rgba(0,0,0,0.03);
}

[data-theme="light"] .stat-number {
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] body::before {
  opacity: 0.015;
}

[data-theme="light"] .tag {
  background: rgba(0, 153, 122, 0.06);
  border-color: rgba(0, 153, 122, 0.15);
  color: var(--accent-1);
}

[data-theme="light"] .tag.purple {
  background: rgba(109, 40, 217, 0.06);
  border-color: rgba(109, 40, 217, 0.15);
  color: var(--accent-3);
}

[data-theme="light"] .tag.blue {
  background: rgba(0, 136, 168, 0.06);
  border-color: rgba(0, 136, 168, 0.15);
  color: var(--accent-2);
}

/* ─── Scroll animations ─── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 5rem 2rem;
    gap: 1.5rem;
    transition: right var(--transition);
    border-left: 1px solid var(--border);
  }

  .nav-links.open {
    right: 0;
  }

  .mobile-toggle {
    display: block;
  }

  .mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .projects-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

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

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .section {
    padding: 5rem 1.5rem;
  }

  .hero-cta {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }
}

/* ─── A11y ─── */
.skip-link {
  position: absolute;
  top: -48px;
  left: 1rem;
  z-index: 2000;
  padding: 0.6rem 1.2rem;
  background: var(--accent-1);
  color: #000;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  color: #000;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─── Hero spotlight (cursor-following) ─── */
.hero .spotlight {
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 70%) var(--my, 30%),
              rgba(0, 212, 170, 0.07), transparent 45%);
  transition: background 0.15s ease-out;
  pointer-events: none;
}

[data-theme="light"] .hero .spotlight {
  background: radial-gradient(600px circle at var(--mx, 70%) var(--my, 30%),
              rgba(0, 153, 122, 0.06), transparent 45%);
}

/* ─── Project status badges ─── */
.status-badge {
  position: absolute;
  top: 1.75rem;
  right: 1.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.live {
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent-1);
  border: 1px solid rgba(0, 212, 170, 0.25);
}

.status-badge.building {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-badge.exploring {
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-3);
  border: 1px solid rgba(124, 58, 237, 0.25);
}

/* ─── Now box ─── */
.now-box {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.now-box .now-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 0.85rem;
}

.now-box .now-label::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-1);
  animation: pulse-dot 2s ease-in-out infinite;
}

.now-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.now-box li {
  font-size: 0.92rem;
  color: var(--text-secondary);
  padding: 0.3rem 0;
  padding-left: 1.2rem;
  position: relative;
}

.now-box li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-1);
}

/* ─── Reading progress bar ─── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--gradient-accent);
  z-index: 1001;
  border-radius: 0 2px 2px 0;
}

/* ─── Appreciation (claps) ─── */
.clap-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 3.5rem 0 1rem;
  padding: 1.75rem 2rem;
  background: var(--gradient-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.clap-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--border-hover);
  background: var(--bg-card);
  font-size: 1.6rem;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clap-btn:hover {
  transform: scale(1.1);
  border-color: var(--accent-1);
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.25);
}

.clap-btn.pop {
  animation: clap-pop 0.3s ease;
}

@keyframes clap-pop {
  50% { transform: scale(1.3) rotate(-8deg); }
}

.clap-btn.maxed {
  opacity: 0.55;
  cursor: default;
}

.clap-meta .clap-count {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-primary);
  display: block;
  line-height: 1.3;
}

.clap-meta .clap-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── Playbook series list ─── */
.series {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.series-item {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  position: relative;
}

.series-item:hover {
  border-color: var(--border-hover);
  transform: translateX(6px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .series-item:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.series-num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent-1);
  opacity: 0.65;
  min-width: 2.8rem;
  flex-shrink: 0;
}

.series-body {
  flex: 1;
  min-width: 0;
}

.series-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.series-body h3 a {
  color: var(--text-primary);
}

.series-body h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.series-item:hover h3 a {
  color: var(--accent-1);
}

.series-body p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.series-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  flex-shrink: 0;
}

.series-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.start-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  background: var(--gradient-accent);
  color: #000;
  white-space: nowrap;
}

[data-theme="light"] .start-badge { color: #fff; }

.bonus-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  background: rgba(124, 58, 237, 0.12);
  color: var(--accent-3);
  border: 1px solid rgba(124, 58, 237, 0.25);
  white-space: nowrap;
}

/* ─── Calculators ─── */
.calc-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.calc-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
}

.calc-row {
  margin-bottom: 1.75rem;
}

.calc-row label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}

.calc-row label .val {
  color: var(--accent-1);
  font-family: var(--font-mono);
  font-size: 1.05rem;
}

.calc-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent-1);
  cursor: pointer;
}

.calc-row input[type="number"],
.calc-row select {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.calc-row input[type="number"]:focus,
.calc-row select:focus {
  outline: none;
  border-color: var(--accent-1);
}

.calc-row .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.calc-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.result-card {
  padding: 1.5rem 1.25rem;
  background: var(--gradient-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.result-card .result-value {
  font-size: 1.9rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.result-card.danger .result-value {
  background: none;
  -webkit-text-fill-color: #ff6b6b;
  color: #ff6b6b;
}

.result-card .result-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  font-weight: 500;
}

.calc-verdict {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  margin-top: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.calc-verdict.good {
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.25);
}

.calc-verdict.bad {
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.calc-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2rem;
  line-height: 1.7;
}

/* ─── CTA band ─── */
.cta-band {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem;
  background: var(--gradient-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cta-band h3 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cta-band p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

@media (max-width: 768px) {
  .series-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .series-side {
    flex-direction: row;
    align-items: center;
  }
  .cta-band {
    flex-direction: column;
    text-align: center;
  }
}

/* ============================================
   Code Syntax Highlighting (shared by all posts)
   Posts may carry a duplicate inline copy for
   standalone viewing; values must stay in sync.
   ============================================ */
.syntax-kw { color: #ff7b72; }
.syntax-fn { color: #d2a8ff; }
.syntax-str { color: #a5d6ff; }
.syntax-cm { color: #8b949e; }
.syntax-num { color: #79c0ff; }
.syntax-cls { color: #7ee787; }
[data-theme="light"] .syntax-kw { color: #cf222e; }
[data-theme="light"] .syntax-fn { color: #8250df; }
[data-theme="light"] .syntax-str { color: #0a3069; }
[data-theme="light"] .syntax-cm { color: #6e7781; }
[data-theme="light"] .syntax-num { color: #0550ae; }
[data-theme="light"] .syntax-cls { color: #116329; }

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   Print
   ============================================ */
@media print {
  .nav,
  .footer,
  .progress-bar,
  .clap-box,
  .skip-link,
  .theme-toggle,
  .mobile-toggle,
  .cta-band {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .article-content,
  .article-header {
    max-width: 100%;
    padding: 0;
  }
  a {
    color: inherit;
    text-decoration: underline;
  }
  pre {
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid #ccc;
  }
}
