html {
  scroll-behavior: smooth;
}

html.no-js .site-nav__toggle {
  display: none !important;
}

html.no-js .site-nav__list {
  position: static !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  display: flex !important;
}

body {
  --surface: #0a0a0d;
  --surface-elevated: rgba(20, 20, 24, 0.92);
  --surface-card: #121217;
  --text-primary: #f4f4f7;
  --text-secondary: #cbd0dc;
  --accent: #facc15;
  --accent-dark: #eab308;
  --secondary: #38bdf8;
  --border-subtle: rgba(252, 252, 255, 0.1);
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  background: var(--surface);
  color: var(--text-primary);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

body[data-theme="dark"] {
  --surface: #050506;
  --surface-elevated: rgba(10, 10, 14, 0.94);
  --surface-card: #0c0c10;
  --text-primary: #f9fafb;
  --text-secondary: #d4d8e5;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --secondary: #2563eb;
  --border-subtle: rgba(148, 163, 184, 0.25);
  --shadow: 0 25px 45px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 12px;
}

picture {
  display: block;
}

main {
  display: block;
}

p {
  line-height: 1.6;
  color: var(--text-secondary);
}

h1,
h2,
h3 {
  color: var(--text-primary);
  line-height: 1.2;
}

h1 {
  font-size: clamp(2.25rem, 3vw + 1rem, 3.25rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.container {
  width: min(1120px, 90vw);
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 3rem) 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-elevated);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.3s ease, border 0.3s ease;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.brand__name {
  font-size: 1.125rem;
}

.site-nav__toggle {
  display: none;
  color: var(--text-primary);
  font-weight: 600;
}

.site-nav__list {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin: 0;
}

.nav__link {
  position: relative;
  padding-block: 0.25rem;
  color: var(--text-secondary);
}

.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  box-shadow: none;
}

.button--primary {
  background: var(--accent);
  color: #1c1c1f;
  border-color: var(--accent-dark);
  box-shadow: 0 10px 22px rgba(250, 204, 21, 0.25);
}

.button--primary:hover,
.button--primary:focus-visible {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.button--ghost {
  background: transparent;
  color: var(--text-primary);
}

.button--ghost:hover {
  color: var(--accent);
}

.theme-toggle {
  font-size: 1.25rem;
  line-height: 1;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  background: var(--secondary);
  color: #fff;
  border-radius: 8px;
  z-index: 99;
}

.hero {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(250, 204, 21, 0.14));
  padding-top: 6.5rem;
}

.hero__grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero__content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--secondary);
  font-size: 0.85rem;
}

.lead {
  font-size: 1.1rem;
  max-width: 34ch;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero__metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.hero__metrics dt {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.hero__metrics dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hero__media img {
  box-shadow: var(--shadow);
  background: #050506;
}

.about__layout {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.about__bio {
  font-size: 1rem;
  max-width: 45ch;
}

.about__highlights {
  display: grid;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.about__highlights li {
  padding-left: 1.75rem;
  position: relative;
}

.about__highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
}

.skills {
  background: var(--surface);
}

.skills__grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.skill-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  padding: 1.75rem;
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.skill-meter {
  background: rgba(56, 189, 248, 0.18);
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
}

.skill-meter span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.skill-card ul {
  display: grid;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.projects__intro {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.filter-button {
  padding: 0.45rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-weight: 600;
  transition: all 0.2s ease;
}

.filter-button:hover {
  color: var(--accent);
}

.filter-button.is-active {
  background: var(--accent);
  color: #1c1c1f;
  border-color: var(--accent-dark);
}

.projects__grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
}

.project-card img {
  background: #050506;
  object-fit: cover;
}

.project-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent);
}

.tag-list li {
  padding: 0.3rem 0.7rem;
  background: rgba(250, 204, 21, 0.2);
  border-radius: 999px;
}

.project-card__links {
  display: flex;
  gap: 1.25rem;
  font-weight: 600;
}

.services {
  background: var(--surface);
}

.services__grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.service-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow);
}

.service-card a {
  font-weight: 600;
  color: var(--secondary);
}

.contact__wrap {
  display: grid;
  gap: 2.5rem;
}

.contact__intro {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact__mailto {
  font-weight: 600;
  color: var(--secondary);
}

.contact__form {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 2rem;
  display: grid;
  gap: 1.25rem;
  box-shadow: var(--shadow);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field label {
  font-weight: 600;
  color: var(--text-primary);
}

.form-field input,
.form-field textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.form-field__error {
  min-height: 1rem;
  font-size: 0.85rem;
  color: #f87171;
  margin: 0;
}

.form__status {
  min-height: 1.25rem;
  font-weight: 600;
}

.site-footer {
  background: var(--surface-card);
  border-top: 1px solid var(--border-subtle);
}

.footer__grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 0;
}

.footer__social {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-weight: 600;
}

.footer__top {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--secondary);
}

@media (max-width: 768px) {
  .site-nav__toggle {
    display: block;
  }

  .site-nav__list {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 1rem;
    background: var(--surface-card);
    padding: 1rem 1.25rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    min-width: 220px;
    transform-origin: top right;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .site-nav__list[aria-expanded="true"] {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }

  .hero {
    padding-top: 6rem;
  }

  .header__inner {
    align-items: flex-start;
  }

  .header__actions {
    gap: 0.5rem;
  }

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

  .hero__media {
    order: -1;
  }

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

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

@media (min-width: 640px) {
  .hero__grid {
    grid-template-columns: 1fr 0.9fr;
    gap: 3rem;
  }

  .about__layout {
    grid-template-columns: 0.9fr 1fr;
    gap: 3rem;
  }

  .skills__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .services__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact__wrap {
    grid-template-columns: 0.9fr 1.1fr;
  }

  .footer__grid {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (min-width: 1024px) {
  .skills__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .projects__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .services__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
