/* stonkbrokers.wiki - community wiki design system */
:root {
  --bg: #131110;
  --panel: #1a1816;
  --panel2: #211e1b;
  --line: #2e2a26;
  --line2: #3b362f;
  --ink: #e9e5de;
  --muted: #a39b8f;
  --faint: #6e675d;
  --red: #d24036;
  --yellow: #f2c230;
  --silver: #f4f2ee;
  --link: #e0b98a;
  --radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.sans { font-family: "Barlow", "Helvetica Neue", Arial, sans-serif; }
.cond { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; }

a { color: var(--link); text-decoration-color: #5e4f3c; text-underline-offset: 3px; }
a:hover { color: var(--yellow); }

/* Top strip */
.topstrip {
  background: #0b0a09;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: "Barlow", sans-serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 8px 20px;
  text-align: center;
}
.topstrip b { color: var(--ink); font-weight: 600; }

/* Shell */
.shell { display: flex; min-height: 100vh; max-width: 1240px; margin: 0 auto; }
aside {
  width: 264px; flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: 26px 0 30px;
  display: flex; flex-direction: column;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 0 22px 22px;
  text-decoration: none; color: var(--silver);
}
.brand img { width: 34px; height: 34px; border-radius: 50%; }
.brand .t {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700; font-size: 20px; letter-spacing: 0.05em;
}
.brand .t em { font-style: normal; color: var(--red); }
.brand .s { display: block; font-family: "Barlow", sans-serif; font-size: 10px; letter-spacing: 0.28em; color: var(--faint); font-weight: 500; }

.burger {
  display: none;
  background: none; border: 1px solid var(--line2); border-radius: 7px;
  padding: 8px 10px; cursor: pointer; color: var(--ink);
}
.burger svg { display: block; }

nav.wiki { flex: 1; }
.navlabel {
  font-family: "Barlow", sans-serif;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--faint);
  padding: 18px 24px 7px;
}
.navitem {
  display: block;
  font-family: "Barlow", sans-serif;
  font-size: 14.5px;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 24px 7px 21px;
  border-left: 3px solid transparent;
}
.navitem:hover { color: var(--ink); background: #191714; }
.navitem.active { color: var(--silver); border-left-color: var(--red); background: #1b1815; }

.side-foot { padding: 22px 24px 0; font-family: "Barlow", sans-serif; font-size: 12.5px; color: var(--faint); }
.side-foot a { color: var(--faint); text-decoration: none; }
.side-foot a:hover { color: var(--muted); }

/* Main */
main { flex: 1; min-width: 0; padding: 34px 48px 70px; max-width: 850px; }
.crumb {
  font-family: "Barlow", sans-serif;
  font-size: 13px; color: var(--faint);
  margin-bottom: 26px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.crumb .path b { color: var(--muted); font-weight: 500; }
.stamp { color: var(--faint); }

h1 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700; font-size: clamp(34px, 4.5vw, 46px);
  letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--silver);
  line-height: 1.05;
  margin-bottom: 10px;
}
h1 .accent { color: var(--red); }
.standfirst {
  font-size: 18.5px; color: var(--muted); font-style: italic;
  margin-bottom: 30px; max-width: 640px;
}
h2 {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600; font-size: 26px; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--silver);
  margin: 38px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
h3 {
  font-family: "Barlow", sans-serif;
  font-weight: 600; font-size: 16.5px;
  color: var(--ink);
  margin: 24px 0 8px;
}
p { margin-bottom: 14px; }
ul, ol { margin: 0 0 14px 22px; }
li { margin-bottom: 7px; }
strong { color: var(--silver); }

/* Wiki furniture */
.callout {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--yellow);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 18px 0;
  font-size: 15.5px;
}
.callout .lbl {
  font-family: "Barlow", sans-serif;
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--yellow);
  display: block; margin-bottom: 6px;
}
.callout.warn { border-left-color: var(--red); }
.callout.warn .lbl { color: var(--red); }

.factbox {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 18px 0;
  overflow: hidden;
}
.factbox table { width: 100%; border-collapse: collapse; font-family: "Barlow", sans-serif; font-size: 14.5px; }
.factbox th, .factbox td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.factbox tr:last-child th, .factbox tr:last-child td { border-bottom: none; }
.factbox th { color: var(--faint); font-weight: 500; width: 40%; }
.factbox td { color: var(--ink); overflow-wrap: anywhere; }
.factbox .num { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13.5px; word-break: break-all; }

.tablewrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); }
.tablewrap table { width: 100%; border-collapse: collapse; font-family: "Barlow", sans-serif; font-size: 14px; min-width: 480px; }
.tablewrap th { background: var(--panel2); color: var(--muted); font-weight: 600; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line2); }
.tablewrap td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tablewrap tr:last-child td { border-bottom: none; }

.term { border-bottom: 1px dotted var(--faint); cursor: help; }

code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; word-break: break-all; }
main { overflow-wrap: break-word; }
.callout, .factbox, .log-entry { overflow-wrap: anywhere; }

.src { font-family: "Barlow", sans-serif; font-size: 12.5px; color: var(--faint); }
.src a { color: var(--faint); }

.pagenav {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 46px; padding-top: 18px; border-top: 1px solid var(--line);
  font-family: "Barlow", sans-serif; font-size: 14px;
}
.pagenav a { text-decoration: none; color: var(--muted); }
.pagenav a:hover { color: var(--yellow); }
.pagenav .dir { display: block; font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--faint); }

/* Footer */
footer {
  border-top: 1px solid var(--line);
  margin-top: 50px; padding-top: 22px;
  font-family: "Barlow", sans-serif; font-size: 13.5px; color: var(--faint);
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
}
footer .links { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--ink); }
.can-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; color: var(--yellow) !important;
  border: 1px solid #4a3c14;
  font-weight: 600; font-size: 12px; letter-spacing: 0.04em;
  border-radius: 6px; padding: 5px 10px;
  text-decoration: none;
}
.can-btn:hover { border-color: var(--yellow); color: #ffd34d !important; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-family: "Barlow", sans-serif; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input, .field textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--line2); border-radius: 7px;
  color: var(--ink); font-family: "Barlow", sans-serif; font-size: 15px; padding: 10px 12px;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--yellow); }
.btn {
  display: inline-block; background: var(--silver); color: #14100a;
  font-family: "Barlow", sans-serif; font-weight: 600; font-size: 14.5px;
  border: none; border-radius: 7px; padding: 11px 22px; cursor: pointer;
}
.btn:hover { background: #fff; }

/* Hero (Start Here) */
.hero-banner { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 30px; }
.hero-banner img { display: block; width: 100%; height: auto; }

/* Glossary */
dl.gloss dt {
  font-family: "Barlow", sans-serif; font-weight: 600; color: var(--silver);
  margin-top: 18px; font-size: 16px;
}
dl.gloss dd { margin-left: 0; color: var(--muted); font-size: 15.5px; }

/* Changelog */
.log { border-left: 2px solid var(--line2); margin: 20px 0 20px 6px; padding-left: 22px; }
.log-entry { position: relative; margin-bottom: 22px; }
.log-entry::before {
  content: ""; position: absolute; left: -28px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--bg);
}
.log-date { font-family: "Barlow", sans-serif; font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.log-entry h3 { margin: 2px 0 4px; }
.log-entry p { font-size: 15px; color: var(--muted); margin-bottom: 0; }

@media (max-width: 640px) {
  .tablewrap table { font-size: 12.5px; min-width: 420px; }
  .tablewrap th, .tablewrap td { padding: 8px 10px; }
  .factbox tr { display: block; padding: 4px 0; border-bottom: 1px solid var(--line); }
  .factbox tr:last-child { border-bottom: none; }
  .factbox th, .factbox td { display: block; width: auto; border-bottom: none; padding: 2px 16px; }
  .factbox th {
    padding-top: 9px;
    font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  }
  .factbox td { padding-bottom: 9px; }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  aside {
    width: 100%; border-right: none; border-bottom: 1px solid var(--line);
    flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between;
    padding: 12px 16px;
  }
  .brand { padding: 0; }
  .burger { display: block; }
  nav.wiki, .side-foot { display: none; }
  aside.open nav.wiki { display: block; flex-basis: 100%; padding-top: 8px; }
  aside.open .side-foot { display: block; flex-basis: 100%; padding: 14px 8px 4px; border-top: 1px solid var(--line); margin-top: 10px; }
  main { padding: 24px 18px 56px; }
}
