:root {
  --navy-950: #050b1a;
  --navy-900: #0a1428;
  --navy-800: #0f1e3d;
  --navy-700: #16295a;
  --blue-500: #2f80ff;
  --blue-400: #3da9ff;
  --blue-300: #7cc4ff;
  --text: #e8eefc;
  --text-muted: #9aa8c7;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--navy-950);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow: hidden;
  isolation: isolate;
}

.hero-gradient {
  position: absolute;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 30%, rgba(47, 128, 255, 0.35), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(61, 169, 255, 0.25), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(22, 41, 90, 0.9), transparent 60%),
    linear-gradient(160deg, var(--navy-900), var(--navy-950) 60%);
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  0%   { transform: translate(0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate(-4%, 3%) rotate(6deg) scale(1.08); }
  100% { transform: translate(3%, -3%) rotate(-4deg) scale(1.04); }
}

.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-content {
  max-width: 760px;
  text-align: center;
  animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue-400);
  margin-bottom: 1rem;
}

.hero-name {
  font-size: clamp(2.75rem, 9vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #ffffff 0%, var(--blue-300) 55%, var(--blue-500) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-title {
  margin-top: 0.75rem;
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 600;
  color: var(--text);
}

.hero-tagline {
  margin: 1.25rem auto 0;
  max-width: 560px;
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  line-height: 1.7;
  color: var(--text-muted);
}

.hero-actions {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--blue-300);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-500), var(--blue-400));
  color: #fff;
  box-shadow: 0 8px 24px rgba(47, 128, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(47, 128, 255, 0.55);
}

.btn-secondary {
  border: 1.5px solid rgba(124, 196, 255, 0.5);
  color: var(--blue-300);
  background: rgba(10, 20, 40, 0.4);
  backdrop-filter: blur(6px);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: rgba(47, 128, 255, 0.12);
  border-color: var(--blue-400);
  color: #fff;
}

/* ---------- Shared section styles ---------- */

.section {
  position: relative;
  padding: 6rem 1.5rem;
  background: var(--navy-950);
}

.section.skills {
  background: var(--navy-900);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

.section-eyebrow {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue-400);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  background: linear-gradient(90deg, #ffffff 0%, var(--blue-300) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- About ---------- */

.about-text {
  max-width: 720px;
  display: grid;
  gap: 1.25rem;
}

.about-text p {
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  line-height: 1.75;
  color: var(--text-muted);
}

/* ---------- Skills ---------- */

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

.skill-card {
  padding: 1.75rem;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--navy-800), var(--navy-900));
  border: 1px solid rgba(124, 196, 255, 0.15);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--blue-400);
  box-shadow: 0 12px 32px rgba(47, 128, 255, 0.25);
}

.skill-label {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-300);
  background: rgba(47, 128, 255, 0.15);
  border: 1px solid rgba(61, 169, 255, 0.35);
}

.skill-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.skill-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-gradient,
  .hero-content { animation: none; }
  .btn,
  .skill-card { transition: none; }
}

/* ---------- Projects ---------- */

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

.project-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.75rem;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--navy-800), var(--navy-900));
  border: 1px solid rgba(124, 196, 255, 0.15);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--blue-400);
  box-shadow: 0 12px 32px rgba(47, 128, 255, 0.25);
}

.project-card h3 {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.project-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.tech-stack {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.tech-stack li {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--blue-300);
  background: rgba(47, 128, 255, 0.15);
  border: 1px solid rgba(61, 169, 255, 0.35);
}

.project-card .btn {
  margin-top: auto;
  padding: 0.7rem 1.5rem;
  font-size: 0.95rem;
}

/* ---------- Contact ---------- */

.section.contact {
  background: var(--navy-900);
}

.contact-form {
  max-width: 600px;
  display: grid;
  gap: 1.25rem;
  justify-items: start;
}

.form-field {
  width: 100%;
  display: grid;
  gap: 0.5rem;
}

.form-field label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(124, 196, 255, 0.2);
  background: var(--navy-950);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(61, 169, 255, 0.25);
}

.form-field input[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
  border-color: #ff6b81;
}

.contact-form .btn {
  border: none;
  cursor: pointer;
}

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

.form-status.error {
  color: #ff6b81;
}

@media (prefers-reduced-motion: reduce) {
  .project-card,
  .form-field input,
  .form-field textarea { transition: none; }
}

/* ---------- Navigation ---------- */

html {
  scroll-padding-top: 72px;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.scrolled,
.site-header.menu-open {
  background: rgba(5, 11, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(124, 196, 255, 0.15);
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  height: 72px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.nav-brand:hover {
  color: var(--blue-300);
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-link {
  position: relative;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--blue-400);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav a:focus-visible,
.footer-brand:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--blue-300);
  outline-offset: 4px;
  border-radius: 4px;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Footer ---------- */

.site-footer {
  padding: 2.5rem 1.5rem;
  background: var(--navy-950);
  border-top: 1px solid rgba(124, 196, 255, 0.12);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-brand {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-brand:hover {
  color: var(--blue-300);
}

.footer-copy {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ---------- Typography & spacing refinements ---------- */

body {
  line-height: 1.6;
}

h1, h2, h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.hero {
  padding-top: calc(72px + 2rem);
}

.section {
  padding: clamp(4rem, 10vw, 7rem) 1.5rem;
}

.section-title {
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.skill-card h3,
.project-card h3 {
  letter-spacing: -0.01em;
}

/* ---------- Hover refinements ---------- */

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

.btn-primary:hover {
  background: linear-gradient(135deg, #4a93ff, var(--blue-300));
}

.skill-card:hover .skill-label {
  background: rgba(47, 128, 255, 0.28);
  color: #fff;
}

.project-card:hover h3 {
  color: var(--blue-300);
}

.project-card:hover .tech-stack li {
  border-color: rgba(124, 196, 255, 0.6);
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .nav {
    padding: 0 1.25rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.25rem 1.25rem;
    background: rgba(5, 11, 26, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(124, 196, 255, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }

  .nav-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-link {
    display: block;
    padding: 0.9rem 0;
    font-size: 1.05rem;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link.active {
    color: var(--blue-400);
  }

  .section {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .skills-grid,
  .projects-grid {
    gap: 1.1rem;
  }

  .skill-card,
  .project-card {
    padding: 1.5rem;
  }

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

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-header,
  .nav-link,
  .nav-link::after,
  .nav-toggle span,
  .nav-menu,
  .footer-brand { transition: none; }
}
