/* ===== Base Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== CSS Variables (light & dark via data-theme) ===== */
:root {
  --bg-main: radial-gradient(circle at top, #1f2937 0, #020617 55%);
  --bg-card: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(17, 24, 39, 0.98));
  --text-main: #e2e8f0;
  --text-soft: #9ca3af;
  --accent-1: #60a5fa;
  --accent-2: #a855f7;
  --nav-bg: rgba(15, 23, 42, 0.9);
  --border-subtle: rgba(148, 163, 184, 0.4);
  --shadow-strong: 0 18px 45px rgba(15, 23, 42, 0.9);
  --card-border-radius: 18px;
}

[data-theme="light"] {
  --bg-main: radial-gradient(circle at top, #e0f2fe 0, #f9fafb 55%);
  --bg-card: linear-gradient(135deg,
      rgba(255, 255, 255, 0.9),
      rgba(243, 244, 246, 0.96));
  --text-main: #111827;
  --text-soft: #4b5563;
  --accent-1: #2563eb;
  --accent-2: #a855f7;
  --nav-bg: rgba(255, 255, 255, 0.96);
  --border-subtle: rgba(148, 163, 184, 0.35);
  --shadow-strong: 0 16px 40px rgba(15, 23, 42, 0.18);
}

/* ===== Body / Global ===== */
body {
  font-family: 'Poppins', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  background: var(--bg-main);
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== Navbar ===== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

nav .nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

nav .logo {
  font-weight: 700;
  color: var(--accent-1);
  letter-spacing: 0.04em;
}

nav .logoindex {
  font-weight: 700;
  color: var(--accent-1);
  letter-spacing: 0.04em;
  color: transparent;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* hide the mobile theme button on desktop */
.nav-menu-theme {
  display: none;
}

/* desktop menu */
.nav-menu {
  list-style: none;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0 auto;
}

nav a.nav-link {
  font-weight: 500;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

nav a.nav-link:hover {
  background: rgba(148, 163, 184, 0.18);
  transform: translateY(-1px);
}

/* hamburger button (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 4px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-main);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Theme toggle button */
.theme-toggle {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  background: transparent;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ===== Layout ===== */
.main {
  max-width: 1100px;
  margin: 2.5rem auto 3rem;
  padding: 0 1.5rem;
}

/* ===== Home (Hero) ===== */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  /* left narrower, right wider */
  gap: 2.5rem;
  align-items: center;
}

/* glass card */
.hero-inner {
  padding: 1.8rem 2rem;
  border-radius: 24px;
  background: linear-gradient(135deg,
      rgba(148, 163, 184, 0.18),
      rgba(148, 163, 184, 0.04));
  border: 1px solid rgba(148, 163, 184, 0.5);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow-strong);
  animation: fadeUp 0.7s ease-out;
}

.hero-text h1,
.hero-text h2 {
  text-align: center;
}

.hero-text h1 {
  font-size: 2.7rem;
  margin-bottom: 0.3rem;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;

}

.hero-text h2 {
  font-size: 1.25rem;
  color: var(--text-soft);
  margin-bottom: 1rem;
}

.hero-text p {
  color: var(--text-soft);
  margin-bottom: 1.3rem;
}

.hero-meta {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 1.2rem;
}

.hero-meta span {
  display: inline-block;
  margin-right: 0.75rem;
}

/* ===== Buttons ===== */
.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, border 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #a855f7);
  color: #fff;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.6);
}

.btn-outline {
  border-color: var(--accent-1);
  color: var(--text-main);
  background: transparent;
}

.btn-outline:hover {
  background: rgba(37, 99, 235, 0.15);
}

/* ===== Hero Photo ===== */
.hero-photo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-photo {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.6);
  padding: 4px;
  background: radial-gradient(circle at top, rgba(96, 165, 250, 0.7), rgba(15, 23, 42, 0.95));
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.9);
  transform: translateY(4px);
  animation: float 5s ease-in-out infinite;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.hero-photo-info {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-soft);
  max-width: 260px;
}

.hero-photo-line {
  margin-bottom: 0.4rem;
}

.hero-photo-btn {
  display: inline-block;
  margin: 0.4rem 0;
}

/* ===== Section Titles ===== */
.section-title {
  font-size: 1.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.section-subtitle {
  color: var(--text-soft);
  margin-bottom: 1.5rem;
}

/* ===== Glass Cards ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--card-border-radius);
  padding: 1.6rem 1.7rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-strong);
  border: 1px solid rgba(148, 163, 184, 0.35);
  backdrop-filter: blur(16px);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border 0.15s ease;
  animation: fadeUp 0.6s ease-out;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 55px rgba(15, 23, 42, 0.95);
  border-color: rgba(96, 165, 250, 0.7);
}

.card h2 {
  margin-bottom: 0.4rem;
  font-size: 1.15rem;
  color: var(--text-main);
}

.card h3 {
  margin-bottom: 0.4rem;
  font-size: 1rem;
  color: var(--accent-1);
}

.card-meta {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-bottom: 0.6rem;
}

.card p,
.card li {
  color: var(--text-main);
}

.card ul {
  margin-left: 1.1rem;
  margin-top: 0.3rem;
}

/* ===== Skills Grid ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
}

.skill-category h2 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.skill-category ul {
  list-style: none;
}

.skill-category li {
  margin-bottom: 0.2rem;
  color: var(--text-main);
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* ===== Animations ===== */
@keyframes float {

  0%,
  100% {
    transform: translateY(4px);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Responsive (nav + hero) ===== */
@media (max-width: 768px) {

  /* mobile nav */
  .nav-inner {
    align-items: center;
  }

  .nav-menu {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1.5rem 1rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: none;
  }

  .nav-menu.show {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  /* hide desktop theme button on mobile */
  .nav-right .theme-toggle {
    display: none;
  }

  /* show theme toggle inside menu on mobile */
  .nav-menu-theme {
    display: block;
    margin-top: 0.5rem;
  }

  .nav-menu-theme .theme-toggle {
    display: inline-flex;
    margin-top: 0.25rem;
  }

  /* hero layout (same as before) */
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-inner {
    padding: 1.2rem 1.1rem;
  }

  .hero-text h1 {
    font-size: 2.0rem;
  }

  .hero-text h2 {
    font-size: 1.0rem;
  }

  .hero-text p {
    font-size: 0.9rem;
  }

  .main {
    margin-top: 1.2rem;
  }
}

/* Project PAGE */

.card-title {
  position: relative;
  padding-right: 100px;
  /* more room */
  margin-bottom: 1rem;
}

.view-project-badge {
  position: absolute !important;
  right: -1.20rem;
  top: 10%;
  /* ← CHANGE: center vertically on title line */
  transform: translateY(-10%);
  /* ← CHANGE: pull up 50% of its own height */

  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;

  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: white !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  line-height: 1.2 !important;

  padding: 0.5rem 1rem !important;
  border-radius: 50px !important;
  border: none !important;
  text-decoration: none !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;

  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4) !important;

  transform: translateY(0);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.view-project-badge:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  transform: translateY(-3px) scale(1.05) !important;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.6) !important;
}

/* skill page */
.skills-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* FORCE 3 cards */
    gap: 1.5rem !important;
    max-width: 1200px !important; /* Fits 3 perfectly */
    margin: 3rem auto !important;
    padding: 0 1rem !important;
}

.skill-category {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.skill-category:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.skill-category h2 {
    font-size: 1.3rem;
    margin: 0 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    color: #1f2937;
}

.skill-category ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0; /* Space before button */
}

.skill-category li {
    padding: 0.6rem 0 0.6rem 2rem;
    position: relative;
    color: #4b5563;
    font-size: 1rem;
}

.skill-category li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* Button - Clean spacing, no overlap */
.skill-toggle {
    max-height: 50px; /* Just button */
    overflow: hidden;
    transition: max-height 0.4s ease;
    margin-top: 0.5rem;
}

.skill-toggle.expanded {
    max-height: 750px;
}

.toggle-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 30px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* Dark mode */
[data-theme="dark"] .skill-category { background: rgba(31,41,55,0.5); border-color: rgba(75,85,79,0.3); }
[data-theme="dark"] .skill-category h2 { color: #f9fafb; }
[data-theme="dark"] .skill-category li { color: #d1d5db; }

/* Responsive */
/* @media (max-width: 768px) { .skills-grid { grid-template-columns: 1fr; } } */

/* Tablet: 2 cards */
@media (max-width: 1100px) {
    .skills-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
        max-width: 800px !important;
    }
}

/* Mobile: 1 card */
@media (max-width: 768px) {
    .skills-grid { 
        grid-template-columns: 1fr !important; 
        max-width: 400px !important;
        gap: 1.25rem !important;
    }
}