@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=Poppins:wght@600;800&display=swap');

/* ------------- VARIABLES ------------- */
:root {
  /* Dark mode variables */
  --bg: #0f1724;
  --panel: rgba(255, 255, 255, 0.04);
  --muted: rgba(255, 255, 255, 0.6);
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --btn-bg: linear-gradient(90deg, var(--accent), var(--accent-2));
  --btn-text: #031226;
  --btn-ghost-bg: transparent;
  --btn-ghost-border: rgba(255, 255, 255, 0.06);
  --btn-ghost-text: var(--muted);
  --radius: 14px;
}

.light-theme {
  /* Light mode variables */
  --bg: #f6f8fb;
  --panel: #ffffff;
  --muted: rgba(2, 6, 23, 0.6);
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --btn-bg: linear-gradient(90deg, var(--accent), var(--accent-2));
  --btn-text: white;
  --btn-ghost-bg: transparent;
  --btn-ghost-border: rgba(2, 6, 23, 0.1);
  --btn-ghost-text: rgba(2, 6, 23, 0.8);
}

/* ----------- GLOBAL ----------- */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: var(--bg);
  color: #e6eef8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

.container {
  width: min(1200px, 95%);
  margin: 40px auto;
}

/* ----------- HEADER & NAV ----------- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--panel), rgba(255, 255, 255, 0.01));
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.6);
  position: sticky;
  top: 18px;
  z-index: 50;
  transition: background-color 0.3s ease;
  color: var(--muted);
}

header * {
  color: inherit;
  transition: color 0.3s ease;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-family: Poppins, Inter;
  color: #fff;
  user-select: none;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

nav {
  display: flex;
  gap: 14px;
  align-items: center;
}

nav a {
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.2s ease;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  transform: translateY(-3px);
}

/* -------- BUTTONS -------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  user-select: none;
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: 0 12px 30px rgba(124, 92, 255, 0.18);
}

.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

.btn-ghost {
  background: var(--btn-ghost-bg);
  border: 1px solid var(--btn-ghost-border);
  color: var(--btn-ghost-text);
}

.btn-ghost:hover {
  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.3);
  transform: translateY(-2px);
}

/* -------- HERO -------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 40px;
  align-items: center;
  margin-top: 34px;
  transition: color 0.3s ease;
}

.hero-card {
  padding: 34px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.02));
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.6);
  transition: background-color 0.3s ease, color 0.3s ease;
  color: inherit;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  user-select: none;
}

h2 {
  font-size: 44px;
  margin: 12px 0;
  line-height: 1.02;
  color: inherit;
}

p.lead {
  color: var(--muted);
  margin-bottom: 18px;
}

/* CTA */
.cta-row {
  display: flex;
  gap: 12px;
}

/* -------- PROFILE -------- */
.profile {
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background-color 0.3s ease, color 0.3s ease;
  color: inherit;
}

.avatar {
  width: 100%;
  height: 500px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #223047, #17213a);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.04);
  transition: transform 0.6s ease;
}

.avatar:hover img {
  transform: scale(1.09);
}

.profile-stats {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.pill {
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 600;
  user-select: none;
  color: inherit;
}

/* -------- SKILLS -------- */
.section {
  margin-top: 36px;
  color: inherit;
}

.section h3 {
  margin-bottom: 18px;
  color: inherit;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  user-select: none;
  color: var(--muted);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.skill:hover {
  background: var(--accent);
  color: white;
  cursor: default;
}

/* -------- PROJECTS -------- */
.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  color: inherit;
}

.filter {
  padding: 8px 16px;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.filter.active,
.filter:hover {
  background: var(--accent);
  color: white;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.3);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: inherit;
  min-height: 280px;
  border: 1px solid transparent;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.4);
}

.project-thumb {
  width: 100%;
  height: 180px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #111;
  position: relative;
  flex-grow: 1;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.project-card:hover .project-thumb img {
  transform: scale(1.05);
}

.project-title {
  font-weight: 700;
  font-size: 18px;
  margin: 12px 0 8px 0;
  color: inherit;
}

.project-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.project-tag {
  font-size: 12px;
  background: var(--accent);
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  user-select: none;
}

/* -------- MODAL -------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow-y: auto;
  padding: 24px;
  color: #e6eef8;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-card {
  background: var(--panel);
  border-radius: var(--radius);
  max-width: 800px;
  width: 90%;
  padding: 32px;
  box-shadow: 0 16px 50px rgba(2, 6, 23, 0.9);
  color: inherit;
  position: relative;
  border: 1px solid transparent;
}

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 24px;
}

.close {
  position: absolute;
  right: 24px;
  top: 24px;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.3s ease;
}

.close:hover {
  color: white;
}

#modalThumb {
  height: 320px;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
}

#modalThumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* -------- TESTIMONIALS -------- */
.carousel {
  display: flex;
  overflow-x: auto;
  gap: 20px;
  padding: 8px 0;
  color: inherit;
}

.testimonial {
  flex: 0 0 280px;
  background: var(--panel);
  padding: 18px 20px;
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(2, 6, 23, 0.4);
  font-style: italic;
  color: var(--muted);
}

/* -------- BLOG -------- */
.blog-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  color: inherit;
}

.blog-post {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.3);
  cursor: pointer;
  transition: transform 0.3s ease, color 0.3s ease;
  color: inherit;
  border: 1px solid transparent;
}

.blog-post:hover {
  transform: translateY(-5px);
}

.blog-post h4 {
  margin-top: 0;
  color: inherit;
}

/* -------- CONTACT -------- */
.contact-row {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  color: inherit;
}

.contact-form {
  flex: 1 1 380px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: inherit;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: none;
  background: var(--panel);
  color: inherit;
  resize: vertical;
  font-size: 16px;
  font-family: inherit;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  background: rgba(124, 92, 255, 0.1);
}

/* -------- FOOTER -------- */
footer {
  margin-top: 60px;
  padding: 18px 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  user-select: none;
  transition: color 0.3s ease;
}

/* -------- UTILS -------- */
.muted {
  color: var(--muted);
}

.spacer {
  height: 12px;
}

/* -------- RESPONSIVE -------- */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
  }
  
  .profile {
    flex-direction: row;
    align-items: center;
  }
  
  .avatar {
    width: 200px;
    height: 200px;
  }
}

@media (max-width: 768px) {
  .container {
    margin: 20px auto;
  }
  
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  nav {
    width: 100%;
    flex-wrap: wrap;
  }
  
  .hero-card {
    padding: 24px;
  }
  
  h2 {
    font-size: 36px;
  }
  
  .profile {
    flex-direction: column;
  }
  
  .avatar {
    width: 100%;
    height: 200px;
  }
  
  .modal-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-card {
    padding: 24px;
  }
  
  #modalThumb {
    height: 200px;
  }
  
  .contact-row {
    flex-direction: column;
  }
  
  .contact-form {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  h2 {
    font-size: 28px;
  }
  
  .filters {
    flex-wrap: wrap;
  }
  
  .cta-row {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .profile-stats {
    flex-direction: column;
  }
  
  .modal-card {
    padding: 16px;
  }
}

/* -------- LIGHT THEME OVERRIDES -------- */
.light-theme header,
.light-theme header * {
  color: #111 !important;
}

.light-theme nav a {
  color: #111 !important;
}

.light-theme nav a:hover,
.light-theme nav a.active {
  color: var(--accent) !important;
}

.light-theme .hero-card,
.light-theme .profile,
.light-theme .section,
.light-theme .testimonial,
.light-theme .blog-post,
.light-theme footer,
.light-theme .contact-row,
.light-theme .contact-form,
.light-theme .modal-card {
  color: #111 !important;
}

.light-theme input,
.light-theme textarea {
  color: #111 !important;
  background: #fefefe !important;
  border: 1px solid var(--btn-ghost-border);
}

.light-theme input::placeholder,
.light-theme textarea::placeholder {
  color: #666 !important;
}

.light-theme .project-card,
.light-theme .blog-post,
.light-theme .testimonial {
  border: 1px solid rgba(2, 6, 23, 0.05);
  background: #ffffff;
}

.light-theme .project-thumb,
.light-theme #modalThumb {
  background: #f5f5f5;
}

.light-theme .btn-ghost {
  border-color: rgba(2, 6, 23, 0.1);
  color: rgba(2, 6, 23, 0.8);
}

.light-theme .btn-ghost:hover {
  color: white;
}

.light-theme .muted {
  color: rgba(2, 6, 23, 0.6);
}

.light-theme .filter {
  background: rgba(2, 6, 23, 0.05);
}

.light-theme .filter.active,
.light-theme .filter:hover {
  background: var(--accent);
  color: white;
}

.light-theme .skill {
  background: rgba(2, 6, 23, 0.03);
  color: rgba(2, 6, 23, 0.8);
}

.light-theme .skill:hover {
  background: var(--accent);
  color: white;
}