:root {
  /* Colors - Professional palette */
  --bg: #0f1419;
  --card: #16202f;
  --muted: #8b95a5;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-dark: #1e40af;
  --success: #10b981;
  --glass: rgba(255,255,255,0.04);
  --border-color: rgba(59, 130, 246, 0.2);
  --radius: 12px;
  --max-width: 1200px;
  --gap: clamp(18px, 2.5vw, 28px);
  --text: #e8ecf1;
  
  /* Typography */
  --font-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --font-sm: clamp(0.875rem, 0.8rem + 0.25vw, 1rem);
  --font-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --font-lg: clamp(1.25rem, 1rem + 0.75vw, 1.5rem);
  --font-xl: clamp(1.5rem, 1.25rem + 1vw, 2.5rem);
  --font-2xl: clamp(2rem, 1.5rem + 1.5vw, 3rem);
  
  /* Animations */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(59, 130, 246, 0.12), 0 2px 4px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 24px rgba(59, 130, 246, 0.15), 0 8px 16px rgba(0,0,0,0.15);
}

/* Light theme */
body.light {
  --bg: #f8fafc;
  --card: #ffffff;
  --muted: #57627b;
  --text: #0a0e27;
  --glass: rgba(37, 99, 235, 0.06);
  --accent: #2563eb;
  --accent-light: #2563eb;
  --accent-dark: #1e40af;
  --border-color: rgba(37, 99, 235, 0.18);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(37, 99, 235, 0.1), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 24px rgba(37, 99, 235, 0.12), 0 8px 16px rgba(0,0,0,0.08);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  height: 100%;
  margin: 0;
  width: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #0f1419 0%, #1a2332 50%, #16202f 100%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.65;
  font-size: var(--font-base);
  font-weight: 400;
  letter-spacing: 0.3px;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

body.light {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  margin-bottom: 0.5em;
  font-weight: 600;
}

h1 { font-size: var(--font-xl); }
h2 { font-size: var(--font-lg); }
h3 { font-size: var(--font-base); }

p { margin-bottom: 1em; }

/* Icons */
i {
  font-style: normal;
  display: inline-block;
}

.fa, .fas, .far, .fab {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  speak: none;
  line-height: 1;
}
.fab { font-family: "Font Awesome 6 Brands", "Font Awesome 6 Free", sans-serif; font-weight: 400; }
.fas, .fa-solid { font-family: "Font Awesome 6 Free", sans-serif; font-weight: 900; }
.far, .fa-regular { font-family: "Font Awesome 6 Free", sans-serif; font-weight: 400; }

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

a:hover {
  color: var(--accent);
}

/* Main Layout */
.app {
  display: flex;
  min-height: 100vh;
  max-width: 100%;
  margin: 0;
  gap: var(--gap);
  padding: var(--gap);
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

/* Mobile Header with Hamburger Menu */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(22, 32, 47, 0.95) 0%, rgba(15, 20, 25, 0.95) 100%);
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gap);
  box-sizing: border-box;
}

body.light .mobile-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  border-bottom-color: rgba(37, 99, 235, 0.18);
}

.mobile-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.5px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.hamburger:hover {
  background: rgba(59, 130, 246, 0.1);
}

.hamburger span {
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.sidebar {
  width: 300px;
  flex: 0 0 300px;
  background: linear-gradient(180deg, rgba(22, 32, 47, 0.8) 0%, rgba(15, 20, 25, 0.8) 100%);
  border: 1px solid rgba(59, 130, 246, 0.15);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 32px 24px;
  border-radius: var(--radius);
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: var(--gap);
  box-shadow: var(--shadow-md);
  box-sizing: border-box;
}

body.light .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.85) 100%);
  border-color: rgba(37, 99, 235, 0.18);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  width: 100%;
}

/* Mobile Layout */
/* Tablet Layout (1200px and below) */
@media (max-width: 1200px) {
  .sidebar {
    width: 250px;
  }
}

/* Mobile Layout (768px and below) */
@media (max-width: 768px) {
  .app {
    flex-direction: column;
    padding: var(--gap);
    gap: var(--gap);
  }

  .sidebar {
    width: 100%;
    flex: 1;
    position: static;
    height: auto;
    max-height: none;
    top: auto;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 0;
  }

  .main {
    width: 100%;
    padding: 0;
  }
}

/* Brand */
.brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.name {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.role {
  margin: 0;
  color: var(--accent-light);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Nav */
.nav {
  display: flex;
  flex-direction: column;
  margin: 0;
  gap: 8px;
}

.nav-link {
  display: block;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-light);
  border-left-color: var(--accent);
  padding-left: 18px;
}

.nav-link.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
  border-left-color: var(--accent);
  padding-left: 18px;
}

/* Sidebar Bottom */
.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid rgba(59, 130, 246, 0.1);
}

/* Buttons */
.btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-ghost:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

body.light .btn-ghost {
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--muted);
}

body.light .btn-ghost:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--accent);
  color: var(--accent);
}

.copyright {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}

/* Sections & Cards */
.section {
  display: block;
  max-width: var(--max-width);
  width: 100%;
  scroll-margin-top: 100px;
}

.card {
  background: linear-gradient(135deg, rgba(22, 32, 47, 0.6) 0%, rgba(15, 20, 25, 0.4) 100%);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid rgba(59, 130, 246, 0.15);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  transition: all var(--transition-smooth);
}

.card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: var(--shadow-lg);
}

body.light .card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(248, 250, 252, 0.75) 100%);
  border-color: rgba(37, 99, 235, 0.18);
}

body.light .card:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

/* About Section */
.about {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  align-items: start;
}

.about-left {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.socials {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--accent-light);
  font-size: 1.25rem;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.socials a:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

body.light .socials a {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
}

body.light .socials a:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.avatar-large {
  width: 140px;
  height: 140px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(96, 165, 250, 0.1));
  border: 2px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 800;
  color: var(--accent-light);
}

.about-right h3 {
  color: var(--accent-light);
  font-size: 1.8rem;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.about-right p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-cta {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-light);
  border-color: var(--accent-light);
}

.subtitle {
  font-size: var(--font-lg);
  color: var(--accent-light);
  font-weight: 600;
  margin-bottom: 16px;
}

/* Skills */
.section-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}

.section-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.section-header .muted {
  color: var(--muted);
  font-size: 1rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.skill {
  background: transparent;
  padding: 10px;
  border-radius: 10px;
}

.skill-head {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  color: var(--muted);
  gap: 12px;
}

.skill-head span:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.skill-head span:last-child {
  margin-left: auto;
  font-weight: 600;
  color: var(--accent-light);
}

.skill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-light);
  font-size: 1.1rem;
  flex-shrink: 0;
}

body.light .skill-icon {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

.skill-bar {
  height: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #7c3aed);
  transition: width 1000ms cubic-bezier(.2,.9,.3,1);
}

body.light .skill-bar {
  background: rgba(37, 99, 235, 0.08);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
}

.project-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(22, 32, 47, 0.6) 0%, rgba(15, 20, 25, 0.4) 100%);
  border: 1px solid rgba(59, 130, 246, 0.15);
  transition: all var(--transition-smooth);
  position: relative;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  outline: none;
}

.project-card:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: var(--shadow-lg);
}

body.light .project-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(248, 250, 252, 0.75) 100%);
  border-color: rgba(37, 99, 235, 0.18);
}

body.light .project-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.project-media {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(96, 165, 250, 0.05));
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-lg);
  color: var(--accent-light);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
  loading: lazy;
  decoding: async;
}

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

body.light .project-media {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(59, 130, 246, 0.05));
  border-bottom-color: rgba(37, 99, 235, 0.18);
}

.project-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: calc(var(--gap) / 2);
}

.tag {
  display: inline-block;
  background: var(--glass);
  color: var(--muted);
  padding: 4px 12px;
  border-radius: calc(var(--radius) / 2);
  font-size: var(--font-xs);
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.tag:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: var(--gap);
}

.contact-info {
  background: var(--card);
  padding: var(--gap);
  border-radius: var(--radius);
  border: 1px solid var(--glass);
}

.contact-info h4 {
  color: var(--accent);
  margin-top: var(--gap);
  font-size: var(--font-base);
}

.contact-info .services {
  list-style: none;
  margin: calc(var(--gap) / 2) 0;
  padding: 0;
}

.contact-info .services li {
  color: var(--muted);
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
}

.contact-info .services li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.contact-form {
  max-width: 520px;
  margin: 0 auto;
}

.form-group {
  position: relative;
  margin-bottom: 28px;
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  background: rgba(59, 130, 246, 0.08);
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-control::placeholder {
  color: transparent;
}

.form-control:focus {
  outline: none;
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

body.light .form-control {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.25);
}

body.light .form-control:focus {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-label {
  position: absolute;
  left: 16px;
  top: 14px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  pointer-events: none;
  transition: all var(--transition-fast);
  background: transparent;
}

.form-control:focus ~ .form-label,
.form-control:not(:placeholder-shown) ~ .form-label {
  transform: translateY(-28px) scale(0.85);
  color: var(--accent-light);
  background: var(--bg);
  padding: 0 6px;
}

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

.form-row {
  display: flex;
  gap: 20px;
  align-items: center;
}

.form-status {
  color: var(--muted);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  background: transparent;
  min-height: 1.2em;
  display: flex;
  align-items: center;
  font-weight: 500;
}

.form-status-sending {
  color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid var(--accent);
}

.form-status-success {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid #10b981;
}

.form-status-error {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
}

body.light .form-status-sending {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.12);
  border-left-color: var(--accent);
}

body.light .form-status-success {
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  border-left-color: #059669;
}

body.light .form-status-error {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.12);
  border-left-color: #dc2626;
}

.submit-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.submit-btn:hover {
  background: var(--accent-dark);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-text { display: inline; }
.btn-loading { display: none; font-size: 0.95em; color: var(--muted); margin-left: 8px; vertical-align: middle; }

/* Footer */
.footer {
  background: linear-gradient(135deg, rgba(100, 255, 218, 0.05) 0%, rgba(100, 255, 218, 0) 100%);
  border-top: 1px solid var(--border-color);
  padding: 48px var(--gap) 24px;
  margin-top: 80px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto 32px;
}

.footer-section h4 {
  font-size: var(--font-sm);
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.footer-section p {
  margin-bottom: 8px;
  line-height: 1.6;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.small {
  font-size: var(--font-xs);
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.section {
  animation: fadeUp 0.6s ease-out;
}

.project-card {
  animation: scaleIn 0.4s ease-out;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.6);
  z-index: 60;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-panel {
  background: var(--card);
  padding: 20px;
  border-radius: 12px;
  max-width: 720px;
  width: 92%;
  position: relative;
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* Profile Image */
.profile-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  box-shadow: var(--shadow-md);
}

.profile-fallback {
  width: 120px;
  height: 120px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #071828, #0f2430);
  color: var(--muted);
  border-radius: var(--radius);
}

.avatar-large.fallback .profile-fallback {
  display: flex;
}

.avatar-large.fallback .profile-img {
  display: none;
}

/* Responsive */
@media (max-width: 1200px) {
  :root {
    --gap: clamp(12px, 1.5vw, 20px);
  }
  
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    width: 250px;
  }
}

/* Mobile & Small Device Styles (768px and below) */
@media (max-width: 768px) {
  :root {
    --gap: clamp(12px, 3vw, 16px);
  }

  .mobile-header {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .app {
    flex-direction: column;
    padding: 70px var(--gap) var(--gap);
    gap: 0;
  }

  .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 60px);
    border-radius: 0;
    flex: none;
    border: none;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    padding: 24px;
    transform: translateX(-100%);
    transition: transform var(--transition-smooth);
    z-index: 999;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main {
    padding: 0;
  }

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

  .about,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .about-cta {
    flex-direction: column;
  }

  .btn-lg {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .submit-btn,
  .contact-form .btn {
    width: 100%;
  }

  h1 { font-size: var(--font-lg); }
  h2 { font-size: var(--font-base); }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer {
    padding: 32px var(--gap) 16px;
    margin-top: 40px;
  }

  .card {
    padding: 20px 16px;
    border-radius: 8px;
  }

  .section {
    margin-bottom: 16px;
  }

  .form-control {
    padding: 12px 14px;
    font-size: 16px; /* Prevent iOS zoom */
  }

  .section-header {
    padding-bottom: 16px;
  }

  .project-media {
    height: 140px;
  }
}

/* Small mobile devices (420px and below) */
@media (max-width: 420px) {
  :root {
    --gap: clamp(8px, 2vw, 12px);
  }

  .mobile-header {
    height: 56px;
  }

  .app {
    padding: 66px var(--gap) var(--gap);
  }

  .sidebar {
    padding: 16px;
  }

  .card {
    padding: 16px;
  }

  .form-control {
    padding: 10px 12px;
  }

  .btn-lg {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  h1 { font-size: var(--font-base); }
  h2 { font-size: 0.95rem; }
  h3 { font-size: 0.9rem; }
}

@media print {
  .sidebar,
  .nav,
  .project-actions,
  .form-row {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  .app {
    display: block;
    padding: 20px;
  }

  .section {
    page-break-inside: avoid;
  }
}
