/* ========================================
   DevSec Theme — Terminal Elegance
   Cybersecurity blog with refined dark aesthetic
   ======================================== */

/* ---- Custom Properties ---- */
:root {
  /* Dark theme (default) */
  --bg-0: #070b14;
  --bg-1: #0c1222;
  --bg-2: #131b2e;
  --bg-3: #1a2440;
  --text-0: #f1f5f9;
  --text-1: #cbd5e1;
  --text-2: #64748b;
  --accent: #ff8400;
  --accent-2: #00ffa3;
  --accent-3: #a78bfa;
  --border: #1e293b;
  --border-hover: rgba(0, 212, 255, 0.4);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.08), 0 10px 40px rgba(0, 0, 0, 0.2);
  --header-bg: rgba(12, 18, 34, 0.85);
  --tag-bg: rgba(0, 212, 255, 0.08);
  --tag-text: #ff8400;
  --tag-border: rgba(0, 212, 255, 0.2);
  --code-bg: #0d1117;
  --inline-code-bg: rgba(0, 212, 255, 0.08);
  --inline-code-text: #ff8400;
  --radius: 8px;
  --radius-lg: 12px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

[data-theme="light"] {
  --bg-0: #f8fafc;
  --bg-1: #f1f5f9;
  --bg-2: #ffffff;
  --bg-3: #e2e8f0;
  --text-0: #0f172a;
  --text-1: #334155;
  --text-2: #64748b;
  --accent: #ff8400;
  --accent-2: #059669;
  --accent-3: #7c3aed;
  --border: #e2e8f0;
  --border-hover: rgba(8, 145, 178, 0.4);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --header-bg: rgba(241, 245, 249, 0.9);
  --tag-bg: rgba(8, 145, 178, 0.08);
  --tag-text: #ff8400;
  --tag-border: rgba(8, 145, 178, 0.2);
  --code-bg: #1e1e2e;
  --inline-code-bg: rgba(8, 145, 178, 0.08);
  --inline-code-text: #ff8400;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-1);
  color: var(--text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s, color 0.3s;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

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

img {
  max-width: 100%;
  height: auto;
}

::selection {
  background: rgba(0, 212, 255, 0.3);
  color: var(--text-0);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--text-0);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

/* ---- Progress Bar ---- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 200;
  width: 0;
  transition: width 0.15s linear;
  pointer-events: none;
}

/* ---- Header / Navigation ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-0);
  display: flex;
  align-items: center;
  gap: 0;
  transition: color 0.2s;
}
.site-logo:hover {
  color: var(--accent);
}
.logo-bracket {
  color: var(--accent);
  font-weight: 400;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header-nav a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-2);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  letter-spacing: -0.01em;
}
.header-nav a:hover,
.header-nav a.active {
  color: var(--text-0);
  background: var(--bg-3);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem 0.5rem;
  color: var(--text-2);
  transition: all 0.2s;
  margin-left: 0.5rem;
  line-height: 1;
}
.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--accent);
  background: var(--tag-bg);
}

/* Mobile menu */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.mobile-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-1);
  border-radius: 2px;
  transition: all 0.3s;
}
.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav {
  display: none;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}
.mobile-nav.open {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.mobile-nav a {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-1);
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.mobile-nav a:hover {
  background: var(--bg-3);
  color: var(--text-0);
}

@media (max-width: 768px) {
  .header-nav { display: none; }
  .mobile-menu-toggle { display: flex; }
}

/* ---- Containers ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Hero Section ---- */
.hero {
  position: relative;
  padding: 7rem 1.5rem 5rem;
  overflow: hidden;
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: grid-drift 25s linear infinite;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, black 20%, transparent 70%);
}

@keyframes grid-drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(40px, 40px); }
}

.hero-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

/* Terminal */
.hero-terminal {
  display: inline-block;
  text-align: left;
  margin-bottom: 2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 320px;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
}

.terminal-body {
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.terminal-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-1);
}

.terminal-prompt {
  color: var(--accent-2);
  font-weight: 700;
  user-select: none;
}

.terminal-text {
  color: var(--text-0);
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--accent);
  animation: cursor-blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text-0);
  line-height: 1.15;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-2);
  margin-bottom: 2.5rem;
  font-family: var(--font-mono);
  font-weight: 400;
}

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

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  transition: all 0.25s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #070b14;
}
.btn-primary:hover {
  background: var(--accent-2);
  color: #070b14;
  box-shadow: 0 0 20px rgba(0, 255, 163, 0.3);
  transform: translateY(-1px);
}

.btn-icon {
  font-weight: 700;
  opacity: 0.7;
}

.btn-ghost {
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--accent);
  background: var(--tag-bg);
}

/* ---- Sections ---- */
.section {
  padding: 4rem 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding: 0 1.5rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-title .accent {
  color: var(--accent);
}

.section-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-2);
  transition: color 0.2s;
}
.section-link:hover {
  color: var(--accent);
}

/* ---- Article Cards (Homepage Grid) ---- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1.25rem;
  padding: 0 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.article-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.article-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.article-card-inner {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 220px;
}

.article-card-category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-3);
}

.article-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
}
.article-card-title a {
  color: var(--text-0);
  transition: color 0.2s;
}
.article-card-title a:hover {
  color: var(--accent);
}

.article-card-excerpt {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.6;
  flex: 1;
}

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

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--tag-text);
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  transition: all 0.2s;
}
.tag:hover {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
}
.tag::before {
  content: '#';
  opacity: 0.5;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.meta-dot {
  opacity: 0.4;
}

/* ---- Article List (Section Pages) ---- */
.page-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.page-title {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.page-title .accent {
  color: var(--accent);
}

.page-description {
  color: var(--text-2);
  font-size: 0.95rem;
}

.articles-list {
  display: flex;
  flex-direction: column;
}

.article-row {
  display: flex;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.article-row:hover {
  background: var(--bg-2);
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: var(--radius);
  border-bottom-color: transparent;
}

.article-row-date {
  flex-shrink: 0;
  width: 50px;
  text-align: center;
  font-family: var(--font-mono);
}
.article-row-date .date-month {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.article-row-date .date-day {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-0);
  line-height: 1.2;
}

.article-row-content {
  flex: 1;
  min-width: 0;
}

.article-row-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.article-row-title a {
  color: var(--text-0);
}
.article-row-title a:hover {
  color: var(--accent);
}

.article-row-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
}

.article-row-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* ---- Single Article ---- */
/* Article page two-column layout */
.article-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

.article-main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.article-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.article-cover img {
  width: 100%;
  max-height: 33vh;
  object-fit: cover;
  display: block;
}

.article-hero {
  padding: 2rem 2.5rem 1.5rem;
}

.article-body {
  padding: 0 2.5rem 2.5rem;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.article-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}

.sidebar-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.article-category {
  margin-bottom: 0.75rem;
}
.article-category a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #F6530F;
  text-decoration: none;
  transition: opacity 0.2s;
}
.article-category a:hover {
  opacity: 0.8;
}

.article-title {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
  max-width: 768px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-2);
}

/* ---- TLDR Section ---- */
.tldr-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-0);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.tldr-header {
  margin-bottom: 0.75rem;
}
.tldr-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  background: #F6530F;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}
.tldr-content {
  font-size: 0.92rem;
  color: var(--text-1);
  line-height: 1.7;
}
.tldr-content ul {
  margin: 0;
  padding-left: 1.25rem;
}
.tldr-content li {
  margin-bottom: 0.4rem;
}
.tldr-content li:last-child {
  margin-bottom: 0;
}

/* TOC sidebar card */

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.toc nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc nav ul ul {
  padding-left: 0.75rem;
  margin-top: 0.15rem;
}

.toc nav a {
  display: block;
  font-size: 0.75rem;
  color: var(--text-2);
  padding: 0.25rem 0.5rem;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all 0.2s;
  line-height: 1.5;
}
.toc nav a:hover {
  color: var(--text-0);
  background: var(--bg-3);
}
.toc nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--tag-bg);
}

@media (max-width: 1024px) {
  .article-sidebar {
    display: none;
  }
  .article-page {
    max-width: 100%;
  }
}

/* ---- Article Content Typography ---- */
.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 3rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.article-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2.5rem 0 0.75rem;
  color: var(--accent);
}

.article-body h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
}

.article-body p {
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-1);
}

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

.article-body ul,
.article-body ol {
  margin: 0.75rem 0 1.25rem 1.25rem;
  font-size: 1.05rem;
  line-height: 1.8;
}

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

.article-body li::marker {
  color: var(--accent);
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-2);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-2);
}
.article-body blockquote p {
  margin-bottom: 0;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(0, 212, 255, 0.3);
  transition: text-decoration-color 0.2s;
}
.article-body a:hover {
  text-decoration-color: var(--accent);
}

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

/* Inline code */
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--inline-code-bg);
  color: var(--inline-code-text);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--tag-border);
  word-break: break-word;
}

/* Code blocks */
.article-body pre {
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow-x: auto;
  max-width: 100%;
}

.article-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.65;
  border: none;
}

.article-body img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  max-width: 100%;
  height: auto;
}

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  overflow-x: auto;
  display: block;
}

.article-body thead {
  background: var(--bg-3);
}

.article-body th,
.article-body td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.article-body th {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-0);
}

.article-body td {
  font-size: 0.88rem;
}

/* ---- Code Blocks / Highlight ---- */
.highlight {
  position: relative;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--code-bg);
}

.highlight pre {
  margin: 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  word-break: break-all;
  white-space: pre-wrap;
}

/* Language label */
.highlight .code-lang {
  position: absolute;
  top: 0;
  right: 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
  background: var(--bg-3);
  padding: 0.25rem 0.65rem;
  border-radius: 0 var(--radius) 0 6px;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  z-index: 2;
  opacity: 0.7;
}

/* Copy button */
.highlight .copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-2);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s;
  z-index: 3;
}
.highlight:hover .copy-btn {
  opacity: 1;
}
.copy-btn:hover {
  color: var(--accent);
  border-color: var(--border-hover);
}
.copy-btn.copied {
  color: var(--accent-2);
  border-color: var(--accent-2);
}

/* Hugo line numbers in table */
.lntable {
  width: 100%;
  border-collapse: collapse;
  border: none;
  margin: 0;
  overflow: hidden;
  table-layout: fixed;
}
.lntable td {
  border: none;
  padding: 0;
  overflow-x: auto;
}
.lntable .lntd:first-child {
  width: 40px;
  user-select: none;
}
.lntable .lntd:first-child pre {
  padding-right: 0.75rem;
  text-align: right;
}
.lntable .lnt {
  color: var(--text-2);
  opacity: 0.4;
}
.lntable .lntd:last-child pre {
  padding-left: 0.5rem;
}

/* ---- Callout Boxes ---- */
.callout {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.92rem;
  line-height: 1.65;
  border: 1px solid;
}
.callout-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.callout-info {
  background: rgba(0, 212, 255, 0.06);
  border-color: rgba(0, 212, 255, 0.2);
  color: var(--text-1);
}
.callout-warning {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--text-1);
}
.callout-danger {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--text-1);
}
.callout-success {
  background: rgba(0, 255, 163, 0.06);
  border-color: rgba(0, 255, 163, 0.2);
  color: var(--text-1);
}

/* ---- Tags Page ---- */
.tags-page {
  max-width: 820px;
  margin: 0 auto;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.tag-large {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  transition: all 0.25s;
}
.tag-large:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--tag-bg);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.1);
  transform: translateY(-2px);
}

/* ---- About Page ---- */
.about-hero {
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
  padding: 4rem 1.5rem 3rem;
}

.about-hero-inner {
  max-width: 768px;
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.about-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--bg-0);
  font-family: var(--font-mono);
  flex-shrink: 0;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
}

.about-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.about-info h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.about-role {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.about-location {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-2);
  margin-bottom: 0.75rem;
}

.about-bio {
  font-size: 0.95rem;
  color: var(--text-1);
  line-height: 1.7;
}

.about-social {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.about-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all 0.2s;
}
.about-social a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--tag-bg);
}
.about-social a svg {
  width: 18px;
  height: 18px;
}

.about-body {
  max-width: 768px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.about-section {
  margin-bottom: 3rem;
}

.about-section-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.about-section-title .prompt {
  color: var(--accent);
}

/* Skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.skill-category {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.skill-category h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-1);
  background: var(--bg-3);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
  padding-left: 1.5rem;
}
.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -1.5rem;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.timeline-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.timeline-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-0);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
  background: var(--bg-3);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.timeline-company {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.timeline-desc {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* Certifications */
.cert-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cert-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.15rem;
  transition: all 0.2s;
}
.cert-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.cert-name {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-0);
}

.cert-issuer {
  font-size: 0.72rem;
  color: var(--text-2);
}

/* About page markdown content */
.about-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-1);
}
.about-content p {
  margin-bottom: 1.25rem;
}
.about-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-0);
  padding: 3rem 1.5rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-0);
}

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

.footer-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-2);
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--accent);
}

.footer-copy {
  width: 100%;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.footer-copy p {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-2);
  opacity: 0.6;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  body {
    display: block;
    min-height: 0;
  }

  .hero {
    padding: 5rem 1rem 3.5rem;
  }

  .hero-terminal {
    min-width: 0;
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

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

  .articles-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem;
    overflow: visible;
  }

  .article-card-inner {
    min-height: auto;
    padding: 1.25rem;
  }

  .section-header {
    padding: 0 1rem;
  }

  .article-page {
    flex-direction: column;
    padding: 0.5rem;
    gap: 1rem;
  }

  .article-sidebar {
    display: none;
  }

  .article-card {
    border-radius: var(--radius);
  }

  .article-cover img {
    max-height: 25vh;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .article-hero {
    padding: 1.25rem 1rem 0.75rem;
  }

  .article-body {
    padding: 0 1rem 1.5rem;
  }

  .article-body pre {
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 0;
    font-size: 0.75rem;
  }

  .highlight {
    max-width: calc(100% + 2rem);
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 0;
  }

  .article-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.8rem;
  }

  .article-body code {
    font-size: 0.8em;
    word-break: break-all;
  }

  .article-hero {
    padding: 1.25rem 1rem 0.75rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .lntable {
    display: block;
    overflow-x: auto;
    table-layout: auto;
  }

  .lntable .lntd:first-child {
    display: none;
  }

  .article-title {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .article-meta {
    font-size: 0.72rem;
  }

  .article-category a {
    font-size: 0.75rem;
  }

  .tldr-section {
    padding: 1rem;
  }

  .article-body p,
  .article-body ul,
  .article-body ol {
    font-size: 0.95rem;
  }

  .article-body h2 {
    font-size: 1.25rem;
  }

  .article-body h3 {
    font-size: 1.1rem;
  }

  .about-hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .about-social {
    justify-content: center;
  }

  .article-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .article-row-date {
    text-align: left;
    display: flex;
    gap: 0.5rem;
    width: auto;
  }
  .article-row-date .date-month {
    display: inline;
  }
  .article-row-date .date-day {
    display: inline;
    font-size: 0.85rem;
  }

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

  .footer-links {
    justify-content: center;
  }

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

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

.hero-content {
  animation: fade-in 0.6s ease-out;
}

.article-card {
  animation: fade-in 0.5s ease-out both;
}
.article-card:nth-child(2) { animation-delay: 0.05s; }
.article-card:nth-child(3) { animation-delay: 0.1s; }
.article-card:nth-child(4) { animation-delay: 0.15s; }
.article-card:nth-child(5) { animation-delay: 0.2s; }
.article-card:nth-child(6) { animation-delay: 0.25s; }

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 50;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
