/* =========================================
   DrowsyGuard — Premium Design System
   ========================================= */

:root {
  --bg-base: #050a14;
  --bg-surface: #0c1524;
  --bg-card: #0f1d30;
  --bg-card-hover: #162540;
  --border: rgba(0, 212, 255, 0.12);
  --border-hover: rgba(0, 212, 255, 0.3);

  --cyan: #00d4ff;
  --purple: #7b2ff7;
  --green: #22d45b;
  --red: #ff4757;
  --orange: #ff6b35;
  --yellow: #ffd32a;

  --grad-main: linear-gradient(135deg, #00d4ff 0%, #7b2ff7 100%);
  --grad-glow: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(123, 47, 247, 0.15));

  --text-primary: #f0f6ff;
  --text-secondary: #8da4c2;
  --text-muted: #4a6080;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-main: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  --shadow-glow: 0 0 40px rgba(0, 212, 255, 0.12);
  --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.5);
  --shadow-btn: 0 4px 20px rgba(0, 212, 255, 0.3);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── Animated Background ─────────────────── */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 10s ease-in-out infinite;
}

.orb-1 {
  width: 500px;
  height: 500px;
  top: -150px;
  left: -150px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.12) 0%, transparent 70%);
  animation-delay: 0s;
}

.orb-2 {
  width: 600px;
  height: 600px;
  bottom: -200px;
  right: -200px;
  background: radial-gradient(circle, rgba(123, 47, 247, 0.15) 0%, transparent 70%);
  animation-delay: -5s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 212, 255, 0.06) 0%, transparent 70%);
  animation-delay: -2.5s;
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -20px) scale(1.05);
  }

  66% {
    transform: translate(-20px, 30px) scale(0.95);
  }
}

/* ─── Header ──────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(5, 10, 20, 0.7);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo-accent {
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.08);
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.06);
  flex-shrink: 0;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* ─── Section Shared Styles ───────────────── */
section {
  position: relative;
  z-index: 1;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
  padding: 4px 14px;
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 100px;
  background: rgba(0, 212, 255, 0.06);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* ─── Hero Section ────────────────────────── */
.hero {
  min-height: 100vh;
  padding: 120px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
}

.hero-content {
  flex: 1;
  max-width: 580px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 24px;
}

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

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
}

.hero-desc strong {
  color: var(--cyan);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  background: var(--grad-main);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-btn);
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
}

.btn-primary .btn-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.3s;
}

.btn-primary:hover .btn-icon {
  transform: translateX(4px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  background: transparent;
  cursor: pointer;
}

.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.06);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* Hero Visual */
.hero-visual {
  flex-shrink: 0;
  width: 360px;
  height: 360px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.15);
  animation: ringPulse 4s ease-in-out infinite;
}

.visual-ring-1 {
  width: 100%;
  height: 100%;
  animation-delay: 0s;
}

.visual-ring-2 {
  width: 75%;
  height: 75%;
  border-color: rgba(123, 47, 247, 0.2);
  animation-delay: -1.3s;
}

.visual-ring-3 {
  width: 50%;
  height: 50%;
  border-color: rgba(0, 212, 255, 0.25);
  animation-delay: -2.6s;
}

@keyframes ringPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

.visual-icon-wrap {
  position: relative;
  z-index: 2;
  width: 120px;
  height: 120px;
  background: var(--grad-glow);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 60px rgba(0, 212, 255, 0.15), var(--shadow-card);
}

.visual-eye-icon {
  width: 70px;
  height: 70px;
  animation: eyeBlink 4s ease-in-out infinite;
}

@keyframes eyeBlink {

  0%,
  90%,
  100% {
    transform: scaleY(1);
  }

  95% {
    transform: scaleY(0.1);
  }
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: scanAnim 3s linear infinite;
  z-index: 3;
  box-shadow: 0 0 8px var(--cyan);
}

@keyframes scanAnim {
  0% {
    top: 10%;
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    top: 90%;
    opacity: 0;
  }
}

.visual-label {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  padding: 4px 12px;
  border-radius: 100px;
  white-space: nowrap;
}

/* ─── Detector Section ────────────────────── */
.detector-section {
  padding: 100px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.detector-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  align-items: start;
}

/* Camera Panel */
.camera-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.camera-panel:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow), var(--shadow-card);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--grad-glow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
}

.panel-icon svg {
  width: 18px;
  height: 18px;
}

.camera-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.danger {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: pulse 0.5s ease-in-out infinite;
}

.camera-container {
  position: relative;
  aspect-ratio: 16/9;
  background: #080f1a;
  overflow: hidden;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
}

.placeholder-icon {
  width: 80px;
  height: 80px;
  opacity: 0.5;
}

.placeholder-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.placeholder-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 280px;
  line-height: 1.5;
}

.camera-feed-wrap {
  position: absolute;
  inset: 0;
}

#webcam-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Scan Overlay */
.scan-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: var(--cyan);
  border-style: solid;
}

.corner-tl {
  top: 16px;
  left: 16px;
  border-width: 2px 0 0 2px;
}

.corner-tr {
  top: 16px;
  right: 16px;
  border-width: 2px 2px 0 0;
}

.corner-bl {
  bottom: 16px;
  left: 16px;
  border-width: 0 0 2px 2px;
}

.corner-br {
  bottom: 16px;
  right: 16px;
  border-width: 0 2px 2px 0;
}

.scan-beam {
  position: absolute;
  left: 16px;
  right: 16px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 6px var(--cyan);
  animation: beamScan 2.5s linear infinite;
  opacity: 0;
}

.scan-beam.active {
  opacity: 1;
}

@keyframes beamScan {
  0% {
    top: 16px;
  }

  100% {
    top: calc(100% - 18px);
  }
}

.camera-controls {
  padding: 20px 24px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  background: var(--grad-main);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-btn);
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.4);
}

.btn-start .btn-icon,
.btn-stop .btn-icon {
  width: 18px;
  height: 18px;
}

.btn-stop {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  background: rgba(255, 71, 87, 0.12);
  border: 1px solid rgba(255, 71, 87, 0.3);
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-stop:hover {
  background: rgba(255, 71, 87, 0.2);
  border-color: var(--red);
  transform: translateY(-2px);
}

.hidden {
  display: none !important;
}

/* ─── Result Panel ────────────────────────── */
.result-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.status-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.status-card.state-awake {
  border-color: rgba(34, 212, 91, 0.3);
  background: rgba(34, 212, 91, 0.05);
}

.status-card.state-drowsy {
  border-color: rgba(255, 71, 87, 0.3);
  background: rgba(255, 71, 87, 0.05);
  animation: dangerPulse 1s ease-in-out infinite;
}

@keyframes dangerPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.2);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(255, 71, 87, 0);
  }
}

.status-icon-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.status-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition: var(--transition);
}

.status-ring.ring-awake {
  border-color: rgba(34, 212, 91, 0.4);
  box-shadow: 0 0 16px rgba(34, 212, 91, 0.2);
}

.status-ring.ring-drowsy {
  border-color: rgba(255, 71, 87, 0.5);
  box-shadow: 0 0 16px rgba(255, 71, 87, 0.3);
  animation: ringDanger 0.5s ease-in-out infinite;
}

@keyframes ringDanger {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

.status-icon {
  position: absolute;
  inset: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-icon svg {
  width: 100%;
  height: 100%;
}

.status-label {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.status-sublabel {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Confidence Card */
.confidence-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.confidence-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}

.conf-item {
  margin-bottom: 18px;
}

.conf-item:last-child {
  margin-bottom: 0;
}

.conf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.conf-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

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

.conf-dot-awake {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.conf-dot-drowsy {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

.conf-value {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.conf-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  overflow: hidden;
}

.conf-bar {
  height: 100%;
  border-radius: 100px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.conf-bar-awake {
  background: linear-gradient(90deg, #22d45b, #00ff88);
  box-shadow: 0 0 8px rgba(34, 212, 91, 0.5);
}

.conf-bar-drowsy {
  background: linear-gradient(90deg, #ff4757, #ff6b6b);
  box-shadow: 0 0 8px rgba(255, 71, 87, 0.5);
}

/* Alert Card */
.alert-card {
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.4);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  animation: alertShake 0.5s ease-in-out;
}

@keyframes alertShake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-6px);
  }

  40% {
    transform: translateX(6px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

.alert-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.alert-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

.alert-text {
  font-size: 0.82rem;
  color: rgba(255, 71, 87, 0.8);
  line-height: 1.5;
}

/* Log Card */
.log-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
}

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

.log-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.log-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.log-empty {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 16px;
}

.log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.log-item-state {
  font-size: 0.8rem;
  font-weight: 600;
}

.log-item-state.drowsy {
  color: var(--red);
}

.log-item-state.awake {
  color: var(--green);
}

.log-item-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
}

/* ─── How It Works Section ────────────────── */
.how-section {
  padding: 100px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

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

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  position: relative;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.step-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-main);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.step-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-glow), var(--shadow-card);
}

.step-card:hover::before {
  transform: scaleX(1);
}

.step-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: rgba(0, 212, 255, 0.08);
  letter-spacing: -0.04em;
  position: absolute;
  top: 16px;
  right: 20px;
  line-height: 1;
}

.step-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
}

.step-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.step-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── Stats Section ───────────────────────── */
.stats-section {
  padding: 100px 24px;
  position: relative;
}

.stats-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      transparent 0%,
      rgba(0, 212, 255, 0.03) 30%,
      rgba(123, 47, 247, 0.04) 70%,
      transparent 100%);
  pointer-events: none;
}

.stats-section .section-header {
  max-width: 1200px;
  margin: 0 auto 60px;
}

.stats-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 24px;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow), var(--shadow-card);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-unit {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
  margin-bottom: 12px;
}

.stat-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── Alert Modal ─────────────────────────── */
.alert-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-inner {
  background: var(--bg-card);
  border: 2px solid rgba(255, 71, 87, 0.5);
  border-radius: var(--radius-xl);
  padding: 60px 48px;
  max-width: 480px;
  width: calc(100% - 48px);
  text-align: center;
  box-shadow: 0 0 60px rgba(255, 71, 87, 0.2), var(--shadow-card);
  animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.85) translateY(20px);
    opacity: 0;
  }

  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.modal-icon {
  font-size: 3.5rem;
  margin-bottom: 24px;
  animation: modalIconPulse 0.5s ease-in-out infinite;
}

@keyframes modalIconPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--red);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.modal-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}

.modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ff4757, #ff6b6b);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(255, 71, 87, 0.4);
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 71, 87, 0.5);
}

/* ─── Footer ──────────────────────────────── */
.footer {
  padding: 48px 24px 32px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

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

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

.footer-link {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 500;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-divider {
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 16px 0 8px;
}

/* Made By Section */
.footer-made-by {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.04), rgba(123, 47, 247, 0.04));
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.footer-made-by::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--grad-main);
  opacity: 0.5;
}

.footer-made-by:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.08);
}

.made-by-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.made-by-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  flex-shrink: 0;
  transition: var(--transition);
}

.footer-made-by:hover .author-avatar {
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.25);
  border-color: rgba(0, 212, 255, 0.3);
}

.author-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.author-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid rgba(0, 212, 255, 0.2);
  background: rgba(0, 212, 255, 0.06);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.05em;
}

.author-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}

.made-by-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.01em;
}

/* ─── Loading Overlay ─────────────────────── */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 20, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(0, 212, 255, 0.15);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ─── Responsive ──────────────────────────── */
@media (max-width: 1024px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detector-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 140px;
  }

  .hero-visual {
    width: 260px;
    height: 260px;
  }

  .hero-eyebrow {
    justify-content: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav {
    display: none;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-visual {
    width: 200px;
    height: 200px;
  }

  .modal-inner {
    padding: 40px 24px;
  }
}

/* Efek Hologram pada Kamera */
#webcam-canvas {
  filter: contrast(1.1) brightness(1.1);
}

.camera-feed-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
}