/* History of Hackers -- Wikipedia-style encyclopedia skin. */

:root {
  --bg: #ffffff;
  --content-bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f8f9fa;
  --sidebar-bg: #f6f6f6;
  --text: #202122;
  --muted: #54595d;
  --link: #0645ad;
  --link-visited: #0b0080;
  --red-link: #ba0000;
  --border: #a2a9b1;
  --border-light: #eaecf0;
  --chip: #eaecf0;
  --focus: #4c9ed9;
  --code-bg: #f8f9fa;
  --header-bg: #ffffff;
  --tab-inactive: #f0f1f3;
  --font-heading: Georgia, "Linux Libertine", "Times New Roman", serif;
  --font-body: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-ui: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

:root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --bg: #101418; --content-bg: #14181d; --panel: #14181d; --panel-2: #1a1f25;
    --sidebar-bg: #171b20; --text: #e8e6e3; --muted: #a2a9b1; --link: #6ab5f3;
    --link-visited: #b28fe0; --border: #3b4148; --border-light: #262b31;
    --chip: #1e2329; --focus: #6ab5f3; --code-bg: #1a1f25; --header-bg: #14181d;
    --tab-inactive: #1a1f25;
  }
}
:root[data-theme="dark"] {
  --bg: #101418; --content-bg: #14181d; --panel: #14181d; --panel-2: #1a1f25;
  --sidebar-bg: #171b20; --text: #e8e6e3; --muted: #a2a9b1; --link: #6ab5f3;
  --link-visited: #b28fe0; --border: #3b4148; --border-light: #262b31;
  --chip: #1e2329; --focus: #6ab5f3; --code-bg: #1a1f25; --header-bg: #14181d;
  --tab-inactive: #1a1f25;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:visited { color: var(--link-visited); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 1px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--panel);
  color: var(--text); padding: 8px 12px; z-index: 100; border: 1px solid var(--border);
}
.skip-link:focus { left: 8px; top: 8px; }

/* Top personal-tools strip */
.top-strip {
  font-size: 12px; text-align: right; padding: 4px 16px; color: var(--muted);
  border-bottom: 1px solid var(--border-light); background: var(--panel-2);
}
.top-strip a { color: var(--muted); margin-left: 12px; }
.top-strip a:first-child { margin-left: 0; }

/* Header: logo + search */
header.site-header {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--header-bg); flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--text); }
.brand-logo {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: var(--text); color: var(--bg); font-weight: 900; font-family: var(--font-heading); font-size: 14px;
}
.brand small { display: block; font-weight: 400; font-size: 10px; color: var(--muted); }

.site-search { flex: 1; min-width: 160px; max-width: 420px; display: flex; margin-left: auto; }
.site-search input {
  width: 100%; padding: 6px 10px; border-radius: 2px 0 0 2px; border: 1px solid var(--border);
  border-right: none; background: var(--panel); color: var(--text); font-size: 14px;
}
.site-search button {
  border: 1px solid var(--border); background: var(--panel-2); padding: 6px 12px; border-radius: 0 2px 2px 0;
  cursor: pointer; color: var(--text);
}
.header-actions { display: flex; gap: 6px; font-size: 13px; }
.btn {
  padding: 6px 10px; border-radius: 2px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); cursor: pointer; font-weight: 600; font-size: 13px;
}
.btn:hover { background: var(--chip); text-decoration: none; }

/* Tab strip (section-level nav, styled like article/talk tabs) */
nav.tab-strip {
  font-size: 13px; background: var(--sidebar-bg); border-bottom: 1px solid var(--border);
  padding: 0 16px; display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
nav.tab-strip a {
  display: inline-block; padding: 8px 12px; color: var(--text); border: 1px solid transparent;
  border-bottom: none; white-space: nowrap;
}
nav.tab-strip a[aria-current="page"] {
  background: var(--content-bg); border-color: var(--border); border-radius: 2px 2px 0 0;
  margin-bottom: -1px; font-weight: 700;
}
nav.tab-strip a:not([aria-current="page"]):hover { background: var(--tab-inactive); text-decoration: none; }

/* Overall layout: left rail + content */
.shell { display: grid; grid-template-columns: 190px 1fr; max-width: 1200px; margin: 0 auto; }
main.content { padding: 20px 28px 60px; min-width: 0; background: var(--content-bg); border-left: 1px solid var(--border); }

aside.sidebar { background: var(--sidebar-bg); padding: 16px 12px; font-size: 13px; }
.sidebar-box { margin-bottom: 18px; }
.sidebar-box h2 {
  font-size: 12px; font-weight: 700; color: var(--muted); text-transform: none;
  border-bottom: 1px solid var(--border-light); padding-bottom: 4px; margin: 0 0 6px;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin-bottom: 5px; line-height: 1.3; }

.mobile-nav-toggle { display: none; }

.breadcrumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }

.hero {
  border: 1px solid var(--border); border-radius: 2px; padding: 24px; margin-bottom: 20px;
  background: var(--panel-2);
}
.hero h1 { margin: 0 0 8px; font-family: var(--font-heading); font-size: 28px; border-bottom: none; }
.hero p.lede { margin: 0; color: var(--muted); font-size: 15.5px; max-width: 640px; }

.chip {
  display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--chip);
  color: var(--text); font-size: 12px; margin: 3px 4px 0 0; border: 1px solid var(--border-light);
}
a.chip { color: var(--text); }
a.chip:hover { text-decoration: none; background: var(--border-light); }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar select, .filter-bar input {
  padding: 6px 8px; border-radius: 2px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 13px;
}

.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--border-light); border-radius: 2px; padding: 14px;
  display: flex; flex-direction: column; gap: 5px;
}
.card:hover { border-color: var(--border); }
.card h3 { margin: 0; font-size: 16px; font-family: var(--font-heading); }
.card .card-meta { font-size: 11.5px; color: var(--muted); }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; }

.stats-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 18px 0; }
.stat { background: var(--panel-2); border: 1px solid var(--border-light); border-radius: 2px; padding: 12px 16px; min-width: 110px; }
.stat .num { font-size: 24px; font-weight: 700; color: var(--text); font-family: var(--font-heading); }
.stat .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }

article.entity { background: var(--content-bg); padding: 0; }
article.entity h1 {
  margin: 0 0 6px; font-size: 28px; font-family: var(--font-heading); font-weight: normal;
  border-bottom: 1px solid var(--border); padding-bottom: 6px;
}
.entity-layout { display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: start; }
@media (max-width: 820px) { .entity-layout { grid-template-columns: 1fr; } .entity-layout > div:last-child { order: -1; max-width: 320px; } }

.infobox {
  border: 1px solid var(--border); border-radius: 2px; background: var(--panel-2);
  font-size: 13px; padding: 0; overflow: hidden; float: none;
}
.infobox .infobox-title {
  background: var(--panel-2); color: var(--text); padding: 8px 12px; font-weight: 700; font-size: 16px;
  font-family: var(--font-heading); text-align: center; border-bottom: 1px solid var(--border);
}
.infobox dl { margin: 0; padding: 0; }
.infobox dt {
  display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px;
  padding: 6px 12px 0;
}
.infobox dd {
  display: block; margin: 0; padding: 1px 12px 8px; border-bottom: 1px solid var(--border-light);
}
.infobox dd:last-child { border-bottom: none; }

.why-matters {
  border: 1px solid var(--border-light); border-left: 4px solid var(--text); padding: 10px 14px; margin: 14px 0 18px;
  background: var(--panel-2); font-style: italic; font-size: 14.5px;
}

.toc-box {
  display: inline-block; border: 1px solid var(--border); background: var(--panel-2);
  padding: 10px 20px; margin: 12px 0 20px; font-size: 13.5px;
}
.toc-box .toc-title { font-weight: 700; margin-bottom: 4px; }
.toc-box ol { margin: 0; padding-left: 20px; }

.entity-content h2 {
  font-family: var(--font-heading); font-weight: normal; font-size: 21px;
  border-bottom: 1px solid var(--border); padding-bottom: 4px; margin-top: 28px;
}
.entity-content h3 { font-size: 16px; margin-top: 18px; }
.entity-content ul, .entity-content ol { padding-left: 26px; }
.entity-content p { margin: 12px 0; }

.timeline-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.timeline-list li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border-light); }
.timeline-list li:first-child { border-top: none; }
.timeline-list .t-date { color: var(--text); font-weight: 700; }

.sources { margin-top: 22px; font-size: 13.5px; border-top: 1px solid var(--border); padding-top: 10px; }
.sources h2 { font-size: 18px; border: none; font-family: var(--font-heading); }
.sources ol { padding-left: 22px; }
.sources li { margin-bottom: 4px; }

.page-credit { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--border-light); font-size: 12.5px; color: var(--muted); }

.divider { height: 1px; background: var(--border); margin: 16px 0; }

footer.site-footer {
  font-size: 12px; color: var(--muted); padding: 20px 16px; border-top: 1px solid var(--border);
  margin-top: 20px; grid-column: 1 / -1;
}
footer.site-footer a { color: var(--muted); }

.no-results { color: var(--muted); }

.editorial-note {
  font-size: 12.5px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: 2px; padding: 8px 12px; margin: 16px 0;
}

.entity-content pre {
  background: var(--code-bg); border: 1px solid var(--border-light); border-radius: 2px;
  padding: 12px 14px; overflow-x: auto; font-family: "SF Mono", Consolas, monospace; font-size: 13px;
}
.entity-content code {
  background: var(--code-bg); border-radius: 2px; padding: 1px 5px;
  font-family: "SF Mono", Consolas, monospace; font-size: 0.9em;
}
.entity-content pre code { background: none; padding: 0; }
.entity-content table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 12px 0; }
.entity-content th, .entity-content td { border: 1px solid var(--border-light); padding: 6px 10px; text-align: left; }
.entity-content th { background: var(--panel-2); }
.entity-content blockquote { border-left: 3px solid var(--border); margin: 12px 0; padding: 4px 14px; color: var(--muted); }

/* Responsive: collapse sidebar into a <details> toggle below ~760px */
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  aside.sidebar.desktop-only { display: none; }
  main.content { border-left: none; padding: 16px 16px 40px; }
  .mobile-nav-toggle { display: block; background: var(--sidebar-bg); border-bottom: 1px solid var(--border); }
  .mobile-nav-toggle summary {
    padding: 10px 16px; font-size: 13px; font-weight: 700; cursor: pointer; list-style: none;
  }
  .mobile-nav-toggle summary::-webkit-details-marker { display: none; }
  .mobile-nav-toggle[open] summary::after { content: " \25B2"; }
  .mobile-nav-toggle:not([open]) summary::after { content: " \25BC"; }
  .mobile-nav-toggle .sidebar { padding-top: 0; }
  header.site-header { padding: 8px 12px; }
  .site-search { max-width: none; order: 3; flex-basis: 100%; margin-left: 0; margin-top: 6px; }
  .site-search input, .site-search button { font-size: 16px; } /* avoid iOS auto-zoom on focus */
  .filter-bar input, .filter-bar select { font-size: 16px; }
  .brand small { display: none; }
  article.entity h1 { font-size: 23px; }
  .hero h1 { font-size: 22px; }
  .infobox { font-size: 12.5px; }
}
@media (max-width: 420px) {
  body { font-size: 14px; }
  .header-actions .btn span.btn-label { display: none; }
}
