/* ==========================================================================
   MermAid Brand Design System (Astys Operational Engine) - Light Theme
   ========================================================================== */

:root {
  /* Slate Light Palette */
  --color-bg-darkest: #f8fafc; /* Slate 50 */
  --color-bg-dark: #ffffff;
  --color-bg-card: rgba(255, 255, 255, 0.75);
  --color-bg-card-hover: rgba(255, 255, 255, 0.95);
  --color-border: rgba(15, 23, 42, 0.08); /* Slate 900 with low opacity */
  --color-border-hover: rgba(15, 23, 42, 0.15);
  
  --color-text-main: #0f172a; /* Slate 900 */
  --color-text-muted: #475569; /* Slate 600 */
  --color-text-dark: #64748b; /* Slate 500 */
  
  /* Brand Gradients */
  --gradient-brand: linear-gradient(135deg, #8250df 0%, #0969da 50%, #06b6d4 100%);
  --gradient-text: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #475569 100%);
  --gradient-glow: radial-gradient(circle, rgba(130, 80, 223, 0.06) 0%, transparent 70%);

  /* Functional Status Colors */
  --color-success: #09a67a;
  --color-warning: #f59e0b;
  --color-danger: #cf222e;
  --color-info: #0969da;

  /* Role-Based Semantic Accent Tokens */
  --color-role-admin: #8250df;
  --color-role-supervisor: #cf222e;
  --color-role-engineer: #0969da;
  --color-role-accountant: #09a67a;
  --color-role-sales: #f59e0b;
  --color-role-hr: #db2777;
  --color-role-architect: #06b6d4;

  /* Typography */
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout and Transition Spacers */
  --container-max-width: 1200px;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Glassmorphic Rules */
  --glass-blur: blur(12px);
  --glass-shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.08);
  
  /* Dynamic Active Role Color (Manipulated via JS) */
  --color-role-active: var(--color-role-admin);
  --color-role-active-rgb: 130, 80, 223;
}

/* ==========================================================================
   Resets and Global Layout Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--color-bg-darkest);
  color: var(--color-text-main);
  font-family: var(--font-body);
}

body {
  overflow-x: hidden;
  line-height: 1.6;
  position: relative;
  background-color: var(--color-bg-darkest);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-darkest);
}
::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-role-active);
}

/* Common Typography Styling */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

p {
  color: var(--color-text-muted);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-accent-glow {
  background: linear-gradient(90deg, #0969da, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.2));
}

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

/* Glassmorphic Panel Base */
.glass-panel {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 16px;
  transition: var(--transition-smooth);
}

/* ==========================================================================
   Background Decorative Glow Spheres
   ========================================================================== */
.bg-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(150px);
  opacity: 0.08;
  transition: all 0.8s ease;
}

.bg-glow-role-active {
  top: -100px;
  right: 5%;
  background: radial-gradient(circle, var(--color-role-active) 0%, transparent 80%);
}

.bg-glow-secondary {
  top: 1500px;
  left: -200px;
  background: radial-gradient(circle, var(--color-role-engineer) 0%, transparent 80%);
  opacity: 0.04;
}

/* ==========================================================================
   Buttons and Indicators
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 600;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--color-role-active);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(var(--color-role-active-rgb), 0.2);
}
.btn-primary:hover {
  background: var(--color-text-main);
  color: var(--color-bg-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.15);
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.03);
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover {
  background: rgba(15, 23, 42, 0.07);
  border-color: var(--color-border-hover);
  transform: translateY(-2px);
}

.btn-gradient {
  background: var(--gradient-brand);
  color: #ffffff;
  border: none;
}
.btn-gradient:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 0.95rem 1.9rem;
  font-size: 1.05rem;
  border-radius: 10px;
}

.btn-xs {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

.btn-block {
  width: 100%;
}

/* Blink indicator for system logs */
.led-blink {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-role-active);
  box-shadow: 0 0 10px var(--color-role-active);
  animation: pulseLed 1.5s infinite;
}

@keyframes pulseLed {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  background-color: rgba(255, 255, 255, 0.8);
  transition: var(--transition-smooth);
}

.main-header.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  height: 70px;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 85px;
  transition: var(--transition-smooth);
}

.main-header.scrolled .header-container {
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  width: 170px;
  overflow: hidden;
  position: relative;
  transition: var(--transition-smooth);
}
.logo-img {
  position: absolute;
  height: 120px;
  width: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: var(--transition-smooth);
}
.main-header.scrolled .logo {
  height: 44px;
}
.main-header.scrolled .logo-img {
  height: 100px;
}
.logo:hover .logo-img {
  transform: translate(-50%, -50%) scale(1.05);
}

.nav-menu ul {
  display: flex;
  list-style: none;
  gap: 2.2rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  position: relative;
  padding: 0.5rem 0;
  letter-spacing: -0.01em;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-text-main);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--color-role-active);
  transition: var(--transition-smooth);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.header-ctas {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.status-shield {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.02);
  display: flex;
  align-items: center;
  gap: 6px;
}

.shield-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
}

/* Mobile Nav Menu Toggler */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 101;
}
.mobile-nav-toggle span {
  width: 100%;
  height: 2px;
  background-color: var(--color-text-main);
  border-radius: 2px;
  transition: var(--transition-smooth);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  padding: 180px 0 120px 0;
  position: relative;
  background: radial-gradient(80% 60% at 50% 0%, rgba(130, 80, 223, 0.04) 0%, transparent 100%), var(--color-bg-darkest);
  border-bottom: 1px solid var(--color-border);
}

.hero-container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 4rem;
  align-items: center;
}

.badge-wrapper {
  margin-bottom: 1.5rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(130, 80, 223, 0.06);
  border: 1px solid rgba(130, 80, 223, 0.15);
  color: #8250df;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8250df;
  box-shadow: 0 0 6px #8250df;
  animation: pulseLed 1.2s infinite;
}

.hero-title {
  font-size: 3.8rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.035em;
  font-weight: 900;
}

.hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 580px;
  color: var(--color-text-muted);
}

.hero-ctas {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 4rem;
}

.play-icon {
  margin-right: 8px;
  color: var(--color-role-engineer);
}

.hero-trust p {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1.25rem;
  color: var(--color-text-dark);
  font-weight: 700;
}

.logo-grid {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.trust-logo {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  background: rgba(15, 23, 42, 0.02);
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  transition: var(--transition-fast);
}
.trust-logo:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-main);
  transform: translateY(-1px);
}

/* Dashboard Mock Window CSS */
.hero-visual {
  width: 100%;
}

.dashboard-window {
  width: 100%;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.dashboard-window:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 50px -15px rgba(15, 23, 42, 0.1);
}

.window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.02);
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.window-buttons {
  display: flex;
  gap: 6px;
}
.window-buttons .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: var(--color-danger); }
.dot-yellow { background: var(--color-warning); }
.dot-green { background: var(--color-success); }

.window-title {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 600;
  font-family: var(--font-mono);
}

.window-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(9, 166, 122, 0.1);
  color: var(--color-success);
  font-weight: 700;
  font-family: var(--font-mono);
}

.window-body {
  display: flex;
  height: 380px;
}

.mini-sidebar {
  width: 50px;
  border-right: 1px solid var(--color-border);
  background: rgba(15, 23, 42, 0.01);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0;
  gap: 1.75rem;
}

.sidebar-item {
  color: var(--color-text-dark);
  cursor: pointer;
  transition: var(--transition-fast);
}
.sidebar-item:hover, .sidebar-item.active {
  color: var(--color-role-active);
}

.mini-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.02);
}

.mini-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.kudos-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--color-role-sales);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.mini-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mini-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-label {
  font-size: 0.6rem;
  color: var(--color-text-dark);
  margin-bottom: 0.25rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.card-val-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.card-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.trend {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
}
.trend-up { color: var(--color-success); }
.trend-ok { color: var(--color-info); }
.trend-warning { color: var(--color-warning); }

.mini-graph-card {
  flex-grow: 1;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.graph-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.graph-legends {
  display: flex;
  gap: 0.75rem;
}

.legend {
  display: flex;
  align-items: center;
  gap: 4px;
}
.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.graph-plot {
  flex-grow: 1;
  position: relative;
  display: flex;
  align-items: flex-end;
}
.graph-svg {
  width: 100%;
  height: 130px;
}

/* ==========================================================================
   Section Layout General Styles
   ========================================================================== */
section {
  padding: 110px 0;
  position: relative;
}

.section-header {
  max-width: 750px;
  margin: 0 auto 5rem auto;
}

.section-label {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-role-active);
  margin-bottom: 0.75rem;
  display: block;
  font-family: var(--font-mono);
}

.section-title {
  font-size: 2.8rem;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.section-desc {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Role-Selector Tab Section
   ========================================================================== */
.roles-section {
  background: linear-gradient(180deg, var(--color-bg-darkest) 0%, var(--color-bg-dark) 100%);
  border-bottom: 1px solid var(--color-border);
}

.roles-grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 4rem;
  align-items: flex-start;
}

.role-tabs-container {
  display: flex;
  flex-direction: column;
}

.role-tabs-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.role-tab {
  background: rgba(15, 23, 42, 0.01);
  border: 1px solid var(--color-border);
  padding: 1.15rem 1.5rem;
  border-radius: 12px;
  color: var(--color-text-muted);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.role-tab::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: var(--transition-smooth);
}

.role-tab:hover {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.15);
  color: var(--color-text-main);
  transform: translateX(4px);
}

.role-tab.active {
  background: rgba(15, 23, 42, 0.05);
  border-color: var(--color-border-hover);
  color: var(--color-text-main);
  box-shadow: 0 4px 20px -5px rgba(15, 23, 42, 0.05);
}

.role-tab.active::after {
  background: var(--color-role-active);
}

/* Tabs Accent Border Colors on Selection */
#tab-admin.active::after { background: var(--color-role-admin); }
#tab-supervisor.active::after { background: var(--color-role-supervisor); }
#tab-engineer.active::after { background: var(--color-role-engineer); }
#tab-accountant.active::after { background: var(--color-role-accountant); }
#tab-sales.active::after { background: var(--color-role-sales); }
#tab-hr.active::after { background: var(--color-role-hr); }
#tab-architect.active::after { background: var(--color-role-architect); }

.role-emoji {
  font-size: 1.3rem;
  display: inline-block;
  transition: transform 0.3s ease;
}
.role-tab:hover .role-emoji {
  transform: scale(1.2) rotate(5deg);
}

/* Workspace Preview Panel CSS */
.role-display-container {
  position: relative;
}

.role-display-card {
  width: 100%;
  min-height: 400px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  border: 1px solid var(--color-border);
}

.card-inner-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-role-active) 0%, transparent 70%);
  filter: blur(100px);
  opacity: 0.05;
  top: -150px;
  right: -150px;
  pointer-events: none;
  transition: all 0.8s ease;
}

.role-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.role-meta {
  max-width: 80%;
}

.role-pill {
  display: inline-block;
  background: rgba(15, 23, 42, 0.02);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-role-active);
  border: 1px solid rgba(var(--color-role-active-rgb), 0.2);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.role-desc-text {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  display: block;
}

.role-card-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-sys-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-dark);
}

/* Workspace Preview Panel Body content */
.role-card-body {
  position: relative;
  min-height: 250px;
}

.mock-workspace-content {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.mock-workspace-content.active {
  opacity: 1;
  position: relative;
  transform: translateY(0);
  pointer-events: auto;
}

/* Sub-Dashboard layouts within tab selections */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.admin-panel-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
}
.admin-panel-card h4 {
  font-size: 0.9rem;
  color: var(--color-text-main);
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  padding-bottom: 0.5rem;
  font-family: var(--font-title);
}

.admin-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.admin-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}
.badge-success {
  background: rgba(9, 166, 122, 0.1);
  color: var(--color-success);
}
.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.points-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.points-feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
  background: rgba(15, 23, 42, 0.02);
  border-radius: 4px;
  font-family: var(--font-mono);
}
.feed-time {
  color: var(--color-text-dark);
}
.feed-desc {
  color: var(--color-text-muted);
  flex-grow: 1;
  margin: 0 1rem;
}
.feed-points {
  font-weight: 700;
}
.points-add {
  color: var(--color-success);
}

/* ==========================================================================
   19-Stage Project Lifecycle Visual Timeline Section
   ========================================================================== */
.lifecycle-section {
  border-bottom: 1px solid var(--color-border);
}

.lifecycle-wrapper {
  padding: 2.5rem;
  background: rgba(255, 255, 255, 0.4);
}

.level-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 1.5rem;
}

.level-tab-btn {
  background: rgba(15, 23, 42, 0.01);
  border: 1px solid var(--color-border);
  padding: 0.95rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--color-text-muted);
}

.level-tab-btn:hover {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.1);
}

.level-tab-btn.active {
  background: rgba(130, 80, 223, 0.04);
  border-color: var(--color-role-active);
  color: var(--color-text-main);
  box-shadow: 0 4px 15px -5px rgba(var(--color-role-active-rgb), 0.15);
}

.lvl-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  color: var(--color-role-active);
}

.lvl-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
}

.timeline-container {
  overflow-x: auto;
  padding: 1rem 0;
  margin-bottom: 2.5rem;
  display: flex;
}

.timeline-track {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 1rem;
  width: max-content;
}

.stage-card {
  width: 250px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.stage-card:hover {
  border-color: var(--color-role-active);
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 20px -10px rgba(15, 23, 42, 0.1);
}

.stage-card.active {
  border-color: var(--color-role-active);
  box-shadow: 0 0 20px -5px rgba(var(--color-role-active-rgb), 0.2);
  background: rgba(130, 80, 223, 0.02);
}

.stage-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 0.5rem;
}

.stage-card.active .stage-num {
  color: var(--color-role-active);
}

.stage-card h4 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.stage-card p {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.role-badge-sm {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

/* Level Color Accents for stage badges */
.arch-bg { background: rgba(6, 182, 212, 0.1); color: var(--color-role-architect); }
.acc-bg { background: rgba(9, 166, 122, 0.1); color: var(--color-role-accountant); }
.sup-bg { background: rgba(207, 34, 46, 0.1); color: var(--color-role-supervisor); }
.eng-bg { background: rgba(9, 105, 218, 0.1); color: var(--color-role-engineer); }
.sys-bg { background: rgba(130, 80, 223, 0.1); color: var(--color-role-admin); }

/* Confetti element */
.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.confetti-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0;
}

/* Requirements list below timeline */
.timeline-checklist-box {
  background: rgba(15, 23, 42, 0.01);
  border-top: 1px solid var(--color-border);
  padding-top: 2rem;
  margin-top: 1rem;
}

.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.checklist-header h3 {
  font-size: 1.25rem;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: relative;
  width: 44px;
  height: 22px;
  background-color: var(--color-text-dark);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-role-active);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

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

.checklist-questions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}

.checklist-questions.collapsed {
  max-height: 0px !important;
  padding: 0;
}

.question-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  padding: 1rem;
  border-radius: 8px;
}

.question-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-role-active);
}

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

/* ==========================================================================
   Features Highlights Grid & Interactive Widgets
   ========================================================================== */
.features-section {
  border-bottom: 1px solid var(--color-border);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.feature-card-interactive {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
}

.card-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

.bg-teal-icon { background: var(--color-role-accountant); box-shadow: 0 4px 15px rgba(9, 166, 122, 0.2); }
.bg-purple-icon { background: var(--color-role-admin); box-shadow: 0 4px 15px rgba(130, 80, 223, 0.2); }
.bg-amber-icon { background: var(--color-role-sales); box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2); }
.bg-red-icon { background: var(--color-role-supervisor); box-shadow: 0 4px 15px rgba(207, 34, 46, 0.2); }

.feature-card-interactive h3 {
  font-size: 1.45rem;
  margin-bottom: 0.5rem;
}

.feat-sub {
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* A. Vendor Matrix Widget */
.vendor-matrix-widget {
  background: rgba(15, 23, 42, 0.01);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
}

.vendor-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: var(--transition-fast);
}

.vendor-row:hover {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.15);
}

.vendor-row.selected {
  border-color: var(--color-role-accountant);
  background: rgba(9, 166, 122, 0.05);
}

.v-radio {
  display: flex;
  align-items: center;
  gap: 10px;
}
.v-radio input {
  accent-color: var(--color-role-accountant);
  width: 16px;
  height: 16px;
}

.v-lead {
  font-size: 0.75rem;
  color: var(--color-text-dark);
}

.v-price {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.matrix-summary {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  border-top: 1px solid var(--color-border);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
}

/* B. Leaderboard Widget */
.leaderboard-widget {
  background: rgba(15, 23, 42, 0.01);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: auto;
}

.leaderboard-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-role-admin);
  font-weight: 700;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 0.65rem 1rem;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.85rem;
}

.leaderboard-item.user-highlight {
  border-color: var(--color-role-admin);
  background: rgba(130, 80, 223, 0.05);
}

.l-rank {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-text-dark);
  width: 30px;
}

.user-highlight .l-rank {
  color: var(--color-role-admin);
}

.l-name {
  flex-grow: 1;
  color: var(--color-text-main);
  font-weight: 500;
}

.l-points {
  font-family: var(--font-mono);
  font-weight: 700;
}

/* C. CRM Kanban Widget */
.kanban-widget {
  background: rgba(15, 23, 42, 0.01);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: auto;
}

.kanban-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.kanban-col-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-role-sales);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 120px;
}

.kanban-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem;
  cursor: grab;
  transition: var(--transition-fast);
}

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

.kanban-card h5 {
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.k-val {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.k-btn-move {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
}

.card-completed {
  border-color: rgba(9, 166, 122, 0.25);
  background: rgba(9, 166, 122, 0.02);
}

.k-status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-success);
  font-weight: 700;
}

/* D. Snag Log Widget */
.snag-log-widget {
  background: rgba(15, 23, 42, 0.01);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: auto;
}

.snag-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 220px;
  overflow-y: auto;
}

.snag-item {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem;
  transition: all 0.3s ease;
}

.snag-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.snag-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.snag-badge.red { background: rgba(207, 34, 46, 0.1); color: var(--color-danger); }
.snag-badge.yellow { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); }

.snag-loc {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-text-dark);
}

.snag-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

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

.proof-tag, .proof-tag-pending {
  font-family: var(--font-mono);
  font-size: 0.65rem;
}
.proof-tag { color: var(--color-success); }
.proof-tag-pending { color: var(--color-warning); }

/* ==========================================================================
   Operational Statistics Section
   ========================================================================== */
.stats-section {
  background: linear-gradient(180deg, var(--color-bg-dark) 0%, var(--color-bg-darkest) 100%);
}

.stats-container {
  padding: 4rem 3rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
}

.stat-card {
  text-align: center;
}

.stat-num {
  font-family: var(--font-title);
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.75rem;
  letter-spacing: -0.04em;
}

.stat-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-title);
}

.stat-card p {
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ==========================================================================
   Points Notification Toast Alert
   ========================================================================== */
.points-toast-alert {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 280px;
  z-index: 120;
  overflow: hidden;
  border-color: var(--color-warning);
  transform: translateX(-350px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--glass-shadow);
  pointer-events: none;
}

.points-toast-alert.active {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-content {
  display: flex;
  padding: 1rem 1.25rem;
  align-items: center;
  gap: 12px;
}

.toast-icon {
  font-size: 1.8rem;
  animation: bounceItem 1s infinite alternate;
}

@keyframes bounceItem {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.toast-text h5 {
  font-size: 0.95rem;
  color: var(--color-text-main);
  margin-bottom: 0.15rem;
}

.toast-text p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.toast-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(0,0,0,0.05);
}

.toast-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-warning);
}

/* ==========================================================================
   Footer Section
   ========================================================================== */
.main-footer {
  background-color: #ffffff;
  border-top: 1px solid var(--color-border);
  padding: 5rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 0.87fr);
  gap: 4rem;
}

.footer-brand .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  width: 170px;
  overflow: hidden;
  position: relative;
  margin-bottom: 1.5rem;
}

.main-footer .logo-img {
  position: absolute;
  height: 120px;
  width: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.brand-desc {
  font-size: 0.8rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  color: var(--color-text-dark);
}

.copyright {
  font-size: 0.75rem;
  color: var(--color-text-dark);
  font-family: var(--font-mono);
}

.footer-links-col h4 {
  font-size: 0.9rem;
  color: var(--color-text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
}

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

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

.footer-links-col a:hover {
  color: var(--color-role-active);
}

/* ==========================================================================
   Responsive Viewports & Breakpoint Rules
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 3.5rem;
    text-align: center;
  }
  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-ctas {
    justify-content: center;
  }
  .logo-grid {
    justify-content: center;
  }
  .roles-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .role-tabs-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .role-tab {
    font-size: 0.95rem;
    padding: 0.75rem 1.15rem;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  section {
    padding: 70px 0;
  }
  .hero-section {
    padding-top: 140px;
  }
  .hero-title {
    font-size: 2.6rem;
  }
  .section-title {
    font-size: 2rem;
  }
  .mobile-nav-toggle {
    display: flex;
  }
  .nav-menu {
    position: absolute;
    top: 85px;
    left: 0;
    width: 100%;
    background-color: var(--color-bg-darkest);
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
  }
  .main-header.scrolled .nav-menu {
    top: 70px;
  }
  .nav-menu.active {
    max-height: 300px;
  }
  .nav-menu ul {
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 1.25rem;
  }
  .header-ctas {
    display: none;
  }
  .level-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .level-tab-btn[data-level="5"] {
    grid-column: span 2;
  }
  .checklist-questions {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* Timeline animations for particles */
@keyframes explode {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--x), var(--y)) scale(0);
    opacity: 0;
  }
}
