/* =========================================================
   CLINIC QUEUE MANAGEMENT SYSTEM — DARK MEDICAL-TECH THEME
   ========================================================= */
:root {
  --bg-deep: #0A1324;
  --bg-surface: #0F1B33;
  --bg-panel: rgba(15, 27, 51, 0.72);
  --bg-panel-solid: #12203B;
  --border-subtle: rgba(56, 189, 248, 0.16);
  --border-strong: rgba(56, 189, 248, 0.38);

  --cyan: #38BDF8;
  --cyan-deep: #0EA5E9;
  --emerald: #10B981;
  --amber: #F59E0B;
  --danger: #EF4444;

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-glow: 0 18px 50px rgba(2, 6, 23, 0.65), 0 0 36px rgba(14, 165, 233, 0.08);
  --transition: 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-deep);
  overflow-x: hidden;
  line-height: 1.6;
}

body.locked {
  overflow: hidden;
  height: 100vh;
}

body.locked .top-nav,
body.locked .slide-controls,
body.locked .presentation-main {
  filter: blur(14px) brightness(0.45);
  pointer-events: none;
  user-select: none;
}

code, pre, kbd {
  font-family: var(--font-mono);
}

code {
  background: rgba(56, 189, 248, 0.1);
  color: var(--cyan);
  padding: 0.14em 0.45em;
  border-radius: 6px;
  font-size: 0.88em;
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  font-size: 0.78rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
}

/* Ambient Background */
.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(56, 189, 248, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 35%, black 35%, transparent 85%);
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.45;
}

.bg-glow-1 {
  width: 520px;
  height: 520px;
  top: -140px;
  left: -120px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.38), transparent 70%);
}

.bg-glow-2 {
  width: 560px;
  height: 560px;
  bottom: -160px;
  right: -120px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.24), transparent 70%);
}

.bg-glow-3 {
  width: 420px;
  height: 420px;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12), transparent 70%);
}

/* Glass Panel Utility */
.glass-panel {
  background: linear-gradient(155deg, rgba(18, 32, 59, 0.85), rgba(10, 19, 36, 0.82));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glow);
}

/* =========================================================
   0. PIN LOCK SCREEN OVERLAY
   ========================================================= */
.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 30%, rgba(15, 27, 51, 0.86), rgba(6, 12, 24, 0.94));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s ease;
}

.pin-overlay.unlocking {
  opacity: 0;
  transform: scale(1.03);
  visibility: hidden;
  pointer-events: none;
}

.pin-overlay.hidden {
  display: none;
}

.pin-bg-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.geo-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.14);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.geo-ring-1 {
  width: 520px;
  height: 520px;
  animation: spinSlow 45s linear infinite;
  border-style: dashed;
}

.geo-ring-2 {
  width: 760px;
  height: 760px;
  border-color: rgba(16, 185, 129, 0.08);
}

.geo-hex {
  position: absolute;
  width: 340px;
  height: 340px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1px solid rgba(56, 189, 248, 0.09);
  border-radius: 36px;
}

@keyframes spinSlow {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.pin-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 36px 28px 28px;
  text-align: center;
  border-color: rgba(56, 189, 248, 0.28);
}

.pin-card.shake {
  animation: pinShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes pinShake {
  10%, 90% { transform: translateX(-4px); }
  20%, 80% { transform: translateX(7px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.pulse-dot,
.pill-dot,
.brand-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
  display: inline-block;
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

.lock-icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(14, 165, 233, 0.06));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--cyan);
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.18);
}

.lock-svg {
  width: 30px;
  height: 30px;
}

.pin-title {
  margin: 0 0 8px;
  font-size: 1.48rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.pin-subtitle {
  margin: 0 0 24px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.pin-inputs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.pin-digit {
  width: 100%;
  aspect-ratio: 1 / 1.15;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(10, 19, 36, 0.82);
  border: 1.5px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.pin-digit:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
}

.pin-digit.filled {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(14, 165, 233, 0.08);
}

.pin-digit.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.pin-error {
  min-height: 22px;
  margin: 4px 0 16px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #FCA5A5;
}

.btn-unlock {
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  font-size: 0.98rem;
}

.pin-footer-meta {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* =========================================================
   BUTTONS & BADGES
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.btn-sm {
  padding: 9px 15px;
  font-size: 0.85rem;
  border-radius: 10px;
}

.btn-xs {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-deep));
  color: #061224;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.42);
}

.btn-secondary {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.32);
  color: var(--cyan);
}

.btn-secondary:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.btn-emerald {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #041A13;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.25);
}

.btn-emerald:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.38);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #FCA5A5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: var(--danger);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.badge-perf {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: #34D399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.38);
}

.badge-cyan {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
}

.badge-linear {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: #FBBF24;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.34);
}

/* =========================================================
   TOP NAVIGATION BAR & SLIDE CONTROLS
   ========================================================= */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: rgba(10, 19, 36, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.98rem;
  white-space: nowrap;
}

.brand-accent {
  color: var(--cyan);
  font-family: var(--font-mono);
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar { display: none; }

.nav-link {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slide-counter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.counter-sep { color: var(--text-muted); margin: 0 2px; }

.icon-btn,
.lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover,
.lock-btn:hover {
  color: var(--cyan);
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.1);
}

.progress-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
  width: 100%;
}

.progress-fill {
  height: 100%;
  width: 9%;
  background: linear-gradient(90deg, var(--cyan), var(--emerald));
  transition: width 0.25s ease;
}

/* Bottom Slide Controls */
.slide-controls {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 450;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(10, 19, 36, 0.86);
  border: 1px solid rgba(56, 189, 248, 0.22);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.6);
}

.ctrl-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(56, 189, 248, 0.08);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.ctrl-btn:hover:not(:disabled) {
  background: var(--cyan);
  color: #061224;
}

.ctrl-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.slide-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(148, 163, 184, 0.35);
  cursor: pointer;
  transition: all 0.25s ease;
}

.slide-dot.active {
  width: 22px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.65);
}

/* =========================================================
   SECTIONS & TYPOGRAPHY
   ========================================================= */
.presentation-main {
  position: relative;
  z-index: 1;
}

.slide-section {
  min-height: 100vh;
  padding: 96px 20px 92px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(56, 189, 248, 0.06);
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 44px;
}

.section-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--cyan);
  margin-bottom: 10px;
}

.section-title {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.18;
  color: var(--text-primary);
}

.section-subtitle {
  margin: 0;
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: var(--text-secondary);
}

.mono-tag {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 0.92rem;
}

.slide-footer-note {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-muted);
  text-align: center;
}

.note-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* =========================================================
   SECTION 1: HERO SLIDE
   ========================================================= */
.hero-slide {
  padding-top: 108px;
}

.hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(15, 27, 51, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-bottom: 22px;
}

.hero-tagline {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--emerald);
}

.hero-title {
  margin: 0 0 18px;
  font-size: clamp(2.4rem, 5.8vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.text-gradient {
  background: linear-gradient(125deg, #38BDF8 0%, #60A5FA 50%, #10B981 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 auto 28px;
  max-width: 680px;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--text-secondary);
  font-style: italic;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 34px;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(15, 27, 51, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.18);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 28px;
}

.hero-faculty {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* =========================================================
   SECTION 2: TEAM GRID (GROUP 24)
   ========================================================= */
.team-leader-row {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.team-members-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.team-card {
  position: relative;
  padding: 26px 18px 22px;
  text-align: center;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.team-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 44px rgba(2, 6, 23, 0.75), 0 0 28px rgba(56, 189, 248, 0.16);
}

.team-card-leader {
  width: 100%;
  max-width: 340px;
  border-color: rgba(56, 189, 248, 0.42);
  background: linear-gradient(160deg, rgba(19, 37, 68, 0.92), rgba(10, 19, 36, 0.88));
}

.card-glow-ring {
  position: absolute;
  inset: -40% -20% auto;
  height: 180px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18), transparent 70%);
  pointer-events: none;
}

.role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  margin-bottom: 16px;
}

.role-leader {
  color: #34D399;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.4);
}

.avatar-frame {
  width: 132px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid var(--cyan);
  padding: 3px;
  background: var(--bg-deep);
  overflow: hidden;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.24);
}

.avatar-leader {
  width: 150px;
  border-width: 3.5px;
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.34);
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  transform: scale(1.07);
}

.member-name {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.member-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.member-group {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
}

/* =========================================================
   SECTIONS 3, 4, 5: FEATURE & PILLAR CARDS
   ========================================================= */
.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.feature-card {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
}

.feature-card-highlight {
  border-color: rgba(16, 185, 129, 0.36);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.num-badge {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 6px 14px;
  border-radius: 12px;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 1.22rem;
  font-weight: 700;
}

.feature-card p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  flex: 1;
}

.card-tag-line,
.req-footer {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.req-badge {
  align-self: flex-start;
  margin-bottom: 16px;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.pillar-card {
  padding: 30px;
  transition: transform var(--transition), border-color var(--transition);
}

.pillar-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.pillar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.pillar-code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan);
}

.pillar-card h3 {
  margin: 0 0 10px;
  font-size: 1.32rem;
}

.pillar-card p {
  margin: 0 0 18px;
  color: var(--text-secondary);
}

.pillar-code-snippet {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(6, 12, 24, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.18);
  overflow-x: auto;
}

.pillar-code-snippet code {
  background: none;
  padding: 0;
  font-size: 0.84rem;
}

/* =========================================================
   SECTION 6: MEMORY ARCHITECTURE DIAGRAM
   ========================================================= */
.memory-diagram-panel {
  padding: 32px 28px;
}

.diagram-scroll-wrap {
  overflow-x: auto;
  padding: 12px 4px 20px;
}

.diagram-canvas {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 760px;
  gap: 8px;
}

.diag-node-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ptr-tag {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 4px;
  min-height: 70px;
  justify-content: flex-end;
}

.ptr-spacer {
  min-height: 70px;
}

.ptr-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 3px 12px;
  border-radius: 8px;
}

.ptr-front .ptr-label {
  color: #34D399;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.ptr-rear .ptr-label {
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.ptr-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 3px 0 2px;
}

.mem-node {
  width: 210px;
  border-radius: 14px;
  background: rgba(10, 19, 36, 0.92);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.55);
}

.mem-node.node-head {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.16);
}

.mem-node.node-tail {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.16);
}

.mem-node-addr {
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mem-node-body {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
}

.mem-data,
.mem-next {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mem-data {
  border-right: 1px solid rgba(255, 255, 255, 0.09);
}

.mem-data strong {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.mem-field-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mem-next code {
  font-size: 0.76rem;
  align-self: flex-start;
}

.null-code {
  color: #FCA5A5 !important;
  background: rgba(239, 68, 68, 0.14) !important;
}

.diag-link {
  padding-bottom: 24px;
  display: flex;
  align-items: center;
}

.nullptr-box {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px dashed rgba(148, 163, 184, 0.4);
  background: rgba(10, 19, 36, 0.6);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nullptr-box span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.diagram-legend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 20px;
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.legend-item p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.dot-green { background: var(--emerald); box-shadow: 0 0 10px var(--emerald); }
.dot-cyan { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

.invariant-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.invariant-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #34D399;
}

/* =========================================================
   SECTION 7: COMPLEXITY TABLE
   ========================================================= */
.table-card {
  padding: 8px;
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
}

.complexity-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.complexity-table th {
  text-align: left;
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.06);
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
}

.complexity-table td {
  padding: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 0.93rem;
  vertical-align: middle;
}

.complexity-table tbody tr:last-child td {
  border-bottom: none;
}

.complexity-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.04);
}

.op-name {
  display: block;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
}

.op-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.edge-cell {
  color: var(--text-muted);
}

/* =========================================================
   SECTION 8: CONSOLE WORKFLOW
   ========================================================= */
.workflow-layout {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 24px;
  align-items: stretch;
}

.workflow-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wf-step {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15, 27, 51, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.16);
  color: var(--text-primary);
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.wf-step:hover,
.wf-step.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--cyan);
  transform: translateX(4px);
}

.wf-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--cyan);
  min-width: 104px;
}

.wf-arrow {
  color: var(--text-muted);
}

.wf-action {
  font-weight: 600;
  flex: 1;
}

.console-window {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.console-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(6, 12, 24, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.win-dots {
  display: flex;
  gap: 6px;
}

.win-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-r { background: #EF4444; }
.dot-y { background: #F59E0B; }
.dot-g { background: #10B981; }

.console-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.console-body {
  margin: 0;
  padding: 20px;
  font-size: 0.86rem;
  line-height: 1.65;
  color: #E2E8F0;
  overflow-x: auto;
  flex: 1;
}

.console-body code {
  background: none;
  color: inherit;
  padding: 0;
}

/* =========================================================
   SECTION 9: LIVE LINKED-LIST SIMULATOR
   ========================================================= */
.simulator-shell {
  padding: 24px;
}

.sim-controls-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr 1.2fr;
  gap: 16px;
  margin-bottom: 18px;
}

.sim-control-group {
  padding: 14px;
  border-radius: 14px;
  background: rgba(10, 19, 36, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.16);
}

.control-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.input-row,
.action-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sim-control-group input {
  flex: 1;
  min-width: 90px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  background: rgba(15, 27, 51, 0.9);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  outline: none;
}

.sim-control-group input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.sim-telemetry {
  display: grid;
  grid-template-columns: repeat(4, auto) 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(6, 12, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
  align-items: center;
}

.tele-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tele-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tele-val {
  font-size: 0.84rem;
  font-weight: 700;
}

.val-green { color: #34D399 !important; background: rgba(16, 185, 129, 0.14) !important; }
.val-cyan { color: var(--cyan) !important; }

.tele-msg {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.sim-stage-wrap {
  min-height: 190px;
  padding: 20px 14px;
  border-radius: 14px;
  background: rgba(6, 12, 24, 0.65);
  border: 1px dashed rgba(56, 189, 248, 0.25);
  overflow-x: auto;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.sim-canvas {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  margin: 0 auto;
}

.sim-empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
}

.sim-node {
  position: relative;
  width: 196px;
  border-radius: 14px;
  background: #0F1B33;
  border: 1.5px solid rgba(56, 189, 248, 0.38);
  padding: 10px 12px;
  transition: all 0.28s ease;
  animation: nodePop 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes nodePop {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.sim-node.is-front {
  border-color: var(--emerald);
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.2);
}

.sim-node.is-rear {
  border-color: var(--cyan);
}

.sim-node.is-scanning {
  border-color: var(--amber);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.35);
  transform: translateY(-4px);
}

.sim-node.is-found {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.14);
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.45);
  transform: translateY(-6px);
}

.sim-node-badges {
  display: flex;
  gap: 6px;
  min-height: 20px;
  margin-bottom: 6px;
}

.ptr-chip {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.ptr-chip-front {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.ptr-chip-rear {
  background: rgba(56, 189, 248, 0.18);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.sim-node-addr {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sim-node-name {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text-primary);
  margin: 4px 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sim-node-id {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
}

.sim-node-next {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sim-arrow {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
}

.sim-nullptr {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #FCA5A5;
}

.sim-log-panel {
  border-radius: 12px;
  background: rgba(6, 12, 24, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sim-log-header {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.sim-log-list {
  max-height: 118px;
  overflow-y: auto;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.log-entry {
  color: var(--text-secondary);
}

.log-entry .log-time { color: var(--text-muted); margin-right: 8px; }
.log-entry.log-ok { color: #34D399; }
.log-entry.log-warn { color: #FBBF24; }
.log-entry.log-err { color: #FCA5A5; }

/* =========================================================
   SECTION 10: C++ CODE SHOWCASE
   ========================================================= */
.code-showcase {
  overflow: hidden;
}

.code-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(6, 12, 24, 0.82);
  border-bottom: 1px solid rgba(56, 189, 248, 0.16);
}

.code-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.code-tab {
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.code-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.code-tab.active {
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.34);
}

.code-pre {
  margin: 0;
  padding: 22px;
  overflow-x: auto;
  max-height: 430px;
  font-size: 0.84rem;
  line-height: 1.62;
  color: #E2E8F0;
}

.code-pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.tok-kw { color: #38BDF8; font-weight: 600; }
.tok-type { color: #34D399; }
.tok-str { color: #FBBF24; }
.tok-cmt { color: #64748B; font-style: italic; }
.tok-num { color: #C084FC; }

/* =========================================================
   SECTION 11: CONCLUSION & Q&A
   ========================================================= */
.conclusion-card {
  padding: 44px 36px;
  text-align: center;
}

.conclusion-title {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 3.8vw, 2.9rem);
  font-weight: 800;
}

.conclusion-subtitle {
  margin: 0 auto 32px;
  max-width: 680px;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.takeaways-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 32px;
  text-align: left;
}

.takeaway-box {
  padding: 20px;
  border-radius: 14px;
  background: rgba(10, 19, 36, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.16);
}

.takeaway-box h4 {
  margin: 12px 0 6px;
  font-size: 1.05rem;
}

.takeaway-box p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.qa-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.3);
  text-align: left;
}

.qa-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qa-text strong { font-size: 1.08rem; }
.qa-text span { font-size: 0.86rem; color: var(--text-secondary); }

.qa-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================================================
   SECTION 12: CLOSING VIDEO FINALE
   ========================================================= */
.outro-video-card {
  max-width: 780px;
  margin: 0 auto;
  padding: 20px;
}

.outro-video-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #040914;
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 12px 36px rgba(2, 6, 23, 0.7), 0 0 28px rgba(56, 189, 248, 0.14);
}

.outro-video {
  width: 100%;
  max-height: 62vh;
  display: block;
  background: #040914;
  outline: none;
}

.outro-video-bar {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.outro-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.outro-caption {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.outro-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================================================
   RESPONSIVE BREAKPOINTS (MOBILE-FIRST FRIENDLY)
   ========================================================= */
@media (max-width: 1040px) {
  .team-members-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sim-controls-grid {
    grid-template-columns: 1fr;
  }
  .sim-telemetry {
    grid-template-columns: repeat(2, 1fr);
  }
  .tele-status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .cards-grid-3,
  .pillars-grid,
  .workflow-layout,
  .takeaways-grid,
  .diagram-legend-grid {
    grid-template-columns: 1fr;
  }
  .slide-section {
    padding: 86px 16px 86px;
  }
}

@media (max-width: 560px) {
  .team-members-grid {
    grid-template-columns: 1fr;
  }
  .pin-card {
    padding: 28px 18px 22px;
  }
  .pin-inputs {
    gap: 7px;
  }
  .pin-digit {
    font-size: 1.2rem;
    border-radius: 10px;
  }
  .slide-controls {
    bottom: 12px;
    padding: 6px 10px;
    gap: 6px;
  }
  .slide-dot {
    width: 6px;
    height: 6px;
  }
  .slide-dot.active {
    width: 16px;
  }
  .conclusion-card {
    padding: 28px 18px;
  }
  .lock-btn span {
    display: none;
  }
}
