/* -----------------------------------
   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;
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #0b0f19;
  --text: #f3f4f6;
  --accent: #818cf8;
  --muted: #9ca3af;
  --surface: #1f2937;
  --border: #374151;
}

/* Smooth fade between themes */
html.theme-fade {
  opacity: 0;
  transition: opacity 0.18s ease;
}

/* -----------------------------------
   CONTAINERS & LAYOUT
----------------------------------- */
.container {
  width: min(92%, 1200px);
  margin-inline: auto;
  padding-block: 2rem;
}

.section {
  padding: 6rem 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);
}

/* Nav links */
.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;
}

/* Hide mobile actions by default */
.nav-actions-mobile {
  display: none;
}

/* -----------------------------------
   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
----------------------------------- */
.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: 1rem;
}

.hero-tags li {
  background: var(--surface);
  border-radius: 1rem;
  padding: 0.4rem 0.9rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* -----------------------------------
   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.05);
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  opacity: 0;
  display: flex;
  align-items: center;
  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%;
  padding: 2rem 1rem;
  text-align: center;
}

blockquote {
  font-size: clamp(1rem, 1vw + 0.8rem, 1.2rem);
  font-style: italic;
  margin-bottom: 1rem;
}

/* -----------------------------------
   CAPABILITIES
----------------------------------- */
.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);
}

/* -----------------------------------
   SKILLS
----------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.chips span {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* -----------------------------------
   CONTACT
----------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

form input,
form textarea {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.8rem;
  border-radius: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
}

/* -----------------------------------
   FOOTER
----------------------------------- */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.footer-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.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;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 1.2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#scrollTopBtn.show {
  opacity: 1;
  pointer-events: auto;
}

#scrollTopBtn:hover {
  transform: scale(1.1);
}

/* -----------------------------------
   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-size: 2rem;
  font-weight: 700;
  color: var(--text);
  animation: fadeIn 1s ease forwards;
}

.loader-logo .dot {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.4s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* -----------------------------------
   REVEAL ANIMATION
----------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* -----------------------------------
   MOBILE NAV (HAMBURGER)
----------------------------------- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  width: 36px;
  height: 36px;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.bar {
  width: 24px;
  height: 3px;
  background: var(--text);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.active .bar:nth-child(1) { transform: rotate(45deg) translateY(7px); }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(3) { transform: rotate(-45deg) translateY(-7px); }

/* MOBILE NAV DRAWER */
@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;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: right 0.4s ease;
    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 is 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);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 900;
}

#menuOverlay.active {
  opacity: 1;
  visibility: visible;
}

/* -----------------------------------
   RESPONSIVE TWEAKS
----------------------------------- */
@media (max-width: 1024px) {
  .section { padding: 4.5rem 0; }
}

@media (max-width: 768px) {
  .hero-copy h1 { font-size: 2rem; }
  .main-nav a { font-size: 1.1rem; }
  .footer-grid { flex-direction: column; }
}

@media (max-width: 480px) {
  .btn { width: 100%; text-align: center; }
  .hero-copy h1 { font-size: 1.8rem; }
  .main-nav a { font-size: 1rem; }
}

/* -----------------------------------
   SKIP LINK (Accessibility)
----------------------------------- */
.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem; top: 1rem;
  background: var(--accent);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: .5rem;
  z-index: 2000;
}
