/* The Cohort Wall: thirteen equal tiles. Official logos and each venture's own
   colour carry the identity; ventures without a logo are set as type. */
.cohort-wall {
  --plate: #ffffff;
  --tile-line: var(--line);
  --flood: var(--deep);
  --wall-columns: 4;
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  /* Equal flexible tracks keep the intro row and every venture row in step.
     Content can still grow at larger text sizes without a fixed-height crop. */
  grid-auto-rows: minmax(clamp(200px, 17vw, 252px), 1fr);
  border-top: 1px solid var(--tile-line);
  border-left: 1px solid var(--tile-line);
}
:root[data-theme="dark"] .cohort-wall { --plate: var(--soft); --flood: #1261ed; }

.wall-intro,
.wall-tile { border-right: 1px solid var(--tile-line); border-bottom: 1px solid var(--tile-line); }

.wall-intro {
  grid-column: span 3;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: clamp(20px, 2.4vw, 36px);
  background: var(--deep);
  color: var(--on-photo);
}
.wall-intro::after {
  content: "";
  position: absolute;
  right: -10%;
  bottom: -45%;
  z-index: -1;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--grad);
  filter: blur(72px);
  opacity: 0.34;
}
.wall-intro .eyebrow,
.wall-intro dt { color: #a9b4c4; }
.wall-intro h2,
.wall-intro-line {
  max-width: 32ch;
  font-size: clamp(24px, 2.4vw, 36px);
  font-weight: 550;
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: var(--on-photo);
}
.wall-intro dl { display: flex; flex-wrap: wrap; gap: 12px clamp(24px, 3vw, 48px); }
.wall-intro dt { font-size: 11px; font-weight: 550; letter-spacing: 0.07em; text-transform: uppercase; }
.wall-intro dd { margin-top: 4px; font-size: clamp(20px, 2vw, 30px); font-weight: 600; letter-spacing: -0.035em; color: var(--on-photo); }

.wall-tile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 14px 16px;
  background: var(--plate);
  color: var(--ink);
  transition: color 0.3s ease;
}
.wall-tile[hidden] { display: none; }
.wall-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--brand, var(--flood));
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.5s cubic-bezier(0.7, 0, 0.2, 1);
}
.wall-tile--still::before { display: none; }
.wall-tile-sector {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s ease;
}
/* One invisible artwork boundary between the unchanged labels/descriptions.
   Size containment supplies cqw/cqh without allowing images to grow the card. */
.wall-tile-mark {
  grid-row: 2;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  max-width: calc(100cqw / var(--wall-columns) - 49px);
  container-type: size;
}
.wall-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  /* Inset artwork only; labels, media region and card tracks stay fixed. */
  width: min(calc((100cqw - 2 * min(var(--card-space-x, 12px), 10cqw)) * var(--fit-width) * var(--card-fill, 1)), calc((100cqh - 2 * min(var(--card-space-y, 10px), 12cqh)) * var(--fit-height) * var(--card-fill, 1)));
  height: auto;
  max-width: none;
  max-height: none;
  transform: translate(var(--art-x), var(--art-y));
  object-fit: contain;
  transition: opacity 0.3s ease;
}
/* Text stays at its original card offsets. Its real line count reserves space
   above/below the logo, including translated text and narrow filtered results. */
.cohort-wall[data-view="wall"] .wall-tile-sector { position: static; grid-row: 1; justify-self: stretch; }
.cohort-wall[data-view="wall"] .wall-tile-domain { position: static; grid-row: 3; justify-self: stretch; margin-right: 30px; }
.wall-logo--dark { opacity: 0; }
:root[data-theme="dark"] .wall-logo--light { opacity: 0; }
:root[data-theme="dark"] .wall-logo--dark { opacity: 1; }
:root[data-theme="dark"] .wall-tile--still .wall-logo--light { opacity: 1; }
.wall-wordmark { font-size: min(clamp(30px, 3.6vw, 50px), 24cqw); font-weight: 600; line-height: 1; letter-spacing: -0.045em; text-align: center; }
.wall-tile-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.wall-tile-domain {
  position: absolute;
  left: 16px;
  right: 46px;
  bottom: 14px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  transition: color 0.3s ease;
}
.wall-tile > .arrow { position: absolute; right: 14px; bottom: 13px; width: 18px; height: 18px; color: var(--muted); transition: color 0.3s ease, transform 0.3s ease; }
.wall-tile:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
@media (hover: hover) {
  .wall-tile:not(.wall-tile--still):hover { color: var(--on-photo); }
  .wall-tile:hover::before { clip-path: inset(0); }
  .wall-tile:not(.wall-tile--still):hover .wall-tile-sector,
  .wall-tile:not(.wall-tile--still):hover .wall-tile-domain,
  .wall-tile:not(.wall-tile--still):hover > .arrow { color: rgba(255, 255, 255, 0.8); }
  .wall-tile:not(.wall-tile--still):hover .wall-logo--light { opacity: 0; }
  .wall-tile:not(.wall-tile--still):hover .wall-logo--dark { opacity: 1; }
  .wall-tile:hover > .arrow { transform: translate(2px, -2px); }
}
.wall-tile:not(.wall-tile--still):focus-visible { color: var(--on-photo); }
.wall-tile:focus-visible::before { clip-path: inset(0); }
.wall-tile:not(.wall-tile--still):focus-visible .wall-tile-sector,
.wall-tile:not(.wall-tile--still):focus-visible .wall-tile-domain,
.wall-tile:not(.wall-tile--still):focus-visible > .arrow { color: rgba(255, 255, 255, 0.8); }
.wall-tile:not(.wall-tile--still):focus-visible .wall-logo--light { opacity: 0; }
.wall-tile:not(.wall-tile--still):focus-visible .wall-logo--dark { opacity: 1; }

/* Index view: the same links as a scannable list. */
.cohort-wall[data-view="index"] {
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: auto;
  border-left: 0;
  border-top-color: var(--ink);
}
.cohort-wall[data-view="index"] .wall-intro { display: none; }
.cohort-wall[data-view="index"] .wall-tile {
  grid-template-columns: 76px minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1.3fr) 24px;
  grid-template-areas: "mark name sector domain arrow";
  grid-template-rows: auto;
  align-items: center;
  justify-items: start;
  gap: 24px;
  padding: 14px 10px;
  border-right: 0;
}
.cohort-wall[data-view="index"] .wall-tile::before { clip-path: inset(0 100% 0 0); }
.cohort-wall[data-view="index"] .wall-tile:hover::before,
.cohort-wall[data-view="index"] .wall-tile:focus-visible::before { clip-path: inset(0); }
.cohort-wall[data-view="index"] .wall-tile-mark {
  grid-area: mark;
  max-width: none;
  position: relative;
  inset: auto;
  width: 76px;
  height: 48px;
  background: var(--paper);
  border: 1px solid var(--tile-line);
}
.cohort-wall[data-view="index"] .wall-logo { width: min(calc(88cqw * var(--fit-width) * var(--card-fill, 1)), calc(84cqh * var(--fit-height) * var(--card-fill, 1))); }
.wall-monogram { display: none; }
.cohort-wall[data-view="index"] .wall-wordmark { display: none; }
.cohort-wall[data-view="index"] .wall-monogram { display: block; font-size: 20px; font-weight: 600; line-height: 1; letter-spacing: -0.04em; color: var(--muted); }
.cohort-wall[data-view="index"] .wall-tile-name {
  grid-area: name;
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 550;
  letter-spacing: -0.03em;
}
.cohort-wall[data-view="index"] .wall-tile-sector { grid-area: sector; position: static; }
.cohort-wall[data-view="index"] .wall-tile-domain { grid-area: domain; position: static; font-size: 14px; }
.cohort-wall[data-view="index"] .wall-tile > .arrow { grid-area: arrow; position: static; }

/* In the index the logo sits on its own small plate, so it keeps the theme variant. */
.cohort-wall[data-view="index"] .wall-tile:hover .wall-logo--light,
.cohort-wall[data-view="index"] .wall-tile:focus-visible .wall-logo--light { opacity: 1; }
.cohort-wall[data-view="index"] .wall-tile:hover .wall-logo--dark,
.cohort-wall[data-view="index"] .wall-tile:focus-visible .wall-logo--dark { opacity: 0; }
:root[data-theme="dark"] .cohort-wall[data-view="index"] .wall-tile:hover .wall-logo--light,
:root[data-theme="dark"] .cohort-wall[data-view="index"] .wall-tile:focus-visible .wall-logo--light { opacity: 0; }
:root[data-theme="dark"] .cohort-wall[data-view="index"] .wall-tile:hover .wall-logo--dark,
:root[data-theme="dark"] .cohort-wall[data-view="index"] .wall-tile:focus-visible .wall-logo--dark { opacity: 1; }

/* Directory header and controls. */
.directory-head { padding-block: clamp(44px, 6vw, 84px) clamp(28px, 3vw, 44px); }
.directory-kicker { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); margin-bottom: clamp(24px, 3vw, 40px); }
.directory-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px 48px; flex-wrap: wrap; }
.directory-head h1 { display: flex; align-items: flex-end; gap: clamp(14px, 1.8vw, 28px); font-size: inherit; position: relative; padding-bottom: 22px; }
.directory-head h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: min(100%, 420px); height: 5px; background: var(--grad); }
.directory-count { font-size: clamp(120px, 18vw, 270px); font-weight: 600; line-height: 0.76; letter-spacing: -0.075em; font-variant-numeric: tabular-nums; }
.directory-word { display: grid; gap: 12px; font-size: clamp(36px, 4.6vw, 70px); line-height: 0.9; letter-spacing: -0.05em; }
.directory-word small { max-width: 26ch; font-size: 15px; font-weight: 400; line-height: 1.4; letter-spacing: -0.01em; color: var(--muted); }
.directory-title-row > p { max-width: 36ch; font-size: 16px; }

.directory-page .directory-controls {
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  padding: 24px 0;
  background: none;
}
.directory-page .search-field { max-width: 560px; }
.search-submit {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 100%;
  display: grid;
  place-items: center end;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
}
.directory-page .search-field .search-submit svg { position: static; }
.sector-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.sector-chips legend {
  float: left;
  width: 100%;
  margin-bottom: 10px;
  padding: 0;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.sector-chips button,
.view-toggle button {
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.sector-chips button span { margin-left: 4px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sector-chips button:hover,
.view-toggle button:hover { border-color: var(--ink); }
.sector-chips button[aria-pressed="true"],
.view-toggle button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.sector-chips button[aria-pressed="true"] span { color: inherit; opacity: 0.7; }
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.view-toggle[hidden] { display: none; }
.view-toggle button { min-height: 34px; padding: 6px 16px; border-color: transparent; }
.directory-page .directory-summary { margin: 28px 0 20px; }
.directory-page .directory-summary > p { font-size: 13px; }

@media (max-width: 1024px) {
  .cohort-wall { --wall-columns: 3; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wall-intro { grid-column: span 2; }
  .cohort-wall[data-view="index"] .wall-tile { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.2fr) 22px; grid-template-areas: "mark name domain arrow"; }
  .cohort-wall[data-view="index"] .wall-tile-sector { display: none; }
  .cohort-wall[data-view="index"] .wall-tile-mark { width: 64px; height: 42px; }
}
@media (max-width: 760px) {
  .cohort-wall { --wall-columns: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(168px, 1fr); }
  /* The full-width phone intro has its own content-sized row; only cards
     participate in equal row sizing at this breakpoint. */
  .cohort-wall[data-view="wall"]:has(> .wall-intro:not([hidden])) { grid-template-rows: auto; }
  .wall-intro { grid-column: 1 / -1; }
  .wall-intro h2, .wall-intro-line { font-size: 28px; }
  .cohort-wall[data-view="wall"] .wall-tile:nth-child(odd of .wall-tile:not([hidden])):nth-last-child(1 of .wall-tile:not([hidden])) { grid-column: 1 / -1; }
  .wall-tile { padding: 12px; gap: 6px; }
  .wall-tile-mark { max-width: calc(100cqw / var(--wall-columns) - 33px); }
  .cohort-wall[data-view="wall"] .wall-tile-domain { margin-right: 24px; }
  .wall-tile-sector { top: 12px; left: 12px; right: 12px; font-size: 9px; }
  .wall-tile-domain { left: 12px; right: 36px; bottom: 12px; font-size: 11px; }
  .wall-tile > .arrow { right: 10px; bottom: 11px; width: 16px; height: 16px; }
  .cohort-wall[data-view="index"] .wall-tile { grid-template-columns: 56px minmax(0, 1fr) 20px; grid-template-areas: "mark name arrow" "mark domain arrow"; gap: 2px 16px; padding: 12px 4px; }
  .cohort-wall[data-view="index"] .wall-tile-mark { width: 56px; height: 40px; }
  .cohort-wall[data-view="index"] .wall-tile-domain { font-size: 12px; }
  .directory-head h1 { flex-wrap: wrap; }
  .sector-chips button { min-height: 38px; padding: 7px 12px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .wall-tile::before { transition: none; }
}
@media (forced-colors: active) {
  .wall-tile::before, .wall-intro::after { display: none; }
  .wall-tile { border: 1px solid CanvasText; }
}
