/* Afara (Yoruba: bridge), the Human Rights Knowledge Commons. Direction D.
   The page has two banks and a rule down the middle: the gap between one system and another.
   What the Repository does is drawn as things that cross that rule: the search field, a story's
   span from the document you looked for to the one you found, a source word and its shared topic.
   Coral and black only. Coral is the crossing colour: it is used for what crosses the rule or joins
   the two banks (a band where both banks make one statement, the plate that carries a connection
   over the rule, the shared topic, the fields the Repository adds to a record) and for nothing else.
   It is never used as a small accent on paper. The rule is the spine of every page: the header nav,
   the section labels and the footer hang from it.
   Heavy grotesque for statements, a light serif italic for what is found, mono for captions.
   Square corners, rules, no shadows. */
:root {
  --paper: #F2F1EC;
  --card: #FFFFFF;
  --ink: #111110;
  --ink-2: #3B3A36;
  --ink-3: #6A6963;
  --rule: #111110;
  --soft: #D9D8D1;
  /* The accent: coral. Black text on it passes WCAG AA (7.9:1), and it passes as text on the black band. */
  --accent: #FF8566;
  --on-accent: #111110;
  --black: #111110;        /* fixed black band, both themes */
  --on-black: #F2F1EC;
  --display: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
  --gap: 40px;             /* distance from the centre rule to each bank's content */
  /* Spacing scale. Every vertical gap is one of these: s1 inside a group, s2 label rows and small
     items, s3 heading to text, s4 between blocks and plate padding, s5 section title to content,
     s6 the end of a band. */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px; --s5: 64px; --s6: 112px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131312; --card: #1D1D1B; --ink: #F2F1EC; --ink-2: #D2D1CA; --ink-3: #9C9B94; --rule: #F2F1EC; --soft: #3A3936;
    --black: #000000; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131312; --card: #1D1D1B; --ink: #F2F1EC; --ink-2: #D2D1CA; --ink-3: #9C9B94; --rule: #F2F1EC; --soft: #3A3936;
  --black: #000000; color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink-2); font-family: var(--display); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 86rem; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.site-nav a:focus-visible, .go:focus-visible, .site-foot a:focus-visible { outline-offset: 6px; }
.on-accent a:focus-visible, .on-accent button:focus-visible { outline-color: var(--on-accent); }
.on-black a:focus-visible, .on-black button:focus-visible { outline-color: var(--accent); }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; color: var(--ink); letter-spacing: -0.045em; line-height: 0.92; text-wrap: balance; }
em.found, .found-word { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.02em; }
.cap { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink); }
.cap i { font-style: normal; color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Prototype note */
.proto { background: var(--black); color: var(--on-black); font-family: var(--mono); font-size: 12px; }
.proto .wrap { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-block: 8px; }
.proto b { font-weight: 500; }

/* Header */
.site-head { border-bottom: 2px solid var(--rule); }
.site-head .wrap { display: flex; justify-content: space-between; align-items: center; gap: var(--s1) var(--s2); flex-wrap: wrap; padding-block: var(--s2); }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; color: var(--ink); }
.brand b { font-weight: 900; font-size: 30px; letter-spacing: -0.06em; line-height: 1; }
.brand small { font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase; color: var(--ink-3); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px 26px; flex-wrap: wrap; align-items: center; }
.site-nav a { text-decoration: none; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; color: var(--ink); padding: 2px 0; border-bottom: 3px solid transparent; }
.site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }
/* Hover is a black plate, the same inversion as the buttons; the underline is kept for the current page only. */
.site-nav a:not([aria-current]):hover { background: var(--ink); color: var(--paper); box-shadow: 0 0 0 4px var(--ink); }
.on-accent .site-nav a:not([aria-current]):hover, .site-head.on-accent a:not([aria-current]):hover { color: var(--accent); }
.site-nav .lang { font-family: var(--mono); font-size: 12px; font-weight: 500; border: 1.5px solid var(--ink); padding: 3px 8px; color: var(--ink); }
/* On a wide page the header sits on the two banks: the name on the left, the nav hung from the rule. */
@media (min-width: 60.0625rem) {
  .site-head .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
  .site-head .wrap::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; margin-left: -1px; border-left: 2px solid var(--rule); }
  .site-nav { padding-left: var(--gap); }
  .site-nav ul { flex-wrap: nowrap; }
  .site-nav li:last-child { margin-left: auto; }
}
.on-accent.site-head, .on-accent { --ink: #111110; --ink-2: #26251F; --ink-3: #33322E; --rule: #111110; --soft: #111110; --card: #FFFFFF; background: var(--accent); color: var(--ink-2); }
.on-black { --ink: #F2F1EC; --ink-2: #D2D1CA; --ink-3: #9C9B94; --rule: #F2F1EC; --soft: #3A3936; --card: #1D1D1B; background: var(--black); color: var(--ink-2); }

/* Two banks and the rule between them */
.banks { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.banks::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 2px solid var(--rule); margin-left: -1px; pointer-events: none; }
.bank-l { padding-right: var(--gap); min-width: 0; }
.bank-r { padding-left: var(--gap); min-width: 0; }
.bank-l.end { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.cross { grid-column: 1 / -1; position: relative; z-index: 1; }

/* Bands */
.band { padding-block: 0; border-top: 2px solid var(--rule); }
.band > .wrap > .banks > .bank-l, .band > .wrap > .banks > .bank-r { padding-top: var(--s5); padding-bottom: var(--s6); }
.band-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding-block: var(--s2); border-bottom: 2px solid var(--rule); }
/* Section labels meet at the rule: the number and name end on it, the note starts from it. */
@media (min-width: 44.0625rem) {
  .band-head, .caps { position: relative; display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 !important; }
  .band-head::before, .caps::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; margin-left: -1px; border-left: 2px solid var(--rule); }
  .band-head > :first-child { justify-self: end; padding-right: var(--gap); text-align: right; }
  .band-head > :last-child { justify-self: start; padding-left: var(--gap); }
  /* Page tops carry a third label, the name, at the outer edge of the left bank. */
  .caps > * { grid-row: 1; }
  .caps > :first-child { grid-column: 1; justify-self: start; }
  .caps > :last-child { grid-column: 1; justify-self: end; padding-right: var(--gap); }
  .caps > .opt { grid-column: 2; justify-self: start; padding-left: var(--gap); }
}
.cap { line-height: 16px; }
.h-xl { font-size: clamp(44px, 7.6vw, 118px); }
.h-l { font-size: clamp(36px, 5vw, 76px); }
.h-m { font-size: clamp(28px, 3vw, 44px); letter-spacing: -0.035em; line-height: 0.98; }
.lead { font-size: 20px; line-height: 1.35; color: var(--ink); max-width: 34ch; letter-spacing: -0.01em; }
.bank-l.end .lead { margin-left: auto; }

/* Buttons, tags, marks */
.btn { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 16px var(--display); letter-spacing: -0.01em; padding: 13px 20px; border: 2px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: transparent; color: var(--ink); }
.on-accent .btn:hover, .on-accent .btn.solid { background: var(--on-accent); color: var(--accent); }
.on-accent .btn.solid:hover { background: #FFFFFF; color: var(--on-accent); }
.on-black .btn.solid { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.on-black .btn:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.tag { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase; padding: 2px 7px; border: 1.5px solid var(--ink); color: var(--ink); white-space: nowrap; }
.tag.fill { background: var(--ink); color: var(--paper); }
.tag.accent { background: var(--accent); color: var(--on-accent); border-color: var(--on-accent); }
.tag.inv { background: var(--ink); color: var(--black); }
.tag.dash { border-style: dashed; }
.chip { display: inline-flex; font-size: 14px; font-weight: 700; padding: 6px 12px; border: 1.5px solid var(--ink); color: var(--ink); background: var(--card); text-decoration: none; }
.chip:hover { background: var(--ink); color: var(--card); }

/* Spans: how two documents are joined. Solid = cited, double = shared topic, dashed = same question. */
.span-mark { display: inline-block; width: 44px; height: 12px; flex: none; vertical-align: middle; }
.span-mark path { fill: none; stroke: var(--ink); stroke-width: 3; }
.span-mark.topic path { stroke-width: 2; }
.span-mark.question path { stroke-dasharray: 6 5; }

/* A crossing: the coral plate that carries a connection over the rule. Its edges say how the two
   documents are joined: solid = cited, double = shared topic, dashed = same question. */
.deck { position: absolute; z-index: 1; left: 50%; width: 176px; height: 40px; transform: translateX(-50%); display: grid; place-items: center; background: var(--accent); border-block: 3px solid var(--ink); white-space: nowrap; }
.deck.topic { border-block: 6px double var(--ink); }
.deck.question { border-block: 3px dashed var(--ink); }
.deck .tag { border: 0; padding: 0; color: var(--on-accent); }

/* Status dots */
.st { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
.st::before { content: ""; width: 10px; height: 10px; background: var(--ink); flex: none; }
.st.soon::before { background: transparent; border: 2px solid var(--ink); }
.st.plan { color: var(--ink-3); }
.st.plan::before { background: transparent; border: 2px dashed var(--ink-3); }

/* Page head (Methodology, Journey): accent field, title across both banks */
.page-head { padding-bottom: 0; }
.page-head .caps { display: flex; justify-content: space-between; gap: var(--s2); padding-block: var(--s2); }
.page-head .banks > * { padding-top: var(--s5); padding-bottom: var(--s5); }
.page-head h1 { font-size: clamp(46px, 8.6vw, 132px); font-weight: 900; letter-spacing: -0.055em; line-height: 0.86; }

/* Spine: the centre rule runs unbroken from the top of the page head to its bottom edge,
   behind the labels, the headline and the search field that crosses it. */
.hero > .wrap, .page-head > .wrap { position: relative; padding-bottom: var(--s5); }
@media (min-width: 44.0625rem) {
  .hero > .wrap::after, .page-head > .wrap::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; margin-left: -1px; border-left: 2px solid var(--rule); pointer-events: none; }
}

/* Footer */
.site-foot { border-top: 2px solid var(--rule); }
/* The name crosses from one bank to the other: the centre rule comes down to it, stops, and starts again under it. */
.site-foot .wrap { position: relative; }
.site-foot .wrap::before { content: ""; position: absolute; left: 50%; top: 0; height: var(--s5); margin-left: -1px; border-left: 2px solid var(--rule); }
.site-foot .mark { font-weight: 900; font-size: clamp(72px, 23vw, 350px); letter-spacing: -0.07em; line-height: 0.74; color: var(--ink); padding: var(--s5) 0.07em 0 0; text-align: center; white-space: nowrap; overflow: hidden; }
.site-foot .cols { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: var(--s4); padding-block: var(--s4) var(--s5); font-size: 14px; border-top: 2px solid var(--rule); margin-top: var(--s4); }
.site-foot h4 { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s2); line-height: 16px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.site-foot a { text-decoration: none; font-weight: 700; color: var(--ink); }
.site-foot a:hover { background: var(--ink); color: var(--paper); box-shadow: 0 0 0 4px var(--ink); }
.site-foot p { max-width: 38ch; color: var(--ink); }
/* The footer keeps the two banks: what Afara is on the left, ending on the rule; the links from it. */
@media (min-width: 44.0625rem) {
  .site-foot .cols { position: relative; grid-template-columns: minmax(0, 3fr) repeat(3, minmax(0, 1fr)); gap: 0; }
  .site-foot .cols::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; margin-left: -1px; border-left: 2px solid var(--rule); }
  .site-foot .cols > div { padding-right: var(--s2); }
  .site-foot .cols > div:first-child { padding-right: var(--gap); text-align: right; }
  .site-foot .cols > div:first-child p { margin-left: auto; }
  .site-foot .cols > div:nth-child(2) { padding-left: var(--gap); }
}
/* Between phone and desktop the right bank holds two groups a row. */
@media (min-width: 44.0625rem) and (max-width: 60rem) {
  .site-foot .cols { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); row-gap: var(--s3); }
  .site-foot .cols > div:first-child { grid-row: 1 / span 2; }
  .site-foot .cols > div:nth-child(4) { grid-column: 2; padding-left: var(--gap); }
}

@media (max-width: 60rem) {
  :root { --gap: 24px; --s4: 32px; --s5: 48px; --s6: 80px; }
  .deck { width: 128px; }
}
@media (max-width: 44rem) {
  :root { --gap: 20px; }
  .site-foot .cols { grid-template-columns: 1fr 1fr; }
  /* One column has no centre rule, so the name goes back to the left edge. */
  .site-foot .wrap::before { display: none; }
  .site-foot .mark { text-align: left; margin-left: -0.05em; padding-right: 0; }
  .banks { grid-template-columns: minmax(0, 1fr); }
  .banks::before { display: none; }
  .bank-l, .bank-r { padding-left: 0; padding-right: 0; }
  .bank-l.end { text-align: left; align-items: flex-start; }
  .bank-l.end .lead { margin-left: 0; }
  .band > .wrap > .banks > .bank-l { padding-bottom: var(--s4); }
  .band > .wrap > .banks > .bank-r { padding-top: 0; }
  .page-head .banks > * { padding-top: var(--s4); padding-bottom: 0; }
  .page-head .banks > * + * { padding-top: 0; padding-bottom: var(--s4); }
  /* One column: the rule moves to the left edge and the plate still crosses it. */
  .deck { position: relative; left: auto; top: auto; transform: none; width: max-content; padding-inline: 44px var(--s2); margin: var(--s3) 0 var(--s3) -44px; }
}
@media (max-width: 40rem) {
  .site-nav ul { gap: 6px 16px; }
  :root { --s4: 24px; --s5: 40px; --s6: 64px; }
  .site-nav a { font-size: 14px; }
  .site-foot .cols { grid-template-columns: 1fr; }
  .band-head .opt, .page-head .caps .opt { display: none; }
}
