/* Hackerboard */

:root {
  --bg:         #ffffff;
  --text:       #1a1a1a;
  --dim:        #888;
  --accent:     #c2387e;
  --hdr-bg:     #5c2d91;
  --hdr-border: #000;      /* border along header bottom + around active tab */
  --border:     #e8e2f0;
  --tag-bg:     #f3eefb;
  --item-bg:    #fce9f3;
  --tc:         rgba(255,255,255,0.72);  /* inactive tab text */

  /* Monospace: used for logo, tags, retro UI chrome */
  --font-mono: ui-monospace, Menlo, Consolas, 'Courier New', monospace;
  /* Reading font: native system sans-serif, optimised for screen legibility */
  --font-read: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* Alias kept for retro elements that relied on --font */
  --font: var(--font-mono);
}

[data-theme="dark"] {
  --bg:         #1c1c26;
  --text:       #ece6f8;
  --dim:        #9898b0;
  --accent:     #d9539a;
  --hdr-bg:     #3a1c62;
  --hdr-border: #000;
  --border:     #32284a;
  --tag-bg:     #221630;
  --item-bg:    #38183a;
  --tc:         rgba(255,255,255,0.62);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 13px; }

body {
  font-family: var(--font-read);
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a         { color: var(--text); text-decoration: none; }
a:hover   { text-decoration: underline; }
a:visited { color: var(--dim); }

/* ── Top bar ────────────────────────────────────────────── */

header {
  background: var(--hdr-bg);
  border-bottom: 2px solid var(--hdr-border);
  box-shadow: inset 0 -5px 6px -3px rgba(0,0,0,0.4);
}

.hi {
  padding: 12px 16px 0;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

/* Logo: monospace + vertically centred in the available chrome space */
.hname {
  align-self: center;
  font-family: var(--font-mono);
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 0.03em;
  color: #fff !important;
  margin-right: 10px;
  white-space: nowrap;
}

.hname:visited { color: #fff !important; }
.hname:hover   { text-decoration: none; }

/* ── Tabs ───────────────────────────────────────────────── */

.tab {
  position: relative;
  bottom: -2px;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 0 15px;
  height: 26px;
  font-size: 12px;
  font-weight: bold;
  color: var(--tc);
  background: transparent;
  border: 2px solid transparent;
  white-space: nowrap;
}

.tab:hover    { color: #fff; text-decoration: none; }
.tab:visited  { color: var(--tc); }

.tab.active {
  background: var(--bg);
  border-color: var(--hdr-border);
  border-bottom-color: var(--bg);
  color: var(--text);
  font-weight: bold;
  box-shadow: 5px 4px 8px -3px rgba(0,0,0,0.55);
}

/* Mask the shadow bleed into the white content area below the tab.
   The content box is 22px tall (26px height - 2px top border - 2px bottom border),
   so top:22px lands exactly at the bottom border and we extend further down. */
.tab.active::after {
  content: '';
  position: absolute;
  top: 24px;
  left: -2px;
  right: -10px;
  bottom: -10px;
  background: var(--bg);
  pointer-events: none;
}

/* Right-side controls stay vertically centered */
.hright {
  align-self: center;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hright a {
  font-size: 12px;
  color: var(--tc);
}

.hright a:hover   { color: #fff; text-decoration: none; }
.hright a:visited { color: var(--tc); }

.hdark {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 0;
}

.hdark:hover { color: #fff; }

/* ── Main ──────────────────────────────────────────────── */

main {
  padding: 14px 12px 28px;
  flex: 1;
}

/* ── Post list ─────────────────────────────────────────── */

.posts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.posts li {
  background: var(--item-bg);
  padding: 10px 14px;
}

.pt { font-size: 13px; line-height: 1.4; }
.pt a {
  color: var(--text);
}
.posts .pt a:visited {
  color: #5f545f;
}
[data-theme="dark"] .posts .pt a:visited {
  color: #d8d0e4;
}

.dom {
  font-size: 11px;
  color: var(--dim);
  margin-left: 6px;
  font-family: var(--font-mono);
}

.pm {
  font-size: 11px;
  color: var(--dim);
  margin-top: 3px;
  font-family: var(--font-mono);
}

.pm a          { color: var(--dim); }
.pm a:hover    { color: var(--text); text-decoration: none; }
.pm a:visited  { color: var(--dim); }

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  background: var(--tag-bg);
  border: 1px solid var(--border);
  padding: 0 3px;
  line-height: 1.4;
  margin-left: 2px;
}

/* ── Post detail ───────────────────────────────────────── */

article { padding: 10px 0; }

article h1.pt {
  font-size: 15px;
  font-weight: normal;
  margin-bottom: 5px;
}

article .pm { padding-left: 0; }

.pdesc {
  margin: 12px 0;
  font-size: 13px;
  color: var(--dim);
  max-width: 72ch;
  line-height: 1.65;
}

.ptags { margin: 8px 0; }

.pact { margin-top: 14px; font-size: 12px; font-family: var(--font-mono); }

.upvote         { color: var(--accent) !important; }
.upvote:visited { color: var(--accent) !important; }

/* ── Submit page ───────────────────────────────────────── */

.submit-wrap {
  padding: 4px 0 48px;
}

.submit-wrap h1 {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
  font-family: var(--font-mono);
}

.submit-wrap h2 {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--accent);
  margin: 24px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.submit-wrap p,
.submit-wrap li {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}

.submit-wrap ul {
  list-style: disc;
  padding-left: 1.4em;
}

.submit-wrap ul li { margin-bottom: 4px; }

.submit-cta {
  margin: 40px 0 0;
}

.cta-btn {
  display: inline-block;
  background: var(--hdr-bg);
  color: #fff !important;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: bold;
  padding: 13px 36px;
  text-decoration: none !important;
  letter-spacing: 0.04em;
  transition: opacity 0.15s;
}

.cta-btn:hover   { opacity: 0.85; text-decoration: none !important; }
.cta-btn:visited { color: #fff !important; }

/* ── Footer ────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 8px 20px;
  font-size: 11px;
  color: var(--dim);
  text-align: center;
  font-family: var(--font-mono);
}

footer a          { color: var(--dim); }
footer a:visited  { color: var(--dim); }

/* ── Mobile ────────────────────────────────────────────── */

@media (max-width: 560px) {
  html { font-size: 12px; }
  .pm  { padding-left: 0; }
  main { padding: 10px; }
  .tab { padding: 0 10px; }
}
