/**
 * css/pages/portfolio.css
 * Phase 9 — Portfolio Page Rebuild
 *
 * Portfolio-specific styles only.
 * All global styles from: global.css → utilities.css → header.css → footer.css → components.css
 *
 * Namespace: pf-* prefix for all portfolio-specific classes.
 * Avoid generic selectors (.card, .grid, .title) to prevent global pollution.
 *
 * Load order:
 *   global.css → utilities.css → header.css → footer.css → components.css → portfolio.css
 */

/* ── Utility: visually hidden (for sr-only headings) ────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Portfolio page hero section ──────────────────────────────────────────── */

/* Override .iph bottom padding — portfolio hero has stats strip below */
.pf-hero-section.iph {
  padding-bottom: 0;
}

/* Stats strip */
.pf-hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin-top: 48px;
  background: linear-gradient(160deg, rgba(18,16,30,0.8), rgba(12,10,22,0.9));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-md);
  padding: 28px 40px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
}

.pf-hstat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 40px;
  flex: 1;
  min-width: 120px;
}

.pf-hstat-num {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  background: linear-gradient(135deg, var(--purple2), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  display: inline;
}

.pf-hstat-plus {
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 900;
  background: linear-gradient(135deg, var(--purple2), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}

.pf-hstat-lbl {
  font-size: var(--font-size-caption);
  color: var(--gray2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-family-mono);
  margin-top: 6px;
  text-align: center;
}

.pf-hstat-div {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.1), transparent);
  flex-shrink: 0;
}

/* ── Filter section ──────────────────────────────────────────────────────── */

.pf-filter-sec {
  padding: 40px 0 0;
}

.pf-filter-label {
  font-family: var(--font-family-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray2);
  margin-bottom: 10px;
}

/* Category filter pills */
.pf-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.pf-filter {
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--gray);
  font-size: var(--font-size-body-sm);
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-family-primary);
  transition: all var(--duration-fast) ease;
}

.pf-filter:hover {
  background: rgba(124,58,237,0.1);
  border-color: rgba(124,58,237,0.3);
  color: var(--purple2);
}

.pf-filter.active {
  background: linear-gradient(135deg, rgba(88,28,135,0.5), rgba(124,58,237,0.35));
  border-color: rgba(124,58,237,0.5);
  color: var(--white);
  box-shadow: 0 0 20px rgba(124,58,237,0.2);
}

/* Type tabs */
.pf-type-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pf-type-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--gray);
  font-size: var(--font-size-body-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family-primary);
  transition: all var(--duration-fast) ease;
}

.pf-type-tab:hover {
  background: rgba(124,58,237,0.1);
  border-color: rgba(124,58,237,0.3);
  color: var(--purple2);
}

.pf-type-tab.active {
  background: linear-gradient(135deg, rgba(88,28,135,0.5), rgba(124,58,237,0.35));
  border-color: rgba(124,58,237,0.5);
  color: var(--white);
  box-shadow: 0 0 20px rgba(124,58,237,0.2);
}

/* ── Projects section ────────────────────────────────────────────────────── */

.pf-section {
  padding: 40px 0 80px;
}

/* Count bar */
.pf-count-bar {
  font-family: var(--font-family-mono);
  font-size: 11px;
  color: var(--gray2);
  letter-spacing: 0.06em;
  margin-bottom: 20px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Projects 2-col grid */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

/* ── Project card ────────────────────────────────────────────────────────── */

/* .pf-card base styles are in css/components.css (preserved from legacy) */
/* Only add overrides and extensions here */

/* article link reset — cards use <article> not <a> */
.pf-card a.pf-view-btn {
  text-decoration: none;
}

/* Image wrapper */
.pf-img-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  flex-shrink: 0;
}

.pf-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.pf-card:hover .pf-img {
  transform: scale(1.04);
}

/* Number badge */
.pf-img-num {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-caption);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
}

/* Category badge */
.pf-cat-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: var(--font-size-caption);
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  letter-spacing: 0.04em;
}

/* Category badge color variants */
.pf-cat-cyan   { background: rgba(6,182,212,0.12);   border: 1px solid rgba(6,182,212,0.4);   color: var(--cyan); }
.pf-cat-purple { background: rgba(124,58,237,0.12);  border: 1px solid rgba(124,58,237,0.4);  color: var(--purple2); }
.pf-cat-green  { background: rgba(16,185,129,0.12);  border: 1px solid rgba(16,185,129,0.4);  color: var(--color-theme-green); }
.pf-cat-orange { background: rgba(245,158,11,0.12);  border: 1px solid rgba(245,158,11,0.4);  color: var(--color-theme-orange); }
.pf-cat-yellow { background: rgba(234,179,8,0.12);   border: 1px solid rgba(234,179,8,0.4);   color: #EAB308; }
.pf-cat-pink   { background: rgba(236,72,153,0.12);  border: 1px solid rgba(236,72,153,0.4);  color: var(--color-theme-pink); }
.pf-cat-red    { background: rgba(239,68,68,0.12);   border: 1px solid rgba(239,68,68,0.4);   color: var(--color-error); }
.pf-cat-teal   { background: rgba(20,184,166,0.12);  border: 1px solid rgba(20,184,166,0.4);  color: var(--color-theme-teal); }

/* Details section */
.pf-details {
  padding: 24px 26px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pf-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.pf-meta-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Tags */
.pf-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pf-tag {
  font-size: var(--font-size-caption);
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.03em;
}

/* Tag color variants */
.pf-tag-cyan   { background: rgba(6,182,212,0.12);   border: 1px solid rgba(6,182,212,0.4);   color: var(--cyan); }
.pf-tag-purple { background: rgba(124,58,237,0.12);  border: 1px solid rgba(124,58,237,0.4);  color: var(--purple2); }
.pf-tag-green  { background: rgba(16,185,129,0.12);  border: 1px solid rgba(16,185,129,0.4);  color: var(--color-theme-green); }
.pf-tag-orange { background: rgba(245,158,11,0.12);  border: 1px solid rgba(245,158,11,0.4);  color: var(--color-theme-orange); }
.pf-tag-yellow { background: rgba(234,179,8,0.12);   border: 1px solid rgba(234,179,8,0.4);   color: #EAB308; }
.pf-tag-pink   { background: rgba(236,72,153,0.12);  border: 1px solid rgba(236,72,153,0.4);  color: var(--color-theme-pink); }
.pf-tag-red    { background: rgba(239,68,68,0.12);   border: 1px solid rgba(239,68,68,0.4);   color: var(--color-error); }
.pf-tag-teal   { background: rgba(20,184,166,0.12);  border: 1px solid rgba(20,184,166,0.4);  color: var(--color-theme-teal); }

/* Type badge on card */
.pf-type-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pf-type-website { background: rgba(6,182,212,0.1);  border: 1px solid rgba(6,182,212,0.3);  color: var(--cyan); }
.pf-type-software { background: rgba(124,58,237,0.1); border: 1px solid rgba(124,58,237,0.3); color: var(--purple2); }

/* Year label */
.pf-year {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-caption);
  color: var(--gray2);
  letter-spacing: 0.1em;
  flex-shrink: 0;
}

/* Project title */
.pf-name {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--white);
  margin: 0 0 10px;
  line-height: 1.2;
}

/* Project description */
.pf-desc {
  font-size: var(--font-size-body-sm);
  color: var(--gray);
  line-height: 1.7;
  margin-bottom: 20px;
}

/* Results row */
.pf-results {
  display: flex;
  gap: 0;
  background: rgba(124,58,237,0.06);
  border: 1px solid rgba(124,58,237,0.14);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 18px;
}

.pf-result {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  border-right: 1px solid rgba(124,58,237,0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pf-result:last-child {
  border-right: none;
}

.pf-res-val {
  font-size: var(--font-size-body-sm);
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple2), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.pf-res-lbl {
  font-size: 10px;
  color: var(--gray2);
  font-family: var(--font-family-mono);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

/* Tech stack */
.pf-tech-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.pf-tech-lbl {
  font-size: var(--font-size-caption);
  color: var(--gray2);
  font-family: var(--font-family-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* tech list reset */
.pf-techs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pf-tech {
  font-size: var(--font-size-caption);
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--gray);
}

/* View Project button (as anchor) */
.pf-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(88,28,135,0.35), rgba(124,58,237,0.25));
  border: 1px solid rgba(124,58,237,0.35);
  color: var(--purple2);
  font-size: var(--font-size-body);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--duration-normal) ease;
  letter-spacing: 0.01em;
  margin-top: auto;
  align-self: flex-start;
  box-shadow: 0 0 0 1px rgba(124,58,237,0.08), inset 0 1px 0 rgba(255,255,255,0.05);
}

.pf-view-btn:hover {
  background: linear-gradient(135deg, #5B21B6, #7C3AED);
  border-color: transparent;
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(88,28,135,0.4), 0 0 0 1px rgba(124,58,237,0.4);
}

.pf-view-btn svg {
  transition: transform var(--duration-fast);
  flex-shrink: 0;
}

.pf-view-btn:hover svg {
  transform: translate(2px, -2px);
}

/* Hidden card (filtered out) */
.pf-card.pf-hidden {
  display: none;
}

/* ── Bottom CTA section ──────────────────────────────────────────────────── */

.pf-cta-section {
  text-align: center;
}

.pf-cta-inner {
  padding: 64px 0;
}

.pf-cta-inner h2 {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--white);
  margin: 12px 0 16px;
  line-height: 1.2;
}

.pf-cta-inner p {
  font-size: var(--font-size-body-lg);
  color: var(--gray);
  max-width: 480px;
  margin: 0 auto 32px;
  line-height: var(--line-height-normal);
}

.pf-cta-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

/* Tablet → 2 columns still, tighter padding */
@media (max-width: 1024px) {
  .pf-hstat {
    padding: 0 24px;
  }
}

/* Tablet small → single column grid */
@media (max-width: 900px) {
  .pf-grid {
    grid-template-columns: 1fr;
  }

  .pf-hero-stats {
    padding: 20px 16px;
    gap: 4px;
  }

  .pf-hstat {
    padding: 8px 16px;
  }
}

/* Medium mobile */
@media (max-width: 768px) {
  .pf-filter-sec .pf-filters {
    justify-content: flex-start;
  }

  .pf-cta-btns {
    flex-direction: column;
    align-items: center;
  }
}

/* Small mobile */
@media (max-width: 600px) {
  .pf-img-wrap {
    height: 180px;
  }

  .pf-hstat-div {
    display: none;
  }

  .pf-hero-stats {
    gap: 0;
  }

  .pf-filters {
    justify-content: flex-start;
  }
}

/* Narrow mobile */
@media (max-width: 414px) {
  .pf-details {
    padding: 20px;
  }

  .pf-name {
    font-size: 18px;
  }

  .pf-results {
    flex-direction: column;
  }

  .pf-result {
    border-right: none;
    border-bottom: 1px solid rgba(124,58,237,0.12);
    padding: 8px;
  }

  .pf-result:last-child {
    border-bottom: none;
  }
}

/* Very narrow (320px) */
@media (max-width: 360px) {
  .pf-filter {
    padding: 8px 14px;
    font-size: 12px;
  }

  .pf-type-tab {
    padding: 8px 14px;
    font-size: 12px;
  }

  .pf-hero-stats {
    padding: 16px 12px;
  }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .pf-card {
    transition: none !important;
  }

  .pf-img {
    transition: none !important;
  }

  .pf-view-btn {
    transition: none !important;
  }

  .pf-view-btn svg {
    transition: none !important;
  }

  .pf-filter,
  .pf-type-tab {
    transition: none !important;
  }
}
