.portfolio-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(6rem, 8vw, 8rem) 0 clamp(3rem, 6vw, 5rem);
  background:
    linear-gradient(rgba(220, 174, 63, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(220, 174, 63, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 80% 20%, rgba(220, 174, 63, 0.16), transparent 34rem),
    #071f39;
  background-size: 96px 96px, 96px 96px, auto, auto;
}

.portfolio-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.7fr);
  gap: clamp(2rem, 4.5vw, 4rem);
  align-items: center;
}

.portfolio-hero-copy h1 {
  max-width: 13ch;
  margin: 0 0 1.5rem;
  color: var(--white);
  font-size: clamp(2.75rem, 4.5vw, 5rem);
  line-height: 1;
}

.portfolio-hero-showcase {
  position: relative;
  justify-self: end;
  width: min(100%, 620px);
  border: 1px solid rgba(166, 197, 226, 0.24);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(22, 58, 91, 0.72);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.24);
}

.portfolio-hero-showcase img {
  display: block;
  width: 100%;
  height: clamp(340px, 42vw, 580px);
  object-fit: cover;
  object-position: center;
}

.featured-work-section,
.portfolio-gallery-section {
  background: #071f39;
}

.featured-work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.featured-project-card,
.portfolio-sample-card {
  overflow: hidden;
  border: 1px solid rgba(166, 197, 226, 0.2);
  border-radius: 16px;
  background: #143a5d;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.featured-project-card:hover,
.portfolio-sample-card:hover {
  transform: translateY(-4px);
  border-color: rgba(220, 174, 63, 0.42);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.24);
}

.featured-project-card {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  min-height: 360px;
}

.featured-project-card:first-child {
  grid-column: 1 / -1;
}

.featured-project-media,
.portfolio-card-media {
  display: grid;
  place-items: center;
  background: #f8f8f4;
}

.featured-project-media img,
.portfolio-card-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.featured-project-media img[data-fit="contain"],
.portfolio-card-media img[data-fit="contain"] {
  object-fit: contain;
  padding: clamp(1rem, 2.5vw, 2rem);
}

.featured-project-media img[data-fit="cover"],
.portfolio-card-media img[data-fit="cover"] {
  object-fit: cover;
}

.featured-project-content,
.portfolio-card-content {
  display: flex;
  flex-direction: column;
  padding: clamp(1.4rem, 2.6vw, 2rem);
}

.featured-project-content h3,
.portfolio-card-content h3 {
  margin: 0;
  color: var(--white);
  font-size: clamp(1.35rem, 1.8vw, 2rem);
  line-height: 1.15;
}

.featured-project-content > p:not(.project-category),
.portfolio-card-content > p:not(.project-category) {
  color: var(--muted);
  line-height: 1.75;
}

.featured-project-content .button {
  align-self: flex-start;
  margin-top: auto;
}

.portfolio-filter-bar {
  margin-bottom: 1.7rem;
}

.portfolio-sample-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  min-height: 24rem;
}

.portfolio-sample-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.portfolio-card-media {
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid rgba(166, 197, 226, 0.17);
}

.portfolio-card-content {
  flex: 1;
}

.portfolio-card-content a,
.portfolio-card-content button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  margin-top: auto;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.portfolio-card-content a span,
.portfolio-card-content button span {
  color: var(--gold);
}

.portfolio-card-content a:hover,
.portfolio-card-content button:hover {
  color: var(--gold);
}

.portfolio-empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 2rem;
  border: 1px solid rgba(166, 197, 226, 0.2);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(20, 58, 93, 0.72);
}

.portfolio-service-cta {
  padding: clamp(4rem, 8vw, 7rem) 0;
  background: linear-gradient(180deg, #071f39, #0b2742);
}

.portfolio-cta-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: center;
  padding: clamp(1.6rem, 4vw, 3rem);
  border: 1px solid rgba(166, 197, 226, 0.2);
  border-radius: 22px;
  background: rgba(20, 58, 93, 0.82);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
}

.portfolio-cta-card h2 {
  margin: 0 0 1rem;
  color: var(--white);
  font-size: clamp(2.25rem, 3vw, 4rem);
  line-height: 1;
}

.portfolio-cta-card p {
  max-width: 48rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.portfolio-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: flex-end;
}

.project-modal[hidden] {
  display: none;
}

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.project-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 14, 27, 0.82);
  backdrop-filter: blur(10px);
}

.project-modal-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.8fr);
  width: min(1120px, 100%);
  max-height: min(86vh, 860px);
  overflow: auto;
  border: 1px solid rgba(166, 197, 226, 0.28);
  border-radius: 22px;
  background: #0b2742;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.45);
}

.project-modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(7, 31, 57, 0.85);
  color: var(--white);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.project-modal-media {
  display: grid;
  gap: 1px;
  align-content: start;
  background: rgba(166, 197, 226, 0.16);
}

.project-modal-media img {
  display: block;
  width: 100%;
  max-height: 56vh;
  object-fit: contain;
  background: #f8f8f4;
}

.project-modal-content {
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.project-modal-content h2 {
  margin: 0 0 0.75rem;
  color: var(--white);
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1;
}

.modal-client,
.project-modal-content > p {
  color: var(--muted);
  line-height: 1.75;
}

.modal-detail-grid {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.modal-detail-grid section {
  padding: 1rem;
  border: 1px solid rgba(166, 197, 226, 0.16);
  border-radius: 14px;
  background: rgba(7, 31, 57, 0.46);
}

.modal-detail-grid h3 {
  margin: 0 0 0.55rem;
  color: var(--white);
  font-size: 1rem;
}

.modal-detail-grid p,
.modal-detail-grid ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.modal-detail-grid ul {
  padding-left: 1.2rem;
}

.project-modal :focus-visible,
.portfolio-sample-card :focus-visible,
.featured-project-card :focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .portfolio-hero-layout,
  .portfolio-cta-card {
    grid-template-columns: 1fr;
  }

  .portfolio-hero-copy h1 {
    max-width: 13ch;
  }

  .portfolio-hero-showcase {
    justify-self: stretch;
    width: 100%;
  }

  .portfolio-hero-showcase img {
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .portfolio-cta-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .featured-work-grid,
  .portfolio-sample-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured-project-card,
  .featured-project-card:first-child,
  .project-modal-panel {
    grid-template-columns: 1fr;
  }

  .featured-project-card {
    min-height: 0;
  }

  .featured-project-media {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 640px) {
  .portfolio-hero {
    padding-top: 6rem;
  }

  .portfolio-hero-copy h1 {
    font-size: clamp(2.45rem, 11vw, 3.45rem);
  }

  .featured-work-grid,
  .portfolio-sample-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-sample-grid {
    min-height: 0;
  }

  .portfolio-cta-actions .button {
    width: 100%;
  }

  .project-modal {
    padding: 0.6rem;
  }

  .project-modal-panel {
    max-height: 90vh;
    border-radius: 18px;
  }
}
