/* Portfolio page
   One list, grouped by sector, each company named once. The page sits inside
   a hairline frame with ruled cells, after globalcitizens.ai: thin rules, a lot
   of air, small tracked labels and modest sector titles, so the companies
   carry the page. Every logo sits centred in an identical cell, sized by area
   (assets/js/portfolio.js) so square, tall and wide marks read as one family.
   ITI's layer: the row fills red from the left on hover, its text turns white
   and the logo lifts slightly. No boxes, pills or bordered chips. */

.pf {
  --pf-ease: cubic-bezier(0.2, 0.75, 0.1, 1);
  --pf-logo-cell: 168px;
  --pf-frame: var(--rule);
}

/* -------------------------------------------------------------- the frame
   Vertical hairlines run down both edges of the content column, like the
   source's page frame. */

.pf-frame { border-inline: 1px solid var(--pf-frame); }

/* ------------------------------------------------------------ header plate */

.pf-head { padding: clamp(56px, 8vw, 120px) 0 0; }
.pf-head .pf-frame { padding: 0 clamp(20px, 3vw, 40px) clamp(36px, 5vw, 64px); }
.pf-head__title { display: flex; align-items: center; gap: 24px; }
.pf-head__title h1 { margin: 0; font-size: clamp(2.2rem, 1.4rem + 2.4vw, 3.4rem); line-height: 1; font-weight: 500; }
.pf-head__rule { flex: 0 0 92px; height: 1px; background: var(--rule-strong); }
.pf-head__line {
  margin-top: clamp(22px, 3vw, 36px);
  max-width: 34ch;
  font-weight: 300;
  font-size: clamp(1.4rem, 1rem + 1.3vw, 2.2rem);
  line-height: 1.3;
  color: var(--ink-warm);
}
.pf-head__count { color: var(--muted); }

/* ----------------------------------------------------------------- toolbar */

.pf-bar__sentinel { display: block; height: 1px; }
.pf-bar {
  position: sticky;
  top: 78px;
  z-index: 20;
  max-width: 100%;
  overflow: hidden;
  background: rgba(244, 241, 233, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-block: 1px solid var(--rule);
}
.pf-bar .pf-frame { display: flex; align-items: stretch; min-height: 56px; }
.pf-bar__cell { display: flex; align-items: center; flex: 0 0 auto; padding-inline: clamp(14px, 1.8vw, 24px); }
.pf-bar__cell + .pf-bar__cell { border-left: 1px solid var(--rule); }
.pf-bar__label { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-right: 16px; white-space: nowrap; }
.pf-tabs { display: flex; gap: clamp(14px, 2vw, 24px); }
.pf-tab {
  position: relative;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
  cursor: pointer;
}
.pf-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}
.pf-tab:hover { color: var(--ink); }
.pf-tab[aria-pressed="true"] { color: var(--ink); }
.pf-tab[aria-pressed="true"]::after { transform: scaleX(1); }
.pf--interacted .pf-tab::after { transition: transform 420ms var(--pf-ease); }
.pf-bar__count { margin-left: auto; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }

/* the jump line: one cell per sector, ruled between */
.pf-jump { flex: 1 1 auto !important; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 0 !important; }
.pf-jump::-webkit-scrollbar { display: none; }
.pf-jump ul { list-style: none; display: flex; height: 100%; }
.pf-jump li { flex: 0 0 auto; display: flex; }
.pf-jump li + li { border-left: 1px solid var(--rule); }
.pf-jump li[hidden] { display: none; }
.pf-jump a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 clamp(10px, 1.1vw, 16px);
  min-height: 44px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color 200ms ease, background-color 200ms ease;
}
.pf-jump__n { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums lining-nums; }
.pf-jump a:hover { color: var(--red); }
.pf-jump a { position: relative; }
.pf-jump a[aria-current="true"] { color: var(--ink); }
.pf-jump a[aria-current="true"]::before { content: ""; position: absolute; left: 50%; bottom: 6px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }

/* ----------------------------------------------------------------- sectors */

.pf-list .pf-frame { padding-bottom: clamp(48px, 6vw, 88px); }
.pf-sector { scroll-margin-top: 150px; }
.pf-sector[hidden] { display: none; }
.pf-sector + .pf-sector { margin-top: clamp(24px, 3vw, 40px); }
.pf-sector__head {
  display: grid;
  grid-template-columns: var(--pf-logo-cell) minmax(0, 1fr) auto;
  align-items: center;
  min-height: 64px;
  border-block: 1px solid var(--rule-strong);
  margin-top: -1px;
}
.pf-sector__num {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--rule);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--red);
  font-variant-numeric: tabular-nums lining-nums;
}
.pf-sector__title {
  margin: 0;
  padding-inline: clamp(16px, 2vw, 28px);
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.45rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
}
.pf-sector__count { padding-inline: clamp(16px, 2vw, 28px); font-size: 0.8125rem; color: var(--muted); }

.pf-rows { list-style: none; }

/* ------------------------------------------------------------------- rows */

.pf-row {
  position: relative;
  display: grid;
  grid-template-columns: var(--pf-logo-cell) minmax(0, 1fr) minmax(0, 260px) 112px 72px;
  align-items: stretch;
  min-height: 96px;
  border-bottom: 1px solid var(--rule);
  isolation: isolate;
}
.pf-row[hidden] { display: none; }
.pf-row > * { display: flex; align-items: center; padding: 18px clamp(14px, 1.8vw, 24px); min-width: 0; }
.pf-row > * + *:not(.pf-row__fill) { border-left: 1px solid var(--rule); }
.pf-row__fill {
  position: absolute;
  inset: -1px 0;
  z-index: -1;
  padding: 0 !important;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 520ms var(--pf-ease);
}
.pf-row:hover .pf-row__fill,
.pf-row:focus-within .pf-row__fill { transform: scaleX(1); }
.pf-row:hover > *, .pf-row:focus-within > * { border-color: rgba(255, 255, 255, 0.22); }

/* every logo centred in the same cell; portfolio.js sets its size by area */
.pf-row__logo { justify-content: center; }
.pf-row__logo img {
  display: block;
  max-width: calc(var(--pf-logo-cell) - 40px);
  max-height: 60px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 500ms var(--pf-ease), filter 300ms ease;
}
.pf-row:hover .pf-row__logo img,
.pf-row:focus-within .pf-row__logo img { transform: translateY(-3px) scale(1.04); filter: brightness(0) invert(1); }

.pf-row__main { flex-direction: column; align-items: flex-start !important; justify-content: center; gap: 4px; }
.pf-row__name {
  font-weight: 600;
  font-size: clamp(1.2rem, 1rem + 0.6vw, 1.5rem);
  line-height: 1.2;
  color: var(--ink);
  transition: color 300ms ease, transform 500ms var(--pf-ease);
}
.pf-row__name::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pf-row__name:focus-visible { outline: 3px solid var(--white); outline-offset: 4px; }
.pf-row__summary {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  transition: color 300ms ease;
}

.pf-row__meta { flex-direction: column; align-items: flex-start !important; justify-content: center; gap: 4px; }
.pf-row__label { font-size: 0.625rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); transition: color 300ms ease; }
.pf-row__backers { font-size: 0.875rem; line-height: 1.4; color: var(--ink-soft); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; transition: color 300ms ease; }
.pf-row__funds { display: flex; flex-direction: column; gap: 2px; }
.pf-fund { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; color: var(--muted); transition: color 300ms ease; }
.pf-fund--live { color: var(--red); }

.pf-row__site {
  position: relative;
  z-index: 2;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  transition: color 300ms ease;
}
.pf-row__site::after { content: "\2197"; margin-left: 4px; }
.pf-row__site--none::after { content: none; }
.pf-row__site:hover { text-decoration: underline; text-underline-offset: 4px; }

/* on the red, everything turns white */
.pf-row:hover .pf-row__name, .pf-row:focus-within .pf-row__name,
.pf-row:hover .pf-row__summary, .pf-row:focus-within .pf-row__summary,
.pf-row:hover .pf-row__label, .pf-row:focus-within .pf-row__label,
.pf-row:hover .pf-row__backers, .pf-row:focus-within .pf-row__backers,
.pf-row:hover .pf-fund, .pf-row:focus-within .pf-fund,
.pf-row:hover .pf-row__site, .pf-row:focus-within .pf-row__site { color: var(--white); }
.pf-row:hover .pf-row__name, .pf-row:focus-within .pf-row__name { transform: translateX(6px); }
.pf-row:focus-within .pf-row__site:focus-visible { outline-color: var(--white); }

/* ----------------------------------------------------------------- empty */

.pf-empty { padding: 48px clamp(20px, 3vw, 40px); color: var(--muted); }
.pf-empty[hidden] { display: none; }
.pf-empty .link-arrow { margin-top: 12px; }
.pf-empty button.link-arrow { border: 0; border-bottom: 1px solid var(--rule-strong); background: none; padding: 0 0 4px; cursor: pointer; }

/* ----------------------------------------------------------------- quote */

.pf-quote .pf-frame { padding: clamp(80px, 10vw, 150px) clamp(20px, 3vw, 40px) clamp(64px, 8vw, 120px); text-align: center; border-top: 1px solid var(--rule); }
.pf-quote__text { max-width: 26ch; margin: 0 auto 28px; font-weight: 300; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.4rem); line-height: 1.25; color: var(--ink-warm); }
.pf-quote__text em { font-style: italic; color: var(--red); }

/* --------------------------------------------------------------- reveal
   transform and clip-path only, never opacity, so contrast holds */

.pf--reveal .pf-sector__head:not(.is-in) .pf-sector__title { clip-path: inset(0 0 100% 0); transform: translateY(12px); }
.pf--reveal .pf-sector__head .pf-sector__title { transition: clip-path 800ms var(--pf-ease), transform 800ms var(--pf-ease); }
.pf--reveal .pf-row:not(.is-in) > :not(.pf-row__fill) > * { transform: translateY(12px); }
.pf--reveal .pf-row > :not(.pf-row__fill) > * { transition: transform 700ms var(--pf-ease); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
  .pf { --pf-logo-cell: 140px; }
  .pf-row { grid-template-columns: var(--pf-logo-cell) minmax(0, 1fr) minmax(0, 200px) 100px 64px; }
  .pf-bar__count { display: none; }
}
@media (max-width: 820px) {
  .pf { --pf-logo-cell: 104px; }
  .pf-bar { top: 64px; }
  .pf-bar .pf-frame { flex-direction: column; }
  .pf-bar__cell + .pf-bar__cell { border-left: 0; border-top: 1px solid var(--rule); }
  .pf-bar__count { display: none; }
  .pf-row {
    grid-template-columns: var(--pf-logo-cell) minmax(0, 1fr) 48px;
    grid-template-areas: "logo main site" "logo meta site";
  }
  .pf-row__logo { grid-area: logo; }
  .pf-row__main { grid-area: main; padding-bottom: 4px !important; }
  .pf-row__site { grid-area: site; }
  .pf-row__meta { display: none !important; }
  .pf-row__meta--fund { display: flex !important; grid-area: meta; flex-direction: row; padding-top: 0 !important; border-left: 1px solid var(--rule); }
  .pf-row__funds { flex-direction: row; gap: 10px; }
  .pf-sector { scroll-margin-top: 220px; }
}
@media (max-width: 560px) {
  .pf { --pf-logo-cell: 80px; }
  .pf-frame { border-inline: 0; }
  .pf-head__rule { display: none; }
  .pf-row > * { padding: 14px 12px; }
  .pf-row__logo img { max-height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-row__fill, .pf-row__logo img, .pf-row__name, .pf-tab::after { transition: none !important; }
  .pf--reveal .pf-row > * > *, .pf--reveal .pf-sector__title { transform: none !important; clip-path: none !important; }
}

/* co-investors: one name per line, each on a short rule */
.pf-row__meta--backers { justify-content: center; padding-block: 16px !important; }
ul.pf-row__backers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
  overflow: visible;
  -webkit-line-clamp: unset;
}
ul.pf-row__backers li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: baseline;
  column-gap: 8px;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--ink-soft);
  transition: color 300ms ease;
}
ul.pf-row__backers li::before { content: ""; height: 1px; background: var(--rule-strong); transform: translateY(-0.3em); transition: background 300ms ease; }
.pf-row:hover ul.pf-row__backers li, .pf-row:focus-within ul.pf-row__backers li { color: var(--white); }
.pf-row:hover ul.pf-row__backers li::before, .pf-row:focus-within ul.pf-row__backers li::before { background: rgba(255, 255, 255, 0.6); }

/* sector jump bar: "Climate/Mobility" is longer than "Climate", so the
   links sit a little tighter to keep all seven in view at desktop widths */
.pf-jump a { padding: 0 clamp(8px, 0.8vw, 12px); gap: 6px; }
