/* ═══════════════════════════════════════════════════
   CUSTOM STYLES — microsoft.ai-inspired portfolio
   ═══════════════════════════════════════════════════ */

/* ── Base ────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
::selection { background-color: #D8876E; color: #fff; }

/* ── Preloader ───────────────────────────────────── */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #F4EBD8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader img {
  width: clamp(300px, 50vw, 600px); /* Larger size for better visibility */
  height: auto;
}
#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

/* ── Typography ──────────────────────────────────── */
.section-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: #D8876E;
  font-weight: 500;
  margin-bottom: 1rem;
}

.section-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  color: #2B2B2B;
  line-height: 1.15;
}

/* ── Buttons ─────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, #D8876E, #C06A50);
  color: #fff; font-weight: 600; font-size: 0.875rem;
  border-radius: 9999px; letter-spacing: 0.03em;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 4px 14px rgba(216,135,110,0.3);
  cursor: pointer; border: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(216,135,110,0.45);
  background: linear-gradient(135deg, #C06A50, #A85840);
}

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 2rem;
  background: transparent; color: #2B2B2B; font-weight: 600; font-size: 0.875rem;
  border-radius: 9999px; letter-spacing: 0.03em;
  border: 2px solid #2B2B2B;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
}
.btn-secondary:hover {
  background: #2B2B2B; color: #fff; transform: translateY(-2px);
}

/* ── Cat Mascot ──────────────────────────────────── */
.cat-mascot {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 40px; /* Matching common logo/icon sizing */
  height: auto;
  pointer-events: none;
  z-index: 10;
  margin-bottom: -4px; /* Slight overlap to look like it's sitting *on* the button */
}

/* ── Cards ───────────────────────────────────────── */
.card {
  background: #fff; border-radius: 1.25rem; padding: 1.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  isolation: isolate;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

/* ── Skill Pills ─────────────────────────────────── */
.skill-pill {
  display: inline-flex; align-items: center;
  padding: 0.5rem 1.25rem;
  background: #fff; color: #2B2B2B;
  font-size: 0.8125rem; font-weight: 500;
  border-radius: 9999px; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: all 0.25s ease;
}
.skill-pill:hover {
  background: #D8876E; color: #fff;
  transform: translateY(-2px); box-shadow: 0 4px 12px rgba(216,135,110,0.3);
}

/* ── Tech Tags ───────────────────────────────────── */
.tech-tag {
  display: inline-block; font-size: 0.6875rem;
  padding: 0.25rem 0.75rem; border-radius: 9999px;
  background: #F4EBD8; color: #6B6B6B; font-weight: 500;
  transition: all 0.2s ease;
}
.tech-tag:hover { background: #D8876E; color: #fff; }

/* ── Project Cards ───────────────────────────────── */
.project-card {
  background: #fff; border-radius: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  isolation: isolate;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.1);
}
.project-card-img {
  position: relative; height: 200px; overflow: hidden;
  border-top-left-radius: 1.25rem;
  border-top-right-radius: 1.25rem;
}



/* ═══════════════════════════  CAROUSEL  ═══════════════════════════ */

.carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  padding: 20px 0;
}

.carousel-track {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 900px;
  position: relative;
  height: 320px;
  perspective: 1000px;
}

.carousel-slide {
  position: absolute;
  width: 320px;
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.7) translateX(0);
}

.carousel-slide img {
  width: 100%;
  height: 240px;
  object-fit: contain;
  background: #f9f5ee;
  padding: 8px;
}

/* Side cards */
.carousel-slide.slide-left {
  opacity: 0.6;
  transform: translateX(-110%) scale(0.78);
  pointer-events: auto;
  z-index: 1;
}

.carousel-slide.slide-right {
  opacity: 0.6;
  transform: translateX(110%) scale(0.78);
  pointer-events: auto;
  z-index: 1;
}

/* Far side cards */
.carousel-slide.slide-far-left {
  opacity: 0.25;
  transform: translateX(-190%) scale(0.6);
  pointer-events: none;
  z-index: 0;
}

.carousel-slide.slide-far-right {
  opacity: 0.25;
  transform: translateX(190%) scale(0.6);
  pointer-events: none;
  z-index: 0;
}

/* Center card — highlighted & popped */
.carousel-slide.slide-center {
  opacity: 1;
  transform: translateX(-50%) scale(1.05);
  left: 50%;
  z-index: 5;
  pointer-events: auto;
  box-shadow: 0 16px 50px rgba(216,135,110,0.25), 0 4px 20px rgba(0,0,0,0.12);
}

/* Override the left positioning for side cards */
.carousel-slide.slide-left { left: calc(50% - 360px); transform: scale(0.78); }
.carousel-slide.slide-right { left: calc(50% + 40px); transform: scale(0.78); }
.carousel-slide.slide-far-left { left: calc(50% - 560px); transform: scale(0.6); }
.carousel-slide.slide-far-right { left: calc(50% + 240px); transform: scale(0.6); }

/* Arrows */
.carousel-arrow {
  position: absolute;
  z-index: 10;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #EDE4D0;
  color: #2B2B2B;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.carousel-arrow:hover {
  background: #D8876E; color: #fff; border-color: #D8876E;
  transform: scale(1.1);
}
.carousel-arrow-left { left: 0; }
.carousel-arrow-right { right: 0; }

/* Dots */
.carousel-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #D4DAE0;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}
.carousel-dot.active {
  background: #D8876E;
  transform: scale(1.3);
}

/* ── All Certs Grid Card ─────────────────────────── */
.cert-grid-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
  position: relative;
  isolation: isolate;
}
.cert-grid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}
.cert-grid-card img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #f9f5ee;
  padding: 6px;
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
}
.cert-grid-card-info {
  padding: 0.75rem 1rem;
}
.cert-grid-card-info h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2B2B2B;
  line-height: 1.3;
}
.cert-grid-card-info p {
  font-size: 0.75rem;
  font-weight: 500;
  color: #D8876E;
  margin-top: 0.25rem;
}


/* ── Certificate Modal ───────────────────────────── */
.cert-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 2rem;
}
.cert-modal.open { opacity: 1; pointer-events: auto; }
.cert-modal-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s ease; z-index: 101;
}
.cert-modal-close:hover { background: rgba(255,255,255,0.3); }
.cert-modal-body {
  max-width: 90vw; max-height: 90vh;
  display: flex; align-items: center; justify-content: center;
}
.cert-modal-body img {
  max-width: 100%; max-height: 85vh;
  border-radius: 0.75rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}


/* ── Navbar ──────────────────────────────────────── */
.nav-link { position: relative; color: #2B2B2B; transition: color 0.3s ease; }
.nav-link::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 2px; background: #D8876E; border-radius: 1px;
  transition: width 0.3s ease;
}
.nav-link:hover { color: #D8876E; }
.nav-link:hover::after { width: 100%; }

#navbar.scrolled {
  background: rgba(244,235,216,0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 12px rgba(0,0,0,0.06);
}

/* ── Hamburger ───────────────────────────────────── */
.hamburger-bar {
  display: block; width: 24px; height: 2px;
  background: #2B2B2B; border-radius: 2px; transition: all 0.3s ease;
}
.hamburger-open .hamburger-bar:nth-child(1) { transform: rotate(45deg) translate(4px,4px); }
.hamburger-open .hamburger-bar:nth-child(2) { opacity: 0; }
.hamburger-open .hamburger-bar:nth-child(3) { transform: rotate(-45deg) translate(4px,-4px); }

/* ── Mobile Menu ─────────────────────────────────── */
.mobile-menu-overlay {
  position: fixed; inset: 0;
  background: rgba(244,235,216,0.97);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.4s ease; z-index: 40;
}
.mobile-menu-overlay.open { opacity: 1; pointer-events: auto; }
.mobile-link { color: #2B2B2B; font-family: 'Playfair Display', Georgia, serif; transition: color 0.25s ease; }
.mobile-link:hover { color: #D8876E; }

/* ── Footer Icons ────────────────────────────────── */
.footer-icon { color: rgba(255,255,255,0.5); transition: all 0.25s ease; }
.footer-icon:hover { color: #F2B28A; transform: translateY(-2px); }

/* ── Scroll Animations ───────────────────────────── */
.fade-up {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1), transform 0.7s cubic-bezier(0.4,0,0.2,1);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.fade-up:nth-child(2) { transition-delay: 0.1s; }
.fade-up:nth-child(3) { transition-delay: 0.2s; }
.fade-up:nth-child(4) { transition-delay: 0.3s; }

/* ── Contact Form Focus ──────────────────────────── */
#contact-form input:focus,
#contact-form textarea:focus {
  box-shadow: 0 0 0 3px rgba(242,178,138,0.2);
}

/* ── Back to Top ─────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background: #D8876E;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(216,135,110,0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 99;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: #C06A50;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(192,106,80,0.5);
}

/* ── Contact GIF ─────────────────────────────────── */
.contact-gif {
  margin-top: 2rem;
  width: 100%;
  max-width: 280px;
  border-radius: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: block;
  transition: transform 0.3s ease;
}

.contact-gif:hover {
  transform: scale(1.02);
}


/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .carousel-slide { width: 260px; }
  .carousel-slide img { height: 190px; }
  .carousel-slide.slide-left { left: calc(50% - 280px); }
  .carousel-slide.slide-right { left: calc(50% + 20px); }
  .carousel-slide.slide-far-left,
  .carousel-slide.slide-far-right { display: none; }
  .carousel-arrow { width: 40px; height: 40px; }
}

@media (max-width: 640px) {
  .section-heading { font-size: 1.875rem; }
  .carousel-slide { width: 220px; }
  .carousel-slide img { height: 160px; }
  .carousel-slide.slide-left { left: calc(50% - 240px); }
  .carousel-slide.slide-right { left: calc(50% + 20px); }
}

/* ── Animated Glowing Borders ────────────────────── */
.training-card { 
  position: relative;
  isolation: isolate; 
}

.card::before, .project-card::before, .cert-grid-card::before, .training-card::before {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: -2;
  background: linear-gradient(45deg, #D8876E, #F4EBD8, #D8876E, #F4EBD8);
  background-size: 300% 300%;
  filter: blur(6px);
  animation: glowBorder 4s ease infinite alternate;
}

.card::after, .project-card::after, .cert-grid-card::after, .training-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #fff;
}

.card::before, .project-card::before { border-radius: 1.5rem; }
.cert-grid-card::before { border-radius: 1.25rem; }
.training-card::before { border-radius: 1.25rem; }

.card::after, .project-card::after { border-radius: 1.25rem; }
.cert-grid-card::after { border-radius: 1rem; }
.training-card::after { border-radius: 1rem; }

@keyframes glowBorder {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}


/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #F4EBD8; }
::-webkit-scrollbar-thumb { background: #D8876E; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #C06A50; }

/* ---------------------------------------------------
   PRELOADER ANIMATION
   --------------------------------------------------- */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
}
.anim-scene {
  position: absolute;
  width: 240px; height: 240px;
  stroke: #E8432D; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  fill: #fff; pointer-events: none;
}
.anim-scene [fill="none"] { fill: none !important; }
.anim-scene.no-fill { fill: none !important; }

/* Airplane: 0-2s (0% - 33.33%) */
.scene-airplane {
  opacity: 1; animation: planeAnim 6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes planeAnim {
  0% { transform: scale(0.2) translateX(-100px); opacity: 0; }
  5% { transform: scale(1) translateX(0); opacity: 1; }
  15% { transform: scale(1) translateY(-8px); }
  25% { transform: scale(1) translateY(8px); }
  31% { transform: scale(1) translateY(0); opacity: 1; }
  33.33% { transform: scaleY(0.1) translateY(0); opacity: 0; }
  100% { transform: scaleY(0.1) translateY(0); opacity: 0; }
}

/* Car: 2-4s (33.33% - 66.66%) */
.scene-car {
  opacity: 0; animation: carAnim 6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes carAnim {
  0%, 31% { opacity: 0; transform: scaleY(0.1); }
  33.33% { opacity: 1; transform: scaleY(1); }
  42% { transform: translateY(-8px); }
  50% { transform: translateY(0); }
  58% { transform: translateY(-4px); }
  64% { opacity: 1; transform: translateY(0) scaleY(1); }
  66.66% { opacity: 0; transform: translateY(-20px) scaleY(1.5); }
  100% { opacity: 0; }
}

/* Building: 4-6s (66.66% - 100%) */
.scene-building {
  opacity: 0; animation: bldgAnim 6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes bldgAnim {
  0%, 64% { opacity: 0; transform: translateY(-20px) scaleY(1.5); }
  66.66% { opacity: 1; transform: translateY(0) scaleY(1); }
  72% { transform: scale(1.03); }
  76%, 95% { transform: scale(1); opacity: 1; }
  100% { opacity: 0; transform: scale(0.8); }
}

.drifting-cloud { animation: drift 2s linear infinite; }
@keyframes drift { 0% { transform: translateX(5px); } 50% { transform: translateX(-5px); } 100% { transform: translateX(5px); } }
.speed-line { animation: dashSpeed 0.5s linear infinite; }
@keyframes dashSpeed { 0% { transform: translateX(0); } 100% { transform: translateX(-10px); opacity: 0; } }

.building-path { stroke-dasharray: 400; stroke-dashoffset: 400; animation: drawBldg 6s ease-out forwards; }
@keyframes drawBldg { 0%, 65% { stroke-dashoffset: 400; } 72%, 100% { stroke-dashoffset: 0; } }
.window-path { opacity: 0; animation: popWindow 6s ease-out forwards; transform-origin: center; }
@keyframes popWindow { 0%, 72% { opacity: 0; transform: scale(0); } 76%, 100% { opacity: 1; transform: scale(1); } }

