/* Base resets */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1f2933;
  background: #f5f7fb;
  line-height: 1.6;
}

a {
  color: inherit;
}

a:hover,
a:focus {
  color: #2563eb;
}

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

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 3rem 0;
}

/* Header hero area */
header {
  background: radial-gradient(circle at top left, #2563eb 0%, #1d4ed8 40%, #111827 100%);
  color: #f9fafb;
  text-align: center;
  padding: 6rem 1.5rem 5rem;
  position: relative;
  overflow: hidden;
}

header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(17, 24, 39, 0.6) 60%);
  pointer-events: none;
}

header h1,
header p {
  position: relative;
  z-index: 1;
}

header h1 {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

header p {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: rgba(249, 250, 251, 0.85);
  margin: 0;
}

/* Navigation */
.menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: -2.5rem auto 2.5rem;
  padding: 0.75rem 1.25rem;
  width: fit-content;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.15);
  position: sticky;
  top: 1.5rem;
  z-index: 5;
}

.menu__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 4vw, 2.5rem);
}

.menu__link {
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  color: #1f2933;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.menu__link:hover,
.menu__link:focus {
  background-color: #1d4ed8;
  color: #f9fafb;
  transform: translateY(-2px);
}

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

.menu__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.75);
  color: #111827;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.menu__toggle:hover,
.menu__toggle:focus {
  background: #1d4ed8;
  color: #f8fafc;
  box-shadow: 0 10px 20px rgba(29, 78, 216, 0.25);
}

.menu.menu--open .menu__toggle {
  background: #1d4ed8;
  color: #f8fafc;
  box-shadow: 0 10px 20px rgba(29, 78, 216, 0.25);
}

.menu__toggle:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.5);
  outline-offset: 2px;
}

.menu__icon {
  position: relative;
  display: block;
  width: 1.5rem;
  height: 2px;
  border-radius: 999px;
  background-color: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.menu__icon::before,
.menu__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 1.5rem;
  height: 2px;
  border-radius: 999px;
  background-color: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.menu__icon::before {
  top: -6px;
}

.menu__icon::after {
  top: 6px;
}

.menu.menu--open .menu__icon {
  background-color: transparent;
}

.menu.menu--open .menu__icon::before {
  transform: translateY(6px) rotate(45deg);
}

.menu.menu--open .menu__icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* Section spacing */
section,
.content {
  margin-bottom: 4rem;
}

.content {
  background: #ffffff;
  border-radius: 1.25rem;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.content h2 {
  margin-top: 0;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  color: #111827;
  margin-bottom: 1.25rem;
  position: relative;
}

.content h2::after {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  background: #2563eb;
  border-radius: 999px;
  margin-top: 0.4rem;
}

.content p {
  margin-bottom: 1rem;
  color: #4b5563;
  font-size: 1.05rem;
}

/* Project cards */
#projects .project {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.02) 100%);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 1.1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#projects .project:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.18);
}

#projects h3 {
  margin-top: 0;
  color: #1d4ed8;
  font-size: 1.35rem;
}

#projects p {
  margin-bottom: 0;
  color: #334155;
}

/* Contact section */
#contact a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

#contact a:hover,
#contact a:focus {
  text-decoration: underline;
}

/* Footer */
footer {
  background: #0f172a;
  color: rgba(248, 250, 252, 0.72);
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: 0.95rem;
}

footer a {
  color: #93c5fd;
  text-decoration: none;
}

footer a:hover,
footer a:focus {
  text-decoration: underline;
}

/* Utilities */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .menu__links {
    gap: 1.25rem;
  }

  .container {
    width: min(680px, 94vw);
    padding: 2.5rem 0;
  }
}

@media (max-width: 768px) {
  header {
    padding: 5rem 1.5rem 4rem;
  }

  .menu {
    width: min(100%, 520px);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.5rem;
    border-radius: 1.5rem;
    position: static;
    margin-top: -3.25rem;
    padding: 0.75rem 1rem 1rem;
  }

  .menu__toggle {
    display: inline-flex;
  }

  .menu__links {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
  }

  .menu.menu--open .menu__links {
    display: flex;
  }

  .menu__link {
    font-size: 0.95rem;
    padding: 0.55rem 0.85rem;
    border-radius: 0.85rem;
    width: 100%;
    text-align: center;
    transform: none;
  }

  .menu__link:hover,
  .menu__link:focus {
    transform: none;
  }

  .container {
    padding: 2rem 0 3rem;
  }
}

@media (max-width: 540px) {
  header {
    padding: 4.5rem 1.25rem 3.25rem;
  }

  header h1 {
    font-size: clamp(2.2rem, 10vw, 2.75rem);
  }

  .menu {
    margin: -2.25rem auto 2rem;
    padding: 0.75rem 1rem 1rem;
  }

  .content {
    padding: 1.5rem;
  }
}

@media (max-width: 400px) {
  .menu {
    border-radius: 1rem;
  }
}
