/* ============================================================
   PeaBox Lab — Modern Static Site Styles
   ============================================================ */

:root {
  /* Color palette — light European: cream, sage, terracotta, dusty blue */
  --bg: #faf7f0;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --fg: #2d2a26;
  --fg-muted: #6f6759;
  --accent: #b8623a;          /* terracotta */
  --sage: #6d8a72;            /* sage green */
  --dusty-blue: #5f7a95;      /* dusty blue */
  --mustard: #c49a3a;         /* muted mustard */
  --plum: #7c5a70;            /* muted plum */
  --accent-soft: rgba(184, 98, 58, 0.1);
  --accent-glow: rgba(184, 98, 58, 0.22);
  --border: #e3ddd0;
  --border-hover: #b8ad9b;
  --card-shadow: 0 10px 30px -12px rgba(90, 74, 54, 0.25);
  --card-shadow-hover: 0 22px 44px -16px rgba(184, 98, 58, 0.3);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

[data-theme="dark"] {
  /* Warm dark espresso, keeps the European warmth */
  --bg: #1f1b17;
  --bg-elevated: #29231e;
  --bg-card: #2e2823;
  --fg: #ece6da;
  --fg-muted: #b0a796;
  --accent: #d97c4a;
  --sage: #8fae95;
  --dusty-blue: #8ba4bd;
  --mustard: #e0b668;
  --plum: #b08fa8;
  --accent-soft: rgba(217, 124, 74, 0.14);
  --accent-glow: rgba(217, 124, 74, 0.3);
  --border: #3e372f;
  --border-hover: #5a5148;
  --card-shadow: 0 10px 30px -12px rgba(0,0,0,0.5);
  --card-shadow-hover: 0 22px 44px -16px rgba(217, 124, 74, 0.35);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
}

/* Background atmosphere */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 100% 100%, rgba(99, 102, 241, 0.08) 0%, transparent 55%),
    var(--bg);
  z-index: -1;
  pointer-events: none;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 100% 100%, rgba(99, 102, 241, 0.05) 0%, transparent 55%),
    var(--bg);
}

/* ============================================================
   Layout utilities
   ============================================================ */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; }
.section-sm { padding: 60px 0; }

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 16px; }
h3 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); margin-bottom: 12px; }
h4 { font-size: 1.15rem; margin-bottom: 8px; }

p { color: var(--fg-muted); margin-bottom: 1rem; max-width: 75ch; }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #ffb800; text-decoration: underline; }

code, pre { font-family: var(--font-mono); font-size: 0.9em; }
code { background: var(--accent-soft); color: var(--accent); padding: 0.15em 0.45em; border-radius: 4px; }
pre { background: #080a10; color: #d4d6e0; padding: 1.25rem; border-radius: var(--radius); overflow-x: auto; border: 1px solid var(--border); line-height: 1.55; }
pre code { background: transparent; color: inherit; padding: 0; }
[data-theme="light"] pre { background: #1a1c26; }

blockquote { border-left: 3px solid var(--accent); padding-left: 1.5rem; margin: 1.5rem 0; color: var(--fg-muted); font-style: italic; }

img { max-width: 100%; height: auto; border-radius: var(--radius); }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.5rem; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #e09300);
  color: #0b0d14;
  box-shadow: 0 4px 14px -4px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px -6px var(--accent-glow); text-decoration: none; color: #0b0d14; }
.btn-secondary {
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; color: var(--accent); }
.btn-ghost { background: transparent; color: var(--fg-muted); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }

/* ============================================================
   Header / Navigation
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(var(--bg-elevated-rgb, 18, 21, 30), 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}
[data-theme="light"] .site-header { background: rgba(255, 255, 255, 0.85); }

.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; color: var(--fg); text-decoration: none; }
.logo:hover { color: var(--accent); text-decoration: none; }
.logo svg { width: 36px; height: 36px; }

.nav-links { display: flex; align-items: center; gap: 8px; list-style: none; margin: 0; padding: 0; line-height: 1; }
.nav-links a { padding: 0.6rem 1.1rem; border-radius: var(--radius-sm); color: var(--fg-muted); font-weight: 600; font-size: 1rem; line-height: 1; transition: all var(--transition); text-decoration: none; }
.nav-links a:hover, .nav-links a.active { color: var(--accent); background: var(--accent-soft); text-decoration: none; }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg);
  transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(15deg); }
.theme-toggle svg { width: 20px; height: 20px; }

.mobile-menu-btn { display: none; background: none; border: none; color: var(--fg); cursor: pointer; padding: 8px; }
.mobile-menu-btn svg { width: 24px; height: 24px; }

/* ============================================================
   Hero Section
   ============================================================ */
.hero {
  position: relative;
  padding: 140px 0 100px;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
}
.hero-content { text-align: center; max-width: 800px; margin: 0 auto; position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(184, 98, 58, 0.25);
}
.hero h1 { margin-bottom: 20px; background: linear-gradient(135deg, var(--fg) 0%, var(--dusty-blue) 50%, var(--accent) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 1.2rem; color: var(--fg-muted); max-width: 65ch; margin: 0 auto 36px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 60px; }

/* Stats bar */
.stats-bar { display: flex; justify-content: center; gap: 48px; flex-wrap: wrap; margin-top: 40px; padding-top: 40px; border-top: 1px solid var(--border); }
.stat-item { text-align: center; }
.stat-value { font-size: 2.5rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-label { font-size: 0.9rem; color: var(--fg-muted); margin-top: 6px; }

/* ============================================================
   Repository Grid
   ============================================================ */
.section-header { text-align: center; margin-bottom: 56px; }
.section-header p { margin: 0 auto; }

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}
.repo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.repo-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #ffd700);
  opacity: 0;
  transition: opacity var(--transition);
}
.repo-card:hover { transform: translateY(-6px); border-color: var(--border-hover); box-shadow: var(--card-shadow-hover); }
.repo-card:hover::before { opacity: 1; }

.repo-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.repo-name { font-weight: 700; font-size: 1.15rem; color: var(--fg); }
.repo-name:hover { color: var(--accent); }
.repo-language { font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 100px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.repo-desc { color: var(--fg-muted); font-size: 0.95rem; line-height: 1.6; flex: 1; margin-bottom: 20px; }
.repo-meta { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 0.8rem; color: var(--fg-muted); padding-top: 16px; border-top: 1px solid var(--border); margin-top: auto; }
.repo-meta span { display: flex; align-items: center; gap: 6px; }
.repo-meta svg { width: 14px; height: 14px; }
.repo-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.repo-topic { font-size: 0.7rem; font-weight: 500; padding: 0.2rem 0.55rem; border-radius: 100px; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--fg-muted); transition: all var(--transition); }
.repo-topic:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ============================================================
   Repository Detail Page
   ============================================================ */
.repo-hero {
  padding: 100px 0 60px;
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%);
  border-bottom: 1px solid var(--border);
}
.repo-hero h1 { margin-bottom: 16px; }
.repo-hero .repo-meta { justify-content: center; border-top: none; padding-top: 0; margin-top: 24px; }
.repo-hero .repo-language { font-size: 0.85rem; }

.repo-content { padding: 60px 0 100px; }
.repo-content .container { display: grid; grid-template-columns: 280px 1fr; gap: 48px; }

.repo-sidebar { position: sticky; top: 100px; height: fit-content; }
.repo-toc { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.repo-toc h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-muted); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.repo-toc ul { list-style: none; padding: 0; }
.repo-toc li { margin: 0; }
.repo-toc a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--fg-muted); font-size: 0.9rem; font-weight: 500; transition: all var(--transition); text-decoration: none; }
.repo-toc a:hover, .repo-toc a.active { background: var(--accent-soft); color: var(--accent); text-decoration: none; }

.repo-main article { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; }
.repo-main h2 { padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.repo-main h3 { margin-top: 36px; color: var(--accent); }
.repo-main h4 { color: var(--fg); }
.repo-main p { margin-bottom: 1.25rem; }
.repo-main ul, .repo-main ol { margin-bottom: 1.5rem; }
.repo-main li { margin-bottom: 0.6rem; }
.repo-main pre { margin: 1.5rem 0; }
.repo-main table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9rem; }
.repo-main th, .repo-main td { padding: 0.75rem 1rem; border: 1px solid var(--border); text-align: left; }
.repo-main th { background: var(--bg-elevated); font-weight: 600; color: var(--fg); }
.repo-main tr:nth-child(even) td { background: var(--bg-elevated); }

/* ============================================================
   Help / Docs Section
   ============================================================ */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.help-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--transition);
}
.help-card:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: var(--card-shadow); }
.help-icon { width: 48px; height: 48px; background: var(--accent-soft); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--accent); }
.help-icon svg { width: 24px; height: 24px; }
.help-card h3 { margin-bottom: 8px; }
.help-card p { margin-bottom: 16px; font-size: 0.95rem; }
.help-card .btn { font-size: 0.85rem; padding: 0.5rem 1rem; }

/* ============================================================
   Blog / Articles Section
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.blog-card:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: var(--card-shadow); }
.blog-thumb {
  display: block;
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-elevated);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.blog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--transition);
}
.blog-thumb:hover img { transform: scale(1.04); }
.blog-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.blog-meta { display: flex; gap: 16px; font-size: 0.8rem; color: var(--fg-muted); margin-bottom: 10px; }
.blog-meta span { display: flex; align-items: center; gap: 6px; }
.blog-card h3 { margin-bottom: 10px; line-height: 1.35; }
.blog-card h3 a { color: var(--fg); }
.blog-card h3 a:hover { color: var(--accent); text-decoration: none; }
.blog-excerpt { color: var(--fg-muted); font-size: 0.95rem; line-height: 1.6; flex: 1; margin-bottom: 16px; }
.blog-link { font-weight: 600; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 6px; }
.blog-link svg { width: 16px; height: 16px; transition: transform var(--transition); }
.blog-link:hover svg { transform: translateX(4px); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--bg-elevated); border-top: 1px solid var(--border); padding: 60px 0 30px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 48px; margin-bottom: 48px; }
.footer-brand p { color: var(--fg-muted); margin-top: 16px; max-width: 300px; }
.footer-links h4 { font-size: 0.95rem; margin-bottom: 16px; color: var(--fg); }
.footer-links ul { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--fg-muted); font-size: 0.9rem; transition: color var(--transition); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom { padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; color: var(--fg-muted); font-size: 0.85rem; }
.footer-social { display: flex; gap: 16px; }
.footer-social a { color: var(--fg-muted); transition: color var(--transition); }
.footer-social a:hover { color: var(--accent); }
.footer-social svg { width: 20px; height: 20px; }

/* ============================================================
   Search / Filter (for repo index)
   ============================================================ */
.search-filter { margin-bottom: 40px; }
.search-box { position: relative; max-width: 480px; margin: 0 auto; }
.search-box svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--fg-muted); }
.search-box input { width: 100%; padding: 14px 16px 14px 52px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 1rem; color: var(--fg); transition: all var(--transition); }
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box input::placeholder { color: var(--fg-muted); }

.filter-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.filter-chip { padding: 0.5rem 1.1rem; border-radius: 100px; background: var(--bg-card); border: 1px solid var(--border); color: var(--fg-muted); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all var(--transition); }
.filter-chip:hover, .filter-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fadeUp 0.7s var(--transition) both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .repo-content .container { grid-template-columns: 1fr; }
  .repo-sidebar { position: static; }
  .repo-toc { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px; }
  .repo-toc h4 { display: none; }
  .repo-toc ul { display: flex; flex-wrap: wrap; gap: 8px; }
  .repo-toc a { padding: 6px 12px; font-size: 0.85rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links { position: fixed; top: 72px; left: 0; right: 0; background: var(--bg-elevated); border-bottom: 1px solid var(--border); flex-direction: column; padding: 16px; gap: 8px; display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; text-align: center; padding: 14px; }
  .mobile-menu-btn { display: block; }
  .hero { padding: 100px 0 60px; }
  .stats-bar { gap: 24px; }
  .stat-value { font-size: 2rem; }
  .section { padding: 70px 0; }
  .repo-main article { padding: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ============================================================
   Focus visible
   ============================================================ */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   Print
   ============================================================ */
@media print {
  .site-header, .theme-toggle, .btn, .repo-sidebar, .footer { display: none !important; }
  body { background: white; color: black; }
  .repo-main article { border: none; padding: 0; }
  a { color: black; text-decoration: underline; }
}

/* ============================================================
   Glass-morphism & Gradient utilities
   ============================================================ */
.glass {
  background: rgba(var(--bg-elevated-rgb, 18, 21, 30), 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
}
[data-theme="light"] .glass { background: rgba(255, 255, 255, 0.7); }

.glass-strong {
  background: rgba(var(--bg-elevated-rgb, 18, 21, 30), 0.9);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--border);
}
[data-theme="light"] .glass-strong { background: rgba(255, 255, 255, 0.9); }

.gradient-bg {
  background: linear-gradient(135deg, var(--bg) 0%, #1a1d2e 50%, var(--bg) 100%);
}
.gradient-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #ffd700 100%);
}
.gradient-text {
  background: linear-gradient(135deg, var(--fg) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   Small Footer (for repo/category pages)
   ============================================================ */
.site-footer-small {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  margin-top: auto;
}
.footer-nav-small {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.footer-col-small h4 {
  font-size: 0.9rem;
  margin-bottom: 14px;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.footer-col-small ul { list-style: none; padding: 0; }
.footer-col-small li { margin-bottom: 8px; }
.footer-col-small a {
  color: var(--fg-muted);
  font-size: 0.85rem;
  transition: color var(--transition);
  text-decoration: none;
}
.footer-col-small a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom-small {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.8rem;
}

/* ============================================================
   Video Embed Support
   ============================================================ */
.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.video-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--accent-soft), rgba(99,102,241,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.video-thumbnail:hover { border-color: var(--accent); }
.video-thumbnail .play-btn {
  width: 72px; height: 72px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b0d14;
  transition: all var(--transition);
  box-shadow: var(--card-shadow);
}
.video-thumbnail:hover .play-btn { transform: scale(1.1); box-shadow: var(--card-shadow-hover); }
.video-thumbnail svg { width: 32px; height: 32px; margin-left: 4px; }

/* ============================================================
   Portfolio / Showcase Section
   ============================================================ */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}
.portfolio-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.portfolio-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-hover);
  box-shadow: var(--card-shadow-hover);
}
.portfolio-media {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.portfolio-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--transition);
}
.portfolio-card:hover .portfolio-media img { transform: scale(1.05); }
.portfolio-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.portfolio-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 12px;
  width: fit-content;
}
.portfolio-card h3 { margin-bottom: 10px; }
.portfolio-card h3 a { color: var(--fg); text-decoration: none; }
.portfolio-card h3 a:hover { color: var(--accent); }
.portfolio-desc { color: var(--fg-muted); font-size: 0.95rem; line-height: 1.6; flex: 1; margin-bottom: 16px; }
.portfolio-meta { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 0.8rem; color: var(--fg-muted); }
.portfolio-meta span { display: flex; align-items: center; gap: 6px; }

/* ============================================================
   Sidebar Toggle (mobile)
   ============================================================ */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 90;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #0b0d14;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  align-items: center;
  justify-content: center;
}
.sidebar-toggle svg { width: 24px; height: 24px; }
@media (max-width: 1024px) {
  .sidebar-toggle { display: flex; }
  .repo-sidebar.open { display: block; position: fixed; top: 100px; left: 16px; right: 16px; bottom: 16px; z-index: 80; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow: auto; }
}

/* ============================================================
   Search Overlay
   ============================================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(11, 13, 20, 0.95);
  backdrop-filter: blur(8px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 120px;
}
.search-overlay.open { display: flex; }
.search-overlay .close-btn {
  position: absolute; top: 24px; right: 24px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.search-overlay .search-input {
  width: 90%; max-width: 720px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.25rem;
  color: var(--fg);
}
.search-overlay .search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-overlay .search-results { margin-top: 32px; width: 90%; max-width: 720px; }
.search-result-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: all var(--transition);
}
.search-result-item:hover { border-color: var(--accent); }
.search-result-item a { color: var(--fg); font-weight: 600; font-size: 1.1rem; text-decoration: none; }
.search-result-item a:hover { color: var(--accent); }
.search-result-item p { color: var(--fg-muted); margin-top: 8px; font-size: 0.95rem; }
.search-result-item .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.search-result-item .tag { font-size: 0.7rem; font-weight: 500; padding: 0.15rem 0.5rem; border-radius: 100px; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--fg-muted); }

/* ============================================================
   Back to Top Button
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 90;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #0b0d14;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  pointer-events: none;
  transition: all var(--transition);
}
.back-to-top svg { width: 24px; height: 24px; }
.back-to-top.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.back-to-top:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }
@media (max-width: 1024px) { .back-to-top { display: none; } }

/* ============================================================
   Scroll Progress Indicator
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #ffd700);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 9999;
  transition: transform 0.1s linear;
}
/* ============================================================
   PromptVault - Prompt Library
   ============================================================ */
.prompt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.prompt-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 10px; transition: all var(--transition); cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.prompt-card:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: var(--card-shadow-hover); }
.prompt-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.prompt-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.prompt-cat { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); background: var(--accent-soft); border-radius: 100px; padding: 4px 10px; }
.prompt-id { font-family: var(--font-mono, monospace); font-size: 0.72rem; color: var(--fg-muted); }
.prompt-card h3 { font-size: 1.05rem; line-height: 1.35; margin: 0; }
.prompt-card p { font-size: 0.85rem; color: var(--fg-muted); margin: 0; line-height: 1.5; }
.prompt-placeholders { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.prompt-ph { font-family: var(--font-mono, monospace); font-size: 0.68rem; color: var(--fg-muted); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 2px 7px; }
.prompt-count { font-size: 0.8rem; color: var(--fg-muted); text-align: center; margin: 0 0 18px; }
.prompt-empty { text-align: center; color: var(--fg-muted); padding: 48px 16px; display: none; }

.prompt-modal-overlay { position: fixed; inset: 0; background: rgba(4,6,12,0.72); backdrop-filter: blur(4px); z-index: 1000; display: none; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px; }
.prompt-modal-overlay.open { display: flex; }
.prompt-modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; max-width: 760px; width: 100%; padding: 28px; box-shadow: var(--card-shadow-hover); }
.prompt-modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 6px; }
.prompt-modal h2 { font-size: 1.35rem; margin: 0; line-height: 1.3; }
.prompt-modal-close { background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--fg-muted); cursor: pointer; padding: 6px 10px; font-size: 1rem; line-height: 1; }
.prompt-modal-close:hover { color: var(--accent); border-color: var(--accent); }
.prompt-modal-desc { color: var(--fg-muted); font-size: 0.9rem; line-height: 1.55; margin: 10px 0 16px; }
.prompt-modal pre { background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; overflow-x: auto; font-size: 0.8rem; line-height: 1.55; max-height: 45vh; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.prompt-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.prompt-toast { position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 12px); background: var(--accent); color: #0b0d14; font-weight: 600; font-size: 0.85rem; padding: 10px 18px; border-radius: 100px; opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 1100; }
.prompt-toast.show { opacity: 1; transform: translate(-50%, 0); }

.prompt-modal-actions .btn[disabled]{opacity:0.5;cursor:not-allowed}

/* ============================================================
   App Ideas
   ============================================================ */
.idea-tier { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; border-radius: 100px; padding: 4px 10px; }
.idea-tier-starter { color: #15803d; background: rgba(34,197,94,0.14); }
.idea-tier-intermediate { color: #b45309; background: rgba(245,158,11,0.16); }
.idea-tier-advanced { color: #b91c1c; background: rgba(239,68,68,0.12); }
[data-theme="dark"] .idea-tier-starter { color: #4ade80; }
[data-theme="dark"] .idea-tier-intermediate { color: #fbbf24; }
[data-theme="dark"] .idea-tier-advanced { color: #f87171; }
.idea-effort { font-family: var(--font-mono, monospace); font-size: 0.72rem; color: var(--fg-muted); }
.idea-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 14px 0; }
@media (max-width: 640px) { .idea-modal-grid { grid-template-columns: 1fr; } }
.idea-field { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.idea-field h5 { margin: 0 0 4px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); }
.idea-field p { margin: 0; font-size: 0.85rem; line-height: 1.5; color: var(--fg); }
.idea-modal-body { max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.idea-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.idea-links a { font-size: 0.78rem; }

/* ============================================================
   Blog Pagination
   ============================================================ */
.blog-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 32px; }
.blog-page-numbers { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.blog-page-btn, .blog-page-num { border: 1px solid var(--border); background: var(--bg-card, var(--bg)); color: var(--fg); border-radius: 10px; padding: 8px 14px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease; font-family: inherit; }
.blog-page-num { min-width: 42px; padding: 8px 10px; }
.blog-page-btn:hover:not([disabled]), .blog-page-num:hover { border-color: var(--accent); color: var(--accent); }
.blog-page-num.active { background: var(--accent); border-color: var(--accent); color: #0b0d14; }
.blog-page-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.blog-page-status { text-align: center; color: var(--fg-muted); font-size: 0.85rem; margin-top: 14px; }
