@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@500;600;700;800&display=swap');

/* ==========================================
   DESIGN VARIABLES
   ========================================== */
:root {
  /* Fonts & Layout tokens */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --max-width: 1100px;
  --header-height: 70px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Default Theme (Dark) */
:root, :root[data-theme="dark"] {
  --bg: #0a0b10;
  --surface: #11121a;
  --surface-alt: #181926;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #8b5cf6;
  
  --text: #f3f4f6;
  --text-muted: #8e8ea8;
  --text-dark: #4b5563;
  
  --accent-primary: #8b5cf6; /* Electric Violet */
  --accent-secondary: #f59e0b; /* Rose */
  --accent-glow: rgba(139, 92, 246, 0.15);
  --grid-color: rgba(255, 255, 255, 0.012);
  --header-bg: rgba(10, 11, 16, 0.8);
  --shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.5);

  /* Terminal */
  --term-bg: #06070c;
  --term-text: #34d399;
  --term-prompt: #8b5cf6;
  --term-header: #11121a;
}

/* Light Theme */
:root[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: rgba(15, 23, 42, 0.08);
  --border-focus: #7c3aed;
  
  --text: #0f172a; /* high contrast dark text */
  --text-muted: #475569; /* readable mid-gray */
  --text-dark: #94a3b8;
  
  --accent-primary: #7c3aed; /* violet */
  --accent-secondary: #e11d48; /* rose */
  --accent-glow: rgba(124, 58, 237, 0.08);
  --grid-color: rgba(15, 23, 42, 0.015);
  --header-bg: rgba(248, 250, 252, 0.8);
  --shadow: 0 10px 30px -15px rgba(15, 23, 42, 0.05);

  /* Terminal (remains dark for dev aesthetic contrast) */
  --term-bg: #1b1c24;
  --term-text: #38bdf8;
  --term-prompt: #c084fc;
  --term-header: #24252e;
}


/* ==========================================
   RESET & BASE STYLES
   ========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg);
}

body {
  background-color: var(--bg);
  background-image: 
    linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
  background-size: 50px 50px;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
body::-webkit-scrollbar {
  width: 6px;
}
body::-webkit-scrollbar-track {
  background: var(--bg);
}
body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
body::-webkit-scrollbar-thumb:hover {
  background: var(--text-dark);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

section {
  padding: 80px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 12px;
  display: block;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-title::after {
  content: '';
  height: 1px;
  flex-grow: 1;
  background-color: var(--border);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  gap: 8px;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--border-focus);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background-color: var(--surface-alt);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

/* ==========================================
   NAVBAR & HEADER
   ========================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 100;
  background: transparent;
}

header.scrolled {
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

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

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

.nav-menu {
  display: flex;
  gap: 28px;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-secondary);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--accent-secondary);
  border-color: var(--accent-secondary);
  background-color: var(--surface-alt);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Icon Swap */
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

.hamburger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 24px;
  height: 20px;
  position: relative;
  z-index: 110;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text);
  position: absolute;
  transition: var(--transition);
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 9px; }
.hamburger span:nth-child(3) { top: 18px; }

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg);
  top: 9px;
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg);
  top: 9px;
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero-grid {
  min-height: 100vh;
  padding-top: var(--header-height);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: center;
}

.hero-info {
  display: flex;
  flex-direction: column;
}

.hero-tag {
  font-family: var(--font-mono);
  color: var(--accent-secondary);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  background-color: var(--accent-secondary);
  border-radius: 50%;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--text);
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.hero-socials {
  display: flex;
  gap: 12px;
}

.social-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.social-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.social-icon-btn:hover {
  color: var(--accent-secondary);
  border-color: var(--accent-secondary);
  background-color: var(--surface-alt);
}

/* Terminal Component */
.terminal-window {
  background-color: var(--term-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.terminal-header {
  background-color: var(--term-header);
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.term-dot-red { background-color: #ef4444; }
.term-dot-yellow { background-color: #f59e0b; }
.term-dot-green { background-color: #10b981; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.terminal-actions-bar {
  display: flex;
  background-color: var(--term-header);
  padding: 8px 16px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.term-action-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.term-action-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background-color: rgba(139, 92, 246, 0.05);
}

.terminal-body {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--term-text);
  min-height: 240px;
  max-height: 320px;
  overflow-y: auto;
  line-height: 1.5;
}

.term-prompt {
  color: var(--term-prompt);
}

.term-command {
  color: var(--text);
  font-weight: 500;
}

.term-output {
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 12px;
  white-space: pre-wrap;
}

/* ==========================================
   ABOUT SECTION
   ========================================== */
.about-flex {
  display: flex;
  gap: 64px;
  align-items: center;
}

.about-left {
  flex: 1.2;
}

.about-right {
  flex: 1;
}

.about-bio {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.about-stats-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stat-tag {
  background-color: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
}

.stat-tag span {
  color: var(--accent-secondary);
  font-weight: 600;
}

.profile-frame {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 12px;
  background: var(--surface);
}

.profile-frame::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  width: 16px;
  height: 16px;
  border-top: 2px solid var(--accent-secondary);
  border-left: 2px solid var(--accent-secondary);
}

.profile-frame::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: -8px;
  width: 16px;
  height: 16px;
  border-bottom: 2px solid var(--accent-secondary);
  border-right: 2px solid var(--accent-secondary);
}

.profile-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  filter: grayscale(10%);
}

/* ==========================================
   SKILLS SECTION
   ========================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.skills-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.skills-card-title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-secondary);
  margin-bottom: 20px;
}

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

.skill-badge {
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-badge img {
  width: 14px;
  height: 14px;
  filter: invert(0.8);
}

[data-theme="light"] .skill-badge img {
  filter: invert(0.2);
}

.skill-badge:hover {
  border-color: var(--accent-primary);
  color: var(--text);
  background-color: var(--surface);
}

/* ==========================================
   PROJECTS SECTION (ASYMMETRIC ROWS)
   ========================================== */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.project-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  align-items: center;
}

.project-row:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow);
}

.project-meta-side {
  display: flex;
  flex-direction: column;
}

.project-title {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--text);
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
  font-weight: 300;
}

.project-links {
  display: flex;
  gap: 16px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.project-link svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.project-link:hover {
  color: var(--accent-secondary);
}

.project-tech-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tech-banner-preview {
  height: 120px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

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

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background-color: var(--surface-alt);
  color: var(--accent-primary);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

/* ==========================================
   EXPERIENCE SECTION (DATE TICK TIMELINE)
   ========================================== */
.experience-timeline {
  border-left: 2px solid var(--border);
  margin-left: 12px;
  padding-left: 32px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.timeline-row {
  position: relative;
}

.timeline-row::before {
  content: '';
  position: absolute;
  left: -42px;
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--bg);
  border: 2px solid var(--accent-secondary);
}

.timeline-date-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-secondary);
  margin-bottom: 8px;
  display: block;
}

.timeline-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
}

.timeline-title {
  font-size: 1.25rem;
  margin-bottom: 4px;
  color: var(--text);
}

.timeline-org {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.timeline-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 300;
}

/* ==========================================
   CONTACT SECTION
   ========================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
}

.contact-info-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-intro h3 {
  font-size: 1.75rem;
}

.contact-intro p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 16px;
}

.contact-links-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 40px 0;
}

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

.contact-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-secondary);
}

.contact-badge-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.contact-details-text span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dark);
  text-transform: uppercase;
}

.contact-details-text a {
  font-size: 0.95rem;
  font-weight: 500;
}

.contact-details-text a:hover {
  color: var(--accent-secondary);
}

.contact-form-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-control {
  background-color: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* ==========================================
   FOOTER
   ========================================== */
footer {
  border-top: 1px solid var(--border);
  background-color: var(--bg);
  padding: 32px 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dark);
}

.back-to-top-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-to-top-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  transition: var(--transition);
}

.back-to-top-btn:hover {
  color: var(--accent-secondary);
}

.back-to-top-btn:hover svg {
  transform: translateY(-2px);
}

/* ==========================================
   DYNAMIC THEME TRANSITIONS & RESPONSIVE
   ========================================== */
body, header, .ide-window, .ide-body, .skills-card, .project-row, .timeline-card, .contact-form-box, .contact-badge-icon, .social-icon-btn, .btn, .theme-toggle, .form-control, .nav-link, .logo {
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

@media (prefers-reduced-motion: reduce) {
  body, header, .ide-window, .ide-body, .skills-card, .project-row, .timeline-card, .contact-form-box, .contact-badge-icon, .social-icon-btn, .btn, .theme-toggle, .form-control, .nav-link, .logo {
    transition: none !important;
  }
}

@media (max-width: 1024px) {
  section {
    padding: 60px 24px;
  }
  
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-top: 100px;
  }

  .about-flex {
    flex-direction: column-reverse;
    gap: 48px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  section {
    padding: 48px 20px;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    background: var(--surface-alt);
    flex-direction: column;
    padding: 100px 32px;
    gap: 32px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    transition: right 0.3s ease;
    border-left: 1px solid var(--border);
  }

  .nav-menu.open {
    right: 0;
  }

  .hamburger {
    display: block;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .project-row {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}
