/* =========
   Base
   ========= */

:root {
  /* Default (Light) theme variables */
  --bg: #f5f7ff;
  --bg-soft: rgba(255, 255, 255, 0.8);
  --text-main: #111827;
  --text-soft: #6b7280;
  --accent: #38bdf8; /* Blue */
  --accent-2: #a855f7; /* Purple */
  --accent-soft: rgba(56, 189, 248, 0.14);
  --border-subtle: rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
  --card-radius: 26px;
  --transition-fast: 180ms ease-out;
}

body.dark {
  /* Dark mode variables - Improved contrast */
  --bg: #020617; /* Very Dark Base */
  --bg-soft: rgba(15, 23, 42, 0.92);
  --text-main: #e5e7eb; /* Brighter White for Main Text */
  --text-soft: #c9ccd0; /* Brighter Gray for Descriptions */
  --accent-soft: rgba(56, 189, 248, 0.25);
  --border-subtle: rgba(148, 163, 184, 0.35); /* Better border visibility */
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.9);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Inter", sans-serif;
  background: var(--bg);
  color: var(--text-main);
  overflow-x: hidden;
}

/* Background canvas */

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}

/* Preloader (Unchanged) */

#preloader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #4ade80 0, #1d4ed8 40%, #020617 80%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  color: #e5e7eb;
}

.preloader-inner {
  text-align: center;
  animation: fadeIn 0.8s ease-out forwards;
}

.preloader-logo {
  width: 70px;
  height: 70px;
  border-radius: 22px;
  background: linear-gradient(135deg, #22c55e, #0ea5e9, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 28px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.7);
  margin: 0 auto 12px;
}

/* Layout */

.page-wrapper {
  position: relative;
  min-height: 100vh;
}

/* Navbar - Fixed visibility issues */

.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(248, 250, 252, 0.98); 
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

body.dark .navbar {
  background: rgba(15, 23, 42, 0.98); 
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  color: var(--text-main);
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-soft);
  font-size: 14px;
  position: relative;
  padding-bottom: 4px;
  transition: color 140ms ease-out;
  cursor: pointer;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 160ms ease-out;
}

.nav-links a:hover {
  color: var(--text-main);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  border: none;
  outline: none;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.icon-button:hover {
  background: rgba(56, 189, 248, 0.12);
  transform: translateY(-1px);
}

.theme-toggle .theme-icon {
  font-size: 18px;
}

/* Burger (mobile) */

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.burger span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-main);
  transition: transform 160ms ease-out, opacity 160ms ease-out;
}

.burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger.open span:nth-child(2) {
  opacity: 0;
}

.burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Sections (Unchanged) */

.section {
  padding: 72px 16px 60px;
}

.section-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.section-header h2 {
  font-size: 28px;
  margin-bottom: 4px;
}

.section-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
}

/* Hero */

.hero {
  padding-top: 80px;
}

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 56px;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.5fr);
  gap: 40px;
  align-items: center;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.hero-title {
  font-size: clamp(32px, 4vw, 40px);
  margin: 0 0 8px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wave {
  display: inline-block;
  animation: wave 1.4s infinite;
  transform-origin: 70% 70%;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--accent-2);
  margin: 0 0 12px;
  min-height: 22px;
}

.hero-description {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--text-soft);
  max-width: 460px;
}

/* typing (simple blink) */

.typing::after {
  content: "|";
  display: inline-block;
  margin-left: 2px;
  animation: blink 1s step-start infinite;
}

/* current role pill */

.current-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
  margin-bottom: 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 13px;
}

body.dark .current-role-pill {
  background: rgba(15, 23, 42, 0.96);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.9);
}

/* hero actions (Unchanged) */

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn {
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 150ms ease-out, box-shadow 150ms ease-out,
    background 150ms ease-out;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.45);
}

.primary-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 22px 50px rgba(37, 99, 235, 0.6);
}

/* social icons */

.social-icons {
  display: flex;
  gap: 10px;
}

.icon-button.social {
  background: white;
}

body.dark .icon-button.social {
  background: rgba(15, 23, 42, 0.9);
}

.social.github i {
  color: #111827;
}
.social.linkedin i {
  color: #0a66c2;
}
.social.mail i {
  color: #ea4335;
}

/* hero visual - INCREASED SIZE */

.hero-visual {
  display: flex;
  justify-content: center;
}

.profile-orbit {
  position: relative;
  width: 340px; 
  height: 340px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.orbit-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    from 200deg,
    #38bdf8,
    #a855f7,
    #f97316,
    #38bdf8
  );
  filter: blur(14px);
  opacity: 0.9;
}

.orbit-ring-2 {
  width: 78%;
  height: 78%;
  filter: blur(10px);
  opacity: 0.6;
}

.profile-card {
  position: relative;
  width: 240px; 
  height: 240px;
  border-radius: 50%;
  padding: 6px;
  background: radial-gradient(circle at top, #ffffff, #c7d2fe);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.38);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.profile-card img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-caption {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-soft);
}

/* floating icons */

.floating-icon {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.25);
  color: var(--accent-2);
  animation: float 5s infinite ease-in-out;
}

.fi-1 {
  top: 10%;
  left: 5%;
}
.fi-2 {
  right: 8%;
  top: 20%;
  animation-delay: 0.8s;
}
.fi-3 {
  bottom: 8%;
  left: 15%;
  animation-delay: 1.3s;
}

/* About */

.about-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about-content {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 2fr);
  gap: 40px;
  align-items: center;
}

.about-text p {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.7;
  margin: 0 0 12px; 
}
.about-text p:last-child {
  margin-bottom: 0;
}


.about-visual {
  position: relative;
  perspective: 1200px;
}

.about-card {
  border-radius: 24px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
  transform-style: preserve-3d;
  transform: rotateX(16deg) rotateY(-14deg);
  overflow: hidden;
}

.about-card-header {
  padding: 10px 14px;
  display: flex;
  gap: 6px;
}

.about-card-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.about-card-header .red {
  background: #ef4444;
}
.about-card-header .yellow {
  background: #f59e0b;
}
.about-card-header .green {
  background: #22c55e;
}

.about-card-body {
  padding: 16px 18px 18px;
}

.chart-lines {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.chart-lines .line {
  flex: 1;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  opacity: 0.4;
  animation: pulseLine 4s infinite ease-in-out;
}
.chart-lines .line-2 {
  animation-delay: 0.6s;
}
.chart-lines .line-3 {
  animation-delay: 1s;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 16px;
}

.chart-bars .bar {
  width: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a855f7, #38bdf8);
  opacity: 0.7;
  animation: growBar 3s infinite ease-in-out;
}
.bar-1 {
  height: 18px;
}
.bar-2 {
  height: 32px;
  animation-delay: 0.4s;
}
.bar-3 {
  height: 24px;
  animation-delay: 0.8s;
}

.about-label {
  font-size: 12px;
  color: var(--text-soft);
}

.about-floating-tag {
  position: absolute;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
  color: var(--text-soft);
  animation: float 6s infinite ease-in-out;
}

.tag-1 {
  top: -14px;
  right: 12%;
}
.tag-2 {
  bottom: -6px;
  left: 6%;
  animation-delay: 0.9s;
}
.tag-3 {
  bottom: -16px;
  right: -6px;
  animation-delay: 1.4s;
}

/* Skills (Unchanged) */

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-soft);
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  font-size: 13px;
  color: var(--text-main);
  cursor: default;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.skill-pill i {
  font-size: 18px;
}

.excel-icon {
  color: #107c41;
}

.skill-pill:hover {
  transform: translateY(-2px);
  border-color: var(--accent-soft);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

/* Experience */

.timeline {
  margin-top: 36px;
  position: relative;
}

/* In styles.css (around line 398) */
.timeline-item {
  /* OLD: grid-template-columns: 40px minmax(0, 1fr); */
  grid-template-columns: 24px minmax(0, 1fr); /* Reduce the first column width */
  gap: 16px;
  margin-bottom: 28px;
}

/* In styles.css (around line 406) */
.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
  margin-top: 14px;
  /* NEW: Add this to center the dot */
  justify-self: center; 
}
.timeline-line {
  width: 2px;
  flex: 1;
  background: linear-gradient(to bottom, var(--accent-soft), transparent);
  margin: 0 auto;
}

.timeline-line.end {
  background: transparent;
}

.exp-card {
  background: var(--bg-soft);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px 18px;
  border: 1px solid var(--border-subtle);
}

.exp-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.exp-logo img {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: contain;
  background: white;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.exp-title-block h3 {
  margin: 0 0 2px;
  font-size: 16px;
}

.exp-meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
}

.exp-points {
  padding-left: 18px;
  margin: 10px 0 12px;
  color: var(--text-soft);
  font-size: 14px;
}

.exp-points li + li {
  margin-top: 4px;
}

.exp-skills-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.exp-skill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.exp-skill-pill {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 5px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body.dark .exp-skill-pill {
  background: rgba(15, 23, 42, 0.96);
}

/* Projects */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.project-card {
  background: var(--bg-soft);
  border-radius: var(--card-radius);
  padding: 18px 18px 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 180ms ease-out, box-shadow 180ms ease-out,
    border-color 180ms ease-out;
}

.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 55%);
  opacity: 0;
  transition: opacity 180ms ease-out;
  pointer-events: none;
}

.project-card:hover {
  transform: translateY(-8px) scale(1.02); /* Increased lift and scale */
  box-shadow: 0 30px 80px rgba(56, 189, 248, 0.35); 
  border-color: var(--accent);
}

.project-card:hover::after {
  opacity: 1;
}

.project-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-2);
  margin-bottom: 10px;
}

.project-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.project-card p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-soft);
}

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

.project-tags span {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.45);
}

/* Contact */

.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.contact-content {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 10px;
}

.contact-form-card,
.contact-card {
  background: var(--bg-soft);
  border-radius: var(--card-radius);
  padding: 18px 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.contact-form-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.field input,
.field textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.96);
  outline: none;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}

body.dark .field input,
body.dark .field textarea {
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5);
}

.form-status {
  font-size: 12px;
  margin-top: 6px;
  min-height: 16px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.contact-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: white;
}

.contact-icon.mail {
  background: #ea4335;
}
.contact-icon.linkedin {
  background: #0a66c2;
}
.contact-icon.github {
  background: #111827;
}
/* New Social Icons */
.contact-icon.youtube {
  background: #ff0000;
}
.contact-icon.instagram {
  background: linear-gradient(45deg, #f09433 0%,#e66846 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
}


.contact-row h4 {
  margin: 0;
  font-size: 14px;
}
.contact-row a {
  font-size: 13px;
  text-decoration: none;
  color: var(--text-soft);
}

/* Footer (Unchanged) */

.footer {
  text-align: center;
  font-size: 12px;
  padding: 20px 12px 28px;
  color: var(--text-soft);
}

/* Reveal on scroll (Unchanged) */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Animations (Unchanged) */

@keyframes wave {
  0% {
    transform: rotate(0deg);
  }
  15% {
    transform: rotate(14deg);
  }
  30% {
    transform: rotate(-8deg);
  }
  45% {
    transform: rotate(10deg);
  }
  60% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes pulseLine {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

@keyframes growBar {
  0%,
  100% {
    transform: scaleY(0.85);
  }
  50% {
    transform: scaleY(1.1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
   MOBILE OPTIMIZATIONS (Light & Dark)
   ========================================= */

@media (max-width: 768px) {
  /* 1. Improve Layout Spacing for Mobile */
  .hero-inner {
    padding-top: 10px; 
    text-align: center;
  }
  
  .hero-visual {
    margin-bottom: 30px;
  }

  /* 2. Fix Navbar for Light Mode visibility */
  .navbar {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  body.dark .navbar {
    background: rgba(15, 23, 42, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* 3. Fix Text Contrast in Light Mode */
  :root {
    --text-main: #111827;
    --text-soft: #4b5563;
    --bg: #ffffff; /* Pure white for mobile light mode */
  }

  /* 4. Adjust Card Styling for Mobile */
  .project-card, .exp-card, .about-card {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
  }

  /* 5. Hero Title Size Adjustment */
  .hero-title {
    font-size: 32px;
  }
  
  /* 6. Ensure Toggle Button is Visible */
  .theme-toggle {
    display: inline-flex !important;
    background: rgba(0,0,0,0.05);
  }
}
