﻿:root {
  --accent-color: #ffffff;
  --accent-glow: rgba(255, 255, 255, 0.4);
}

body {
  box-sizing: border-box;
}

* {
  font-family: 'Outfit', sans-serif;
}

h1, h2, h3, .heading-font {
  font-family: 'Space Grotesk', sans-serif;
}

.glass-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.336);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-color);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.accent-glow {
  box-shadow: 0 0 30px var(--accent-glow);
}

.text-accent {
  color: var(--accent-color);
}

.bg-accent {
  background-color: var(--accent-color);
}

.border-accent {
  border-color: var(--accent-color);
}

/* Typing Animation */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

.typing-text {
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--accent-color);
  animation: typing 2s steps(15) forwards, blink 0.7s step-end infinite;
}

/* Fade In Up Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* Skill Bar Animation */
@keyframes fillBar {
  from { width: 0%; }
}

.skill-bar-fill {
  animation: fillBar 1.5s ease-out forwards;
}

/* Float Animation */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* Pulse Animation */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
  50% { box-shadow: 0 0 40px var(--accent-glow); }
}

.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Color Picker */
.color-picker-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.color-picker-btn:hover {
  transform: scale(1.2);
  border-color: white;
}

.color-picker-btn.active {
  border-color: white;
  box-shadow: 0 0 15px currentColor;
}

/* Scroll animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Social Icons */
.social-icon {
  transition: all 0.3s ease;
}

.social-icon:hover {
  transform: translateY(-5px) scale(1.1);
  filter: drop-shadow(0 5px 15px var(--accent-glow));
}

/* Background Pattern */
.bg-pattern {
  background-image:
    radial-gradient(circle at 20% 80%, var(--accent-glow) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, var(--accent-glow) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255,255,255,0.03) 0%, transparent 50%);
}

/* Hero layout */
.hero-section {
  position: relative;
}

.hero-layout {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 40px;
  align-items: center;
}

.hero-copy {
  text-align: left;
}

.hero-portrait {
  --hero-photo: url('images/ahmad ahmad.jpg');
  width: 320px;
  height: 360px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  justify-self: end;
  filter: drop-shadow(0 12px 35px rgba(0, 0, 0, 0.35));
}

.hero-slice {
  background-image: var(--hero-photo);
  background-size: 320px 360px;
  background-repeat: no-repeat;
  border-radius: 4px;
  align-self: end;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-slice:nth-child(1) { background-position: 0 0; height: 88%; transform: translateY(0); }
.hero-slice:nth-child(2) { background-position: -64px 0; height: 100%; transform: translateY(6px); }
.hero-slice:nth-child(3) { background-position: -128px 0; height: 92%; transform: translateY(-4px); }
.hero-slice:nth-child(4) { background-position: -192px 0; height: 96%; transform: translateY(8px); }
.hero-slice:nth-child(5) { background-position: -256px 0; height: 84%; transform: translateY(-2px); }

.hero-portrait:hover .hero-slice {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

@media (max-width: 900px) {
  .hero-layout {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-portrait {
    justify-self: center;
  }
}

/* Project Card Hover */
.project-card {
  transition: all 0.4s ease;
}

.project-card:hover {
  transform: translateY(-10px);
}

.project-card:hover .project-overlay {
  opacity: 0;
}

/* Hero Button Hover */
.hero-btn {
  transition: transform 0.4s ease, box-shadow 0.4s ease, background-color 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-btn:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 12px 30px var(--accent-glow);
  border-color: var(--accent-color);
}

.hero-btn::before {
  content: '';
  position: absolute;
  inset: -60%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.hero-btn:hover::before {
  opacity: 1;
}

.hero-btn > * {
  position: relative;
  z-index: 1;
}

/* Course Card */
.course-card {
  transition: all 0.3s ease;
}

.course-card:hover {
  transform: scale(1.02);
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 4px;
}

/* Modal overlay */
.modal-overlay {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

/* View transition */
@view-transition {
  navigation: auto;
}

/* Disable glow on the fixed navigation bar when hovered */
nav.glass-card:hover {
  /* keep the original subtle shadow but remove the accent glow */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.336) !important;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Navbar link underline on hover */
nav ul li a {
  position: relative;
  padding-bottom: 6px;
}

nav ul li a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-color);
  bottom: -6px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms cubic-bezier(.4,0,.2,1);
  border-radius: 2px;
  pointer-events: none;
}

nav ul li a:hover::after,
nav ul li a:focus::after {
  transform: scaleX(1);
}

/* ===== Mobile Navigation ===== */
.mobile-nav-overlay {
  background: rgba(3, 7, 18, 0.95);
  backdrop-filter: blur(24px);
}

.mobile-nav-overlay.open {
  display: flex;
}

.mobile-nav-link {
  display: inline-block;
  padding: 8px 0;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
}

.mobile-nav-overlay.open .mobile-nav-link {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav-overlay.open li:nth-child(1) .mobile-nav-link { transition-delay: 0.05s; }
.mobile-nav-overlay.open li:nth-child(2) .mobile-nav-link { transition-delay: 0.10s; }
.mobile-nav-overlay.open li:nth-child(3) .mobile-nav-link { transition-delay: 0.15s; }
.mobile-nav-overlay.open li:nth-child(4) .mobile-nav-link { transition-delay: 0.20s; }
.mobile-nav-overlay.open li:nth-child(5) .mobile-nav-link { transition-delay: 0.25s; }

/* ===== Mobile Responsive Tweaks ===== */
@media (max-width: 640px) {
  /* Smaller section padding on phone */
  section {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  /* Smaller headings on phone */
  h2 {
    font-size: 1.5rem !important;
  }

  /* Glass cards need less padding */
  .glass-card {
    padding: 1rem;
  }

  /* Skill section cards keep more padding */
  #skills .glass-card {
    padding: 1.25rem;
  }

  /* About text smaller */
  #about p {
    font-size: 0.9rem;
  }

  /* Hero portrait smaller on mobile */
  .hero-portrait {
    width: 220px;
    height: 260px;
  }

  .hero-slice:nth-child(1) { background-position: 0 0; }
  .hero-slice:nth-child(2) { background-position: -44px 0; }
  .hero-slice:nth-child(3) { background-position: -88px 0; }
  .hero-slice:nth-child(4) { background-position: -132px 0; }
  .hero-slice:nth-child(5) { background-position: -176px 0; }

  .hero-slice {
    background-size: 220px 260px;
  }

  /* Contact social icons smaller on phone */
  .social-icon .glass-card,
  .social-icon > div {
    width: 3.5rem !important;
    height: 3.5rem !important;
  }

  .social-icon svg {
    width: 1.5rem;
    height: 1.5rem;
  }

  /* Project cards single column */
  #projects .grid {
    grid-template-columns: 1fr !important;
  }

  /* Team section 2-col on small */
  #team .grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  /* Smaller team member images */
  #team .glass-card h3 {
    font-size: 0.85rem;
  }

  #team .glass-card p {
    font-size: 0.7rem;
  }

  /* Footer tighter */
  footer {
    padding: 1.5rem 1rem;
  }

  /* Modal responsive */
  .modal-overlay > div {
    max-width: 95vw;
    padding: 1rem;
  }
}
