:root {
  --bg: #f7f7f8;
  --card: #ffffff;
  --text: #111111;
  --muted: #666666;
  --accent: #0b69ff;
  --accent-hover: #0052cc;
  --radius: 10px;
  --max-width: 1200px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  --bg: #0a0e1a;
  --card: #0f1724;
  --text: #e6eef8;
  --muted: #9aa4b2;
  --accent: #6ea8ff;
  --accent-hover: #8bb8ff;
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 1.5rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: -999px;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  z-index: 999;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid rgba(11, 105, 255, 0.25);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: var(--transition);
}

:root[data-theme="dark"] .site-header {
  background: rgba(15, 23, 36, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  justify-content: flex-end;
}

.nav {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  transition: color 0.15s ease, transform 0.12s ease;
  border-radius: 6px;
}

.nav a:hover,
.nav a:focus {
  color: var(--accent);
  background: rgba(11, 105, 255, 0.08);
  transform: translateY(-1px);
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.menu-toggle,
.theme-toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: var(--transition);
}

.theme-toggle:hover,
.theme-toggle:focus,
.menu-toggle:hover,
.menu-toggle:focus {
  background: rgba(11, 105, 255, 0.08);
  transform: scale(1.05);
}

.site-nav {
  display: block;
}

.site-nav.open {
  position: fixed;
  inset: auto 1rem;
  top: 70px;
  padding: 1.5rem;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 100;
  max-width: 300px;
  margin-left: auto;
}

:root[data-theme="dark"] .site-nav.open {
  border-color: rgba(255, 255, 255, 0.1);
}

.site-nav.open .nav {
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}

.site-nav.open .nav a {
  display: block;
  padding: 0.75rem 1rem;
  text-align: left;
}

.hero {
  padding: 6rem 0 4rem;
  min-height: 80vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, rgba(11, 105, 255, 0.03) 0%, transparent 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(11, 105, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 3rem;
  position: relative;
  z-index: 1;
}

.profile-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: 0 10px 40px rgba(11, 105, 255, 0.2);
  transition: var(--transition);
}

.profile:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 50px rgba(11, 105, 255, 0.3);
}

.profile-ring {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0.3;
  animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.1;
  }
}

.hero-text {
  flex: 1;
}

.hero-greeting {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-family: 'Inter', monospace;
}

.hero-name {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.hero-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  font-size: 1rem;
}

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

.btn-primary:hover,
.btn-primary:focus {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(11, 105, 255, 0.3);
}

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

.btn-secondary:hover,
.btn-secondary:focus {
  background: rgba(11, 105, 255, 0.1);
  transform: translateY(-2px);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text);
  background: var(--card);
  border: 2px solid rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  text-decoration: none;
}

.social-link:hover,
.social-link:focus {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(11, 105, 255, 0.2);
}

:root[data-theme="dark"] .social-link {
  border-color: rgba(255, 255, 255, 0.1);
}

section {
  padding: 4rem 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

section.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.section-number {
  font-family: 'Inter', monospace;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
}

.section-header h3 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
  margin-left: 1rem;
}

.projects .grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
}

.card.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

:root[data-theme="dark"] .card {
  border-color: rgba(255, 255, 255, 0.1);
}

.card-image-wrapper {
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
}

:root[data-theme="dark"] .card-image-wrapper {
  background: #1a1f2e;
}

.project-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: var(--transition);
}

.card:hover .project-image {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: var(--transition);
}

.card:hover .card-overlay {
  opacity: 1;
}

.card-link {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
}

.card-link:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
}

.card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card h4 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.card p {
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.7;
  flex: 1;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.tech-tag {
  padding: 0.35rem 0.75rem;
  background: rgba(11, 105, 255, 0.1);
  color: var(--accent);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: 'Inter', monospace;
}

:root[data-theme="dark"] .tech-tag {
  background: rgba(110, 168, 255, 0.15);
}

.card-coming-soon {
  opacity: 0.7;
}

.coming-soon-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(11, 105, 255, 0.1) 0%, rgba(11, 105, 255, 0.05) 100%);
  color: var(--muted);
}

.site-footer {
  text-align: center;
  padding: 1.2rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.small {
  color: var(--muted);
}

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

.fade-in {
  animation: fade-in 560ms ease both;
}

@keyframes slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.element {
  animation: slide 1s ease-in-out infinite alternate;
}

@media (max-width: 920px) {
  .projects .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-inner {
    gap: 1rem;
  }

  .nav-links {
    display: none;
  }
  .header-right {
    gap: 0.5rem;
  }

  .hero {
    padding: 4rem 0 3rem;
    min-height: auto;
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .profile {
    width: 160px;
    height: 160px;
  }

  .hero-buttons {
    justify-content: center;
  }

  .social-links {
    justify-content: center;
  }

  .section-header {
    flex-wrap: wrap;
  }

  .section-line {
    display: none;
  }

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

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

  .nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  .site-nav {
    display: none;
    position: fixed;
    top: 60px; /* match header height */
    right: 1rem;
    background: var(--card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 200; /* higher than header */
    max-width: 250px;
  }

  .menu-toggle,
  .theme-toggle {
    display: flex;
  }

  .site-nav.open {
    display: block;
  }

  .brand {
    font-size: 1rem;
  }

  .contact-links {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-link {
    justify-content: center;
  }
}

.about-content {
  max-width: 800px;
}

.TEXT {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.8;
}

.skills {
  background: linear-gradient(135deg, rgba(11, 105, 255, 0.02) 0%, transparent 100%);
  border-radius: 20px;
  padding: 3rem 2rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.skill-category h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-tag {
  padding: 0.5rem 1rem;
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.skill-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--accent);
}

:root[data-theme="dark"] .skill-tag {
  border-color: rgba(255, 255, 255, 0.1);
}

.contact-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact-intro {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.contact-link:hover,
.contact-link:focus {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(11, 105, 255, 0.2);
}

:root[data-theme="dark"] .contact-link {
  border-color: rgba(255, 255, 255, 0.1);
}