/*DESIGN TOKENS
   Fonts are loaded in index.html (Inter for UI/body, JetBrains Mono for
   the "code" accents — labels, tags, terminal chrome). Two fonts, two
   jobs: Inter reads, JetBrains Mono signals "this is data/code".*/
:root {
  --bg: #05070c;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #e9ebf1;
  --muted: #8b93a9;
  --muted-2: #707a90;
  --primary: #6d6af5;
  --primary-soft: rgba(109, 106, 245, 0.14);
  --secondary: #22d3ee;
  --secondary-soft: rgba(34, 211, 238, 0.14);
  --accent: #f6b93b;
  --danger: #ef4444;
  --success: #34d399;
  --blob-1: #1c1a4a;
  --blob-2: #0b3a3a;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

/* LIGHT MODE */
html[data-theme="light"] {
  --bg: #f7f8fb;
  --surface: rgba(79, 70, 229, 0.045);
  --surface-strong: rgba(79, 70, 229, 0.08);
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #1c2333;
  --muted: #5b6478;
  --muted-2: #7c8598;
  --primary: #4f46e5;
  --primary-soft: rgba(79, 70, 229, 0.08);
  --secondary: #0e7490;
  --secondary-soft: rgba(8, 145, 178, 0.1);
  --accent: #b45309;
  --danger: #dc2626;
  --success: #059669;
  --blob-1: rgba(79, 70, 229, 0.32);
  --blob-2: rgba(8, 145, 178, 0.32);
}

/*BASE RESET*/
html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px; /* keeps anchored sections clear of the fixed header, for every link, not just the JS-handled ones */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

img, picture, svg {
  display: block;
  max-width: 100%;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a { text-decoration: none; color: inherit; }

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at 15% 15%, var(--blob-1), transparent 40%),
              radial-gradient(circle at 85% 15%, var(--blob-2), transparent 40%),
              var(--bg);
  background-size: 150% 150%;
  background-attachment: fixed;
  animation: bgAnimate 15s ease infinite alternate;
  color: var(--text);
  line-height: 1.6;
  min-width: 320px;
  padding-left: 90px;
}

@keyframes bgAnimate {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

h1, h2, h3 { font-weight: 800; }
p { color: var(--muted); }

/*ACCESSIBILITY: focus, reduced motion, screen-reader-only text*/
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
  border-radius: 4px;
}

body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/*CUSTOM SCROLLBAR*/
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: transparent; margin-block: 6px; }
::-webkit-scrollbar-thumb {
  background-color: var(--muted);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--primary); }

/*HEADER*/
.main-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 90px;
  width: calc(100% - 90px);
  height: 72px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 900;
}

.main-header .logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============ TOGGLES (dark mode / reduce motion) ============ */
.dark-mode-toggle,
.reduce-motion-toggle {
  position: absolute;
  top: 11px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  color: #020617;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1001;
}

.reduce-motion-toggle { right: 80px; }

.dark-mode-toggle:hover,
.reduce-motion-toggle:hover {
  background: var(--primary);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(109, 106, 245, 0.6);
}

.dark-mode-toggle i,
.reduce-motion-toggle i { transition: transform 0.3s ease; }

.dark-mode-toggle:hover i,
.reduce-motion-toggle:hover i { transform: rotate(15deg); }

/* ============ TOOLTIPS ============ */
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 115%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 1100;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  top: 125%;
}

.dark-mode-toggle[data-tooltip]::after {
  left: auto;
  right: 0;
  transform: none;
}

.project-links a[data-tooltip]::after {
  top: auto;
  bottom: 130%;
}

/* ============ MOBILE MENU TOGGLE ============ */
.mobile-menu-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  color: #020617;
  font-size: 1.3rem;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 9991;
}

.mobile-menu-toggle:hover {
  background: var(--primary);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(109, 106, 245, 0.6);
}

/* ============ SCROLL TO TOP ============ */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  color: #020617;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 999;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(109, 106, 245, 0.3);
}

/*SIDEBAR NAVIGATION*/
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 90px;
  height: 100vh;
  background: linear-gradient(180deg, #050505, rgba(10, 12, 30, 0.6));
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  z-index: 1000;
  transition: left 0.25s ease;
  overflow: auto;
}

.sidebar-brand {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: #020617;
}

.sidebar-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  justify-content: center;
}

.sidebar-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 70px;
  padding: 8px 4px;
  margin: 0.2rem auto;
  border-radius: 10px;
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  transition: all 0.25s ease;
  min-height: 55px;
  gap: 6px;
  word-break: break-word;
}

.sidebar-links i { font-size: 1.25rem; transition: all 0.25s ease; }
.sidebar-links span { display: block; font-size: 0.65rem; line-height: 1.1; }

.sidebar-links a:hover,
.sidebar-links a.active {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: #020617;
  box-shadow: 0 8px 20px rgba(109, 106, 245, 0.12);
}

.sidebar-links a.active i { color: #020617; }
.sidebar-links a:hover { transform: scale(1.08); }
.sidebar-links a:hover i { transform: scale(1.2) rotate(10deg); }
.sidebar-links a:active { transform: scale(0.95); transition: transform 0.1s; }
.sidebar-links a:active i { transform: scale(1.2) rotate(-10deg); transition: transform 0.1s; }

/*SECTION SHELL, EYEBROWS & HEADINGS*/
section {
  padding: 100px 20px;
  max-width: 1200px;
  margin: auto;
}

.eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  margin-bottom: 10px;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  margin-bottom: 30px;
}

/* Shared "window chrome" dots used on the hero, project cards & modal */
.terminal-dots { display: inline-flex; gap: 6px; flex-shrink: 0; }
.terminal-dots span { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.terminal-dots span:nth-child(1) { background: var(--danger); }
.terminal-dots span:nth-child(2) { background: var(--accent); }
.terminal-dots span:nth-child(3) { background: var(--success); }

/*HERO*/
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 20px 60px rgba(0, 0, 0, 0.35);
  max-width: 820px;
  width: 90%;
  overflow: hidden;
  text-align: left;
  animation: heroIn 0.8s ease-out both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.hero-tab {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-content { padding: 44px; }

.hero-prompt {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--secondary);
  margin-bottom: 18px;
}

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.cursor { display: inline-block; color: var(--accent); animation: blink 1s step-end infinite; }

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.hero-role {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-top: 14px;
}

.hero-tagline {
  margin-top: 16px;
  font-size: 1.05rem;
  max-width: 46ch;
}

.hero-buttons { margin-top: 36px; display: flex; gap: 16px; flex-wrap: wrap; }

/*BUTTONS*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: #020617;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 10px 30px rgba(109, 106, 245, 0.35);
  text-align: center;
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn:hover { transform: translateY(-4px); box-shadow: 0 20px 50px rgba(109, 106, 245, 0.5); }
.btn:active { transform: translateY(-1px); }

#contact .btn {
  padding: 15px 40px;
  font-size: 1rem;
  width: 100%;
  max-width: 300px;
  margin: 12px auto 0;
  box-shadow: 0 12px 35px rgba(109, 106, 245, 0.4);
  letter-spacing: 0.5px;
}

#contact .btn:hover { box-shadow: 0 20px 50px rgba(109, 106, 245, 0.55); }

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/*ABOUT*/
#about p { max-width: 720px; font-size: 1.05rem; }

.tech-stack { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 25px; }

.badge {
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  border: 1px solid rgba(109, 106, 245, 0.35);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/*RESUME*/
#resume { text-align: center; }

.resume-card { max-width: 720px; margin: 30px auto 0; padding: 32px; }
.resume-card p { margin-bottom: 28px; font-size: 1.05rem; }

.resume-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/*PROJECTS*/
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.project-card {
  overflow: hidden;
  transition: opacity 0.4s ease-out, transform 0.4s ease-out, box-shadow 0.4s;
  opacity: 0;
  transform: translateY(30px);
  max-width: 380px;
  margin: 0 auto;
  width: 100%;
  cursor: pointer;
}

.project-card.show { opacity: 1; transform: translateY(0); }
.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
}
.project-card:focus-visible { outline-offset: 4px; }

.card-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.card-tab-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-media {
  position: relative;
  aspect-ratio: 5 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-soft), var(--secondary-soft));
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .card-media img { transform: scale(1.06); }

.project-content { padding: 24px; }
.project-content h3 { margin-bottom: 8px; }
.project-content > p { font-size: 0.95rem; }

.tech-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  border: 1px solid var(--border);
  color: var(--secondary);
}

.project-links { display: flex; gap: 18px; }
.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--secondary);
  position: relative;
}
.project-links a:hover { color: var(--text); }
.project-links a.is-disabled { color: var(--muted-2); cursor: not-allowed; }
.project-links a.is-disabled:hover { color: var(--muted-2); }

/*PROJECT FILTERS*/
.project-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.filter-btn:hover { border-color: var(--primary); color: var(--text); }

.filter-btn.active {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: #020617;
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(109, 106, 245, 0.2);
}

/*SKILLS*/
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 25px;
}
.skill-box { padding: 28px; transition: background 0.3s ease, transform 0.3s ease; }
.skill-box:hover { background: var(--surface-strong); transform: translateY(-4px); }
.skill-box h3 { margin-bottom: 8px; }

/*CONTACT*/
.social-links { display: flex; gap: 20px; margin-bottom: 30px; justify-content: center; flex-wrap: wrap; }

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  border: 1px solid var(--border);
  color: var(--secondary);
  font-weight: 600;
  transition: all 0.3s;
}

.social-links a:hover { background: var(--secondary-soft); transform: translateY(-2px); }

#contact form { max-width: 520px; padding: 28px; display: grid; gap: 18px; margin: auto; }

input, textarea {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  resize: vertical;
  max-height: 260px;
  min-height: 60px;
}

input:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--secondary); }

.form-message { text-align: center; font-weight: 600; min-height: 24px; margin-top: 8px; }
.form-message.is-error { color: var(--danger); }
.form-message.is-success { color: var(--success); }
.form-message.is-pending { color: var(--secondary); }

/*FOOTER*/
footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/*PROJECT MODAL*/
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal.open { opacity: 1; pointer-events: all; }

.modal-content {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  border-radius: 24px;
  position: relative;
  transform: translateY(30px);
  transition: transform 0.3s ease;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal.open .modal-content { transform: translateY(0); }

.modal-titlebar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-tab {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted-2);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.modal-body { padding: 26px 28px 32px; overflow-y: auto; }

.modal-body::-webkit-scrollbar { width: 12px; }
.modal-body::-webkit-scrollbar-track { background: transparent; margin-block: 15px; }
.modal-body::-webkit-scrollbar-thumb {
  background-color: var(--muted);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.modal-body::-webkit-scrollbar-thumb:hover { background-color: var(--primary); }

.modal-image {
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.modal-body h3 { font-size: 1.4rem; margin-bottom: 4px; }
.modal-body .tech-tags { margin: 0 0 20px; }

.modal-body h4 {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--secondary);
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.modal-body h4:first-of-type { margin-top: 0; }

.modal-body ul { margin-left: 20px; margin-bottom: 15px; list-style-type: disc; }
.modal-body li { margin-bottom: 8px; color: var(--muted); }
.modal-body p { margin-bottom: 15px; }
.modal-body strong { color: var(--text); font-weight: 700; }

/*SCROLL-REVEAL (one-shot: elements fade in once, then stay put)*/
h2, .badge, .skill-box, .resume-card, form {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in { opacity: 1; transform: translateY(0); }

/*LIGHT THEME — component overrides*/
html[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #f1f5f9, #e0e7ff);
  border-right-color: var(--border);
}

html[data-theme="light"] .btn:not(.secondary) { color: #ffffff; }

html[data-theme="light"] .glass,
html[data-theme="light"] .hero-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(99, 102, 241, 0.1);
}

html[data-theme="light"] .hero-card {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 40px rgba(30, 27, 75, 0.1);
  border-color: rgba(79, 70, 229, 0.2);
}

html[data-theme="light"] .hero-titlebar,
html[data-theme="light"] .card-tab,
html[data-theme="light"] .modal-titlebar {
  background: rgba(15, 23, 42, 0.03);
}

html[data-theme="light"] .project-card:hover { box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08); }

html[data-theme="light"] input,
html[data-theme="light"] textarea {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .sidebar-links a:hover,
html[data-theme="light"] .sidebar-links a.active,
html[data-theme="light"] .sidebar-links a.active i { color: #ffffff; }

html[data-theme="light"] .social-links a {
  background: #ffffff;
  color: var(--primary);
  border-color: var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .social-links a:hover {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border-color: var(--primary);
}

html[data-theme="light"] .tech-tag {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.25);
  color: var(--primary);
}

html[data-theme="light"] .modal-close { background: rgba(15, 23, 42, 0.05); }

html[data-theme="light"] .filter-btn { color: var(--text); background: rgba(255, 255, 255, 0.6); }

html[data-theme="light"] .filter-btn.active {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: none;
}

html[data-theme="light"] .dark-mode-toggle,
html[data-theme="light"] .reduce-motion-toggle,
html[data-theme="light"] .mobile-menu-toggle,
html[data-theme="light"] .scroll-to-top { color: #ffffff; }

/*RESPONSIVE — sidebar becomes a top bar*/
@media (max-width: 900px) {
  .sidebar {
    top: 0; left: 0; right: 0;
    width: 100%;
    height: 72px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
  }

  body { padding-left: 0; padding-top: 72px; }

  .sidebar-links {
    flex-direction: row;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
  }

  .sidebar-links a {
    width: auto;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    flex-direction: row;
    gap: 8px;
  }

  .sidebar-links i { font-size: 1rem; }
  .sidebar-brand { margin-right: 8px; }
}

/*RESPONSIVE — content stacking*/
@media (max-width: 768px) {
  .main-header { left: 0; width: 100%; }

  .mobile-menu-toggle { display: flex; top: 14px; left: 16px; width: 44px; height: 44px; font-size: 1.1rem; }

  .sidebar-brand { display: none; }

  .sidebar {
    width: 260px;
    height: 100vh;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 80px 20px;
    border-right: 1px solid var(--border);
    border-bottom: none;
    left: -100%;
    position: fixed;
    top: 0;
  }

  .dark-mode-toggle { right: 16px; width: 44px; height: 44px; font-size: 1rem; }
  .reduce-motion-toggle { right: 70px; width: 44px; height: 44px; font-size: 1rem; }

  body { padding-left: 0; padding-top: 72px; }

  .sidebar-brand { width: 40px; height: 40px; font-size: 1.1rem; margin-right: 16px; }

  .sidebar-links {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }

  .sidebar-links a {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1rem;
    flex-direction: row;
    gap: 12px;
    min-height: 50px;
    justify-content: flex-start;
  }

  .sidebar-links span { display: block; }
  .sidebar-links i { font-size: 1rem; }

  section { padding: 60px 16px; }
  h2 { font-size: 1.8rem; margin-bottom: 20px; }

  /* HERO */
  .hero { min-height: 80vh; padding: 20px; }
  .hero-content { padding: 26px; }
  .hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
  .hero-tagline { font-size: 0.95rem; }
  .hero-buttons { margin-top: 26px; flex-direction: column; gap: 12px; }

  .btn { padding: 12px 24px; font-size: 0.95rem; width: 100%; justify-content: center; min-height: 44px; }

  /* ABOUT */
  #about p { max-width: 100%; font-size: 0.95rem; }
  .tech-stack { gap: 10px; }
  .badge { padding: 8px 14px; font-size: 0.85rem; }

  /* PROJECTS */
  .projects-grid { grid-template-columns: 1fr; gap: 20px; }
  .project-content { padding: 16px; }
  .project-links a { font-size: 0.85rem; }
  .project-filters { justify-content: center; gap: 10px; }
  .filter-btn { padding: 8px 16px; font-size: 0.85rem; }

  .scroll-to-top { bottom: 80px; right: 20px; width: 44px; height: 44px; font-size: 1rem; }

  /* SKILLS */
  .skills-grid { grid-template-columns: 1fr; gap: 15px; }
  .skill-box { padding: 20px; }
  .skill-box h3 { font-size: 1.1rem; }

  /* CONTACT */
  #contact form { max-width: 100%; padding: 20px; gap: 14px; }
  input, textarea { padding: 12px; font-size: 16px; }

  .social-links { flex-direction: column; gap: 10px; margin-bottom: 20px; }
  .social-links a { justify-content: center; min-height: 44px; }
}

/*RESPONSIVE — extra small devices*/
@media (max-width: 480px) {
  section { padding: 50px 12px; }
  h2 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.6rem; }
  .hero-tab { max-width: 120px; }
  .badge { padding: 6px 12px; font-size: 0.8rem; }
  .project-content { padding: 12px; }
  .project-content h3 { font-size: 1rem; }
  .project-content > p { font-size: 0.85rem; }
  footer { padding: 30px 12px; font-size: 0.8rem; }
}
