/* -----------------------------------
   RESET & BASE
----------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  transition: background-color 0.4s ease, color 0.4s ease;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* -----------------------------------
   THEME VARIABLES
----------------------------------- */
:root {
  --bg: #ffffff;
  --text: #0b0f19;
  --accent: #4f46e5;
  --muted: #6b7280;
  --surface: #f9fafb;
  --border: #e5e7eb;
}

[data-theme="dark"] {
  --bg: #0b0f19;
  --text: #f3f4f6;
  --accent: #818cf8;
  --muted: #9ca3af;
  --surface: #1f2937;
  --border: #374151;
}

/* -----------------------------------
   CONTAINERS & LAYOUT
----------------------------------- */
.container {
  width: min(92%, 1200px);
  margin-inline: auto;
  padding-block: 2rem;
}

.section {
  padding: 2.5rem 0;
}

.section-head {
  text-align: center;
  margin-bottom: 3rem;
}

.section-head h2 {
  font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem);
  margin-bottom: 0.5rem;
}

.section-head p {
  color: var(--muted);
  font-size: clamp(0.9rem, 1vw, 1rem);
}

/* -----------------------------------
   HEADER / NAVIGATION
----------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding-block: 0.5rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.4rem;
  text-decoration: none;
  color: var(--text);
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
}

.brand-text span {
  color: var(--accent);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  position: relative;
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent);
}

.main-nav a.active::after,
.main-nav a:hover::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* -----------------------------------
   BUTTONS
----------------------------------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border-radius: 0.6rem;
  text-decoration: none;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all 0.25s ease;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--ghost {
  color: var(--accent);
  border-color: var(--accent);
}

.btn--primary:hover {
  opacity: 0.9;
}

.btn--ghost:hover {
  background: var(--accent);
  color: #fff;
}

/* -----------------------------------
   HERO SECTION
----------------------------------- */
.hero-grid {
  display: grid;
  align-items: center;
  gap: 3rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.hero-copy h1 {
  font-size: clamp(2rem, 3vw + 1rem, 3rem);
  line-height: 1.3;
}

.hero-copy .lead {
  margin: 1rem 0 2rem;
  color: var(--muted);
  font-size: clamp(1rem, 1vw + 0.5rem, 1.125rem);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.hero-tags li {
  background: var(--surface);
  border-radius: 1rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* -----------------------------------
   PROJECTS
----------------------------------- */
.projects-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  display: block;
}

.project-figure img {
  width: 100%;
  border-radius: 1rem;
  transition: transform 0.5s ease;
}

.project-card:hover img {
  transform: scale(1.1);
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
  transition: opacity 0.4s ease;
}

.project-card:hover .overlay {
  opacity: 1;
}

/* -----------------------------------
   TESTIMONIALS
----------------------------------- */
.testimonials {
  background: var(--surface);
}

.slider {
  overflow: hidden;
  position: relative;
}

.slides {
  display: flex;
  transition: transform 0.6s ease;
}

.slide {
  min-width: 100%;
  text-align: center;
  padding: 2rem 1rem;
}

blockquote {
  font-size: clamp(1rem, 1vw + 0.8rem, 1.3rem);
  font-style: italic;
  margin-bottom: 1rem;
}

.slider-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

/* -----------------------------------
   CAPABILITIES & SKILLS
----------------------------------- */
.capabilities-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.cap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
  transition: transform 0.3s ease;
}

.cap-card:hover {
  transform: translateY(-5px);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.chips span {
  background: var(--surface);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

/* -----------------------------------
   CONTACT
----------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.contact-box a {
  color: var(--accent);
  text-decoration: none;
}

form input,
form textarea {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}

/* -----------------------------------
   FOOTER
----------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  background: var(--bg);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-nav a {
  margin-left: 1rem;
  color: var(--muted);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--accent);
}

/* -----------------------------------
   SCROLL TO TOP
----------------------------------- */
#scrollTopBtn {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1000;
}

#scrollTopBtn.show {
  opacity: 1;
  pointer-events: auto;
}

#scrollTopBtn:hover {
  transform: scale(1.1);
  background: var(--text);
  color: var(--bg);
}

/* -----------------------------------
   LOGO LOADER
----------------------------------- */
#loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--text);
  animation: fadeInLogo 1s ease forwards;
}

.loader-logo .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}

.loader-logo .text span {
  color: var(--accent);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

@keyframes fadeInLogo {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* -----------------------------------
   REVEAL ANIMATIONS
----------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* -----------------------------------
   HAMBURGER MENU
----------------------------------- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.hamburger .bar {
  width: 24px;
  height: 3px;
  background-color: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active .bar:nth-child(1) {
  transform: rotate(45deg) translateY(8px);
}
.hamburger.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger.active .bar:nth-child(3) {
  transform: rotate(-45deg) translateY(-8px);
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 300px;
    height: 100%;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right 0.4s ease;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
  }

  .main-nav.open {
    right: 0;
  }

  .nav-actions {
    display: none;
  }

  .nav-actions-mobile {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
}

/* Disable scroll when menu open */
body.menu-open {
  overflow: hidden;
}

/* -----------------------------------
   iOS BLUR OVERLAY
----------------------------------- */
#menuOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 900;
}

#menuOverlay.active {
  opacity: 1;
  visibility: visible;
}

/* Hide mobile actions by default (desktop/tablet) */
.nav-actions-mobile {
  display: none;
}

/* Desktop layout sanity (prevents slide-in styles from affecting desktop) */
@media (min-width: 769px) {
  .main-nav {
    position: static;
    right: auto;
    width: auto;
    height: auto;
    box-shadow: none;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
  }
}

/* Mobile: show mobile actions, hide desktop actions, enable drawer */
@media (max-width: 768px) {
  .nav-actions-mobile {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }

  .nav-actions {
    display: none;
  }

  /* (kept from earlier) drawer styles */
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 300px;
    height: 100%;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: right 0.4s ease;
    box-shadow: -2px 0 12px rgba(0,0,0,.2);
    z-index: 1000;
  }
  .main-nav.open { right: 0; }
}


/* -----------------------------------
   RESPONSIVE ADJUSTMENTS
----------------------------------- */
@media (max-width: 1024px) {
  .section {
    padding: 5rem 0;
  }
}

@media (max-width: 768px) {
  .main-nav a {
    font-size: 1.1rem;
  }
  .section {
    padding: 4rem 0;
  }
  .hero-copy h1 {
    font-size: 2rem;
  }
  .footer-grid {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .hero-copy h1 {
    font-size: 1.8rem;
  }
  .btn {
    width: 100%;
    text-align: center;
  }
  .hero-tags {
    justify-content: center;
  }
  .main-nav a {
    font-size: 0.95rem;
  }
}
