/* ET Bembo font faces */
@font-face {
  font-family: 'ET Bembo';
  src: url('fonts/ETBembo-RomanOSF.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'ET Bembo';
  src: url('fonts/ETBembo-DisplayItalic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'ET Bembo';
  src: url('fonts/ETBembo-SemiBoldOSF.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Lining figures version for tables */
@font-face {
  font-family: 'ET Bembo LF';
  src: url('fonts/ETBembo-RomanLF.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --font-body: 'ET Bembo', Palatino, 'Palatino Linotype', Georgia, serif;
  --font-sans: 'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
  --font-tabular: 'ET Bembo LF', 'ET Bembo', Georgia, serif;

  --text: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #888;
  --bg: #fff;
  --bg-secondary: #fafafa;
  --border: #e0e0e0;
  --accent: #c00;
  --highlight: #1a1a1a;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header - minimal */
header {
  padding: 3rem 0 1rem;
  border-bottom: 1px solid var(--text);
}

header .container {
  padding-top: 0;
  padding-bottom: 0;
}

h1 {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: 0.01em;
}

.subtitle {
  font-family: var(--font-body);
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-style: italic;
}

.subtitle a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.subtitle a:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

.byline {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.byline a {
  color: var(--text-secondary);
  text-decoration: none;
}

.byline a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Key stats - inline, Tufte sidenote style */
.stats-row {
  font-family: var(--font-sans);
  display: flex;
  gap: 2.5rem;
  margin: 1.5rem 0 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat strong {
  font-weight: 600;
  color: var(--text);
}

.stat .highlight {
  color: var(--accent);
  font-weight: 600;
}

/* Key finding - Tufte epigraph style */
.key-finding {
  margin: 2rem 0;
  padding-left: 1.5rem;
  border-left: 3px solid var(--text);
}

.key-finding p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.key-finding strong {
  color: var(--text);
}

/* Metrics guide */
.metrics-guide {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-secondary);
  border-left: 3px solid var(--border);
}

.metrics-guide h3 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.metrics-guide dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  font-size: 0.95rem;
}

.metrics-guide dt {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text);
  font-size: 0.85rem;
}

.metrics-guide dd {
  color: var(--text-secondary);
  margin: 0;
}

/* Section headers */
section {
  margin: 3rem 0;
}

h2 {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h2::after {
  content: '';
  display: block;
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-top: 0.4rem;
}

/* Tufte-style dot plot / lollipop chart container */
.chart-section {
  margin: 2.5rem 0;
}

.chart-section h3 {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.chart-section .chart-note {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.chart-wrapper {
  position: relative;
}

/* Rankings - compact, high density */
.rankings-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 3rem;
  margin: 2rem 0;
}

.ranking {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.ranking h3 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ranking-explainer {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.ranking ol {
  list-style: none;
  counter-reset: ranking;
}

.ranking li {
  font-family: var(--font-sans);
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  border-bottom: 1px dotted var(--border);
  counter-increment: ranking;
}

.ranking li::before {
  content: counter(ranking) ".";
  color: var(--text-muted);
  width: 1.5rem;
  flex-shrink: 0;
}

.ranking .name {
  flex: 1;
  color: var(--text);
}

.ranking .value {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 4rem;
}

.table-footnotes {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.table-footnotes p {
  margin: 0.15rem 0;
}

/* Tufte-style data table */
.data-table {
  font-family: var(--font-sans);
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin: 1rem 0;
}

.data-table thead {
  border-bottom: 2px solid var(--text);
}

.data-table th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.data-table th:hover {
  color: var(--text);
}

.data-table th.num {
  text-align: right;
}

.data-table th.sorted-asc::after {
  content: ' \2191';
}

.data-table th.sorted-desc::after {
  content: ' \2193';
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
  background: var(--bg-secondary);
}

.data-table td {
  padding: 0.5rem 0.75rem;
  color: var(--text);
}

.data-table td.num {
  font-family: var(--font-tabular);
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.data-table td.name {
  font-weight: 500;
}

.data-table .org {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.data-table .ai-company {
  color: var(--accent);
}

.data-table .gpt-word {
  font-size: 0.7rem;
  color: var(--accent);
  font-style: italic;
}

/* Speaker photos */
.speaker-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(100%);
  opacity: 0.85;
  vertical-align: middle;
  margin-right: 0.5rem;
  transition: filter 0.2s, opacity 0.2s;
}

.speaker-photo:hover {
  filter: grayscale(0%);
  opacity: 1;
}

.data-table td.name {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Sparklines */
.sparkline {
  display: inline-block;
  vertical-align: middle;
}

.sparkline svg {
  display: block;
}

.sparkline-bar {
  fill: var(--text-muted);
  transition: fill 0.15s;
}

.sparkline-bar.highlight {
  fill: var(--accent);
}

/* Dot plot with photos */
.dot-row .speaker-photo {
  width: 24px;
  height: 24px;
  margin-right: 0.4rem;
}

.dot-label-with-photo {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Rankings with photos */
.ranking li {
  align-items: center;
}

.ranking .speaker-photo {
  width: 22px;
  height: 22px;
  margin-right: 0.35rem;
}

.ranking .name {
  display: flex;
  align-items: center;
}

/* Dot plot - Tufte style */
.dot-plot {
  width: 100%;
}

.dot-row {
  display: flex;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px dotted #eee;
}

.dot-row:last-child {
  border-bottom: none;
}

.dot-label {
  font-family: var(--font-sans);
  width: 200px;
  font-size: 0.8rem;
  color: var(--text);
  flex-shrink: 0;
  text-align: right;
  padding-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.dot-track {
  flex: 1;
  height: 1px;
  background: #eee;
  position: relative;
}

.dot {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--text);
  border-radius: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.dot.highlight {
  background: var(--accent);
  width: 9px;
  height: 9px;
}

.dot-value {
  font-family: var(--font-tabular);
  width: 60px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-left: 1rem;
  font-variant-numeric: tabular-nums;
}

/* Scale markers */
.scale-row {
  font-family: var(--font-sans);
  display: flex;
  padding-left: 200px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.scale-row span {
  flex: 1;
}

.scale-row span:last-child {
  text-align: right;
  flex: 0;
}

/* Methodology note */
.methodology {
  margin: 3rem 0;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.methodology h3 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.methodology p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.methodology a {
  color: var(--text);
}

/* Footer */
footer {
  font-family: var(--font-sans);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 700px) {
  .rankings-section {
    grid-template-columns: 1fr;
  }

  .stats-row {
    flex-wrap: wrap;
    gap: 1rem 2rem;
  }

  .dot-label {
    width: 140px;
    font-size: 0.7rem;
  }

  .scale-row {
    padding-left: 140px;
  }

  .speaker-photo {
    width: 20px;
    height: 20px;
  }

  .data-table {
    font-size: 0.7rem;
  }

  .data-table .speaker-photo {
    width: 22px;
    height: 22px;
  }
}
