/* Data Collection Visuals — usf.ac/collect. USF.ac colors: black, blue, grey, white. */
:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: #d2d2d7;
  --hairline: #e8e8ed;
  --panel: #f5f5f7;
  --surface: #ffffff;
  --blue: #0071e3;
  --blue-dark: #0058b0;
  --blue-soft: #e8f1fc;
  /* Interval methods: validated as a set for color-vision deficiency (dataviz validator, light surface). */
  --pir: #0071e3;
  --wir: #b8457a;
  --mts: #6b7d1e;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI Variable Text", "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { background: var(--panel); scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; color: var(--ink); background: var(--panel); font-family: var(--font); font-size: 17px; line-height: 1.5; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; }
a { color: #0066cc; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 8px 14px; border-radius: 8px; background: var(--ink); color: #fff; }
.skip-link:focus { top: 12px; }
.wrap { width: min(100% - 32px, 1120px); margin: 0 auto; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(245, 245, 247, .88); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid rgba(0, 0, 0, .07); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 650; white-space: nowrap; }
.wordmark a { color: inherit; text-decoration: none; }
.wordmark > a { display: inline-flex; align-items: center; }
.wordmark small { overflow: hidden; color: var(--muted); font-size: 15px; font-weight: 600; text-overflow: ellipsis; }
.wordmark small a:hover { text-decoration: underline; }
.top nav { display: flex; gap: 4px; margin-left: auto; }
.top nav a { padding: 6px 12px; border-radius: 999px; color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.top nav a:hover { background: rgba(0, 0, 0, .06); }
@media (max-width: 640px) { .top nav { display: none; } }

/* Intro */
.intro { padding: 56px 0 8px; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(38px, 6vw, 64px); font-weight: 750; line-height: 1.03; letter-spacing: -0.045em; }
.lede { max-width: 700px; margin: 18px 0 0; color: var(--muted); font-size: clamp(18px, 2vw, 21px); line-height: 1.45; }

/* Tool sections */
.tool { padding: 56px 0 8px; }
.tool-head { max-width: 760px; margin-bottom: 22px; }
h2 { margin: 0; font-size: clamp(28px, 3.4vw, 40px); font-weight: 720; line-height: 1.1; letter-spacing: -0.035em; }
.tool-head > p:not(.eyebrow) { margin: 12px 0 0; color: var(--muted); font-size: 18px; }
h3 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.card { padding: 20px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 1px rgba(0, 0, 0, .05), 0 12px 40px rgba(0, 0, 0, .06); }

/* Controls */
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 22px; margin-bottom: 16px; }
.field { display: grid; gap: 6px; }
.field > span { color: var(--muted); font-size: 13px; font-weight: 600; }
select { min-height: 40px; padding: 6px 34px 6px 12px; border: 1px solid #8e8e93; border-radius: 10px; color: var(--ink); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231d1d1f' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; font: inherit; font-size: 15px; appearance: none; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.toolbar-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.btn { min-height: 40px; padding: 8px 16px; border: 0; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn.ghost { color: var(--ink); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover:not(:disabled) { background: #ebebf0; }
.btn.ghost[aria-pressed="true"] { color: #fff; background: var(--ink); box-shadow: none; }
.btn.primary { color: #fff; background: var(--blue); }
.btn.primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn:disabled { opacity: .45; cursor: default; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel); }
.seg button { min-height: 34px; padding: 6px 12px; border: 0; border-radius: 9px; color: var(--ink); background: transparent; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.seg button:hover { background: rgba(0, 0, 0, .05); }
.seg button[aria-pressed="true"] { color: #fff; background: var(--ink); }
.seg button:disabled { opacity: .45; cursor: default; }

/* Cumulative recorder */
.paper { position: relative; height: clamp(340px, 46vw, 480px); overflow: hidden; background: #fff; border-top: 1px solid var(--hairline); cursor: pointer; touch-action: manipulation; }
.paper canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.paper-hint { position: absolute; left: 50%; top: 42%; margin: 0; padding: 8px 16px; border-radius: 999px; color: var(--muted); background: rgba(255, 255, 255, .9); font-size: 15px; transform: translate(-50%, -50%); pointer-events: none; box-shadow: 0 0 0 1px var(--hairline); }
.respond-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 16px; }
.respond { display: grid; place-items: center; gap: 2px; min-width: 200px; min-height: 76px; padding: 12px 28px; border: 0; border-radius: 18px; color: #fff; background: var(--ink); font: inherit; cursor: pointer; box-shadow: 0 4px 0 #000, 0 10px 24px rgba(0, 0, 0, .18); transition: transform .06s ease, box-shadow .06s ease, background .3s ease; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.respond span { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.respond small { color: #a1a1a6; font-size: 12px; }
.respond:active, .respond.is-down { transform: translateY(3px); box-shadow: 0 1px 0 #000, 0 4px 12px rgba(0, 0, 0, .18); }
.recorder.is-reinforced .respond { background: var(--blue); box-shadow: 0 4px 0 var(--blue-dark), 0 10px 24px rgba(0, 113, 227, .35); }
.readout { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; }
.readout div { min-width: 86px; }
.readout dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.readout dd { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.readout dd small { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.status { min-height: 1.5em; margin: 12px 0 0; color: var(--muted); font-size: 14px; }

/* Interval sampler */
.live-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 12px; }
.hold { display: grid; gap: 1px; min-height: 52px; padding: 8px 20px; border: 0; border-radius: 14px; color: #fff; background: var(--ink); font: inherit; text-align: left; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; }
.hold span { font-size: 16px; font-weight: 650; }
.hold small { color: #a1a1a6; font-size: 12px; }
.hold.is-down { background: var(--blue); }
.hold:disabled { opacity: .35; cursor: default; }
.live-status { flex: 1 1 240px; margin: 0; color: var(--muted); font-size: 14px; }
.timeline-wrap { overflow-x: auto; }
.timeline { display: block; width: 100%; min-width: 640px; height: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.timeline text { font-family: var(--font); }
.timeline .track-hit { cursor: crosshair; }
.timeline .bout { cursor: pointer; }
.results { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--hairline); }
.results h3 { margin-bottom: 12px; font-size: 16px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) 128px; align-items: center; gap: 12px; font-size: 15px; }
.bar-row .name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.bar-track { position: relative; height: 22px; border-radius: 6px; background: var(--panel); }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--c, var(--ink)); transition: width .35s ease; }
.bar-true { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px dashed var(--ink); }
.bar-row .val { font-variant-numeric: tabular-nums; }
.bar-row .val small { color: var(--muted); font-size: 13px; }
.verdict { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
@media (max-width: 640px) {
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .respond { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .bar-fill, .respond { transition: none; } }

/* Legend keys */
.key { display: inline-block; flex: none; width: 14px; height: 14px; margin-right: 8px; border-radius: 4px; vertical-align: -2px; background: var(--c); }
.key-true { --c: var(--ink); }
.key-pir { --c: var(--pir); }
.key-wir { --c: var(--wir); }
.key-mts { --c: var(--mts); }

/* Teaching notes */
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.notes > div { padding: 22px 24px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 1px rgba(0, 0, 0, .05); }
.notes ul { margin: 10px 0 0; padding: 0; list-style: none; }
.notes li { padding: 8px 0; border-top: 1px solid var(--hairline); color: #3a3a3c; font-size: 15px; line-height: 1.5; }
.notes li:first-child { border-top: 0; }
@media (max-width: 760px) { .notes { grid-template-columns: 1fr; } }

.foot { padding: 56px 0 48px; color: var(--muted); font-size: 14px; }
.foot p { margin: 0; }
