/* Talent Flow (/talent/talent-flow/): the ranking and its hover card, the
   shared tooltip, and the compact flow chart on the /talent/ hub card.
   Markup is rendered by js/talent-flow.js from data/talent-flow/*.json. */
.tf { padding: 0 2rem 4.5rem; scroll-margin-top: 130px; }
.tf-inner { max-width: 1080px; margin: 0 auto; }
.tf-eyebrow { display: flex; align-items: center; gap: 0.6rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--eyebrow); margin-bottom: 0.55rem; }
.tf-badge { font-size: 0.625rem; letter-spacing: 0.1em; padding: 0.2rem 0.55rem; border-radius: 999px; border: 1px solid var(--border-tray); background: var(--surface-tray); color: var(--blue-ink); }

.tf-card { border: 1px solid var(--border-light); border-radius: 16px; background: var(--surface-card); box-shadow: var(--shadow-sm); }
.tf-loading { padding: 3rem 1rem; text-align: center; color: var(--text-light); }

/* One floating tooltip for every [data-tip] element (js/talent-flow.js) */
.tf-has-tip { cursor: help; }
.tf-has-tip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.tf-tooltip { position: fixed; z-index: 1200; max-width: 300px; padding: 0.5rem 0.7rem; border-radius: 8px; background: var(--chart-tooltip-bg); color: var(--chart-tooltip-ink); font: 500 0.75rem/1.45 var(--font-sans); white-space: pre-line; pointer-events: none; box-shadow: var(--shadow-md); }
.tf-tooltip[hidden] { display: none; }

/* Hub card preview */
.talent-flow-preview-chart { height: 100%; display: grid; place-items: center; padding: 0.6rem 1rem; }
.talent-flow-preview-chart .tf-flow-svg { display: block; width: 100%; max-height: 100%; }

/* Tables */
.tf-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.tf-table th { text-align: left; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light); padding: 0.85rem 0.9rem 0.6rem; border-bottom: 1px solid var(--border-light); white-space: nowrap; }
.tf-table td { padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--border-light); white-space: nowrap; color: var(--ink); }
.tf-table tr:last-child td { border-bottom: 0; }
.tf-muted { color: var(--text-light); }

/* Logo tiles and people */
.tf-logo { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--logo-tile-bg); border: 1px solid var(--logo-tile-border); overflow: hidden; font-size: 0.625rem; font-weight: 700; color: var(--text-light); }
.tf-logo img { width: 100%; height: 100%; object-fit: contain; }
.tf-logo--sm { width: 20px; height: 20px; border-radius: 5px; font-size: 0.5rem; }
.tf-avatar { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--navy-lighter); overflow: hidden; font-size: 0.6875rem; font-weight: 700; color: var(--text-light); }
.tf-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Flow chart (hub card) */
.tf-flow-svg { display: block; width: 100%; height: auto; overflow: visible; }
.tf-flow-svg text { font-family: var(--font-sans); fill: var(--ink); }
.tf-flow-svg .tf-flow-count { fill: var(--text-light); font-variant-numeric: tabular-nums; }
.tf-flow-svg .tf-flow-head { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; fill: var(--text-light); }
.tf-band-in { fill: var(--blue); opacity: 0.22; }
.tf-band-out { fill: var(--marker-alt); opacity: 0.28; }
.tf-node-in { fill: var(--blue); }
.tf-node-out { fill: var(--marker-alt); }
.tf-node-co { fill: var(--ink); }

/* Buttons, tags, filters */
.tf-more { margin-top: 0.75rem; border: 1px solid var(--border-light); background: var(--surface-card); color: var(--ink); border-radius: 999px; padding: 0.4rem 1rem; font: 600 0.8125rem var(--font-sans); cursor: pointer; }
.tf-more:hover { border-color: var(--border-mid); }

.tf-founder { display: block; margin-top: 0.1rem; font-size: 0.625rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue-ink); }

.sg-pills { display: inline-flex; gap: 0.25rem; padding: 0.2rem; border-radius: 999px; background: var(--surface-tray); border: 1px solid var(--border-tray); }
.sg-pill { border: 0; background: none; padding: 0.35rem 0.85rem; border-radius: 999px; font: 600 0.8125rem var(--font-sans); color: var(--text-light); cursor: pointer; }
.sg-pill[aria-pressed="true"] { background: var(--blue); color: var(--surface-card); }

.tf-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; margin-top: 1.25rem; padding: 1.25rem 1.5rem; border-radius: 16px; background: var(--surface-tray); border: 1px solid var(--border-tray); }
.tf-foot p { font-size: 0.875rem; color: var(--text-light); max-width: 62ch; }

/* Ranking */
.tr-box { padding: 1rem 1.25rem 1.25rem; }
.tr-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 0.75rem; }
.tr-select { height: 2.15rem; padding: 0 2rem 0 0.85rem; border-radius: 999px; border: 1px solid var(--border-tray); background: var(--surface-tray); color: var(--ink); font: 600 0.8125rem var(--font-sans); cursor: pointer; }
.tr-select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tr-table td { padding-top: 0.6rem; padding-bottom: 0.6rem; }
.tr-row { cursor: default; transition: background 120ms ease; }
.tr-row:hover, .tr-row:focus-visible { background: var(--navy-light); outline: none; }
.tr-row:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.tr-col-rank { width: 2.5rem; text-align: right; color: var(--text-light); font-weight: 600; }
.tf-table th.tr-col-rank { text-align: right; }
.tr-col-num, .tf-table th.tr-col-num { text-align: right; }
.tr-co { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.tr-co-text { min-width: 0; }
.tr-co-name { font-weight: 600; font-size: 0.9375rem; color: var(--ink); }
.tr-row:hover .tr-co-name { color: var(--blue-ink); }
.tr-co-loc { font-size: 0.75rem; color: var(--text-light); }
.tr-stage { font-size: 0.6875rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px; }
.tr-stage--early { color: var(--marker-alt); background: var(--surface-data); }
.tr-stage--breakout { color: var(--blue-ink); background: var(--mint-soft); }
.tr-sources { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tr-source { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.45rem 0.15rem 0.2rem; border: 1px solid var(--border-light); border-radius: 999px; font-size: 0.75rem; font-weight: 600; color: var(--ink); }
.tr-source b { font-weight: 700; color: var(--blue-ink); }
.tr-source--more { padding-left: 0.45rem; color: var(--text-light); }
.tr-empty { padding: 1rem 0.9rem; }
.tr-empty[hidden], .tf-more[hidden] { display: none; }

/* Main tabs: ranking | talent moves */
.tr-tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-light); }
.tr-tab { border: 0; background: none; padding: 0.7rem 1.1rem; margin-bottom: -1px; border-bottom: 2px solid transparent; font: 600 1rem var(--font-sans); color: var(--text-light); cursor: pointer; }
.tr-tab:hover { color: var(--ink); }
.tr-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--blue); }
.tr-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 6px; }
.tr-view[hidden] { display: none; }
.tr-view-note { font-size: 0.875rem; color: var(--text-light); margin-bottom: 0.5rem; }

/* Locked content: blurred placeholder rows and feed items under a note */
.tr-locked-wrap { position: relative; }
.tr-row--locked td, .tr-feed--locked { filter: blur(5px); user-select: none; pointer-events: none; }
.tr-row--locked td { opacity: 0.75; }
.tr-lock { display: none; }
.tr-locked-wrap--on .tr-lock { display: flex; position: absolute; left: 50%; bottom: 1.5rem; transform: translateX(-50%); width: min(420px, calc(100% - 2rem)); flex-direction: column; align-items: center; gap: 0.75rem; padding: 1.1rem 1.25rem; text-align: center; border-radius: 14px; background: var(--surface-card); border: 1px solid var(--border-light); box-shadow: var(--shadow-md); }
.tr-lock p { font-size: 0.875rem; line-height: 1.45; color: var(--ink); }

/* Feed */
.tr-feed { display: grid; }
.tr-feed-item { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; padding: 0.75rem 0.25rem; border-bottom: 1px solid var(--border-light); }
.tr-faces { display: inline-flex; }
.tr-faces .tf-avatar { width: 28px; height: 28px; margin-left: -12px; border: 2px solid var(--surface-card); }
.tr-faces .tf-avatar:first-child { margin-left: 0; }
.tr-feed-line { font-size: 0.9rem; line-height: 1.45; color: var(--ink); }
.tr-feed-line b { font-weight: 600; }
.tr-feed-meta { font-size: 0.75rem; color: var(--text-light); }
.tr-feed-tag { font-size: 0.6875rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px; white-space: nowrap; }
.tr-feed-tag--founded { color: var(--marker-alt); background: var(--surface-data); }
.tr-feed-tag--team, .tr-feed-tag--joined { color: var(--blue-ink); background: var(--mint-soft); }
.tr-feed--locked { min-height: 420px; max-height: 560px; overflow: hidden; }
.tr-locked-wrap--feed .tr-lock { top: 4rem; bottom: auto; }
.tr-feed-item { align-items: start; }
.tr-feed-item > .tr-feed-tag { align-self: center; }

/* Hover card: what a company's rank is based on */
.tr-card { position: fixed; z-index: 1200; width: min(380px, calc(100vw - 16px)); padding: 1rem 1.1rem; border-radius: 14px; background: var(--surface-card); border: 1px solid var(--border-light); box-shadow: var(--shadow-md); pointer-events: none; }
.tr-card[hidden] { display: none; }
.tr-card-head { display: flex; align-items: center; gap: 0.65rem; }
.tr-card-name { font: 600 1.05rem/1.2 var(--font-display); color: var(--ink); }
.tr-card-loc { font-size: 0.75rem; color: var(--text-light); }
.tr-card-tagline { margin-top: 0.55rem; font-size: 0.8125rem; line-height: 1.45; color: var(--text-cool); }
.tr-card-facts { margin-top: 0.45rem; font-size: 0.75rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.tr-card-title { margin: 0.85rem 0 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--border-light); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light); }
.tr-card-people { display: grid; gap: 0.55rem; }
.tr-card-more { margin-top: 0.5rem; font-size: 0.75rem; color: var(--text-light); }
.tr-person { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0.6rem; align-items: center; }
.tr-person-name { font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
.tr-person-name .tf-founder { display: inline; margin-left: 0.4rem; }
.tr-person-role, .tr-person-from { font-size: 0.75rem; line-height: 1.35; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-person-from { color: var(--blue-ink); font-weight: 600; white-space: normal; }

/* Stats tab: where they go, founders vs hires, flow at ten companies */
.st-section + .st-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border-light); }
.st-head { margin-bottom: 0.9rem; }
.st-head h3 { font: 600 1.2rem/1.25 var(--font-display); color: var(--ink); margin-bottom: 0.25rem; }
.st-head p { font-size: 0.875rem; color: var(--text-light); max-width: 72ch; }
.st-band { opacity: 0.26; }
.st-band--europe, .st-node--europe { fill: var(--blue); }
.st-band--usa, .st-node--usa { fill: var(--marker-alt); }
.st-band--asia, .st-node--asia { fill: var(--ecosystem-research); }
.st-band--row, .st-node--row { fill: var(--text-light); }
.st-table-wrap { display: none; }
.st-src { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; }
.st-src-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-key { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-bottom: 0.75rem; font-size: 0.8125rem; color: var(--text-light); }
.st-key-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.st-sw { display: inline-block; width: 10px; height: 10px; }
.st-sw--founded { background: var(--blue); }
.st-sw--stealth { background: var(--ecosystem-company); }
.st-sw--joined { background: var(--ecosystem-talent); }
.st-bars { display: grid; gap: 0.5rem; }
.st-bar-row { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 3rem; gap: 0.75rem; align-items: center; font-size: 0.875rem; color: var(--ink); }
.st-track { display: flex; height: 14px; }
.st-seg { display: block; height: 100%; }
.st-total { text-align: right; color: var(--text-light); font-variant-numeric: tabular-nums; }
.st-picker { margin-bottom: 0.75rem; }
.tf-flow-lists { display: none; gap: 1.25rem; }
.tf-flow-note { margin-top: 0.6rem; font-size: 0.75rem; color: var(--text-light); }
.tf-sublist-title { font-size: 0.8125rem; font-weight: 600; color: var(--ink); margin-bottom: 0.55rem; }
.tf-bars { display: grid; gap: 0.45rem; }
.tf-bar-row { display: grid; grid-template-columns: 20px minmax(0, 7.5rem) minmax(0, 1fr) 2.25rem; gap: 0.55rem; align-items: center; font-size: 0.8125rem; }
.tf-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-bar-track { height: 10px; background: var(--mint-soft); overflow: hidden; }
.tf-bar-fill { display: block; height: 100%; background: var(--blue); }
.tf-bar-fill--out { background: var(--marker-alt); }
.tf-bar-value { text-align: right; color: var(--text-light); font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
    .tf { padding: 0 1rem 3rem; }
    .st-sankey, .st-flow .tf-flow-svg { display: none; }
    .st-table-wrap, .tf-flow-lists { display: grid; }
    .st-table-wrap { overflow-x: auto; }
    .st-table { font-size: 0.8125rem; }
    .st-table td, .st-table th { padding-left: 0.35rem; padding-right: 0.35rem; }
    .st-bar-row { grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) 2.5rem; gap: 0.5rem; font-size: 0.8125rem; }
    .tr-box { padding: 0.75rem 0.75rem 1rem; }
    .tr-col-raised, .tr-col-team, .tr-col-stage { display: none; }
    .tf-table .tr-col-rank { width: 1.75rem; padding-left: 0.25rem; padding-right: 0.25rem; }
    .tf-table td, .tf-table th { padding-left: 0.5rem; padding-right: 0.5rem; }
    .tr-col-co { max-width: 0; width: 100%; }
    .tr-co-name, .tr-co-loc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tr-sources { flex-wrap: nowrap; justify-content: flex-end; }
    .tf-table th.tr-col-from { text-align: right; }
    .tr-source-name { display: none; }
    .tr-source { padding-right: 0.3rem; }
    .tr-row { cursor: pointer; }
    .tr-tab { padding: 0.6rem 0.8rem; font-size: 0.9375rem; }
    .tr-feed-item { grid-template-columns: 60px minmax(0, 1fr); }
    .tr-feed-tag { grid-column: 2; justify-self: start; }
}
