/* Premium Portfolio Design System */
:root {
  --navy: #000000;
  --cyan: #00ADB5;
  --pink: #FF00E5;
  --blue: #00E0FF;
  --slate: #F8FAFC;
  --muted: #94A3B8;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.08);
  --overlay: rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --container: 1200px;
  --gradient: linear-gradient(135deg, var(--blue), var(--pink), var(--cyan));
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* --- Preloader --- */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow: hidden;
}

.preloader-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  z-index: -1;
  opacity: 0.6;
}

.loader-content {
  text-align: center;
  position: relative;
  z-index: 10;
}

.loader-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2rem;
  color: #fff;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.loader-percentage {
  font-family: 'Fira Code', monospace;
  font-size: 3rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(0, 224, 255, 0.5);
}

.loader-text span {
  display: inline-block;
}

.loader-bar-container {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.loader-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: var(--blue);
  box-shadow: 0 0 15px var(--blue);
}

/* --- Lenis Smooth Scroll --- */
html.lenis {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto; /* Managed by Lenis */
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--slate);
  background: var(--navy);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.divider{
  margin: 0 10px;
}
/* Nav Glow keyframe is defined at the bottom for modern dual-color pulse */

header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1200;
  padding: 18px 0;
  transition: all 0.3s ease;
  animation: nav-glow 4s infinite ease-in-out;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav .logo {
  flex: 1;
  display: flex;
  justify-content: flex-start;
}

nav .nav-links {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

nav > div:last-child {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.logo {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 24px;
  white-space: nowrap;
}

.logo span {
  color: var(--blue);
}

.logo-img {
  height: 48px;
  width: auto;
  display: block;
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: scale(1.05);
}

.logo .divider {
  color: var(--muted);
  font-weight: 300;
  opacity: 0.6;
  margin: 0 8px;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  padding: 8px 12px;
  border-radius: 99px;
  transition: all 0.3s ease;
  display: inline-block;
  perspective: 1000px;
}

.nav-links a:hover {
  color: var(--cyan);
  background: rgba(0, 173, 181, 0.1);
}

/* --- 3D Flip Effect --- */
.flip-3d {
  perspective: 1000px;
  display: inline-block;
}

.flip-3d-inner {
  position: relative;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-3d:hover .flip-3d-inner {
  transform: rotateX(360deg);
}

/* --- Dropdown --- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  min-width: 200px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  z-index: 1300;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  padding: 12px 20px;
  display: block;
  font-size: 0.9rem;
  color: var(--slate);
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dropdown-content a:last-child {
  border-bottom: none;
}

.dropdown-content a:hover {
  background: var(--glass);
  color: var(--blue);
}

/* --- Buttons --- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  perspective: 1000px;
  overflow: visible;
  white-space: nowrap;
}

.btn-primary {
  background: var(--cyan);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 173, 181, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 173, 181, 0.4);
}

.btn-ghost {
  background: transparent;
  border: 2px solid var(--cyan);
  color: #fff;
}

.btn-ghost:hover {
  background: var(--cyan);
}

header .btn {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

header .btn-ghost {
  animation: button-glow-pulse 3s infinite ease-in-out;
  position: relative;
  overflow: hidden;
}

header .btn-ghost::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
  transform: skewX(-25deg);
  animation: shimmer-sweep 3s infinite linear;
}

@keyframes button-glow-pulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 224, 255, 0.15), inset 0 0 5px rgba(0, 224, 255, 0.1);
    border-color: rgba(0, 224, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 224, 255, 0.5), 0 0 8px rgba(255, 0, 229, 0.25);
    border-color: rgba(0, 224, 255, 0.6);
  }
}

@keyframes shimmer-sweep {
  0% { left: -150%; }
  50% { left: 150%; }
  100% { left: 150%; }
}

/* --- Video Background System --- */
section {
  position: relative;
  padding: 140px 0;
  overflow: hidden;
}

.video-bg-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
}

.video-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: -2;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  z-index: -1;
}

/* --- Glassmorphism Cards --- */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, border-color 0.3s ease;
  height: 100%;
}

.glass-card:hover {
  transform: translateY(-10px);
  border-color: rgba(0, 224, 255, 0.4);
  box-shadow: 0 15px 45px rgba(0, 224, 255, 0.25), 0 0 25px rgba(255, 0, 229, 0.12);
}

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 140px;
  text-align: left;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 60px;
  align-items: center;
}

.hero-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1.1;
  margin-bottom: 24px;
  font-weight: 800;
  background: linear-gradient(
    90deg,
    #00E0FF 0%,
    #FF00E5 50%,
    #00ADB5 100%
  );
  background-size: 200% auto;
  background-position: 100% 0%;
  -webkit-background-clip: text;
  background-clip: text;
  color: #fff;
  will-change: background-position, transform, opacity;
  display: block;
}

.hero-title .char {
  display: inline-block;
  will-change: transform, opacity;
  color: inherit;
  background: inherit;
  -webkit-background-clip: text;
  background-clip: text;
}

.chip-frosted {
  display: inline-block;
  background: rgba(0, 224, 255, 0.1);
  color: var(--blue);
  padding: 10px 20px;
  border-radius: 99px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 224, 255, 0.2);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* No extra styles for .faq-accordion to keep individual cards */

/* --- Text Reveal Animations --- */
.reveal-text {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal-text.active {
  opacity: 1;
  transform: translateY(0);
}

/* --- FAQ Accordion --- */
.faq-item {
  margin-bottom: 16px;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: var(--glass);
  border: none;
  padding: 24px;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.faq-question:hover {
  background: rgba(255, 255, 255, 0.1);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 0 12px 12px;
  padding: 0 24px;
}

.faq-item.active .faq-answer {
  max-height: 200px;
  padding: 20px 24px;
  border: none;
}

.faq-item.active .faq-question {
  border-radius: 12px 12px 0 0;
  border: none;
}

.faq-question i {
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

/* --- Marquee --- */
.marquee-container {
  overflow: hidden;
  width: 100%;
  padding: 40px 0;
}

.marquee-content {
  display: flex;
  width: max-content;
  animation: marquee-scroll 40s linear infinite;
  gap: 32px;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-card {
  width: 350px;
  flex-shrink: 0;
}

/* --- Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.stat-card {
  text-align: center;
  padding: 30px 20px;
}

.stat-card h2 {
  font-size: 2.5rem;
  margin-bottom: 8px;
  color: var(--blue);
}

.stat-card p {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}

.section-header h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 2.5rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.faq-header {
  text-align: center;
}

.faq-header h2 {
  width: 100%;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 40px;
  justify-items: center;
  align-items: center;
}

@media (max-width: 991px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.portfolio-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: #000000;
  border-radius: 24px;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
  width: 100%;
}

.portfolio-card.card-portrait {
  aspect-ratio: 9 / 16;
  max-width: 360px;
  max-height: 68svh; /* Never exceeds viewport height, ensuring total vertical responsiveness */
}

.portfolio-card.card-landscape {
  aspect-ratio: 16 / 9;
  max-width: 600px;
  max-height: 68svh;
}

@media (min-width: 992px) {
  .portfolio-card.card-portrait {
    grid-column: span 2; /* 3 portrait cards * 2 columns = 6 columns (fills row 1) */
  }
  .portfolio-card.card-landscape {
    grid-column: span 3; /* 2 landscape cards * 3 columns = 6 columns (fills row 2) */
  }
}

@media (max-width: 991px) {
  .portfolio-card.card-portrait,
  .portfolio-card.card-landscape {
    grid-column: auto !important;
  }
}

.portfolio-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 224, 255, 0.15);
}

.portfolio-video, .portfolio-static-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* Pure uncropped scaling without any stretching or canvas clipping, matching user request */
  opacity: 0.82;
  filter: brightness(0.85);
  transition: opacity 0.3s ease, transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), filter 0.3s ease;
  z-index: 1;
}

.portfolio-card:hover .portfolio-video,
.portfolio-card:hover .portfolio-static-image {
  opacity: 1;
  filter: brightness(1);
  transform: scale(1.03);
}

.portfolio-gradient-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 55%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.portfolio-card-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.75) 45%, rgba(0, 0, 0, 0.35) 80%, transparent 100%);
  pointer-events: none;
}

.portfolio-tech-porsche, .portfolio-card-title, .portfolio-cta-container {
  pointer-events: auto; /* Restores button and tag click interactions inside absolute shadow footer */
}

.portfolio-card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.portfolio-tech-porsche {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-frosted-mini {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.portfolio-cta-container {
  margin-top: 12px;
  display: flex;
  justify-content: flex-start;
}

.btn-compact-porsche {
  height: 38px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-compact-porsche:hover {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

/* --- Services & Tech Stack --- */
.services-grid, .tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.service-icon, .tech-card-header i {
  font-size: 40px;
  color: var(--cyan);
  margin-bottom: 24px;
  display: block;
}

.tech-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tech-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin: 4px 0;
  color: var(--muted);
  border-radius: 8px;
  background: transparent;
  transition: color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.tech-list li:hover {
  color: #ffffff;
  background: rgba(0, 224, 255, 0.04);
  transform: translateX(8px) !important;
  box-shadow: inset 1px 0 0 rgba(0, 224, 255, 0.3);
  transition: color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.tech-dot {
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--blue);
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tech-list li:hover .tech-dot {
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
  transform: scale(1.4);
}

.marquee-container {
  overflow: hidden;
  padding: 40px 0;
  position: relative;
  -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

/* --- FAQ & Testimonials --- */
.faq-grid, .testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.testimonial-text {
  font-style: italic;
  font-size: 1.1rem;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.9);
}

.faq-accordion .faq-item {
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  margin-bottom: 24px;
  padding: 0;
}

.author-avatar {
  width: 48px;
  height: 48px;
  background: var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

/* --- Contact Section --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 48px;
}

.form-control {
  width: 100%;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  margin-bottom: 20px;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--cyan);
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--muted);
}

/* --- Footer --- */
footer {
  padding: 100px 0 40px;
  position: relative;
  overflow: hidden;
}

footer .video-bg {
  z-index: -2;
}

footer .video-overlay {
  background: rgba(0, 0, 0, 0.6);
  z-index: -1;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.socials a {
  font-size: 20px;
  color: var(--muted);
  margin-right: 20px;
  transition: color 0.3s ease;
}

.socials a:hover {
  color: var(--cyan);
}

/* --- Availability Bar (Marquee) --- */
.availability-bar {
  padding: 24px 0;
  background: rgba(255, 255, 255, 0.02);
  border-y: 1px solid rgba(0, 173, 181, 0.1);
}

.availability-track {
  display: flex;
  width: max-content;
  animation: scroll 20s linear infinite;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-33.33%); }
}

@keyframes nav-glow {
  0%, 100% {
    box-shadow: 0 4px 30px rgba(0, 224, 255, 0.05);
    border-bottom: 1px solid rgba(0, 224, 255, 0.1);
  }
  50% {
    box-shadow: 0 4px 30px rgba(255, 0, 229, 0.12);
    border-bottom: 1px solid rgba(255, 0, 229, 0.2);
  }
}

/* --- About Section Grid --- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}

/* --- Touch device Hover limits (UX Optimization) --- */
@media (hover: none) {
  .portfolio-card:hover {
    transform: none !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important;
  }
  .glass-card:hover {
    transform: none !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
  }
}

/* --- Hero Typing Animation --- */
.hero-typing {
  font-family: 'Fira Code', monospace;
  font-weight: 600;
  font-size: 28px;
  color: #4285F4;
  text-align: left;
  margin: 16px 0 24px 0;
  display: flex;
  align-items: center;
  min-height: 40px; /* Prevent layout shifting */
}

.typing-cursor {
  animation: blink 0.8s infinite step-end;
  color: #4285F4;
  font-weight: 400;
  margin-left: 4px;
}

@keyframes blink {
  from, to { color: transparent; }
  50% { color: #4285F4; }
}

/* --- Mobile Adjustments --- */
@media (max-width: 992px) {
  .hero-grid, .about-grid, .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .about-text h1 {
    font-size: 2.5rem !important;
    margin-bottom: 20px !important;
  }
  .about-text p {
    font-size: 1.15rem !important;
  }
  .hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
  }
}

@media (max-width: 1080px) {
  /* Modern mobile drawer overlay menu */
  nav .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 30px 24px;
    gap: 20px;
    z-index: 1100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
  }
  
  nav .nav-links.active {
    display: flex !important;
    animation: slideDownMobile 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  }
  
  nav .nav-links li, nav .nav-links a {
    width: 100%;
    text-align: left;
    font-size: 1.1rem;
    padding: 10px 0;
  }

  nav .dropdown-content {
    position: static;
    background: rgba(255, 255, 255, 0.03);
    border: none;
    backdrop-filter: none;
    box-shadow: none;
    padding-left: 15px;
    display: none; /* revealed on click or hover */
  }

  nav .dropdown:hover .dropdown-content {
    display: block;
  }
  
  .mobile-toggle {
    display: block !important;
  }
  
  .flip-3d, .flip-3d-inner {
    transform: none !important;
    transition: none !important;
  }
  .flip-3d:hover .flip-3d-inner {
    transform: none !important;
  }
  
  /* Compact layout tokens to avoid overlapping on tablets and mobile headers */
  .logo {
    font-size: 16px !important;
  }
  header .btn {
    padding: 0 14px !important;
    font-size: 13px !important;
    height: 36px !important;
  }
}

@media (max-width: 768px) {
  section {
    padding: 60px 0;
  }
  
  .hero-typing {
    font-size: 20px;
    min-height: 30px;
    margin: 12px 0 20px 0;
  }
  
  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
  }
}

@media (max-width: 500px) {
  .container {
    padding: 0 16px;
  }
  .portfolio-card-bottom {
    padding: 16px;
  }
  .portfolio-card-title {
    font-size: 1.15rem;
  }
  .btn-compact-porsche {
    height: 34px;
    padding: 0 14px;
    font-size: 11px;
  }
}

@media (max-width: 400px) {
  .logo {
    font-size: 15px !important;
  }
  header .btn {
    padding: 0 10px !important;
    font-size: 12px !important;
    height: 32px !important;
  }
}

@keyframes slideDownMobile {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cinematic Glassmorphic Video Modal */
.video-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  opacity: 0;
  transition: opacity 0.4s ease;
  justify-content: center;
  align-items: center;
}

.video-modal.active {
  display: flex;
  opacity: 1;
}

.video-modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 224, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
}

.video-modal-content video {
  width: 100%;
  height: 100%;
  max-height: 85vh;
  object-fit: contain;
}

.video-modal-close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #fff;
  font-size: 50px;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10000;
  line-height: 1;
}

.video-modal-close:hover {
  color: var(--cyan);
  transform: scale(1.1) rotate(90deg);
}

@media (max-width: 768px) {
  .video-modal-close {
    top: 20px;
    right: 25px;
    font-size: 40px;
  }
}

/* --- Resume Download Button Hover & Premium Glow/Shimmer Effects --- */
.resume-btn {
  background: var(--cyan);
  box-shadow: 0 4px 15px rgba(0, 173, 181, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: button-glow-pulse 3s infinite ease-in-out;
  position: relative;
  overflow: hidden;
}

.resume-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
  transform: skewX(-25deg);
  animation: shimmer-sweep 3s infinite linear;
}

.resume-btn:hover {
  transform: translateY(-2px) scale(1.05) !important;
  box-shadow: 0 8px 25px rgba(0, 173, 181, 0.6);
  background: var(--cyan) !important;
  color: #fff !important;
}

/* --- Floating AI Chatbot CSS --- */
.portfolio-chatbot-wrapper {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 10000;
}

.chat-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 173, 181, 0.4), 0 0 15px rgba(255, 0, 229, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #fff;
  font-size: 24px;
  position: relative;
}

.chat-toggle-btn:hover {
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 12px 40px rgba(0, 173, 181, 0.6), 0 0 25px rgba(255, 0, 229, 0.4);
}

.chat-toggle-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 20px;
  border: 2px solid #0d1117;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px var(--pink);
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: 520px;
  max-height: calc(100vh - 140px);
  border-radius: 20px;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 173, 181, 0.1);
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-window.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

.chat-header {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 173, 181, 0.3);
}

.chat-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: 0.5px;
}

.chat-status {
  font-size: 11px;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00E0FF;
  display: inline-block;
  box-shadow: 0 0 8px #00E0FF;
  animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.chat-close-btn {
  background: none;
  border: none;
  color: var(--slate);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0 5px;
  transition: color 0.3s;
}

.chat-close-btn:hover {
  color: var(--pink);
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-bubble.bot {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: var(--slate);
}

.chat-bubble.user {
  background: var(--cyan);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 173, 181, 0.25);
}

.chat-chips-container {
  overflow-x: auto;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  scrollbar-width: none;
}

.chat-chips-container::-webkit-scrollbar {
  display: none;
}

.chat-chips {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.chat-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--slate);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
}

.chat-chip:hover {
  background: rgba(0, 173, 181, 0.15);
  border-color: var(--cyan);
  color: #fff;
  transform: translateY(-1px);
}

.chat-input-area {
  padding: 16px 20px;
  background: rgba(13, 17, 23, 0.98);
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-input-area input {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 18px;
  border-radius: 99px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
}

.chat-input-area input:focus {
  border-color: var(--cyan);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 10px rgba(0, 173, 181, 0.1);
}

.chat-send-btn {
  background: var(--cyan);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 173, 181, 0.3);
}

.chat-send-btn:hover {
  background: #009aa2;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 173, 181, 0.5);
}

/* Typing Indicator Animation */
.typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 20px !important;
}

.typing-bubble .dot {
  width: 6px;
  height: 6px;
  background-color: var(--slate);
  border-radius: 50%;
  display: inline-block;
  animation: bounce ease-in-out both;
  animation-duration: 1.4s;
  animation-iteration-count: infinite;
}

.typing-bubble .dot:nth-child(1) { animation-delay: -0.32s; }
.typing-bubble .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 40px);
    right: -10px;
    bottom: 80px;
    height: 460px;
  }
}
