/* Homepage data explorers. Shared navigation and typography live in styles.css. */
.home-main { --chart-surface: #eef3f8; }

/* Upright, single-color title and a consistent set of resource buttons. */
.home-intro { padding: 58px 0 44px; }
.home-intro::before { content: ''; display: block; width: 54px; height: 5px; border-radius: 3px; background: var(--accent); margin-bottom: 22px; }
.home-intro h1 { font: 800 clamp(2.7rem,5.2vw,4.4rem)/1.12 var(--display); letter-spacing: -.05em; margin: 0 0 22px; max-width: none; }
.home-intro h1 span { font-style: normal; color: inherit; }
.home-deck { font-size: 1.14rem; line-height: 1.65; color: #45546a; }
.home-byline { font-size: .85rem; font-weight: 600; color: var(--ink); margin-top: 22px; }
.home-actions { margin-top: 24px; gap: 12px; }
.home-actions .button { min-height: 48px; gap: 10px; padding: 12px 16px; border-radius: 9px; font-size: .85rem; transition: background .18s, border-color .18s, box-shadow .18s; }
.home-actions .button .button-label { color: inherit; }
.home-actions .resource-button { background: #fff; color: var(--ink); border: 1px solid #cbd5e1; box-shadow: 0 2px 3px #15233704; }
.home-actions .resource-button:hover { background: #f0f4f8; border-color: #93a5ba; box-shadow: 0 3px 8px #1523370a; }
.home-actions .button:focus-visible { outline: 3px solid #315dcc; outline-offset: 3px; }
.action-icon { width: 20px; height: 20px; flex: 0 0 20px; }
.action-arrow { width: 16px; height: 16px; flex: 0 0 16px; margin-left: 4px; color: #6c7c91; }
.primary .action-arrow { color: #b9c9dc; }

.data-section { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px 30px 24px; margin-bottom: 30px; box-shadow: 0 8px 28px #23354d06; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; margin-bottom: 24px; }
.section-heading h2 { font-size: 1.75rem; font-weight: 750; }
.section-heading p { color: var(--muted); font-size: .9rem; margin-top: 9px; }
.section-heading > a { flex-shrink: 0; font-size: .82rem; }
.chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 22px; }
.chart-switch { display: flex; flex-wrap: wrap; padding: 4px; gap: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f1f5f9; }
.chart-switch button { border: 0; border-radius: 6px; background: transparent; padding: 8px 17px; font-size: .82rem; font-weight: 550; color: var(--muted); }
.chart-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: 0 2px 4px #1523371a; }
.chart-switch button:hover:not([aria-pressed="true"]) { background: #e4ecf4; color: var(--ink); }
.quiet-button { border: 0; background: transparent; font-size: .8rem; font-weight: 550; color: var(--muted); padding: 6px 0; }
.quiet-button:hover { color: var(--green); }
.quiet-button span { margin-left: 12px; }
.composition-chart { display: grid; grid-template-columns: minmax(260px,.85fr) minmax(0,1.5fr); gap: 38px; align-items: center; min-height: 402px; padding: 12px 0 25px; }
.donut-column { text-align: center; min-width: 0; }
.donut-wrap { position: relative; width: 100%; max-width: 360px; margin: auto; aspect-ratio: 1; }
.donut-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.donut-wrap path { cursor: pointer; transition: transform .22s ease, opacity .2s ease; }
.donut-wrap path:focus-visible { outline: none; stroke: var(--ink); stroke-width: 2.5; }
.donut-wrap .has-active path:not(.is-active) { opacity: .22; }
.donut-center { position: absolute; inset: 24%; display: flex; justify-content: center; align-items: center; flex-direction: column; pointer-events: none; line-height: 1.3; }
#composition-number { font: 750 3.5rem/1.15 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
#composition-unit { font-size: .85rem; color: var(--muted); margin-top: 5px; }
#composition-share { font-size: .78rem; color: var(--muted); margin-top: 10px; }
.composition-detail { font-size: .83rem; min-height: 2.8em; max-width: 340px; margin: 6px auto 0; line-height: 1.4; }
#composition-reset { font-size: .76rem; min-height: 28px; }
#composition-reset:disabled { visibility: hidden; }
.composition-legend { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px 20px; }
.composition-item { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: start; gap: 9px; width: 100%; text-align: left; padding: 12px 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; transition: background .18s, border-color .18s; }
.composition-item:hover,.composition-item.is-active { background: var(--chart-surface); }
.composition-item[aria-pressed="true"] { border-color: var(--category); }
.category-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--category); margin-top: 7px; }
.category-name { min-width: 0; font-size: .88rem; font-weight: 550; line-height: 1.45; }
.category-name small { display: block; font-size: .74rem; font-weight: 450; color: var(--muted); min-height: 1.45em; margin-top: 3px; }
.category-track { display: block; height: 3px; width: 100%; background: #edf1f6; border-radius: 2px; margin-top: 9px; }
.category-track i { height: 100%; display: block; background: var(--category); }
.category-value { font-size: .98rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; line-height: 1.5; }
.category-value small { display: block; font-size: .74rem; font-weight: 450; color: var(--muted); padding-top: 3px; }
.chart-footer { display: flex; justify-content: space-between; gap: 12px 30px; border-top: 1px solid var(--line); padding-top: 15px; color: var(--muted); font-size: .76rem; }
.chart-footer > span { flex-shrink: 0; }
.composition-table { overflow-x: auto; padding-bottom: 20px; }
.composition-table table { width: 100%; min-width: 0; border-collapse: collapse; font-size: .82rem; }
.composition-table caption { text-align: left; padding: 8px 0 14px; color: var(--muted); }
.composition-table th,.composition-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 400; white-space: normal; }
.composition-table th:first-child { text-align: left; }
.composition-table td,.composition-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.composition-table thead,.composition-table tfoot { background: var(--chart-surface); }
.performance-section { padding-top: 34px; }
.performance-toolbar { gap: 18px; }
.harness-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.harness-chips button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid transparent; border-radius: 4px; background: transparent; font-size: .76rem; font-weight: 500; color: var(--muted); }
.harness-chips button[aria-pressed="true"] { background: var(--chart-surface); border-color: var(--line); color: var(--ink); }
.harness-chips button:hover { color: var(--ink); }
.harness-chips i { width: 7px; height: 7px; border-radius: 50%; }
.performance-layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 28px; align-items: start; padding-bottom: 24px; }
.ranking-panel { min-width: 0; }
.ranking-axis { display: flex; justify-content: space-between; gap: 10px; font-size: .75rem; color: var(--muted); padding: 0 10px 14px; }
.ranking-axis > span:last-child { white-space: nowrap; }
.ranking-row { width: 100%; display: grid; grid-template-columns: 22px minmax(140px,1.15fr) minmax(55px,1fr) 48px; align-items: center; gap: 10px; padding: 11px 10px; border: 1px solid transparent; border-bottom-color: #e7edf3; border-radius: 6px; background: transparent; text-align: left; }
.ranking-row:hover { background: var(--chart-surface); }
.ranking-row[aria-pressed="true"] { background: #edf3fb; border-color: #cedcf0; box-shadow: inset 3px 0 var(--agent-color); }
.ranking-position { font: .7rem var(--mono); color: var(--muted); }
.ranking-model { font-size: .86rem; font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; }
.ranking-model small { display: block; color: var(--muted); font-size: .73rem; font-weight: 450; }
.ranking-bar { height: 8px; position: relative; background: #e7edf3; border-radius: 3px; }
.ranking-bar > i { position: absolute; height: 100%; border-radius: 3px; background: var(--agent-color); transition: width .3s, left .3s; }
.gain-bar { background: transparent; }
.gain-bar:before { content: ''; position: absolute; top: -6px; bottom: -6px; left: 11.7647%; width: 1px; background: #8e9eb2; }
.ranking-bar .negative-bar { background: #aa5946; }
.ranking-value { font-size: .96rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ranking-value small { font-size: .72rem; font-weight: 450; margin-left: 2px; color: var(--muted); }
.ranking-expand { margin: 15px 10px 0; }
.agent-detail { background: #17283f; color: #fff; border-radius: 12px; padding: 25px 26px; min-width: 0; border-top: 4px solid var(--agent-highlight); box-shadow: 0 12px 26px #17283f18; }
.agent-harness { font-size: .8rem; font-weight: 550; color: var(--agent-highlight); margin-bottom: 8px; }
.agent-detail h3 { font: 700 1.65rem/1.3 var(--display); overflow-wrap: anywhere; }
.agent-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 23px 0 25px; }
.agent-metrics > div > span { font: 750 clamp(2rem,3.5vw,3rem)/1.3 var(--display); white-space: nowrap; letter-spacing: -.035em; }
.agent-metrics p { font-size: .76rem; color: #c0cede; margin-top: 3px; }
#agent-gain { font-size: clamp(1.3rem,2.3vw,2rem); color: var(--agent-highlight); }
#agent-gain.is-negative { color: #ffb49d; }
.is-negative { color: #a13f2a; }
.progression-heading { border-top: 1px solid #3b4b60; padding-top: 20px; }
.progression-heading h4 { font-size: .86rem; font-weight: 600; }
.trial-legend { display: flex; gap: 16px; font-size: .75rem; color: #c0cede; margin-top: 8px; }
.trial-legend > span { display: flex; gap: 5px; align-items: center; }
.trial-legend i { width: 8px; height: 8px; }
.trial-one { background: #73869f; }
.trial-two { background: var(--agent-highlight); }
.agent-levels { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin-top: 22px; }
.level-comparison { position: relative; text-align: center; cursor: help; }
.level-values { display: block; font-size: .75rem; font-variant-numeric: tabular-nums; margin-bottom: 7px; }
.level-columns { height: 112px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-bottom: 1px solid #53657d; }
.level-columns i { width: 17px; max-width: 42%; display: block; border-radius: 2px 2px 0 0; transition: height .3s ease; }
.level-before { background: #73869f; }
.level-after { background: var(--agent-highlight); }
.level-label { display: block; font-size: .76rem; color: #c0cede; margin-top: 7px; }
.level-tooltip { position: absolute; z-index: 2; bottom: 40%; left: 50%; transform: translateX(-50%); padding: 7px 9px; background: #fff; color: var(--ink); border-radius: 6px; white-space: nowrap; font-size: .75rem; pointer-events: none; opacity: 0; transition: opacity .15s; }
.level-comparison:hover .level-tooltip,.level-comparison:focus .level-tooltip { opacity: 1; }
.level-comparison:first-child .level-tooltip { left: 0; transform: none; }
.level-comparison:last-child .level-tooltip { left: auto; right: 0; transform: none; }
.agent-full-tasks { border-top: 1px solid #3b4b60; margin-top: 22px; padding-top: 15px; font-size: .78rem; color: #c0cede; }
.agent-full-tasks strong { color: #fff; font-size: 1.2rem; font-weight: 650; margin-right: 4px; }
.agent-full-tasks strong span { font-size: .8rem; color: #c0cede; }
.full-task-before { display: block; font-size: .76rem; margin-top: 3px; }
.home-footnote { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 12px 0 36px; color: var(--muted); font-size: .8rem; }
.home-footnote a { font-size: .8rem; }
.chart-fallback { font-size: .9rem; color: var(--muted); padding: 15px 0; }
@media (max-width: 1100px) {
  .composition-chart { gap: 24px; grid-template-columns: minmax(240px,.85fr) minmax(0,1.5fr); }
  .composition-legend { gap: 2px 8px; }
  .performance-layout { gap: 22px; }
  .ranking-row { gap: 7px; grid-template-columns: 20px minmax(120px,1.2fr) minmax(35px,1fr) 44px; }
  .agent-detail { padding: 23px 20px; }
}
@media (max-width: 800px) {
  .composition-chart { grid-template-columns: minmax(220px,.85fr) minmax(0,1fr); align-items: start; }
  .composition-legend { grid-template-columns: 1fr; }
  .donut-column { position: sticky; top: 100px; }
  .performance-layout { grid-template-columns: 1fr; gap: 25px; }
  .agent-detail { max-width: none; }
  .agent-levels { gap: 22px; }
  .agent-levels .level-columns i { width: 30px; }
  .level-columns { height: 145px; }
}
@media (max-width: 600px) {
  .data-section { padding: 22px 16px 20px; border-radius: 12px; margin-bottom: 22px; }
  .section-heading { flex-wrap: wrap; gap: 12px; }
  .section-heading h2 { font-size: 1.4rem; }
  .section-heading p { font-size: .8rem; }
  .section-heading > a { font-size: .8rem; }
  .chart-toolbar { gap: 10px; padding-bottom: 10px; }
  .chart-switch { padding: 3px; gap: 0; }
  .chart-switch button { padding: 7px 10px; font-size: .78rem; }
  .quiet-button { font-size: .76rem; }
  .quiet-button span { margin-left: 5px; }
  .composition-chart { display: block; padding-top: 0; }
  .donut-column { position: static; }
  .donut-wrap { max-width: 300px; }
  #composition-number { font-size: 3rem; }
  .composition-detail { font-size: .8rem; }
  .composition-legend { grid-template-columns: 1fr; gap: 3px; margin-top: 12px; }
  .composition-item { padding: 10px 5px; grid-template-columns: 8px minmax(0,1fr) auto; gap: 9px; }
  .category-name { font-size: .85rem; }
  .category-name small { font-size: .75rem; }
  .category-value { font-size: .95rem; }
  .category-value small { font-size: .75rem; }
  .category-dot { width: 6px; height: 6px; margin-top: 5px; }
  .chart-footer { flex-wrap: wrap; gap: 6px; font-size: .75rem; }
  .chart-footer > span { flex-shrink: 1; }
  .performance-toolbar { gap: 15px; padding-bottom: 20px; }
  .harness-chips { gap: 4px; }
  .harness-chips button { font-size: .75rem; padding: 6px 8px; }
  .ranking-row { grid-template-columns: 19px minmax(110px,1.3fr) minmax(25px,1fr) 41px; padding: 9px 5px; gap: 6px; }
  .ranking-model { font-size: .83rem; }
  .ranking-value { font-size: .9rem; }
  .ranking-axis { font-size: .72rem; padding-inline: 5px; }
  .agent-detail h3 { font-size: 1.45rem; }
  .agent-metrics { gap: 12px; }
  .agent-levels { gap: 9px; }
  .home-footnote { flex-wrap: wrap; gap: 10px; font-size: .76rem; }
  .composition-table table { font-size: .78rem; }
  .composition-table th,.composition-table td { padding: 9px 5px; }
}
@media (max-width: 360px) {
  .composition-legend { grid-template-columns: 1fr; }
  .ranking-row { grid-template-columns: 16px minmax(104px,1fr) minmax(15px,.5fr) 39px; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-main *, .home-main *::before { transition: none !important; }
}
@media print {
  .chart-toolbar,.ranking-expand,#composition-reset { display: none; }
  .donut-column { position: static; }
  .data-section { break-inside: avoid; }
}

@media (max-width: 600px) {
  .home-intro { padding: 34px 0 32px; }
  .home-intro::before { margin-bottom: 18px; width: 40px; height: 4px; }
  .home-intro h1 { font-size: clamp(2.5rem,10.5vw,3.6rem); margin: 0 0 20px; line-height: 1.12; }
  .home-deck { font-size: 1rem; }
  .home-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .home-actions .primary { grid-column: 1 / -1; }
  .home-actions .button { justify-content: center; text-align: center; padding: 11px 10px; font-size: .8rem; gap: 8px; }
  .action-icon { width: 18px; height: 18px; flex-basis: 18px; }
  .action-arrow { display: none; }
  .ranking-row { grid-template-columns: 16px minmax(0,1fr) 45px; gap: 8px; padding: 12px 7px; }
  .ranking-bar { grid-column: 2; grid-row: 2; }
  .ranking-value { grid-column: 3; grid-row: 1 / 3; }
  .ranking-axis { flex-wrap: wrap; }
  .agent-detail { padding: 22px 16px; }
  .agent-levels { gap: 6px; }
  .agent-metrics { grid-template-columns: 1.1fr 1fr; }
  .agent-metrics > div > span { font-size: 2rem; }
  #agent-gain { font-size: 1.4rem; }
  .level-values { font-size: .7rem; }
}
@media print {
  .data-section { box-shadow: none; }
  .agent-detail { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
