:root {
  --paper: #efe6d6;
  --paper-2: #f7f1e6;
  --ink: #1b2430;
  --muted: #4a5563;
  --line: #d9d0c2;
  --teal: #1c5f59;
  --teal-ink: #134743;
  --copper: #8a4630;
  --navy: #141c28;
  --cream: #fbf7f0;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --spine: 252px;
  --pad: clamp(1.25rem, 3vw, 3.25rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.consent-ok #cookie { display: none; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal-ink); text-underline-offset: 0.18em; }
a:hover { color: var(--copper); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
::selection { background: var(--teal); color: var(--cream); }

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: var(--cream);
  padding: 0.5rem 0.8rem;
  z-index: 50;
}
.skip:focus { top: 0.75rem; }

.shell {
  display: grid;
  grid-template-columns: var(--spine) minmax(0, 1fr);
  min-height: 100vh;
}
.spine {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  padding: 1.4rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.brand img { width: 56px; height: 56px; }
.brand strong {
  display: block;
  font-family: var(--sans);
  font-weight: 650;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  text-transform: uppercase;
}
.brand em {
  display: block;
  margin-top: 0.15rem;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--muted);
}
.issue {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.4rem 0.7rem;
  font-family: var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}
.nav { display: flex; flex-direction: column; counter-reset: item; }
.nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  text-decoration: none;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}
.nav a:last-child { border-bottom: 1px solid var(--line); }
.nav a::before {
  counter-increment: item;
  content: counter(item, decimal-leading-zero);
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--teal);
  width: 1.8rem;
}
.nav a[aria-current="page"] { color: var(--teal-ink); font-weight: 600; }
.spine-contact {
  margin-top: auto;
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}
.spine-contact a { color: inherit; }
.spine-contact p { margin: 0 0 0.35rem; }

.main-col { display: flex; flex-direction: column; min-width: 0; }
main { flex: 1; padding: var(--pad); }
.page-head { max-width: 40rem; margin-bottom: 2rem; }
.eyebrow {
  margin: 0 0 0.7rem;
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
}
h1, h2, h3 { font-weight: 500; letter-spacing: -0.02em; line-height: 1.12; }
h1 { font-size: clamp(2.3rem, 5vw, 4.15rem); margin: 0 0 0.8rem; }
h2 { font-size: clamp(1.55rem, 2.4vw, 2rem); margin: 2.2rem 0 0.7rem; }
h3 { font-size: 1.25rem; margin: 1.4rem 0 0.4rem; }
.standfirst { font-size: 1.25rem; line-height: 1.45; color: var(--muted); margin: 0; }
.prose { max-width: 68ch; }
.prose p { margin: 0 0 1rem; }
.drop::first-letter {
  float: left;
  font-size: 3.3rem;
  line-height: 0.8;
  padding: 0.15rem 0.45rem 0 0;
  color: var(--teal);
}
.flag {
  display: inline-block;
  margin: 0 0 0.8rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--copper);
  color: var(--copper);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.crumbs { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); margin: 0 0 1rem; }
.crumbs a { color: inherit; }

.frame {
  margin: 0;
  background: var(--navy);
}
.frame img { width: 100%; height: auto; object-fit: cover; }
.frame figcaption, .credit {
  font-family: var(--sans);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted);
  padding: 0.55rem 0 0;
  background: var(--paper);
}
.scale {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.2rem 0 0.4rem;
  max-width: 40rem;
}
.scale div { border-top: 1px solid var(--ink); padding-top: 0.45rem; }
.scale dt { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.scale dd { margin: 0.25rem 0 0; font-size: 1.35rem; }
.note { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); }

.meter {
  display: inline-block;
  width: 4.6rem;
  height: 0.38rem;
  background: #e4dccf;
  vertical-align: middle;
  margin-left: 0.35rem;
}
.meter > i {
  display: block;
  height: 100%;
  width: calc(var(--n) * 20%);
  background: var(--teal);
  font-style: normal;
}

.ledger { display: flex; flex-direction: column; }
.entry {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 1.1rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry[hidden] { display: none; }
.entry img { width: 100%; height: 112px; object-fit: cover; background: var(--navy); }
.entry h2, .entry h3 { margin: 0.15rem 0 0.35rem; font-size: 1.45rem; }
.entry p { margin: 0; color: var(--muted); }
.kicker { margin: 0; font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); }
.meta { display: flex; flex-wrap: wrap; gap: 0.45rem 0.9rem; margin: 0.55rem 0 0; padding: 0; list-style: none; font-family: var(--sans); font-size: 0.78rem; color: var(--muted); }

.filters { display: flex; flex-direction: column; gap: 0.7rem; margin: 0 0 1.2rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.filter-row span { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); min-width: 7.5rem; }
.filter-row button, .tools button, .cookie button, .dialog-close {
  min-height: 40px;
  background: transparent;
  border: 1px solid var(--line);
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.86rem;
}
.filter-row button.is-on, .tools button.primary, .cookie button.primary {
  background: var(--teal-ink);
  color: var(--cream);
  border-color: var(--teal-ink);
}
.tools { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; margin-bottom: 0.6rem; }
.tools label { display: flex; flex-direction: column; gap: 0.25rem; font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.tools input, .tools select, .instrument input, .instrument select {
  min-height: 42px;
  background: var(--cream);
  border: 1px solid var(--line);
  padding: 0.3rem 0.55rem;
  font-family: var(--sans);
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0;
}
#empty { border: 1px dashed var(--line); padding: 1rem; }

.table-scroll { overflow-x: auto; border-top: 1px solid var(--ink); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { text-align: left; padding: 0.7rem 0.55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
th button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; }
tbody tr { cursor: pointer; }
tbody tr.is-picked { background: rgba(28, 95, 89, 0.08); }
.compare-note { min-height: 3.2rem; margin: 0.8rem 0 0; max-width: 68ch; }

.instrument {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(16rem, 0.9fr);
  gap: 1.5rem;
  border-top: 1px solid var(--ink);
  padding-top: 1rem;
}
.readout {
  font-family: var(--mono);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.04em;
  margin: 0.2rem 0;
}
.bars { display: flex; flex-direction: column; gap: 0.28rem; margin-top: 0.8rem; }
.bar-row { display: grid; grid-template-columns: 2.2rem 1fr 4.2rem; gap: 0.45rem; align-items: center; font-family: var(--mono); font-size: 0.75rem; }
.bar-track { background: #e4dccf; height: 0.55rem; }
.bar-track span { display: block; height: 100%; background: var(--teal); }
.prob-table { min-width: 0; width: 100%; margin-top: 0.8rem; }
.prob-table td, .prob-table th { padding: 0.35rem 0.4rem; }

.fold { border-top: 1px solid var(--line); max-width: 68ch; }
.fold summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 0;
  font-family: var(--sans);
  letter-spacing: 0.03em;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before { content: "+"; color: var(--teal); margin-right: 0.55rem; font-family: var(--mono); }
.fold[open] summary::before { content: "–"; }
.fold .fold-body { padding: 0 0 1rem 1.2rem; }
.formula {
  font-family: var(--mono);
  font-size: 0.92rem;
  background: var(--cream);
  border-left: 3px solid var(--teal);
  padding: 0.7rem 0.8rem;
  overflow-x: auto;
}

button.term {
  background: none;
  border: 0;
  border-bottom: 1px dashed var(--teal);
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
dialog {
  border: 1px solid var(--ink);
  background: var(--paper-2);
  color: var(--ink);
  max-width: 34rem;
  width: calc(100% - 2rem);
  padding: 1.3rem 1.3rem 1.1rem;
}
dialog::backdrop { background: rgba(20, 28, 40, 0.46); }
dialog h2 { margin: 0 0 0.6rem; font-size: 1.6rem; }
.dialog-close { margin-top: 0.8rem; }

.desk {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}
.hours, .contact-card { border-top: 1px solid var(--ink); padding-top: 0.6rem; }
.hours table { min-width: 0; }
.contact-card a { word-break: break-word; }

.jobs { display: grid; gap: 1rem; }
.job { border-top: 1px solid var(--ink); padding-top: 0.8rem; }
.job ul { margin-top: 0.3rem; }

.site-footer {
  background: var(--navy);
  color: #efe6d6;
  padding: 2rem var(--pad) 2.4rem;
}
.site-footer a { color: #efe6d6; }
.foot-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 1.4rem;
}
.site-footer h2 { margin: 0 0 0.5rem; font-size: 1rem; font-family: var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
.site-footer p, .site-footer li { font-family: var(--sans); font-size: 0.88rem; line-height: 1.5; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.disclaimer {
  margin: 1.4rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(239, 230, 214, 0.25);
  max-width: 78ch;
}
.copy { margin: 0.8rem 0 0; opacity: 0.75; }

.cookie {
  position: fixed;
  z-index: 40;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  max-width: 26rem;
  margin-left: auto;
  background: var(--navy);
  color: var(--cream);
  padding: 1rem 1rem 0.9rem;
  box-shadow: 0 10px 30px rgba(20, 28, 40, 0.18);
}
.cookie p { margin: 0 0 0.8rem; font-family: var(--sans); font-size: 0.88rem; }
.cookie .row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cookie a { color: var(--cream); }

@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .spine {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 30;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 0.7rem;
  }
  .nav-toggle { display: flex; }
  .nav { display: none; }
  .spine.is-open .nav { display: flex; max-height: 62vh; overflow: auto; }
  .spine-contact { display: none; }
  .entry { grid-template-columns: 1fr; }
  .entry img { height: 180px; }
  .instrument, .desk, .foot-grid, .scale { grid-template-columns: 1fr; }
  .cookie { right: 0.6rem; left: 0.6rem; }
}
@media (max-width: 560px) {
  h1 { font-size: 2.15rem; }
  .filter-row span { min-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media print {
  .spine, .cookie, .nav-toggle, .filters, .tools { display: none !important; }
  .shell { display: block; }
  .site-footer { background: white; color: black; }
  .site-footer a { color: black; }
}
