/* ==========================================================================
   Ehsan Lak Portfolio Stylesheet
   Designed with terminal aesthetic matching modern developer portfolios
   ========================================================================== */

/* Local Fonts (Vazirmatn & JetBrains Mono) */
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-primary: #05070d;
  --bg-panel: #0d121f;
  --bg-panel-hover: #141b2d;
  --border-color: rgba(56, 189, 248, 0.15);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --accent-cyan: #38bdf8;
  --accent-violet: #818cf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --fg-primary: #f8fafc;
  --fg-soft: #94a3b8;
  --fg-muted: #64748b;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-panel: #ffffff;
  --bg-panel-hover: #f1f5f9;
  --border-color: rgba(14, 165, 233, 0.25);
  --border-subtle: rgba(0, 0, 0, 0.08);
  --accent-cyan: #0284c7;
  --accent-violet: #6366f1;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --fg-primary: #0f172a;
  --fg-soft: #475569;
  --fg-muted: #64748b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--fg-primary);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.font-mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Background Grids & Masks */
.bg-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

[data-theme="light"] .bg-grid {
  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);
}

.mask-radial {
  mask-image: radial-gradient(circle at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, black 30%, transparent 80%);
}

/* Aurora Glow Effects */
.aurora {
  filter: blur(90px);
  opacity: 0.45;
  pointer-events: none;
  animation: aurora-pulse 10s ease-in-out infinite alternate;
}

@keyframes aurora-pulse {
  0% { transform: scale(0.9) translate(0, 0); opacity: 0.35; }
  50% { transform: scale(1.1) translate(20px, -20px); opacity: 0.55; }
  100% { transform: scale(1.0) translate(-15px, 15px); opacity: 0.4; }
}

/* Conic Spinning Avatar Border */
.spin-slow {
  animation: spin-around 8s linear infinite;
}

@keyframes spin-around {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Glassmorphism Cards */
.tech-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.tech-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tech-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px -10px rgba(56, 189, 248, 0.12);
}

.tech-card:hover::before {
  opacity: 1;
}

/* Glow Badges */
.badge-cyan {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-violet {
  background: rgba(129, 140, 248, 0.1);
  color: #818cf8;
  border: 1px solid rgba(129, 140, 248, 0.25);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Pulsing Status Dot */
.pulse-dot {
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  background-color: inherit;
  opacity: 0.6;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Terminal Cursor */
.blinking-cursor {
  display: inline-block;
  width: 8px;
  height: 18px;
  background-color: #38bdf8;
  margin-right: 2px;
  vertical-align: middle;
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Code Snippet Styles */
pre code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

/* Modal styling */
.modal-backdrop {
  background: rgba(5, 7, 13, 0.85);
  backdrop-filter: blur(8px);
}

/* Toast Notification */
#toast {
  visibility: hidden;
  min-width: 250px;
  transform: translateX(-50%) translateY(100px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#toast.show {
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Canvas background */
#neuralCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
