.portfolio {
  padding-block: clamp(3.6rem, 7vw, 7rem);
  background: var(--paper);
  color: var(--ink);
}
.portfolio__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.4rem 3rem;
  margin-bottom: 2.25rem;
}
.portfolio__heading h2 {
  margin: 0;
  font-size: clamp(2.65rem, 5.7vw, 5rem);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.065em;
}
.portfolio__eyebrow {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 .9rem;
  color: var(--teal);
  font-size: .71rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.portfolio__eyebrow::before {
  width: 1.2rem;
  height: 1px;
  background: currentColor;
  content: "";
}
.portfolio__intro {
  max-width: 31ch;
  margin: 0 0 .15rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}
.portfolio__controls { display: none; }
.portfolio--ready .portfolio__controls {
  display: grid;
  gap: .9rem;
  padding: 1.05rem;
  border: 1px solid #d8e3dd;
  border-radius: 9px;
  background: #eef4f0;
}
.portfolio__search {
  display: flex;
  align-items: center;
  gap: .7rem;
  max-width: 30rem;
  min-height: 47px;
  padding: 0 .9rem;
  border: 1px solid #bfcec6;
  border-radius: 5px;
  background: #fff;
  color: var(--teal);
}
.portfolio__search:focus-within { outline: 2px solid #2b8f79; outline-offset: 2px; }
.portfolio__search svg { flex: none; }
.portfolio__search input {
  width: 100%;
  min-width: 0;
  align-self: stretch;
  padding: .6rem 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font-size: .95rem;
}
.portfolio__search input::placeholder { color: #56706a; }
.portfolio__filters { display: flex; flex-wrap: wrap; gap: .45rem; }
.portfolio__filters button,
.portfolio__more button {
  min-height: 40px;
  padding: .45rem .8rem;
  border: 1px solid #c6d7cd;
  border-radius: 5px;
  background: #fcfdfc;
  color: var(--ink);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}
.portfolio__filters button:hover, .portfolio__more button:hover { border-color: var(--teal); }
.portfolio__filters button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.portfolio__meta {
  display: flex;
  justify-content: space-between;
  gap: .65rem 1rem;
  flex-wrap: wrap;
  margin: 1rem 0;
  color: var(--muted);
  font-size: .78rem;
}
.portfolio__meta p { margin: 0; line-height: 1.45; }
.portfolio__status { color: var(--ink); font-weight: 750; }
.portfolio__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.9rem, 2vw, 1.6rem);
  list-style: none;
  padding: 0;
  margin: 0;
}
.portfolio-card {
  min-width: 0;
  border: 1px solid #d7e4dd;
  border-radius: 9px;
  background: #fff;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.portfolio-card:hover, .portfolio-card:focus-within {
  border-color: #a3bbb0;
  box-shadow: 0 12px 25px #14352e0c;
}
.portfolio-card__button {
  display: flex;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  flex-direction: column;
  border: 0;
  border-radius: inherit;
  background: none;
  text-align: left;
  cursor: pointer;
}
.portfolio-card__button img {
  width: 100%;
  height: auto;
  aspect-ratio: 33 / 19;
  background: #e7f0eb;
  object-fit: cover;
}
.portfolio-card__caption {
  position: relative;
  flex: 1;
  width: 100%;
  padding: .95rem 3.5rem 1.15rem 1.05rem;
}
.portfolio-card__caption > span:not(.portfolio-card__arrow) { display: block; }
.portfolio-card__category {
  margin: 0 0 .35rem;
  color: var(--teal);
  font-size: .64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .115em;
}
.portfolio-card__name {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.18rem, 2vw, 1.55rem);
  font-weight: 750;
  letter-spacing: -.04em;
  line-height: 1.13;
  overflow-wrap: anywhere;
}
.portfolio-card__spec {
  margin: .45rem 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}
.portfolio-card__arrow {
  position: absolute;
  top: 50%;
  right: .95rem;
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid #d5e6dc;
  border-radius: 50%;
  font-size: 1.05rem;
  transition: background-color .18s ease;
}
.portfolio-card__button:is(:hover, :focus-visible) .portfolio-card__arrow {
  background: var(--lime);
  border-color: transparent;
}
.portfolio__empty {
  padding: 1.5rem;
  border: 1px dashed #adbbb4;
  border-radius: 8px;
  text-align: center;
}
.portfolio__empty p { margin: 0 0 .5rem; }
.text-button {
  border: none;
  padding: .35rem;
  background: transparent;
  color: var(--teal);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.portfolio__more { display: flex; justify-content: center; }
.portfolio__more button {
  margin-top: 1.5rem;
  padding-inline: 1.4rem;
  min-height: 44px;
  font-size: .9rem;
}
.product-dialog {
  position: fixed;
  inset: 0;
  width: min(860px, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid #d2e0d8;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 20px 60px #06161455;
}
.product-dialog[open] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.product-dialog::backdrop { background: #0a292ddb; }
.product-dialog__dismiss { position: absolute; z-index: 1; top: .75rem; right: .75rem; }
.product-dialog__close {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0 0 2px;
  border: 1px solid #c9dad0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  line-height: 1;
  font-size: 1.55rem;
  cursor: pointer;
}
.product-dialog__close:hover { background: #edf5ef; }
.product-dialog__figure {
  display: grid;
  align-content: center;
  margin: 0;
  background: #eaf2ed;
}
.product-dialog__photo { width: 100%; height: auto; aspect-ratio: 33 / 19; }
.product-dialog__photo--front {
  padding: 1rem;
  object-fit: contain;
}
.product-dialog__views {
  display: flex;
  justify-content: center;
  gap: .35rem;
  padding: .75rem 1rem;
}
.product-dialog__views button {
  min-height: 38px;
  padding: .4rem .65rem;
  border: 1px solid #c6d7cd;
  border-radius: 5px;
  background: #fcfdfc;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 750;
  cursor: pointer;
}
.product-dialog__views button[aria-pressed="true"] {
  background: var(--ink);
  color: white;
}
.product-dialog__copy { min-width: 0; padding: clamp(1.35rem, 4vw, 2.8rem); padding-top: 3.45rem; }
.product-dialog__copy h2 {
  margin: 0;
  font-size: clamp(1.86rem, 4vw, 3.1rem);
  letter-spacing: -.055em;
  line-height: 1.03;
  overflow-wrap: anywhere;
}
.product-dialog__specs {
  display: grid;
  gap: .75rem;
  margin: 1.2rem 0 .75rem;
  padding: 1rem 0;
  border-block: 1px solid #d8e4df;
}
.product-dialog__specs dt { color: var(--teal); font-size: .75rem; font-weight: 800; }
.product-dialog__specs dd { margin: .25rem 0 0; line-height: 1.45; font-size: .91rem; }
.product-dialog__specs select {
  max-width: 100%;
  min-height: 42px;
  padding: .4rem .6rem;
  border: 1px solid #bdcec4;
  border-radius: 5px;
  background: #f9fcfa;
  color: var(--ink);
}
.product-dialog__source, .product-dialog__email {
  color: var(--teal);
  font-size: .82rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: .17em;
}
.product-dialog__note { color: var(--muted); font-size: .82rem; line-height: 1.5; }
.product-dialog__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1rem; margin-top: 1rem; }
.product-dialog__download {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .6rem;
  padding: .55rem .7rem;
  border-radius: 5px;
  background: var(--lime);
  color: var(--ink);
  font-size: .83rem;
  font-weight: 750;
}
.product-dialog__download:hover { background: #ddf7a4; }

@media (max-width: 980px) {
  .portfolio__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .portfolio__heading { align-items: start; flex-direction: column; gap: .65rem; margin-bottom: 1.25rem; }
  .portfolio__intro { max-width: none; }
  .product-dialog[open] { display: block; }
  .product-dialog__copy { padding: 1.35rem; }
  .product-dialog__photo { max-height: 220px; object-fit: contain; }
}
@media (max-width: 490px) {
  .portfolio__grid { grid-template-columns: 1fr; }
  .portfolio--ready .portfolio__controls { padding: .7rem; }
  .portfolio__search input { font-size: 16px; }
  .portfolio__filters button { min-height: 38px; padding-inline: .55rem; font-size: .74rem; }
}
