/* BRAND VARIABLES */
:root {
  --brand-navy: #0f172a;
  --brand-navy-light: #1e293b;
  --brand-teal: #0d9488;
  --brand-teal-dim: #f0fdfa;
  --brand-slate: #64748b;
  --brand-primary: #2563eb;
  
  --bg-page: #ffffff;
  --bg-surface: #f8fafc;
  --bg-diagram: #F4F7FA;
  
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  
  --radius-sm: 6px;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

/* GLOBAL RESET - FIXES SCROLL ISSUES */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--brand-navy);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--brand-navy);
}

h1 { font-size: 3.2rem; line-height: 1.1; margin-bottom: 24px; }
h2 { font-size: 2.25rem; margin-bottom: 16px; }
h3 { font-size: 1.25rem; margin-bottom: 12px; }
h4 { font-size: 1.1rem; margin-bottom: 8px; }

p { color: var(--brand-slate); max-width: 60ch; margin-bottom: 24px; }
a { color: inherit; text-decoration: none; }

/* UTILITIES */
.container { 
  max-width: 1080px; 
  margin: 0 auto; 
  padding-inline: 24px; 
  width: 100%; /* Ensures it doesn't overflow */
}
.text-center { text-align: center; }
.kicker {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--brand-teal);
  font-weight: 600;
  margin-bottom: 16px;
  display: block;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--brand-slate); border: 1px solid transparent; }
.btn-ghost:hover { color: var(--brand-navy); background: var(--bg-surface); }

/* NAVIGATION */
.nav {
  position: sticky;
  top: 0;
  z-index: 100; /* Higher z-index to stay on top */
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
}
.nav-inner { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
}

/* Nav Group: Holds Links + Auth Buttons */
.nav-group { 
  display: flex; 
  gap: 32px; 
  align-items: center; 
}

/* Mobile Toggle: Hidden by default */
.mobile-toggle { 
  display: none; 
  background: none; 
  border: none; 
  cursor: pointer; 
  padding: 10px;
  color: var(--brand-navy);
}
.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: currentColor;
  margin: 5px 0;
}

/* Logo */
.brand-lockup { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.symbol { display: flex; flex-direction: column; gap: 3px; width: 20px; }
.symbol span { height: 3px; background: var(--brand-navy); border-radius: 4px; display: block; }
.symbol span:nth-child(1) { width: 12px; transform: translateX(8px); }
.symbol span:nth-child(2) { width: 12px; transform: translateX(4px); background: var(--brand-teal); }
.symbol span:nth-child(3) { width: 12px; }

/* DROPDOWN MENU */
.dropdown-wrapper { position: relative; padding: 10px 0; }
.dropdown-trigger {
  background: none; border: none; font-family: var(--font-sans); font-size: 0.95rem;
  font-weight: 500; color: var(--brand-slate); cursor: pointer; padding: 0;
  display: flex; align-items: center; gap: 4px;
}
.dropdown-wrapper:hover .dropdown-trigger { color: var(--brand-navy); }
.dropdown-menu {
  position: absolute; top: 100%; left: -12px; width: 260px; background: #fff;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.08);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100; display: flex; flex-direction: column; padding: 6px;
}
.dropdown-wrapper:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item { display: block; padding: 10px 12px; border-radius: 4px; transition: background 0.1s; }
.dropdown-item:hover { background: var(--bg-surface); }
.dropdown-title { display: block; font-size: 0.9rem; font-weight: 600; color: var(--brand-navy); margin-bottom: 2px; }
.dropdown-desc { display: block; font-size: 0.75rem; color: var(--brand-slate); line-height: 1.3; }

/* SECTIONS & LAYOUTS */
.hero { padding: 80px 0 100px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center; }
.section { padding: 80px 0; }
.section-border { border-top: 1px solid var(--border-subtle); }
.bg-surface { background: var(--bg-surface); }
.problem-section { background: var(--bg-surface); padding: 80px 0; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }

/* GRID SYSTEMS */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; margin: 120px 0; }
.feature-row.reverse { direction: rtl; }
.feature-row.reverse .feature-text { direction: ltr; }

/* DIAGRAM VISUALS */
.system-diagram {
  position: relative; background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: 8px; padding: 32px;
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px); background-size: 24px 24px;
  max-width: 100%; /* Prevents overflow */
}
.schematic-box {
  background: #fff; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 40px;
  position: relative; display: flex; flex-direction: column; gap: 24px;
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.05);
  max-width: 100%;
}
.pipeline-rail { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; position: relative; width: 100%; }
.pipeline-rail::before, .rail { content: ""; position: absolute; left: 20px; right: 0; top: 50%; height: 2px; background: var(--border-subtle); z-index: 0; }
.rail { position: relative; width: 100%; margin: 10px 0; left: 0; }

.node {
  width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; position: relative; z-index: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02); color: var(--brand-slate);
  flex-shrink: 0; /* Prevents squishing on mobile */
}
.rail .node { width: 12px; height: 12px; border: 2px solid var(--brand-slate); top: -5px; }
.node.active { border-color: var(--brand-teal); color: var(--brand-teal); background: #fff; }
.rail .node.active { background: var(--brand-teal); border-color: var(--brand-teal); }
.node.filled { background: var(--brand-navy); color: #fff; border-color: var(--brand-navy); }

.diagram-card {
  background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
  padding: 12px 16px; position: relative; z-index: 2; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  margin-left: 24px; min-width: 180px;
}
.card-mock { background: var(--bg-surface); border: 1px solid var(--border-subtle); padding: 16px; border-radius: 4px; width: 100%; }
.stack-layer { 
  border: 1px dashed var(--border-subtle); padding: 12px; margin-bottom: 8px; border-radius: 4px; 
  display: flex; justify-content: space-between; align-items: center;
}
.stack-layer.filled { background: var(--brand-teal-dim); border-style: solid; border-color: var(--brand-teal); }

.diagram-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand-slate); margin-bottom: 4px; }
.diagram-stat { font-size: 0.85rem; font-weight: 600; color: var(--brand-navy); white-space: nowrap; }
.icon { width: 20px; height: 20px; stroke-width: 1.5px; stroke: currentColor; fill: none; }

/* SYSTEM BRANCH (Methodology) */
.system-branch { display: flex; justify-content: center; margin-bottom: -2px; position: relative; height: 40px; }
.system-branch::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--border-subtle); z-index: 0; }
.system-branch::after { content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; background: #fff; border: 2px solid var(--brand-slate); border-radius: 50%; z-index: 1; }

/* PERSONA/HOME ELEMENTS */
.persona-section { padding: 80px 0; border-top: 1px solid var(--border-subtle); }
.tabs-header {
  display: flex; gap: 4px; background: var(--bg-surface); padding: 4px;
  border-radius: var(--radius-sm); width: fit-content; margin-bottom: 48px; margin-inline: auto; border: 1px solid var(--border-subtle);
}
.tab-btn {
  padding: 8px 24px; border: none; background: transparent; font-size: 0.95rem;
  font-weight: 500; color: var(--brand-slate); border-radius: 4px; cursor: pointer; transition: all 0.2s;
}
.tab-btn.active { background: #fff; color: var(--brand-navy); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.persona-layout { display: none; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; animation: fadeIn 0.3s ease-in; }
.persona-layout.visible { display: grid; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.feature-list { display: flex; flex-direction: column; gap: 24px; margin-top: 32px; }
.feature-item { display: flex; gap: 16px; }
.feature-icon {
  flex-shrink: 0; width: 32px; height: 32px; background: var(--brand-teal-dim); color: var(--brand-teal);
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}

/* FOOTER */
.footer-section { background: var(--brand-navy); color: white; padding: 100px 0; text-align: center; }
.footer-section h2 { color: white; margin-bottom: 24px; }
.footer-section p { color: #94a3b8; margin: 0 auto 40px; }
.jump-links { display: flex; justify-content: center; gap: 24px; margin-top: 24px; font-size: 0.9rem; color: #94a3b8; }
.jump-links button, .jump-links a { background: none; border: none; color: inherit; cursor: pointer; text-decoration: underline; }

/* RESPONSIVE & MOBILE MENU CSS */
@media (max-width: 768px) {
  h1 { font-size: 2.25rem; }
  .container { padding-inline: 20px; }
  
  /* Stack Layouts */
  .hero, .feature-row, .grid-2, .persona-layout { grid-template-columns: 1fr; gap: 48px; }
  .feature-row.reverse { direction: ltr; }
  
  /* Toggle Button Visible */
  .mobile-toggle { display: block; }
  
  /* Mobile Drawer Logic */
  .nav-group {
    display: none; /* Hide default nav group on mobile */
    position: absolute;
    top: 100%; /* Right below header */
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column; /* Stack items */
    align-items: flex-start;
    padding: 24px;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
  }
  
  /* When class 'open' is added via JS */
  .nav-group.open { display: flex; }
  
  /* Adjust Dropdown for Mobile */
  .dropdown-wrapper { width: 100%; }
  .dropdown-trigger { width: 100%; justify-content: space-between; padding: 8px 0; }
  .dropdown-menu {
    position: static; /* Flow naturally */
    width: 100%;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--border-subtle);
    opacity: 1;
    visibility: visible;
    transform: none;
    padding-left: 12px;
    margin-top: 8px;
  }
  
  /* Fix Diagrams Overflow */
  .system-diagram, .schematic-box { padding: 24px; width: 100%; }
  .diagram-card { min-width: auto; width: 100%; margin-left: 12px; }
  .pipeline-rail { overflow-x: auto; padding-bottom: 8px; } /* Allow swipe if rail is huge */
}