:root {
  --primary: #0a2540;
  --secondary: #00a86b;
  --bg: #f5f7fa;
  --text: #11263d;
  --muted: #5f738a;
  --surface: rgba(255, 255, 255, 0.78);
  --card: #ffffff;
  --border: #d9e3ed;
  --shadow: 0 18px 42px rgba(10, 37, 64, 0.14);
  --shadow-lg: 0 26px 56px rgba(10, 37, 64, 0.18);
  --glow: 0 0 0 1px rgba(0, 168, 107, 0.26), 0 0 24px rgba(0, 168, 107, 0.2);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 250ms ease;
}

body.dark {
  --bg: #0c1928;
  --text: #e9f0f7;
  --muted: #9cb0c5;
  --surface: rgba(18, 37, 58, 0.72);
  --card: #12253a;
  --border: #2e4660;
  --shadow: 0 20px 42px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 28px 58px rgba(0, 0, 0, 0.44);
  --glow: 0 0 0 1px rgba(0, 168, 107, 0.3), 0 0 26px rgba(0, 168, 107, 0.26);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(0, 168, 107, 0.1), transparent 26%),
    radial-gradient(circle at 85% 18%, rgba(10, 37, 64, 0.09), transparent 32%),
    linear-gradient(165deg, #f8fbff 6%, var(--bg) 56%, #e2ebf4 100%);
  line-height: 1.65;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(10, 37, 64, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 37, 64, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 25%, transparent 85%);
}

body.dark::before {
  background-image:
    linear-gradient(rgba(233, 240, 247, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 240, 247, 0.07) 1px, transparent 1px);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.section {
  padding: 5.5rem 0;
}

.section-alt {
  background:
    linear-gradient(180deg, rgba(10, 37, 64, 0.06) 0%, rgba(10, 37, 64, 0.015) 100%),
    linear-gradient(90deg, rgba(0, 168, 107, 0.04), rgba(10, 37, 64, 0.03));
}

.eyebrow {
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  font-size: 0.75rem;
  margin-bottom: 0.8rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  max-width: 14ch;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

p {
  color: var(--muted);
}

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(245, 247, 250, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(10, 37, 64, 0.12);
  box-shadow: 0 10px 24px rgba(10, 37, 64, 0.08);
}

body.dark .header {
  background: rgba(12, 25, 40, 0.82);
}

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-weight: 800;
  color: var(--primary);
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  text-shadow: 0 0 18px rgba(0, 168, 107, 0.16);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.25rem;
}

.nav-links a {
  font-weight: 500;
  color: var(--text);
  position: relative;
  padding-bottom: 0.35rem;
  transition: color var(--transition);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--secondary), #22c58c);
  transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
}

.hero {
  position: relative;
  overflow: hidden;
  padding-top: 7rem;
  min-height: 80vh;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(10, 37, 64, 0.92) 0%, rgba(10, 37, 64, 0.82) 46%, rgba(0, 168, 107, 0.52) 100%),
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.12), transparent 40%);
  z-index: 1;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 36px 36px;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 3.25rem 2.2rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 22px;
  background: rgba(6, 18, 32, 0.25);
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
}

.hero-content h1,
.hero-content .hero-subtitle,
.hero-content .eyebrow {
  color: #f6fbff;
}

.hero-content .eyebrow {
  text-shadow: 0 0 18px rgba(0, 168, 107, 0.3);
}

.hero-subtitle {
  margin-top: 1rem;
  max-width: 62ch;
  font-size: 1.05rem;
  color: rgba(246, 251, 255, 0.88);
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-shape {
  position: absolute;
  border-radius: 999px;
  filter: blur(6px);
  z-index: 2;
}

.hero-shape-1 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(0, 168, 107, 0.5), rgba(0, 168, 107, 0));
  top: -140px;
  right: -80px;
  animation: float 7s ease-in-out infinite;
}

.hero-shape-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(37, 181, 255, 0.28), rgba(37, 181, 255, 0));
  bottom: -120px;
  left: -80px;
  animation: float 9s ease-in-out infinite reverse;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-16px);
  }
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.82rem 1.4rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px) scale(1.01);
}

.btn-primary {
  background: linear-gradient(135deg, #0f3559, #1a5f96);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 24px rgba(10, 37, 64, 0.25), 0 0 18px rgba(0, 168, 107, 0.2);
}

.btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #f3f9ff;
  background: rgba(255, 255, 255, 0.06);
}

.btn-small {
  background: linear-gradient(120deg, #00a86b, #00c57f);
  color: #fff;
  margin-top: 1rem;
  padding: 0.62rem 1rem;
  box-shadow: 0 8px 18px rgba(0, 168, 107, 0.22);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  position: relative;
  isolation: isolate;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(0, 168, 107, 0.2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), var(--glow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.section-head {
  margin-bottom: 2rem;
}

.about-grid,
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.list {
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.list li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--text);
}

.list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--secondary);
  position: absolute;
  left: 0;
  top: 0.58rem;
}

.highlight {
  border-left: 5px solid var(--secondary);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(0, 168, 107, 0.22);
}

.skills-grid,
.projects-grid,
.blog-grid {
  display: grid;
  gap: 1.2rem;
}

.skills-grid {
  grid-template-columns: repeat(3, 1fr);
}

.projects-grid {
  grid-template-columns: repeat(2, 1fr);
}

.blog-grid {
  grid-template-columns: repeat(3, 1fr);
}

.skill-icon {
  margin-right: 0.35rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tags span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  background: linear-gradient(120deg, rgba(10, 37, 64, 0.1), rgba(0, 168, 107, 0.15));
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  border: 1px solid rgba(0, 168, 107, 0.2);
}

.tools {
  margin-top: 0.55rem;
  color: var(--text);
  font-weight: 500;
}

.text-link {
  color: var(--secondary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.contact-form {
  display: grid;
  gap: 0.65rem;
}

label {
  color: var(--text);
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.76rem 0.9rem;
  background: rgba(255, 255, 255, 0.35);
  color: var(--text);
  font: inherit;
}

body.dark input,
body.dark textarea {
  background: rgba(10, 25, 42, 0.42);
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(0, 168, 107, 0.25);
  border-color: var(--secondary);
}

.form-status {
  min-height: 1.5rem;
  margin-top: 0.35rem;
  font-weight: 500;
}

.social-list {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.social-list a {
  color: var(--primary);
  font-weight: 600;
  transition: color var(--transition);
}

.social-list a:hover {
  color: var(--secondary);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  background: linear-gradient(180deg, rgba(10, 37, 64, 0.03), rgba(10, 37, 64, 0.07));
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-social {
  display: flex;
  gap: 0.55rem;
}

.footer-social a {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.footer-social a:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 168, 107, 0.5);
  box-shadow: 0 0 0 1px rgba(0, 168, 107, 0.32), 0 0 16px rgba(0, 168, 107, 0.26);
}

.loader {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 168, 107, 0.12), transparent 36%),
    rgba(245, 247, 250, 0.96);
  display: grid;
  place-content: center;
  gap: 1rem;
  z-index: 1100;
  transition: opacity 350ms ease, visibility 350ms ease;
}

body.dark .loader {
  background: rgba(12, 25, 40, 0.96);
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-ring {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(10, 37, 64, 0.18);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
  box-shadow: 0 0 18px rgba(0, 168, 107, 0.25);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
  transition: opacity 550ms ease, transform 550ms ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 992px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 800px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 76px;
    left: 0;
    width: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 4%;
    transform: scaleY(0);
    transform-origin: top;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
  }

  .nav-links.open {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .theme-toggle {
    margin-left: auto;
  }

  .about-grid,
  .contact-grid,
  .projects-grid,
  .blog-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 5.5rem;
  }

  .hero-content {
    padding: 2rem 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
