/* ==========================================================================
   BIOPUNK NEWS — wet lab terminal
   Palette and typography inherited from biopunk.community.
   ========================================================================== */

:root {
  --bg: #0a0a0a;
  --bg-2: #111210;
  --bg-3: #16170f;
  --ink: #f2efe6;
  --muted: #8a8a82;
  --dim: #bdbcb2;
  --line: #26261f;
  --acid: #b4ff00;
  --yellow: #ffd600;
  --pink: #ff6fa8;
  --cyan: #5fd7ff;
  --red: #ff4d4d;
  --mono: "Courier New", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Helvetica Neue", Arial, sans-serif;
  --rail: 34px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scanlines + a faint culture-dish grid, fixed behind everything. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.22;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 75%);
}
body::after {
  background: repeating-linear-gradient(
    to bottom,
    rgba(180, 255, 0, 0.025) 0px,
    rgba(180, 255, 0, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.6;
}
@media (prefers-reduced-motion: no-preference) {
  body::after { animation: drift 12s linear infinite; }
}
@keyframes drift {
  from { background-position: 0 0; }
  to { background-position: 0 60px; }
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--acid); }

.wrap { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 18px; position: relative; z-index: 1; }

.mono {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
}

/* --------------------------------------------------------------- masthead */

header.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 15px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.brand:hover { color: inherit; }
.brand .helix { width: 22px; height: 22px; display: block; }
.brand b { color: var(--acid); text-shadow: 0 0 14px rgba(180, 255, 0, 0.45); }
.brand .slash { color: var(--acid); opacity: 0.55; }

nav.tabs {
  display: flex;
  gap: 14px;
  flex: 1;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}
nav.tabs a { color: var(--muted); padding-bottom: 2px; border-bottom: 1px solid transparent; }
nav.tabs a:hover { color: var(--ink); }
nav.tabs a.on { color: var(--acid); border-bottom-color: var(--acid); }

.masthead .me {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.masthead .me .karma { color: var(--acid); }
.btn-nav {
  border: 1px solid var(--acid);
  color: var(--acid);
  padding: 6px 12px;
  white-space: nowrap;
}
.btn-nav:hover { background: var(--acid); color: #000; }

/* Ticker under the masthead — the "live culture" strip. */
.ticker {
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  height: 26px;
  display: flex;
  align-items: center;
}
.ticker .run { display: flex; gap: 34px; white-space: nowrap; padding-right: 34px; will-change: transform; }
@media (prefers-reduced-motion: no-preference) {
  .ticker .run { animation: ticker 42s linear infinite; }
}
/* The strip holds two identical copies, so -50% is one seamless loop. */
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker b { color: var(--acid); font-weight: 400; }

/* ------------------------------------------------------------------ layout */

main { flex: 1; padding: 22px 0 48px; position: relative; z-index: 1; }

.page-head { margin-bottom: 18px; border-left: 3px solid var(--acid); padding-left: 14px; }
.page-head h1 {
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.page-head p { color: var(--muted); font-size: 13px; margin-top: 5px; }

.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--acid);
  background: var(--bg-2);
  padding: 11px 14px;
  margin-bottom: 18px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.notice.error { border-left-color: var(--red); color: #ffb3b3; }

/* -------------------------------------------------------------- story list */

ol.feed { list-style: none; counter-reset: rank; }

li.story {
  display: grid;
  grid-template-columns: var(--rail) 16px 1fr;
  gap: 0 6px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(38, 38, 31, 0.55);
  align-items: baseline;
}
li.story:hover { background: rgba(180, 255, 0, 0.022); }

.rank {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: 4px;
  letter-spacing: 0.04em;
}

.voter {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  font-family: var(--mono);
  transition: color 0.15s, text-shadow 0.15s, transform 0.15s;
}
.voter:hover { color: var(--acid); text-shadow: 0 0 8px var(--acid); transform: translateY(-1px); }
.voter[aria-pressed="true"] { color: var(--acid); text-shadow: 0 0 8px var(--acid); }
.voter[disabled] { cursor: default; opacity: 0.25; }
.voter[disabled]:hover { color: var(--muted); text-shadow: none; transform: none; }
.voter.pulse { animation: pulse 0.45s ease-out; }
@keyframes pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.55) translateY(-2px); }
  100% { transform: scale(1); }
}

.title-line { font-size: 15.5px; line-height: 1.35; }
.title-line a.title { color: var(--ink); }
.title-line a.title:visited { color: #a9a89f; }
.title-line a.title:hover { color: var(--acid); }
.sitebit { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.sitebit a:hover { color: var(--acid); text-decoration: underline; }

.tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: 1px;
  white-space: nowrap;
}
.tag:hover { border-color: var(--acid); color: var(--acid); }
.tag.ask { border-color: var(--yellow); color: var(--yellow); }
.tag.show { border-color: var(--pink); color: var(--pink); }
.tag.dead { border-color: var(--red); color: var(--red); }

.subline {
  grid-column: 3;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 0 5px;
  align-items: center;
}
.subline .pts { color: var(--acid); }
li.story:nth-child(-n + 3) .rank { color: var(--acid); }
.subline a:hover { color: var(--acid); text-decoration: underline; }
.subline form { display: inline; }
.subline button.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  letter-spacing: inherit;
}
.subline button.linkish:hover { color: var(--acid); text-decoration: underline; }
.sep { opacity: 0.4; }

li.story.is-dead .title-line a.title { color: var(--muted); text-decoration: line-through; }

.text-body { grid-column: 3; margin-top: 8px; color: var(--dim); font-size: 14px; line-height: 1.6; }
.text-body p { margin-bottom: 10px; }
.text-body p:last-child { margin-bottom: 0; }
.text-body a { color: var(--cyan); text-decoration: underline; }
.text-body code {
  font-family: var(--mono);
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 0 4px;
  font-size: 13px;
}

/* ---------------------------------------------------------------- comments */

.thread { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }

.comment {
  padding: 10px 0 10px 0;
  border-bottom: 1px solid rgba(38, 38, 31, 0.4);
}
.comment .chead {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
  flex-wrap: wrap;
}
.comment .chead .voter { margin-right: 2px; }
.comment .cbody { margin-top: 7px; color: var(--dim); font-size: 14px; line-height: 1.62; }
.comment .cbody p { margin-bottom: 10px; }
.comment .cbody p:last-child { margin-bottom: 0; }
.comment .cbody a { color: var(--cyan); text-decoration: underline; }
.comment.deleted .cbody { color: var(--muted); font-style: italic; }
.comment.op .chead .who { color: var(--acid); }
.comment[data-depth] { border-left: 1px solid var(--line); padding-left: 12px; }
.comment.collapsed .cbody,
.comment.collapsed .cfoot { display: none; }
.toggle { cursor: pointer; color: var(--muted); }
.toggle:hover { color: var(--acid); }
.cfoot { margin-top: 7px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); display: flex; gap: 10px; }
.cfoot a:hover, .cfoot button.linkish:hover { color: var(--acid); }
.cfoot button.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }

/* ------------------------------------------------------------------- forms */

form.stack { max-width: 620px; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.field .hint { color: var(--muted); font-size: 12px; margin-top: 5px; font-family: var(--mono); letter-spacing: 0.04em; }

input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13.5px;
  padding: 10px 12px;
  outline: none;
  border-radius: 0;
}
textarea { line-height: 1.6; resize: vertical; min-height: 110px; }
input:focus, textarea:focus, select:focus { border-color: var(--acid); box-shadow: 0 0 0 1px rgba(180, 255, 0, 0.35); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--acid) 50%), linear-gradient(135deg, var(--acid) 50%, transparent 50%); background-position: right 14px center, right 8px center; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.btn.solid { background: var(--acid); color: #000; border-color: var(--acid); font-weight: 700; }
.btn.solid:hover { background: #cdff4d; color: #000; }
.btn.ghost:hover { background: var(--ink); color: #000; }
.btn.small { padding: 7px 13px; font-size: 10px; }

.searchbar { display: flex; gap: 8px; margin-bottom: 20px; }
.searchbar input { flex: 1; }

/* ------------------------------------------------------------------- misc */

.topics { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.topics a {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 5px 10px;
}
.topics a:hover { border-color: var(--acid); color: var(--acid); }
.topics a.on { border-color: var(--acid); color: #000; background: var(--acid); }

.more { margin-top: 22px; display: flex; gap: 14px; }

.empty {
  border: 1px dashed var(--line);
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile { display: grid; grid-template-columns: 120px 1fr; gap: 10px 18px; max-width: 640px; font-size: 14px; }
.profile dt { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.profile dd { color: var(--dim); }

.statstrip { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 20px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.statstrip b { color: var(--acid); font-weight: 400; }

footer.foot {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
  position: relative;
  z-index: 1;
}
footer.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
footer.foot a:hover { color: var(--acid); }
footer.foot .tagline { width: 100%; text-align: center; color: #4d4d47; margin-top: 12px; letter-spacing: 0.2em; }

/* --------------------------------------------------------------- responsive */

@media (max-width: 720px) {
  :root { --rail: 24px; }
  .masthead .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  nav.tabs { order: 3; width: 100%; gap: 12px; }
  .title-line { font-size: 15px; }
  .profile { grid-template-columns: 1fr; gap: 2px; }
  .profile dd { margin-bottom: 12px; }
}
