/* ============================================================
   Mwila Molobeka — Personal Blog
   Cleaned-up styles. Single dark-mode block. No stray braces.
   ============================================================ */

/* ---------- Design tokens (must be first) ---------- */
:root {
  --brand-1: #6a11cb;
  --brand-2: #2575fc;
  --brand-2-dark: #1c65e0;
  --bg: #f8faf8;
  --surface: #ffffff;
  --surface-alt: #f8f9fa;
  --text: #333;
  --text-soft: #666;
  --border: #e5e7eb;
  --radius: 10px;
  --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --gradient: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s, color 0.3s;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: 10px; top: -50px;
  background: var(--brand-2);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  z-index: 2000;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 10px; }

/* ---------- Compound search widget ---------- */
.compound-search {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
#compound-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  background: var(--surface-alt);
  color: inherit;
  margin-bottom: 0.75rem;
}
#compound-input:focus { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.compound-results { display: flex; flex-direction: column; gap: 0.5rem; max-height: 340px; overflow-y: auto; }
.compound-row {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-alt);
  font-size: 0.9rem;
}
.compound-row strong { color: var(--brand-2); }
.compound-row .meta { color: var(--text-soft); font-size: 0.8rem; margin-top: 0.25rem; }
.compound-empty { color: var(--text-soft); font-style: italic; font-size: 0.9rem; }
body.dark-mode .compound-search { background: #1e1e1e; }
body.dark-mode #compound-input { background: #2d2d2d; border-color: #444; }
body.dark-mode .compound-row { background: #2d2d2d; border-color: #444; }

/* ---------- Mini plotter (portfolio card) ---------- */
.mini-plotter {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.mini-plotter-desc { font-size: 0.9rem; color: var(--text-soft); margin-bottom: 0.75rem; }
.mini-plotter-desc code { background: rgba(37,117,252,0.1); color: var(--brand-2);
                          padding: 1px 5px; border-radius: 3px; font-family: monospace; }
#mini-data {
  width: 100%;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-alt);
  color: inherit;
  resize: vertical;
  margin-bottom: 0.75rem;
}
.mini-plotter-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.mini-plotter-controls label {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mini-plotter-controls button {
  background: var(--gradient);
  color: #fff;
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.15s;
}
.mini-plotter-controls button:hover { transform: translateY(-1px); }
.mini-canvas-wrap { position: relative; height: 260px; }
.mini-fit {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  min-height: 1.8rem;
}
.mini-fit.success {
  background: rgba(40,167,69,0.12);
  color: #1b7a37;
  border: 1px solid rgba(40,167,69,0.3);
  font-family: 'Courier New', monospace;
}
.mini-fit.error {
  background: rgba(220,53,69,0.12);
  color: #b02a37;
  border: 1px solid rgba(220,53,69,0.3);
}
body.dark-mode .mini-plotter { background: #1e1e1e; }
body.dark-mode #mini-data { background: #2d2d2d; border-color: #444; }
body.dark-mode .mini-fit.success { background: rgba(40,167,69,0.2); color: #66d97d; }
body.dark-mode .mini-fit.error   { background: rgba(220,53,69,0.2); color: #ff7b88; }

/* ---------- Header ---------- */
header {
  background: var(--gradient);
  color: #fff;
  padding: 2rem 0;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.header-content { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.profile-img {
  width: 150px; height: 150px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 1rem;
  object-fit: cover;
}
h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.tagline { font-size: 1.2rem; opacity: 0.9; font-weight: 300; }

/* ---------- Navigation ---------- */
nav {
  background-color: var(--surface);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
nav ul {
  display: flex;
  list-style: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
nav li { display: flex; align-items: center; }
nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding: 1rem 1.2rem;
  display: inline-block;
  position: relative;
  transition: color 0.2s;
}
nav a:hover { color: var(--brand-2); }
nav a.active { color: var(--brand-2); }
nav a.active::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 1.2rem; right: 1.2rem;
  height: 2px;
  background-color: var(--brand-2);
  border-radius: 2px;
}

#darkModeToggle {
  background: transparent;
  border: 1px solid var(--border);
  color: inherit;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  margin-left: 0.5rem;
  transition: transform 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#darkModeToggle:hover { transform: scale(1.08); background: rgba(0,0,0,0.05); }

/* ---------- Layout ---------- */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 20px;
  flex-grow: 1;
  width: 100%;
}
.page-content {
  background-color: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  display: none;
  animation: fadeIn 0.35s ease-in-out;
}
.page-content.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--brand-2);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

/* ---------- Home ---------- */
.welcome-section { text-align: center; margin-bottom: 2rem; }
.welcome-section h2 { font-size: 2rem; margin-bottom: 1rem; color: var(--brand-2); }

.cta-btn {
  display: inline-block;
  margin-top: 1rem;
  background: var(--gradient);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.cta-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Molar calculator widget */
.tool-widget {
  background: var(--surface-alt);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  border-left: 4px solid var(--brand-2);
}
.tool-desc { color: var(--text-soft); margin-bottom: 1rem; }
.tool-desc code {
  background: rgba(37, 117, 252, 0.1);
  color: var(--brand-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
}
.tool-form { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tool-form input {
  flex: 1 1 220px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  background: var(--surface);
  color: inherit;
}
.tool-form input:focus { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.tool-form button {
  background: var(--gradient);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.tool-form button:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.tool-result {
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  min-height: 2.5rem;
}
.tool-result.success {
  background: rgba(40, 167, 69, 0.12);
  color: #1b7a37;
  border: 1px solid rgba(40, 167, 69, 0.3);
}
.tool-result.error {
  background: rgba(220, 53, 69, 0.12);
  color: #b02a37;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Featured posts */
.featured-posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.post-card {
  background-color: var(--surface-alt);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.post-image {
  width: 100%; height: 200px;
  object-fit: cover;
  background-color: #e0e7ff;
  display: block;
}
.post-content { padding: 1.5rem; }
.post-title { font-size: 1.3rem; margin-bottom: 0.5rem; }
.post-excerpt { color: var(--text-soft); margin-bottom: 1rem; }
.read-more {
  display: inline-block;
  color: var(--brand-2);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.read-more:hover { text-decoration: underline; }

/* ---------- Bio ---------- */
.bio-content { display: flex; flex-direction: column; gap: 1.5rem; }
.bio-text p { margin-bottom: 1rem; }
.bio-highlights {
  background-color: var(--surface-alt);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--brand-2);
}
.bio-highlights h3 { margin-bottom: 1rem; color: var(--brand-2); }
.bio-highlights ul { list-style: none; }
.bio-highlights li {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}
.bio-highlights li::before {
  content: "•";
  color: var(--brand-2);
  position: absolute;
  left: 0;
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.gallery-item {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 1;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
}
.gallery-item:hover,
.gallery-item:focus-visible { transform: translateY(-5px); box-shadow: var(--shadow-lg); outline: none; }
.gallery-item:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 3px; }
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
  display: block;
}
.gallery-item:hover img { transform: scale(1.05); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 2rem;
  animation: fadeIn 0.2s;
}
.lightbox[hidden] { display: none; }
.lightbox figure {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox figcaption {
  color: #fff;
  font-size: 1rem;
  text-align: center;
  max-width: 80vw;
  opacity: 0.9;
}
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  width: 48px; height: 48px;
  cursor: pointer;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  backdrop-filter: blur(6px);
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.08);
}
.lb-close { top: 20px; right: 20px; }
.lb-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---------- Portfolio ---------- */
.portfolio-header { text-align: center; margin-bottom: 2rem; }
.portfolio-header h2 { font-size: 2rem; margin-bottom: 1rem; color: var(--brand-2); }

.portfolio-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.category-card {
  background: var(--gradient);
  color: #fff;
  padding: 2rem;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  border: 0;
  font-family: inherit;
  transition: transform 0.3s, box-shadow 0.3s;
}
.category-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.category-card.active {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  outline: 3px solid rgba(255,255,255,0.6);
  outline-offset: -6px;
}
.category-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.category-card h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }

.portfolio-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.portfolio-item {
  background-color: var(--surface-alt);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
}
.portfolio-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.portfolio-item-header {
  background: var(--gradient);
  color: #fff;
  padding: 1rem;
  text-align: center;
}
.portfolio-item-body { padding: 1.5rem; }
.portfolio-item h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.portfolio-item p { color: var(--text-soft); margin-bottom: 1rem; font-size: 0.95rem; }
.key-findings { margin-left: 1.5rem; margin-bottom: 1rem; color: var(--text-soft); }
.key-findings li { margin-bottom: 0.4rem; }

.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.tag {
  background-color: #e0e7ff;
  color: var(--brand-2);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}
.portfolio-links { display: flex; gap: 1rem; margin-top: 1rem; }
.portfolio-link {
  flex: 1;
  text-align: center;
  background-color: var(--brand-2);
  color: #fff;
  padding: 0.55rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s;
}
.portfolio-link:hover { background-color: var(--brand-2-dark); }
.portfolio-link.github  { background-color: #333; }
.portfolio-link.github:hover  { background-color: #000; }
.portfolio-link.thesis  { background-color: #28a745; }
.portfolio-link.thesis:hover  { background-color: #1e7e34; }
.portfolio-link.demo    { background-color: #6c757d; }
.portfolio-link.demo:hover    { background-color: #5a6268; }

/* Code preview */
.code-preview {
  background-color: #2d2d2d;
  color: #f8f8f2;
  border-radius: 5px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}
.code-keyword { color: #ff79c6; }
.code-function { color: #50fa7b; }
.code-string { color: #f1fa8c; }
.code-comment { color: #6272a4; }

/* ---------- Contact ---------- */
.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.contact-card {
  background-color: var(--surface-alt);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  border-left: 4px solid var(--brand-2);
}
.contact-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.contact-card h3 { margin-bottom: 0.5rem; }
.contact-card p { color: var(--text-soft); margin: 0.25rem 0; }

.copy-btn {
  margin-top: 0.75rem;
  background: transparent;
  border: 1px solid var(--brand-2);
  color: var(--brand-2);
  padding: 0.3rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
}
.copy-btn:hover { background: var(--brand-2); color: #fff; }

.contact-form {
  background-color: var(--surface-alt);
  padding: 1.5rem;
  border-radius: 8px;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 500; }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  background: var(--surface);
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.15);
}
.form-group textarea { min-height: 150px; resize: vertical; }

.field-error {
  display: block;
  color: #b02a37;
  font-size: 0.85rem;
  margin-top: 0.3rem;
  min-height: 1rem;
}

/* Honeypot — visually hidden but not `display:none` */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.submit-btn {
  background-color: var(--brand-2);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s;
  width: 100%;
}
.submit-btn:hover { background-color: var(--brand-2-dark); }
.submit-btn:disabled { background-color: #6c757d; cursor: not-allowed; }

.form-message {
  display: none;
  margin-top: 15px;
  padding: 12px;
  border-radius: 4px;
  text-align: center;
}
.form-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.form-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ---------- Footer ---------- */
footer {
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
}
.footer-content { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.footer-signature { margin-top: 0.5rem; opacity: 0.8; font-style: italic; }
.social-links { display: flex; justify-content: center; gap: 1rem; margin-top: 1rem; }
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.25s;
}
.social-link:hover { background-color: var(--brand-2); transform: translateY(-3px); }

/* ---------- Scroll to top ---------- */
#scrollTop {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
  z-index: 900;
}
#scrollTop.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
#scrollTop:hover { box-shadow: var(--shadow-lg); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  nav ul { gap: 0; }
  nav a { padding: 0.75rem 0.9rem; font-size: 0.95rem; }
  h1 { font-size: 2rem; }
  .featured-posts,
  .portfolio-items,
  .portfolio-categories { grid-template-columns: 1fr; }
  .portfolio-links { flex-direction: column; }
  .container { padding: 0 15px; }
  .page-content { padding: 1.5rem; }
  .lb-prev, .lb-next { width: 40px; height: 40px; font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .profile-img { width: 120px; height: 120px; }
  h1 { font-size: 1.8rem; }
  .tagline { font-size: 1rem; }
  .section-title { font-size: 1.5rem; }
}

/* ---------- Dark mode ---------- */
body.dark-mode {
  color-scheme: dark;
  --bg: #121212;
  --surface: #1e1e1e;
  --surface-alt: #2d2d2d;
  --text: #e0e0e0;
  --text-soft: #b0b0b0;
  --border: #3a3a3a;
}

body.dark-mode header { background: linear-gradient(135deg, #4a148c 0%, #0d47a1 100%); }
body.dark-mode nav { background-color: #1e1e1e; border-bottom: 1px solid #333; }
body.dark-mode nav a { color: #e0e0e0; }
body.dark-mode nav a:hover,
body.dark-mode nav a.active { color: #64b5f6; }
body.dark-mode .page-content { box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); }
body.dark-mode .section-title { color: #64b5f6; border-bottom-color: #333; }
body.dark-mode .tag { background-color: #424242; color: #64b5f6; }
body.dark-mode .portfolio-item-header,
body.dark-mode .category-card { background: linear-gradient(135deg, #4a148c 0%, #0d47a1 100%); }
body.dark-mode .form-group input,
body.dark-mode .form-group textarea,
body.dark-mode .tool-form input { background-color: #2d2d2d; color: #e0e0e0; border-color: #444; }
body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus { border-color: #64b5f6; }
body.dark-mode .tool-desc code { background: rgba(100, 181, 246, 0.15); color: #64b5f6; }
body.dark-mode .tool-result.success { background: rgba(40, 167, 69, 0.2); color: #66d97d; border-color: rgba(40, 167, 69, 0.4); }
body.dark-mode .tool-result.error   { background: rgba(220, 53, 69, 0.2); color: #ff7b88; border-color: rgba(220, 53, 69, 0.4); }
body.dark-mode .portfolio-link,
body.dark-mode .submit-btn { background-color: #1976d2; }
body.dark-mode .portfolio-link:hover,
body.dark-mode .submit-btn:hover { background-color: #1565c0; }
body.dark-mode .portfolio-link.github { background-color: #424242; }
body.dark-mode .portfolio-link.github:hover { background-color: #333; }
body.dark-mode .portfolio-link.thesis { background-color: #2e7d32; }
body.dark-mode .portfolio-link.thesis:hover { background-color: #1b5e20; }
body.dark-mode .read-more { color: #64b5f6; }
body.dark-mode footer { background-color: #1e1e1e; border-top: 1px solid #333; }
body.dark-mode .social-link { background-color: #424242; }
body.dark-mode .social-link:hover { background-color: #1976d2; }
body.dark-mode .copy-btn { border-color: #64b5f6; color: #64b5f6; }
body.dark-mode .copy-btn:hover { background: #64b5f6; color: #121212; }
body.dark-mode #darkModeToggle { color: #ffeb3b; border-color: #555; }
body.dark-mode .form-message.success { background-color: rgba(40,167,69,0.2); color: #66d97d; border-color: rgba(40,167,69,0.4); }
body.dark-mode .form-message.error   { background-color: rgba(220,53,69,0.2); color: #ff7b88; border-color: rgba(220,53,69,0.4); }
body.dark-mode .field-error { color: #ff7b88; }

/* ---------- 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;
  }
}