/* Single-page site for the 2008 paper. Light and dark colours are defined once here;
   the inline SVG figures and chart.js refer to them through classes and variables. */

:root {
    color-scheme: light dark;
    --surface: #ffffff;
    --ink: #191919;
    --ink-2: #666666;
    --grid: #e7e7e7;
    --axis: #c2c2c2;
    --border: rgba(11, 11, 11, 0.10);
    --link: #1b64be;
    --centre: #257de0;
    --wing: #f47230;
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface: #191919;
        --ink: #efefef;
        --ink-2: #9c9c9c;
        --grid: #303030;
        --axis: #474747;
        --border: rgba(255, 255, 255, 0.10);
        --link: #6aabf1;
        --centre: #338ced;
        --wing: #e76624;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
    overflow-wrap: break-word;
}

main {
    max-width: 42rem;
    margin: 0 auto;
    padding: 3rem 1.25rem 2rem;
}

a {
    color: var(--link);
}

h1 {
    font-size: 1.6rem;
    line-height: 1.25;
    font-weight: 650;
    margin: 0 0 0.75rem;
}

h2 {
    font-size: 1.15rem;
    margin: 2.75rem 0 0.5rem;
}

.links {
    color: var(--ink-2);
    margin: 0 0 0.25rem;
}

.lead {
    margin-top: 2rem;
}

ul {
    padding-left: 1.25rem;
}

li + li {
    margin-top: 0.4rem;
}

/* Formulas: one per line, set in from the text. Subscripts do not widen the line spacing. */
.formula {
    margin: 1rem 0 1rem 1.25rem;
}

sub {
    line-height: 0;
}

/* Figures */

figure {
    margin: 2rem 0;
}

figcaption,
table caption {
    font-size: 0.875rem;
    color: var(--ink-2);
    margin-top: 0.6rem;
    text-align: left;
}

svg text {
    font-family: inherit;
}

.pitch {
    display: block;
    width: 100%;
    height: auto;
}

.pitch-half {
    max-width: 27rem;
}

.pitch-mark {
    fill: none;
    stroke: var(--axis);
    stroke-width: 0.3;
}

.zone-line {
    stroke: var(--ink-2);
    stroke-width: 0.3;
}

.zone-num {
    fill: var(--ink);
    font-size: 3.2px;
    font-weight: 600;
    text-anchor: middle;
}

.pitch-label {
    fill: var(--ink-2);
    font-size: 2.6px;
}

.pitch-half .zone-num {
    font-size: 2.4px;
}

.pitch-half .pitch-label {
    font-size: 1.6px;
}

/* On a phone the pitches are drawn small, so their labels get larger relative to them. */
@media (max-width: 30rem) {
    .pitch-full .zone-num {
        font-size: 4.2px;
    }

    .pitch-full .pitch-label {
        font-size: 3.4px;
    }

    .pitch-half .zone-num {
        font-size: 2.9px;
    }

    .pitch-half .pitch-label {
        font-size: 2px;
    }

    .pitch-half .value-label {
        font-size: 2.3px;
    }

    /* Only slightly larger: this text sits in boxes of fixed width (Figure 7). */
    .pitch-half .option-text {
        font-size: 2.05px;
    }
}

.arrow {
    stroke: var(--ink);
    stroke-width: 0.35;
}

.arrow-head,
.passer {
    fill: var(--ink);
}

/* Options one pass further on: drawn faintly, arrowheads included. */
.faint {
    opacity: 0.3;
}

/* Figure 4: the receivers' options fade in and out in turn, starting hidden. Readers whose system
   asks for reduced motion see them faint all the time. */
@media (prefers-reduced-motion: no-preference) {
    .fade-in-out {
        animation: fade-in-out 7s ease-in-out infinite;
    }
}

@keyframes fade-in-out {
    0%, 40% {
        opacity: 0;
    }

    47%, 90% {
        opacity: 0.3;
    }

    97%, 100% {
        opacity: 0;
    }
}

.option-box {
    fill: var(--surface);
    stroke: var(--ink-2);
    stroke-width: 0.2;
}

.option-text {
    fill: var(--ink);
    font-size: 1.9px;
    text-anchor: middle;
}

.value-label {
    fill: var(--ink);
    font-size: 1.9px;
}

.option-text .num,
.value-label .num {
    font-weight: 650;
}

/* Symbols in the pitch figures: an italic p, and subscripts drawn smaller and lowered with dy. */
.sym {
    font-style: italic;
}

.sub {
    font-size: 75%;
}

.opponent {
    fill: var(--surface);
    stroke: var(--ink);
    stroke-width: 0.3;
}

.connector {
    stroke: var(--ink-2);
    stroke-width: 0.2;
    stroke-dasharray: 0.6 0.6;
}

/* Value-by-zone chart (drawn by chart.js) */

.chart-title {
    font-size: 0.875rem;
    color: var(--ink);
    margin: 0 0 0.4rem;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 1.1rem;
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    color: var(--ink-2);
}

.legend li + li {
    margin-top: 0;
}

.key {
    width: 24px;
    height: 10px;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.key-dot {
    width: 10px;
}

.key .opponent {
    stroke-width: 1.2;
}

.chart {
    position: relative;
}

.chart > svg {
    display: block;
    width: 100%;
}

.chart > svg:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 4px;
}

.series {
    fill: none;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.line-centre {
    stroke: var(--centre);
}

.line-wing {
    stroke: var(--wing);
}

.ghost {
    stroke-width: 1.25;
    opacity: 0.25;
}

.dashed {
    stroke-dasharray: 4 5;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.4rem 0 0;
    font-size: 0.8125rem;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

.chart-controls[hidden] {
    display: none;
}

.chart-controls button {
    font: inherit;
    color: var(--link);
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.15rem 0.7rem;
    cursor: pointer;
}

.dot {
    stroke: var(--surface);
    stroke-width: 2;
}

.dot-centre {
    fill: var(--centre);
}

.dot-wing {
    fill: var(--wing);
}

.grid {
    stroke: var(--grid);
    stroke-width: 1;
}

.axis {
    stroke: var(--axis);
    stroke-width: 1;
}

.crosshair {
    stroke: var(--axis);
    stroke-width: 1;
}

.leader {
    stroke: var(--ink-2);
    stroke-width: 1;
}

.tick {
    fill: var(--ink-2);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.tick-note {
    fill: var(--ink-2);
    font-size: 11px;
}

.end-label {
    font-size: 12px;
}

.end-value {
    fill: var(--ink);
    font-weight: 600;
}

.end-name {
    fill: var(--ink-2);
}

.hit {
    fill: transparent;
}

.tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    padding: 0.4rem 0.6rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    white-space: nowrap;
}

.tooltip[hidden] {
    display: none;
}

.tip-head {
    color: var(--ink-2);
    margin-bottom: 0.15rem;
}

.tip-value {
    display: inline-block;
    min-width: 2.2em;
    margin-right: 0.4rem;
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.tip-name {
    color: var(--ink-2);
}

/* Tables */

table {
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9375rem;
}

table caption {
    caption-side: bottom;
}

th,
td {
    padding: 0.35rem 0.75rem 0.35rem 0;
    border-bottom: 1px solid var(--grid);
    text-align: left;
}

thead th {
    border-bottom-color: var(--axis);
    font-weight: 600;
}

td.num,
th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* References */

.refs {
    list-style: none;
    padding: 0;
    font-size: 0.9375rem;
}

footer {
    max-width: 42rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    border-top: 1px solid var(--grid);
    font-size: 0.8125rem;
    color: var(--ink-2);
}
