/* The front page: the public view of the search (js/pages/front.js). What this is, what is tested, how the search
   has moved, what is running. Ink and hairlines for everything said about the search; warm only on the panels,
   where it is their light. Tokens and type come from site.css. */

.page-front { padding-top: 8px; }
.front-hero { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 24px clamp(32px, 5vw, 88px); align-items: start; margin: 10px 0 0; }
.hero-eyebrow { color: var(--ink); margin: 6px 0 22px; display: flex; flex-wrap: wrap; gap: 2px 0; }
.hero-eyebrow span { white-space: nowrap; }
.hero-eyebrow span:not(:last-child)::after, .hero-place span::before, .tl-detail-kind span::before { content: "·"; margin: 0 0.7em; color: var(--ink-4); }
.front-title { font-size: clamp(27px, 2.7vw, 40px); line-height: 1.1; letter-spacing: -0.024em; font-weight: 300; margin: 0 0 24px; max-width: 24ch; text-wrap: balance; }
.front-lede { max-width: 46ch; margin: 0 0 0.75em; }
.front-lede + .front-jumps { margin-top: 1.4em; }
.front-jumps { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; font-family: var(--mono); font-size: 12.5px; }
.front-jumps button { background: none; border: 0; border-bottom: 1px solid var(--ink-4); padding: 3px 0; cursor: pointer; color: var(--ink); }
.front-jumps button::after { content: " ↓"; color: var(--ink-3); }
.front-jumps button:hover { border-bottom-color: var(--ink); }

/* Before the record arrives the statement stands alone, in the column it will keep. */
.page-front > .hero-words { max-width: 54%; margin-top: 10px; }
.hero-light { min-width: 0; }
.hero-plan { display: block; width: 100%; aspect-ratio: 536 / 472; }
.hero-caption { border-top: 1px solid var(--ink); padding-top: 8px; margin-top: 4px; min-height: 5.6em; }
.hero-place { color: var(--ink); margin: 0 0 3px; }
.hero-test { font-size: 18px; line-height: 1.25; margin: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.hero-scrub { position: relative; cursor: ew-resize; touch-action: pan-y; padding-bottom: 18px; outline-offset: 4px; }
.hero-strip { display: block; width: 100%; height: 54px; }
.hero-strip path { fill: none; stroke-width: 1.2; }
.strip-all { stroke: var(--ink-4); }
.strip-done { stroke: var(--ink); }
.strip-days, .tl-days { position: relative; height: 16px; font-size: 11px; color: var(--ink-3); }
.strip-days { position: absolute; left: 0; right: 0; bottom: 0; border-top: 1px solid var(--rule); }
.strip-days span, .tl-days span { position: absolute; top: 2px; white-space: nowrap; padding-left: 4px; border-left: 1px solid var(--rule); }
.hero-note { margin: 8px 0 0; max-width: 62ch; }

.front-counts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 28px; margin: clamp(36px, 5vw, 64px) 0 0; border-top: 1px solid var(--ink); padding-top: 12px; }
.front-counts div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.front-counts dd { font-family: var(--mono); font-weight: 300; font-size: clamp(24px, 2.6vw, 38px); line-height: 1.05; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.front-counts dt { font-family: var(--mono); font-size: 12px; line-height: 1.4; color: var(--ink-3); margin-top: 6px; }

.front-section { margin-top: clamp(64px, 8vw, 112px); border-top: 1px solid var(--ink); padding-top: 14px; scroll-margin-top: 12px; }
.front-head { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 8px 40px; align-items: baseline; margin-bottom: 30px; }
.front-head h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.05; letter-spacing: -0.018em; font-weight: 300; }
.front-head p { max-width: 64ch; color: var(--ink-2); margin: 0; }
.front-head > div { min-width: 0; }

/* The loop: five steps and the line that carries the last back to the first. */
.loop { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 26px; }
.loop-step { position: relative; border-top: 1px solid var(--ink); padding-top: 10px; }
.loop-step:not(:last-child)::after { content: "→"; position: absolute; top: -13px; right: -21px; font-family: var(--mono); font-size: 16px; line-height: 24px; background: var(--page); padding: 0 2px; }
.loop-n { color: var(--ink-3); margin: 0 0 6px; }
.loop-name { font-size: 24px; line-height: 1.1; letter-spacing: -0.012em; margin: 0 0 4px; }
.loop-figure { color: var(--ink); margin: 0 0 10px; }
.loop-text { font-size: 16px; line-height: 1.36; color: var(--ink-2); margin: 0; }
.loop-back { margin: 22px 0 0; height: 15px; border: 1px solid var(--ink); border-top: 0; text-align: center; position: relative; }
.loop-back::before { content: "↑"; position: absolute; left: -5.5px; top: -17px; font-size: 14px; line-height: 1; color: var(--ink); }
.loop-back span { position: relative; top: 5px; background: var(--page); padding: 0 10px; color: var(--ink-3); }

/* The rules and their settings: each rule drawn on the panels, each setting a bar from the lowest to the highest
   value tried. Ink for the bars; warm only on the panels. */
.rules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 30px; }
.rule { border-top: 1px solid var(--ink); padding-top: 10px; min-width: 0; }
.rule-name { margin: 0 0 8px; color: var(--ink); }
.rule-name span::before { content: "·"; margin: 0 0.7em; color: var(--ink-4); }
.rule-title { font-size: 24px; line-height: 1.14; letter-spacing: -0.012em; margin: 0 0 12px; min-height: 3.42em; text-wrap: balance; }
.rule-sketch { margin: 0 0 16px; }
.rule-plan { display: block; width: 100%; aspect-ratio: 536 / 552; }
.rule-reserve { display: flex; align-items: center; gap: 8px; height: 16px; margin-top: 2px; }
.rule-meter { flex: 1; height: 5px; border: 1px solid var(--ink); }
.rule-meter span { display: block; height: 100%; width: 100%; background: var(--ink); }
.rule-sketch figcaption { margin-top: 4px; min-height: 3em; color: var(--ink-2); }
.param { border-top: 1px solid var(--rule); }
.param summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; align-items: baseline; padding: 8px 0 7px; cursor: pointer; list-style: none; }
.param summary::-webkit-details-marker { display: none; }
.param summary:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.param-label { font-size: 17px; line-height: 1.25; }
.param-label::after { content: " +"; font-family: var(--mono); font-size: 12px; color: var(--ink-4); }
.param[open] .param-label::after { content: " −"; }
.param summary:hover .param-label::after { color: var(--ink); }
.param-mark { color: var(--ink-3); margin-left: 8px; font-size: 11px; vertical-align: 1px; }
.param-mark::before { content: "· "; }
.param-now { color: var(--ink); text-align: right; }
.param.is-out .param-now { color: var(--ink-3); }
/* A record of values, not a control: marks stand on a hairline axis; nothing sits on a track to be dragged. */
.param-bar { grid-column: 1 / -1; display: block; padding: 0 1px; height: 16px; margin-top: 2px; }
.param-track { position: relative; display: block; height: 100%; border-bottom: 1px solid var(--rule); }
.param-tick, .param-dot, .param-span { position: absolute; bottom: 0; display: block; }
.param-tick { width: 1px; height: 6px; margin-left: -0.5px; background: var(--ink-3); }
.param-dot { width: 2px; height: 15px; margin-left: -1px; background: var(--ink); }
.param-span { height: 15px; background: var(--rule); }
.param-ends { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--ink-3); font-size: 11px; line-height: 1.3; }
.param-what { font-size: 15px; line-height: 1.34; color: var(--ink-2); margin: 0 0 10px; }
.param-key { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 10px !important; color: var(--ink-2); }
.param-key span { display: inline-flex; align-items: center; gap: 7px; }
.param-key i { position: static; margin: 0; flex: none; }
.param-key .param-span { width: 18px; }
.param-key .param-dot { height: 13px; }
.param-walker { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }


/* The settings across every test: one row a setting, one column a test. */
.tl-wrap { display: grid; grid-template-columns: minmax(0, 8fr) minmax(260px, 4fr); gap: 24px 44px; align-items: start; }
.tl { --tl-label: 168px; --tl-value: 84px; cursor: crosshair; touch-action: pan-y; outline-offset: 6px; user-select: none; -webkit-user-select: none; }
.tl-row { display: grid; grid-template-columns: var(--tl-label) minmax(0, 1fr) var(--tl-value); gap: 0 12px; align-items: center; border-top: 1px solid var(--rule-soft); }
.tl-label { font-size: 15.5px; line-height: 1.15; padding: 3px 0; }
.tl-value { color: var(--ink); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-chart { position: relative; height: 28px; }
.tl-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tl-chart path { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.tl-row:not(.tl-axis) .tl-chart::after { content: ""; position: absolute; top: -1px; bottom: -1px; left: calc(var(--at, 1) * 100%); width: 1px; background: var(--ink); pointer-events: none; }
.tl-on .tl-chart { height: 15px; }
.tl-on .tl-chart path { stroke-width: 5; }
.tl-on .tl-label { font-size: 14px; color: var(--ink-2); padding: 0; }
.tl-measure .tl-chart path { stroke: var(--ink-3); }
.tl-axis { border-top: 0; }
.tl-axis .tl-label { color: var(--ink-3); font-size: 11px; }
.tl-days { height: 20px; }
.tl-days span { top: 4px; }
.tl-work { border-top: 1px solid var(--ink); }
.tl-blocks { height: 22px; }
.tl-block { position: absolute; top: 7px; height: 8px; background: var(--ink-4); }
.tl-block.is-odd { background: var(--ink-3); }
.tl-block.is-none { background: none; border-top: 1px dashed var(--ink-4); top: 11px; height: 0; }
.tl-block.is-now { background: var(--ink); top: 4px; height: 14px; }
.tl-group { margin: 0; padding: 16px 0 5px; color: var(--ink-3); border-top: 1px solid var(--rule-soft); }
.tl-group + .tl-row { border-top-color: var(--ink); }
.tl-detail { position: sticky; top: 16px; border-top: 1px solid var(--ink); padding-top: 10px; }
.tl-detail-kind { color: var(--ink); margin: 0 0 8px; }
.tl-detail-title { font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 10px; }
.tl-detail-changes { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 10px; color: var(--ink); }
.tl-detail-changes span:not(:last-child)::after { content: "·"; margin-left: 8px; color: var(--ink-4); }
.tl-detail-why { font-size: 17px; line-height: 1.36; margin: 0 0 14px; }
.tl-detail-rule { border-top: 1px solid var(--rule); padding-top: 9px; color: var(--ink-2); font-size: 15px; line-height: 1.36; }
.tl-detail-rule p { margin: 0 0 6px; }
.tl-detail-rule a { color: var(--ink); }
.tl-detail-learned { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7; overflow: hidden; }

/* Now: the standing work, the newest reading and decisions, and the newest runs. */
.fn-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px 56px; align-items: start; }
.fn-title { font-size: clamp(22px, 2.3vw, 30px); line-height: 1.16; letter-spacing: -0.012em; margin: 0 0 12px; }
.page-front .fn-why { font-size: 18px; line-height: 1.38; color: var(--ink); max-width: 58ch; margin: 0 0 18px; }
.fn-progress { max-width: 460px; margin: 0 0 12px; }
.fn-bar { height: 8px; border: 1px solid var(--ink); }
.fn-bar span { display: block; height: 100%; background: var(--ink); }
.fn-progress p { margin: 6px 0 0; color: var(--ink); }
.fn-side > div + div { margin-top: 26px; }
.fn-quote { font-size: 20px; line-height: 1.28; font-style: italic; margin: 0 0 6px; }
.fn-entries li { border-top: 1px solid var(--rule); padding: 8px 0; }
.fn-entries p { margin: 0; }
.fn-entry-why { font-size: 16px; line-height: 1.34; color: var(--ink-2); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.fn-latest { margin-top: 40px; }
.fn-runs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 18px 14px; margin-bottom: 14px; }
.fn-run { display: flex; flex-direction: column; gap: 1px; text-decoration: none; }
.fn-still { display: block; width: 100%; aspect-ratio: 536 / 472; }
.fn-run-crowd { font-size: 14px; line-height: 1.22; color: var(--ink-2); }
.fn-run-when { color: var(--ink-3); }
.fn-run:hover .ref { text-decoration: underline; }

.ways li { border-top: 1px solid var(--rule); }
.ways li:first-child { border-top: 0; }
.ways a { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 2px 40px; align-items: baseline; padding: 12px 0; text-decoration: none; }
.way-name { font-size: 24px; letter-spacing: -0.012em; }
.way-name::after { content: " →"; color: var(--ink-4); font-family: var(--mono); font-size: 16px; }
.way-text { color: var(--ink-2); }
.ways a:hover .way-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.ways a:hover .way-name::after { color: var(--ink); }

@media (max-width: 1180px) {
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-title { min-height: 0; }
  .fn-runs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  /* One column, and the light comes straight after the statement, so the first screen holds both. */
  .front-hero { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .page-front > .hero-words { max-width: none; }
  .front-hero .hero-words { display: contents; }
  .hero-eyebrow { order: 1; margin-bottom: 14px; }
  .front-title { order: 2; max-width: 20ch; }
  .hero-light { order: 3; max-width: 560px; margin-bottom: 28px; }
  .front-lede { order: 4; }
  .front-jumps { order: 6; }
  .front-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .front-head, .ways a { grid-template-columns: minmax(0, 1fr); }
  .loop { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .loop-step { padding: 10px 0 22px 34px; }
  .loop-step .loop-n { position: absolute; left: 0; top: 13px; }
  .rule-sketch { max-width: 320px; }
  .rule-sketch figcaption { min-height: 0; }
  .loop-step:not(:last-child)::after { content: "↓"; top: auto; bottom: 2px; right: auto; left: -2px; padding: 0; }
  .loop-back { border: 0; height: auto; text-align: left; margin-top: 0; padding-left: 34px; }
  .loop-back::before { left: 0; top: 2px; }
  .loop-back span { top: 0; padding: 0; }
  .tl-wrap, .fn-grid { grid-template-columns: minmax(0, 1fr); }
  /* The words about a test go above the lines, where a thumb on the lines does not cover them. */
  .tl-detail { position: static; order: -1; min-height: 12.5em; }
  .tl-detail-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  .tl-detail-why { font-size: 16px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; margin-bottom: 0; }
  .tl-detail-rule { display: none; }
}
@media (max-width: 640px) {
  .hero-eyebrow span:nth-last-child(2)::after { content: none; }
  .hero-eyebrow span:last-child { flex-basis: 100%; }
  .front-title { margin-bottom: 18px; }
  .front-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules { grid-template-columns: minmax(0, 1fr); }
  .tl { --tl-label: 96px; --tl-value: 54px; }
  .tl-days span:not(:nth-child(3n + 1)) { display: none; }
  .tl-row { gap: 0 8px; }
  .tl-label { font-size: 13.5px; }
  .tl-on .tl-label { font-size: 12.5px; }
  .tl-value { font-size: 11px; }
  .tl-chart { height: 26px; }
  .fn-runs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .front-jumps button { transition: none; }
}

/* A reference inside a line of small mono type is that line's size, not smaller still. */
.page-front .mono-small .ref, .page-front .mono-line .ref { font-size: 1em; }
