/* ==========================================================================
   AS HRIDOY — Portfolio
   Design tokens + base styles
   ========================================================================== */

:root {
  --bg: #070B12;
  --bg-secondary: #111827;
  --accent: #3B82F6;
  --accent-glow: #60A5FA;
  --text: #FFFFFF;
  --text-muted: #94A3B8;
  --success: #10B981;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  position: relative;
}

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

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--bg-secondary);
  border: 2px solid var(--bg);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent-glow);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4, h5, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

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

/* ---------- background system ---------- */

.grid-pattern {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 480px;
  height: 480px;
  margin-left: -240px;
  margin-top: -240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.14) 0%, rgba(59, 130, 246, 0) 70%);
  pointer-events: none;
  z-index: 1;
  will-change: transform;
  transition: opacity 0.4s ease;
}

@media (max-width: 767px) {
  #cursor-glow { display: none; }
}

/* ---------- glass surfaces ---------- */

.glass {
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
}

.glass-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 40%), rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.glass-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px -20px rgba(59, 130, 246, 0.25);
}

/* ---------- gradient text / glow ---------- */

.text-glow {
  color: var(--accent-glow);
  text-shadow: 0 0 12px rgba(96, 165, 250, 0.6);
}

.text-gradient {
  background: linear-gradient(120deg, #FFFFFF 20%, var(--accent-glow) 60%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.glow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.5;
}

/* ---------- buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
}

.btn-primary:hover {
  background: #4c8bfa;
  box-shadow: 0 10px 30px -6px rgba(59, 130, 246, 0.55);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
}

/* magnetic wrapper set via JS transform, keep transition smooth for return */
.magnetic {
  transition: transform 0.25s var(--ease);
}

/* ---------- section chrome ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-glow);
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-glow);
  box-shadow: 0 0 12px 2px var(--accent-glow);
}

.section-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
}

/* ---------- nav ---------- */

#navbar {
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

#navbar.scrolled {
  background: rgba(7, 11, 18, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.nav-link {
  position: relative;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent-glow);
  box-shadow: 0 0 8px var(--accent-glow);
  transition: width 0.3s var(--ease);
}

.nav-link:hover { color: var(--text); }
.nav-link:hover::after { width: 100%; }

.nav-link.active { color: var(--text); }
.nav-link.active::after { width: 100%; }

/* ---------- scroll progress ---------- */

#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
  box-shadow: 0 0 10px var(--accent-glow);
  z-index: 60;
}

/* ---------- loading screen ---------- */

#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-mark {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  gap: 4px;
  align-items: center;
}

.loader-bar {
  width: 160px;
  height: 2px;
  background: var(--border);
  overflow: hidden;
  margin-top: 14px;
  border-radius: 2px;
}

.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
}

/* ---------- back to top ---------- */

#back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.35s var(--ease);
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ---------- misc ---------- */

.chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
}

.divider-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
}

.timeline-line {
  background: linear-gradient(180deg, var(--accent) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.timeline-dot {
  box-shadow: 0 0 0 4px rgba(7, 11, 18, 1), 0 0 0 5px var(--border-strong), 0 0 16px 2px rgba(59, 130, 246, 0.6);
}

input, textarea {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-strong);
  transition: border-color 0.3s ease, background 0.3s ease;
}

input:focus, textarea:focus {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.04);
}

input::placeholder, textarea::placeholder {
  color: rgba(148, 163, 184, 0.55);
}
