/* ============================================================
   main.css — Global styles, design system, dark theme
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* --- CSS Variables --- */
:root {
  /* Backgrounds — slate-900 dark palette */
  --bg-primary:    #0F172A;
  --bg-secondary:  #1E293B;
  --bg-tertiary:   #293548;
  --border:        #334155;

  /* Accent — soft indigo/purple ("soft blue or purple") */
  --accent:        #818CF8;
  --accent-hover:  #6366F1;
  --accent-dim:    rgba(129, 140, 248, 0.12);

  /* Text */
  --text-primary:  #E2E8F0;
  --text-secondary:#94A3B8;
  --text-muted:    #64748B;

  /* Semantic */
  --success:       #34D399;
  --error:         #F87171;
  --warning:       #FBBF24;
  --blue:          #60A5FA;

  /* Typography */
  --font-mono:  'Space Mono', 'Courier New', monospace;
  --font-body:  'Inter', system-ui, sans-serif;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;

  /* Shadows */
  --shadow:     0 4px 32px rgba(0, 0, 0, 0.5);
  --shadow-sm:  0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-card:0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(129,140,248,0.12);

  /* Layout */
  --nav-height: 64px;
  --container:  1200px;
  --gap:        24px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Arabic RTL support — Cairo is kept for Arabic text */
[lang="ar"], .ar { direction: rtl; text-align: right; font-family: 'Cairo', sans-serif; }

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

img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* --- Container --- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gap); }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 var(--gap); }

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.nav__inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav__logo {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 700;
  white-space: nowrap;
}
.nav__logo span { color: var(--accent); }
.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.nav__links a {
  color: var(--text-secondary);
  font-size: 14px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}
.nav__links a:hover,
.nav__links a.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}
.nav__links a.active { color: var(--accent); }

/* Nav subscribe CTA */
.nav__subscribe {
  margin-left: 8px;
  background: var(--accent);
  color: #fff;
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
}
.nav__subscribe:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.nav__toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.25s;
}

/* --- Hero Section --- */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(129,140,248,0.1) 0%, rgba(99,102,241,0.04) 50%, transparent 70%);
  pointer-events: none;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--accent-dim);
  border: 1px solid rgba(255,140,30,0.3);
  color: var(--accent);
  font-size: 13px;
  font-family: var(--font-mono);
  margin-bottom: 24px;
}
.hero__badge::before { content: '●'; font-size: 8px; animation: pulse 2s infinite; }
.hero__title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -1px;
}
.hero__title .accent { color: var(--accent); }
.hero__subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.6;
}
.hero__cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(129,140,248,0.25);
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; box-shadow: 0 4px 18px rgba(99,102,241,0.35); }
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 8px 16px;
  font-size: 13px;
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.btn-danger {
  background: rgba(248,81,73,0.12);
  color: var(--error);
  border: 1px solid rgba(248,81,73,0.3);
}
.btn-danger:hover { background: rgba(248,81,73,0.2); }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* --- Cards --- */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.card:hover {
  border-color: rgba(129,140,248,0.45);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}
.card__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-tertiary); }
.card__body { padding: 20px; }
.card__tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--accent-dim);
  color: var(--accent);
  margin-bottom: 10px;
}
.card__title { font-size: 17px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.card__excerpt { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }
.card__meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.card__tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* --- Section --- */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section__header { text-align: center; margin-bottom: 48px; }
.section__label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.section__title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.section__desc { font-size: 16px; color: var(--text-secondary); max-width: 560px; margin: 0 auto; }

/* --- Grid layouts --- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }

/* --- Stats bar --- */
.stats-row { display: flex; gap: var(--gap); justify-content: center; flex-wrap: wrap; margin: 48px 0; }
.stat {
  text-align: center;
  padding: 24px 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 140px;
}
.stat__num {
  font-size: 36px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}
.stat__label { font-size: 13px; color: var(--text-secondary); }

/* --- Profile card --- */
.profile-card {
  display: flex;
  gap: 40px;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
}
.profile-card__avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  flex-shrink: 0;
}
.profile-card__name { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.profile-card__role { color: var(--accent); font-family: var(--font-mono); font-size: 14px; margin-bottom: 12px; }
.profile-card__bio { color: var(--text-secondary); font-size: 15px; line-height: 1.7; max-width: 600px; }

/* --- Timeline --- */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline__item { position: relative; margin-bottom: 32px; }
.timeline__item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
}
.timeline__date { font-family: var(--font-mono); font-size: 12px; color: var(--accent); margin-bottom: 6px; }
.timeline__title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.timeline__company { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.timeline__desc { font-size: 14px; color: var(--text-secondary); }

/* --- Divider --- */
.divider { border: none; border-top: 1px solid var(--border); margin: 48px 0; }

/* --- Badge / skill chip --- */
.badge-list { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  padding: 5px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.badge:hover { border-color: var(--accent); color: var(--accent); }
.badge-accent { background: var(--accent-dim); border-color: rgba(255,140,30,0.3); color: var(--accent); }

/* --- Empty state --- */
.empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-secondary);
}
.empty__icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty__title { font-size: 20px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary); }
.empty__text { font-size: 14px; }

/* --- Flash messages --- */
.flash {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.flash-success { background: rgba(63,185,80,0.12); border: 1px solid rgba(63,185,80,0.3); color: var(--success); }
.flash-error   { background: rgba(248,81,73,0.12);  border: 1px solid rgba(248,81,73,0.3);  color: var(--error); }
.flash-warning { background: rgba(210,153,34,0.12); border: 1px solid rgba(210,153,34,0.3); color: var(--warning); }

/* --- Pagination --- */
.pagination ul { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }
.pagination li a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.2s;
}
.pagination li.active a, .pagination li a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* --- Page header --- */
.page-header {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.page-header__breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.page-header__breadcrumb a { color: var(--text-muted); }
.page-header__breadcrumb a:hover { color: var(--accent); }
.page-header__title { font-size: clamp(28px, 4vw, 44px); font-weight: 800; margin-bottom: 12px; }
.page-header__desc { font-size: 16px; color: var(--text-secondary); max-width: 600px; }

/* --- Article content styles --- */
.article-body { font-size: 16px; line-height: 1.9; color: var(--text-secondary); }
.article-body h2 { font-size: 26px; font-weight: 700; color: var(--text-primary); margin: 40px 0 16px; }
.article-body h3 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 32px 0 12px; }
.article-body p { margin-bottom: 20px; }
.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 20px;
  list-style: disc;
}
.article-body li { margin-bottom: 8px; }
.article-body strong { color: var(--text-primary); font-weight: 700; }
.article-body code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}
.article-body pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}
.article-body pre code { background: none; padding: 0; color: var(--text-primary); }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--text-muted);
  font-style: italic;
}
.article-body img { border-radius: var(--radius-sm); margin: 24px 0; }

/* --- Weekly report styles --- */
.report-section { margin-bottom: 32px; }
.report-section__label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.report-section__content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
}
.mood-bar { display: flex; gap: 6px; margin-top: 4px; }
.mood-dot {
  width: 24px;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  transition: background 0.2s;
}
.mood-dot.active { background: var(--accent); }

/* --- Footer --- */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 56px 0 28px;
  color: var(--text-muted);
  font-size: 13px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer__brand {}
.footer__logo { font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: var(--text-primary); margin-bottom: 10px; }
.footer__logo span { color: var(--accent); }
.footer__tagline { font-size: 13px; color: var(--text-muted); line-height: 1.6; max-width: 260px; }
.footer__col-title {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.footer__links { display: flex; flex-direction: column; gap: 8px; }
.footer__links a { color: var(--text-secondary); font-size: 13px; transition: color 0.2s; }
.footer__links a:hover { color: var(--accent); }
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* --- Animations --- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.animate-in   { animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fade-in      { animation: fadeIn  0.4s ease both; }
/* Staggered children */
.animate-in:nth-child(1) { animation-delay: 0.05s; }
.animate-in:nth-child(2) { animation-delay: 0.10s; }
.animate-in:nth-child(3) { animation-delay: 0.15s; }
.animate-in:nth-child(4) { animation-delay: 0.20s; }
.animate-in:nth-child(5) { animation-delay: 0.25s; }
.animate-in:nth-child(6) { animation-delay: 0.30s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  :root { --gap: 16px; }
  .nav__links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px;
    gap: 4px;
  }
  .nav__links.open { display: flex; }
  .nav__subscribe { display: none; } /* shown inside mobile menu only */
  .nav__links.open .nav__subscribe { display: inline-flex; margin: 8px 0 4px; }
  .nav__toggle { display: flex; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .profile-card { flex-direction: column; text-align: center; padding: 24px; }
  .hero { padding: 64px 0 48px; }
  .section { padding: 56px 0; }
  .stats-row .stat { padding: 16px 24px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer__brand { grid-column: span 2; }
}

@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .hero__title { letter-spacing: -0.5px; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__brand { grid-column: span 1; }
}

/* ============================================================
   Light Mode — [data-theme="light"] + prefers-color-scheme
   ============================================================ */
[data-theme="light"] {
  --bg-primary:    #FFFFFF;
  --bg-secondary:  #F8FAFC;
  --bg-tertiary:   #F1F5F9;
  --border:        #E2E8F0;
  --text-primary:  #0F172A;
  --text-secondary:#475569;
  --text-muted:    #94A3B8;
  --shadow:        0 4px 32px rgba(15, 23, 42, 0.08);
  --shadow-sm:     0 2px 10px rgba(15, 23, 42, 0.06);
  --shadow-card:   0 8px 32px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(129,140,248,0.1);
}
[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.92);
}
[data-theme="light"] .nav__links {
  background: #F8FAFC;
}
[data-theme="light"] .nav__toggle {
  background: #F1F5F9;
  border-color: #E2E8F0;
}
[data-theme="light"] .nav__toggle span { background: #0F172A; }
[data-theme="light"] .hero::before {
  background: radial-gradient(circle, rgba(129,140,248,0.14) 0%, rgba(99,102,241,0.06) 50%, transparent 70%);
}
[data-theme="light"] .btn-secondary {
  background: #F1F5F9;
  color: #0F172A;
}
[data-theme="light"] .tag {
  background: #F1F5F9;
  color: #475569;
}
[data-theme="light"] .article-body { color: #334155; }
[data-theme="light"] .article-body code { background: #F1F5F9; color: var(--accent-hover); }
[data-theme="light"] .report-section__content { background: #F8FAFC; color: #475569; }

/* Theme toggle button */
.nav__theme {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 15px;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
  cursor: pointer;
  line-height: 1;
}
.nav__theme:hover { border-color: var(--accent); color: var(--accent); }

/* Scroll-reveal base state (JS adds .is-visible) */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s cubic-bezier(0.22,1,0.36,1), transform 0.55s cubic-bezier(0.22,1,0.36,1);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

/* ── Search overlay ─────────────────────────────────────── */
.nav__search {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 15px;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
  cursor: pointer;
  line-height: 1;
}
.nav__search:hover { border-color: var(--accent); color: var(--accent); }

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
}
.search-overlay.open { display: flex; }

.search-overlay__box {
  width: 100%;
  max-width: 640px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-overlay__input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 18px;
  color: var(--text-primary);
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
}
.search-overlay__input:focus { border-color: var(--accent); }
.search-overlay__input::placeholder { color: var(--text-muted); }
.search-overlay__close {
  color: var(--text-muted);
  font-size: 18px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
  cursor: pointer;
  font-family: var(--font-mono);
}
.search-overlay__close:hover { color: var(--text-primary); background: var(--bg-tertiary); }

.search-overlay__results {
  width: 100%;
  max-width: 640px;
  padding: 16px 24px 40px;
  max-height: 60vh;
  overflow-y: auto;
}
.search-overlay__hint {
  text-align: center;
  padding: 32px 0 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
}

.search-group__label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 20px 0 8px;
}
.search-group__label:first-child { margin-top: 0; }

.search-result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s;
}
.search-result:hover { background: var(--bg-secondary); }
.search-result__icon { font-size: 18px; flex-shrink: 0; opacity: 0.7; }
.search-result__info { flex: 1; min-width: 0; }
.search-result__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result__meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.search-empty {
  text-align: center;
  padding: 48px 0;
  color: var(--text-muted);
  font-size: 14px;
  font-family: var(--font-mono);
}

/* Light mode overrides */
[data-theme="light"] .search-overlay { background: rgba(248, 250, 252, 0.94); }

/* Full search results page */
.search-results-page { padding: 40px 0 80px; }
.search-results-page .page-header { margin-bottom: 32px; }
.search-section { margin-bottom: 40px; }
.search-section__title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.search-page-empty {
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
}
.search-page-empty__icon { font-size: 48px; margin-bottom: 16px; }
.search-page-empty__title { font-size: 20px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }

@media (max-width: 600px) {
  .search-overlay { padding-top: 48px; }
  .search-overlay__input { font-size: 16px; padding: 12px 16px; }
}

/* ── Reading progress bar ───────────────────────────────── */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  z-index: 500;
  transition: width 0.1s linear;
  pointer-events: none;
}
#reading-progress.hidden { opacity: 0; }

/* ── Social sharing ─────────────────────────────────────── */
.share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 32px 0;
  padding: 20px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.share-bar__label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-right: 4px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  line-height: 1;
}
.share-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.share-btn--x        { background: #000; color: #fff; border-color: #333; }
.share-btn--linkedin { background: #0A66C2; color: #fff; }
.share-btn--copy     { background: var(--bg-tertiary); color: var(--text-secondary); border-color: var(--border); }
.share-btn--copy.copied { color: var(--success); border-color: var(--success); }

[data-theme="light"] .share-btn--x { background: #111; }

/* ── Article TOC ────────────────────────────────────────── */
.toc-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 0;
  margin: 32px 0;
  overflow: hidden;
}
.toc-box[open] { padding-bottom: 8px; }
.toc-box__title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.toc-box__title::-webkit-details-marker { display: none; }
.toc-box__title::before { content: '▶'; font-size: 9px; transition: transform 0.2s; }
.toc-box[open] .toc-box__title::before { transform: rotate(90deg); }
.toc-list {
  display: flex;
  flex-direction: column;
  padding: 4px 0 4px;
}
.toc-link {
  display: block;
  padding: 6px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  line-height: 1.5;
}
.toc-link:hover { color: var(--accent); background: rgba(129,140,248,0.06); }
.toc-link.toc-link--sub { padding-left: 36px; font-size: 12px; color: var(--text-muted); }
.toc-link.toc-active { color: var(--accent); font-weight: 600; }

/* ── Reactions bar ──────────────────────────────────────── */
.reactions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 32px 0;
  padding: 18px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.reactions-bar__label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-right: 4px;
}
.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.reaction-btn:hover { border-color: var(--accent); background: var(--accent-dim); transform: scale(1.06); }
.reaction-btn.reacted { border-color: var(--accent); background: var(--accent-dim); color: var(--text-primary); }
.reaction-btn__emoji { font-size: 16px; line-height: 1; }
.reaction-btn__count { font-family: var(--font-mono); font-size: 12px; min-width: 14px; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ===== Roadmap Task Checklist ===== */
.week-task-item { user-select: none; }
.week-task-text.done-text { text-decoration: line-through; color: var(--text-muted); }
.week-task-cb:checked + .week-task-text { text-decoration: line-through; color: var(--text-muted); }
