/* ==========================================================================
   Portfolio (/portfolio/). Shared kit: page.css (.pg-*). This file only adds
   what's specific to this page: the browser-chrome frame, the alternating
   case-study blocks, the client cards, the capability matrix and the tools
   groups.
   Plan: design-runs/2026-09-28-site-v3/pages/00-plan.md §2
   Round 2 (2026-09-29): chatgpt design review + triage — see
   design-runs/2026-09-28-site-v3/review/portfolio/{chatgpt,triage}.md. The
   throughline: spend pixels on the evidence (screenshots, ratings), not on
   ornament (stacked frames, pill walls, tall mobile cards).
   ========================================================================== */

/* ==========================================================================
   Browser-chrome frame (hero, client cards)
   ========================================================================== */

.pf-frame {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow-panel);
}

.pf-frame__link { display: block; color: inherit; text-decoration: none; }

.pf-frame__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding-inline: 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--slate-50);
}

.pf-frame__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone-mark, var(--slate-300));
}

.pf-frame__url {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--slate-600);
  font-size: 0.75rem;
  font-weight: 500;
}

.pf-frame__url svg { flex-shrink: 0; width: 11px; height: 11px; color: var(--slate-500); }

.pf-frame__img { display: block; }
.pf-frame__img img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: top center; }

/* ==========================================================================
   Hero: one large, readable frame (not a portrait, not a decorative stack)
   ========================================================================== */

.pf-hero-stack__dots { --dots-at: 62% 42%; }

.pf-hero-stack__note {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 3;
  transform: rotate(-4deg);
  transform-origin: left top;
}

.pf-hero-stack__note svg { display: none; }

/* Round 2: a single frame, not a stack — the site content is the largest
   object in the hero, at ≥85% of the frame's own height (the chrome bar is
   a fixed 30px against a 16:9 image, well under 15% at any of these widths).
   Round 3: ~10–15% shorter on phones (378→360 was ~5%; 90%→78% of a 390px
   viewport is the rest) so the hero clears the fold sooner. */
.pf-hero-stack {
  position: relative;
  z-index: 1;
  width: min(78%, 360px);
  margin: 4px auto 32px;
}

.pf-hero-stack__frame {
  width: 100%;
  transform: rotate(-3deg); /* 2–4°, per review */
}

@media (min-width: 640px) {
  .pf-hero-stack { width: min(74%, 480px); margin: 8px auto 48px; }
}

@media (min-width: 1200px) {
  .pf-hero-stack { width: min(94%, 600px); margin: 32px 8px 40px auto; }
  .pf-hero-stack__note { top: 2%; left: -4%; font-size: 1.25rem; }
  .pf-hero-stack__note svg {
    display: block;
    width: 54px;
    height: 40px;
    margin: 6px 0 0 96px;
    color: var(--ink-900);
    transform: scaleX(-1) rotate(-12deg);
  }
}

/* A quieter secondary action next to the primary "See the work ↓" (reused
   for the FAQ help card's plain buttons too — page.css, generic). */
.pg-hero__actions .pg-help__link { min-height: 48px; }

/* Round 3, phones only: a 2-col/1-col fact hybrid instead of 3 full-width rows, the two
   CTAs on one row (primary ~60/secondary ~40), and a tighter gap into "01 / Case studies". */
@media (max-width: 899.98px) {
  .pf-hero .pg-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }

  .pf-hero .pg-hero__actions { flex-wrap: nowrap; gap: 10px; }

  .pf-hero .pg-hero__actions .why-btn--primary { flex: 0 1 58%; padding-inline: 10px; }
  .pf-hero .pg-hero__actions .pg-help__link { flex: 1 1 42%; justify-content: center; padding-inline: 8px; }

}

@media (max-width: 767.98px) {
  .pf-cases.pg-section { padding-top: 0; }
}

/* ==========================================================================
   01 Businesses I run — alternating case-study blocks (the primary evidence)
   ========================================================================== */

.pf-cases { background: var(--paper); }

/* 40–56px between cases on phones, 64–80px on desktop (review r3 — r2's 64–104 clamp
   read as "editorial panels" rather than a portfolio list). */
.pf-cases__list {
  display: grid;
  gap: clamp(40px, 6vw, 56px);
  margin: 0;
}

@media (min-width: 900px) {
  .pf-cases__list { gap: clamp(64px, 5vw, 80px); }
}

.pf-case {
  display: grid;
  gap: 28px;
  align-items: center;
}

/* Width capped at ~500–540px on desktop (review r3), not left to the grid track. */
.pf-case__media {
  position: relative;
  width: min(100%, 520px);
  margin-inline: auto;
}

.pf-case__photo {
  display: block;
  padding: 8px;
  border-radius: var(--r-xl);
  background: var(--paper);
  box-shadow: var(--shadow-panel);
  transform: rotate(-2deg);
}

.pf-case:nth-child(even) .pf-case__photo { transform: rotate(2deg); }

/* 4:3, ~300–340px tall at the desktop column width (§ review r2). */
.pf-case__photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: var(--pf-focus, 50% 50%);
  border-radius: 14px;
}

.pf-case__pill {
  position: absolute;
  top: 20px;
  right: -10px;
  padding: 7px 14px;
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 10px 20px -12px rgb(15 23 42 / 0.4);
  color: var(--ink-900);
  font-size: 0.8125rem;
  font-weight: 700;
}

.pf-case__body { min-width: 0; }

.pf-case__name {
  margin: 0;
  color: var(--ink-900);
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 1.3rem + 0.6vw, 1.875rem);
  font-weight: 600;
  line-height: 1.15;
}

.pf-case__place {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  color: var(--slate-600);
  font-size: 0.9375rem;
}

.pf-case__place svg { color: var(--tone-mark, var(--blue-600)); }

/* The rating is the evidence line, not another metadata row: bigger, bolder,
   its own tone-coloured chip (review r2). */
.pf-case__rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: var(--tone-bg, var(--slate-50));
  color: var(--ink-900);
  font-size: 1rem;
  text-decoration: none;
}

.pf-case__g { display: grid; }
.pf-case__g svg { width: 17px; height: 17px; }
.pf-case__rating strong { font-size: 1.1875rem; font-weight: 800; }
.pf-case__star { color: #F59E0B; }
.pf-case__rating span:last-child { color: var(--slate-700); font-size: 0.9375rem; font-weight: 600; }
.pf-case__rating:hover { background: var(--tone-line, var(--slate-100)); }

.pf-case__text {
  max-width: 42rem;
  margin-top: 16px;
  color: var(--slate-700);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-wrap: pretty;
}

/* Max 3 pills per case (review r2) — the photo + sentence carry the rest. */
.pf-case__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
}

.pf-case__tags li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--tone-line, var(--slate-200));
  border-radius: 999px;
  background: var(--tone-bg, var(--slate-50));
  color: var(--tone-ink, var(--ink-900));
  font-size: 0.8125rem;
  font-weight: 600;
}

.pf-case__tags svg { color: var(--tone-mark, var(--blue-600)); }

/* The most important micro-CTA on the page ("check yourself") gets real
   visual weight, not a plain text link (review r2). */
.pf-case__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 20px;
  padding: 10px 16px 10px 4px;
  color: var(--blue-700);
  font-weight: 700;
  text-decoration: none;
}

.pf-case__link:hover { color: var(--blue-800); text-decoration: underline; text-underline-offset: 5px; }
.pf-case__link svg { transition: transform var(--t-base) var(--ease-out); }
.pf-case__link:hover svg { transform: translateX(3px); }

.pf-asof {
  margin-top: clamp(24px, 3vw, 36px);
  color: var(--slate-500);
  font-size: 0.875rem;
}

@media (min-width: 900px) {
  /* 5/7 column split (review r2), 48–64px gap. */
  .pf-case { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; }
  .pf-case:nth-child(even) .pf-case__media { order: 2; }
  .pf-case:nth-child(even) .pf-case__body { order: 1; }
  .pf-case__media { margin-inline: 0; }
}

/* ==========================================================================
   02 Client work — USA (compact, a visibly different proof type from 01)
   ========================================================================== */

.pf-clients-section { background: var(--warm-50); border-top: 1px solid var(--color-border); }

.pf-clients {
  display: grid;
  gap: 32px;
  margin: 0;
}

.pf-client {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  background: var(--paper);
}

.pf-client__frame { border-radius: var(--r-md); }

/* Full card width, ~210px+ on phones, 220–260px on desktop (review r2) — a
   wider crop than the hero's so the chrome bar stays a small fraction. */
.pf-client__frame .pf-frame__img img { aspect-ratio: 1.4 / 1; object-position: top center; }

@media (min-width: 720px) {
  .pf-client__frame .pf-frame__img img { aspect-ratio: 2.5 / 1; }
}

/* "What I did" / "Status" labels (review r3): a hierarchy change, not new content — same
   small-caps treatment as the tools group titles, already contrast-checked at this size. */
.pf-client__label {
  margin: 0;
  color: var(--slate-600);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pf-client__label--status { margin-bottom: 6px; }

.pf-client__status-row { display: grid; }

/* "What I did" sits right under the screenshot, before the metadata. */
.pf-client__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
}

.pf-client__tags li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  background: var(--slate-50);
  color: var(--ink-900);
  font-size: 0.8125rem;
  font-weight: 600;
}

.pf-client__tags svg { color: var(--blue-600); }

.pf-client__body { display: grid; }

.pf-client__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: #EAF1FE;
  color: var(--blue-700);
  font-size: 0.8125rem;
  font-weight: 700;
}

.pf-client__name {
  margin: 0;
  color: var(--ink-900);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
}

.pf-client__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 10px 0 0;
  color: var(--slate-600);
  font-size: 0.9375rem;
}

.pf-client__meta span { display: inline-flex; align-items: center; gap: 7px; }
.pf-client__meta svg { color: var(--blue-600); }

.pf-client__text {
  margin-top: 14px;
  color: var(--slate-700);
  font-size: 1rem;
  line-height: 1.6;
}

.pf-client__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 16px;
  color: var(--blue-700);
  font-weight: 700;
  text-decoration: none;
}

.pf-client__link:hover { color: var(--blue-800); text-decoration: underline; text-underline-offset: 5px; }

@media (min-width: 720px) {
  .pf-clients { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   03 What I built, where — capability matrix
   ========================================================================== */

/* Tighter section padding than the shared default (review r2: "too much
   relative to value"). Higher specificity than .pg-section alone, so this
   wins without editing page.css. */
.pf-matrix-section.pg-section { padding-block: clamp(72px, 6vw, 88px); }
.pf-matrix-section { background: var(--warm-50); border-top: 1px solid var(--color-border); }

.pf-matrix__table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  background: var(--paper);
}

.pf-matrix__table { width: 100%; min-width: 640px; border-collapse: collapse; }

/* 42–46px rows (review r2). */
.pf-matrix__table th,
.pf-matrix__table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--slate-200);
  text-align: center;
}

.pf-matrix__table thead th {
  color: var(--slate-600);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pf-matrix__table tbody th {
  padding-left: 18px;
  color: var(--ink-900);
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.pf-matrix__table tbody tr:last-child th,
.pf-matrix__table tbody tr:last-child td { border-bottom: 0; }

.pf-matrix__yes { color: var(--blue-600); }
.pf-matrix__no { color: var(--slate-300); font-size: 1.125rem; }

/* Phones: one ≤72px row per project, not six tall cards (review r2). The
   legend stands in for the table's column headers; each mark still carries
   its own sr-only label. */
.pf-matrix__compact { display: none; }

@media (max-width: 639.98px) {
  .pf-matrix__table-wrap { display: none; }
  .pf-matrix__compact { display: block; }

  .pf-matrix__legend {
    margin: 0 0 10px;
    color: var(--slate-600);
    font-size: 0.8125rem;
    line-height: 1.4;
  }

  .pf-matrix__rows {
    margin: 0;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--r-lg);
    background: var(--paper);
    overflow: hidden;
  }

  .pf-matrix__crow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 56px;
    max-height: 72px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--slate-100);
  }

  .pf-matrix__crow:last-child { border-bottom: 0; }

  .pf-matrix__cname {
    overflow: hidden;
    color: var(--ink-900);
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .pf-matrix__cmarks {
    display: flex;
    flex-shrink: 0;
    gap: 12px;
  }

  .pf-matrix__cmark {
    display: grid;
    place-items: center;
    width: 22px;
  }

  .pf-matrix__cmark .pf-matrix__yes { width: 14px; height: 14px; }
}

/* ==========================================================================
   04 Tools — 3 contextual groups instead of a flat logo cloud (review r2)
   ========================================================================== */

/* Section padding cut ~25% from the shared default (review r3: "underpowered" was really
   "too much empty field around too few chips" — see the group-width fix below too). */
.pf-tools-section.pg-section { padding-block: clamp(48px, 6vw, 96px); }
.pf-tools-section { background: var(--paper); }

.pf-tools-groups {
  display: grid;
  gap: 28px;
}

.pf-tools-group__title {
  margin: 0 0 12px;
  color: var(--slate-600);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pf-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.pf-tools li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px 9px 10px;
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  background: var(--warm-50);
  color: var(--ink-900);
  font-size: 0.9375rem;
  font-weight: 500;
}

.pf-tools__logo { display: grid; place-items: center; width: 22px; height: 22px; }
.pf-tools__logo svg { width: 20px; height: 20px; }

@media (min-width: 860px) {
  /* 30/30/40 (review r3), not three even columns of empty space — Build & Automation
     has the most chips, so it gets the extra width. A light rule stands in for the gap. */
  .pf-tools-groups { grid-template-columns: 0.75fr 0.75fr 1fr; gap: 0; }

  .pf-tools-group {
    padding-inline: 28px;
    border-left: 1px solid var(--slate-200);
  }

  .pf-tools-group:first-child { padding-left: 0; border-left: 0; }
  .pf-tools-group:last-child { padding-right: 0; }
}

/* Gate: body copy ≥16px on phones (final sweep 2026-09-29). */
@media (max-width: 639.98px) {
  .pf-client__meta { font-size: 1rem; }
}
