/* ============================================================
   Codegraphs Design Language
   Based on Codegraphs Constitution 1.1 & design-principle.md
   ============================================================

   Tokens:
   --bg:         #FFFFFF
   --primary:    #0F172A
   --accent:     #2563EB
   --success:    #10B981
   --graph:      #38BDF8
   --text:       #1E293B
   --text-muted: #64748B
   --border:     #E2E8F0
   --bg-subtle:  #F8FAFC
   ============================================================ */

/* --- Reset & Base ------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:         #FFFFFF;
  --primary:    #0F172A;
  --accent:     #2563EB;
  --accent-dim: #1D4ED8;
  --success:    #10B981;
  --graph:      #38BDF8;
  --text:       #1E293B;
  --text-muted: #64748B;
  --border:     #E2E8F0;
  --bg-subtle:  #F8FAFC;
  --bg-graph:   #F1F5F9;
  --nav-bg:     rgba(255, 255, 255, 0.85);
  --shadow-sm:  rgba(15, 23, 42, 0.04);
  --shadow-md:  rgba(15, 23, 42, 0.06);
  --shadow-lg:  rgba(15, 23, 42, 0.08);
  --radius:     8px;
  --radius-lg:  16px;
  --max-width:  1200px;
  --transition: 200ms ease;
}

/* --- Dark Mode ----------------------------------------------- */
[data-theme="dark"] {
  --bg:         #0F172A;
  --primary:    #F1F5F9;
  --accent:     #60A5FA;
  --accent-dim: #3B82F6;
  --success:    #34D399;
  --graph:      #38BDF8;
  --text:       #E2E8F0;
  --text-muted: #94A3B8;
  --border:     #1E293B;
  --bg-subtle:  #1E293B;
  --bg-graph:   #1E293B;
  --nav-bg:     rgba(15, 23, 42, 0.85);
  --shadow-sm:  rgba(0, 0, 0, 0.2);
  --shadow-md:  rgba(0, 0, 0, 0.3);
  --shadow-lg:  rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .nav-logo-icon {
  background: var(--accent);
}

[data-theme="dark"] .viz-section {
  background: #0A0F1A;
}

[data-theme="dark"] .cta-banner {
  background: #1E293B;
}

[data-theme="dark"] .hero-search input {
  background: var(--bg-subtle);
  color: var(--text);
}

[data-theme="dark"] .search-modal {
  background: var(--bg);
}

[data-theme="dark"] .search-modal-input input {
  color: var(--text);
}

[data-theme="dark"] .search-modal-input kbd {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-muted);
}

/* --- Dark Mode Buttons -------------------------------------- */
[data-theme="dark"] .nav-cta {
  background: var(--accent);
  color: #0F172A !important;
}

[data-theme="dark"] .nav-cta:hover {
  background: var(--accent-dim);
}

[data-theme="dark"] .cta-btn {
  background: var(--accent);
  color: #0F172A;
}

[data-theme="dark"] .cta-btn:hover {
  background: var(--accent-dim);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

[data-theme="dark"] .form-submit {
  background: var(--accent);
  color: #0F172A;
}

[data-theme="dark"] .form-submit:hover {
  background: var(--accent-dim);
}

[data-theme="dark"] .pricing-btn-primary {
  background: var(--accent);
  color: #0F172A;
}

[data-theme="dark"] .pricing-btn-primary:hover {
  background: var(--accent-dim);
}

[data-theme="dark"] .pricing-btn-outline {
  border-color: var(--border);
  color: var(--text);
}

[data-theme="dark"] .pricing-btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="dark"] .pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(96, 165, 250, 0.12);
}

[data-theme="dark"] .hero-search-shortcut {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-muted);
}

[data-theme="dark"] .back-to-top {
  background: var(--bg-subtle);
  border-color: var(--border);
}

/* Theme Toggle Button */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), background var(--transition);
  margin-left: 0.75rem;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.theme-toggle:hover svg {
  color: var(--accent);
}

/* Language Toggle */
.lang-toggle {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
.sun-icon { display: none; }
.moon-icon { display: block; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Typography --------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

p {
  color: var(--text-muted);
  max-width: 64ch;
}

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

/* --- Navigation --------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--transition);
}

.nav-links a:hover { color: var(--primary); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  background: var(--primary);
  color: #fff !important;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}

.nav-cta:hover {
  background: #1E293B;
  transform: translateY(-1px);
}

/* --- Mobile Nav Toggle --------------------------------------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* --- Hero --------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 2rem 4rem;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-tagline {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  padding: 0.375rem 0.875rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary);
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.hero-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 auto 2.5rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.hero-search {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.hero-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1),
              0 4px 16px rgba(15, 23, 42, 0.06);
}

.hero-search input::placeholder {
  color: #94A3B8;
}

.hero-search-shortcut {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: #94A3B8;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.125rem 0.5rem;
  pointer-events: none;
}

/* --- Sections ----------------------------------------------- */
.section {
  padding: 6rem 2rem;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section h2 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.section-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

/* --- Asset Grid --------------------------------------------- */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.asset-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), transform var(--transition);
}

.asset-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.asset-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}

.asset-card-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}

.icon-programs   { background: var(--accent); }
.icon-functions  { background: #7C3AED; }
.icon-tables     { background: var(--success); }
.icon-sql        { background: #F59E0B; }
.icon-apis       { background: #EF4444; }
.icon-documents  { background: #8B5CF6; }
.icon-jobs       { background: #06B6D4; }
.icon-screens    { background: #EC4899; }
.icon-repos      { background: var(--primary); }

/* --- Visualization Section ---------------------------------- */
.viz-section {
  background: var(--primary);
  color: #fff;
  text-align: center;
  overflow: hidden;
}

.viz-section .section-label { color: var(--graph); }
.viz-section h2 { color: #fff; }
.viz-section .section-lead { color: #94A3B8; }

.viz-demo {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

.viz-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

/* --- Platform Architecture ---------------------------------- */
.platform-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 2rem 0;
}

.platform-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color var(--transition);
}

.platform-step:hover {
  border-color: var(--accent);
}

.platform-step-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: #fff;
  flex-shrink: 0;
}

.platform-arrow {
  color: var(--border);
  font-size: 1.25rem;
  font-weight: 300;
}

/* --- Integrations ------------------------------------------- */
.integration-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 2.5rem;
}

.integration-logo {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition);
}

.integration-logo:hover { color: var(--primary); }

/* --- Pricing ------------------------------------------------ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.pricing-card {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.pricing-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.08);
}

.pricing-tier {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.pricing-price {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.pricing-period {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.pricing-features {
  list-style: none;
  margin-bottom: 2rem;
}

.pricing-features li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.375rem 0;
  padding-left: 1.5rem;
  position: relative;
}

.pricing-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
}

.pricing-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background var(--transition), transform var(--transition);
}

.pricing-btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
}

.pricing-btn-primary:hover {
  background: #1E293B;
  transform: translateY(-1px);
}

.pricing-btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--border);
}

.pricing-btn-outline:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* --- Footer ------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 4rem 2rem 2rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand p {
  font-size: 0.875rem;
  margin-top: 0.75rem;
  max-width: 32ch;
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Page Header (for sub-pages) ---------------------------- */
.page-header {
  padding: 8rem 2rem 3rem;
  text-align: center;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin-bottom: 0.75rem;
}

.page-header p {
  font-size: 1.125rem;
  margin: 0 auto;
}

/* --- Feature Blocks (Platform page) ------------------------- */
.feature-block {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}

.feature-block:last-child { border-bottom: none; }

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.feature-grid.reverse { direction: rtl; }
.feature-grid.reverse > * { direction: ltr; }

.feature-text h3 {
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.feature-text p {
  margin-bottom: 1.25rem;
}

.feature-list {
  list-style: none;
}

.feature-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.375rem 0 0.375rem 1.5rem;
  position: relative;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.feature-visual {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  overflow: hidden;
}

.feature-visual canvas {
  max-width: 100%;
  height: auto;
}

/* --- CTA Banner --------------------------------------------- */
.cta-banner {
  text-align: center;
  padding: 5rem 2rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-lg);
  margin: 4rem auto 0;
  max-width: var(--max-width);
}

.cta-banner h2 {
  color: #fff;
  margin-bottom: 0.75rem;
}

.cta-banner p {
  color: #94A3B8;
  margin: 0 auto 1.5rem;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* --- Dropdown Navigation ------------------------------------ */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-dropdown-toggle::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
  margin-top: -2px;
  transition: transform var(--transition);
}

.nav-dropdown.open .nav-dropdown-toggle::after {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  padding: 0.5rem;
  z-index: 200;
}

.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.nav-dropdown-menu a:hover {
  background: var(--bg-subtle);
  color: var(--primary);
}

/* --- Stat Counters ------------------------------------------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.stat-item {
  text-align: center;
  padding: 1.5rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.375rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Language Grid (Solutions pages) ------------------------- */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.lang-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), transform var(--transition);
}

.lang-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.lang-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.lang-card-body h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.lang-card-body p {
  font-size: 0.8rem;
  line-height: 1.5;
}

/* --- Placeholder Visuals ------------------------------------ */
.placeholder-illustration {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-illustration svg {
  max-width: 100%;
  max-height: 100%;
}

/* Mock UI Panel */
.mock-ui {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}

.mock-ui-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.mock-ui-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.mock-ui-dot:nth-child(1) { background: #EF4444; }
.mock-ui-dot:nth-child(2) { background: #F59E0B; }
.mock-ui-dot:nth-child(3) { background: #10B981; }

.mock-ui-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mock-ui-line {
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 4px;
}

.mock-ui-line.short { width: 60%; }
.mock-ui-line.medium { width: 80%; }

.mock-ui-code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.mock-ui-code .keyword { color: #7C3AED; }
.mock-ui-code .string  { color: #10B981; }
.mock-ui-code .comment { color: #94A3B8; font-style: italic; }
.mock-ui-code .func    { color: #2563EB; }

/* Search Result Mock */
.mock-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mock-search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.mock-search-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}

.mock-search-item-text {
  flex: 1;
}

.mock-search-item-text .mock-ui-line {
  height: 6px;
}

.mock-search-item-text .mock-ui-line:last-child {
  width: 45%;
  margin-top: 4px;
  opacity: 0.5;
}

/* Graph Node Mock */
.mock-graph-container {
  position: relative;
  width: 100%;
  min-height: 280px;
}

/* --- Comparison Table (Pricing) ------------------------------ */
.compare-table-wrap {
  overflow-x: auto;
  margin: 2rem 0;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.compare-table thead th {
  text-align: left;
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.compare-table thead th:first-child {
  min-width: 220px;
}

.compare-table thead th.plan-col {
  text-align: center;
  font-size: 1rem;
}

.compare-table tbody td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: middle;
}

.compare-table tbody td:first-child {
  font-weight: 500;
  color: var(--text);
}

.compare-table tbody td.plan-col {
  text-align: center;
}

.compare-table .icon-check {
  color: var(--success);
  font-weight: 700;
}

.compare-table .icon-dash {
  color: var(--border);
}

.compare-table tbody tr:hover {
  background: var(--bg-subtle);
}

/* --- FAQ (Pricing) ------------------------------------------- */
.faq-list {
  max-width: 720px;
  margin: 2rem auto 0;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  padding: 1.25rem 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.faq-item.open .faq-question::after {
  content: '−';
}

.faq-answer {
  display: none;
  padding: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  display: block;
}

/* --- Timeline (About page) ----------------------------------- */
.timeline {
  position: relative;
  max-width: 640px;
  margin: 2rem auto 0;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1.5px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-year {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.timeline-title {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.timeline-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --- Contact Form -------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  padding: 0.8rem 2rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  align-self: flex-start;
}

.form-submit:hover {
  background: #1E293B;
  transform: translateY(-1px);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 0.25rem;
}

.contact-info-item {
  display: flex;
  gap: 0.75rem;
}

.contact-info-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-info-item h4 {
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.contact-info-item p {
  font-size: 0.85rem;
}

/* --- Vision Statement ----------------------------------------- */
.vision-quote {
  max-width: 720px;
  margin: 2rem auto;
  padding: 3rem 2rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
}

.vision-quote blockquote {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.vision-quote blockquote::before {
  content: '';
}

.vision-principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.vision-principle {
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.vision-principle:hover { border-color: var(--accent); }

.vision-principle-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.vision-principle h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.vision-principle p {
  font-size: 0.875rem;
  line-height: 1.6;
}

/* --- Solution Hero ------------------------------------------- */
.solution-hero {
  padding: 8rem 2rem 4rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.solution-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.solution-hero-text h1 {
  margin-bottom: 0.75rem;
}

.solution-hero-text .section-lead {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.solution-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.solution-tag {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.07);
  border-radius: 100px;
}

/* --- Platform Coverage Badges -------------------------------- */
.coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.coverage-card {
  padding: 1.5rem;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.coverage-card-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.coverage-card h4 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.coverage-card p {
  font-size: 0.8rem;
}

/* --- Scroll Reveal Animations -------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* --- Back to Top --------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, border-color var(--transition);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: var(--accent);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.back-to-top:hover svg {
  color: var(--accent);
}

/* --- Form Validation ----------------------------------------- */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.form-error-msg {
  display: none;
  font-size: 0.78rem;
  color: #EF4444;
  margin-top: 0.3rem;
}

.form-group.error .form-error-msg {
  display: block;
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Thank You State */
.form-thankyou {
  display: none;
  text-align: center;
  padding: 3rem 2rem;
}

.form-thankyou.show {
  display: block;
}

.form-thankyou-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.75rem;
}

.form-thankyou h3 {
  margin-bottom: 0.5rem;
}

.form-thankyou p {
  max-width: 40ch;
  margin: 0 auto;
}

/* --- 404 Page ------------------------------------------------- */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.error-page-code {
  font-size: 7rem;
  font-weight: 800;
  color: var(--border);
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 0.5rem;
}

.error-page h2 {
  margin-bottom: 0.75rem;
}

.error-page p {
  margin: 0 auto 1.5rem;
}

.error-page .cta-btn {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

/* --- Search Modal (⌘K) --------------------------------------- */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-overlay.open {
  display: flex;
}

.search-modal {
  width: 100%;
  max-width: 560px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15);
  overflow: hidden;
  animation: modalIn 0.15s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.search-modal-input {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.search-modal-input svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-modal-input input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: transparent;
}

.search-modal-input input::placeholder {
  color: #94A3B8;
}

.search-modal-input kbd {
  font-family: inherit;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.search-modal-hints {
  padding: 0.75rem 1.25rem;
}

.search-modal-hints span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-modal-hints .hint-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.825rem;
  color: var(--text);
}

.hint-icon {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: #fff;
  flex-shrink: 0;
}

/* --- Skip to Content (Accessibility) -------------------------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 999;
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* --- Focus Styles (Accessibility) ---------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[data-theme="dark"] a:focus-visible,
[data-theme="dark"] button:focus-visible,
[data-theme="dark"] input:focus-visible,
[data-theme="dark"] select:focus-visible,
[data-theme="dark"] textarea:focus-visible {
  outline-color: #60A5FA;
}

/* --- Cookie Consent Banner ----------------------------------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  padding: 1rem 1.5rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner p {
  font-size: 0.85rem;
  max-width: 520px;
  margin: 0;
  line-height: 1.5;
}

.cookie-banner p a {
  color: var(--accent);
  text-decoration: underline;
}

.cookie-banner-btns {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.cookie-btn-accept {
  background: var(--primary);
  color: var(--bg);
  border: none;
}

.cookie-btn-accept:hover {
  background: var(--accent);
}

.cookie-btn-dismiss {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.cookie-btn-dismiss:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

[data-theme="dark"] .cookie-btn-accept {
  background: var(--accent);
  color: #0F172A;
}

/* --- Blog Post Template -------------------------------------- */
.blog-post {
  max-width: 720px;
  margin: 0 auto;
}

.blog-post-header {
  text-align: center;
  padding: 3rem 0 2rem;
}

.blog-post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.blog-post-body {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--text);
}

.blog-post-body h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 0.75rem;
}

.blog-post-body h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
}

.blog-post-body p {
  color: var(--text);
  max-width: none;
  margin-bottom: 1.25rem;
}

.blog-post-body ul,
.blog-post-body ol {
  margin: 0.75rem 0 1.5rem 1.5rem;
  color: var(--text);
}

.blog-post-body li {
  margin-bottom: 0.5rem;
}

.blog-post-body code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.88em;
  background: var(--bg-subtle);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.blog-post-body pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.blog-post-body pre code {
  background: none;
  border: none;
  padding: 0;
}

.blog-post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Responsive --------------------------------------------- */
@media (max-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }

  .hero h1 { font-size: 2.25rem; }
  .hero-subtitle { font-size: 1.125rem; }

  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    gap: 1rem;
  }

  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .solution-hero-inner {
    grid-template-columns: 1fr;
  }

  .platform-flow {
    flex-direction: column;
  }
  .platform-arrow {
    transform: rotate(90deg);
  }

  .asset-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .section { padding: 4rem 1.25rem; }
  .hero { padding: 5rem 1.25rem 3rem; }

  .asset-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}
