/* ===== RESET & CORE ===== */
:root {
  --primary: #2563eb;
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #f5f5f5;
  --text-primary: #f5f5f5;
  --text-muted: #94a3b8;
  --border: rgba(255,255,255,0.1);
  --font-main: 'Inter', sans-serif;
  --font-head: 'Plus Jakarta Sans', sans-serif;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --border: rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
  background: var(--bg); 
  color: var(--text); 
  font-family: var(--font-main); 
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== REVEAL ANIMATIONS ===== */
.reveal-section {
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

.container { 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 0 20px; 
  width: 100%;
}

.section { padding: 100px 0; }
.section-header { text-align: center; margin-bottom: 50px; }
.section-tag { color: var(--primary); font-weight: 700; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; }
.section-title { font-size: 2.5rem; margin-top: 10px; font-family: var(--font-head); }

.skip-link { position: absolute; top: -100px; left: 0; background: var(--primary); color: white; padding: 10px; z-index: 999; }
.skip-link:focus { top: 0; }

/* ===== NAVIGATION ===== */
.navbar {
  position: fixed;
  top: 0; width: 100%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
}
.navbar__inner { display: flex; justify-content: space-between; align-items: center; }
.navbar__logo { 
  font-size: 1.2rem; 
  font-weight: 800; 
  text-decoration: none; 
  color: var(--text); 
  display: flex;
  align-items: center;
  gap: 10px;
}
.navbar__logo-img { flex-shrink: 0; }
.brand-inline {
  display: flex;
  align-items: baseline;
  gap: 0.3em;
  white-space: nowrap;
}
.brand-nexus-inline {
  font-family: 'Arial Black', 'Helvetica Neue', var(--font-head);
  font-size: 1.4em;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -1px;
  filter: drop-shadow(2px 3px 5px rgba(0,0,0,0.5));
}
.brand-soft-world-inline {
  font-family: 'Arial Black', 'Helvetica Neue', var(--font-head);
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 400;
  background: linear-gradient(
      var(--shine-angle, 135deg), 
      #b0b0b0 0%, 
      #ffffff 45%, 
      #b0b0b0 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.5));
}
.logo-accent { color: var(--primary); }
.logo-bracket { color: var(--primary); }
.navbar__links { display: flex; gap: 30px; }
.nav-link { text-decoration: none; color: var(--text-muted); font-weight: 500; }
.nav-link:hover { color: var(--primary); }
.btn-icon { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text); }

/* ===== HERO ===== */
.hero {
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 80px;
  background: radial-gradient(circle at 50% 50%, rgba(37,99,235,0.1), transparent 70%);
}
.hero__eyebrow { color: var(--primary); font-weight: 600; margin-bottom: 10px; }
.hero__name { 
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.metallic-text {
  background: linear-gradient(
      var(--shine-angle, 135deg), 
      #8e9eab 0%, 
      #eef2f3 30%,
      #ffffff 50%,
      #d7d7d7 70%,
      #8e9eab 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent; 
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.5));
  display: inline-block;
}
.brand-nexus {
  font-family: 'Arial Black', 'Helvetica Neue', var(--font-head);
  font-size: clamp(3rem, 10vw, 6.5rem);
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: -2px;
  margin-bottom: 5px;
  filter: drop-shadow(3px 5px 8px rgba(0,0,0,0.6));
}
.brand-soft-world {
  font-family: 'Arial Black', 'Helvetica Neue', var(--font-head);
  font-size: clamp(1rem, 3vw, 1.8rem);
  text-transform: uppercase;
  letter-spacing: 0.6em;
  margin-left: 0.6em;
  font-weight: 400;
  background: linear-gradient(
      var(--shine-angle, 135deg), 
      #b0b0b0 0%, 
      #ffffff 45%, 
      #b0b0b0 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(1px 2px 4px rgba(0, 0, 0, 0.6));
}
.hero__role { font-size: 2rem; font-weight: 700; margin-bottom: 30px; }
.typewriter { color: var(--primary); border-right: 3px solid var(--primary); padding-right: 5px; }
.hero__sub { color: var(--text-muted); max-width: 600px; margin: 0 auto 40px; font-size: 1.1rem; }
.hero__cta { display: flex; gap: 20px; justify-content: center; }

.btn { padding: 12px 30px; border-radius: 8px; font-weight: 600; text-decoration: none; display: inline-block; cursor: pointer; transition: 0.3s; }
.btn--primary { background: var(--primary); color: white; border: none; }
.btn--primary:hover { opacity: 0.9; transform: translateY(-2px); }
.btn--ghost { 
  border: 1px solid var(--primary); 
  color: var(--primary); 
  background: transparent;
}
.btn--ghost:hover { 
  background: var(--primary); 
  color: #fff; 
}

.hero__stats { display: flex; justify-content: center; gap: 60px; margin-top: 60px; }
.stat { display: flex; flex-direction: column; }
.stat__num { font-size: 2.5rem; font-weight: 800; }
.stat__label { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; }

/* ===== ABOUT ===== */
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.about__sub-heading { font-size: 1.5rem; margin-bottom: 25px; font-family: var(--font-head); color: var(--text); position: relative; padding-bottom: 10px; }
.about__sub-heading::after { content: ''; position: absolute; bottom: 0; left: 0; width: 40px; height: 3px; background: var(--primary); }

.about__philosophy { font-size: 1.15rem; color: var(--text); font-weight: 500; margin-bottom: 20px; line-height: 1.8; }
.about__text p { margin-bottom: 1.5rem; color: var(--text-muted); }
.about__btns { display: flex; gap: 15px; margin-top: 30px; }

.skill-item { margin-bottom: 30px; }
.skill-info { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 700; color: var(--text); }
.skill-bar { background: var(--border); height: 10px; border-radius: 5px; overflow: hidden; margin-bottom: 8px; }
.skill-fill { background: var(--primary); height: 100%; width: 0; transition: width 1.5s cubic-bezier(0.65, 0, 0.35, 1); }
.skill-desc { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; line-height: 1.5; }

/* ===== EXPERTISE CARDS ===== */
.expertise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 60px;
}

.expertise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.expertise-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.expertise-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15);
}

.expertise-card:hover::before {
  opacity: 1;
}

.expertise-icon {
  font-size: 2rem;
  margin-bottom: 14px;
  display: block;
  transition: transform 0.3s ease;
}

.expertise-card:hover .expertise-icon {
  transform: scale(1.15);
}

.expertise-card h4 {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.expertise-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}


/* ===== PROJECTS ===== */
.filter-tabs { display: flex; justify-content: center; gap: 15px; margin-bottom: 40px; }
.filter-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); padding: 8px 25px; border-radius: 25px; cursor: pointer; font-weight: 600; transition: 0.3s; }
.filter-btn:hover { border-color: var(--primary); color: var(--text-primary); }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3); }

.section-sub { 
  color: var(--text-muted); 
  max-width: 600px; 
  margin: 10px auto 0; 
  font-size: 1rem; 
}

.projects-grid, .alt-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
  gap: 30px; 
  perspective: 1000px;
}

.alt-grid .project-card {
  border-style: dashed; /* Subtle difference for non-web projects */
}

.project-card { 
  background: var(--surface); 
  border-radius: 12px; 
  overflow: hidden; 
  border: 1px solid var(--border); 
  transition: transform 0.1s ease-out, border-color 0.3s, box-shadow 0.3s; 
  display: flex; 
  flex-direction: column;
  transform-style: preserve-3d;
}
.project-card:hover { 
  border-color: var(--primary); 
  box-shadow: 0 20px 40px rgba(0,0,0,0.4); 
}
.project-card__img { 
  height: 200px; 
  background: var(--surface); 
  background-image: linear-gradient(45deg, var(--surface) 25%, transparent 25%), 
                    linear-gradient(-45deg, var(--surface) 25%, transparent 25%), 
                    linear-gradient(45deg, transparent 75%, var(--surface) 75%), 
                    linear-gradient(-45deg, transparent 75%, var(--surface) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  overflow: hidden; 
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-card__img::after {
  content: 'Preview Image';
  position: absolute;
  color: var(--text-muted);
  font-size: 0.8rem;
  opacity: 0.3;
}
.project-card__img img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  transition: transform 0.5s ease; 
  z-index: 1;
}
.project-card:hover .project-card__img img { transform: scale(1.1); }

.project-card__body { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.project-card__category { 
  font-size: 0.7rem; 
  text-transform: uppercase; 
  color: #fff; 
  font-weight: 800; 
  background: var(--primary);
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  letter-spacing: 0.5px;
  width: fit-content;
}
.project-card__title { margin: 15px 0 10px; font-family: var(--font-head); font-size: 1.25rem; }
.project-card__desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; line-height: 1.5; flex-grow: 1; }
.project-card__footer { display: flex; gap: 12px; margin-top: auto; }

/* ===== CONTACT ===== */
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { position: relative; }
.contact-form input, .contact-form textarea { width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 12px; border-radius: 6px; transition: 0.3s; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.contact-form input.invalid, .contact-form textarea.invalid { border-color: #ef4444; }

.error-msg { color: #ef4444; font-size: 0.75rem; margin-top: 5px; display: block; min-height: 1em; opacity: 0; transition: 0.3s; }
.error-msg.active { opacity: 1; }

.form-status { padding: 10px; border-radius: 6px; font-size: 0.9rem; text-align: center; display: none; }
.form-status.success { display: block; background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid #10b981; }
.form-status.error { display: block; background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid #ef4444; }

/* ===== FOOTER ===== */
.footer { padding: 40px 0; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); }
.footer__inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.footer__logo { display: flex; align-items: center; margin-bottom: 6px; }

/* ===== MODAL ===== */
.modal { 
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2000; /* High but below custom cursor (9999) */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal__backdrop {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  border-radius: 16px; 
  background: var(--surface); 
  color: var(--text); 
  max-width: 800px; 
  width: 90%; 
  margin: auto; 
  padding: 0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2001;
}

.modal.active .modal__content {
  transform: scale(1);
}

.modal__close { 
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--bg); 
  border: 1px solid var(--border); 
  color: var(--text); 
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  z-index: 10;
}
.modal__close:hover { background: var(--primary); color: white; }

.modal__header {
  padding: 40px 40px 20px;
  border-bottom: 1px solid var(--border);
}
.modal__tag {
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
}
.modal__title {
  font-size: 2.5rem;
  margin-top: 5px;
  font-family: var(--font-head);
}

.modal__scroll-area {
  padding: 20px 40px 40px;
  overflow-y: auto;
}

.modal__section {
  margin-bottom: 35px;
}
.modal__section h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal__section p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 24px;
  margin-bottom: 25px;
  list-style: none;
}
.features-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.features-list li::before {
  content: "→";
  color: var(--primary);
  font-weight: 900;
  font-size: 1.1rem;
}

.code-snippet {
  background: #0a0f1d;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  overflow-x: auto;
  margin-top: 15px;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
}
.code-snippet pre {
  margin: 0;
}
.code-snippet code {
  font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.modal__footer {
  padding: 20px 40px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* ===== SCROLL PROGRESS ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease-out;
}

/* ===== HERO CANVAS ===== */
#hero-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ===== GITHUB STATS ===== */
.github-stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gh-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.95rem;
}
.gh-metrics {
  display: flex;
  gap: 20px;
}
.gh-metric {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.gh-metric span {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
}

/* ===== TESTIMONIALS ===== */
.testimonial-carousel-wrapper {
  overflow: hidden;
  position: relative;
  width: 100%;
  padding-bottom: 20px;
}
.testimonial-carousel {
  display: flex;
  gap: 24px;
  cursor: grab;
  overflow-x: auto;
  scroll-behavior: smooth;
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
  user-select: none;
  -webkit-user-select: none;
}
.testimonial-carousel::-webkit-scrollbar {
  display: none;
}
.testimonial-carousel.active {
  cursor: grabbing;
  scroll-behavior: auto;
}
.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  min-width: 320px;
  max-width: 400px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.t-text {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.6;
}
.t-author {
  display: flex;
  flex-direction: column;
}
.t-name {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.95rem;
}
.t-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: 0.3s;
}
.carousel-dot.active {
  background: var(--primary);
  transform: scale(1.2);
}

/* ===== CHECKMARK ANIMATION ===== */
.success-animation {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}
.checkmark {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: block;
  stroke-width: 2;
  stroke: #10b981;
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px #10b981;
  animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}
.checkmark__circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 2;
  stroke-miterlimit: 10;
  stroke: #10b981;
  fill: none;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.checkmark__check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}
@keyframes stroke {
  100% { stroke-dashoffset: 0; }
}
@keyframes scale {
  0%, 100% { transform: none; }
  50% { transform: scale3d(1.1, 1.1, 1); }
}
@keyframes fill {
  100% { box-shadow: inset 0px 0px 0px 30px rgba(16, 185, 129, 0.1); }
}

/* ===== MOBILE DRAWER ===== */
.mobile-menu-btn { display: none; }
.mobile-drawer-backdrop {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-drawer-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  * { cursor: auto !important; }
  .custom-cursor, .custom-cursor-dot { display: none; }
  .hero__name { font-size: 3rem; }
  
  .mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; margin-left: 10px; }
  .navbar__links {
    position: fixed;
    top: 0;
    right: -250px;
    width: 250px;
    height: 100vh;
    background: var(--surface);
    flex-direction: column;
    padding: 80px 30px;
    gap: 20px;
    transition: right 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    display: flex;
    z-index: 1000;
  }
  .navbar__links.active { right: 0; }
  .about__grid, .contact__grid { grid-template-columns: 1fr; }
  .features-list { grid-template-columns: 1fr; }
  .modal__header, .modal__scroll-area, .modal__footer { padding: 25px; }
  .modal__title { font-size: 1.8rem; }
  .expertise-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-tabs { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .expertise-grid { grid-template-columns: 1fr; }
  .hero__stats { gap: 30px; }
  
  /* Fix logo wrapping on very small screens */
  .brand-inline { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 0px; 
  }
  .brand-nexus-inline { font-size: 1.3em; letter-spacing: -0.5px; }
  .brand-soft-world-inline { font-size: 0.75em; letter-spacing: 0.2em; }
  .navbar__logo-img { height: 45px !important; }
  
  /* Fix hero text sizes so it doesn't overflow horizontally */
  .brand-nexus { font-size: clamp(2.5rem, 12vw, 4rem); letter-spacing: -1px; }
  .brand-soft-world { font-size: clamp(0.9rem, 4vw, 1.2rem); letter-spacing: 0.4em; margin-left: 0; }
}
