/* =========================================================
   TANYM BARAKAH — PORTFOLIO STYLESHEET
   Design system: Glassmorphism · Dark-first · Space-blue
   ========================================================= */

/* ---------- Google Fonts Import ---------- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Dark mode palette (default) */
  --bg-primary:       #080c14;
  --bg-secondary:     #0d1525;
  --bg-card:          rgba(255, 255, 255, 0.04);
  --bg-card-hover:    rgba(255, 255, 255, 0.07);
  --glass-border:     rgba(255, 255, 255, 0.10);
  --glass-shadow:     0 8px 32px rgba(0, 0, 0, 0.5);
  --glass-blur:       blur(16px);

  --accent-primary:   #4f8ef7;   /* electric blue */
  --accent-secondary: #8b5cf6;   /* violet */
  --accent-glow:      rgba(79, 142, 247, 0.3);

  --text-primary:     #f0f4ff;
  --text-secondary:   #8fa3c8;
  --text-muted:       #4a6080;

  --gradient-hero:    linear-gradient(135deg, #080c14 0%, #0d1a30 50%, #0a1020 100%);
  --gradient-accent:  linear-gradient(135deg, #4f8ef7 0%, #8b5cf6 100%);

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

  /* Spacing */
  --section-pad:   6rem 0;
  --radius-glass:  16px;
  --radius-pill:   999px;

  /* Transitions */
  --transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Light Mode Overrides ---------- */
[data-theme="light"] {
  --bg-primary:      #eef2fb;
  --bg-secondary:    #dde5f5;
  --bg-card:         rgba(255, 255, 255, 0.55);
  --bg-card-hover:   rgba(255, 255, 255, 0.75);
  --glass-border:    rgba(79, 142, 247, 0.18);
  --glass-shadow:    0 8px 32px rgba(79, 142, 247, 0.12);

  --accent-glow:     rgba(79, 142, 247, 0.15);

  --text-primary:    #0d1525;
  --text-secondary:  #3a5070;
  --text-muted:      #7a95b8;

  --gradient-hero:   linear-gradient(135deg, #dde5f5 0%, #eef2fb 50%, #dde5f5 100%);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: var(--radius-pill);
}

/* ---------- Selection ---------- */
::selection {
  background: var(--accent-primary);
  color: #fff;
}

/* ---------- Typography Scale ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

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

/* ---------- Glass Card Mixin ---------- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-glass);
  box-shadow: var(--glass-shadow);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--glass-border);
}

/* ========================================================
   NAVBAR
   ======================================================== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(8, 12, 20, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition), border-color var(--transition);
  padding: 0.85rem 0;
}

[data-theme="light"] #navbar {
  background: rgba(238, 242, 251, 0.75);
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-primary) !important;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-brand span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-nav .nav-link {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary) !important;
  letter-spacing: 0.03em;
  padding: 0.4rem 1rem !important;
  border-radius: var(--radius-pill);
  transition: color var(--transition), background var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--accent-primary) !important;
  background: rgba(79, 142, 247, 0.08);
}

/* Theme Toggle */
#themeToggle,
#themeToggleMobile,
.theme-toggle-btn {
  width: 52px;
  height: 28px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}

.theme-toggle-btn::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gradient-accent);
  transition: transform var(--transition);
}

[data-theme="light"] .theme-toggle-btn::after {
  transform: translateX(24px);
}

.toggle-icon {
  font-size: 0.75rem;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity var(--transition);
}
.toggle-icon.moon { right: 7px; }
.toggle-icon.sun  { left: 7px; opacity: 0; }
[data-theme="light"] .toggle-icon.moon { opacity: 0; }
[data-theme="light"] .toggle-icon.sun  { opacity: 1; }

.navbar-toggler {
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
}
.navbar-toggler-icon {
  filter: invert(60%) sepia(50%) saturate(600%) hue-rotate(190deg);
}

/* ========================================================
   HERO / HEADER
   ======================================================== */
#hero {
  min-height: 100vh;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}

/* Ambient glow orbs */
#hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  top: -150px; right: -100px;
  background: radial-gradient(circle, rgba(79, 142, 247, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}

#hero::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  bottom: -100px; left: -50px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.10) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-30px) scale(1.05); }
}

/* Particle grid overlay */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(79, 142, 247, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 142, 247, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-primary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-eyebrow::before {
  content: '';
  width: 32px; height: 1px;
  background: var(--accent-primary);
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 0.5rem;
}

.hero-name .gradient-text {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 2rem;
}

.hero-about {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.btn-primary-glass {
  background: var(--gradient-accent);
  color: #fff;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary-glass:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
  color: #fff;
}

.btn-outline-glass {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  padding: 0.75rem 2rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
  backdrop-filter: blur(8px);
  text-decoration: none;
  display: inline-block;
}

.btn-outline-glass:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  color: var(--text-primary);
}

/* Social Links */
.social-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.social-link {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 1rem;
  text-decoration: none;
  transition: color var(--transition), background var(--transition), transform var(--transition), border-color var(--transition);
  backdrop-filter: blur(8px);
}

.social-link:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  background: rgba(79, 142, 247, 0.08);
}

/* Hero Image / Avatar */
.hero-avatar-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-avatar-ring {
  width: 320px; height: 320px;
  border-radius: 50%;
  background: var(--gradient-accent);
  padding: 3px;
  position: relative;
  animation: spin-slow 12s linear infinite;
  box-shadow: 0 0 60px var(--accent-glow);
}

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

.hero-avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;              /* clips the photo to the circle */
  animation: spin-slow 12s linear infinite reverse;
}

.hero-avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;             /* fills the circle, no stretching */
  object-position: center top;   /* adjust: 'center', 'top', '50% 20%' etc. */
  border-radius: 50%;
  animation: spin-slow 12s linear infinite; /* counter-spins so photo stays upright */
}

.floating-badge {
  position: absolute;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  white-space: nowrap;
  animation: badge-float 4s ease-in-out infinite;
}

.badge-1 { top: 10%; right: -10%; animation-delay: 0s; }
.badge-2 { bottom: 15%; left: -15%; animation-delay: 1.5s; }
.badge-3 { top: 60%; right: -20%; animation-delay: 3s; }

@keyframes badge-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ========================================================
   SECTION SHARED STYLES
   ======================================================== */
section { padding: var(--section-pad); position: relative; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.section-divider {
  width: 48px; height: 3px;
  background: var(--gradient-accent);
  border-radius: var(--radius-pill);
  margin: 0 0 3rem;
}

/* ========================================================
   CONTACT SECTION
   ======================================================== */
#contact { background: var(--bg-secondary); }

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: var(--radius-glass);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  transition: background var(--transition), transform var(--transition);
  height: 100%;
}

.contact-item:hover {
  background: var(--bg-card-hover);
  transform: translateY(-3px);
}

.contact-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(79, 142, 247, 0.1);
  border: 1px solid rgba(79, 142, 247, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.2rem;
}

.contact-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
}

.contact-value a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

.contact-value a:hover { color: var(--accent-primary); }

/* ========================================================
   SKILLS SECTION
   ======================================================== */
#skills { background: var(--bg-primary); }

.skill-item {
  margin-bottom: 1.75rem;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
}

.skill-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.skill-pct {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-primary);
}

.skill-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .skill-track {
  background: rgba(0,0,0,0.08);
}

.skill-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--gradient-accent);
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.skill-bar::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  to { left: 100%; }
}

.skills-glass-wrap {
  padding: 2.5rem;
}

/* ========================================================
   EDUCATION SECTION
   ======================================================== */
#education { background: var(--bg-secondary); }

.edu-timeline {
  position: relative;
  padding-left: 2.5rem;
}

.edu-timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary), transparent);
  border-radius: var(--radius-pill);
}

.edu-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.edu-item:last-child { margin-bottom: 0; }

.edu-dot {
  position: absolute;
  left: -2.5rem;
  top: 0.4rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gradient-accent);
  border: 2px solid var(--bg-primary);
  transform: translateX(-6px);
  box-shadow: 0 0 10px var(--accent-glow);
}

[data-theme="light"] .edu-dot { border-color: var(--bg-secondary); }

.edu-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.edu-degree {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.edu-institution {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.edu-gpa {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-secondary);
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  display: inline-block;
}

/* ========================================================
   EXPERIENCE SECTION
   ======================================================== */
#experience { background: var(--bg-primary); }

.exp-card {
  padding: 2rem;
  height: 100%;
}

.exp-period-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-primary);
  background: rgba(79, 142, 247, 0.1);
  border: 1px solid rgba(79, 142, 247, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-bottom: 1rem;
}

.exp-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.exp-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.exp-icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

/* ========================================================
   VISITOR COUNTER
   ======================================================== */
.counter-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  backdrop-filter: var(--glass-blur);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.counter-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50%       { opacity: 0.8; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

#visitorCount {
  color: var(--accent-primary);
  font-weight: 600;
}

/* ========================================================
   FOOTER
   ======================================================== */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--glass-border);
  padding: 2.5rem 0;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.footer-brand span {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-heart { color: #f43f5e; }

/* ========================================================
   ANIMATIONS — Scroll Reveal
   ======================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ========================================================
   BACK TO TOP
   ======================================================== */
#backToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 900;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--gradient-accent);
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
}

#backToTop.visible {
  opacity: 1;
  pointer-events: all;
}

#backToTop:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

/* ========================================================
   RESPONSIVE
   ======================================================== */
@media (max-width: 991.98px) {
  .hero-avatar-ring { width: 240px; height: 240px; }
  .hero-avatar-inner { font-size: 3.5rem; }
  .floating-badge { display: none; }
}

@media (max-width: 767.98px) {
  :root { --section-pad: 4rem 0; }

  #hero { padding-top: 100px; padding-bottom: 3rem; }
  .hero-about { max-width: 100%; }
  .hero-avatar-wrap { margin-bottom: 2.5rem; }
  .hero-avatar-ring { width: 200px; height: 200px; }
  .hero-avatar-inner { font-size: 3rem; }

  .skills-glass-wrap { padding: 1.5rem; }
  .exp-card { padding: 1.5rem; }
}

@media (max-width: 575.98px) {
  .hero-name { font-size: 2.5rem; }
  .btn-primary-glass, .btn-outline-glass { width: 100%; text-align: center; }
  .hero-cta-group { flex-direction: column; }
}

/* ========================================================
   REDUCED MOTION
   ======================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.2s !important;
  }
  .hero-avatar-ring, .hero-avatar-inner { animation: none; }
  .skill-bar::after { animation: none; }
}
