/* ============================================================
   PERSONAL PORTFOLIO — style.css
   Author: Alex Morgan Portfolio
   Structure:
   1.  CSS Variables (design tokens) ← EDIT COLORS HERE
   2.  Base / Reset
   3.  Typography & RTL
   4.  Background Blobs
   5.  Navbar
   6.  Hero
   7.  Sections & Headings
   8.  Glass Cards
   9.  About
   10. Skills
   11. Projects
   12. Timeline
   13. Contact
   14. Footer
   15. Utilities / Reveal
   16. Responsive
   ============================================================ */

/* ============ 1. CSS VARIABLES ============ */
:root {
  /* --- Brand colors (change these to re-theme the site) --- */
  --primary: #512BD4;          /* .NET purple */
  --primary-light: #7B5FE8;
  --secondary: #00D9FF;        /* cyber blue */
  --accent: #39FF14;           /* neon green CTA */

  /* --- Dark theme --- */
  --bg: #0D1117;
  --bg-2: #161B22;
  --bg-glass: rgba(22, 27, 34, 0.55);
  --border-glass: rgba(255, 255, 255, 0.08);
  --text: #E6EDF3;
  --text-muted: #8B949E;

  /* --- Gradients --- */
  --grad-brand: linear-gradient(135deg, var(--primary), var(--secondary));
  --grad-text: linear-gradient(135deg, #7B5FE8 0%, #00D9FF 100%);
  --grad-cta: linear-gradient(135deg, var(--accent), #00D9FF);

  /* --- Effects --- */
  --glow-primary: 0 0 30px rgba(81, 43, 212, 0.45);
  --glow-secondary: 0 0 30px rgba(0, 217, 255, 0.35);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* --- Fonts (change font family here) --- */
  --font-en: 'Space Grotesk', system-ui, sans-serif;
  --font-fa: 'Vazirmatn', system-ui, sans-serif;
  --font: var(--font-en);

  /* --- Layout --- */
  --radius: 18px;
  --radius-sm: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Light theme overrides --- */
[data-theme="light"] {
  --bg: #F8F9FC;
  --bg-2: #EEF1F8;
  --bg-glass: rgba(255, 255, 255, 0.65);
  --border-glass: rgba(31, 35, 40, 0.08);
  --text: #1F2328;
  --text-muted: #57606A;
  --shadow-card: 0 8px 32px rgba(81, 43, 212, 0.1);
}

/* --- RTL font switching --- */
[dir="rtl"] { --font: var(--font-fa); }

/* ============ 2. BASE / RESET ============ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

/* Selection */
::selection { background: var(--primary); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb {
  background: var(--grad-brand);
  border-radius: 10px;
}

/* ============ 3. TYPOGRAPHY & RTL ============ */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }

.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* RTL adjustments */
[dir="rtl"] .navbar-nav { padding-right: 0; }
[dir="rtl"] .hero-title { letter-spacing: 0; }
[dir="rtl"] .section-title { letter-spacing: 0; }
[dir="rtl"] .timeline { padding-right: 2rem; padding-left: 0; }
[dir="rtl"] .timeline-item { padding-right: 2.5rem; padding-left: 0; }
[dir="rtl"] .timeline-dot { right: 0; left: auto; }
[dir="rtl"] .contact-item i { margin-left: 0.6rem; margin-right: 0; }

/* ============ 4. BACKGROUND BLOBS ============ */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  will-change: transform;
}

.blob-1 {
  width: 480px; height: 480px;
  background: var(--primary);
  top: -120px; left: -120px;
  animation: float1 18s ease-in-out infinite;
}
.blob-2 {
  width: 420px; height: 420px;
  background: var(--secondary);
  bottom: -100px; right: -100px;
  animation: float2 22s ease-in-out infinite;
}
.blob-3 {
  width: 360px; height: 360px;
  background: var(--accent);
  top: 40%; left: 50%;
  opacity: 0.12;
  animation: float3 26s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(80px, 60px) scale(1.15); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-70px, -50px) scale(1.1); }
}
@keyframes float3 {
  0%, 100% { transform: translate(-50%, 0) scale(1); }
  50% { transform: translate(-30%, 40px) scale(1.2); }
}

/* ============ 5. NAVBAR ============ */
.navbar-wrap {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.6rem 0;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-glass);
}

.navbar { padding: 0; }

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text) !important;
}

.brand-badge {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--grad-brand);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--glow-primary);
}
.brand-dot { color: var(--accent); }

.navbar-nav .nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
  position: relative;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  color: var(--text) !important;
  background: rgba(81, 43, 212, 0.12);
}

.icon-btn, .lang-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}
.icon-btn:hover, .lang-btn:hover {
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
  transform: translateY(-2px);
}
.lang-btn {
  width: auto;
  padding: 0 0.9rem;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* ============ 6. HERO ============ */
.hero { position: relative; }

.hero-pill {
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.hero-title {
  font-size: clamp(2.6rem, 7vw, 5rem);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 600;
  color: var(--text-muted);
  min-height: 2.4rem;
  margin-bottom: 1.4rem;
}

.typewriter { color: var(--secondary); }

.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-weight: 400;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  max-width: 620px;
  margin: 0 auto 2rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.hero-socials {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
}

.social-link {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  transition: all var(--transition);
}
.social-link:hover {
  color: #fff;
  background: var(--grad-brand);
  box-shadow: var(--glow-primary);
  transform: translateY(-3px) scale(1.05);
}

.scroll-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  animation: bounce 2s infinite;
  font-size: 1.5rem;
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ============ 7. SECTIONS & HEADINGS ============ */
.section { padding: 6rem 0; position: relative; }

.section-head { text-align: center; margin-bottom: 3.5rem; }

.section-kicker {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--secondary);
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0;
}

/* ============ 8. GLASS CARDS ============ */
.glass-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.glass-card:hover {
  border-color: rgba(81, 43, 212, 0.4);
  box-shadow: var(--shadow-card), var(--glow-primary);
}

/* ============ 9. ABOUT ============ */
.profile-frame {
  position: relative;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 1;
}
.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  position: relative;
  z-index: 1;
}
.profile-glow {
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, var(--primary), var(--secondary), var(--accent), var(--primary));
  filter: blur(60px);
  opacity: 0.4;
  animation: spin 12s linear infinite;
  z-index: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.about-name { margin-bottom: 1rem; font-size: 1.4rem; }
.about-card p { color: var(--text-muted); margin-bottom: 1rem; }

.about-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { color: var(--text-muted); font-size: 0.85rem; }

/* ============ 10. SKILLS ============ */
.skill-card {
  padding: 1.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.skill-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.skill-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(81, 43, 212, 0.15);
  color: var(--secondary);
  font-size: 1.3rem;
  flex-shrink: 0;
}
.skill-name { font-weight: 600; font-size: 1rem; margin: 0; }
.skill-pct {
  margin-inline-start: auto;
  font-weight: 700;
  color: var(--secondary);
  font-size: 0.9rem;
}
.skill-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
[data-theme="light"] .skill-bar { background: rgba(31, 35, 40, 0.1); }
.skill-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--grad-brand);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(0, 217, 255, 0.5);
}

/* ============ 11. PROJECTS ============ */
.filter-bar {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.filter-btn {
  padding: 0.5rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { color: var(--text); border-color: var(--primary); }
.filter-btn.active {
  background: var(--grad-brand);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--glow-primary);
}

.project-card {
  padding: 0;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.project-thumb {
  height: 180px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 3rem;
  color: #fff;
}
.project-thumb.thumb-1 { background: linear-gradient(135deg, #512BD4, #00D9FF); }
.project-thumb.thumb-2 { background: linear-gradient(135deg, #00D9FF, #39FF14); }
.project-thumb.thumb-3 { background: linear-gradient(135deg, #7B5FE8, #FF4D6D); }
.project-thumb.thumb-4 { background: linear-gradient(135deg, #39FF14, #512BD4); }
.project-thumb.thumb-5 { background: linear-gradient(135deg, #FF4D6D, #00D9FF); }
.project-thumb.thumb-6 { background: linear-gradient(135deg, #FFB800, #512BD4); }

.project-body { padding: 1.4rem; display: flex; flex-direction: column; flex: 1; }
.project-title { font-size: 1.1rem; margin-bottom: 0.5rem; }
.project-desc { color: var(--text-muted); font-size: 0.9rem; flex: 1; margin-bottom: 1rem; }
.project-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tag {
  font-size: 0.72rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(0, 217, 255, 0.12);
  color: var(--secondary);
  font-weight: 600;
}
.project-links { display: flex; gap: 0.8rem; }
.project-links a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color var(--transition);
}
.project-links a:hover { color: var(--accent); }

/* ============ 12. TIMELINE ============ */
.timeline { position: relative; padding-left: 2rem; max-width: 820px; margin: 0 auto; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--secondary), transparent);
}
.timeline-item {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 2.5rem;
}
.timeline-dot {
  position: absolute;
  left: 0; top: 0.4rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--grad-brand);
  transform: translateX(-50%);
  box-shadow: var(--glow-primary);
}
.timeline-date {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.timeline-role { font-size: 1.15rem; margin-bottom: 0.2rem; }
.timeline-company { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.6rem; }
.timeline-desc { color: var(--text-muted); font-size: 0.9rem; }

/* ============ 13. CONTACT ============ */
.contact-form .form-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.contact-form .form-control {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.7rem 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
[data-theme="light"] .contact-form .form-control { background: rgba(255, 255, 255, 0.6); }
.contact-form .form-control:focus {
  background: rgba(0, 0, 0, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(81, 43, 212, 0.2);
  color: var(--text);
}
.contact-form .form-control::placeholder { color: var(--text-muted); }

.form-success {
  display: none;
  margin-top: 1rem;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(57, 255, 20, 0.1);
  color: var(--accent);
  font-weight: 600;
  text-align: center;
}
.form-success.show { display: block; }

.contact-info h3 { margin-bottom: 1.5rem; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  transition: color var(--transition);
}
.contact-item:hover { color: var(--secondary); }
.contact-item i { color: var(--secondary); flex-shrink: 0; }
.contact-socials { display: flex; gap: 0.8rem; margin-top: 1.5rem; }

/* ============ 14. FOOTER ============ */
.footer {
  border-top: 1px solid var(--border-glass);
  padding: 2rem 0;
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
}
.footer-copy { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.footer-socials { display: flex; gap: 0.6rem; }

/* ============ 15. BUTTONS / UTILITIES / REVEAL ============ */
.btn-glow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: var(--grad-cta);
  color: #0D1117;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 0 24px rgba(57, 255, 20, 0.35);
}
.btn-glow:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 40px rgba(57, 255, 20, 0.6);
  color: #0D1117;
}

.btn-outline-glow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-outline-glow:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--glow-primary);
  transform: translateY(-3px);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ 16. RESPONSIVE ============ */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 0.8rem;
  }
  .navbar-nav .nav-link { padding: 0.6rem 0.8rem !important; }
  .scroll-hint { display: none; }
}

@media (max-width: 575.98px) {
  .section { padding: 4rem 0; }
  .glass-card { padding: 1.4rem; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn-glow,
  .hero-cta .btn-outline-glow { justify-content: center; }
  .about-stats { gap: 1.2rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .timeline { padding-left: 1.2rem; }
  .timeline-item { padding-left: 2rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}