/* ==========================================================================
   AIbyPranav — shared design layer
   Loaded on every page AFTER the page's own inline <style>, so these rules
   win at equal specificity. Keep page-specific styling inline; keep anything
   shared (header, nav, hero, forms, buttons, cards, FAQ, footer, prose) here.
   ========================================================================== */

:root {
  --ui-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ui-font-display: 'Outfit', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ui-bg: #f8fafc;
  --ui-surface: #ffffff;
  --ui-surface-2: #f8fafc;
  --ui-border: #e2e8f0;
  --ui-border-strong: #cbd5e1;
  --ui-text: #0f172a;
  --ui-text-2: #334155;
  --ui-muted: #64748b;

  --ui-brand: #4f46e5;
  --ui-brand-500: #6366f1;
  --ui-brand-50: #eef2ff;
  --ui-brand-100: #e0e7ff;
  --ui-accent: #ea580c;
  --ui-success: #059669;
  --ui-danger: #dc2626;

  --ui-radius-sm: 10px;
  --ui-radius: 14px;
  --ui-radius-lg: 20px;
  --ui-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --ui-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px -14px rgba(15, 23, 42, 0.14);
  --ui-shadow-lg: 0 24px 60px -24px rgba(79, 70, 229, 0.35);
  --ui-ring: 0 0 0 3px rgba(99, 102, 241, 0.3);
  --ui-header-h: 64px;

  /* variables some pages reference but never define */
  --gray-400: #94a3b8;
  --gray-600: #475569;
}

body.dark-theme {
  --ui-bg: #0b1120;
  --ui-surface: #111827;
  --ui-surface-2: #0f172a;
  --ui-border: #1f2a3d;
  --ui-border-strong: #334155;
  --ui-text: #f1f5f9;
  --ui-text-2: #cbd5e1;
  --ui-muted: #94a3b8;
  --ui-brand: #a5b4fc;
  --ui-brand-50: rgba(99, 102, 241, 0.14);
  --ui-brand-100: rgba(99, 102, 241, 0.22);
  --ui-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
  --gray-400: #64748b;
  --gray-600: #94a3b8;
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--ui-header-h) + 16px); }
body {
  font-family: var(--ui-font);
  background: var(--ui-bg);
  color: var(--ui-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.dark-theme { background: var(--ui-bg); color: var(--ui-text-2); }
img, video { max-width: 100%; }
::selection { background: rgba(99, 102, 241, 0.22); }
:focus-visible { outline: 2px solid var(--ui-brand-500); outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 2000;
  background: var(--ui-text); color: var(--ui-surface) !important;
  padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 0.9rem;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: none;
}
body.dark-theme .site-header { background: rgba(11, 17, 32, 0.86); border-bottom-color: rgba(255, 255, 255, 0.06); }
.site-header .header-inner {
  max-width: 1200px; height: var(--ui-header-h); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 16px; justify-content: flex-start;
}
.site-header .logo {
  display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0;
  font-family: var(--ui-font-display); font-size: 1.28rem; font-weight: 800; letter-spacing: -0.02em;
  text-decoration: none; color: var(--ui-text);
}
.logo-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: inline-grid; place-items: center; font-size: 1rem; line-height: 1;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #f97316 100%);
  box-shadow: 0 6px 16px -6px rgba(99, 102, 241, 0.6);
  color: #fff;
}
.logo-text { color: var(--ui-text); white-space: nowrap; }
.logo-text .logo-ai { color: var(--ui-brand); letter-spacing: 0.01em; }
.logo-text .logo-by { color: var(--ui-muted); font-weight: 500; font-size: 0.86em; margin: 0 1px 0 3px; }
.logo-text .logo-name { color: var(--ui-text); }
body.dark-theme .logo-text, body.dark-theme .logo-text .logo-name { color: #f8fafc; }

.site-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.site-nav a {
  font-size: 0.92rem; font-weight: 500; color: var(--ui-text-2);
  padding: 8px 14px; border-radius: 999px; text-decoration: none; background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.site-nav a:hover { background: rgba(15, 23, 42, 0.05); color: var(--ui-text); }
.site-nav a.active, .site-nav a[aria-current="page"] { background: var(--ui-brand-50); color: var(--ui-brand); font-weight: 600; }
body.dark-theme .site-nav a { color: #cbd5e1; }
body.dark-theme .site-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
body.dark-theme .site-nav a.active, body.dark-theme .site-nav a[aria-current="page"] { background: rgba(99, 102, 241, 0.18); color: #c7d2fe; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.site-nav + .header-actions { margin-left: 8px; }
.theme-toggle-btn {
  width: 38px; height: 38px; padding: 0; border-radius: 999px;
  display: inline-grid; place-items: center; font-size: 1rem; line-height: 1;
  background: var(--ui-surface); border: 1px solid var(--ui-border); cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.theme-toggle-btn:hover { border-color: var(--ui-border-strong); background: var(--ui-surface-2); }
.hamburger {
  display: none; width: 40px; height: 40px; padding: 0; border-radius: 10px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  background: transparent; border: 1px solid transparent; cursor: pointer;
}
.hamburger span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--ui-text-2); transition: transform 0.2s ease, opacity 0.2s ease; }
body.dark-theme .hamburger span { background: #e2e8f0; }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none; flex-direction: column; gap: 2px;
  padding: 8px 16px 16px; background: var(--ui-surface);
  border-top: 1px solid var(--ui-border);
  box-shadow: 0 18px 30px -18px rgba(15, 23, 42, 0.25);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  display: flex; align-items: center; min-height: 46px; padding: 10px 14px; border-radius: 10px;
  font-size: 1rem; font-weight: 500; color: var(--ui-text-2); text-decoration: none;
}
.mobile-nav a:hover, .mobile-nav a.active, .mobile-nav a[aria-current="page"] { background: var(--ui-brand-50); color: var(--ui-brand); }
body.dark-theme .mobile-nav { background: #0b1120; border-top-color: rgba(255, 255, 255, 0.06); }
body.dark-theme .mobile-nav a { color: #cbd5e1; }

@media (max-width: 760px) {
  .site-nav { display: none; }
  .hamburger { display: flex; }
  .header-actions { margin-left: auto; }
  .site-header .header-inner { padding: 0 16px; }
}
@media (min-width: 761px) {
  .mobile-nav, .mobile-nav.open { display: none; }
}

/* ---------- Page hero (tool + info pages) ---------- */
.page-hero {
  background: radial-gradient(1200px 300px at 50% -40px, rgba(99, 102, 241, 0.14), transparent 70%), var(--ui-bg);
  padding: 40px 20px 28px; text-align: center; border-bottom: 0;
}
body.dark-theme .page-hero { background: radial-gradient(1200px 300px at 50% -40px, rgba(99, 102, 241, 0.22), transparent 70%), var(--ui-bg); }
.page-hero .breadcrumb, .breadcrumb {
  font-size: 0.82rem; color: var(--ui-muted); margin: 0 auto 14px;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px;
}
.page-hero .breadcrumb a, .breadcrumb a { color: var(--ui-brand); text-decoration: none; }
.page-hero .breadcrumb a:hover, .breadcrumb a:hover { text-decoration: underline; }
.page-hero .hero-icon {
  width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px;
  display: grid; place-items: center; font-size: 1.9rem; line-height: 1;
  background: var(--ui-surface); border: 1px solid var(--ui-border); box-shadow: var(--ui-shadow);
}
.page-hero h1 {
  font-family: var(--ui-font-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.12;
  font-size: clamp(1.85rem, 4.2vw, 2.75rem); color: var(--ui-text); margin: 0 auto 10px; max-width: 760px;
}
body.dark-theme .page-hero h1 { color: #f8fafc; }
.page-hero p { font-size: 1.05rem; line-height: 1.6; color: var(--ui-muted); max-width: 600px; margin: 0 auto; }
.hero-meta-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; padding: 0; list-style: none; }
.hero-meta-chips li {
  font-size: 0.8rem; font-weight: 600; color: var(--ui-text-2);
  background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: 999px; padding: 6px 12px;
}
@media (max-width: 640px) {
  .page-hero { padding: 26px 16px 18px; }
  .page-hero .hero-icon { width: 52px; height: 52px; font-size: 1.6rem; border-radius: 16px; margin-bottom: 10px; }
  .page-hero p { font-size: 0.98rem; }
}

/* ---------- Tool workspace ---------- */
.tool-container { max-width: 860px; margin: 0 auto; padding: 24px 20px 48px; }
.tool-card-box {
  background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg);
  padding: 28px; box-shadow: var(--ui-shadow);
}
body.dark-theme .tool-card-box { background: var(--ui-surface); border-color: var(--ui-border); }
@media (max-width: 640px) {
  .tool-container { padding: 16px 12px 40px; }
  .tool-card-box { padding: 18px 16px; border-radius: 18px; }
}

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--ui-text-2); margin-bottom: 7px; }
body.dark-theme .form-label { color: #cbd5e1; }
.form-input, .form-select, .form-textarea,
.api-key-input-row input {
  min-height: 48px; padding: 12px 14px; font-size: 1rem; font-family: inherit; line-height: 1.5;
  color: var(--ui-text); background: var(--ui-surface);
  border: 1.5px solid var(--ui-border-strong); border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input::placeholder, .form-textarea::placeholder, .api-key-input-row input::placeholder { color: #94a3b8; }
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: #94a3b8; }
.form-input:focus, .form-select:focus, .form-textarea:focus, .api-key-input-row input:focus {
  outline: none; border-color: var(--ui-brand-500); box-shadow: var(--ui-ring);
}
.form-textarea { min-height: 120px; }
body.dark-theme .form-input, body.dark-theme .form-select, body.dark-theme .form-textarea, body.dark-theme .api-key-input-row input {
  background: #0b1120; border-color: #334155; color: #f1f5f9;
}
.form-row { gap: 14px; }
#promptTemplateSelector {
  border: 1.5px dashed #a5b4fc !important; background: var(--ui-brand-50) !important;
  color: var(--ui-brand) !important; font-weight: 600 !important;
}

.btn-primary {
  min-height: 50px; padding: 13px 24px; border: 0; border-radius: 12px; cursor: pointer;
  font-family: inherit; font-size: 1rem; font-weight: 700; letter-spacing: -0.005em; color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 10px 24px -12px rgba(79, 70, 229, 0.75);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 14px 28px -12px rgba(79, 70, 229, 0.8); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; filter: none; }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: 0.85rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
  color: var(--ui-text-2); background: var(--ui-surface); border: 1.5px solid var(--ui-border);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.btn-secondary:hover { border-color: var(--ui-brand-500); color: var(--ui-brand); background: var(--ui-brand-50); }
body.dark-theme .btn-secondary { background: #0f172a; border-color: #334155; color: #e2e8f0; }
.copy-btn { min-height: 38px; border-radius: 10px; font-weight: 600; }

.output-section { margin-top: 24px; }
.output-header { gap: 8px; }
.output-title { font-family: var(--ui-font-display); font-size: 1.05rem; font-weight: 700; color: var(--ui-text); }
.output-box {
  background: var(--ui-surface-2); border: 1px solid var(--ui-border); border-radius: var(--ui-radius);
  padding: 22px; font-size: 1rem; line-height: 1.75; color: var(--ui-text-2);
}
body.dark-theme .output-box { background: #0b1120; border-color: #334155; color: #e2e8f0; }
.error-box { border-radius: 12px; }

/* "Use your own key" panel — sits below the tool, secondary */
.api-key-section { margin: 18px 0 0; }
.api-key-card {
  background: var(--ui-surface); border: 1px dashed var(--ui-border-strong); border-radius: var(--ui-radius);
  padding: 18px 20px; box-shadow: none;
}
body.dark-theme .api-key-card { background: var(--ui-surface); border-color: #334155; }
.api-key-header { gap: 12px; margin-bottom: 14px; align-items: center; }
.api-key-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; font-size: 1.15rem;
  display: grid; place-items: center; background: var(--ui-brand-50);
}
.api-key-header p { font-size: 0.85rem; color: var(--ui-muted); margin: 2px 0 0; line-height: 1.5; }
.api-key-input-row { gap: 8px; align-items: stretch; }
.api-key-input-row input { min-height: 44px; }
.api-key-input-row .btn-primary, .api-key-input-row .btn-secondary { min-height: 44px; width: auto; margin-left: 0 !important; }
.toggle-key-btn { min-height: 44px; border-radius: 12px; }
.api-key-saved-bar { border-radius: 12px; }
@media (max-width: 520px) {
  .api-key-input-row input { flex-basis: 100%; }
  .api-key-input-row .btn-primary, .api-key-input-row .btn-secondary { flex: 1; }
}

/* ---------- Info / guide sections ---------- */
.info-section { max-width: 860px; margin: 0 auto; padding: 0 20px 40px; }
.info-card {
  background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg);
  padding: 30px 32px; margin-bottom: 20px; box-shadow: var(--ui-shadow-sm);
}
body.dark-theme .info-card { background: var(--ui-surface); border-color: var(--ui-border); }
.info-card h2, .info-card .section-title {
  font-family: var(--ui-font-display); font-size: clamp(1.3rem, 2.5vw, 1.55rem); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.25; color: var(--ui-text); margin: 0 0 12px;
}
.info-card h3 { font-family: var(--ui-font-display); font-size: 1.08rem; font-weight: 700; color: var(--ui-text); margin: 18px 0 6px; line-height: 1.35; }
body.dark-theme .info-card h2, body.dark-theme .info-card h3 { color: #f8fafc; }
.info-card p { font-size: 1rem; line-height: 1.75; color: var(--ui-text-2); }
body.dark-theme .info-card p { color: #cbd5e1; }
.info-card ul:not([class]), .info-card ol:not([class]) { padding-left: 1.25rem; margin: 10px 0 14px; color: var(--ui-text-2); line-height: 1.7; }
.section-label {
  display: inline-block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ui-accent); margin-bottom: 8px;
}
@media (max-width: 640px) {
  .info-section { padding: 0 12px 32px; }
  .info-card { padding: 22px 18px; border-radius: 18px; }
}

.guide-steps { list-style: none; counter-reset: step; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.guide-steps li { counter-increment: step; position: relative; padding: 2px 0 0 52px; min-height: 38px; }
.guide-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--ui-font-display); font-weight: 800; font-size: 0.95rem;
  color: var(--ui-brand); background: var(--ui-brand-50); border: 1px solid var(--ui-brand-100);
}
.guide-steps h3 { margin: 4px 0 4px; font-size: 1.02rem; }
.guide-steps p { margin: 0; }
.guide-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.guide-list li { position: relative; padding-left: 32px; line-height: 1.65; color: var(--ui-text-2); }
body.dark-theme .guide-list li { color: #cbd5e1; }
.guide-list li::before {
  content: '✓'; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 800;
  color: var(--ui-success); background: rgba(5, 150, 105, 0.1);
}
.guide-list--warn li::before { content: '✕'; color: var(--ui-danger); background: rgba(220, 38, 38, 0.09); }
.guide-list--users li::before { content: '→'; color: var(--ui-brand); background: var(--ui-brand-50); }
.info-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.info-grid-2 .info-card { margin-bottom: 0; }
@media (max-width: 760px) { .info-grid-2 { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 10px; --card: var(--ui-surface); --border: var(--ui-border); --text: var(--ui-text); --accent: var(--ui-brand-500); --muted: var(--ui-text-2); }
body.dark-theme .faq-list { --card: #0f172a; --border: #1f2a3d; --text: #f1f5f9; --muted: #cbd5e1; }
.faq-item { border-radius: var(--ui-radius); border: 1px solid var(--border, var(--ui-border)); background: var(--card, var(--ui-surface)); }
.faq-item:hover { border-color: var(--ui-border-strong); }
.faq-item.open, details.faq-item[open] { border-color: rgba(99, 102, 241, 0.5); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08); }
.faq-q { min-height: 56px; padding: 15px 18px; font-size: 1rem; font-weight: 600; line-height: 1.45; color: var(--text, var(--ui-text)); }
.faq-icon {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; display: inline-grid; place-items: center;
  background: var(--ui-brand-50); color: var(--ui-brand); font-weight: 700;
}
.faq-a-inner p { font-size: 0.97rem; line-height: 1.7; padding: 0 18px 16px; color: var(--muted, var(--ui-text-2)); }

/* ---------- Related tools ---------- */
.related-tools { max-width: 860px; margin: 8px auto 0; padding: 0 20px 56px; }
.related-tools h2 { font-family: var(--ui-font-display); font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ui-text); margin: 0 0 14px; }
.related-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.related-tools-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .related-tools-grid--3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .related-tools-grid { grid-template-columns: 1fr; } }
.related-tool {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: inherit;
  background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.related-tool:hover { border-color: rgba(99, 102, 241, 0.55); transform: translateY(-2px); box-shadow: var(--ui-shadow); }
.related-tool-icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: var(--ui-surface-2); border: 1px solid var(--ui-border); }
.related-tool-name { display: block; font-weight: 700; font-size: 0.92rem; color: var(--ui-text); }
.related-tool-desc { display: block; font-size: 0.8rem; color: var(--ui-muted); margin-top: 2px; line-height: 1.4; }
body.dark-theme .related-tools h2, body.dark-theme .related-tool-name { color: #f1f5f9; }
@media (max-width: 640px) { .related-tools { padding: 0 12px 40px; } }

/* ---------- Footer (theme-proof: never use var(--gray-900) here) ---------- */
.site-footer {
  background: #0f172a !important;
  color: #94a3b8 !important;
  padding: 56px 20px 28px;
  margin-top: 24px;
}
body.dark-theme .site-footer {
  background: #090d16 !important;
  color: #94a3b8 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.site-footer .footer-inner { max-width: 1200px; margin: 0 auto; }
.site-footer .footer-top {
  display: grid; grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); gap: 32px;
  padding-bottom: 36px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-footer .footer-brand .logo { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; text-decoration: none; font-family: var(--ui-font-display); font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.footer-brand .logo-text, .footer-brand .logo-text .logo-name, .footer-col h4, .site-footer .footer-heading { color: #ffffff !important; }
.footer-brand .logo-text .logo-ai { color: #a5b4fc; }
.footer-brand .logo-text .logo-by { color: #94a3b8; }
.site-footer .footer-brand p { font-size: 0.9rem; line-height: 1.7; color: #94a3b8; max-width: 300px; margin: 0 0 16px; }
.site-footer .footer-heading {
  font-family: var(--ui-font-display); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  margin: 0 0 14px;
}
.site-footer .footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.site-footer .footer-col a { font-size: 0.9rem; color: #94a3b8; text-decoration: none; transition: color 0.15s ease; }
.site-footer .footer-col a:hover { color: #ffffff; }
.footer-social { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-social a {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 600; color: #e2e8f0; text-decoration: none;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-social a:hover { background: rgba(255, 255, 255, 0.12); }
.site-footer .footer-bottom { padding-top: 22px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.site-footer .footer-bottom p { font-size: 0.82rem; color: #64748b; margin: 0; }
.site-footer .footer-bottom a { color: #94a3b8; }
@media (max-width: 1000px) { .site-footer .footer-top { grid-template-columns: repeat(3, minmax(0, 1fr)); } .site-footer .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  .site-footer { padding: 44px 16px 24px; }
  .site-footer .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .site-footer .footer-bottom { flex-direction: column; text-align: center; }
}

/* ---------- Homepage additions ---------- */
.hero-cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 26px; }
.btn-hero {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px;
  padding: 12px 22px; border-radius: 12px; font-weight: 700; font-size: 0.98rem; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-hero--primary { color: #fff; background: linear-gradient(135deg, #6366f1, #4f46e5); box-shadow: 0 12px 28px -12px rgba(79, 70, 229, 0.8); }
.btn-hero--primary:hover { transform: translateY(-1px); }
.btn-hero--ghost { color: var(--ui-text); background: var(--ui-surface); border: 1.5px solid var(--ui-border-strong); }
.btn-hero--ghost:hover { border-color: var(--ui-brand-500); color: var(--ui-brand); }
body.dark-theme .btn-hero--ghost { background: #111827; color: #f1f5f9; border-color: #334155; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 22px 0 0; padding: 0; list-style: none; }
.trust-row li { display: inline-flex; align-items: center; gap: 7px; font-size: 0.9rem; font-weight: 500; color: var(--ui-text-2); }
.trust-row li::before { content: '✓'; width: 20px; height: 20px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 0.7rem; font-weight: 800; color: #047857; background: #d1fae5; }
body.dark-theme .trust-row li { color: #cbd5e1; }
body.dark-theme .trust-row li::before { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
@media (max-width: 640px) {
  .hero-cta-row .btn-hero { flex: 1 1 100%; }
}

.latest-posts { max-width: 1200px; margin: 0 auto; padding: 56px 20px; }
.latest-posts-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.latest-posts-head h2 { font-family: var(--ui-font-display); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.02em; color: var(--ui-text); margin: 4px 0 0; }
.latest-posts-head p { color: var(--ui-muted); margin: 6px 0 0; }
.latest-posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.post-tile {
  display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit;
  background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.post-tile:hover { transform: translateY(-3px); box-shadow: var(--ui-shadow); border-color: rgba(99, 102, 241, 0.4); }
.post-tile img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; display: block; background: var(--ui-surface-2); }
.post-tile-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.post-tile-cat { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ui-brand); }
.post-tile-title { font-family: var(--ui-font-display); font-size: 1.05rem; font-weight: 700; line-height: 1.35; color: var(--ui-text); }
.post-tile-meta { margin-top: auto; padding-top: 8px; font-size: 0.8rem; color: var(--ui-muted); }
body.dark-theme .latest-posts-head h2, body.dark-theme .post-tile-title { color: #f1f5f9; }
.link-arrow { font-weight: 700; color: var(--ui-brand); text-decoration: none; white-space: nowrap; }
.link-arrow:hover { text-decoration: underline; }
@media (max-width: 900px) { .latest-posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .latest-posts { padding: 40px 12px; } .latest-posts-grid { grid-template-columns: 1fr; } }

/* ---------- Articles ---------- */
.article-hero {
  background: radial-gradient(1200px 320px at 50% -60px, rgba(99, 102, 241, 0.14), transparent 70%), var(--ui-bg);
  padding: 40px 20px 24px; text-align: center;
}
body.dark-theme .article-hero { background: radial-gradient(1200px 320px at 50% -60px, rgba(99, 102, 241, 0.22), transparent 70%), var(--ui-bg); }
.article-hero h1 {
  font-family: var(--ui-font-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
  font-size: clamp(1.75rem, 4vw, 2.6rem); color: var(--ui-text); max-width: 860px; margin: 10px auto 12px;
}
body.dark-theme .article-hero h1 { color: #f8fafc; }
.article-hero .article-tagline { font-size: 1.08rem; line-height: 1.6; color: var(--ui-muted); max-width: 720px; margin: 0 auto; }
.article-hero .breadcrumb span[aria-current] { color: var(--ui-text-2); font-weight: 600; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; margin-top: 18px; font-size: 0.88rem; color: var(--ui-muted); }
.article-byline .author-avatar { width: 28px; height: 28px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 0.72rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.article-byline a { color: var(--ui-text); font-weight: 600; text-decoration: none; }
.article-byline .dot { width: 4px; height: 4px; border-radius: 999px; background: var(--ui-border-strong); }
.article-layout-container { max-width: 1160px; gap: 48px; margin: 8px auto 0; padding: 0 20px 24px; }
@media (min-width: 1024px) { .article-layout-container { grid-template-columns: minmax(0, 1fr) 280px; } .article-toc-column { width: 280px; } }
.article-main-column { min-width: 0; }
.article-hero-img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--ui-radius-lg); margin: 0 0 28px; background: var(--ui-surface-2); box-shadow: var(--ui-shadow); }
.prose { font-size: 1.0625rem; line-height: 1.8; color: var(--ui-text-2); max-width: 74ch; }
body.dark-theme .prose { color: #cbd5e1; }
.prose h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); line-height: 1.25; letter-spacing: -0.02em; margin: 2.6rem 0 0.9rem; color: var(--ui-text); }
.prose h3 { font-size: clamp(1.15rem, 2vw, 1.3rem); line-height: 1.35; margin: 2rem 0 0.75rem; color: var(--ui-text); }
body.dark-theme .prose h2, body.dark-theme .prose h3 { color: #f8fafc; }
.prose p { margin: 0 0 1.25rem; }
.prose a { color: var(--ui-brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose img { height: auto; border-radius: var(--ui-radius); margin: 1.5rem 0; }
.prose ul, .prose ol { margin: 1rem 0 1.4rem 1.4rem; }
.prose li { margin-bottom: 0.5rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 10px 12px; border: 1px solid var(--ui-border); text-align: left; vertical-align: top; }
.prose th { background: var(--ui-surface-2); color: var(--ui-text); font-weight: 700; }
.prose blockquote { border-left: 4px solid var(--ui-brand-500); background: var(--ui-brand-50); padding: 14px 18px; border-radius: 0 12px 12px 0; font-style: normal; color: var(--ui-text-2); }
.sticky-toc-container {
  border: 1px solid var(--ui-border); border-left: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg);
  background: var(--ui-surface); padding: 18px; max-height: calc(100vh - 110px); overflow-y: auto;
}
.article-toc-column { top: calc(var(--ui-header-h) + 20px); }
.toc-title { font-size: 0.78rem !important; letter-spacing: 0.08em !important; color: var(--ui-muted) !important; margin-bottom: 12px !important; }
.toc-list { gap: 2px !important; margin: 0; padding: 0; }
.toc-item { margin: 0 !important; }
.toc-link { display: block; padding: 6px 10px; border-radius: 8px; font-size: 0.86rem !important; line-height: 1.4; color: var(--ui-text-2) !important; }
.toc-item-h3 .toc-link { padding-left: 22px; font-size: 0.8rem !important; color: var(--ui-muted) !important; }
.toc-link:hover, .toc-item.active .toc-link { background: var(--ui-brand-50); color: var(--ui-brand) !important; }
.article-section-title { font-family: var(--ui-font-display); font-size: 1.3rem; font-weight: 800; color: var(--ui-text); margin: 0 0 18px; }
body.dark-theme .article-section-title { color: #f8fafc; }
.article-related { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--ui-border); }
.article-related .latest-posts-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.article-tools-cta {
  margin: 40px 0 0; padding: 22px 24px; border-radius: var(--ui-radius-lg);
  background: linear-gradient(135deg, var(--ui-brand-50), transparent), var(--ui-surface); border: 1px solid var(--ui-brand-100);
  display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.article-tools-cta strong { display: block; font-family: var(--ui-font-display); font-size: 1.1rem; color: var(--ui-text); }
.article-tools-cta span { color: var(--ui-muted); font-size: 0.92rem; }
.article-tools-cta span a { color: var(--ui-brand); font-weight: 600; text-decoration: none; }
.article-tools-cta span a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .article-hero { padding: 26px 16px 16px; }
  .article-layout-container { padding: 0 14px 16px; }
  .article-hero-img { border-radius: 14px; margin-bottom: 22px; }
  .prose { font-size: 1.02rem; }
}

/* ---------- 404 ---------- */
.notfound { max-width: 640px; margin: 0 auto; padding: 72px 20px 64px; text-align: center; }
.notfound-code { font-family: var(--ui-font-display); font-size: clamp(4rem, 14vw, 7rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em; background: linear-gradient(135deg, #6366f1, #f97316); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notfound h1 { font-family: var(--ui-font-display); font-size: 1.6rem; margin: 12px 0 8px; color: var(--ui-text); }
.notfound p { color: var(--ui-muted); margin: 0 0 24px; }
