/* ================================================================
   [ai]ctrl.dev — Marketing Site Shared Stylesheet
   Brand Design System — Light Theme Only
   ================================================================ */

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; }

/* ---- Foundation Tokens ---- */
:root {
  /* Primary (Indigo) */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #4c6ef5;
  --primary-600: #4338ca;
  --primary-700: #3730a3;
  --primary-800: #312e81;
  --primary-900: #2e2a72;
  --primary-950: #1e1b4b;

  /* Amber */
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;

  /* Neutrals */
  --neutral-50: #fafafa;
  --neutral-100: #f4f4f5;
  --neutral-200: #e4e4e7;
  --neutral-300: #d4d4d8;
  --neutral-400: #a1a1aa;
  --neutral-500: #71717a;
  --neutral-600: #52525b;
  --neutral-700: #3f3f46;
  --neutral-800: #27272a;
  --neutral-900: #18181b;
  --neutral-950: #09090b;

  /* Semantic */
  --green-600: #16a34a;
  --green-500: #22c55e;
  --red-600: #dc2626;

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #1e1b4b, #4c6ef5, #818cf8);
  --gradient-accent: linear-gradient(135deg, #4c6ef5, #7c3aed);
  --gradient-subtle: linear-gradient(135deg, #eef2ff, #e0e7ff);

  /* Typography */
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px; --space-20: 80px; --space-24: 96px;

  /* Radius */
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px;
  --radius-xl: 16px; --radius-2xl: 24px; --radius-full: 9999px;

  /* Shadows (light mode) */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.06);

  /* Light Theme Semantic */
  --bg-page: var(--neutral-50);
  --bg-surface: #ffffff;
  --bg-muted: var(--neutral-100);
  --text-primary: var(--neutral-900);
  --text-secondary: var(--neutral-600);
  --text-muted: var(--neutral-500);
  --border-default: var(--neutral-200);
  --border-subtle: var(--neutral-100);

  /* Brand logo (light bg) */
  --brand-bracket: #a1a1aa;
  --brand-ai: #4c6ef5;
  --brand-ctrl: #18181b;
  --brand-dot: #a1a1aa;
  --brand-dev: #52525b;
}

/* ---- Base ---- */
body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: var(--primary-600); text-decoration: none; }
a:hover { color: var(--primary-500); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
}

/* ---- Container ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-6); }
.container--narrow { max-width: 720px; }
.container--wide { max-width: 1000px; }

/* ---- Section ---- */
.section { padding: var(--space-20) 0; }
.section--muted { background: var(--bg-muted); }
.section--white { background: var(--bg-surface); }
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-600);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}
.section-title {
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
}
.section-subtitle {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.7;
}

/* ---- Sticky Navigation ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
}
.site-nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-nav__logo {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-nav__logo-text {
  color: var(--brand-ctrl);
}
.site-nav__logo-text .dot { color: var(--brand-dot); }
.site-nav__logo-text .dev { color: var(--brand-dev); }

.site-nav__icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}
.site-nav__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}
.site-nav__links a:hover,
.site-nav__links a.active {
  color: var(--primary-600);
  background: var(--primary-50);
}

.site-nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Mobile nav toggle */
.site-nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--text-primary);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.4;
}
.btn--primary {
  background: var(--primary-600);
  color: white;
}
.btn--primary:hover {
  background: var(--primary-500);
  color: white;
}
.btn--secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn--secondary:hover {
  background: var(--neutral-100);
  border-color: var(--neutral-300);
  color: var(--text-primary);
}
.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn--ghost:hover {
  background: var(--neutral-100);
  color: var(--text-primary);
}
.btn--large {
  padding: var(--space-4) var(--space-8);
  font-size: 1rem;
}
.btn--inverse {
  background: white;
  color: var(--primary-700);
}
.btn--inverse:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}

/* ---- Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}
.badge--primary { background: rgba(76,110,245,0.12); color: var(--primary-600); }
.badge--success { background: rgba(22,163,74,0.1); color: var(--green-600); }
.badge--warning { background: rgba(217,119,6,0.1); color: var(--amber-600); }
.badge--neutral { background: var(--neutral-200); color: var(--neutral-700); }
.badge--amber { background: rgba(245,158,11,0.12); color: var(--amber-700); }

/* ---- Cards ---- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover {
  box-shadow: var(--shadow-lg);
}
.card--highlighted {
  border-color: var(--primary-300);
  box-shadow: 0 0 0 1px var(--primary-200);
}

/* ---- Code Block ---- */
.code-block {
  background: var(--neutral-950);
  color: var(--neutral-300);
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  overflow-x: auto;
  border: 1px solid var(--neutral-800);
}
.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--neutral-800);
  font-size: 0.75rem;
  color: var(--neutral-500);
}
.code-block__body { padding: var(--space-4) var(--space-5); }
.code-block .prompt { color: var(--primary-400); }
.code-block .comment { color: var(--neutral-600); }

.copy-btn {
  background: var(--neutral-800);
  border: 1px solid var(--neutral-700);
  color: var(--neutral-400);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.copy-btn:hover { background: var(--neutral-700); color: var(--neutral-200); }

/* ---- Footer ---- */
.site-footer {
  background: var(--neutral-900);
  color: var(--neutral-400);
  padding: var(--space-16) 0 var(--space-8);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.site-footer__logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-footer__logo-text {
  color: var(--neutral-50);
}
.site-footer__logo-text .dot { color: var(--neutral-500); }
.site-footer__logo-text .dev { color: var(--neutral-400); }
.site-footer__tagline {
  font-size: 0.875rem;
  color: var(--neutral-500);
  line-height: 1.6;
  max-width: 280px;
}
.site-footer__social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.site-footer__social a {
  color: var(--neutral-500);
  transition: color 0.15s;
}
.site-footer__social a:hover { color: var(--primary-400); }

.site-footer__col h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--neutral-300);
  margin-bottom: var(--space-4);
}
.site-footer__col ul { list-style: none; }
.site-footer__col li { margin-bottom: var(--space-2); }
.site-footer__col a {
  font-size: 0.875rem;
  color: var(--neutral-500);
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer__col a:hover { color: var(--neutral-200); }

.site-footer__bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) 0;
  margin-top: var(--space-12);
  border-top: 1px solid var(--neutral-800);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--neutral-600);
}
.site-footer__bottom-links {
  display: flex;
  gap: var(--space-4);
}
.site-footer__bottom-links a {
  color: var(--neutral-600);
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer__bottom-links a:hover { color: var(--neutral-400); }

/* ---- Cookie Banner ---- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-default);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}
.cookie-banner__text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}
.cookie-banner__text a {
  color: var(--primary-600);
  text-decoration: underline;
}
.cookie-banner__actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Cookie Preferences Modal */
.cookie-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.25);
  align-items: center;
  justify-content: center;
}
.cookie-modal-overlay.active { display: flex; }
.cookie-modal {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 520px;
  width: 90%;
  padding: var(--space-8);
}
.cookie-modal h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-4);
}
.cookie-modal__category {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cookie-modal__category:last-of-type { border-bottom: none; }
.cookie-modal__cat-info h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.cookie-modal__cat-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.cookie-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--neutral-300);
  border-radius: var(--radius-full);
  transition: background 0.2s;
}
.toggle__slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle input:checked + .toggle__slider { background: var(--primary-600); }
.toggle input:checked + .toggle__slider::before { transform: translateX(20px); }
.toggle input:disabled + .toggle__slider { opacity: 0.5; cursor: not-allowed; }

/* ---- Utility Classes ---- */
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mx-auto { margin-left: auto; margin-right: auto; }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
}

@media (max-width: 768px) {
  .site-nav__links { display: none; }
  .site-nav__toggle { display: block; }
  .site-nav__links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    box-shadow: var(--shadow-lg);
    padding: var(--space-4);
    gap: 0;
  }
  .site-nav__actions .btn--ghost { display: none; }
  .section-title { font-size: 2rem; }
  .site-footer__grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .cookie-banner { flex-direction: column; align-items: stretch; }
  .cookie-banner__actions { flex-wrap: wrap; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .section-title { font-size: 1.75rem; }
  .btn--large { padding: var(--space-3) var(--space-6); }
}

/* ---- Print ---- */
@media print {
  .site-nav, .site-footer, .cookie-banner { display: none !important; }
  body { background: white; }
}
