/* ==================================================
   PORTFOLIO & CASE STUDIES
   Purpose:
   Filterable project grid, project cards (always clearly
   labelled when they are demonstration concepts rather
   than delivered client work), the case-study layout and
   the testimonial placeholder structure.
================================================== */

/* ==================================================
   FILTER BAR
   Category filtering, driven by js/portfolio.js. Without
   JavaScript every project simply stays visible.
================================================== */

.portfolio-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-8);
}

.portfolio-filter__button {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background-color: var(--surface);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--ink-600);
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast),
              color var(--transition-fast);
}

.portfolio-filter__button:hover {
  border-color: var(--brand-300);
  color: var(--brand-700);
}

.portfolio-filter__button[aria-pressed="true"] {
  background-color: var(--ink-900);
  border-color: var(--ink-900);
  color: #FFFFFF;
}

.portfolio-filter__count {
  margin-left: var(--s-2);
  font-size: var(--fs-xs);
  opacity: 0.7;
}

/* Live region announcing how many projects match the active filter. */
.portfolio-status {
  margin-bottom: var(--s-6);
  font-size: var(--fs-sm);
  color: var(--ink-400);
}

/* ==================================================
   PROJECT CARD
================================================== */

.portfolio-grid {
  display: grid;
  gap: var(--gap-grid);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background-color: var(--surface);
  overflow: hidden;
  transition: transform var(--transition-normal),
              border-color var(--transition-normal),
              box-shadow var(--transition-normal);
}

.portfolio-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-200);
  box-shadow: var(--shadow-lg);
}

.portfolio-card[hidden] { display: none; }

/* Abstract, CSS-drawn cover. No stock photography is used so nothing on the
   site implies a client engagement that did not happen. */
.portfolio-card__cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--gradient-night);
  overflow: hidden;
  isolation: isolate;
}

.portfolio-card__cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 34px 34px;
}

.portfolio-card__cover::after {
  content: "";
  position: absolute;
  inset: auto -20% -50% auto;
  width: 260px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(22, 104, 255, 0.45), transparent 66%);
  filter: blur(12px);
}

.portfolio-card__cover-label {
  position: absolute;
  left: var(--s-5);
  bottom: var(--s-5);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
  color: #FFFFFF;
  max-width: calc(100% - var(--s-10));
}

.portfolio-card__badge {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
}

.portfolio-card__body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: var(--s-6);
}

.portfolio-card__category {
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: var(--s-3);
}

.portfolio-card__title {
  font-size: var(--fs-h4);
  margin-bottom: var(--s-3);
}

.portfolio-card__text {
  font-size: var(--fs-sm);
  line-height: 1.62;
  color: var(--ink-500);
  flex-grow: 1;
}

.portfolio-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--color-border);
}

/* Empty state when a filter matches nothing. */
.portfolio-empty {
  padding: var(--s-12) var(--s-6);
  text-align: center;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  color: var(--ink-400);
}

/* ==================================================
   CASE STUDY
   Structured challenge → outcome narrative.
================================================== */

.case-study-header {
  display: grid;
  gap: var(--s-6);
  padding-bottom: var(--s-8);
  border-bottom: 1px solid var(--color-border);
}

@media (min-width: 880px) {
  .case-study-header { grid-template-columns: 1.4fr 1fr; gap: var(--s-10); }
}

.case-study-meta {
  display: grid;
  gap: var(--s-4);
  align-content: start;
  padding: var(--s-6);
  border-radius: var(--radius-md);
  background-color: var(--surface-muted);
}

.case-study-meta__row {
  display: grid;
  gap: var(--s-1);
  font-size: var(--fs-sm);
}

.case-study-meta__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--ink-400);
}

.case-study-meta__value { color: var(--ink-700); font-weight: var(--fw-medium); }

/* ==================================================
   TESTIMONIAL STRUCTURE
   The component is built and styled, but ships without
   content: no review is shown until a real, attributable
   one has been supplied by a client.
================================================== */

.testimonial-grid {
  display: grid;
  gap: var(--gap-grid);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.testimonial {
  display: flex;
  flex-direction: column;
  padding: var(--s-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background-color: var(--surface);
}

.testimonial__quote-icon {
  width: 30px;
  height: 30px;
  margin-bottom: var(--s-4);
  background-color: var(--brand-200);
  mask: url("../assets/icons/ui/quote.svg") no-repeat center / contain;
  -webkit-mask: url("../assets/icons/ui/quote.svg") no-repeat center / contain;
}

.testimonial__text {
  font-size: var(--fs-body);
  line-height: 1.68;
  color: var(--ink-600);
  flex-grow: 1;
}

.testimonial__author {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--color-border);
}

.testimonial__avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background-color: var(--surface-sunken);
  color: var(--ink-400);
  font-weight: var(--fw-bold);
}

.testimonial__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--ink-800);
}

.testimonial__role {
  font-size: var(--fs-xs);
  color: var(--ink-400);
}

/* Awaiting-content state. Explicit rather than filled with invented praise. */
.testimonial--placeholder {
  border-style: dashed;
  border-color: var(--color-border-strong);
  background-color: var(--surface-muted);
}

.testimonial--placeholder .testimonial__text { color: var(--ink-400); }

/* Card inviting the visitor to leave a Google review instead. */
.review-invite {
  display: grid;
  gap: var(--s-5);
  padding: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--brand-100);
  background: var(--gradient-brand-soft);
  align-items: center;
}

@media (min-width: 760px) {
  .review-invite { grid-template-columns: 1fr auto; gap: var(--s-8); }
}

.review-invite__title {
  font-size: var(--fs-h4);
  margin-bottom: var(--s-2);
}

.review-invite__text {
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--ink-500);
}
