/* Hallmark · genre: editorial with the v5 night · macrostructure: Portfolio Grid (index), Split Studio case study (cases) · design-system: design.md · designed-as-app
 * Hallmark · pre-emit critique: P5 H5 E5 S5 R5 V4 · contrast: crema on the night 17.9:1, lead 14.6:1; ink on crema 15.8:1, ink-2 10.6:1, muted 6.2:1 · nav: N11 (the shell's bar) · footer: Ft5 statement over Ft4 colophon (the shell's night footer)
 *   · real captures only (public/portfolio/capturas), never a drawn device or browser chrome; no eyebrows, no emoji, no glow beyond the shell's field
 * Capi Studio portfolio: /portfolio/ (the filters and the grid of projects) and /portfolio/SLUG/ (each case). Written by
 * scripts/site/gerar-portfolio.mjs. The band, the trail, the lead with its proof, the sections, the ruled items, the
 * steps, the questions and the link index are the inner pages' components (pagina.css), the pair of captures, the
 * entrances and the pills over the night are the shell's (shell.css); this file is only what the portfolio adds.
 * Every colour, face, size, space, radius and easing is a token of tokens.css. Requires tokens.css, shell.css and
 * pagina.css; no inline style anywhere (the pages work under style-src 'self'). */

/* ---------- The band: the line under the title and the kind of project ---------- */
.pf-band-lead {
  margin-top: clamp(var(--space-sm), 2.2vh, var(--space-md));
  max-width: 46ch;
  color: var(--color-on-night-2);
  font-size: var(--text-lead-read);
  line-height: 1.45;
  text-wrap: pretty;
}
.pf-band-meta { margin-top: var(--space-sm); color: var(--color-on-night-2); font-size: var(--text-sm); font-weight: var(--wght-small); line-height: 1.45; }
@media (prefers-reduced-motion: no-preference) {
  .pf-band-lead.band-rise { --d: 300ms; }
  .pf-band-meta.band-rise { --d: 360ms; }
}
.pf .btn .ico--down { transition: transform var(--dur-short) var(--ease-out); }
/* On touch screens every trail link is at least 44 px wide too ("Início" alone is narrower) */
@media (pointer: coarse) {
  .pf .trail a { min-width: 44px; justify-content: center; }
}
@media (hover: hover) and (pointer: fine) {
  .pf .btn:hover .ico--down { transform: translateY(2px); }
}

/* ---------- Index: the filters ---------- */
.pf-work { padding-block: clamp(var(--space-xl), 6vw, var(--space-3xl)) calc(var(--section-pad) / 2); }
.pf-browse {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-lg);
  margin-bottom: clamp(var(--space-lg), 3.5vw, var(--space-xl));
  scroll-margin-top: calc(var(--header-h) + var(--space-md));
}
.pf-filters { display: flex; flex-wrap: wrap; gap: var(--space-2xs); min-width: 0; }
.pf-filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: 44px;
  padding: 0 var(--space-xs);
  border: 1px solid var(--color-rule-strong);
  border-radius: var(--radius-pill);
  color: var(--color-ink);
  font-size: 0.9375rem;
  font-weight: var(--wght-ui);
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-color) var(--ease-out), border-color var(--dur-color) var(--ease-out), color var(--dur-color) var(--ease-out);
}
.pf-filter-count { color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); font-variant-numeric: tabular-nums; transition: color var(--dur-color) var(--ease-out); }
.pf-filter[aria-current="true"] { border-color: var(--color-ink); background: var(--color-ink); color: var(--color-paper); }
.pf-filter[aria-current="true"] .pf-filter-count { color: var(--color-on-ink-2); }
.pf-filter:active { transform: translateY(1px); }
@media (hover: hover) and (pointer: fine) {
  .pf-filter:hover { border-color: var(--color-ink); }
}
/* The live region stays rendered even while empty (an empty paragraph takes no height), so its first change is read */
.pf-status { color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); line-height: 1.45; }
/* Phones: one row that scrolls sideways under the screen's edges, instead of four rows of pills */
@media (max-width: 39.99rem) {
  .pf-browse { display: block; }
  .pf-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(-1 * var(--gutter));
    padding: var(--space-2xs) var(--gutter);
    scroll-padding-inline: var(--gutter);
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .pf-filters::-webkit-scrollbar { display: none; }
  .pf-filter { flex: none; }
  .pf-status { margin-top: var(--space-2xs); }
}

/* ---------- Index: the grid of projects ---------- */
.pf-grid { --pf-cols: 1; }
@media (min-width: 40rem) { .pf-grid { --pf-cols: 2; } }
@media (min-width: 100rem) { .pf-grid { --pf-cols: 3; } }
@media (min-width: 140rem) { .pf-grid { --pf-cols: 4; } }
.pf-cards, .pf-enhanced .pf-grid {
  display: grid;
  grid-template-columns: repeat(var(--pf-cols), minmax(0, 1fr));
  gap: clamp(var(--space-xl), 5vw, var(--space-2xl)) var(--col-gap);
  align-items: start;
}
/* Enhanced (portfolio.js): one grid; without the script each kind of work keeps its own heading */
.pf-enhanced .pf-group, .pf-enhanced .pf-cards { display: contents; }
/* Out of sight, but still in the page's outline (the cards' names come under them) */
.pf-enhanced .pf-group-title { position: absolute; inline-size: 1px; block-size: 1px; margin: 0; padding: 0; overflow: hidden; border: 0; clip-path: inset(50%); white-space: nowrap; }
.pf-group + .pf-group { margin-top: clamp(var(--space-2xl), 6vw, var(--space-3xl)); }
.pf-group-title {
  margin-bottom: var(--space-lg);
  padding-top: var(--space-sm);
  border-top: 2px solid var(--color-ink);
  font-size: var(--text-title);
  font-weight: var(--wght-ui);
  letter-spacing: var(--track-title);
  line-height: 1.2;
  scroll-margin-top: calc(var(--header-h) + var(--space-md));
}
.pf-empty { color: var(--color-muted); }

.pf-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.pf-card-visual { position: relative; transition: transform var(--dur-hover) var(--ease-out); }
.pf-card-media { display: block; border-radius: var(--radius-media); text-decoration: none; }
.pf-card-actions { display: none; }
.pf-card-text { display: flex; flex-direction: column; align-items: flex-start; padding-top: var(--space-sm); min-width: 0; }
.pf-card-name {
  overflow-wrap: anywhere;
  min-width: 0;
  font-size: clamp(1.5rem, 1.2rem + 0.8vw, 2.125rem);
  font-weight: var(--wght-display);
  font-stretch: var(--wdth-display);
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.pf-card-name a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; text-decoration-thickness: 2px; text-underline-offset: 0.16em; }
.pf-card-kind { color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); line-height: 1.4; }
.pf-card-desc { margin-top: var(--space-xs); max-width: 52ch; color: var(--color-ink-2); font-size: 1rem; line-height: 1.5; }
.pf-card-open { margin-top: var(--space-2xs); }
@media (hover: hover) and (pointer: fine) {
  .pf-card-name a { min-height: 32px; }
  .pf-card-name a:hover { text-decoration-line: underline; text-decoration-color: var(--color-accent); }
  /* The hover layer, laid out like the pair so it covers exactly the computer capture */
  .pf-card-actions {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    gap: clamp(8px, 1vw, 16px);
    pointer-events: none;
  }
  .pf-card-actions::after { content: ""; flex: 0.5874 1 0; }
  .pf-card-veil {
    flex: 1.6 1 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm);
    border-radius: var(--radius-media);
    background: var(--color-scrim);
    opacity: 0;
    transition: opacity var(--dur-short) var(--ease-out);
  }
  .pf-card-btn { transform: translate3d(0, 8px, 0); transition: transform var(--dur-short) var(--ease-out), background-color var(--dur-color) var(--ease-out), border-color var(--dur-color) var(--ease-out), color var(--dur-color) var(--ease-out); }
  .pf-card-btn--ink { border-color: var(--color-paper); }
  .pf-card-visual:hover .pf-card-veil, .pf-card-veil:focus-within { opacity: 1; }
  .pf-card-visual:hover .pf-card-btn, .pf-card-veil:focus-within .pf-card-btn { pointer-events: auto; transform: none; }
  .pf-card-visual:hover, .pf-card:focus-within .pf-card-visual { transform: translateY(-4px); }
  .pf-card-visual:hover .pair { --zoom: 1.03; }
  .pf-card-open { display: none; }
}
.pf-card-btn:focus-visible { outline-color: var(--color-paper); outline-offset: 3px; }
/* The studio's own product: the whole row, the pair beside its text from 1024 px */
.pf-card--feature { grid-column: 1 / -1; }
.pf-card--feature .pf-card-name { font-size: var(--text-display-l); line-height: 1; }
.pf-card--feature .pf-card-desc { font-size: var(--text-lead-read); line-height: 1.45; max-width: 30ch; }
.pf-card-links { margin-top: var(--space-md); }
@media (hover: hover) and (pointer: fine) {
  .pf-card--feature .pf-card-visual:hover { transform: translateY(-4px); }
}
@media (min-width: 64rem) {
  .pf-card--feature { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: center; }
  .pf-card--feature .pf-card-visual { grid-column: 1 / span 8; }
  .pf-card--feature .pf-card-text { grid-column: 9 / -1; padding-top: 0; }
}
/* A filter change: the cards that are shown again arrive, a little apart */
@media (prefers-reduced-motion: no-preference) {
  .pf-card.pf-enter { animation: pf-card-in 520ms var(--ease-out) both; animation-delay: calc(var(--pf-i, 0) * 45ms); }
}
@keyframes pf-card-in { from { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.985); } }

.pf-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-lg); }
.block-body > .pf-links { margin-top: var(--space-md); }
.pf-after { padding-top: 0; }

/* ---------- Case: the lead beside the computer capture, with the project's facts ---------- */
.pf-lead { min-width: 0; }
.pf-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--col-gap); margin: clamp(var(--space-lg), 3vw, var(--space-xl)) 0 0; border-top: 2px solid var(--color-ink); max-width: 40rem; }
.pf-facts > div { padding-block: var(--space-sm); border-bottom: 1px solid var(--color-rule); min-width: 0; }
.pf-facts dt { color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); line-height: 1.4; }
.pf-facts dd { margin: var(--space-3xs) 0 0; font-weight: var(--wght-ui); line-height: 1.35; overflow-wrap: anywhere; }
@media (min-width: 64rem) { .pf-lead { grid-column: 1 / span 6; padding-right: var(--space-lg); } }
@media (min-width: 100rem) { .pf-lead { grid-column: 1 / span 5; } }
.pf-lead .lead-text { max-width: 40ch; }
/* Phones and tablets: the capture comes first, right under the band; the long story at reading size */
@media (max-width: 63.99rem) {
  .pf-proof { order: -1; }
}
@media (max-width: 39.99rem) {
  .pf-lead .lead-text { font-size: var(--text-read); line-height: var(--leading-read); }
}
.pf-open-hint { display: none; }
@media (hover: hover) and (pointer: fine) {
  .pf-open-hint {
    position: absolute;
    left: var(--space-md);
    bottom: var(--space-md);
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    min-height: 44px;
    padding: 0 var(--space-md);
    border-radius: var(--radius-pill);
    background: var(--color-ink);
    color: var(--color-paper);
    font-size: var(--text-ui);
    font-weight: var(--wght-ui);
    box-shadow: var(--shadow-float);
    opacity: 0;
    transform: translate3d(0, 8px, 0);
    transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
  }
  .proof-open:hover .pf-open-hint, .proof-open:focus-visible .pf-open-hint { opacity: 1; transform: none; }
}
.proof-open:focus-visible { outline-offset: 4px; }
.pf-pending { margin-top: var(--space-2xs); }

/* ---------- Case: what was built, with the phone capture under the title ---------- */
.pf-count { margin-top: var(--space-sm); color: var(--color-muted); font-size: var(--text-ui); font-weight: var(--wght-ui); }
.pf-phone { width: min(62%, 280px); margin: var(--space-lg) 0 0; }
.pf-phone-open { display: block; border-radius: var(--radius-input); text-decoration: none; transition: transform var(--dur-hover) var(--ease-out); }
.pf-phone-shot {
  position: relative;
  display: block;
  aspect-ratio: 1170 / 1992;
  overflow: hidden;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-input);
  background: var(--color-paper-2);
}
.pf-phone-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.pf-phone figcaption { margin-top: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); line-height: 1.45; }
.pf-phone-open:focus-visible { outline-offset: 4px; }
@media (min-width: 64rem) {
  /* Small enough that the title and the capture stay in view together while the list scrolls */
  .pf-phone { width: auto; max-width: min(100%, calc((100svh - var(--header-h) - 300px) * 0.5874)); }
}
@media (hover: hover) and (pointer: fine) {
  .pf-phone-open:hover { transform: translateY(-4px); }
  .pf-phone-open:hover .pf-phone-shot { --zoom: 1.03; }
}

/* ---------- Case: try it, the live site in the viewer ---------- */
.pf-try-note { margin-top: var(--space-md); max-width: 30ch; color: var(--color-ink-2); font-size: 1.0625rem; line-height: 1.5; }
.pf-try-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-lg); margin-top: var(--space-lg); }

/* ---------- Case: what was measured ---------- */
.pf-method { max-width: var(--measure); color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); line-height: 1.55; }
.pf-measures .item h3 { font-size: 1.125rem; }
.pf-stats { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--col-gap); margin: 0; }
@media (min-width: 40rem) { .pf-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pf-stats > div { padding-block: var(--space-md) var(--space-lg); border-top: 1px solid var(--color-rule); min-width: 0; }
.pf-stats dt {
  overflow-wrap: anywhere;
  font-size: clamp(2.125rem, 1.4rem + 2vw, 3.5rem);
  font-weight: var(--wght-display);
  font-stretch: var(--wdth-display);
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pf-stats dd { margin: var(--space-xs) 0 0; max-width: 30ch; color: var(--color-ink-2); font-size: 1.0625rem; line-height: 1.5; }

/* ---------- Case: the next project, one link stretched over its capture and text ---------- */
.pf-next .shell { padding-top: var(--space-md); border-top: 2px solid var(--color-ink); }
.pf-next-label { margin-bottom: var(--space-lg); color: var(--color-ink-2); font-size: var(--text-ui); font-weight: var(--wght-ui); line-height: 1.3; }
.pf-next-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-md) var(--col-gap); align-items: center; }
.pf-next-media { min-width: 0; transition: transform var(--dur-hover) var(--ease-out); }
.pf-next-shot {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-media);
  background: var(--color-paper-2);
}
.pf-next-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.pf-next-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.pf-next-name {
  overflow-wrap: anywhere;
  min-width: 0;
  font-size: var(--text-display-m);
  font-weight: var(--wght-display);
  font-stretch: var(--wdth-display);
  letter-spacing: var(--track-display);
  line-height: 1.02;
  text-wrap: balance;
}
.pf-next-name a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; text-decoration-thickness: 2px; text-underline-offset: 0.12em; }
.pf-next-name a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-media); }
.pf-next-name a:focus-visible { outline: none; }
.pf-next-name a:focus-visible::after { outline: 2px solid var(--color-focus); outline-offset: 6px; }
.pf-next-kind { margin-top: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--wght-small); }
.pf-next-desc { margin-top: var(--space-sm); max-width: 45ch; color: var(--color-ink-2); }
.pf-next-go { display: inline-flex; align-items: center; gap: var(--space-2xs); min-height: 44px; margin-top: var(--space-sm); font-weight: var(--wght-ui); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 6px; transition: text-decoration-color var(--dur-color) var(--ease-out); }
.pf-next-go .ico { transition: transform var(--dur-short) var(--ease-out); }
@media (min-width: 64rem) {
  .pf-next-card { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .pf-next-media { grid-column: 1 / span 6; }
  .pf-next-text { grid-column: 8 / -1; }
}
@media (hover: hover) and (pointer: fine) {
  .pf-next-card:hover .pf-next-media { transform: translateY(-4px); }
  .pf-next-card:hover .pf-next-shot { --zoom: 1.03; }
  .pf-next-card:hover .pf-next-name a { text-decoration-line: underline; text-decoration-color: var(--color-accent); }
  .pf-next-card:hover .pf-next-go { text-decoration-color: var(--color-accent); }
  .pf-next-card:hover .pf-next-go .ico { transform: translateX(3px); }
}

/* Reduced motion: no travel; colours and opacity only */
@media (prefers-reduced-motion: reduce) {
  .pf-card-visual, .pf-phone-open, .pf-next-media { transition: none; transform: none !important; }
}
