/* ═══════════════════════════════════════════════
   IMBILA.AI DESIGN SYSTEM v1.0
   Shared tokens + components for demos.imbila.ai
   Light-first with dark mode toggle.
   ═══════════════════════════════════════════════ */

/* ─── TOKENS ─── */
:root {
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --honey: #EDAF42;
  --honey-light: #F5C96E;
  --honey-dark: #C8922F;
  --honey-deep: #A67720;
  --honey-wash: #FAE0A5;
  --honey-10: rgba(237,175,66,0.10);
  --honey-15: rgba(237,175,66,0.15);
  --honey-25: rgba(237,175,66,0.25);
  --success: #3A9E6B;
  --warning: #E8A838;
  --error: #D94F4F;
  --info: #4A90B8;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 100px;
}

/* ─── LIGHT THEME (default) ─── */
[data-theme="light"] {
  --bg: #FAFAFA;
  --bg-card: #FFFFFF;
  --bg-card-alt: #F5F5F5;
  --bg-code: #F5F5F5;
  --bg-nav: rgba(250,250,250,0.88);
  --bg-hero-orb1: rgba(237,175,66,0.06);
  --bg-hero-orb2: rgba(237,175,66,0.09);
  --text-primary: #0A0A0A;
  --text-heading: #0A0A0A;
  --text-body: #555555;
  --text-secondary: #777777;
  --text-muted: #999999;
  --text-code: #A67720;
  --border: #EEEEEE;
  --border-strong: #DDDDDD;
  --border-hover: #BBBBBB;
  --accent-tag-bg: rgba(237,175,66,0.10);
  --accent-tag-border: rgba(237,175,66,0.20);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  --shadow-card-hover: 0 4px 16px rgba(0,0,0,0.07);
}

/* ─── DARK THEME ─── */
[data-theme="dark"] {
  --bg: #0A0A0A;
  --bg-card: #1F1E1E;
  --bg-card-alt: #111111;
  --bg-code: #1A1A1A;
  --bg-nav: rgba(10,10,10,0.88);
  --bg-hero-orb1: rgba(237,175,66,0.04);
  --bg-hero-orb2: rgba(237,175,66,0.06);
  --text-primary: #FAFAFA;
  --text-heading: #FAFAFA;
  --text-body: #BBBBBB;
  --text-secondary: #999999;
  --text-muted: #777777;
  --text-code: #EDAF42;
  --border: #2A2A2A;
  --border-strong: #3D3D3D;
  --border-hover: #555555;
  --accent-tag-bg: rgba(237,175,66,0.10);
  --accent-tag-border: rgba(237,175,66,0.15);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-card-hover: 0 4px 16px rgba(0,0,0,0.3);
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.7;
  transition: background 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}

/* ─── NAV ─── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 32px;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s ease, border-color 0.35s ease;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-brand svg { width: 28px; height: 28px; }
.nav-brand span { font-size: 16px; font-weight: 700; color: var(--text-heading); }
.nav-brand em { font-style: normal; color: var(--honey); }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a {
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover { color: var(--honey); }
.nav-links a.active { color: var(--honey); }
.nav-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 4px 12px;
  background: var(--accent-tag-bg); border: 1px solid var(--accent-tag-border);
  border-radius: var(--radius-pill); color: var(--honey-deep);
}
[data-theme="dark"] .nav-tag { color: var(--honey); }
.theme-toggle {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 6px 10px;
  cursor: pointer; font-size: 14px; transition: border-color 0.2s;
}
.theme-toggle:hover { border-color: var(--honey); }

/* ─── LAYOUT ─── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 28px; }
.prose { max-width: 64ch; }
section { padding: 72px 0; }

/* ─── TYPOGRAPHY ─── */
h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800; line-height: 1.15;
  color: var(--text-heading);
}
h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800; color: var(--text-heading);
  line-height: 1.2;
}
h3 { font-size: 1.15rem; font-weight: 700; color: var(--text-heading); }
.accent { color: var(--honey); }
.section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--honey-deep); margin-bottom: 12px;
}
[data-theme="dark"] .section-label { color: var(--honey); }

/* ─── HERO ─── */
.hero {
  text-align: center; padding: 140px 28px 80px;
  position: relative; overflow: hidden;
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%;
  pointer-events: none; filter: blur(80px);
}
.hero::before {
  width: 500px; height: 500px; top: -120px; right: -100px;
  background: var(--bg-hero-orb1);
}
.hero::after {
  width: 400px; height: 400px; bottom: -80px; left: -60px;
  background: var(--bg-hero-orb2);
}
.hero h1 { margin-bottom: 16px; }
.hero-sub {
  font-size: 18px; color: var(--text-secondary);
  max-width: 580px; margin: 0 auto 28px;
}
.hero-meta {
  display: flex; justify-content: center; gap: 16px; flex-wrap: wrap;
}
.hero-meta span {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 6px 16px; border-radius: var(--radius-pill);
}

/* ─── CARDS ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.card-link {
  text-decoration: none; color: inherit; display: block;
}

/* ─── GRIDS ─── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }

/* ─── TAGS ─── */
.tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--accent-tag-bg); border: 1px solid var(--accent-tag-border);
  color: var(--honey-deep);
}
[data-theme="dark"] .tag { color: var(--honey); }
.tag-green { background: rgba(58,158,107,0.10); border-color: rgba(58,158,107,0.20); color: var(--success); }
.tag-blue { background: rgba(74,144,184,0.10); border-color: rgba(74,144,184,0.20); color: var(--info); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: all 0.2s ease; border: none;
}
.btn-primary { background: var(--honey); color: #0A0A0A; }
.btn-primary:hover { background: var(--honey-light); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-heading);
}
.btn-secondary:hover { border-color: var(--honey); color: var(--honey); }

/* ─── CALLOUT ─── */
.callout {
  background: var(--bg-card);
  border-left: 3px solid var(--honey);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 24px;
  margin: 24px 0;
  font-size: 15px;
}

/* ─── DEMO CHROME (shared UI for demo pages) ─── */
.demo-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.demo-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card-alt);
}
.demo-panel-header h3 { font-size: 14px; margin: 0; }
.demo-panel-body { padding: 24px; }
.demo-panel-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-card-alt);
  font-size: 12px; color: var(--text-muted);
  display: flex; justify-content: space-between; align-items: center;
}

/* ─── FORM ELEMENTS ─── */
.input, .textarea, .select {
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  color: var(--text-primary);
  width: 100%;
  transition: border-color 0.2s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--honey);
}
.textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.select { cursor: pointer; }
label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── STATUS INDICATOR ─── */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.idle { background: var(--text-muted); }
.status-dot.running { background: var(--honey); animation: pulse 1s infinite; }
.status-dot.success { background: var(--success); }
.status-dot.error { background: var(--error); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── TIMING BAR ─── */
.timing-bar {
  display: flex; align-items: center; gap: 16px;
  font-size: 12px; color: var(--text-muted);
}
.timing-bar .timing-value {
  font-weight: 700; color: var(--honey);
  font-variant-numeric: tabular-nums;
}

/* ─── FOOTER ─── */
.footer {
  text-align: center; padding: 60px 28px 40px;
  border-top: 1px solid var(--border);
}
.footer-brand {
  font-size: 18px; font-weight: 800;
  color: var(--text-heading); margin-top: 12px;
}
.footer-brand span { color: var(--honey); }
.footer p { font-size: 13px; color: var(--text-muted); margin-top: 8px; }
.footer-links { margin-top: 16px; display: flex; justify-content: center; gap: 20px; }
.footer-links a {
  font-size: 13px; color: var(--text-secondary);
  text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: var(--honey); }

/* ─── FADE-IN ─── */
.fade-up { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .nav { padding: 12px 16px; }
  .nav-links a:not(.nav-tag):not(.theme-toggle) { display: none; }
  .hero { padding: 120px 16px 60px; }
  section { padding: 48px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
