/* Warm plaster, walnut, ochre. A small grid for a personal archive. */
:root {
  --ink: #30362e;
  --muted: #66685a;
  --paper: #f1eee4;
  --line: #c9c8b9;
  --accent: #a44424;
  --olive: #77774d;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  line-height: 1.7;
  display: grid;
  grid-template-columns: 210px minmax(0, 930px);
  column-gap: 66px;
  max-width: 1350px;
  padding: 68px 48px 0;
  margin-inline: auto;
  min-height: 100vh;
  align-content: start;
}
a { color: inherit; text-underline-offset: 5px; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
.site-header { grid-row: 1 / 3; border-right: 1px solid var(--line); padding-right: 28px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 25px; text-decoration: none; font-family: var(--sans); font-weight: 500; font-size: 26px; line-height: 1.05; letter-spacing: -.7px; }
nav { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; margin-top: 67px; }
nav a { font-size: 14px; text-decoration: none; padding: 4px 0; }
nav a[aria-current=page] { color: var(--accent); }
nav a[aria-current=page]::before { content: '/ '; }
main { min-width: 0; }
.intro { padding: 0 0 64px; max-width: 760px; }
.eyebrow, .meta { font: 12px/1.6 var(--mono); letter-spacing: 0; }
.eyebrow { color: var(--muted); margin: 0 0 25px; }
h1 { font: 400 clamp(2.6rem, 5.6vw, 4.8rem)/1.1 var(--sans); letter-spacing: -.055em; margin: 0 0 23px; }
h1 > span { display: none; }
h2, h3 { font-family: var(--sans); font-weight: 500; line-height: 1.3; letter-spacing: -.02em; }
h2 { font-size: 24px; margin: 0; }
h3 { font-size: 21px; }
.lede { color: var(--muted); font-size: 16px; margin: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 0 0 17px; border-bottom: 1px solid var(--ink); }
.section-heading h2 { font-family: var(--mono); font-size: 14px; font-weight: 400; letter-spacing: 0; }
.meta { color: var(--muted); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th { font-weight: 400; font-size: 12px; color: var(--muted); white-space: nowrap; padding: 16px 18px 16px 0; border-bottom: 1px solid var(--line); }
td { padding: 22px 18px 22px 0; border-bottom: 1px solid var(--line); }
td.empty { text-align: left; padding: 48px 0 60px; white-space: normal; }
.empty-index { color: var(--olive); font-size: 25px; }
.empty h3 { margin: 18px 0 6px; }
.empty p, .journal-empty p:not(.eyebrow) { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.crosslink { display: flex; justify-content: flex-end; gap: 20px; padding: 24px 0; margin-bottom: 65px; }
.text-link { font-size: 14px; font-weight: 400; }
.text-link span { margin-left: 12px; color: var(--accent); }
.site-footer { grid-column: 2; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); padding: 22px 0 35px; color: var(--muted); font-size: 12px; }
.site-footer > span:first-child { color: var(--ink); }
.journal-empty { padding: 48px 0 60px; border-bottom: 1px solid var(--line); }
.journal-number { display: block; color: var(--olive); font-size: 25px; margin-bottom: 18px; }
.journal-empty h2 { font-size: 21px; }
.project-feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 36px; padding: 28px 0; margin-bottom: 75px; border-block: 1px solid var(--line); }
.project-art { background: #77774d; color: var(--paper); display: flex; flex-direction: column; justify-content: center; gap: 35px; padding: 32px 25px; overflow: hidden; min-height: 260px; }
.project-art > span { font-size: 12px; line-height: 1.6; }
.mini-neck { height: 132px; position: relative; display: flex; flex-direction: column; justify-content: space-between; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(20% - 1px), #aaa98b calc(20% - 1px), #aaa98b 20%); border-left: 3px solid var(--paper); }
.mini-neck i { height: 1px; background: #aaa98b; width: 100%; }
.dot { position: absolute; width: 27px; height: 27px; border-radius: 50%; background: var(--paper); color: var(--ink); font: 12px/27px var(--mono); text-align: center; transform: translate(-50%, -50%); }
.d1 { left: 10%; top: 0; background: #73321f; color: white; }
.d2 { left: 50%; top: 20%; }
.d3 { left: 90%; top: 40%; }
.d4 { left: 30%; top: 60%; }
.d5 { left: 70%; top: 100%; background: #73321f; color: white; }
.project-info { padding: 3px 0; }
.project-info .eyebrow { margin-bottom: 18px; }
.project-info h2 { font-size: 30px; line-height: 1.15; font-weight: 400; }
.project-info p:not(.eyebrow) { color: var(--muted); font-size: 14px; }
.button { display: inline-flex; gap: 28px; padding: 9px 0; color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent); font-size: 14px; margin-top: 7px; }
.button:hover { color: var(--ink); border-color: var(--ink); }
.project-note { display: block; font-size: 12px; color: var(--muted); margin-top: 20px; }
.skip { position: absolute; top: -100px; left: 12px; background: var(--paper); padding: 12px; z-index: 10; }
.skip:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.tool-heading { padding: 0 0 24px; }
.tool-heading .eyebrow { margin-top: 35px; }
.tool-heading h1 { font-size: clamp(2.3rem, 4vw, 3.7rem); }
.tool-heading p { color: var(--muted); font-size: 14px; }
.legend span { color: var(--accent); }
.page.tool-page { width: 100%; max-width: none; padding: 0; background: transparent; display: flow-root; }
.tool-page .btn { font-family: var(--mono); border-radius: 0; }
.tool-page .add-widget { float: none; background: var(--ink); color: var(--paper); padding: 10px 16px; }
.tool-page > div[id^=widget] { overflow-x: auto; padding: 20px 0; margin-top: 24px; border-color: var(--line); }
.tool-page div[id^=control] { min-width: 620px; font-size: 14px; }
.tool-page .neck, .tool-page .fret-numbers { min-width: 900px; }
.tool-page .neck { background: #c9ac83; }
.tool-page .bottom-string { background: var(--paper); }
.tool-page .root-note { background: var(--accent); }
.tool-page .in-scale { background: var(--ink); }
.tool-page ul.fret-numbers > li { color: var(--muted); }
.tool-page select { font: 14px var(--mono); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 0; padding: 8px; margin-bottom: 15px; }
.tool-page .btn-remove { width: 32px; height: 32px; background: var(--accent); }
.tool-page div[id^=mode-element] { display: block; font-size: 14px; }
.support { padding: 36px 0; text-align: right; font-size: 14px; }
.report-body { max-width: 680px; margin-bottom: 70px; font: 18px/1.8 var(--sans); }
.report-body h2 { margin-top: 35px; }
.report-body img { max-width: 100%; height: auto; }
.home-intro { padding: 13vh 0 10vh; max-width: 760px; }
.home-intro h1 { margin-bottom: 28px; }
.home-intro h1 span { display: inline; }
.home-links { border-top: 1px solid var(--ink); }
.home-link { display: grid; grid-template-columns: 46px 1fr auto; gap: 18px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.home-link:hover { color: var(--accent); }
.home-link-index { color: var(--muted); font-size: 12px; }
.home-link strong, .home-link small { display: block; }
.home-link strong { font: 400 20px var(--sans); }
.home-link small { color: var(--muted); font-size: 12px; margin-top: 4px; }
@media (max-width: 1050px) {
  body { grid-template-columns: 165px minmax(0, 1fr); column-gap: 36px; padding: 44px 30px 0; }
  .project-feature { grid-template-columns: 1fr; gap: 26px; }
  .project-art { max-width: 440px; }
}
@media (max-width: 700px) {
  body { display: block; padding: 26px 22px 0; }
  .site-header { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 22px; margin-bottom: 38px; }
  .brand { flex-direction: row; align-items: center; font-size: 21px; gap: 16px; }
  nav { margin-top: 24px; flex-direction: row; flex-wrap: wrap; gap: 12px 22px; }
  nav a { font-size: 14px; }
  .intro { padding-bottom: 38px; }
  .home-intro { padding: 9vh 0 8vh; }
  h1 { font-size: clamp(2.5rem, 10vw, 3.7rem); }
  .section-heading { gap: 12px; }
  .crosslink { margin-bottom: 40px; }
  .project-feature { margin-bottom: 40px; }
  .project-art { max-width: none; }
  .site-footer { font-size: 12px; }
}

/* Race archive: keep event names readable beside compact numeric columns. */
.archive td { vertical-align: top; font-variant-numeric: tabular-nums; }
.archive td:first-child { min-width: 115px; }
.archive td:nth-child(2) { min-width: 185px; }
.archive td:nth-child(3), .archive td:nth-child(4) { white-space: nowrap; }
.race-name { display: block; font: 500 18px/1.4 var(--sans); }
.archive td small { display: block; color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 6px; max-width: 240px; }
.race-notes { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 22px 0 0; max-width: 760px; }
.race-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.race-filter { font: 12px var(--mono); color: var(--ink); background: transparent; border: 1px solid var(--line); padding: 8px 12px; cursor: pointer; }
.race-filter:hover, .race-filter.is-active { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.archive tr[hidden] { display: none; }

.race-map-section { margin: -20px 0 48px; }
.race-map-section h2 { font: 400 14px var(--mono); }
#race-map { height: 390px; background: #deded0; border: 1px solid var(--line); margin-top: 16px; z-index: 0; }
#race-map > p { padding: 24px; font-size: 14px; }
.map-toolbar { display: flex; align-items: center; gap: 14px; margin-top: 16px; font-size: 14px; }
.map-toolbar[hidden] { display: none; }
.map-toolbar select { min-width: 0; max-width: 100%; flex: 1; font: 14px var(--mono); padding: 9px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
#map-reset { font: 14px var(--mono); color: var(--accent); padding: 5px 0; border: 0; background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.map-note { font: 12px/1.7 var(--mono); color: var(--muted); margin: 12px 0; }
.race-pin span { display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--paper); border-radius: 50%; background: var(--accent); color: white; font: 12px var(--mono); box-shadow: 0 1px 4px #30362e66; }
.race-pin:hover span, .race-pin:focus span { background: var(--ink); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--paper); color: var(--ink); border-radius: 0; }
.race-popup { font: 13px/1.6 var(--mono); }
.race-popup h3 { font-size: 20px; margin: 12px 0 6px; }
.race-popup p { margin: 5px 0; }
.race-popup article + article { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 8px; }
.race-popup .popup-place { color: var(--muted); font-size: 12px; }
.race-popup a { color: var(--accent); }
.race-popup .popup-sources { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.archive tr:target { background: #e5dfcb; outline: 1px solid var(--olive); outline-offset: -1px; }
@media(max-width:700px) { #race-map { height: 330px; } .map-toolbar { align-items: stretch; flex-direction: column; gap: 5px; } .race-map-section { margin-top: 0; } }
