:root {
  --nm-gold: #d4b981;
  --nm-text: #f2ede4;
  --nm-soft: rgba(242, 237, 228, 0.68);
  --nm-line: rgba(255, 255, 255, 0.1);
  --nm-surface: rgba(27, 28, 29, 0.88);
}

html:not(.nm-content-ready) #portfolios,
body.nm-route-cv #portfolios {
  display: none;
}

.nm-portfolio-section {
  position: relative;
  z-index: 2;
  padding: clamp(82px, 10vw, 138px) 0;
  background:
    radial-gradient(circle at 78% 16%, rgba(190, 153, 87, 0.12), transparent 31%),
    linear-gradient(180deg, #121315 0%, #0f1012 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  color: var(--nm-text);
  scroll-margin-top: 86px;
}

.nm-portfolio-shell {
  width: min(1280px, calc(100% - 72px));
  margin: 0 auto;
}

.nm-portfolio-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(300px, 0.55fr);
  gap: 24px 64px;
  align-items: end;
  margin-bottom: 38px;
}

.nm-portfolio-heading .nm-kicker {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--nm-gold);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nm-portfolio-heading h2 {
  margin: 0;
  max-width: 12ch;
  color: var(--nm-text);
  font-family: Manrope, Inter, Arial, sans-serif;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 0.98;
}

.nm-portfolio-heading > p:last-child {
  margin: 0;
  color: var(--nm-soft);
  font-size: clamp(1rem, 1.4vw, 1.13rem);
  line-height: 1.75;
}

.nm-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.nm-portfolio-card {
  overflow: hidden;
  border: 1px solid var(--nm-line);
  border-radius: 24px;
  background: var(--nm-surface);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  transition: border-color 180ms ease, transform 180ms ease;
}

.nm-portfolio-card:hover {
  border-color: rgba(212, 185, 129, 0.38);
  transform: translateY(-4px);
}

.nm-portfolio-card img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center;
  border-bottom: 1px solid var(--nm-line);
  background: #0c0d0f;
}

.nm-portfolio-body {
  display: flex;
  min-height: 295px;
  flex-direction: column;
  padding: 26px;
}

.nm-card-meta {
  margin: 0 0 12px;
  color: var(--nm-gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nm-portfolio-card h3 {
  margin: 0 0 14px;
  color: var(--nm-text);
  font-family: Manrope, Inter, Arial, sans-serif;
  font-size: 1.48rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.nm-portfolio-card p:not(.nm-card-meta) {
  margin: 0;
  color: var(--nm-soft);
  line-height: 1.7;
}

.nm-card-actions,
.nm-cv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.nm-card-actions a,
.nm-cv-actions a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid rgba(212, 185, 129, 0.34);
  border-radius: 999px;
  color: var(--nm-text);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nm-card-actions a:first-child,
.nm-cv-actions a:first-child {
  background: var(--nm-gold);
  color: #171719;
}

.nm-card-actions a:hover,
.nm-cv-actions a:hover {
  border-color: var(--nm-gold);
  background: rgba(212, 185, 129, 0.14);
  color: var(--nm-text);
}

.nm-cv-download-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid rgba(212, 185, 129, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.nm-cv-download-card img {
  width: 88px;
  height: 112px;
  object-fit: cover;
  object-position: top;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.nm-cv-download-copy strong {
  display: block;
  margin-bottom: 7px;
  color: var(--nm-text);
  font-family: Manrope, Inter, Arial, sans-serif;
  font-size: 1.05rem;
}

.nm-cv-download-copy span {
  color: var(--nm-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.nm-cv-download-card .nm-cv-actions {
  margin: 0;
  padding: 0;
  justify-content: flex-end;
}

.nm-cv-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 22px;
}

.nm-cv-highlight {
  padding: 20px 22px;
  border: 1px solid var(--nm-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.028);
}

.nm-cv-highlight strong {
  display: block;
  margin-bottom: 7px;
  color: var(--nm-text);
  font-family: Manrope, Inter, Arial, sans-serif;
  font-size: 1rem;
}

.nm-cv-highlight span {
  color: var(--nm-soft);
  font-size: 0.84rem;
  line-height: 1.55;
}

@media (min-width: 1040px) {
  .navbar .nav-inner {
    padding-right: 78px;
  }

  .navbar .nav-links {
    margin-left: auto;
    transform: translateX(-18px);
  }
}

@media (max-width: 1039px) {
  .nm-portfolio-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nm-portfolio-card:last-child {
    grid-column: 1 / -1;
  }

  .nm-cv-download-card {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .nm-cv-download-card .nm-cv-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .nm-portfolio-section {
    scroll-margin-top: 170px;
  }

  .nm-portfolio-shell {
    width: min(1280px, calc(100% - 28px));
  }

  .nm-portfolio-heading,
  .nm-portfolio-grid,
  .nm-cv-highlights {
    grid-template-columns: 1fr;
  }

  .nm-portfolio-card:last-child {
    grid-column: auto;
  }

  .nm-portfolio-body {
    min-height: 0;
  }

  .nm-card-actions {
    margin-top: 8px;
  }

  .nm-cv-download-card {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 14px;
  }

  .nm-cv-download-card img {
    width: 62px;
    height: 82px;
  }

  .nm-lang-widget {
    top: 14px;
    right: 12px;
  }

  .navbar .nav-inner {
    padding-right: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nm-portfolio-card,
  .nm-card-actions a,
  .nm-cv-actions a {
    transition: none;
  }
}
