/* ── White theme for portfolio ── */
    body[data-page="portfolio"] {
      background: var(--white);
      color: var(--black);
    }

    /* ── Clients section on portfolio: forced dark background ── */
    body[data-page="portfolio"] .hp-clients--dark {
      background: #1e1e1e;
      color: var(--white);
      padding-top: calc(100px + var(--space-3xl));
    }

    body[data-page="portfolio"] .hp-clients--dark .hp-clients__greeting {
      width: 100%;
      max-width: none;
      text-align: center;
      font-family: var(--font-sans);
      font-size: clamp(2rem, 4.5vw, 3.8rem);
      font-weight: 300;
      line-height: 1.15;
      letter-spacing: -0.02em;
      color: var(--white);
      margin: 0 0 var(--space-3xl);
    }

    body[data-page="portfolio"] .hp-clients--dark .hp-clients__title {
      color: var(--white);
    }

    body[data-page="portfolio"] .hp-clients--dark .hp-clients__text {
      color: var(--gray-400, #999);
    }

    body[data-page="portfolio"] .hp-clients--dark .hp-clients__text strong {
      color: var(--white);
    }

    body[data-page="portfolio"] .hp-clients--dark .hp-timeline__list,
    body[data-page="portfolio"] .hp-clients--dark .hp-timeline__years,
    body[data-page="portfolio"] .hp-clients--dark .hp-timeline__year {
      color: var(--white);
    }

    /* Kill the dark radial-gradient overlay from main.css */
    body[data-page="portfolio"]::before {
      display: none;
    }

    /* ── Black-to-white entrance transition ── */
    body[data-page="portfolio"]::after {
      content: '';
      position: fixed;
      inset: 0;
      z-index: 9999;
      background: var(--black);
      animation: pf-reveal 0.8s 0.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
      pointer-events: none;
    }

    @keyframes pf-reveal {
      from { opacity: 1; }
      to   { opacity: 0; }
    }

    /* ── Hero ── */
    .pf-hero {
      padding-top: calc(100px + var(--space-3xl));
      padding-bottom: var(--space-2xl);
    }

    .pf-hero__title {
      font-size: var(--text-5xl);
      font-weight: 700;
      line-height: 1.05;
      letter-spacing: -0.03em;
      color: var(--black);
      margin-bottom: var(--space-lg);
    }

    .pf-hero__text {
      font-size: var(--text-lg);
      color: var(--gray-600, #555);
      line-height: 1.5;
      max-width: 560px;
    }

    /* ── Project grid – full bleed, mobile-first: 1 col ── */
    .pf-feed {
      display: grid;
      grid-template-columns: 1fr;
      column-gap: 1rem;
      row-gap: 3rem;
      width: 100%;
    }

    @media (min-width: 768px) {
      .pf-feed {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    /* ── Single project card ── */
    .pf-project {
      display: block;
      text-decoration: none;
      color: inherit;
      position: relative;
    }

    .pf-project__image-wrap {
      overflow: hidden;
      aspect-ratio: 1 / 1;
    }

    .pf-project__image {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    /* Info – below image */
    .pf-project__info {
      padding: var(--space-sm) 0 0;
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: var(--space-sm);
    }

    @media (min-width: 768px) {
      .pf-project__info {
        padding: var(--space-sm) var(--space-md) 0;
      }
    }

    .pf-project__left {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .pf-project__client {
      font-size: var(--text-base);
      font-weight: 600;
      color: var(--black);
      line-height: 1.3;
    }

    .pf-project__name {
      font-size: var(--text-sm);
      font-weight: 300;
      color: var(--gray-600, #555);
      line-height: 1.3;
      letter-spacing: 0;
      transition: color 0.3s;
    }

    .pf-project:hover .pf-project__client {
      color: var(--rosa);
    }

    .pf-project__scope {
      font-size: var(--text-sm);
      color: var(--gray-500, #777);
      font-weight: 300;
      text-align: right;
      white-space: nowrap;
    }

    /* ── Scroll reveal ── */
    .pf-project {
      opacity: 0;
      transform: translateY(30px);
    }

    .pf-project.is-visible {
      opacity: 1;
      transform: translateY(0);
      transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .pf-project:nth-child(even).is-visible {
      transition-delay: 0.1s;
    }

    /* ── CTA section – adapted for white bg ── */
    .pf-cta {
      border-top: 1px solid var(--gray-200, #e5e5e5);
      margin-top: var(--space-3xl);
    }

    body[data-page="portfolio"] .cta__title {
      color: var(--black);
    }

    body[data-page="portfolio"] .cta__subtitle {
      color: var(--gray-600, #555);
    }

    body[data-page="portfolio"] .section--cta .btn--primary::before,
    body[data-page="portfolio"] .section--cta .btn--primary::after {
      background-color: var(--black);
    }

    body[data-page="portfolio"] .section--cta .btn--primary {
      color: var(--white);
    }

    /* ── Override nav/header for white page ── */
    body[data-page="portfolio"] .site-header {
      background: rgba(255, 255, 255, 0.92);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }

    /* ── "Ver projeto" cursor circle ── */
    .pf-cursor {
      position: fixed;
      width: 100px;
      height: 100px;
      border-radius: 50%;
      background: var(--rosa);
      color: var(--white);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      pointer-events: none;
      z-index: 1000;
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.4);
      transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                  transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      mix-blend-mode: normal;
    }

    .pf-cursor.is-active {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }

    .pf-project__image-wrap {
      cursor: none;
    }

    /* Hide on touch devices */
    @media (hover: none) {
      .pf-cursor { display: none; }
      .pf-project__image-wrap { cursor: pointer; }
    }

    @media (prefers-reduced-motion: reduce) {
      body[data-page="portfolio"]::after {
        animation: none;
        opacity: 0;
      }

      .pf-project {
        opacity: 1;
        transform: none;
        transition: none;
      }

      .pf-project__image {
        transition: none;
      }
    }


    /* ═══════════════════════════════════════════════════════════════
       PORTFOLIO FILTERS, editorial flowing text
       Filtros como uma frase contínua: "Todos¹⁰, Alimentação²,
       Hotelaria²..." separados por vírgula, com contagem em sobrescrito.
       Estado ativo = sublinhado magenta. Como índice de revista.
       ═══════════════════════════════════════════════════════════════ */
    .pf-filters {
      padding: var(--space-md) 0 var(--space-3xl);
    }

    .pf-filters .container {
      display: block;
    }

    /* ─── Filter group: label above, sentence-style chips below ─── */
    .pf-filter-group {
      border: 0;
      padding: 0;
      margin: 0 0 var(--space-xl);
      min-width: 0;
    }

    .pf-filter-group:last-of-type {
      margin-bottom: var(--space-lg);
    }

    .pf-filter-group__label {
      display: block;
      font-family: var(--font-sans);
      font-style: italic;
      font-weight: 300;
      font-size: clamp(0.95rem, 1.4vw, 1.15rem);
      letter-spacing: -0.005em;
      color: var(--gray-500);
      margin-bottom: 0.4rem;
      padding: 0;
      line-height: 1.3;
    }

    /* ─── Collapsible group (Tipo de serviço) ─── */
    .pf-filter-group--collapsible {
      /* details element reset */
    }

    .pf-filter-group--collapsible > summary {
      cursor: pointer;
      list-style: none;
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      user-select: none;
      transition: color 0.25s ease;
    }

    .pf-filter-group--collapsible > summary::-webkit-details-marker {
      display: none;
    }

    .pf-filter-group--collapsible > summary::marker {
      content: '';
    }

    .pf-filter-group--collapsible > summary:hover {
      color: var(--rosa);
    }

    .pf-filter-group--collapsible > summary:focus-visible {
      outline: 2px solid var(--rosa);
      outline-offset: 4px;
      border-radius: 2px;
    }

    .pf-filter-group__label--toggle {
      /* keep italic + light + gray-500 inherited from .pf-filter-group__label */
      margin-bottom: 0;
    }

    .pf-filter-group__arrow {
      flex-shrink: 0;
      color: var(--rosa);
      transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .pf-filter-group--collapsible[open] > summary .pf-filter-group__arrow {
      transform: rotate(180deg);
    }

    /* Magenta dot, appears when any service filter is active */
    .pf-filter-group__active-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--rosa);
      flex-shrink: 0;
      opacity: 0;
      transform: scale(0.4);
      transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .pf-filter-group--collapsible[data-active="true"] .pf-filter-group__active-dot {
      opacity: 1;
      transform: scale(1);
      box-shadow: 0 0 0 3px rgba(255, 39, 122, 0.18);
    }

    /* Reveal animation when the group opens */
    .pf-filter-group--collapsible[open] > .pf-filter-group__chips {
      margin-top: 0.5rem;
      animation: pf-disclose 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes pf-disclose {
      from {
        opacity: 0;
        transform: translateY(-8px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .pf-filter-group__arrow,
      .pf-filter-group__active-dot {
        transition: none;
      }
      .pf-filter-group--collapsible[open] > .pf-filter-group__chips {
        animation: none;
      }
    }

    /* Container, flowing inline text, NOT a flex grid */
    .pf-filter-group__chips {
      display: block;
      font-family: var(--font-sans);
      font-size: clamp(1.4rem, 3vw, 2.4rem);
      font-weight: 300;
      letter-spacing: -0.025em;
      line-height: 1.32;
      color: var(--black);
      word-spacing: 0.02em;
    }

    /* ─── The chip, inline text, no border, no background ─── */
    .pf-chip {
      display: inline;
      background: transparent;
      border: 0;
      padding: 0;
      margin: 0;
      cursor: pointer;
      font: inherit;
      font-family: inherit;
      color: inherit;
      letter-spacing: inherit;
      text-decoration: none;
      transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      white-space: nowrap;
    }

    .pf-chip:hover {
      color: var(--rosa);
    }

    /* Active state: name underlined in magenta, all in magenta */
    .pf-chip[aria-pressed="true"] {
      color: var(--rosa);
    }

    .pf-chip__name {
      transition: text-decoration-color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      white-space: nowrap;
    }

    .pf-chip[aria-pressed="true"] .pf-chip__name {
      text-decoration: underline;
      text-decoration-thickness: 1.5px;
      text-underline-offset: 0.16em;
      text-decoration-color: var(--rosa);
    }

    /* Hover preview underline (inactive only) */
    .pf-chip:not([aria-pressed="true"]):hover .pf-chip__name {
      text-decoration: underline;
      text-decoration-thickness: 1px;
      text-underline-offset: 0.16em;
      text-decoration-color: rgba(255, 39, 122, 0.4);
    }

    /* Comma separator after every chip except the last */
    .pf-chip:not(:last-child)::after {
      content: ',';
      color: var(--gray-400);
      margin-right: 0.18em;
      text-decoration: none;
      pointer-events: none;
    }

    /* When chip is active, the comma stays neutral */
    .pf-chip[aria-pressed="true"]:not(:last-child)::after {
      color: var(--gray-400);
    }

    /* ─── Count badge (superscript) ─── */
    .pf-chip__count {
      display: inline;
      font-size: 0.42em;
      font-weight: 400;
      letter-spacing: 0;
      vertical-align: super;
      line-height: 0;
      margin-left: 0.08em;
      color: var(--gray-500);
      font-variant-numeric: tabular-nums;
      transition: color 0.3s ease;
      text-decoration: none;
    }

    .pf-chip[aria-pressed="true"] .pf-chip__count {
      color: var(--rosa);
    }

    .pf-chip:hover .pf-chip__count {
      color: var(--rosa);
    }

    /* ─── Focus ring ─── */
    .pf-chip:focus-visible {
      outline: 2px solid var(--rosa);
      outline-offset: 4px;
      border-radius: 2px;
    }

    /* ─── Status row: subtle, just the counter and reset ─── */
    .pf-filters__status {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: var(--space-md);
      padding-top: var(--space-md);
      margin-top: var(--space-sm);
      border-top: 1px solid rgba(0, 0, 0, 0.08);
      flex-wrap: wrap;
    }

    .pf-filters__count {
      margin: 0;
      font-family: var(--font-sans);
      font-weight: 300;
      color: var(--gray-600);
      font-size: 0.95rem;
      letter-spacing: 0.005em;
    }

    .pf-filters__count strong {
      color: var(--black);
      font-weight: 500;
      font-variant-numeric: tabular-nums;
    }

    .pf-filters__count-label {
      font-style: italic;
      color: var(--gray-600);
    }

    /* Reset, small italic with arrow */
    .pf-filters__reset {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      background: transparent;
      border: 0;
      font-family: inherit;
      font-size: 0.95rem;
      font-style: italic;
      font-weight: 300;
      color: var(--gray-600);
      cursor: pointer;
      padding: 0.2rem 0;
      transition: color 0.25s ease, gap 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .pf-filters__reset:hover {
      color: var(--rosa);
      gap: 0.6rem;
    }

    .pf-filters__reset:focus-visible {
      outline: 2px solid var(--rosa);
      outline-offset: 4px;
      border-radius: 2px;
    }

    .pf-filters__reset svg {
      transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .pf-filters__reset:hover svg {
      transform: translateX(2px) translateY(-2px) rotate(8deg);
    }

    /* ─── Placeholder cards (case study em breve) ─── */
    .pf-project--placeholder {
      cursor: default;
    }

    .pf-project__image-wrap--yellow {
      background: #fef3a0;
    }

    .pf-project__image-wrap--green {
      background: #d4f0c4;
    }

    .pf-project__image-wrap--blue {
      background: #c8e3f4;
    }

    .pf-project__image-wrap--red {
      background: #fec9c4;
    }

    .pf-project__image-wrap--peach {
      background: #fee0c4;
    }

    .pf-placeholder {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: var(--space-md);
      gap: 0.4rem;
    }

    .pf-placeholder__name {
      font-family: var(--font-sans);
      font-weight: 300;
      font-size: clamp(1.5rem, 3.5vw, 2.4rem);
      letter-spacing: -0.025em;
      line-height: 1.1;
      color: var(--black);
      max-width: 14ch;
    }

    .pf-placeholder__caption {
      font-size: 0.7rem;
      font-weight: 500;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      color: rgba(0, 0, 0, 0.45);
      font-style: italic;
    }

    /* Make sure image-wrap is positioned for absolute placeholder, and override cursor: none */
    .pf-project--placeholder .pf-project__image-wrap {
      position: relative;
      cursor: default;
    }

    /* Ensure scroll-reveal still works on placeholders (they're .pf-project) */

    /* ─── Project filter transition ─── */
    .pf-project {
      transition: opacity 0.42s cubic-bezier(0.16, 1, 0.3, 1),
                  transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .pf-project.is-filtering-out,
    .pf-project.is-visible.is-filtering-out {
      opacity: 0;
      transform: translateY(24px) scale(0.96);
      pointer-events: none;
    }

    .pf-project[hidden] {
      display: none !important;
    }

    /* ─── Empty state, editorial, not a card ─── */
    .pf-empty {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: 1fr;
      gap: var(--space-md);
      padding: var(--space-3xl) 0;
      align-items: start;
    }

    .pf-empty[hidden] {
      display: none !important;
    }

    @media (min-width: 940px) {
      .pf-empty {
        grid-template-columns: 200px 1fr;
        column-gap: var(--space-xl);
      }
    }

    .pf-empty__eyebrow {
      font-family: var(--font-sans);
      font-style: italic;
      font-weight: 300;
      font-size: clamp(1.1rem, 2vw, 1.45rem);
      color: var(--rosa);
      line-height: 1.2;
    }

    .pf-empty__body {
      max-width: 50ch;
    }

    .pf-empty__title {
      font-size: clamp(1.6rem, 3.5vw, 2.4rem);
      font-weight: 300;
      color: var(--black);
      margin: 0 0 var(--space-sm);
      line-height: 1.15;
      letter-spacing: -0.02em;
    }

    .pf-empty__title em {
      font-style: italic;
      color: var(--rosa);
    }

    .pf-empty__text {
      font-size: 1rem;
      color: var(--gray-600);
      margin: 0 0 var(--space-md);
      line-height: 1.55;
    }

    /* ─── Mobile refinements ─── */
    @media (max-width: 939px) {
      .pf-filter-group__chips {
        gap: 0.05rem 0.4rem;
      }
      .pf-chip {
        font-size: 1.05rem;
      }
      .pf-filters__status {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
      }
      .pf-filters__reset {
        margin-bottom: 0;
      }
    }

    /* ─── Reduced motion ─── */
    @media (prefers-reduced-motion: reduce) {
      .pf-project,
      .pf-chip,
      .pf-chip__inner,
      .pf-chip__inner::before,
      .pf-filters__reset,
      .pf-filters__reset svg,
      .pf-filters__count strong {
        transition: none;
      }
      .pf-chip__inner::before {
        transform: scaleX(1) !important;
      }
      .pf-chip:not([aria-pressed="true"]) .pf-chip__inner::before {
        opacity: 0;
        transform: scaleX(0) !important;
      }
      .pf-project.is-filtering-out {
        transform: none;
      }
    }

