/* -------------------------------------------------------------------------- */
/* RAVULA MANOHAR YADAV — DESIGN SYSTEM & CUSTOM STYLES                      */
/* Theme: LIGHT EDITORIAL / ENGINEERING / DIGITAL CRAFT                      */
/* -------------------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-hover: #f4f4f5;
  --surface-elevated: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --border-accent: rgba(220, 38, 38, 0.35);

  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --accent: #dc2626; /* Maniora Red */
  --accent-hover: #b91c1c;
  --accent-glow: rgba(220, 38, 38, 0.12);
  --accent-subtle: rgba(220, 38, 38, 0.06);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Base resets & smooth scrolling */
html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

::selection {
  background-color: var(--accent);
  color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Prevent text overflow on narrow mobile screens */
h1, h2, h3, h4, h5, h6, p, span, a {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Technical Grid Pattern Background for Light Mode */
.tech-grid-bg {
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

@media (max-width: 640px) {
  .tech-grid-bg {
    background-size: 24px 24px;
  }
}

/* Light Surface Cards */
.surface-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.02), 0 1px 2px -1px rgba(0, 0, 0, 0.02);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.surface-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 0 15px -3px var(--accent-glow);
}

/* Monospace Badges */
.font-mono-tag {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

/* Animated Red Accent Line */
.accent-line-grow {
  position: relative;
}
.accent-line-grow::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.surface-card:hover .accent-line-grow::after,
a:hover .accent-line-grow::after {
  width: 100%;
}

/* Reveal Animations on Scroll */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }

/* System Map SVG Node Styling in Light Theme */
.node-circle {
  transition: fill 0.3s ease, r 0.3s ease, filter 0.3s ease;
}

.node-group:hover .node-circle {
  fill: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent));
}

.node-path {
  stroke-dasharray: 8 8;
  animation: dash 30s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: -1000;
  }
}

/* Dynamic Pulse Dot */
.pulse-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pulse-dot::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--accent);
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(2.2);
    opacity: 0;
  }
  100% {
    transform: scale(0.95);
    opacity: 0;
  }
}

/* Light Theme Buttons & Interactive Elements */
.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  min-height: 44px;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--text);
  border: 1px solid #cbd5e1;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  min-height: 44px;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #64748b;
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .btn-primary, .btn-secondary {
    width: 100%;
    padding: 0.875rem 1.25rem;
  }
}

/* Mobile Horizontal Scroll Utilities */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

/* Modal Overlay & Card */
.modal-backdrop {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-overflow-scrolling: touch;
}
.modal-backdrop.is-active .modal-card {
  transform: scale(1) translateY(0);
}

/* Toast Container */
#toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: calc(100vw - 3rem);
}
#toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Accessibility Focus States */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Mobile Navigation Backdrop Drawer */
#mobile-menu-drawer {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Reduced Motion Respect */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal-on-scroll {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .pulse-dot::before {
    animation: none !important;
  }
  .node-path {
    animation: none !important;
  }
}
