@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Inter+Tight:wght@400;500;600&family=Sora:wght@400;600;700&display=swap');

/* Nexsas AI Enterprise Design Tokens */
:root {
  --bg-app: #F1F4F6;
  --ink-primary: #191D2A;
  --brand-violet: #8D59FF;
  --brand-violet-hover: #733be6;
  --attention-red: #DE4A40;
  --attention-red-hover: #c43228;
  --border-gray: #CED5DE;
  --bg-input: #0D1017;
  --btn-secondary: #191D2A;
  --btn-secondary-hover: #293045;
  --btn-primary-surf: #F8F9FA;
  --btn-primary-hover: #e9ecef;
  --bg-card: #FFFFFF;
  --bg-dark-card: #191D2A;
  --text-light: #DBE2E6;
  --text-muted: #6C7A89;
  --text-dark: #191D2A;
  --font-heading: 'Sora', sans-serif;
  --font-body: 'Inter Tight', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  
  --radius-card: 12px;
  --radius-input: 6px;
  --radius-btn-primary: 6px;
  --radius-btn-secondary: 16px;
}

/* Base resets & layout rules */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-app);
  color: var(--ink-primary);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--ink-primary);
  line-height: 1.2;
}

h1 {
  font-size: 3rem; /* 48px base, scaled in hero */
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2rem; /* 32px */
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.25rem; /* 20px */
  font-weight: 600;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--attention-red);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--attention-red-hover);
}

/* Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-violet { color: var(--brand-violet); }
.text-red { color: var(--attention-red); }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }

.bg-dark {
  background-color: var(--ink-primary);
  color: var(--text-light);
}

.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4 {
  color: #FFFFFF;
}

.mono {
  font-family: var(--font-mono);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-8 { margin-top: 4rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-8 { margin-bottom: 4rem; }

.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }
.py-8 { padding-top: 4rem; padding-bottom: 4rem; }
.py-16 { padding-top: 8rem; padding-bottom: 8rem; }

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

/* Layout System */
.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-6 { grid-template-columns: repeat(6, 1fr); }
  .grid-2-1 { grid-template-columns: 2fr 1fr; }
  .grid-1-2 { grid-template-columns: 1fr 2fr; }
}

.flex {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

/* Card Styles - Solid surfaces with borders, strictly no shadows, gradients or glassmorphism */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-card);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.card.dark {
  background-color: var(--bg-dark-card);
  color: var(--text-light);
  border-color: var(--ink-primary);
}

.card.highlight {
  border-color: var(--brand-violet);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.badge-red {
  background-color: rgba(222, 74, 64, 0.1);
  color: var(--attention-red);
  border: 1px solid var(--attention-red);
}

.badge-violet {
  background-color: rgba(141, 89, 255, 0.1);
  color: var(--brand-violet);
  border: 1px solid var(--brand-violet);
}

.badge-gray {
  background-color: var(--bg-app);
  color: var(--text-dark);
  border: 1px solid var(--border-gray);
}

/* Buttons - Solid surfaces, strictly no shadow or gradient */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  width: 100%;
}

@media (min-width: 576px) {
  .btn {
    width: auto;
  }
}

.btn-primary {
  background-color: var(--btn-primary-surf);
  color: var(--text-dark);
  border-color: var(--border-gray);
  border-radius: var(--radius-btn-primary);
}

.btn-primary:hover {
  background-color: var(--btn-primary-hover);
  border-color: var(--border-gray);
}

.btn-secondary {
  background-color: var(--btn-secondary);
  color: var(--btn-primary-surf);
  border-radius: var(--radius-btn-secondary);
}

.btn-secondary:hover {
  background-color: var(--btn-secondary-hover);
}

.btn-accent {
  background-color: var(--brand-violet);
  color: #FFFFFF;
  border-radius: var(--radius-btn-primary);
}

.btn-accent:hover {
  background-color: var(--brand-violet-hover);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-gray);
  color: var(--ink-primary);
  border-radius: var(--radius-btn-primary);
}

.btn-outline:hover {
  background-color: rgba(25, 29, 42, 0.05);
}

.btn-outline-white {
  background-color: transparent;
  border: 1px solid var(--text-light);
  color: #FFFFFF;
  border-radius: var(--radius-btn-secondary);
}

.btn-outline-white:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Form inputs - Dark theme inputs */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
}

label {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--ink-primary);
}

.bg-dark label {
  color: #FFFFFF;
}

input, select, textarea {
  background-color: var(--bg-input);
  color: #F1F4F6;
  border: 1px solid var(--border-gray);
  border-radius: var(--radius-input);
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand-violet);
}

/* Header & Navigation */
header {
  background-color: var(--bg-app);
  border-bottom: 1px solid var(--border-gray);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--brand-violet);
}

.nav-menu {
  display: none;
}

@media (min-width: 1024px) {
  .nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
  }
  
  .nav-link {
    color: var(--ink-primary);
    font-weight: 500;
    font-size: 0.875rem;
  }
  
  .nav-link:hover, .nav-link.active {
    color: var(--brand-violet);
  }
}

.mobile-menu-toggle {
  display: flex;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 6px;
}

@media (min-width: 1024px) {
  .mobile-menu-toggle {
    display: none;
  }
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--ink-primary);
  transition: all 0.2s ease;
}

/* Mobile Nav Overlay */
.mobile-nav {
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  height: calc(100vh - 60px);
  background-color: var(--bg-app);
  border-top: 1px solid var(--border-gray);
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  gap: 1.5rem;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.mobile-nav.open {
  transform: translateX(0);
}

.mobile-nav a {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink-primary);
  border-bottom: 1px solid var(--border-gray);
  padding-bottom: 0.75rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  text-align: left;
}

th, td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-gray);
}

th {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--ink-primary);
}

td {
  font-family: var(--font-body);
}

tr.highlight-row {
  background-color: rgba(141, 89, 255, 0.05);
}

/* Tabs */
.tabs-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tabs-list {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-gray);
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--ink-primary);
}

.tab-btn.active {
  color: var(--brand-violet);
  border-bottom-color: var(--brand-violet);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Footer legal block details */
footer {
  background-color: var(--ink-primary);
  color: var(--text-light);
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border-gray);
}

footer a {
  color: var(--text-light);
}

footer a:hover {
  color: var(--brand-violet);
}

.footer-grid {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  color: #FFFFFF;
}

.footer-logo span {
  color: var(--brand-violet);
}

.footer-title {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #FFFFFF;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  font-size: 0.875rem;
}

.footer-legal-block {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-legal-block p {
  margin-bottom: 0.5rem;
}

/* Interactive Incident Timeline demo */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin-top: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--border-gray);
}

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

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--bg-app);
  border: 2px solid var(--border-gray);
  z-index: 2;
  transition: all 0.2s ease;
}

.timeline-item.active .timeline-marker {
  border-color: var(--brand-violet);
  background-color: var(--brand-violet);
}

.timeline-item.active {
  animation: pulse-item 1.5s infinite alternate;
}

.timeline-time {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-violet);
  margin-bottom: 0.25rem;
}

/* ROI sliders */
.roi-calculator {
  display: grid;
  gap: 2rem;
}

@media (min-width: 992px) {
  .roi-calculator {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.slider-group {
  margin-bottom: 1.5rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.slider-value {
  font-family: var(--font-mono);
  font-weight: 600;
}

input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: var(--border-gray);
  height: 6px;
  border-radius: 3px;
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-violet);
  cursor: pointer;
  border: none;
}

input[type=range]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-violet);
  cursor: pointer;
  border: none;
}

/* Pie-chart / Savings breakdown bar CSS representation */
.savings-chart {
  display: flex;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.savings-slice {
  height: 100%;
}

.savings-slice.detection { background-color: var(--brand-violet); }
.savings-slice.churn { background-color: var(--attention-red); }
.savings-slice.engineering { background-color: #2D3748; }
.savings-slice.exec { background-color: var(--border-gray); }

.savings-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  font-size: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-detection { background-color: var(--brand-violet); }
.dot-churn { background-color: var(--attention-red); }
.dot-engineering { background-color: #2D3748; }
.dot-exec { background-color: var(--border-gray); }

/* Fit Panel */
.fit-panel {
  border: 2px solid var(--border-gray);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  background-color: var(--bg-card);
}

.fit-panel.fit-growth {
  border-color: var(--brand-violet);
}

.fit-panel.fit-starter {
  border-color: var(--border-gray);
}

.fit-panel.fit-enterprise {
  border-color: var(--attention-red);
}

/* JSON API styling */
pre {
  background-color: var(--bg-input);
  color: #DBE2E6;
  padding: 1rem;
  border-radius: var(--radius-input);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.4;
  border: 1px solid var(--border-gray);
}

/* Responsive utilities */
@media (max-width: 767px) {
  h1 {
    font-size: 2.25rem;
  }
  
  .py-16 {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}
