/*===============
  global styles
===============*/

* {
  padding: 0;
  margin: 0;
  border: 0;
  outline: 0;
  background-color: inherit;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  box-shadow: none;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--clr-fg);
  background-color: var(--clr-bg);
}

.light {
  --clr-bg: #fff;
  --clr-bg-alt: #fff;
  --clr-fg: #555;
  --clr-fg-alt: #444;
  --clr-primary: #2978b5;
  --shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}

.dark {
  color-scheme: dark;
  --clr-bg: #101010;
  --clr-bg-alt: #1b1b1b;
  --clr-fg: #c7c7c7;
  --clr-fg-alt: #f2f2f2;
  --clr-primary: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px,
    rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;
}

::-moz-selection {
  background: var(--clr-primary);
  color: var(--clr-bg);
}

::-webkit-selection,
::selection {
  background: var(--clr-primary);
  color: var(--clr-bg);
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  color: var(--clr-fg-alt);
}

h1 {
  font-size: 4rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.3rem;
}

ul {
  list-style-type: none;
}

a {
  text-decoration: none;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 5px;
}

.icon {
  display: block;
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--sun,
.icon--close,
.dark .icon--moon,
[aria-expanded="true"] .icon--menu {
  display: none;
}

.dark .icon--sun,
[aria-expanded="true"] .icon--close {
  display: block;
}

@media (max-width: 900px) {
  h1 {
    font-size: 2.6rem;
  }
}

/*===================
  buttons and links
===================*/

.link {
  color: var(--clr-primary);
  padding: 0 0 0.3em 0;
  position: relative;
}

.link:hover {
  color: var(--clr-primary);
}

.link::before {
  content: "";
  display: inline;
  width: 0%;
  height: 0.2em;
  position: absolute;
  bottom: 0;
  background-color: var(--clr-primary);
  transition: width 0.2s ease-in;
}

.link:hover::before,
.link:focus::before {
  width: 100%;
}

.link--nav {
  color: var(--clr-fg);
  text-transform: lowercase;
  font-weight: 500;
}

.link--icon {
  color: var(--clr-fg);
  font-size: 1.2rem;
}

.btn {
  display: block;
  padding: 0.8em 1.4em;
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: lowercase;
  transition: transform 0.2s ease-in-out;
}

.btn--outline {
  color: var(--clr-primary);
  border: 2px solid var(--clr-primary);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Let the animated button fill show through its label and SVG icon. */
.btn--outline span,
.btn--outline svg,
.btn--outline svg * {
  background-color: transparent;
}

.btn--outline:focus,
.btn--outline:hover {
  color: var(--clr-bg);
}

.btn--outline:before {
  content: "";
  position: absolute;
  background-color: var(--clr-primary);
  right: 100%;
  bottom: 0;
  left: 0;
  top: 0;
  z-index: -1;
  transition: right 0.2s ease-in-out;
}

.btn--outline:hover::before,
.btn--outline:focus::before {
  right: 0;
}

.btn--plain {
  text-transform: initial;
  background-color: var(--clr-bg-alt);
  box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 3px 0px;
  border: 0;
}

.btn--plain:hover {
  transform: translateY(-4px);
}

.btn--icon {
  padding: 0;
  font-size: 1.2rem;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
}

.btn--icon:hover,
.btn--icon:focus {
  color: var(--clr-primary);
}

.btn--icon:active {
  transform: translateY(-5px);
}

.btn--theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0.6em 0.8em;
  border: 1px solid var(--clr-primary);
  border-radius: 0.4em;
  color: var(--clr-primary);
  text-transform: none;
  white-space: nowrap;
}

.btn--theme:hover,
.btn--theme:focus-visible {
  background-color: var(--clr-primary);
  color: var(--clr-bg);
}

/*========
  layout
========*/

.center {
  display: flex;
  align-items: center;
}

.header {
  height: 8em;
  max-width: 1100px;
  width: 95%;
  margin: 0 auto;
  justify-content: space-between;
}

main {
  max-width: 1100px;
  width: 95%;
  margin: 0 auto;
}

.section {
  margin-top: 5em;
  scroll-margin-top: 2em;
}

.section__title {
  text-align: center;
  margin-bottom: 1em;
  text-transform: uppercase;
}

.nav__list {
  margin-right: 1.5em;
  display: flex;
}

.nav__list-item {
  margin-left: 1.5em;
}

.nav__hamburger {
  display: none;
}

.about {
  flex-direction: column;
  margin-top: 3em;
  text-align: center;
}

.about__name {
  color: var(--clr-primary);
}

.about__role {
  margin-top: 1.2em;
  line-height: 1.4;
}

.about__location {
  margin-top: 0.8em;
  font-size: 0.95rem;
}

.about__desc {
  font-size: 1rem;
  max-width: 600px;
  line-height: 1.8;
  text-align: left;
}

.about__desc,
.about__contact {
  margin-top: 2.4em;
}

.about .link--icon {
  margin-right: 0.8em;
}

.about .btn--outline {
  margin-right: 1em;
}

.projects__grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 2em;
}

.project {
  padding: 2em;
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
  background-color: var(--clr-bg-alt);
  box-shadow: var(--shadow);
  transition: transform 0.2s linear;
}

.project:hover {
  transform: translateY(-2px);
}

.project__description {
  margin-top: 1em;
  text-align: left;
  line-height: 1.7;
}

.project__highlights {
  list-style-type: disc;
  padding-left: 1.2em;
  margin-top: 1em;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.7;
}

.project__highlights li + li {
  margin-top: 0.4em;
}

.project__port {
  white-space: nowrap;
  font-weight: 500;
}

.project__stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: auto;
  padding-top: 1.2em;
}

.project__stack-item {
  margin: 0.5em;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--clr-fg-alt);
}

.project .link--icon {
  margin-left: 0.5em;
}

.skills__groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5em 2em;
  max-width: 900px;
  margin: 0 auto;
}

.skills__group {
  min-width: 0;
  text-align: center;
}

.skills__group h3 {
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 0.75em;
}

.skills__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.skills__list-item {
  margin: 0.5em;
  max-width: 100%;
}

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

.contact .about__desc {
  margin-top: 0;
  text-align: center;
}

.contact__link {
  margin-top: 1.8em;
}

.contact__email {
  margin-top: 1.2em;
  font-size: 0.9rem;
}

.footer {
  padding: 3em 0;
  margin-top: 4em;
  text-align: center;
}

.footer__link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--clr-fg);
}

.scroll-top {
  display: none;
  position: fixed;
  bottom: 1em;
  right: 2em;
  background-color: transparent;
  font-size: 1.8rem;
  transition: transform 0.2s ease-in-out;
}

@media (max-width: 600px) {
  .header,
  main {
    width: 90%;
  }

  .header {
    min-height: 6em;
    height: auto;
    flex-wrap: wrap;
    gap: 0.5em;
  }

  .section {
    margin-top: 4em;
  }

  .nav__list {
    flex-wrap: wrap;
    margin-right: 0.5em;
    gap: 0.8em;
  }

  .nav__list-item {
    margin-left: 0;
  }

  .js-enabled .nav__list {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0;
    padding: 2em 0;
    position: absolute;
    right: 0;
    left: 0;
    top: 5em;
    background-color: var(--clr-bg);
    z-index: 10;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    box-shadow: var(--shadow);
    transition: opacity 0.2s ease-in-out;
  }

  .js-enabled .display-nav-list {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .js-enabled .nav__list-item {
    margin: 0.5em 0;
  }

  .js-enabled .nav__hamburger {
    display: grid;
    margin-left: 0.4em;
  }

  .btn--theme {
    font-size: 0.85rem;
  }

  .about {
    align-items: flex-start;
    margin-top: 2em;
    text-align: left;
  }

  .about__role {
    font-size: 1.5rem;
  }

  .project {
    padding: 1.5em;
  }

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

  .footer {
    padding: 2em;
    margin-top: 3em;
  }

  .scroll-container {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .project:hover,
  .btn--plain:hover,
  .btn--icon:active {
    transform: none;
  }
}

/* Portfolio refinements: preserve the original light palette and layout. */
.light { --clr-border: #dedede; --clr-chip: #f5f6f7; }
.dark { --clr-border: #383838; --clr-chip: #252525; }
body { line-height: 1.7; }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.8rem); letter-spacing: -0.045em; max-width: 1000px; }
h3 { font-size: 1.3rem; line-height: 1.4; }
a, h1, h3 { overflow-wrap: anywhere; }
.header, main { width: min(92%, 1100px); }
.header { gap: 1rem; }
.skip-link { position: absolute; top: -6rem; left: 1rem; padding: 0.8rem 1rem; background: var(--clr-bg); color: var(--clr-primary); z-index: 30; }
.skip-link:focus { top: 1rem; }
.eyebrow { font-size: 0.875rem; font-weight: 500; color: var(--clr-primary); margin-bottom: 0.8rem; }
.about { padding: 1.5rem 0 2rem; }
.about__role { font-size: clamp(1.3rem, 3vw, 1.85rem); margin-top: 1.2rem; }
.about__specialties { display: block; font-size: 1rem; font-weight: 400; color: var(--clr-fg); margin-top: 0.65rem; }
.about__desc { max-width: 740px; }
.about > .about__desc { text-align: center; margin-top: 1.5rem; }
.hero__interest { max-width: 680px; margin-top: 0.8rem; }
.about__contact { gap: 1rem; flex-wrap: wrap; justify-content: center; margin-top: 1.8rem; }
.about .btn--outline { margin-right: 0; }
.btn { text-transform: none; }
.btn--primary { background: var(--clr-primary); color: var(--clr-bg); border: 2px solid var(--clr-primary); }
.btn--primary:hover { opacity: 0.85; }
.btn--primary, .btn--outline { border-radius: 0.35rem; }
.section__title { font-size: 1.7rem; letter-spacing: 0.04em; }
.section__intro { max-width: 650px; margin: -0.5rem auto 2rem; text-align: center; }
.biography { max-width: 800px; margin-left: auto; margin-right: auto; }
.biography p + p { margin-top: 1rem; }
.project, .experience-card, .credential, .skills__group { border: 1px solid var(--clr-border); border-radius: 0.6rem; background: var(--clr-bg-alt); }
.project { box-shadow: 0 4px 20px rgba(0,0,0,0.04); }
.project__highlights { font-size: 1rem; }
.project__stack { gap: 0.5rem; justify-content: flex-start; }
.project__stack-item { font-size: 0.875rem; margin: 0; padding: 0.2rem 0.6rem; border-radius: 0.25rem; background: var(--clr-chip); }
.project__source { align-self: flex-start; margin-top: 1rem; font-size: 0.9rem; }
.project__details { margin-top: 1.2rem; border-top: 1px solid var(--clr-border); padding-top: 0.6rem; }
.project__details summary { cursor: pointer; color: var(--clr-primary); font-size: 0.9rem; padding: 0.4rem 0; }
.project__details p { font-size: 0.9rem; margin-top: 0.6rem; }
.skills__groups { max-width: none; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.2rem; }
.skills__group { grid-column: span 2; text-align: left; padding: 1.4rem; border-top: 1px solid var(--clr-border); }
.skills__group:nth-child(n+4) { grid-column: span 3; }
.skills__group h3 { margin-bottom: 1rem; color: var(--clr-fg-alt); }
.skills__list { display: block; }
.skills__list-item { margin: 0; padding: 0.3rem 0; font-size: 0.95rem; }
.experience-card { padding: 2rem; }
.record-heading { display: flex; justify-content: space-between; gap: 1rem; }
.record-heading h3 span { font-weight: 400; }
.record-heading p { margin-top: 0.4rem; }
.record-date { white-space: nowrap; }
.credentials__grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.5rem; }
.credential { padding: 1.8rem; }
.credential p:not(.eyebrow) { margin-top: 0.6rem; }
.credential__result { font-weight: 500; color: var(--clr-fg-alt); }
.credential--featured { border-left: 1px solid var(--clr-border); }
.contact { border-top: 1px solid var(--clr-border); padding-top: 3rem; }
.contact__email { font-size: 1rem; }
.scroll-top a { display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 1px solid var(--clr-border); border-radius: 50%; background: var(--clr-bg); }
@media (max-width: 900px) {
  .skills__group, .skills__group:nth-child(n+4) { grid-column: span 3; }
  .skills__group:last-child { grid-column: 1 / -1; }
  .nav__list-item { margin-left: 1rem; }
  .nav__list { margin-right: 0.7rem; }
  .theme__label { display: none; }
}
@media (max-width: 600px) {
  .header { position: relative; }
  .nav__list-item { margin-left: 0; }
  .about > .about__desc { text-align: left; }
  .about__contact { justify-content: flex-start; }
  .projects__grid, .credentials__grid, .skills__groups { grid-template-columns: minmax(0, 1fr); }
  .skills__group, .skills__group:nth-child(n+4), .skills__group:last-child { grid-column: auto; }
  .record-heading { flex-direction: column; gap: 0; }
  .experience-card, .credential { padding: 1.4rem; }
  .project { padding: 1.4rem; }
  .section__title { font-size: 1.5rem; }
}

/* Targeted hero and contact layout refinements. */
#hero-title { width: 100%; text-align: center; font-size: clamp(1.9rem, 5.5vw, 3.8rem); }
.about__greeting { display: block; font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; letter-spacing: normal; margin-bottom: 0.7rem; }
.about__name, .about__name > span { display: block; }
.about__name > span + span { margin-top: 0.12em; }
.about__contact { width: 100%; justify-content: center; flex-wrap: nowrap; }
.contact__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-top: 1.8rem; }
.contact__actions .contact__link { margin-top: 0; display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; min-width: 15rem; }
.project__source { display: inline-flex; align-items: center; gap: 0.5rem; }
.project__source .icon, .contact__link .icon { flex-shrink: 0; }
#education .credentials__grid { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 360px) {
  .about__contact { gap: 0.6rem; }
  .about__contact .btn { padding: 0.8em 1em; }
}

/* Keep navigation right-aligned after removing the header wordmark. */
.header > .nav { margin-left: auto; }
