.portfolio-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.portfolio-heading .section-title { margin-bottom: 0; }
.portfolio-count {
  flex: 0 0 auto;
  color: var(--gray);
  font-size: .9rem;
  font-weight: 700;
}
.portfolio-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, .7fr) auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 38px;
  padding: 18px 20px;
  border: 1px solid #e6edf4;
  border-radius: var(--radius);
  background: #fff;
}
.portfolio-filter label {
  grid-column: 1 / -1;
  margin-bottom: -7px;
  color: var(--navy);
  font-size: .9rem;
  font-weight: 800;
}
.portfolio-filter .form-select,
.portfolio-filter .btn { min-height: 48px; }
.portfolio-filter .form-select { border-color: #dce5ee; }
.portfolio-filter-reset {
  color: var(--blue);
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}
.portfolio-filter-reset:hover { text-decoration: underline; }
.portfolio-grid { --bs-gutter-y: 3rem; }
.project-card { height: 100%; }
.project-card-visual {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 10;
  place-items: center;
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
  color: #fff;
  background:
    radial-gradient(circle at 75% 22%, rgba(0, 184, 217, .28), transparent 34%),
    linear-gradient(135deg, #102a43, #17466e);
  text-decoration: none;
}
.portfolio-grid > [class*="col"]:nth-child(4n + 2) .project-card-visual,
.portfolio-grid > [class*="col"]:nth-child(4n + 3) .project-card-visual { aspect-ratio: 1.24; }
.project-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.project-card:hover .project-card-visual img { transform: scale(1.035); }
.project-cover-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 210px;
  place-items: center;
  color: rgba(255, 255, 255, .86);
  font-size: 3.2rem;
}
.project-cover-placeholder-large { min-height: 320px; font-size: 5rem; }
.project-card-number {
  position: absolute;
  right: 18px;
  bottom: 17px;
  color: #fff;
  font: 800 .85rem/1 Arial, sans-serif;
  letter-spacing: .12em;
  direction: ltr;
  text-shadow: 0 1px 9px rgba(0, 0, 0, .45);
}
.project-card-arrow {
  position: absolute;
  top: 16px;
  left: 16px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  color: #fff;
  background: rgba(16, 42, 67, .38);
  transition: transform .2s ease, background .2s ease;
}
.project-card:hover .project-card-arrow { transform: translate(-2px, -2px); background: rgba(16, 42, 67, .72); }
.project-card-body {
  position: relative;
  margin-top: 18px;
  padding: 18px 3px 0;
  border-top: 1px solid #dfe8f0;
}
.project-card-body::before {
  position: absolute;
  top: -1px;
  right: 0;
  width: 58px;
  height: 2px;
  background: var(--cyan);
  content: "";
}
.project-card-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.project-category {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #dce8f3;
  border-radius: 999px;
  padding: 5px 11px;
  color: #355572;
  background: #f4f8fc;
  font-size: .79rem;
  font-weight: 700;
}
.project-card-meta time { color: var(--gray); font-size: .83rem; }
.project-card-body h3 { margin: 0 0 7px; color: var(--navy); font-size: 1.2rem; font-weight: 800; line-height: 1.5; }
.project-card-body h3 a { color: inherit; text-decoration: none; }
.project-card-body h3 a:hover { color: var(--blue); }
.project-card-body > p { max-width: 650px; margin: 0 0 13px; color: var(--gray); font-size: .93rem; line-height: 1.85; }
.project-card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-size: .88rem;
  font-weight: 800;
  text-decoration: none;
}
.project-card-link:hover { gap: 12px; }
.project-card-link i { transition: transform .2s ease; }
.project-card-link:hover i { transform: translateX(-3px); }
.project-detail-cover {
  display: grid;
  min-height: 280px;
  aspect-ratio: 11 / 7;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e3ebf2;
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(circle at 75% 25%, rgba(0, 184, 217, .25), transparent 35%),
    linear-gradient(135deg, #102a43, #17466e);
  box-shadow: var(--shadow);
}
.project-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.project-overview-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; margin: 15px 0; }
.project-overview-meta time { color: var(--gray); font-size: .86rem; }
.project-description { color: var(--gray); line-height: 1.95; }
.project-external-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}
.project-external-link:hover { text-decoration: underline; }
.project-context-panel {
  height: 100%;
  padding: clamp(22px, 4vw, 36px);
  border-inline-start: 3px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #fff;
}
.project-solution-panel { border-inline-start-color: var(--cyan); }
.project-context-panel h2 { margin: 0 0 13px; color: var(--navy); font-size: 1.22rem; font-weight: 800; }
.project-context-panel > div { color: var(--gray); line-height: 1.9; }
.project-feature { display: flex; height: 100%; gap: 14px; padding: 19px 0; border-top: 1px solid #e5ecf3; }
.project-feature > i { flex: 0 0 auto; color: var(--blue); font-size: 1.3rem; }
.project-feature h3 { margin: 0 0 5px; color: var(--navy); font-size: 1rem; font-weight: 800; }
.project-feature p { margin: 0; color: var(--gray); font-size: .91rem; line-height: 1.8; }
.project-technology-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.project-technology-list li {
  padding: 8px 14px;
  border: 1px solid #dce8f3;
  border-radius: 999px;
  color: var(--navy);
  background: #fff;
  font-size: .88rem;
  font-weight: 700;
}
.project-gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.project-gallery-item { min-width: 0; margin: 0; overflow: hidden; border-radius: var(--radius); background: #eaf0f6; }
.project-gallery-item:first-child { grid-row: span 2; }
.project-gallery-item img { display: block; width: 100%; height: 100%; min-height: 220px; object-fit: cover; }
.project-gallery-item figcaption { padding: 10px 14px; color: var(--gray); font-size: .83rem; }

@media (max-width: 767.98px) {
  .portfolio-filter { grid-template-columns: 1fr auto; }
  .portfolio-filter-reset { grid-column: 1 / -1; }
  .project-gallery-grid { gap: 12px; }
  .portfolio-grid > [class*="col"] {
    flex: 0 0 50%;
    width: 50%;
  }
  .portfolio-grid > [class*="col"]:only-child {
    flex-basis: 100%;
    width: 100%;
  }
}
@media (max-width: 575.98px) {
  .portfolio-heading { align-items: flex-start; flex-direction: column; }
  .portfolio-filter { grid-template-columns: 1fr; padding: 16px; }
  .portfolio-filter label, .portfolio-filter-reset { grid-column: auto; }
  .portfolio-filter .btn { width: 100%; }
  .portfolio-grid { --bs-gutter-y: 2.25rem; }
  .project-card-visual, .portfolio-grid > [class*="col"]:nth-child(n) .project-card-visual { aspect-ratio: 1.2; }
  .project-card-body { margin-top: 12px; padding-top: 12px; }
  .project-card-meta { flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
  .project-category { padding: 4px 8px; font-size: .68rem; }
  .project-card-body h3 { font-size: .95rem; }
  .project-card-body > p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: .8rem;
  }
  .project-card-link { font-size: .78rem; }
  .project-detail-cover { min-height: 220px; }
  .project-cover-placeholder-large { min-height: 220px; }
  .project-gallery-grid { grid-template-columns: 1fr; }
  .project-gallery-item:first-child { grid-row: auto; }
  .project-gallery-item img { min-height: 190px; }
  .home-portfolio-grid .project-card-visual { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) {
  .project-card-visual img, .project-card-arrow, .project-card-link, .project-card-link i { transition: none; }
  .project-card:hover .project-card-visual img, .project-card:hover .project-card-arrow { transform: none; }
}
