:root {
  --bg: #f3f8ff;
  --bg-alt: rgba(255, 255, 255, 0.92);
  --text: #11223a;
  --muted: #5f7393;
  --accent: #4f73ff;
  --accent-dark: #3457de;
  --accent-green: #1fc8a8;
  --border: rgba(79, 115, 255, 0.2);
  --shadow: 0 18px 40px rgba(18, 35, 72, 0.14);
  --header-bg: rgba(239, 246, 255, 0.78);
  --header-border: rgba(79, 115, 255, 0.25);
  --ui-gradient: linear-gradient(
    180deg,
    #0c1544 0%,
    #340a6f 20%,
    #610cb7 40%,
    #921af1 60%,
    #c235fd 80%,
    #ef5cd2 100%
  );
  --radius: 22px;
}

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

html {
  scroll-behavior: smooth;
}

main {
  scroll-snap-type: y proximity;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: var(--ui-gradient);
  line-height: 1.6;
}

body.dark {
  --bg: #04060d;
  --bg-alt: rgba(10, 15, 28, 0.92);
  --text: #eef3ff;
  --muted: #a6b4d0;
  --accent: #6a7bff;
  --accent-dark: #4b5fe0;
  --accent-green: #2de0c5;
  --border: rgba(106, 123, 255, 0.2);
  --shadow: 0 24px 55px rgba(0, 0, 0, 0.6);
  --header-bg: rgba(12, 18, 36, 0.7);
  --header-border: rgba(106, 123, 255, 0.25);
  background: var(--ui-gradient);
}

a {
  text-decoration: none;
  color: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 6vw;
  gap: 18px;
}

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

.logo {
  font-family: "Playfair Display", serif;
  font-size: 1.4rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 24px;
  font-weight: 500;
  align-items: center;
  margin-left: auto;
}

.nav-links a {
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

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

.nav-dropdown {
  position: relative;
}

.nav-drop-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.nav-drop-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: none;
  min-width: 190px;
  background: color-mix(in srgb, var(--bg-alt) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px;
  backdrop-filter: blur(10px);
  z-index: 30;
}

.nav-drop-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav-drop-menu a::after {
  display: none;
}

.nav-drop-menu a:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.nav-dropdown.open .nav-drop-menu {
  display: block;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 68px;
  height: 38px;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-alt) 72%, transparent);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  position: relative;
}

body.dark .theme-toggle {
  background: color-mix(in srgb, var(--bg-alt) 65%, transparent);
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.theme-toggle::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 78%, #ffffff 22%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease;
}

body.dark .theme-toggle::before {
  transform: translateX(30px);
  background: color-mix(in srgb, var(--accent-green) 70%, #ffffff 30%);
}

.theme-icon {
  width: 16px;
  height: 16px;
  z-index: 1;
  display: inline-flex;
  color: var(--muted);
}

.theme-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

body:not(.dark) .theme-icon.sun {
  color: #ffffff;
}

body.dark .theme-icon.moon {
  color: #ffffff;
}

.nav-toggle span {
  width: 26px;
  height: 2px;
  background: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  padding: 90px 6vw 80px;
  align-items: center;
  min-height: calc(100svh - 88px);
  scroll-snap-align: start;
  position: relative;
}

.hero-content h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.4rem, 4vw, 4rem);
  margin-bottom: 20px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.75rem;
  margin-bottom: 16px;
  color: var(--muted);
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 28px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-follow {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
  font-weight: 500;
}

.follow-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.follow-links a {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-alt) 70%, transparent);
  color: var(--text);
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
}

body.dark .follow-links a {
  background: color-mix(in srgb, var(--bg-alt) 65%, transparent);
}

.follow-links a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.follow-links svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn.primary {
  background: color-mix(in srgb, var(--accent) 82%, transparent);
  color: white;
  box-shadow: 0 12px 25px color-mix(in srgb, var(--accent) 35%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  backdrop-filter: blur(6px);
}

.btn.primary:hover {
  transform: translateY(-2px);
  background: var(--accent-dark);
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: color-mix(in srgb, var(--bg-alt) 70%, transparent);
  backdrop-filter: blur(6px);
}

body.dark .btn.ghost {
  background: color-mix(in srgb, var(--bg-alt) 65%, transparent);
}

.btn.ghost:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

.photo {
  width: clamp(220px, 32vw, 320px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease-out;
}

body.dark .photo {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.section {
  padding: 80px 6vw;
  min-height: 100svh;
  scroll-snap-align: start;
  position: relative;
}

.hero::after,
.section::after {
  content: "";
  position: absolute;
  left: 6vw;
  right: 6vw;
  bottom: 16px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 70%, transparent),
    color-mix(in srgb, var(--accent-green) 70%, transparent),
    transparent
  );
  opacity: 0.35;
  transform: scaleX(0.72);
  transform-origin: center;
  transition: transform 0.8s ease, opacity 0.8s ease;
}

.hero.show::after,
.section.show::after {
  opacity: 0.95;
  transform: scaleX(1);
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 36px;
}

.section-header h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.section-header p {
  color: var(--muted);
}

.about {
  background: var(--bg-alt);
  border-radius: var(--radius);
  margin: 0 6vw 40px;
  box-shadow: var(--shadow);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.about-card {
  background: color-mix(in srgb, var(--bg-alt) 90%, var(--accent) 10%);
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(17, 34, 58, 0.08);
}

body.dark .about-card {
  background: rgba(12, 18, 34, 0.9);
  border: 1px solid rgba(106, 123, 255, 0.2);
  box-shadow: none;
}

.about-card h3 {
  margin-bottom: 12px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.skills-panel {
  background: linear-gradient(
      145deg,
      color-mix(in srgb, var(--accent) 16%, #ffffff 84%),
      color-mix(in srgb, var(--accent-green) 12%, #ffffff 88%)
    ),
    color-mix(in srgb, var(--bg-alt) 94%, #ffffff 6%);
  border-radius: var(--radius);
  padding: 40px;
  display: grid;
  gap: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

body.dark .skills-panel {
  background: linear-gradient(145deg, rgba(106, 123, 255, 0.2), rgba(45, 224, 197, 0.14)),
    rgba(10, 15, 28, 0.92);
  border: 1px solid rgba(106, 123, 255, 0.2);
}

.skill-group h3 {
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 10px;
  text-align: center;
}

.skill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(16, 26, 52, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.skill-badge img {
  height: 44px;
  width: auto;
  display: block;
}

.skill-badge:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 16px 28px rgba(16, 26, 52, 0.24);
  filter: saturate(1.08);
}

body.dark .skill-badge {
  box-shadow: 0 14px 28px rgba(3, 7, 20, 0.45);
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #f4f7ff;
  box-shadow: 0 12px 22px rgba(5, 10, 20, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--pill, #2d6cdf) 95%, #ffffff 5%),
    color-mix(in srgb, var(--pill, #2d6cdf) 92%, #000000 8%)
  );
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  backdrop-filter: blur(6px);
}

.skill-pill:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow:
    0 18px 30px rgba(5, 10, 20, 0.4),
    0 0 12px color-mix(in srgb, var(--pill, #2d6cdf) 45%, transparent);
}

.skill-pill:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.skill-pill:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-green) 65%, transparent);
  outline-offset: 2px;
}

.projects {
  margin-top: 20px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg-alt);
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.project-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}

.text-link {
  color: var(--accent-dark);
  font-weight: 600;
}

.contact {
  background: var(--bg-alt);
  border-radius: var(--radius);
  margin: 40px 6vw 0;
  box-shadow: var(--shadow);
}

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

.contact-info ul {
  list-style: none;
  margin-top: 16px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

.contact-info a {
  color: var(--accent-dark);
}

.contact-form {
  display: grid;
  gap: 16px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  font-weight: 500;
}

input,
textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-family: inherit;
}

body.dark input,
body.dark textarea {
  background: #12171d;
  color: var(--text);
}

input:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-color: var(--accent);
}

input:invalid,
textarea:invalid {
  box-shadow: none;
}

.form-status {
  min-height: 1.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.form-status[data-state="success"] {
  color: #0f9d78;
}

.form-status[data-state="error"] {
  color: #d93025;
}

body.dark .form-status[data-state="success"] {
  color: #67f0bf;
}

body.dark .form-status[data-state="error"] {
  color: #ff8f86;
}

.footer {
  padding: 30px 6vw 50px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal.reveal-left {
  transform: translateX(-34px) scale(0.98);
}

.reveal.reveal-right {
  transform: translateX(34px) scale(0.98);
}

.reveal.reveal-zoom {
  transform: translateY(18px) scale(0.92);
}

.reveal.reveal-up {
  transform: translateY(24px) scale(0.98);
}

.reveal.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.section.show {
  animation: section-glow 900ms ease;
}

@keyframes section-glow {
  0% {
    filter: brightness(0.96) saturate(0.95);
  }

  100% {
    filter: brightness(1) saturate(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal.show {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .section.show {
    animation: none;
  }

  .photo {
    transition: none;
  }
}

@media (max-width: 820px) {
  .nav-links {
    position: absolute;
    right: 6vw;
    top: 68px;
    background: color-mix(in srgb, var(--bg-alt) 88%, transparent);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 16px 20px;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-drop-toggle {
    width: 100%;
    text-align: left;
  }

  .nav-drop-menu {
    position: static;
    margin-top: 8px;
    min-width: 0;
    width: 100%;
  }

  .nav-toggle {
    display: flex;
  }

  .nav {
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .hero {
    padding-top: 60px;
    min-height: calc(100svh - 78px);
  }

  .about,
  .contact {
    margin: 0 4vw;
  }

  .section {
    padding: 60px 4vw;
    min-height: auto;
  }
}
