/* -------------------------------------------------------
   Root Variables
------------------------------------------------------- */
:root {
  --accent: #0d6efd;
  --bg-dark: #121212;
  --bg-dark-alt: #1e1e1e;
  --bg-dark-grad: linear-gradient(135deg, #0d1a32 0%, #112040 100%);
  --text-light: #f1f1f1;
}

/* -------------------------------------------------------
   Base
------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #fefefe;
  color: #212529;
}

.dark {
  background: var(--bg-dark);
  color: var(--text-light);
}

/* -------------------------------------------------------
   Hero
------------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: #fff;
  padding: 100px 0;
  text-align: center;
}

.dark .hero {
  background: var(--bg-dark-grad);
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
}
.hero p {
  font-size: 1.25rem;
  margin-top: 15px;
}

/* -------------------------------------------------------
   Navbar
------------------------------------------------------- */
.navbar-light .navbar-nav .nav-link {
  transition: color 0.2s;
}

.nav-link.active {
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
}

.dark .navbar-light {
  background: var(--bg-dark-alt) !important;
}

.dark .navbar-light .navbar-nav .nav-link,
.dark .navbar-brand {
  color: var(--text-light) !important;
}

.dark .navbar-light .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255,255,255,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}
.dark .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.7);
}

/* -------------------------------------------------------
   Project Cards
------------------------------------------------------- */
.project-card {
  transition: transform 0.25s ease, box-shadow 0.25s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  border: none;
  border-radius: 6px;
  background: #ffffff;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* --- 16:9 image wrapper (added) --- */
.project-image-wrapper {
  position: relative;
  aspect-ratio: 16 / 13;
  overflow: hidden;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.project-image-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center;
  transition: transform 0.35s ease;
}

.project-card:hover .project-image-wrapper img {
  transform: scale(1.06);
}

/* --- override old .project-image --- */
.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 0;
  background: none;
}

.dark .project-card {
  background: var(--bg-dark-alt);
  color: var(--text-light);
}

.dark .card-text {
  color: white !important;
}

/* -------------------------------------------------------
   Contact
------------------------------------------------------- */
.contact {
  background: #f8f9fa;
}

.dark #contact,
.dark section#contact,
.dark .contact {
  background: var(--bg-dark-grad) !important;
  color: var(--text-light);
}

.dark .contact p,
.dark .contact .text-muted {
  color: var(--text-light) !important;
}

/* -------------------------------------------------------
   Reveal Animation
------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}
.reveal.show {
  opacity: 1;
  transform: none;
}

/* -------------------------------------------------------
   Footer
------------------------------------------------------- */
.footer {
  background: #f8f9fa;
  color: #6c757d;
}
.dark .footer {
  background: var(--bg-dark-alt);
  color: #999;
}

/* -------------------------------------------------------
   Back-to-Top
------------------------------------------------------- */
#backToTop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
  background: rgba(0, 119, 181, 0.7);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
@media (min-width: 768px) {
  #backToTop {
    background: var(--accent);
  }
}
#backToTop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* -------------------------------------------------------
   Project card 3D tilt
------------------------------------------------------- */
.project-card {
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: perspective(800px) rotateX(3deg) translateY(-6px) scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .project-card,
  .project-card:hover {
    transform: none !important;
  }
}

.project-card:hover {
  transform: perspective(600px) rotateX(2deg) translateY(-6px);
}

/* -------------------------------------------------------
   Misc
------------------------------------------------------- */
#themeToggle:focus {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}
