/* Pathways — minimal, token-driven. Light/dark via data-theme + OS preference. */

:root {
  color-scheme: light;
  --page:           #f9f9f7;
  --surface:        #fcfcfb;
  --ink:            #0b0b0b;
  --ink-2:          #52514e;
  --muted:          #898781;
  --hairline:       rgba(11, 11, 11, 0.10);
  --grid:           #e1e0d9;
  --rail:           #c3c2b7;

  --f-tech:          #2a78d6;
  --f-business:      #1baf7a;
  --f-media:         #4a3aa7;
  --f-entertainment: #eb6834;
  --f-music:         #e87ba4;
  --f-politics:      #e34948;
  --f-sports:        #008300;
  --f-science:       #eda100;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page:     #0d0d0d;
    --surface:  #1a1a19;
    --ink:      #ffffff;
    --ink-2:    #c3c2b7;
    --muted:    #898781;
    --hairline: rgba(255, 255, 255, 0.10);
    --grid:     #2c2c2a;
    --rail:     #383835;

    --f-tech:          #3987e5;
    --f-business:      #199e70;
    --f-media:         #9085e9;
    --f-entertainment: #d95926;
    --f-music:         #d55181;
    --f-politics:      #e66767;
    --f-sports:        #008300;
    --f-science:       #c98500;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page:     #0d0d0d;
  --surface:  #1a1a19;
  --ink:      #ffffff;
  --ink-2:    #c3c2b7;
  --muted:    #898781;
  --hairline: rgba(255, 255, 255, 0.10);
  --grid:     #2c2c2a;
  --rail:     #383835;

  --f-tech:          #3987e5;
  --f-business:      #199e70;
  --f-media:         #9085e9;
  --f-entertainment: #d95926;
  --f-music:         #d55181;
  --f-politics:      #e66767;
  --f-sports:        #008300;
  --f-science:       #c98500;
}

[data-field="tech"]          { --field: var(--f-tech); }
[data-field="business"]      { --field: var(--f-business); }
[data-field="media"]         { --field: var(--f-media); }
[data-field="entertainment"] { --field: var(--f-entertainment); }
[data-field="music"]         { --field: var(--f-music); }
[data-field="politics"]      { --field: var(--f-politics); }
[data-field="sports"]        { --field: var(--f-sports); }
[data-field="science"]       { --field: var(--f-science); }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 96px;
}

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

.site-header {
  max-width: 860px;
  margin: 0 auto;
  padding: 56px 24px 40px;
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 28px;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.tagline {
  color: var(--muted);
  font-size: 14px;
  flex: 1;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  font-size: 15px;
  color: var(--ink-2);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--rail); }

/* ---------- search ---------- */

.search-row {
  position: relative;
  max-width: 340px;
  margin: 0 auto 28px; /* sits between the origin strip and the cards */
}

.search {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 8px 18px;
  outline: none;
}
.search::placeholder { color: var(--muted); }
.search:focus { border-color: var(--rail); }

.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 10;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 7px 10px;
  border-radius: 8px;
  text-align: left;
}
.suggest-item:hover,
.suggest-item.active { background: var(--page); }

.suggest-field {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ---------- filters ---------- */

.filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 40px;
}

.chip-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.chip-row .row-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  width: 52px;
  flex-shrink: 0;
}

.chip-row .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-size: 13px;
  color: var(--ink-2);
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip:hover { border-color: var(--rail); }
.chip.active {
  color: var(--ink);
  border-color: var(--ink);
}

.field-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--field);
  flex-shrink: 0;
}

/* ---------- origin strip ---------- */

.origin-strip {
  margin-bottom: 48px;
}

.origin-strip .strip-title {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 16px;
}

.strip-columns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--grid);
}

.strip-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 0 4px 14px;
  min-height: 40px;
}
.strip-col + .strip-col { border-left: 1px dashed var(--grid); }

.strip-person {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-2);
  padding: 2px 6px;
  border-radius: 6px;
}
.strip-person:hover { color: var(--ink); background: var(--surface); }
.strip-person.dim { opacity: 0.25; }

/* Compact dot-plot mode for large datasets */
.strip-col.compact {
  flex-direction: row;
  flex-wrap: wrap;
  align-content: flex-end;
  justify-content: center;
  gap: 7px;
  padding: 0 10px 16px;
}
.strip-person.compact { padding: 3px; }
.strip-person.compact .field-dot { width: 10px; height: 10px; }
.strip-person.compact:hover .field-dot {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-radius: 50%;
}

.strip-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-top: 8px;
}
.strip-labels span {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 20px;
  transition: border-color 120ms ease, transform 120ms ease;
}
.card:hover {
  border-color: var(--rail);
  transform: translateY(-2px);
}

.card .field-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.card h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: 21px;
  margin-bottom: 6px;
}

.card .headline {
  font-size: 13px;
  color: var(--ink-2);
  min-height: 3.2em;
  margin-bottom: 16px;
}

.card .mini-stats {
  display: flex;
  gap: 24px;
  border-top: 1px solid var(--hairline);
  padding-top: 12px;
}
.card .mini-stats div { min-width: 0; }
.card .mini-stats dt {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.card .mini-stats dd {
  font-size: 14px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.empty-note {
  color: var(--muted);
  font-size: 14px;
  padding: 32px 0;
  text-align: center;
}

/* ---------- detail ---------- */

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 32px;
}
.back-link:hover { color: var(--ink); }

.person-header { margin-bottom: 36px; }

.person-header .field-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.person-header h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: 40px;
  line-height: 1.15;
  margin-bottom: 10px;
}

.person-header .headline {
  font-size: 16px;
  color: var(--ink-2);
  max-width: 56ch;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 6 cells → 3×2, no empty cells */
  gap: 1px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 56px;
}

@media (max-width: 720px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 440px) {
  .facts { grid-template-columns: 1fr; }
}

.fact {
  background: var(--surface);
  outline: 1px solid var(--hairline);
  padding: 16px 18px;
}
.fact dt {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.fact dd.value {
  font-size: 15px;
  color: var(--ink);
}
.fact dd.note {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 4px;
}

/* ---------- timeline ---------- */

.path-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 24px;
}

.path {
  list-style: none;
  position: relative;
  padding-left: 26px;
}
.path::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--grid);
  border-radius: 1px;
}

.milestone {
  position: relative;
  padding-bottom: 34px;
}
.milestone:last-child { padding-bottom: 0; }

.milestone .node {
  position: absolute;
  left: -26px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--field);
  border: 2px solid var(--surface);
}

.milestone .when {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.milestone .what {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.money {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 1px 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.milestone .note {
  font-size: 14px;
  color: var(--ink-2);
  max-width: 60ch;
  margin-top: 4px;
}

/* ---------- affiliations (inside the facts grid) ---------- */

.affiliation-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.affiliation-line + .affiliation-line { margin-top: 6px; }

.status-badge {
  font-size: 10px;
  color: var(--ink-2);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.affiliation-line[data-status="rumored"] .status-badge {
  color: var(--muted);
  border-style: dashed;
}

.fact dd.disclaimer {
  color: var(--muted);
  margin-top: 8px;
}

/* ---------- sources ---------- */

.sources {
  margin-top: 64px;
  border-top: 1px solid var(--grid);
  padding-top: 28px;
}

.source-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-list a {
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--rail);
  text-underline-offset: 3px;
}
.source-list a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.sources-note {
  font-size: 12px;
  color: var(--muted);
  max-width: 64ch;
  margin-top: 16px;
}

/* ---------- about page ---------- */

.about { max-width: 62ch; }

.about-section { margin-bottom: 32px; }

.about-section h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.about-section p {
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 10px;
}

.about-section a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer a {
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer a:hover { color: var(--ink); }

/* ---------- footer ---------- */

.site-footer {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--grid);
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 560px) {
  .site-header { flex-wrap: wrap; padding-top: 36px; }
  .person-header h1 { font-size: 30px; }
  .strip-labels span { font-size: 9px; }
}
