/* ============================================================
   styles.css — Rezaye Rabbi · Personal Website
   Custom styles layered on top of Tailwind CSS utility classes.
   ============================================================ */


/* ── CSS Architecture / Tokens ────────────────────────────────── */
:root {
  --color-bg-base: #0d0f1a;
  --color-text-base: #e2e8f0;
  
  /* Brand core Hex */
  --color-brand-primary: #3b6ef8;
  
  /* RGB components for Alpha transparency */
  --color-brand-rgb: 59, 110, 248;
  --color-accent-purple-rgb: 139, 92, 246;
  --color-accent-dark-rgb: 30, 36, 130;
  
  /* Surface Tokens */
  --surface-glass-bg: rgba(19, 22, 41, 0.7);
  --surface-glass-border: rgba(30, 35, 64, 0.9);
}


/* ── Base reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  background-color: var(--color-bg-base);
  color: var(--color-text-base);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}


/* ── Animated mesh / gradient background ────────────────────── */
.bg-mesh {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%,  rgba(var(--color-brand-rgb), 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 80%,  rgba(var(--color-accent-purple-rgb), 0.20) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 50%,  rgba(var(--color-accent-dark-rgb), 0.14) 0%, transparent 100%),
    var(--color-bg-base);
  pointer-events: none;
}


/* ── Canvas stars ────────────────────────────────────────────── */
#star-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}


/* ── Grid overlay ────────────────────────────────────────────── */
.grid-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(var(--color-brand-rgb), 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--color-brand-rgb), 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
  mask-image:         radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
}


/* ── Glowing background orbs ─────────────────────────────────── */
.orb {
  position: fixed; border-radius: 50%; filter: blur(80px);
  pointer-events: none; z-index: 0;
}
.orb-1 { width: 500px; height: 500px; top: -150px; left: -100px;  background: rgba(var(--color-brand-rgb), 0.18);  animation: float 8s  ease-in-out infinite; }
.orb-2 { width: 400px; height: 400px; bottom: -100px; right: -80px; background: rgba(var(--color-accent-purple-rgb), 0.18); animation: float 10s ease-in-out infinite reverse; }
.orb-3 { width: 300px; height: 300px; top: 40%; left: 60%;        background: rgba(var(--color-brand-rgb), 0.10); animation: float 12s ease-in-out infinite 2s; }


/* ── Content z-layer ─────────────────────────────────────────── */
.z-content { position: relative; z-index: 10; }


/* ── Build-log ticker ────────────────────────────────────────── */
.ticker-wrap {
  width: 100%; overflow: hidden;
  mask-image:         linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.ticker-track {
  display: flex; gap: 48px; width: max-content;
  animation: tickerScroll 28s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; color: #3d5080; white-space: nowrap;
}
.ticker-item .t-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: 0.6; flex-shrink: 0;
}
.ticker-item.ok   { color: #2a5c3f; }
.ticker-item.ok   .t-dot { background: #22c55e; }
.ticker-item.run  { color: #2a4b7a; }
.ticker-item.run  .t-dot { background: #3b82f6; animation: pulse 1.2s infinite; }
.ticker-item.warn { color: #6b5020; }
.ticker-item.warn .t-dot { background: #eab308; }


/* ── Name gradient ───────────────────────────────────────────── */
.name-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #a5c8ff 40%, #c4aaff 75%, #7ca8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}


/* ── Accent divider line ─────────────────────────────────────── */
.accent-line {
  width: 60px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, #3b6ef8, #8b5cf6);
}


/* ── Glass card ──────────────────────────────────────────────── */
.glass-card {
  background: var(--surface-glass-bg);
  border: 1px solid var(--surface-glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
}


/* ── Skill chips ─────────────────────────────────────────────── */
.skill-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px;
  background: rgba(var(--color-brand-rgb), 0.07);
  border: 1px solid rgba(var(--color-brand-rgb), 0.15);
  font-size: 0.82rem; font-weight: 500; color: #94b4f5;
  transition: all 0.25s ease;
  /* Staggered entrance animation */
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}
.skill-chip:nth-child(1) { animation-delay: 1.0s; }
.skill-chip:nth-child(2) { animation-delay: 1.08s; }
.skill-chip:nth-child(3) { animation-delay: 1.16s; }
.skill-chip:nth-child(4) { animation-delay: 1.24s; }
.skill-chip:nth-child(5) { animation-delay: 1.32s; }
.skill-chip:nth-child(6) { animation-delay: 1.40s; }

.skill-chip:hover {
  background: rgba(var(--color-brand-rgb), 0.14);
  border-color: rgba(59,110,248,0.35);
  color: #c0d4ff;
  transform: translateY(-2px);
}
.skill-chip svg { opacity: 0.7; }


/* ── Form inputs ─────────────────────────────────────────────── */
.form-input {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #e2e8f0; font-size: 0.9rem; font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.form-input::placeholder { color: rgba(148,163,184,0.45); }
.form-input:focus {
  border-color: rgba(59,110,248,0.6);
  background:   rgba(59,110,248,0.05);
  box-shadow:   0 0 0 3px rgba(59,110,248,0.12), 0 0 16px rgba(59,110,248,0.08);
}
.form-label {
  display: block; margin-bottom: 7px;
  font-size: 0.8rem; font-weight: 500;
  color: #94a3b8; letter-spacing: 0.04em;
}


/* ── Primary button ──────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 32px; border-radius: 12px; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 600; letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #3b6ef8 0%, #5a3ef8 60%, #8b5cf6 100%);
  box-shadow: 0 4px 24px rgba(59,110,248,0.35);
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-primary:hover  { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(59,110,248,0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }


/* ── Success / error feedback ────────────────────────────────── */
.success-msg {
  display: none; padding: 14px 20px; border-radius: 12px;
  background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.25);
  color: #6ee7b7; font-size: 0.875rem; text-align: center;
}


/* ── Footer links ────────────────────────────────────────────── */
.footer-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: #64748b; font-size: 0.82rem; text-decoration: none;
  transition: color 0.2s, transform 0.2s, filter 0.2s;
}
.footer-link:hover {
  color: #94b4f5;
  transform: scale(1.08);
  filter: drop-shadow(0 0 6px rgba(59,110,248,0.3));
}


/* ── Keyframe animations (single source of truth) ────────────── */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn   { from { opacity: 0; }                               to { opacity: 1; } }
@keyframes float    { 0%, 100% { transform: translateY(0); }  50% { transform: translateY(-14px); } }


/* ── Top status banner ──────────────────────────────────────── */
.top-status-banner {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px 7px 14px;
  border-radius: 100px;
  background: rgba(13, 15, 26, 0.72);
  border: 1px solid rgba(59, 110, 248, 0.32);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  /* Entrance + ambient glow */
  opacity: 0;
  animation:
    fadeInDown 0.6s ease 0.1s forwards,
    bannerGlow 3s ease-in-out 0.7s infinite alternate;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes bannerGlow {
  from { border-color: rgba(59, 110, 248, 0.28); box-shadow: 0 4px 20px rgba(0,0,0,0.4),  0 0  0px rgba(59,110,248,0);    }
  to   { border-color: rgba(59, 110, 248, 0.55); box-shadow: 0 4px 28px rgba(0,0,0,0.45), 0 0 16px rgba(59,110,248,0.14); }
}

.top-banner-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7ca8ff;
}

/* ── Bip (live/active) dot ───────────────────────────────────── */
.bip-dot-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.bip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b6ef8;
  box-shadow: 0 0 8px #3b6ef8, 0 0 2px #3b6ef8;
  z-index: 1;
  flex-shrink: 0;
  animation: bipPulse 1.6s ease-in-out infinite;
}

@keyframes bipPulse {
  0%   { background: #3b6ef8; box-shadow: 0 0 4px #3b6ef8,  0 0 2px #3b6ef8;  transform: scale(1);    opacity: 1;   }
  40%  { background: #5a94ff; box-shadow: 0 0 12px #5a94ff, 0 0 6px #3b6ef8;  transform: scale(1.25); opacity: 1;   }
  55%  { background: #3b6ef8; box-shadow: 0 0 6px #3b6ef8,  0 0 2px #3b6ef8;  transform: scale(1);    opacity: 1;   }
  70%  { background: #1e3a8a; box-shadow: 0 0 2px #1e3a8a,  0 0 0px #3b6ef8;  transform: scale(0.85); opacity: 0.5; }
  100% { background: #3b6ef8; box-shadow: 0 0 4px #3b6ef8,  0 0 2px #3b6ef8;  transform: scale(1);    opacity: 1;   }
}

.bip-dot-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(59, 110, 248, 0.6);
  animation: bipRing 1.6s ease-out infinite;
}

@keyframes bipRing {
  0%   { transform: scale(0.7); opacity: 0.8; }
  60%  { transform: scale(2.2); opacity: 0;   }
  100% { transform: scale(2.2); opacity: 0;   }
}


/* ── Custom scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: #0d0f1a; }
::-webkit-scrollbar-thumb { background: #1e2340; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3b6ef8; }


/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
