/* ═══════════════════════════════════════════════
   JOSEPH SABA — PORTFOLIO
   Editorial / warm minimalism
   ═══════════════════════════════════════════════ */

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

/* ─── Tokens ─── */
:root {
  /* Palette — warm light */
  --bg:          #f7f5f0;
  --bg-hero:     #edeae3;
  --surface:     #ffffff;
  --surface2:    #f0ede6;
  --surface3:    #e8e4dc;
  --border:      #d9d4ca;
  --border-dim:  #e6e2da;

  /* Type */
  --text:        #1c1c1c;
  --text2:       #3a3a3a;
  --text-muted:  #6b6860;
  --text-dim:    #9a958c;
  --label:       #7a7568;

  /* Accent — forest / copper */
  --accent:      #2b6b3e;
  --accent-dim:  rgba(43,107,62,0.08);
  --accent-border: rgba(43,107,62,0.22);
  --copper:      #b45930;
  --copper-dim:  rgba(180,89,48,0.08);
  --copper-border: rgba(180,89,48,0.2);
  --slate:       #4a6274;
  --slate-dim:   rgba(74,98,116,0.08);
  --slate-border: rgba(74,98,116,0.2);
  --muted-badge: rgba(0,0,0,0.04);
  --muted-badge-border: rgba(0,0,0,0.1);

  /* Functional */
  --green:       #2b6b3e;
  --red:         #c0392b;
  --cyan:        #4a6274;
  --amber:       #b45930;

  /* Fonts */
  --font-display: 'Newsreader', 'Georgia', serif;
  --font-body:    'Outfit', 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --sidebar-w: 52px;
  --content-max: 960px;
  --radius: 8px;
  --radius-sm: 5px;
}

/* ─── Dark mode ─── */
[data-theme="dark"] {
  --bg:          #111114;
  --bg-hero:     #18181c;
  --surface:     #1c1c22;
  --surface2:    #232329;
  --surface3:    #2a2a32;
  --border:      #333340;
  --border-dim:  #282832;

  --text:        #e6e2da;
  --text2:       #c4c0b8;
  --text-muted:  #8a8680;
  --text-dim:    #5e5a54;
  --label:       #8a8680;

  --accent:      #5cb87a;
  --accent-dim:  rgba(92,184,122,0.1);
  --accent-border: rgba(92,184,122,0.25);
  --copper:      #e07a4a;
  --copper-dim:  rgba(224,122,74,0.1);
  --copper-border: rgba(224,122,74,0.25);
  --slate:       #7ca0b8;
  --slate-dim:   rgba(124,160,184,0.1);
  --slate-border: rgba(124,160,184,0.25);
  --muted-badge: rgba(255,255,255,0.04);
  --muted-badge-border: rgba(255,255,255,0.1);

  --green:       #5cb87a;
  --red:         #e06050;
  --cyan:        #7ca0b8;
  --amber:       #e07a4a;
}

/* Smooth transitions */
html { scroll-behavior: smooth; }
body, .sidebar, .page-header, .card, .project-card, .contact-card,
.skill-group, .stat-card, .blog-card, .article-nav-link, .btn {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/* ─── Base ─── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ─── Sidebar ─── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 0;
  z-index: 100;
  gap: 2px;
}

.sidebar .lucide { width: 16px; height: 16px; }

.sidebar-logo {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
  line-height:13px;
}

.nav-item {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}
.nav-item.active {
  color: var(--accent);
}

.nav-spacer { flex: 1; }

/* ─── Main ─── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

/* ─── Page header ─── */
.page-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
}

.page-header-left { display: flex; flex-direction: column; gap: 1px; }

.page-title {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ─── Content ─── */
.content {
  padding: 48px 40px 40px;
  max-width: var(--content-max);
}

/* ─── Sections ─── */
section { margin-bottom: 64px; scroll-margin-top: 80px; }

.section-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 120px;
}

/* ═══════════════════════════════════════════════
   HERO / ABOUT
   ═══════════════════════════════════════════════ */
.hero-bg-wrap {
  position: relative;
  margin: 0 -40px;
  padding: 56px 40px 48px;
  background: var(--bg-hero);
  border-bottom: 1px solid var(--border);
}

/* Subtle decorative element — replaces canvas */
.hero-bg-wrap::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40%;
  height: 100%;
  background: radial-gradient(
    ellipse at 80% 30%,
    var(--accent-dim) 0%,
    transparent 60%
  );
  pointer-events: none;
}

.hero-bg-canvas { display: none; } /* Remove the JS particle canvas */

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: start;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.hero-name span {
  display: block;
  color: var(--accent);
}

.hero-role {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 12px 0 20px;
}

/* Override the nested h1.hero-role inside .hero-bio */
.hero-bio .hero-role {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  font-style: italic;
  color: var(--text2);
  letter-spacing: 0;
  text-transform: none;
  margin: 0 0 16px;
  line-height: 1.4;
}

.hero-bio {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text2);
  line-height: 1.75;
  max-width: 560px;
}
.hero-bio p + p { margin-top: 12px; }

.hero-links {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 9px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

/* ─── Stat cards (hero sidebar) ─── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════════════ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.3s, transform 0.3s;
  cursor: pointer;
}
.project-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 8px 30px rgba(0,0,0,0.07);
  transform: translateY(-2px);
}

.project-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.4s ease;
}
.project-card:hover .project-thumb img { transform: scale(1.04); }

.project-thumb-placeholder {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
}
.project-thumb-placeholder .icon {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
  opacity: 0.3;
}

.project-meta { padding: 16px 18px 18px; }

.project-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

.badge-green  { background: var(--accent-dim);  color: var(--accent);  border: 1px solid var(--accent-border); }
.badge-cyan   { background: var(--slate-dim);   color: var(--slate);   border: 1px solid var(--slate-border); }
.badge-amber  { background: var(--copper-dim);  color: var(--copper);  border: 1px solid var(--copper-border); }
.badge-muted  { background: var(--muted-badge); color: var(--text-muted); border: 1px solid var(--muted-badge-border); }

.project-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.project-desc {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}

.project-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
}

.project-link {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}
.project-link:hover { opacity: 0.7; }
.project-link + .project-link::before {
  content: '·';
  margin-right: 12px;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════════
   FEATURED
   ═══════════════════════════════════════════════ */

.writing-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.writing-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 20px;
  text-decoration: none;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.writing-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.writing-stat {
  font-size: 28px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.writing-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 8px;
}

.writing-tag {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.skill-group-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-tag {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.01em;
  transition: all 0.15s;
}

.skill-tag.green {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.skill-tag.green:hover {
  background: var(--accent);
  color: #fff;
}

.skill-tag.cyan {
  background: var(--slate-dim);
  color: var(--slate);
  border: 1px solid var(--slate-border);
}
.skill-tag.cyan:hover {
  background: var(--slate);
  color: #fff;
}

.skill-tag.amber {
  background: var(--copper-dim);
  color: var(--copper);
  border: 1px solid var(--copper-border);
}
.skill-tag.amber:hover {
  background: var(--copper);
  color: #fff;
}

.skill-tag.muted {
  background: var(--muted-badge);
  color: var(--text-muted);
  border: 1px solid var(--muted-badge-border);
}
.skill-tag.muted:hover {
  background: var(--text-muted);
  color: var(--bg);
}

/* ═══════════════════════════════════════════════
   TIMELINE / EXPERIENCE
   ═══════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}
.card-badge {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.card-body { padding: 18px; }

.timeline { display: flex; flex-direction: column; }

.timeline-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-dim);
}
.timeline-item:last-child { border-bottom: none; }

.timeline-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  padding-top: 3px;
  line-height: 1.5;
}

.timeline-body-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.timeline-body-org {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin: 2px 0 8px;
}

.timeline-body-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════════════ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.contact-card-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.contact-card-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.footer {
  padding: 32px 40px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  letter-spacing: 0.03em;
}

.footer-page {
  font-size:9pt;
  margin:10px 0;
}

/* ═══════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  overflow-y: auto;
  padding: 48px 24px 24px;
}
.lightbox.open { display: block; }

.lightbox-inner {
  width: fit-content;
  max-width: 96vw;
  margin: 0 auto;
  position: relative;
}

.lightbox-close {
  position: absolute;
  top: -36px;
  right: 0;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: color 0.15s;
}
.lightbox-close:hover { color: #fff; }

.lightbox-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 1001;
  transition: background 0.15s;
}
.lightbox-arrow:hover { background: rgba(255,255,255,0.18); }
.lightbox-arrow.lb-prev { left: 20px; }
.lightbox-arrow.lb-next { right: 20px; }
.lightbox.open .lightbox-arrow { display: flex; }
.lightbox-arrow.hidden { display: none !important; }

.lightbox-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.1em;
  pointer-events: none;
  display: none;
}
.lightbox.open .lightbox-counter { display: block; }

.lightbox-body {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
}

.lightbox-body img {
  max-width: 80vw;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.lightbox-info {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}
.lightbox-info:empty { display: none; }

.lightbox-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.lightbox-description {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════
   PROJECT MODALS
   ═══════════════════════════════════════════════ */
.project-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.project-modal.open { display: flex; }

.project-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.project-modal-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}

.project-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.project-modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-top: 8px;
}

.project-modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.project-modal-close:hover { color: var(--text); }

.project-modal-body {
  overflow-y: auto;
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.project-modal-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.project-modal-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.75;
}

.project-modal-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.project-modal-images img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  object-position: top;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: border-color 0.15s, box-shadow 0.2s;
  display: block;
}
.project-modal-images img:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.project-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   GALLERY
   ═══════════════════════════════════════════════ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.gallery-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.gallery-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.gallery-item img {
  width: 100%;
  display: block;
  aspect-ratio: 16/10;
  object-fit: cover;
  object-position: top;
}

.gallery-item-label {
  padding: 10px 12px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   EMBED AREA
   ═══════════════════════════════════════════════ */
.embed-area {
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 80px;
}
.embed-area-hint {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════
   SCROLL FADE
   ═══════════════════════════════════════════════ */
.fade-section {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════
   BLOG LISTING
   ═══════════════════════════════════════════════ */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.blog-card {
  display: block;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s;
}
.blog-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.blog-card-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.blog-card-summary {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 12px;
}

.blog-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.blog-empty {
  padding: 80px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

/* ═══════════════════════════════════════════════
   ARTICLE PAGE
   ═══════════════════════════════════════════════ */
.article-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.article-back {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 20px;
}
.article-back:hover { text-decoration: underline; }

.article-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.article-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 14px;
}

.article-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.article-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text2);
  max-width: 680px;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 28px 0 10px;
}

.article-body p { margin-bottom: 18px; }

.article-body ul, .article-body ol {
  margin: 12px 0 18px 20px;
}
.article-body li { margin-bottom: 6px; }

.article-body code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface2);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--copper);
}

.article-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  overflow-x: auto;
  margin: 18px 0;
}
.article-body pre code {
  background: none;
  padding: 0;
  color: var(--text2);
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 14px 20px;
  margin: 18px 0;
  background: var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text2);
  font-style: italic;
}

.article-body blockquote p {
  margin:0;
}

.article-body img {
  max-width: 100%;
  border-radius: var(--radius);
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-border);
  text-underline-offset: 2px;
}
.article-body a:hover {
  text-decoration-color: var(--accent);
}

.article-body figure { margin-top: 24px; }
.article-body figcaption {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 8px;
}

/* Article nav */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s;
}
.article-nav-link:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
.article-nav-next { text-align: right; }

.article-nav-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.article-nav-title {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

#blog-page, #article-page {
  max-width: 760px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════
   LGA LANGUAGE EXPLORER OVERRIDES
   ═══════════════════════════════════════════════ */
.page-wide { 
  padding: 0 32px 40px; 
  margin-left: var(--sidebar-w); 
}

.topbar {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.topbar-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.topbar-sub {
  font-size: 11px;
  color: var(--text-dim);
}
.topbar-right { text-align: right; }
.topbar-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}
.topbar-date {
  font-size: 11px;
  color: var(--text-dim);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
  margin-top:20px;
}
.search-wrapper {
  position: relative;
  flex: 1 1 auto;
  min-width: 280px;
  max-width: 900px;
}
.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  font-family: var(--font-body);
  font-size: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.12s;
}

.search-wrapper .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-dim);
  pointer-events: none;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-dim); }

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Toggle switch styles */
.toggle-wrap input[type="checkbox"] { display: none; }
.toggle-wrap .toggle-track {
  width: 52px;
  height: 28px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  position: relative;
  box-sizing: border-box;
  padding: 3px;
  transition: background 0.12s, border-color 0.12s;
}
.toggle-wrap .toggle-track::after {
  content: "";
  width: 20px;
  height: 20px;
  background: var(--surface);
  border-radius: 50%;
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  transition: left 0.14s ease, transform 0.14s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.toggle-wrap input[type="checkbox"]:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent-border);
}
.toggle-wrap input[type="checkbox"]:checked + .toggle-track::after {
  left: calc(100% - 4px - 20px);
}

/* Ensure the label text sits nicely */
.toggle-wrap .toggle-label { font-size: 13px; color: var(--text-muted); }

.dropdown {
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 4px;
  max-height: 320px;
  overflow-y: auto;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  width: 100%;
  z-index: 80;
  box-shadow: 0 8px 20px rgba(22,24,34,0.06);
}
.dropdown { display: none; }
.dropdown.show { display: block; }
.dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.dropdown-item:hover { background: var(--surface2); }
.dropdown-item .lga-name {
  color: var(--text);
  font-size: 14px;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dropdown-item .lga-name mark {
  background: none;
  color: var(--accent);
  font-weight: 600;
}
.dropdown-item .lga-state {
  font-size: 12px;
  color: var(--text-dim);
  flex: 0 0 auto;
  margin-left: 12px;
  white-space: nowrap;
  text-align: right;
}

.results-section { display: none; }
.results-section.show { 
  display: block; 
  animation: fadeIn 0.3s ease; 
  margin-top:20px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.result-lga {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}
.result-state {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.result-stats { display: flex; gap: 24px; text-align: right; }
.stat-box .stat-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}
.stat-box .stat-val.cyan { color: var(--slate); }
.stat-box .stat-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}
.stat-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

.lang-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.lang-table { width: 100%; border-collapse: collapse; }
.lang-table thead th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.lang-table thead th.num { text-align: right; }
.lang-table tbody tr {
  border-bottom: 1px solid var(--border-dim);
  transition: background 0.1s;
  animation: fadeIn 0.25s ease backwards;
}
.lang-table tbody tr:hover { background: var(--surface2); }
.lang-table tbody tr:last-child { border-bottom: none; }
.lang-table tbody td {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text2);
}
.lang-table tbody td.num { text-align: right; font-size: 12px; }
.lang-table tbody td.rank { font-size: 11px; color: var(--text-dim); width: 40px; }
.lang-table tbody td.lang-name { font-weight: 500; color: var(--text); }

.growth-up   { color: var(--accent); }
.growth-down { color: var(--red); }
.growth-flat { color: var(--text-dim); }

.bar-cell { position: relative; }
.bar-bg {
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  height: 22px;
  background: var(--slate-dim);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.bar-val { position: relative; z-index: 1; }

.empty-state { text-align: center; padding: 80px 20px; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 15px; color: var(--text-muted); }
.empty-state .hint { font-size: 12px; color: var(--text-dim); margin-top: 8px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

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

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .content { padding: 32px 20px; }
  .page-header { padding: 12px 20px; }
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero-bg-wrap { margin: 0 -20px; padding: 32px 20px; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .footer { flex-direction: column; gap: 4px; padding: 24px 20px; }
  .page-wide { padding: 0 20px 32px; }
}

@media (max-width: 600px) {
  .topbar { flex-direction: column; gap: 10px; align-items: flex-start; }
  .search-bar { flex-direction: column; }
  .toggle-wrap { align-self: flex-start; }
  .result-header { flex-direction: column; gap: 12px; }
  .result-stats { text-align: left; }
  .project-grid { grid-template-columns: 1fr; }
}
