/* The in-world Wikipedia. Wikipedia's bones (infobox, contents, red links, the grey "From Wikipedia" line) in the
   landing's night: near-black, warm ink, grain. Links are warm human light, never blue-on-black. */
:root {
  --bg: #0b0a09;
  --panel: #13110f;
  --ink: #e8e3d8;
  --ink-2: rgba(232, 227, 216, .66);
  --ink-3: rgba(232, 227, 216, .42);
  --line: rgba(232, 227, 216, .13);
  --link: #e9b98b;
  --link-hover: #ffd9b0;
  --new: #d0675c;               /* red links: the page isn't written yet */
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--ink); }
body { background: var(--bg); font-family: var(--sans); font-size: 15.5px; line-height: 1.65; -webkit-font-smoothing: antialiased; min-height: 100vh; }
/* film grain, same recipe as the renders */
body::after {
  content: ''; position: fixed; inset: -50%; pointer-events: none; z-index: 100; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a.new { color: var(--new); }

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; gap: 28px; padding: 14px 28px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; background: rgba(11, 10, 9, .92); backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-family: var(--serif); font-weight: 500; font-size: 23px; letter-spacing: .06em; font-variant: small-caps; }
.brand small { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-3); letter-spacing: .03em; }
.search { position: relative; flex: 1; max-width: 440px; }
.search input {
  width: 100%; background: var(--panel); border: 1px solid var(--line); color: var(--ink); border-radius: 3px;
  font: inherit; font-size: 14px; padding: 7px 12px; outline: none;
}
.search input:focus { border-color: rgba(232, 227, 216, .35); }
.search ul {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); list-style: none; background: var(--panel);
  border: 1px solid var(--line); border-radius: 3px; overflow: hidden;
}
.search li a { display: block; padding: 8px 12px; color: var(--ink); font-size: 14px; }
.search li a small { display: block; color: var(--ink-3); font-size: 12px; }
.search li a:hover, .search li a.on { background: rgba(232, 227, 216, .06); text-decoration: none; }
.tools { display: flex; gap: 18px; margin-left: auto; font-size: 13px; }
.tools a { color: var(--ink-2); }

/* ---------- an article ---------- */
.article { max-width: 1000px; margin: 0 auto; padding: 34px 28px 60px; }
.article h1 {
  font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1.15; letter-spacing: .01em;
  border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.from { font-size: 12.5px; color: var(--ink-3); margin: 8px 0 22px; }
.body::after { content: ''; display: block; clear: both; }
.body p { margin: 0 0 1em; }
.body h2 {
  font-family: var(--serif); font-weight: 400; font-size: 27px; line-height: 1.2;
  border-bottom: 1px solid var(--line); padding-bottom: 4px; margin: 1.6em 0 .6em;
}
.body h3 { font-size: 16px; font-weight: 600; margin: 1.3em 0 .4em; }
.body ul { margin: 0 0 1em 1.4em; }
.body li { margin: .2em 0; }
.body b { font-weight: 600; }
sup { font-size: 11px; line-height: 0; }
.cn { color: var(--ink-3); }

.infobox {
  float: right; clear: right; width: 290px; margin: 0 0 18px 26px; border-collapse: collapse;
  background: var(--panel); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.45;
}
.infobox caption {
  font-family: var(--serif); font-size: 21px; padding: 10px 12px 8px; background: var(--panel);
  border: 1px solid var(--line); border-bottom: 0; caption-side: top;
}
.infobox th, .infobox td { text-align: left; vertical-align: top; padding: 6px 12px; border-top: 1px solid var(--line); }
.infobox th { font-weight: 600; width: 40%; color: var(--ink-2); }
.infobox.war { width: 340px; }
.infobox td.sides { padding: 0; }
.infobox td.sides table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.infobox td.side { border-top: 0; border-left: 1px solid var(--line); padding: 6px 10px; }
.infobox td.side:first-child { border-left: 0; }
.infobox th.grp { width: auto; text-align: center; color: var(--ink); background: rgba(232, 227, 216, .05); font-weight: 600; }

.toc {
  display: inline-block; background: var(--panel); border: 1px solid var(--line); padding: 12px 22px 14px 18px;
  margin: 6px 0 14px; font-size: 14px;
}
.toc h2 { font-family: var(--sans); font-size: 14px; font-weight: 600; border: 0; margin: 0 0 6px; padding: 0; text-align: center; }
.toc ol { margin-left: 1.3em; }
.refs { font-size: 13.5px; margin-left: 1.8em; color: var(--ink-2); }
.refs a { margin-right: 4px; }
.cats { clear: both; margin-top: 40px; padding: 8px 12px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; color: var(--ink-2); }
.missing { color: var(--ink-2); }

/* ---------- the main page ---------- */
.mainpage { max-width: 900px; margin: 0 auto; padding: 60px 28px 80px; }
.welcome { text-align: center; margin-bottom: 56px; }
.welcome img { width: 110px; height: 110px; opacity: .95; }
.welcome h1 { font-family: var(--serif); font-weight: 400; font-size: 40px; margin-top: 14px; }
.welcome h1 b { font-weight: 500; font-variant: small-caps; letter-spacing: .05em; }
.welcome p { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink-2); }
.featured { border: 1px solid var(--line); background: var(--panel); padding: 20px 24px; margin-bottom: 44px; }
.featured:empty { display: none; }
.featured h2, .all h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-bottom: 12px; }
.featured h3 { font-family: var(--serif); font-weight: 500; font-size: 21px; margin-bottom: 6px; }
.all ul { list-style: none; columns: 2; column-gap: 40px; }
.all li { break-inside: avoid; padding: 6px 0; }
.all li span { display: block; font-size: 13px; color: var(--ink-3); }

.foot { max-width: 1000px; margin: 0 auto; padding: 18px 28px 40px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }

/* inside the globe's reader: the reader has its own close button, so the bar can be lighter */
.embedded .top { padding: 10px 20px; gap: 18px; }
.embedded .tools a[href="index.html"] { display: none; }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .article, .mainpage { padding-left: 16px; padding-right: 16px; }
  .article h1 { font-size: 31px; }
  .infobox { float: none; width: 100%; margin: 0 0 18px; }
  .infobox.war { width: 100%; }
  .all ul { columns: 1; }
  .foot { padding-left: 16px; padding-right: 16px; }
}

/* the main page's "Browse by category" */
.browse { margin-bottom: 44px; }
.browse h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-bottom: 12px; }
.catgroups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 40px; }
.catgroup h3 { font-family: var(--serif); font-weight: 500; font-size: 18px; margin-bottom: 4px; }
.catgroup ul { list-style: none; }
.catgroup li { padding: 2px 0; font-size: 14px; }
.catgroup li span { color: var(--ink-3); font-size: 12px; }
@media (max-width: 720px) { .catgroups { grid-template-columns: 1fr; } }

/* hatnotes, coordinates, "Redirected from", locator maps, navboxes */
.hatnote { font-style: italic; color: var(--ink-2); padding-left: 1.6em; margin: 0 0 1em; font-size: 14.5px; }
.redirected { margin: -6px 0 14px; font-size: 13px; color: var(--ink-3); }
.redirected a { color: var(--ink-2); }
.article { position: relative; }
.coords { position: absolute; right: 28px; top: 34px; font-size: 12.5px; color: var(--ink-3); margin: 0; }
.infobox td.map { text-align: center; padding: 6px 4px 10px; }
.infobox td.map img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.infobox td.map div { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.infobox td.image { text-align: center; padding: 10px 4px 10px; }
.infobox td.image img { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.infobox td.image div { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.navbox { clear: both; margin: 28px 0 0; border: 1px solid var(--line); background: var(--panel); font-size: 13.5px; }
.navbox summary { cursor: pointer; text-align: center; padding: 6px 10px; font-family: var(--serif); font-size: 16px; border-bottom: 1px solid var(--line); }
.navbox table { width: 100%; border-collapse: collapse; }
.navbox th { width: 1%; white-space: nowrap; text-align: right; vertical-align: top; padding: 5px 12px; font-weight: 600; color: var(--ink-2); border-top: 1px solid var(--line); }
.navbox td { padding: 5px 12px; border-top: 1px solid var(--line); line-height: 1.7; }
.navbox tr:first-child th, .navbox tr:first-child td { border-top: 0; }
.navbox + .navbox { margin-top: 8px; }
@media (max-width: 720px) {
  .coords { position: static; margin: 0 0 4px; }
  .navbox th { white-space: normal; width: 30%; }
}

/* data tables and verbatim blocks in article bodies */
.wikitable { border-collapse: collapse; margin: .8em 0; font-size: .92em; }
.wikitable th, .wikitable td { border: 1px solid var(--line); padding: .3em .6em; text-align: left; }
.wikitable th { background: var(--panel); }
pre.signal { font-family: Consolas, "DejaVu Sans Mono", monospace; background: var(--panel); border: 1px solid var(--line); padding: .6em .8em; overflow-x: auto; }

/* {{thumb|file|caption}}: a picture beside the text, as on Wikipedia */
figure.thumb { float: right; clear: right; width: 210px; margin: 4px 0 14px 20px; padding: 6px; background: var(--panel); border: 1px solid var(--line); }
figure.thumb img { display: block; width: 100%; height: auto; }
figure.thumb figcaption { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); margin-top: 6px; }
@media (max-width: 640px) { figure.thumb { float: none; margin: 10px auto 16px; } }
.foot .legal { margin-top: .6em; opacity: .75; }
