* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root{
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #334155;
  --border: #e5e7eb;

  --hero-bg: #0b1220;
  --hero-text: #ffffff;
  --hero-muted: rgba(255,255,255,0.78);

  --primary: #4f7cff;
  --card: #f8fafc;
  --card-border: #e5e7eb;
}

body.dark{
  --bg: #0b1220;
  --text: #e5e7eb;
  --muted: #b6c2d0;
  --border: rgba(255,255,255,0.10);

  --hero-bg: #050914;
  --hero-text: #ffffff;
  --hero-muted: rgba(255,255,255,0.72);

  --primary: #7aa2ff;
  --card: rgba(255,255,255,0.06);
  --card-border: rgba(255,255,255,0.10);
}

body{
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }
a:hover { text-decoration: underline; }

.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Topbar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.topbar-inner{
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand{
  font-weight: 800;
  letter-spacing: -0.2px;
}

.toggle{
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

/* HERO full width */
.hero{
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: 64px 0;
}

.hero-inner{
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 26px;
  align-items: center;
}

.hero h1{
  margin: 0 0 10px;
  font-size: 46px;
  line-height: 1.08;
  letter-spacing: -0.6px;
}

.subtitle{
  margin: 0;
  color: var(--hero-muted);
  max-width: 760px;
}

/* Buttons */
.cta{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:hover{ transform: translateY(-1px); opacity: 0.95; text-decoration: none; }

.btn.primary{ background: var(--primary); color: #fff; }
/* Light mode buttons */
.btn.secondary {
    border-color: #cbd5f5;
    color: #0f172a;
}
  
/* Dark mode buttons */
body.dark .btn.secondary {
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}
  

/* Hero Image */
.hero-right img{
  width: 100%;
  max-width: 420px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  display: block;
  margin-left: auto;
}

/* Sections */
section{
  padding: 52px 0;
  border-bottom: 1px solid var(--border);
}

h2{
  margin: 0 0 14px;
  font-size: 28px;
  letter-spacing: -0.2px;
}

/* Projects */
.project{
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 22px;
  margin: 16px 0;
  border-radius: 16px;
}

.projects-head {
  text-align: center;
  margin-bottom: 34px;
}

.projects-head h2 {
  font-size: 54px;           /* match My Toolkit / Contact */
  font-weight: 800;
  letter-spacing: -0.8px;
  margin: 0 0 14px;
}

.projects-head .muted {
  max-width: 720px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.5;
}

.project h3{ margin: 0 0 6px; }
.project p{ color: var(--muted); }
.project li{ color: var(--muted); margin: 8px 0; }

.links a{ color: var(--primary); font-weight: 800; }

/* Responsive */
@media (max-width: 860px){
  .hero-inner{ grid-template-columns: 1fr; }
  .hero-right img{ margin: 18px 0 0; max-width: 520px; }
  .hero h1{ font-size: 38px; }
}

/* ========== HERO BACKGROUND IMAGE ========== */

/* LIGHT MODE HERO */
.hero-bg {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
  
    background-image:
      linear-gradient(
        rgba(255, 255, 255, 0.35),
        rgba(255, 255, 255, 0.35)
      ),
      url("./assets/images/light_theme.jpg");
  
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
  
  /* DARK MODE HERO */
  body.dark .hero-bg {
    background-image:
      linear-gradient(
        rgba(2, 6, 23, 0.82),
        rgba(2, 6, 23, 0.82)
      ),
      url("./assets/images/dark_theme.jpg");
  }
  
  
  /* Text container */
.hero-content {
    position: relative;
    z-index: 2;
  }
  
  /* Headline */
  .hero-content h1 {
    font-size: 48px;
    margin-bottom: 12px;
  }
  
  /* Light mode text */
  .hero-content {
    color: #0f172a;
  }
  
  .hero-content .subtitle {
    font-size: 18px;
    max-width: 720px;
    color: #334155;
  }
  
  /* Dark mode text */
  body.dark .hero-content {
    color: #ffffff;
  }
  
  body.dark .hero-content .subtitle {
    color: rgba(255, 255, 255, 0.88);
  }

  body.dark .hero-content h1 {
    text-shadow: 0 6px 24px rgba(0,0,0,0.6);
  }
  
  #role-text {
    font-weight: 700;
    white-space: nowrap;
  }
  
  /* Optional caret cursor */
  #role-text::after {
    content: "▋";
    margin-left: 6px;
    opacity: 1;
    animation: blink 0.9s infinite;
  }
  
  @keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
  }
  .wave {
    display: inline-block;
    transform-origin: 70% 70%;
  }
  
  .wave:hover {
    animation: wave-hand 1.5s ease-in-out;
  }
  
  /* Keyframes for waving */
  @keyframes wave-hand {
    0%   { transform: rotate(0deg); }
    10%  { transform: rotate(14deg); }
    20%  { transform: rotate(-8deg); }
    30%  { transform: rotate(14deg); }
    40%  { transform: rotate(-4deg); }
    50%  { transform: rotate(10deg); }
    60%  { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
  }
      
  #about strong {
    color: var(--primary);
    font-weight: 700;
  }
  
 /* ===== Skills (Tabs + Neat Grid) ===== */
.skills-section {
  padding: 90px 0;
  background: transparent;
}

.skills-title {
  text-align: center;
  font-size: 54px;
  letter-spacing: -0.8px;
  margin: 0 0 26px;
}

/* Tabs row */
.skills-tabs {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 0 auto 34px;
  flex-wrap: wrap;
}

.skills-tabs .tab.active{
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
body.dark .skills-tabs .tab.active{
  background: var(--primary);
}

.tab {
  padding: 12px 22px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.03);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

body.dark .tab {
  background: rgba(255, 255, 255, 0.06);
}

.tab:hover {
  transform: translateY(-1px);
}

.tab.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  
}

body.dark .tab.active {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

/* The neat centered grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(90px, 1fr));
  gap: 18px;
  justify-items: center;
  align-items: center;
  margin: 0 auto;
  max-width: 1100px;
}

/* Tile */
.skill-item {
  width: 104px;
  height: 104px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  position: relative;

  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--border);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

body.dark .skill-item {
  background: rgba(255, 255, 255, 0.06);
}

.skill-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}

/* Icon */
.skill-item img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  opacity: 1;
  filter: none; /* prevents GitHub from disappearing */
}

/* Hover label */
.skill-item::after {
  content: attr(data-label);
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 10px;
  white-space: nowrap;

  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

body.dark .skill-item::after {
  background: #0b1220;
  border-color: rgba(255,255,255,0.12);
  color: #e5e7eb;
}

.skill-item:hover::after {
  opacity: 1;
}

/* GitHub icon fix for dark mode */
body.dark .invert-on-dark {
  filter: invert(1);
}

/* ===== Flip cards under the toolkit ===== */
.flip-grid {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 22px;
}

.flip-card {
  perspective: 1000px;
  height: 170px;
}

.flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(.2,.8,.2,1);
  border-radius: 18px;
}

.flip-card:hover .flip-inner {
  transform: rotateY(180deg);
}

.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 18px;
  padding: 18px 18px;

  background: var(--card);
  border: 1px solid var(--card-border);
}

body.dark .flip-front,
body.dark .flip-back {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255,255,255,0.12);
}

.flip-front h3,
.flip-back h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.flip-front p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.flip-back {
  transform: rotateY(180deg);
  overflow-y: auto;         /* scroll inside card if list is long */
  scrollbar-width: thin; 
}

/* Optional: nicer scrollbar (Chrome/Safari) */
.flip-back::-webkit-scrollbar {
  width: 8px;
}
.flip-back::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 10px;
}
body:not(.dark) .flip-back::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.18);
}


.flip-back ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.flip-back li {
  margin: 8px 0;
  color: var(--muted);
}

/* Nice bullet marker color */
.flip-back li::marker {
  color: var(--primary);
}

/* Responsive */
@media (max-width: 1100px) {
  .flip-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 720px) {
  .flip-grid { grid-template-columns: 1fr; }
}
  

/* --- Projects Grid: equal sized boxes --- */
.projects-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 6px;
}

@media (max-width: 1100px){
  .projects-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px){
  .projects-grid{ grid-template-columns: 1fr; }
}

/* Card base */
.project-card{
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.6);
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
  height: 280px;                 /* ✅ all same height */
  cursor: pointer;
  transform: translateZ(0);
}

body.dark .project-card{
  background: rgba(18, 24, 38, 0.65);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
}

/* Image fills box */
.project-media{
  position: absolute;
  inset: 0;
}
.project-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
  transition: transform 350ms ease;
}

.project-card:hover .project-media img{
  transform: scale(1.04);
}

/* Title always visible */
.project-titlebar{
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
}

.project-titlebar h3{
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  color: #fff;
  font-weight: 700;
}

/* Hover overlay with details */
.project-overlay{
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.15),
    rgba(0,0,0,0.85)
  );
  display: flex;
  align-items: flex-end;
}

.project-card:hover .project-overlay{
  opacity: 1;
  transform: translateY(0);
}

.project-overlay-inner{
  padding: 18px 18px 18px 18px;
  width: 100%;
}

.project-overlay-inner h3{
  margin: 0 0 8px 0;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.project-overlay-inner p{
  margin: 0 0 12px 0;
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  line-height: 1.4;
  max-width: 52ch;
}

/* Meta chips */
.project-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.project-meta span{
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
}

/* Single GitHub button */
.btn-github{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  background: #3b82f6;     /* blue */
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 10px 20px rgba(59,130,246,0.28);
  transition: transform 180ms ease, filter 180ms ease;
}

.btn-github:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
}
/* Filters (Projects) - make them look like Skills buttons + never hide */
.project-filters{
  display: flex;
  flex-wrap: wrap;          /* ✅ allows wrapping instead of overlapping */
  gap: 12px;
  margin: 14px 0 22px;
  position: relative;
  z-index: 5;               /* ✅ stays above the cards */
}

.project-filters .pf{
  appearance: none;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.7);
  color: #0f172a;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.project-filters .pf:hover{
  transform: translateY(-1px);
  border-color: rgba(59,130,246,0.5);
}

.project-filters .pf.active{
  background: #3b82f6;
  border-color: rgba(59,130,246,0.9);
  color: #fff;
  box-shadow: 0 12px 24px rgba(59,130,246,0.25);
}

/* Dark mode (same blue highlight) */
body.dark .project-filters .pf{
  background: rgba(18,24,38,0.55);
  border-color: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.92);
}

body.dark .project-filters .pf.active{
  background: #3b82f6;  /* ✅ highlight blue in dark mode too */
  color: #fff;
  border-color: rgba(59,130,246,0.9);
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* ========= TOP NAV ========= */
.topbar{
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.65);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

body.dark .topbar{
  background: rgba(7,12,24,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.topbar-inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand{
  font-weight: 900;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: #0f172a;
}

body.dark .brand{ color: rgba(255,255,255,0.95); }

.navlinks{
  display: flex;
  gap: 18px;
  align-items: center;
}

.navlink{
  text-decoration: none;
  font-weight: 700;
  color: rgba(15,23,42,0.75);
  padding: 10px 12px;
  border-radius: 999px;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.navlink:hover{
  background: rgba(59,130,246,0.10);
  color: #0f172a;
  transform: translateY(-1px);
}

.navlink.active{
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 10px 20px rgba(59,130,246,0.20);
}

body.dark .navlink{
  color: rgba(255,255,255,0.78);
}
body.dark .navlink:hover{
  background: rgba(59,130,246,0.16);
  color: rgba(255,255,255,0.95);
}
body.dark .navlink.active{
  background: #3b82f6; /* ✅ blue highlight in dark mode too */
  color: #fff;
}

.nav-cta{
  border: 1px solid rgba(59,130,246,0.35);
  background: rgba(59,130,246,0.10);
  color: #1d4ed8;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}
body.dark .nav-cta{
  background: rgba(59,130,246,0.16);
  color: rgba(255,255,255,0.92);
  border-color: rgba(59,130,246,0.35);
}

/* ========= CONTACT SECTION (LIGHT MODE DEFAULT) ========= */
.contact-section{
  padding: 90px 0;
  position: relative;
  overflow: hidden;

  /* Light background */
  background:
    linear-gradient(180deg, #f6f8ff, #eef2ff);
}

.contact-wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px;
}

.contact-head{
  text-align: center;
  margin-bottom: 34px;
}

.contact-head h2{
  font-size: 52px;
  color: #0f172a; /* DARK text */
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}

.contact-underline{
  width: 90px;
  height: 4px;
  background: #3b82f6;
  margin: 0 auto 14px;
  border-radius: 999px;
}

.contact-subtitle{
  color: #475569;
  max-width: 720px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.5;
}

.contact-grid{
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 34px;
  align-items: center;
  margin-top: 26px;
}

.contact-card{
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(15,23,42,0.12);
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 18px 40px rgba(15,23,42,0.12);
}

.contact-card h3{
  margin: 0 0 16px;
  color: #0f172a;
  font-size: 24px;
}

.contact-form{
  display: grid;
  gap: 14px;
}

.contact-form input,
.contact-form textarea{
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.18);
  border-radius: 12px;
  padding: 14px;
  color: #0f172a;
  outline: none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder{
  color: #64748b;
}

.contact-form input:focus,
.contact-form textarea:focus{
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.25);
}

.contact-btn{
  margin-top: 6px;
  width: fit-content;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: #3b82f6;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(59,130,246,0.30);
}

.contact-visual{
  display: flex;
  justify-content: center;
  align-items: center;
}

.contact-visual img{
  max-width: 520px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(15,23,42,0.25));
}

/* ========= CONTACT SECTION (DARK MODE) ========= */
body.dark .contact-section{
  background:
    linear-gradient(rgba(6,12,26,0.75), rgba(6,12,26,0.75)),
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.07) 0px,
      rgba(255,255,255,0.07) 2px,
      transparent 2px,
      transparent 44px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.07) 0px,
      rgba(255,255,255,0.07) 2px,
      transparent 2px,
      transparent 92px
    );
}

body.dark .contact-head h2{
  color: rgba(255,255,255,0.95);
}

body.dark .contact-subtitle{
  color: rgba(255,255,255,0.80);
}

body.dark .contact-card{
  background: rgba(6,12,26,0.55);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 40px rgba(0,0,0,0.30);
}

body.dark .contact-card h3{
  color: rgba(255,255,255,0.92);
}

body.dark .contact-form input,
body.dark .contact-form textarea{
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.92);
}

body.dark .contact-form input::placeholder,
body.dark .contact-form textarea::placeholder{
  color: rgba(255,255,255,0.45);
}

.form-status{
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.4;
  min-height: 20px;
}

.form-status.loading{
  color: rgba(255,255,255,0.75);
}

.form-status.success{
  color: #86efac; /* green-ish */
}

.form-status.error{
  color: #fca5a5; /* red-ish */
}

/* Light mode support (if your contact section switches) */
body:not(.dark) .form-status.loading{ color: #334155; }
body:not(.dark) .form-status.success{ color: #16a34a; }
body:not(.dark) .form-status.error{ color: #dc2626; }

