/* The School of HN — fresco palette: parchment, ink, terracotta, lapis.
   Fonts: Cormorant Garamond (display), EB Garamond (titles, quotes), system sans (UI, data). All OFL, self-hosted. */
@font-face { font-family: "Cormorant"; font-weight: 500; font-style: normal; font-display: swap; src: url(/assets/fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 500; font-style: italic; font-display: swap; src: url(/assets/fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 600; font-style: normal; font-display: swap; src: url(/assets/fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "EB Garamond"; font-weight: 400; font-style: normal; font-display: swap; src: url(/assets/fonts/eb-garamond-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "EB Garamond"; font-weight: 400; font-style: italic; font-display: swap; src: url(/assets/fonts/eb-garamond-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "EB Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url(/assets/fonts/eb-garamond-latin-500-normal.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --bg: #f4eee3; --card: #fbf7ef; --fg: #2b231c; --muted: #6f6355; --line: #e0d5c2;
  --accent: #a64b28; --link: #2f5270; --cream: #f7f1e6;
  --series-1: #a64b28; --axis: #c9bba3; --grid: #e6dccb;
  --display: "Cormorant", "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --serif: "EB Garamond", Garamond, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #191512; --card: #221d18; --fg: #efe6d6; --muted: #a89a86; --line: #362d25;
    --accent: #cf6a41; --link: #9fbbd6;
    --series-1: #cf6a41; --axis: #4a3f34; --grid: #2e2720;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--sans); overflow-wrap: anywhere; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.wrap { max-width: 940px; margin: 0 auto; padding: 0 20px; }

/* ---------- masthead: a slim strip of the fresco ---------- */
.masthead { position: relative; isolation: isolate; overflow: hidden; color: var(--cream); margin-bottom: 18px; }
.mast-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 52%; z-index: -2;
  filter: saturate(.75) sepia(.16) contrast(.95) brightness(.85); }
.masthead::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to right, rgba(25,21,18,.82), rgba(25,21,18,.45) 55%, rgba(25,21,18,.6)),
    repeating-linear-gradient(to right, transparent 0 calc(12.5% - 1px), rgba(247,241,230,.13) calc(12.5% - 1px) 12.5%); }
.mast-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; min-height: 84px; padding-top: 12px; padding-bottom: 12px; }
.masthead a { color: var(--cream); }
.brand { font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: .005em; margin-right: 14px; }
.tagline { font-family: var(--serif); font-style: italic; font-size: 16px; opacity: .85; white-space: nowrap; }
.masthead nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.masthead nav a { opacity: .88; padding: 2px 0; }
.masthead nav a[aria-current="page"] { opacity: 1; border-bottom: 1px solid currentColor; }
.wrap.wide { max-width: 1240px; }

/* ---------- section headings with numerals ---------- */
.section-title { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.1; margin: 40px 0 4px; }
.section-title .num { font-weight: 500; font-style: italic; color: var(--accent); margin-right: .35em; }
.section-sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }

/* ---------- list controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.controls input, .controls select { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 2px;
  background: var(--card); color: var(--fg); min-width: 0; }
.controls input { flex: 2 1 220px; }
.controls select { flex: 1 1 130px; max-width: 100%; }
.listbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.listbar .count { margin: 0; }
.sortlab { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.sortlab select { font: inherit; font-size: 13px; color: var(--fg); background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 2px 0; }
.controls input:focus, .controls select:focus { outline: 1px solid var(--accent); outline-offset: 0; }
.count { color: var(--muted); font-size: 13px; margin-bottom: 4px; font-variant: all-small-caps; letter-spacing: .08em; }

/* ---------- the list ---------- */
ol.list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--fg); }
ol.list li { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rank { width: 2em; flex: none; text-align: right; font-family: var(--display); font-size: 19px; line-height: 1.2; color: var(--muted); font-variant-numeric: oldstyle-nums; }
.body { flex: 1; min-width: 0; }
.title { font-family: var(--serif); font-size: 18.5px; line-height: 1.25; font-weight: 500; }
.title a { color: var(--fg); }
.title a:hover { color: var(--accent); text-decoration: none; }
.meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.meta a { color: var(--link); }
.chip { display: inline-block; font-variant: all-small-caps; letter-spacing: .06em; font-size: 13px; border: 1px solid var(--line); padding: 0 6px; margin-left: 4px; border-radius: 2px; }
.quote { font-family: var(--sans); font-size: 14px; line-height: 1.45; color: color-mix(in srgb, var(--fg) 72%, var(--bg)); margin-top: 5px;
  padding-left: 9px; border-left: 2px solid var(--line);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quote::before { content: "“"; } .quote::after { content: "”"; }

/* vote: a small seal */
.vote { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 48px;
  border: 1px solid var(--line); border-radius: 2px; background: var(--card); color: var(--muted); font: 500 14px var(--sans);
  cursor: pointer; font-variant-numeric: tabular-nums; }
.vote .arrow { font-size: 11px; line-height: 1; margin-bottom: 3px; }
.vote:hover { border-color: var(--accent); color: var(--accent); }
.vote.on { background: var(--accent); border-color: var(--accent); color: var(--cream); }
.vote:disabled { opacity: .6; cursor: progress; }
.vote:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#more { width: 100%; height: auto; flex-direction: row; padding: 10px; font-family: var(--serif); font-size: 16px; }

/* ---------- home: list pane + trends pane ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 36px; align-items: start; }
.intro { font-family: var(--serif); font-size: 17px; line-height: 1.45; margin: 0 0 12px; color: var(--muted); max-width: 70ch; }
.pane-side { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; padding-top: 4px; scrollbar-width: thin; }
.pane { border-top: 1px solid var(--fg); padding: 10px 0 16px; }
.pane-title { font-family: var(--display); font-weight: 600; font-size: 21px; margin: 0 0 8px; line-height: 1.15; }
.pane-title span { display: block; font: 12px var(--sans); color: var(--muted); margin-top: 2px; }
.meters { display: flex; flex-direction: column; gap: 1px; }
.meter { display: grid; grid-template-columns: 150px minmax(0, 1fr) 38px; align-items: center; gap: 8px; width: 100%; padding: 3px 4px;
  border: 0; background: none; color: var(--fg); font: 13px var(--sans); text-align: left; cursor: pointer; border-radius: 2px; }
.meter:hover { background: color-mix(in srgb, var(--series-1) 8%, transparent); }
.meter[aria-pressed="true"] { background: color-mix(in srgb, var(--series-1) 14%, transparent); font-weight: 600; }
.meter:focus-visible { outline: 2px solid var(--series-1); outline-offset: 0; }
.m-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-track { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--series-1) 14%, var(--bg)); overflow: hidden; }
.m-fill { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.m-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.linkish { border: 0; background: none; padding: 4px 4px 0; color: var(--link); font: 13px var(--sans); cursor: pointer; }
.spark-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.spark-head b { color: var(--fg); font-size: 15px; font-variant-numeric: tabular-nums; }
#spark svg { display: block; overflow: visible; touch-action: none; }
.pane-more { display: inline-block; margin-top: 6px; font-size: 14px; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 10px; }
  .pane-side { position: static; max-height: none; overflow: visible; }
  .meter { grid-template-columns: 140px minmax(0, 1fr) 40px; }
}

/* ---------- resource page ---------- */
.resource .head { display: flex; gap: 16px; align-items: flex-start; }
.resource h2 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 5vw, 42px); line-height: 1.05; margin: 0 0 8px; }
.resource h2 a { color: var(--fg); }
.resource h3 { font-family: var(--display); font-weight: 600; font-size: 26px; margin: 30px 0 10px; }
.stats { display: flex; flex-wrap: wrap; gap: 28px; margin: 20px 0 8px; padding: 14px 0; border-top: 1px solid var(--fg); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.stats b { display: block; color: var(--fg); font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1.1; }
.comments { list-style: none; padding: 0; margin: 0; }
.comments li { padding: 6px 0 6px 18px; border-left: 2px solid var(--accent); margin: 0 0 22px; }
.comments .text { font-family: var(--sans); font-size: 15px; line-height: 1.6; white-space: pre-wrap; }
.comments .src { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

/* ---------- prose (about) ---------- */
.prose { max-width: 680px; font-family: var(--serif); font-size: 18px; line-height: 1.6; }
.prose h2 { font-family: var(--display); font-weight: 600; font-size: 28px; margin: 34px 0 6px; line-height: 1.15; }
.prose table { border-collapse: collapse; font-family: var(--sans); font-size: 14px; margin: 10px 0; }
.prose td, .prose th { border-bottom: 1px solid var(--line); padding: 5px 14px 5px 0; text-align: left; }
.prose td.n { text-align: right; font-variant-numeric: tabular-nums; }
figure.art { margin: 0 0 26px; }
figure.art img { width: 100%; height: auto; display: block; filter: saturate(.85) sepia(.1); }
figure.art figcaption { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---------- trends ---------- */
.headline { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 28px; align-items: center; margin: 0 0 10px; }
.headline-art { width: 100%; height: auto; mix-blend-mode: multiply; filter: sepia(.15) contrast(1.02); }
@media (prefers-color-scheme: dark) { .headline-art { mix-blend-mode: normal; filter: sepia(.2) brightness(.8); border-radius: 2px; } }
.hero-n { font: 600 64px/1 var(--sans); }
.hero-text { margin: 10px 0 0; font-family: var(--serif); font-size: 21px; line-height: 1.4; color: var(--muted); }
.hero-text b { color: var(--fg); font-weight: 500; }
.chart, .multiple { position: relative; }
.chart svg, .multiple svg { display: block; overflow: visible; }
.chart .lbl, .chart .val, .multiple .val { font: 13px var(--sans); fill: var(--fg); }
.chart .lbl { fill: var(--muted); }
.chart .val, .multiple .val, .tick { font-variant-numeric: tabular-nums; }
.mark { fill: var(--series-1); }
.bar:hover .mark, .bar:focus .mark { opacity: .8; }
.bar:focus, .multiple svg:focus { outline: none; }
.bar:focus-visible .lbl { fill: var(--fg); font-weight: 600; }
.multiple svg:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 24px; }
.m-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.m-name { font-family: var(--serif); font-size: 16px; font-weight: 500; }
.m-total { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wash { fill: var(--series-1); opacity: .1; }
.dot { fill: var(--series-1); stroke: var(--bg); stroke-width: 2; }
.grid { stroke: var(--grid); stroke-width: 1; }
.axis { stroke: var(--axis); stroke-width: 1; }
.cross { stroke: var(--muted); stroke-width: 1; }
.tick { font: 11px var(--sans); fill: var(--muted); }
.tt { position: absolute; z-index: 5; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 2px;
  padding: 6px 9px; font-size: 12.5px; color: var(--muted); box-shadow: 0 2px 10px rgba(43,35,28,.14); white-space: nowrap; }
.tt b { display: block; color: var(--fg); font-size: 15px; }
.tt-detail { margin-top: 2px; }
.tableview { margin: 10px 0 0; font-size: 13.5px; }
.tableview summary { color: var(--link); cursor: pointer; }
.tableview table { border-collapse: collapse; margin-top: 8px; width: 100%; display: block; overflow-x: auto; }
.tableview td, .tableview th { border-bottom: 1px solid var(--line); padding: 4px 12px 4px 0; text-align: left; white-space: nowrap; }
.tableview .n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: 2px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
footer { color: var(--muted); font-size: 13px; border-top: 1px solid var(--fg); margin-top: 48px; padding: 18px 0 48px; }
footer p { margin: 0 0 6px; }
@media (max-width: 640px) {
  .brand { font-size: 25px; } .tagline { display: block; white-space: normal; font-size: 14px; margin-top: 4px; } .masthead nav { gap: 14px; font-size: 13px; }
  .rank { display: none; }
  .title { font-size: 18px; }
  .controls input { flex-basis: 100%; }
  .headline { grid-template-columns: 1fr; } .headline-art { max-width: 200px; justify-self: center; order: -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
