/*===============
  design tokens — dark (default)
===============*/

body.dark {
  --bg-fallback: #090b0f;
  --bg-page-gradient: none;
  --bg-secondary: #111418;
  --bg-card: #111418;
  --bg-hover: #161b22;
  --bg-navbar: #111418;

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-subtle: #6b7280;

  --accent: #2e8b57;
  --accent-bright: #3fa46a;
  --accent-blue: #3b82f6;
  --btn-primary-hover: #3fa46a;
  --accent-glow: rgba(46, 139, 87, 0.18);

  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.1);

  --link: #3fa46a;
  --link-hover: #3fa46a;

  --btn-primary-text: #f9fafb;

  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 40px rgba(46, 139, 87, 0.12);

  --gradient-accent: linear-gradient(135deg, #3fa46a 0%, #2e8b57 40%, #3b82f6 100%);

  --tag-text: #9ca3af;
  --tag-bg: rgba(17, 20, 24, 0.65);
  --tag-border: rgba(255, 255, 255, 0.06);

  --skills-block-bg: #1e242e;
  --skills-block-hover: #282f3a;

  --heading-beige: #8d97a5;
  --heading-beige-dark: #9aa5b3;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 30px rgba(0, 0, 0, 0.4);
}

/*===============
  design tokens — light
===============*/

body.light {
  --bg-fallback: #f6f4ef;
  --bg-page-gradient: linear-gradient(to bottom, #f8f6f1, #f2eee6);
  --bg-secondary: #ece8df;
  --bg-card: #ffffff;
  --bg-hover: #e7e2d7;
  --bg-navbar: rgba(255, 255, 255, 0.72);

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;

  --accent: #2e8b57;
  --accent-bright: #3fa46a;
  --btn-primary-hover: #256f47;
  --accent-glow: rgba(46, 139, 87, 0.08);

  --border: rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.1);

  --link: #2e8b57;
  --link-hover: #1f5135;

  --btn-primary-text: #f9fafb;

  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 40px rgba(46, 139, 87, 0.08);

  --gradient-accent: linear-gradient(135deg, #3fa46a 0%, #2e8b57 40%, #3b82f6 100%);

  --tag-text: rgba(31, 81, 53, 0.92);
  --tag-bg: rgba(46, 139, 87, 0.1);
  --tag-border: rgba(46, 139, 87, 0.28);

  --heading-beige: #5f6b7a;
  --heading-beige-dark: #4d5763;
}

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

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

html {
  scroll-behavior: smooth;
  --theme-veil-duration: 0.42s;
  --theme-veil-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  --section-gap: 4.5em;
  font-family: "Poppins", sans-serif;
  line-height: 1.65;
  color: var(--text-secondary);
  background-color: transparent;
  min-height: 100vh;
  position: relative;
}

/* Crossfade page backgrounds — gradients don't tween via variables alone */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  transition: opacity var(--theme-veil-duration) var(--theme-veil-ease);
}

body.theme-snap::before,
body.theme-snap::after {
  transition: none;
}

body::before {
  opacity: 1;
  background-color: #090b0f;
  background-repeat: no-repeat;
}

body::after {
  opacity: 0;
  background-color: #f6f4ef;
  background-image: linear-gradient(to bottom, #f8f6f1, #f2eee6);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

body.light::before {
  opacity: 0;
}

body.light::after {
  opacity: 1;
}

/* Full-screen veil hides per-component color snaps during theme toggle */
.theme-veil {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--theme-veil-duration) var(--theme-veil-ease);
}

.theme-veil.is-active {
  opacity: 1;
}

.theme-veil.is-instant {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    --theme-veil-duration: 0.01ms;
  }

  body::before,
  body::after,
  .theme-veil {
    transition: none;
  }
}

::-moz-selection {
  background: var(--accent);
  color: var(--text-primary);
}

::-webkit-selection,
::selection {
  background: var(--accent);
  color: var(--text-primary);
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 4rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.3rem;
  color: var(--text-secondary);
  font-weight: 500;
}

ul {
  list-style-type: none;
}

a {
  text-decoration: none;
}

button {
  cursor: pointer;
}

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

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

.link {
  color: var(--link);
  padding: 0 0 0.3em 0;
  position: relative;
  transition: color 0.2s ease;
}

.link:hover,
.link:focus-visible {
  color: var(--link-hover);
}

.link::before {
  content: "";
  display: inline;
  width: 0%;
  height: 0.12em;
  position: absolute;
  bottom: 0;
  background: var(--gradient-accent);
  transition: width 0.2s ease-in;
  border-radius: 1px;
}

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

.link--nav {
  color: var(--text-secondary);
  font-weight: 500;
}

.link--nav:hover,
.link--nav:focus-visible {
  color: var(--text-primary);
}

.link--icon {
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: color 0.2s ease;
}

.link--icon:hover,
.link--icon:focus-visible {
  color: var(--link-hover);
}

body.light .link--icon:hover,
body.light .link--icon:focus-visible {
  color: var(--accent-bright);
}

body.light .link--icon:hover svg,
body.light .link--icon:focus-visible svg {
  filter: drop-shadow(0 0 8px rgba(63, 164, 106, 0.45));
}

.btn {
  display: block;
  padding: 0.8em 1.4em;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 6px;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn--outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
  overflow: visible;
  transform-origin: center center;
  background-color: transparent;
  background-image: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  border: none;
  box-shadow: none;
  font-weight: 600;
}

/* Gradient border ring (matches .about__name gradient) */
.btn--outline::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: var(--gradient-accent);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn--outline::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  clip-path: inset(0 round 6px);
  background: linear-gradient(
    115deg,
    transparent 28%,
    rgba(255, 255, 255, 0.12) 46%,
    rgba(255, 255, 255, 0.22) 50%,
    rgba(255, 255, 255, 0.12) 54%,
    transparent 72%
  );
  transform: translateX(-140%) skewX(-14deg);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

a:has(> .btn--outline) {
  display: inline-block;
  position: relative;
  isolation: isolate;
  border-radius: 6px;
  transition: filter 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

a:has(> .btn--outline:not(.btn--resume)):hover,
a:has(> .btn--outline:not(.btn--resume)):focus-visible {
  filter: drop-shadow(0 0 10px rgba(46, 139, 87, 0.55))
    drop-shadow(0 0 20px rgba(59, 130, 246, 0.4))
    drop-shadow(0 0 32px rgba(59, 130, 246, 0.22));
}

.btn--outline:hover,
.btn--outline:focus-visible,
a:hover > .btn--outline,
a:focus-visible > .btn--outline {
  transform: translateY(-3px) scale(1.025);
}

.btn--outline:not(.btn--resume):hover,
.btn--outline:not(.btn--resume):focus-visible,
a:hover > .btn--outline:not(.btn--resume),
a:focus-visible > .btn--outline:not(.btn--resume) {
  box-shadow:
    0 0 14px rgba(46, 139, 87, 0.45),
    0 0 26px rgba(59, 130, 246, 0.35);
}

.btn--outline:hover::after,
.btn--outline:focus-visible::after,
a:hover > .btn--outline::after,
a:focus-visible > .btn--outline::after {
  opacity: 1;
  padding: 2.5px;
}

.btn--outline:not(.btn--resume):hover::before,
.btn--outline:not(.btn--resume):focus-visible::before,
a:hover > .btn--outline:not(.btn--resume)::before,
a:focus-visible > .btn--outline:not(.btn--resume)::before {
  transform: translateX(140%) skewX(-14deg);
}

.btn--outline:active,
a:active > .btn--outline {
  transform: translateY(-1px) scale(1.01);
  transition-duration: 0.12s;
}

/* Resume — gradient fill wipes in; label crossfades to light text */
.btn--resume {
  overflow: hidden;
  background-image: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: inherit;
  color: inherit;
}

.btn--resume::after {
  z-index: 2;
}

.btn--resume::before {
  display: none;
}

.btn--resume__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: inherit;
  background: var(--gradient-accent);
  transition: width 0.55s cubic-bezier(0.33, 1, 0.68, 1);
  pointer-events: none;
  z-index: 0;
}

.btn--resume:hover .btn--resume__fill,
.btn--resume:focus-visible .btn--resume__fill,
a:hover > .btn--resume .btn--resume__fill,
a:focus-visible > .btn--resume .btn--resume__fill {
  width: 100%;
}

.btn--resume__label {
  position: relative;
  z-index: 1;
  display: inline-block;
  background-image: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: inherit;
  transition:
    background-image 0.2s step-end,
    -webkit-text-fill-color 0.25s ease,
    color 0.25s ease;
}

.btn--resume__label::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--btn-primary-text);
  -webkit-text-fill-color: var(--btn-primary-text);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.33, 1, 0.68, 1) 0.18s;
  pointer-events: none;
}

.btn--resume:hover .btn--resume__label,
.btn--resume:focus-visible .btn--resume__label,
a:hover > .btn--resume .btn--resume__label,
a:focus-visible > .btn--resume .btn--resume__label {
  background-image: none;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.btn--resume:hover .btn--resume__label::after,
.btn--resume:focus-visible .btn--resume__label::after,
a:hover > .btn--resume .btn--resume__label::after,
a:focus-visible > .btn--resume .btn--resume__label::after {
  opacity: 1;
}

.btn--plain {
  text-transform: initial;
  background-color: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.btn--plain:hover,
.btn--plain:focus-visible {
  background-color: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.btn--icon {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  border-radius: 8px;
  color: var(--text-secondary);
}

.btn--icon:hover,
.btn--icon:focus-visible {
  color: var(--accent-bright);
  background-color: var(--bg-hover);
}

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

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

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

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

.header-logo {
  display: inline-block;
  cursor: pointer;
  user-select: none;
}

.header-logo h3 {
  display: inline-block;
  transition: transform 0.2s ease;
}

.header-logo:hover h3 {
  transform: scale(1.04);
}

.header-logo.is-pop h3 {
  animation: logo-pop 0.52s cubic-bezier(0.34, 1.45, 0.64, 1);
}

@keyframes logo-pop {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  35% {
    transform: scale(1.14) rotate(-4deg);
  }
  65% {
    transform: scale(0.97) rotate(3deg);
  }
}

.header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.confetti-piece {
  position: fixed;
  z-index: 10001;
  pointer-events: none;
  border-radius: 2px;
  will-change: transform, opacity;
}

.confetti-piece--circle {
  border-radius: 50%;
}

@media (prefers-reduced-motion: reduce) {
  .header-logo.is-pop h3 {
    animation: none !important;
  }

  .header-logo:hover h3 {
    transform: none;
  }

  .btn--outline::before {
    display: none;
  }

  .btn--resume::before {
    transition: none;
  }

  .btn--resume:hover .btn--resume__fill,
  .btn--resume:focus-visible .btn--resume__fill,
  a:hover > .btn--resume .btn--resume__fill,
  a:focus-visible > .btn--resume .btn--resume__fill {
    width: 100%;
  }

  .btn--resume:hover .btn--resume__label::after,
  .btn--resume:focus-visible .btn--resume__label::after,
  a:hover > .btn--resume .btn--resume__label::after,
  a:focus-visible > .btn--resume .btn--resume__label::after {
    opacity: 1;
    transition-delay: 0s;
  }

  a:has(> .btn--outline):hover,
  a:has(> .btn--outline):focus-visible {
    filter: none;
  }

  .btn--outline:hover,
  .btn--outline:focus-visible,
  .btn--outline:active,
  a:hover > .btn--outline,
  a:focus-visible > .btn--outline,
  a:active > .btn--outline {
    transform: none;
    box-shadow: none;
  }

  .text-action:hover,
  .text-action:focus-visible {
    transform: none;
  }

  .contact__link:hover .link-arrow,
  .contact__link:focus-visible .link-arrow,
  .projects__see-more:hover .link-arrow,
  .projects__see-more:focus-visible .link-arrow {
    animation: none;
  }
}

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

.section {
  margin-top: var(--section-gap);
}

#projects,
#experience {
  scroll-margin-top: 3rem;
}

.section__title {
  text-align: center;
  margin-bottom: 1.25em;
  text-transform: uppercase;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

body.light main .section__title {
  color: var(--heading-beige);
}

body.dark main .section__title {
  color: var(--accent-bright);
  text-shadow: 0 0 36px rgba(63, 164, 106, 0.45);
}

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

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

.nav__hamburger {
  display: none;
  width: 1em;
}

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

.about__name {
  display: inline;
  padding: 0;
  border: none;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  user-select: none;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.about__portrait {
  width: 22rem;
  max-width: 90vw;
  margin: 1.5rem auto 0;
  border-radius: 12px;
  display: block;
  object-fit: cover;
  aspect-ratio: 1;
  border: 1px solid var(--border-strong);
  box-shadow:
    var(--shadow-card),
    0 0 48px var(--accent-glow);
}

.about__role {
  margin-top: 1.4em;
}

.about__desc {
  font-size: 1rem;
  max-width: 600px;
  margin-inline: auto;
  text-align: center;
  text-wrap: balance;
  color: var(--text-secondary);
}

.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(auto-fit, minmax(20em, 1fr));
  gap: 2em;
}

.projects__grid--more {
  display: none;
}

.projects__grid--more.is-expanded {
  display: grid;
  margin-top: 2em;
}

.projects__show-more-wrap {
  display: flex;
  justify-content: center;
  max-width: 1100px;
  margin: 2em auto 0;
}

.projects__show-more-wrap.is-repositioned {
  margin-top: 2em;
}

.projects__expanded-actions {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

.projects__show-more-wrap.is-repositioned .projects__show-more {
  display: none;
}

.projects__show-more-wrap.is-repositioned .projects__expanded-actions {
  display: flex;
}

.text-action {
  display: inline;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.text-action:hover,
.text-action:focus-visible {
  background-image: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.text-action:focus-visible {
  outline: none;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
}

.projects__see-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.link-arrow {
  display: inline-block;
  font-size: 0.96em;
  line-height: 1;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.link-arrow::before {
  content: "↗";
}

.contact__link:hover .link-arrow,
.contact__link:focus-visible .link-arrow,
.projects__see-more:hover .link-arrow,
.projects__see-more:focus-visible .link-arrow {
  background-image: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: link-arrow-diagonal 0.7s ease-in-out infinite alternate;
}

@keyframes link-arrow-diagonal {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(4px, -4px);
  }
}

.contact__link.link--icon {
  align-items: flex-end;
  gap: 0.45rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.contact__link.link--icon svg {
  display: block;
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}

.contact__link-label {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  line-height: 1;
}

.contact__link .link-arrow {
  line-height: 1;
  padding-bottom: 0.06em;
}

.project {
  position: relative;
  overflow: visible;
  padding: 1.5em 1.5em 3.25em;
  margin: 0 auto;
  width: 100%;
  text-align: left;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  transition:
    transform 0.25s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.project.has-notes-open,
.project:has(.project__notes.is-open),
.project:has(.project__notes:hover),
.project:has(.project__notes:focus-within),
.project:has(.project__icon-hint:hover),
.project:has(.project__icon-hint:focus-within) {
  z-index: 50;
}

.project:hover {
  transform: translateY(-4px);
  background-color: var(--bg-hover);
  border-color: var(--border-strong);
  box-shadow:
    var(--shadow-card),
    var(--shadow-glow);
}

body.dark .project:hover {
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 12px 40px rgba(0, 0, 0, 0.45),
    var(--shadow-glow);
}

.project__header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.project__header-link {
  display: block;
  margin: -0.35rem;
  padding: 0.35rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.project__header-link .project__description {
  margin: 1.15em 0 0;
  line-height: 1.55;
}

.project__header-link:hover,
.project__header-link:focus-visible {
  background-color: var(--bg-hover);
}

.project__header-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project__header-link:hover h3,
.project__header-link:focus-visible h3 {
  color: var(--accent-bright);
}

body.light .project__header h3,
body.light .project__header-link h3 {
  color: var(--heading-beige);
}

body.light .project__header-link:hover h3,
body.light .project__header-link:focus-visible h3 {
  color: var(--heading-beige-dark);
}

.project__image {
  flex-shrink: 0;
  width: 5.5rem;
  height: 5.5rem;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--bg-secondary);
}

.project__header h3,
.project__header-link h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--text-primary);
}

.project__title-group {
  flex: 1;
  min-width: 0;
}

.project__header:has(.project__title--forge) {
  align-items: flex-start;
}

.project__header:has(.project__title--forge) .project__title-group {
  padding-top: calc((88px - 1.05rem * 1.69 * 1.35) / 2);
}

.project__subtitle {
  margin: 0.2em 0 0;
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 400;
  color: var(--text-secondary);
}

.project__header h3.project__title--forge,
.project__header-link h3.project__title--forge {
  font-size: calc(1.05rem * 1.69);
}

.project__header h3.project__title--spreadsheet,
.project__header-link h3.project__title--spreadsheet {
  font-size: calc(1.05rem * 1.15);
}

.project__body {
  margin-top: 1.15em;
}

.project h3 {
  color: var(--text-primary);
}

.project__description {
  margin-top: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.project__stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  margin: 1.2em 0;
  gap: 0.38rem;
  padding: 0;
  list-style: none;
}

.project__stack-item {
  margin: 0;
  font-weight: 600;
  font-size: 0.68rem;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--tag-text);
  background-color: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

body.light .project__stack-item {
  color: var(--text-muted);
  background-color: var(--bg-secondary);
  border-color: var(--border);
}

.project:hover .project__stack-item {
  color: var(--accent-bright);
  border-color: rgba(63, 164, 106, 0.28);
}

body.dark .project:hover .project__stack-item {
  border-color: rgba(255, 255, 255, 0.1);
}

body.light .project:hover .project__stack-item {
  color: var(--accent-bright);
  background-color: rgba(46, 139, 87, 0.1);
  border-color: rgba(46, 139, 87, 0.28);
}

.project:has(.link--icon-text) {
  padding-bottom: 4.25em;
}

.project__links {
  position: absolute;
  bottom: 1.5em;
  left: 1.5em;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5em;
  margin: 0;
}

.project__links .link--icon-text {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  margin: 0;
}

.project__links .link.link--icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 0 0.3em 0;
  min-width: 24px;
  min-height: 24px;
  vertical-align: middle;
  overflow: visible;
}

.project__links .link.link--icon::before {
  bottom: 0;
  left: 0;
}

.project__notes {
  position: relative;
  display: inline-flex;
}

.project__notes::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 0.65rem;
}

.project__notes-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  margin: 0;
  font: inherit;
}

.project__notes-popup {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.65rem);
  transform: translate(0, 0.35rem);
  width: min(20.5rem, calc(100vw - 3.5rem));
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
  z-index: 10;
}

body.light .project__notes-popup {
  box-shadow:
    0 16px 32px rgba(34, 51, 84, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

.project__notes.is-open .project__notes-popup {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(0, 0);
}

.project__notes-title {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

.project__notes-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.38rem;
}

.project__notes-list li {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.project__icon-hint {
  position: relative;
  display: inline-flex;
}

.project__icon-hint::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 0.65rem;
}

.project__icon-hint-popup {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.65rem);
  transform: translate(0, 0.35rem);
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.04) inset;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
  z-index: 10;
}

body.light .project__icon-hint-popup {
  box-shadow:
    0 16px 32px rgba(34, 51, 84, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

.project__icon-hint:hover .project__icon-hint-popup,
.project__icon-hint:focus-within .project__icon-hint-popup {
  opacity: 1;
  visibility: visible;
  transform: translate(0, 0);
}

.skills__list {
  max-width: 520px;
  width: 95%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25em;
  user-select: none;
}

.skills__list-item {
  margin: 0.5em;
  border: none;
  border-radius: 0;
}

.skills__list-item:hover,
.skills__list-item:focus-visible {
  border: none;
}

body.dark .skills__list-item {
  background-color: var(--skills-block-bg);
}

body.dark .skills__list-item:hover,
body.dark .skills__list-item:focus-visible {
  background-color: var(--skills-block-hover);
}

.contact {
  display: flex;
  justify-content: center;
}

.contact__layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1.25em 2.25rem;
  width: 100%;
}

.contact__title {
  grid-column: 1 / -1;
  grid-row: 1;
  margin-bottom: 0;
  text-align: center;
}

.contact__linkedin {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  display: inline-flex;
  align-items: center;
}

.contact__side {
  grid-row: 2;
  display: inline-flex;
  align-items: center;
}

.contact__side--email {
  grid-column: 1;
  justify-self: end;
}

.contact__side--github {
  grid-column: 3;
  justify-self: start;
}

@media (max-width: 640px) {
  .contact__layout {
    grid-template-columns: 1fr;
    gap: 1em;
  }

  .contact__title,
  .contact__linkedin,
  .contact__side--email,
  .contact__side--github {
    grid-column: 1;
    grid-row: auto;
    justify-self: center;
  }
}

.footer {
  padding: 2em 1.5em 2.5em;
  margin-top: var(--section-gap);
  text-align: center;
  border-top: 1px solid var(--border);
}

.footer__credit {
  max-width: 36rem;
  margin: 0 auto;
  font-size: 0.75rem;
  line-height: 1.6;
  font-weight: 400;
  color: var(--text-muted);
}

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

@media (max-width: 600px) {
  .projects__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .projects__grid--more.is-expanded {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .projects__grid--more.is-expanded,
  .projects__show-more-wrap,
  .projects__show-more-wrap.is-repositioned {
    margin-top: 1rem;
  }

  .project {
    padding: 1.1em 1.1em 2.9em;
  }

  .project__description,
  .project__header-link .project__description {
    display: none;
  }

  .project__body {
    margin-top: 0.85em;
  }

  .project__header,
  .project__header-link .project__header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.65rem;
  }

  .project__header h3,
  .project__header-link h3 {
    font-size: 0.9rem;
    line-height: 1.3;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .project__header:has(.project__title--forge) {
    align-items: center;
  }

  .project__header:has(.project__title--forge) .project__title-group {
    padding-top: 0;
  }

  .project__header h3.project__title--forge,
  .project__header-link h3.project__title--forge {
    font-size: calc(0.9rem * 1.69);
  }

  .project__header h3.project__title--spreadsheet,
  .project__header-link h3.project__title--spreadsheet {
    font-size: calc(0.9rem * 1.15);
  }

  .project__stack {
    justify-content: center;
    margin-top: 0.8em;
  }

  .project__stack-item--excel-docker {
    order: 4;
  }

  .project__image {
    width: 4rem;
    height: 4rem;
  }

  .header {
    height: 6em;
  }

  body {
    --section-gap: 3.5em;
  }

  .nav__list {
    flex-direction: column;
    padding: 4em 0;
    position: absolute;
    right: 0;
    left: 0;
    top: 5em;
    background-color: var(--bg-navbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease-in-out;
  }

  .display-nav-list {
    width: 100%;
  }

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

  .nav__hamburger {
    display: flex;
    margin-left: 0.8em;
  }

  .about {
    align-items: center;
    margin-top: 2em;
    text-align: center;
  }

  .about h1,
  .about__role {
    width: 100%;
    text-align: center;
  }

  .about__name {
    -webkit-tap-highlight-color: transparent;
  }

  .about__name:focus,
  .about__name:focus-visible,
  .about__name:active {
    outline: none;
    box-shadow: none;
  }

  .about__portrait {
    width: 14rem;
    height: 14rem;
    aspect-ratio: 1 / 1;
    margin-top: 1rem;
  }

  .about__contact {
    width: 100%;
    justify-content: center;
    gap: 0.8rem;
  }

  .about .btn--outline,
  .about .link--icon {
    margin-right: 0;
  }

  .footer {
    padding: 2em;
  }
}

.btn--icon svg,
.link--icon svg {
  width: 24px;
  height: 24px;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.link--icon:hover svg,
.link--icon:focus-visible svg {
  transform: translateY(-2px);
}

.github-icon {
  transform: scale(0.9);
}

.link--icon:hover .github-icon,
.link--icon:focus-visible .github-icon {
  transform: scale(0.9) translateY(-2px);
}

.contact__link.link--icon:hover svg,
.contact__link.link--icon:focus-visible svg,
.contact__link.link--icon:hover .github-icon,
.contact__link.link--icon:focus-visible .github-icon {
  transform: none;
}

.link--icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.link--icon-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.link--icon:hover .link--icon-text,
.link--icon:focus-visible .link--icon-text {
  color: var(--link-hover);
}

body.light .link--icon:hover .link--icon-text,
body.light .link--icon:focus-visible .link--icon-text {
  color: var(--accent-bright);
}

.link--muted,
.link--icon-text.link--muted {
  color: var(--text-muted);
  cursor: default;
}

.link--muted::before {
  display: none;
}

/* theme toggle icons */
.theme-icon--sun {
  display: none;
}

body.light .theme-icon--moon {
  display: none;
}

body.light .theme-icon--sun {
  display: block;
}

.theme-icon {
  transform: rotate(-12deg);
}

/* Keep the theme toggle icon-only (no square background flash) */
.btn-theme:hover,
.btn-theme:focus-visible,
.btn-theme:active {
  background-color: transparent;
}

/*===================
  experience section
===================*/

.experience-list {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 0.9rem;
  padding: 0;
  list-style: none;
}

.experience-item {
  display: grid;
  grid-template-columns: minmax(7.2rem, 9rem) 1fr;
  align-items: start;
  gap: 0.85rem;
  padding: 0.9rem 0.8rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.experience-item:hover {
  background: var(--bg-hover);
  border-color: var(--border);
  transform: translateY(-1px);
}

.experience-item__link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.experience-item__link:focus-visible {
  outline: none;
}

.experience-item__link:focus-visible .experience-item__content {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.experience-item__range {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.4;
  transition: color 0.2s ease;
}

body.dark .experience-item__range {
  color: var(--heading-beige);
}

body.dark .experience-item:hover .experience-item__range {
  color: var(--accent-bright);
}

body.light .experience-item__range {
  color: var(--heading-beige-dark);
}

.experience-item__content {
  min-width: 0;
}

.experience-item__title {
  margin: 0;
  font-size: clamp(0.95rem, 1.8vw, 1.04rem);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.experience-item__location {
  margin: 0.25rem 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.experience-item__bullets {
  display: grid;
  gap: 0.45rem;
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
  list-style-type: disc;
}

.experience-item__bullets li {
  font-size: 0.9rem;
  line-height: 1.58;
  color: var(--text-secondary);
}

.experience-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.experience-item__tags li {
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
  color: var(--tag-text);
  background-color: var(--tag-bg);
  border: 1px solid var(--tag-border);
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

body.dark .experience-item__tags li {
  color: var(--accent-bright);
  border-color: rgba(63, 164, 106, 0.28);
}

body.light .experience-item__tags li {
  color: var(--text-muted);
  background-color: var(--bg-secondary);
  border-color: var(--border);
}

body.light .experience-item:hover .experience-item__tags li {
  color: var(--accent-bright);
  background-color: rgba(46, 139, 87, 0.1);
  border-color: rgba(46, 139, 87, 0.28);
}

@media (max-width: 760px) {
  .experience-item {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    padding: 0.78rem 0.72rem;
    background: var(--bg-card);
    border-color: var(--border);
  }

  .experience-item__range {
    margin: 0;
    font-size: 0.66rem;
  }

  .experience-item__title {
    font-size: 0.93rem;
  }

  .experience-item__location {
    font-size: 0.79rem;
  }

  .experience-item__bullets {
    font-size: 0.84rem;
    line-height: 1.48;
  }
}

@media (prefers-reduced-motion: reduce) {
  .experience-item {
    transition: none;
  }

  .experience-item:hover {
    transform: none;
  }
}

/*===============
  case study page
===============*/

.case-study {
  --case-study-back-size: 1.05rem;
  --case-study-heading-size: 0.78rem;
  --case-study-row-line-height: 1.4;
  margin-top: 2em;
  margin-bottom: 4em;
  display: grid;
  grid-template-columns: 1fr minmax(0, 680px) 1fr;
  column-gap: clamp(1.25rem, 4vw, 2.75rem);
  align-items: start;
}

.case-study__back {
  grid-column: 1;
  justify-self: end;
  align-self: start;
  display: inline-flex;
  margin-bottom: 0;
  margin-top: calc(
    (var(--case-study-heading-size) - var(--case-study-back-size)) * var(--case-study-row-line-height) /
      2
  );
  white-space: nowrap;
}

.case-study__back-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.case-study__back-text {
  line-height: var(--case-study-row-line-height);
}

.case-study__back .link-arrow--left {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.92em;
  line-height: 1;
  transform: translateY(-0.06em);
}

.case-study__back:hover,
.case-study__back:focus-visible {
  background-image: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.case-study__back:focus-visible {
  outline: none;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.2em;
}

.link-arrow--left::before {
  content: "←";
}

.case-study__back:hover .link-arrow--left,
.case-study__back:focus-visible .link-arrow--left {
  transform: translate(-3px, -0.06em);
  animation: none;
  background-image: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.case-study__hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.5em;
  padding: 2em 1.5em;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.case-study__icon {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  margin-bottom: 1.25em;
}

.case-study__title {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 0.65em;
}

.case-study__subtitle {
  max-width: 56ch;
  margin: 0 auto 1.5em;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-secondary);
  text-wrap: balance;
}

.case-study__actions {
  display: flex;
  justify-content: center;
  gap: 0.75em;
}

.case-study__section .case-study__actions {
  margin-top: 2em;
  clear: both;
}

.case-study__figure {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.case-study__figure--float {
  float: right;
  width: 25%;
  max-width: 170px;
  margin: 0 0 0.75em 1em;
}

.case-study__figure--float-lg {
  width: 30%;
  max-width: 192px;
}

.case-study__section-body--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 1em;
  align-items: start;
}

.case-study__section-body--split p {
  grid-column: 1;
  margin: 0;
}

.case-study__figure--side {
  grid-column: 2;
  grid-row: 1;
  float: none;
  width: 192px;
  max-width: 192px;
  margin: 1.5em 0 0;
  border-radius: 0;
  overflow: visible;
}

.case-study__figure-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  font: inherit;
}

.case-study__figure-zoom:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.case-study__figure img {
  display: block;
  width: 100%;
  height: auto;
}

.case-study__section::after {
  content: "";
  display: table;
  clear: both;
}

.case-study__content {
  grid-column: 2;
  width: 100%;
  max-width: 680px;
  margin: 0;
}

.case-study__section {
  padding: 1.5em 0;
  border-top: 1px solid var(--border);
}

.case-study__section:first-child {
  border-top: none;
  padding-top: 0;
}

.case-study__section:first-child .case-study__heading {
  line-height: var(--case-study-row-line-height);
}

.case-study__heading {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--heading-beige);
  margin-bottom: 0.85em;
}

body.dark .case-study__heading {
  color: var(--text-primary);
}

body.light .case-study__heading {
  color: var(--heading-beige-dark);
}

.case-study__section p {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.case-study__list {
  list-style: none;
  display: grid;
  gap: 0.85em;
}

.case-study__list li {
  position: relative;
  padding-left: 1.15em;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.case-study__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-bright);
}

.case-study__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  list-style: none;
}

.case-study__tags li {
  padding: 0.35em 0.85em;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--tag-text);
  background-color: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: 999px;
}

.case-study__section--skills {
  padding-bottom: 0;
}

.image-lightbox {
  position: relative;
  border: none;
  padding: 0;
  margin: auto;
  max-width: min(92vw, 960px);
  width: auto;
  background: transparent;
  overflow: visible;
}

.image-lightbox::backdrop {
  background: rgba(8, 10, 14, 0.82);
  backdrop-filter: blur(4px);
}

.image-lightbox__close {
  position: absolute;
  top: -2.75rem;
  right: 0;
  color: #fff;
}

.image-lightbox__close:hover,
.image-lightbox__close:focus-visible {
  color: var(--accent-bright);
}

.image-lightbox__figure {
  margin: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.image-lightbox__image {
  display: block;
  width: 100%;
  max-height: 82vh;
  height: auto;
  object-fit: contain;
}

.image-lightbox__caption {
  padding: 0.85em 1em;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: center;
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .case-study {
    grid-template-columns: minmax(0, 680px);
    justify-content: center;
  }

  .case-study__back,
  .case-study__content {
    grid-column: 1;
  }

  .case-study__back {
    justify-self: start;
    margin-bottom: 1.5em;
  }
}

@media (max-width: 640px) {
  .case-study__hero {
    padding: 1.5em 1.15em;
  }

  .case-study__section {
    padding: 1.25em 0;
  }
}
