/* ==========================================================================
   KineticTwin AI / OrthoBoticsTech — Core Design System & Tokens
   Theme: Pristine Scientific Laboratory (Pure Light White System)
   ========================================================================== */

:root {
  /* Color Palette - 100% Light & Pristine White Lab Aesthetic */
  --bg-pure: #FFFFFF;
  --bg-surface: #F8FAFC;
  --bg-surface-elevated: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-tint-cyan: #F0F9FF;
  --bg-tint-blue: #EFF6FF;
  --bg-tint-violet: #F5F3FF;
  --bg-tint-emerald: #ECFDF5;
  --bg-tint-amber: #FFFBEB;
  --bg-tint-red: #FEF2F2;

  /* Text & Contrast */
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-dim: #94A3B8;

  /* Borders & Dividers */
  --border-light: #E2E8F0;
  --border-subtle: #F1F5F9;
  --border-accent: #BAE6FD;
  --border-strong: #CBD5E1;

  /* Scientific Accents */
  --cyan-primary: #0284C7;
  --cyan-glow: #0EA5E9;
  --cyan-vibrant: #38BDF8;
  --blue-clinical: #2563EB;
  --blue-deep: #1D4ED8;
  --violet-compute: #6366F1;
  --emerald-healthy: #059669;
  --emerald-light: #10B981;
  --amber-review: #D97706;
  --red-alert: #DC2626;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, 'Liberation Mono', Menlo, Courier, monospace;

  /* Kinetic Trajectory & Shadows */
  --shadow-subtle: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-card: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.03);
  --shadow-elevated: 0 12px 24px -4px rgba(15, 23, 42, 0.07), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
  --shadow-glow-cyan: 0 0 24px rgba(14, 165, 233, 0.16);
  --shadow-glow-blue: 0 0 24px rgba(37, 99, 235, 0.14);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Container */
  --container-max: 1280px;
  --container-wide: 1400px;
  --container-tight: 1040px;
  --header-height: 72px;

  /* Transition */
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 250ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-pure);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Scientific Grid Background (Light Subtle Coordinate Mesh) */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.5rem, 5vw + 1rem, 4.25rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.85rem, 3vw + 0.5rem, 2.75rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(1.35rem, 1.5vw + 0.5rem, 1.75rem);
}

h4 {
  font-size: 1.15rem;
}

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

p.lead {
  font-size: clamp(1.15rem, 1vw + 0.5rem, 1.35rem);
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.6;
}

/* Monospace & System Badges */
.mono, .sys-tag, .data-tag, code {
  font-family: var(--font-mono);
}

.sys-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-tint-cyan);
  color: var(--cyan-primary);
  border: 1px solid var(--border-accent);
}

.sys-tag::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--cyan-glow);
  box-shadow: 0 0 8px var(--cyan-glow);
  animation: pulseLight 2s infinite ease-in-out;
}

.sys-tag.emerald {
  background-color: var(--bg-tint-emerald);
  color: var(--emerald-healthy);
  border-color: rgba(16, 185, 129, 0.3);
}
.sys-tag.emerald::before {
  background-color: var(--emerald-light);
  box-shadow: 0 0 8px var(--emerald-light);
}

.sys-tag.amber {
  background-color: var(--bg-tint-amber);
  color: var(--amber-review);
  border-color: rgba(217, 119, 6, 0.3);
}
.sys-tag.amber::before {
  background-color: var(--amber-review);
  box-shadow: 0 0 8px var(--amber-review);
}

.sys-tag.neutral {
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  border-color: var(--border-light);
}
.sys-tag.neutral::before {
  background-color: var(--text-muted);
  box-shadow: none;
}

/* Containers & Layouts */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  position: relative;
  z-index: 1;
}

.container-wide {
  max-width: var(--container-wide);
}

.container-tight {
  max-width: var(--container-tight);
}

.section {
  padding-top: clamp(4.5rem, 8vw, 7.5rem);
  padding-bottom: clamp(4.5rem, 8vw, 7.5rem);
  position: relative;
}

.section-alt {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.section-pure {
  background-color: var(--bg-pure);
}

/* Header & Global Nav */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  z-index: 1000;
  transition: all var(--transition-base);
}

.site-header.scrolled {
  background-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.brand-symbol {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
  border: 1px solid var(--border-accent);
  box-shadow: var(--shadow-subtle);
}

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

.nav-link {
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--cyan-primary);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan-primary), var(--blue-clinical));
  border-radius: 2px;
}

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

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

/* Buttons & CTAs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369A1 0%, #075985 100%);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-pure);
  color: var(--text-primary);
  border-color: var(--border-light);
  box-shadow: var(--shadow-subtle);
}

.btn-secondary:hover {
  background-color: var(--bg-surface);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.btn-cyan {
  background-color: var(--bg-tint-cyan);
  color: var(--cyan-primary);
  border-color: var(--border-accent);
}

.btn-cyan:hover {
  background-color: #E0F2FE;
  border-color: #7DD3FC;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* Kinetic Cards & Scientific Modules */
.lab-card {
  background-color: var(--bg-pure);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.lab-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-elevated), var(--shadow-glow-cyan);
  transform: translateY(-3px);
}

.lab-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan-primary), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.lab-card:hover::before {
  opacity: 1;
}

/* Kinetic Trajectory Line (The Signature Visual Motif) */
.kinetic-trajectory {
  position: relative;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(2, 132, 199, 0.15) 20%, 
    rgba(2, 132, 199, 0.7) 50%, 
    rgba(14, 165, 233, 0.15) 80%, 
    transparent 100%
  );
  margin: 2.5rem 0;
}

.kinetic-trajectory::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--cyan-glow);
  box-shadow: 0 0 10px var(--cyan-glow);
  transform: translateX(-50%);
  animation: trajectoryPulse 3s infinite ease-in-out;
}

/* Command Palette (CMD + K) Modal */
.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.cmd-palette-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.cmd-palette-dialog {
  width: 100%;
  max-width: 580px;
  background-color: var(--bg-pure);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated), 0 20px 40px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  transform: translateY(-20px) scale(0.98);
  transition: transform var(--transition-fast);
}

.cmd-palette-backdrop.open .cmd-palette-dialog {
  transform: translateY(0) scale(1);
}

.cmd-palette-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.cmd-palette-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.1rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: transparent;
}

.cmd-palette-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 0.75rem;
  list-style: none;
}

.cmd-palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.cmd-palette-item:hover, .cmd-palette-item.active {
  background-color: var(--bg-tint-cyan);
  color: var(--cyan-primary);
}

/* Clinical Footers & Regulatory Notices */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding-top: 5rem;
  padding-bottom: 3.5rem;
  position: relative;
  z-index: 1;
}

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

.footer-brand p {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.925rem;
  color: var(--text-muted);
  max-width: 320px;
}

.footer-col h5 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

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

.footer-col a {
  text-decoration: none;
  font-size: 0.925rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

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

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.footer-disclaimer {
  padding: 1.5rem;
  background-color: var(--bg-pure);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 2.5rem;
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Interactive Accordions (for FAQ) */
.faq-item {
  border-bottom: 1px solid var(--border-light);
  padding: 1.5rem 0;
}

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

.faq-trigger:hover {
  color: var(--cyan-primary);
}

.faq-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  transition: transform var(--transition-base);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  background-color: var(--bg-tint-cyan);
  color: var(--cyan-primary);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.faq-content p {
  padding-top: 1rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.status-pill.review {
  background-color: var(--bg-tint-red);
  color: var(--red-alert);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.status-pill.watch {
  background-color: var(--bg-tint-amber);
  color: var(--amber-review);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.status-pill.nominal {
  background-color: var(--bg-tint-emerald);
  color: var(--emerald-healthy);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
