/* ─── Fonts ─────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&family=Outfit:wght@300;400;500;600&display=swap');

/* ─── Tokens ────────────────────────────────────────────────────────────────── */
:root {
  --bg:       #fafaf8;
  --bg-card:  #ffffff;
  --text:     #181714;
  --text-muted: #6b6560;
  --accent:   #b8622a;
  --border:   #e8e4de;
  --nav-h:    64px;
}
[data-theme="dark"] {
  --bg:       #0e0d0c;
  --bg-card:  #1a1917;
  --text:     #f0ece6;
  --text-muted: #9a938b;
  --accent:   #d07840;
  --border:   #2a2825;
}

/* ─── Reset / Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  transition: background 0.25s, color 0.25s;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── Nav ────────────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  transition: background 0.25s, border-color 0.25s;
}
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 1rem; }
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px; height: 36px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 1.4rem;
}

/* ─── Mobile nav drawer ──────────────────────────────────────────────────────── */
.nav-drawer {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem clamp(1.5rem, 5vw, 4rem);
  z-index: 99;
  flex-direction: column;
  gap: 1.25rem;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nav-drawer a:hover { color: var(--accent); }

/* ─── Layout helpers ────────────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
}
section { padding: 6rem 0; }
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 3rem;
}

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
}
.hero-inner { max-width: 700px; }
.hero-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.hero-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 600;
  line-height: 1.05;
  margin-bottom: 1.5rem;
}
.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 560px;
  margin-bottom: 2.5rem;
}
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Experience ────────────────────────────────────────────────────────────── */
#experience { border-top: 1px solid var(--border); }
.experience-list { display: flex; flex-direction: column; gap: 0; }
.exp-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0 3rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}
.exp-meta { padding-top: 0.2rem; }
.exp-period {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.exp-company {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
}
.exp-role {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.exp-body {}
.exp-desc {
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  background: var(--bg-card);
}

/* ─── Projects ──────────────────────────────────────────────────────────────── */
#projects { border-top: 1px solid var(--border); }
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem;
  transition: border-color 0.2s, transform 0.2s;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.project-num {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1rem;
}
.project-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.project-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; }

/* ─── Blog ──────────────────────────────────────────────────────────────────── */
#blog { border-top: 1px solid var(--border); }
.blog-grid { display: flex; flex-direction: column; gap: 0; }
.blog-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}
.blog-card:first-child { border-top: 1px solid var(--border); }
.blog-card:hover .blog-title { color: var(--accent); }
.blog-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  transition: color 0.2s;
  margin-bottom: 0.4rem;
}
.blog-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }
.blog-meta { text-align: right; white-space: nowrap; }
.blog-date {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.35rem;
}
.blog-tags { display: flex; gap: 0.4rem; justify-content: flex-end; flex-wrap: wrap; }
.blog-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
}
.blog-all-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 2rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  transition: gap 0.2s;
}
.blog-all-link:hover { gap: 0.65rem; }

/* ─── Skills ────────────────────────────────────────────────────────────────── */
#skills { border-top: 1px solid var(--border); }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.skill-group {}
.skill-group-name {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.skill-group ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.skill-group li { font-size: 0.9rem; color: var(--text-muted); }

/* ─── About ─────────────────────────────────────────────────────────────────── */
#about { border-top: 1px solid var(--border); }
.about-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; }
.about-bio { font-size: 1rem; color: var(--text-muted); line-height: 1.85; }
.about-bio p + p { margin-top: 1.25rem; }
.about-quote {
  margin-top: 2rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.7;
}
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.stat {}
.stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }

/* ─── Contact ───────────────────────────────────────────────────────────────── */
#contact { border-top: 1px solid var(--border); }
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.contact-heading {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.contact-sub { font-size: 0.95rem; color: var(--text-muted); line-height: 1.75; }
.contact-links { display: flex; flex-direction: column; gap: 1rem; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  transition: border-color 0.2s, transform 0.2s;
}
.contact-link:hover { border-color: var(--accent); transform: translateX(4px); }
.contact-link-icon { font-size: 1.1rem; color: var(--accent); width: 20px; }
.contact-link-info {}
.contact-link-label { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.15rem; }
.contact-link-value { font-size: 0.9rem; font-weight: 500; }

/* ─── Footer ────────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ─── Fade-up animation ─────────────────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: block; }
  .exp-item { grid-template-columns: 1fr; gap: 1rem; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .about-inner { grid-template-columns: 1fr; gap: 3rem; }
  .contact-inner { grid-template-columns: 1fr; gap: 3rem; }
  .blog-card { grid-template-columns: 1fr; }
  .blog-meta { text-align: left; }
}
@media (max-width: 480px) {
  .skills-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
}

/* ─── Articles list page ────────────────────────────────────────────────────── */
.page-header {
  padding: calc(var(--nav-h) + 4rem) 0 3rem;
  border-bottom: 1px solid var(--border);
}
.page-header .section-label { margin-bottom: 0.75rem; }
.page-header .section-title { margin-bottom: 0.5rem; }
.page-header-sub { font-size: 0.95rem; color: var(--text-muted); }

.articles-list { padding: 0; }
.article-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  align-items: start;
  gap: 2rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
  text-decoration: none;
  color: inherit;
}
.article-row:first-child { border-top: 1px solid var(--border); margin-top: 2.5rem; }
.article-row:hover .article-row-title { color: var(--accent); }
.article-row-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}
.article-row-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 0.85rem; }
.article-row-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.article-row-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
}
.article-row-meta { text-align: right; padding-top: 0.3rem; }
.article-row-date {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.4rem;
}
.article-row-reading {
  font-size: 0.75rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .article-row { grid-template-columns: 1fr; gap: 0.75rem; }
  .article-row-meta { text-align: left; }
}

/* ─── Single article page ───────────────────────────────────────────────────── */
.article-wrap {
  padding-top: calc(var(--nav-h) + 4rem);
  padding-bottom: 6rem;
}
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3rem;
  transition: color 0.2s, gap 0.2s;
}
.article-back:hover { color: var(--accent); gap: 0.65rem; }

.article-header { max-width: 720px; margin-bottom: 3.5rem; }
.article-header-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.article-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}
.article-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.article-meta-date {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.article-meta-dot { color: var(--border); }
.article-meta-reading { font-size: 0.8rem; color: var(--text-muted); }
.article-meta-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-left: auto; }
.article-meta-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.article-meta-tag:hover { border-color: var(--accent); color: var(--accent); }

/* Article body layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 5rem;
  align-items: start;
}

/* Table of contents */
.article-toc {
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
}
.article-toc-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.article-toc nav { font-size: 0.82rem; }
.article-toc nav ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.article-toc nav ul ul { padding-left: 1rem; margin-top: 0.4rem; }
.article-toc nav a {
  color: var(--text-muted);
  line-height: 1.4;
  transition: color 0.2s;
}
.article-toc nav a:hover { color: var(--accent); }

/* Prose — article body */
.prose {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
  max-width: 720px;
}
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.prose h1 { font-size: 2rem; }
.prose h2 {
  font-size: 1.65rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.prose h3 { font-size: 1.3rem; }
.prose h4 { font-size: 1.1rem; }
.prose p { margin-bottom: 1.5rem; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { opacity: 0.8; }
.prose strong { font-weight: 600; color: var(--text); }
.prose em { font-style: italic; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.5rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  margin: 2rem 0;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--accent);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}
.prose img {
  border-radius: 4px;
  margin: 2rem 0;
  border: 1px solid var(--border);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.prose th, .prose td {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}
.prose th {
  font-weight: 600;
  background: var(--bg-card);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Inline code */
.prose code {
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 0.84em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.45em;
  color: var(--accent);
}

/* ── Code blocks ──────────────────────────────────────────────────────────── */
.prose .highlight {
  position: relative;
  margin: 2.25rem 0;
  border-radius: 10px;
  overflow: hidden;
  /* Outer glow / shadow */
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 8px 32px rgba(0,0,0,0.32),
    0 2px 8px rgba(0,0,0,0.18);
}

/* macOS-style header bar with traffic-light dots */
.prose .highlight::before {
  content: '';
  display: block;
  height: 42px;
  background: #1c1c1e;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  /* Three colored circles via layered radial gradients */
  background-image:
    radial-gradient(circle at center, #ff5f57 5.5px, transparent 5.5px),
    radial-gradient(circle at center, #febc2e 5.5px, transparent 5.5px),
    radial-gradient(circle at center, #28c840 5.5px, transparent 5.5px);
  background-repeat: no-repeat;
  background-position: 18px 50%, 36px 50%, 54px 50%;
  background-color: #1c1c1e;
  flex-shrink: 0;
}

/* Chroma wrapper */
.prose .highlight .chroma {
  background: #161618 !important;
  overflow-x: auto;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #3a3a3e transparent;
}
.prose .highlight .chroma::-webkit-scrollbar { height: 5px; }
.prose .highlight .chroma::-webkit-scrollbar-track { background: transparent; }
.prose .highlight .chroma::-webkit-scrollbar-thumb { background: #3a3a3e; border-radius: 10px; }

.prose .highlight pre {
  background: transparent !important;
  padding: 1.5rem 1.75rem;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.75;
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', ui-monospace, monospace;
  overflow-x: visible;
  white-space: pre;
}

.prose .highlight code {
  background: none;
  border: none;
  padding: 0;
  color: #e8e6e3;
  font-size: inherit;
  line-height: inherit;
}

/* ── Line numbers ─────────────────────────────────────────────────────────── */
.prose .highlight .lntable {
  border-spacing: 0;
  width: 100%;
  display: block;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3e transparent;
}
.prose .highlight .lntable::-webkit-scrollbar { height: 5px; }
.prose .highlight .lntable::-webkit-scrollbar-thumb { background: #3a3a3e; border-radius: 10px; }

.prose .highlight .lntable tbody { display: block; }
.prose .highlight .lntable tr { display: flex; }

/* Line-number cell */
.prose .highlight .lntd:first-child {
  width: 3.5rem;
  min-width: 3.5rem;
  user-select: none;
  padding: 1.5rem 0 1.5rem 1.25rem;
  background: #161618;
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
}
.prose .highlight .lntd:first-child pre {
  padding: 0;
  background: transparent !important;
}

/* Code cell */
.prose .highlight .lntd:last-child {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  padding: 0;
  background: #161618;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #3a3a3e transparent;
}
.prose .highlight .lntd:last-child::-webkit-scrollbar { height: 5px; }
.prose .highlight .lntd:last-child::-webkit-scrollbar-thumb { background: #3a3a3e; border-radius: 10px; }
.prose .highlight .lntd:last-child pre { flex: 1; }

/* Individual line number — anchor and span */
.prose .highlight .lnt,
.prose .highlight .ln {
  display: block;
  color: #42424a;
  font-size: 0.8rem;
  line-height: 1.75;
  text-align: right;
  padding-right: 1rem;
  text-decoration: none;
  transition: color 0.15s;
  font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
}
.prose .highlight .lnt:hover,
.prose .highlight .ln:hover { color: #6e6e78; }

/* Article nav (prev/next) */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  max-width: 720px;
}
.article-nav-link {
  display: block;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  transition: border-color 0.2s;
}
.article-nav-link:hover { border-color: var(--accent); }
.article-nav-link.next { text-align: right; }
.article-nav-dir {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.article-nav-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-toc { display: none; }
}
@media (max-width: 640px) {
  .article-nav { grid-template-columns: 1fr; }
  .article-nav-link.next { text-align: left; }
  .article-wrap { padding-top: calc(var(--nav-h) + 2.5rem); }
}

/* ─── Nav active state ──────────────────────────────────────────────────────── */
.nav-link-active { color: var(--accent) !important; }

/* ─── Downloads page ────────────────────────────────────────────────────────── */
.downloads-list {
  padding: 2.5rem 0 6rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2.5rem;
  transition: border-color 0.2s;
}
.app-card:hover { border-color: var(--accent); }
.app-card-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.app-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-icon-placeholder { font-size: 1.75rem; line-height: 1; }
.app-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 0.2rem;
}
.app-platform {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.app-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}
.app-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0;
}
.app-features li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
}
.app-features li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
}
.app-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.app-install-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
  .app-card { padding: 1.5rem; }
  .app-actions { flex-direction: column; }
  .app-actions .btn { text-align: center; }
}
