/* StarkGen board — light-blue news desk */
:root {
  --sky: #E2F0FB;        /* page */
  --sky-deep: #C5E1F6;   /* rules, quiet fills */
  --cloud: #8EC5F0;      /* accents on navy */
  --ink: #0A2647;        /* text, masthead */
  --ink-soft: #3C5675;
  --wire: #1D5FD1;       /* links, upvote, primary */
  --alert: #D62839;      /* downvote, report, removal */
  --sheet: #FFFFFF;

  --sans: "Archivo", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --wrap: 1180px;
  --gap: clamp(16px, 3vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--sky); color: var(--ink);
  font: 400 16px/1.5 var(--sans); font-variation-settings: "wdth" 100;
}
img, video { max-width: 100%; display: block; }
a { color: var(--wire); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--wire); outline-offset: 2px; border-radius: 2px; }
button { font: inherit; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

.demo-bar { margin: 0; background: #FFD166; color: var(--ink); text-align: center; font-size: 13px; padding: 6px 12px; }

/* ---------- masthead ---------- */
.masthead { background: var(--ink); color: #fff; }
.masthead-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 14px var(--gap) 12px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.wordmark {
  color: #fff; text-decoration: none; line-height: .82;
  font-weight: 900; font-variation-settings: "wdth" 125;
  font-size: clamp(34px, 6.4vw, 68px); letter-spacing: -0.03em;
}
.wordmark:hover { color: var(--cloud); }
.brand { display: grid; gap: 6px; }
.slogan { margin: 0; font: italic 500 clamp(15px, 1.7vw, 19px)/1.2 var(--serif); color: var(--cloud); }
.nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; padding-bottom: 4px; }
.nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; padding: 4px 0; border-bottom: 3px solid transparent; }
.nav a:hover, .nav a[aria-current] { border-bottom-color: var(--cloud); }
.nav .acct { color: var(--cloud); }
.btn-ghost { background: none; border: 2px solid var(--cloud); color: #fff; padding: 5px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.btn-ghost:hover { background: var(--cloud); color: var(--ink); }

/* ---------- story hero (the loud part) ---------- */
.story { border-bottom: 6px solid var(--ink); }
.story-inner { max-width: var(--wrap); margin: 0 auto; padding: clamp(28px, 5vw, 64px) var(--gap) clamp(28px, 4vw, 48px); }
.story-date { margin: 0 0 14px; font: italic 500 clamp(17px, 1.8vw, 21px)/1.3 var(--serif); color: var(--ink-soft); }
.story-headline {
  margin: 0; max-width: 17ch;
  font-weight: 850; font-variation-settings: "wdth" 66;
  font-size: clamp(44px, 8.6vw, 116px); line-height: .9; letter-spacing: -0.012em;
  text-wrap: balance;
  animation: rise .7s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(0 0 -10% 0); } }
.story-dek { margin: 22px 0 0; max-width: 46ch; font: 400 clamp(20px, 2.2vw, 26px)/1.35 var(--serif); }
.story-body { margin-top: 26px; display: grid; gap: 24px; max-width: 980px; }
.story-body.has-img { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.story-fig { margin: 0; }
.story-fig img { width: 100%; border: 2px solid var(--ink); }
.story-fig figcaption { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.story-summary { margin: 0; max-width: 64ch; font: 400 18px/1.62 var(--serif); }
.story-source { margin: 14px 0 0; font-weight: 600; }

/* ---------- board layout ---------- */
.board {
  max-width: var(--wrap); margin: 0 auto; padding: clamp(24px, 4vw, 40px) var(--gap) 64px;
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(24px, 4vw, 48px); align-items: start;
}
.feed-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.feed-head h2, .jump, .sort button { white-space: nowrap; }
.feed-head h2, .submit h2, .house-rules h2, .comments h2, .sub {
  margin: 0; font-weight: 800; font-variation-settings: "wdth" 80; font-size: 30px; line-height: 1; letter-spacing: -0.01em;
}
.feed-tools { display: flex; gap: 10px; align-items: center; }
.jump { display: none; background: var(--wire); color: #fff; border: 0; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px; }
.sort { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.sort button { border: 0; background: transparent; color: var(--ink); padding: 6px 16px; font-weight: 700; font-size: 14px; }
.sort button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.entries > li.loading, .empty { color: var(--ink-soft); font-style: italic; font-family: var(--serif); font-size: 18px; }

/* entry: rank, vote rail, clipping */
.entry { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 0 14px; align-items: start; }
.entry:not(:has(.rank)) { grid-template-columns: auto minmax(0, 1fr); }
.rank {
  font-weight: 900; font-variation-settings: "wdth" 62; font-size: 64px; line-height: .8;
  color: var(--sky-deep); -webkit-text-stroke: 1.5px var(--ink); min-width: 1.1ch; text-align: right; padding-top: 6px;
}
.entries li:first-child .rank { color: var(--wire); -webkit-text-stroke: 0; }
.vote { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 4px; }
.vote button { width: 38px; height: 34px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 6px; color: var(--ink-soft); }
.vote button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.vote button:hover { background: var(--sheet); color: var(--ink); }
.v-up.on { color: var(--wire); } .v-up.on svg { fill: var(--wire); stroke: var(--wire); }
.v-down.on { color: var(--alert); } .v-down.on svg { fill: var(--alert); stroke: var(--alert); }
.score { font-weight: 800; font-variation-settings: "wdth" 70; font-size: 22px; line-height: 1; min-width: 3ch; text-align: center; font-variant-numeric: tabular-nums; }
.score.bump { animation: bump .28s ease-out; }
@keyframes bump { 40% { transform: scale(1.25); } }

.entry-main { background: var(--sheet); border: 2px solid var(--ink); padding: 16px 18px 12px; box-shadow: 5px 5px 0 var(--ink); }
.entry-title { margin: 0 0 12px; font-weight: 750; font-variation-settings: "wdth" 85; font-size: 23px; line-height: 1.12; text-wrap: balance; }
.entry-title a { color: var(--ink); text-decoration: none; }
.entry-title a:hover { color: var(--wire); }
.entry-title.big { font-size: clamp(30px, 4.4vw, 52px); font-variation-settings: "wdth" 70; font-weight: 850; line-height: .98; }
.media { margin: 0; position: relative; background: var(--ink); }
.media img, .media video { width: 100%; max-height: 560px; object-fit: contain; margin: 0 auto; }
.entry-full .media img, .entry-full .media video { max-height: 78vh; }
.ai-tag { position: absolute; left: 0; bottom: 0; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 9px; }
.media-link { display: block; }
.caption { margin: 12px 0 0; font: 400 17px/1.5 var(--serif); }
.meta { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--ink-soft); }
.meta b { color: var(--ink); font-weight: 650; }
.link { background: none; border: 0; padding: 0; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; font-size: 14px; }
.link:hover { color: var(--alert); }

/* ---------- sidebar ---------- */
.side { position: sticky; top: 16px; display: grid; gap: 22px; }
.submit { background: var(--ink); color: #fff; padding: 22px; }
.submit h2 { color: #fff; }
.submit-lede { margin: 8px 0 16px; font: 400 17px/1.4 var(--serif); color: var(--sky-deep); }
.submit label { color: #fff; }
.submit .opt { color: var(--cloud); }
.submit a { color: var(--cloud); }
.house-rules { border-top: 6px solid var(--ink); padding-top: 14px; }
.house-rules ul { margin: 12px 0 0; padding-left: 20px; font: 400 17px/1.45 var(--serif); }
.house-rules li { margin-bottom: 6px; }
.house-rules li::marker { color: var(--wire); }

/* ---------- forms ---------- */
.stack { display: grid; gap: 6px; }
.stack label { font-weight: 650; font-size: 14px; margin-top: 8px; }
.opt { font-weight: 400; color: var(--ink-soft); }
input, textarea, select {
  font: inherit; font-size: 16px; color: var(--ink); width: 100%;
  background: var(--sheet); border: 2px solid var(--ink); border-radius: 0; padding: 9px 11px;
}
textarea { resize: vertical; font-family: var(--serif); font-size: 17px; }
input[type=file] { padding: 8px; background: var(--sky); }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--cloud); outline-offset: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: 14px; line-height: 1.4; margin-top: 12px !important; }
.check input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--wire); }
.preview { border: 2px solid var(--cloud); }
.preview img, .preview video { width: 100%; max-height: 200px; object-fit: cover; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row input, .row select { flex: 1 1 180px; width: auto; }

.btn { border: 2px solid var(--ink); padding: 11px 18px; font-weight: 750; font-size: 16px; border-radius: 0; background: var(--sheet); color: var(--ink); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--wire); border-color: var(--wire); color: #fff; }
.btn-primary:hover { background: #164ca8; border-color: #164ca8; }
.submit .btn-primary { margin-top: 14px; border-color: #fff; box-shadow: 4px 4px 0 var(--cloud); }
.submit .btn-primary:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--cloud); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--wire); border-color: var(--wire); }
.btn-line:hover { background: var(--sky); }
.btn-alert { background: var(--alert); border-color: var(--alert); color: #fff; }
.btn-wide { width: 100%; }

/* ---------- ad slots ---------- */
.ad-slot { display: grid; place-items: center; background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(10,38,71,.05) 10px 20px); border: 2px dashed var(--ink-soft); color: var(--ink-soft); font-size: 12px; min-height: 250px; }
.ad-slot[hidden] { display: none; }
.ad-leader { max-width: 970px; min-height: 90px; margin: 16px auto 0; }
.entries > .ad-slot { min-height: 120px; }

/* ---------- post page & comments ---------- */
.post-page { max-width: 860px; margin: 0 auto; padding: 28px var(--gap) 64px; }
.crumb { margin: 0 0 20px; font: italic 500 18px/1.3 var(--serif); }
.crumb a { color: var(--ink-soft); }
.notice { background: #FFF4CC; border-left: 6px solid #E0A800; padding: 10px 14px; margin: 0 0 18px; }
.comments { margin-top: 40px; border-top: 6px solid var(--ink); padding-top: 16px; }
.c-form { display: grid; gap: 8px; margin: 14px 0 22px; }
.c-actions { display: flex; justify-content: flex-end; gap: 14px; align-items: center; }
.thread, .kids { list-style: none; margin: 0; padding: 0; }
.kids { margin-left: 18px; padding-left: 16px; border-left: 3px solid var(--sky-deep); }
.kids.flat { margin-left: 0; padding-left: 0; border: 0; }
.comment { padding: 12px 0 4px; }
.c-meta { margin: 0; display: flex; gap: 12px; font-size: 14px; color: var(--ink-soft); }
.c-meta b { color: var(--ink); }
.c-body { margin: 4px 0 6px; font: 400 18px/1.55 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 68ch; }
.c-tools { margin: 0; display: flex; gap: 14px; }

/* ---------- inner pages ---------- */
.page { max-width: var(--wrap); margin: 0 auto; padding: 36px var(--gap) 64px; }
.page.narrow { max-width: 760px; }
.page-title { margin: 0 0 20px; font-weight: 850; font-variation-settings: "wdth" 66; font-size: clamp(44px, 7vw, 84px); line-height: .92; }
.sub { font-size: 26px; margin: 34px 0 12px; }
.lede { font: 400 19px/1.5 var(--serif); }
.archive { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--ink); }
.archive a { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--sky-deep); color: var(--ink); text-decoration: none; }
.archive a:hover span { color: var(--wire); }
.archive time { font: italic 500 16px/1.4 var(--serif); color: var(--ink-soft); }
.archive span { font-weight: 750; font-variation-settings: "wdth" 80; font-size: 22px; line-height: 1.15; }
.mine { list-style: none; padding: 0; margin: 0; }
.mine li { padding: 10px 0; border-bottom: 1px solid var(--sky-deep); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.mine .fine { flex-basis: 100%; margin: 0; }
.status { font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--sky-deep); }
.s-live { background: #D2F2DD; } .s-removed { background: #FAD4D8; color: var(--alert); } .s-pending { background: #FFF0B8; }
.inline-form { max-width: 520px; }
.desk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 40px; align-items: start; }
.desk .sub:first-child { margin-top: 0; }
.desk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.desk-stories { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--ink); }
.desk-stories li { display: grid; grid-template-columns: 96px 1fr auto auto; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--sky-deep); font-size: 15px; }
.desk-stories time { font: italic 500 15px/1.3 var(--serif); color: var(--ink-soft); }
.desk-stories span { font-weight: 650; }
.desk-fields { border: 2px dashed var(--cloud); padding: 4px 12px 12px; margin: 10px 0 0; display: grid; gap: 6px; }
.desk-fields legend { font-size: 13px; font-weight: 700; padding: 0 6px; color: var(--wire); }
.submit .desk-fields legend { color: var(--cloud); }
.btn-sm { padding: 8px 12px; font-size: 14px; }
.c-form .desk-fields label { font-weight: 650; font-size: 14px; }
.desk-item { background: var(--sheet); border: 2px solid var(--ink); padding: 14px; }
.desk-item p { margin: 6px 0; }
.desk-item .media img { max-height: 260px; }
.empty-state { max-width: var(--wrap); margin: 0 auto; padding: 64px var(--gap); }
.empty-state p { font: 400 20px/1.5 var(--serif); }

/* ---------- tips ---------- */
.tips p, .tips li { font: 400 18px/1.6 var(--serif); max-width: 66ch; }
.tips .sub { margin-top: 40px; }
.tips-list { padding-left: 22px; }
.tips-list li { margin-bottom: 10px; }
.tips-list li::marker { color: var(--wire); font-family: var(--sans); font-weight: 800; }
.tips-list b { font-family: var(--sans); font-weight: 700; }
.tip-ex { margin: 18px 0; background: var(--sheet); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); padding: 14px 18px; }
.tip-ex figcaption { font-weight: 750; font-size: 14px; color: var(--wire); margin-bottom: 4px; }
.tip-ex p { margin: 0; font: 400 16px/1.55 var(--sans); }
.tips-cta { margin-top: 36px; }
.tips-cta .btn { display: inline-block; text-decoration: none; font: 750 16px/1.2 var(--sans); }

/* ---------- about ---------- */
.about p, .about li { font: 400 18px/1.6 var(--serif); max-width: 66ch; }
.about .sub { margin-top: 40px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 18px 0 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; background: var(--sheet); border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); padding: 14px 18px 14px 12px; }
.steps li::before { content: counter(step); font: 900 44px/.85 var(--sans); font-variation-settings: "wdth" 62; color: var(--wire); text-align: right; }
.steps b { font-family: var(--sans); font-weight: 750; display: block; font-size: 18px; margin-bottom: 2px; }
.about .facts { padding-left: 22px; }
.about .facts li { margin-bottom: 8px; }
.about .facts li::marker { color: var(--wire); }

/* ---------- leaderboard ---------- */
.lb-toggle { margin: 6px 0 22px; }
.lb { list-style: none; margin: 0; padding: 0; border-top: 6px solid var(--ink); }
.lb li { display: grid; grid-template-columns: 64px 1fr auto 72px; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--sky-deep); }
.lb-rank { font-weight: 900; font-variation-settings: "wdth" 62; font-size: 40px; line-height: .9; text-align: right; color: var(--sky-deep); -webkit-text-stroke: 1.5px var(--ink); }
.lb li:nth-child(-n+3) .lb-rank { color: var(--wire); -webkit-text-stroke: 0; }
.lb-name { font-weight: 750; font-variation-settings: "wdth" 85; font-size: 22px; overflow-wrap: anywhere; }
.lb-name small { font-size: 12px; font-weight: 700; background: var(--wire); color: #fff; padding: 1px 7px; border-radius: 999px; vertical-align: middle; }
.lb-score { font-size: 15px; color: var(--ink-soft); white-space: nowrap; }
.lb-score b { font-weight: 850; font-variation-settings: "wdth" 70; font-size: 24px; color: var(--ink); }
.lb-posts { font-size: 14px; color: var(--ink-soft); text-align: right; white-space: nowrap; }
.lb li.is-me { background: var(--sheet); }
.lb-note { margin-top: 22px; }
@media (max-width: 560px) {
  .lb li { grid-template-columns: 44px 1fr auto; }
  .lb-posts { display: none; }
  .lb-rank { font-size: 32px; }
}

/* ---------- modal & toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 38, 71, .55); z-index: 40; }
.modal {
  position: fixed; z-index: 41; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto;
  background: var(--sheet); border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--wire); padding: 26px 24px 22px;
}
.modal-x { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; border: 0; background: none; color: var(--ink); display: grid; place-items: center; }
.modal-x svg { width: 20px; height: 20px; }
.modal-title { margin: 0 34px 8px 0; font-weight: 850; font-variation-settings: "wdth" 70; font-size: 36px; line-height: .95; }
.modal-lede { margin: 0 0 12px; font: 400 18px/1.45 var(--serif); }
.fine { font-size: 13px; color: var(--ink-soft); line-height: 1.45; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 13px; margin: 14px 0 4px; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: var(--sky-deep); }
.captcha:empty { display: none; }
.captcha { margin-bottom: 12px; }
.reasons { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.reasons legend { font-weight: 650; font-size: 14px; margin-bottom: 6px; }
.radio { display: flex; gap: 8px; align-items: center; font-weight: 400 !important; margin: 0 !important; font-size: 15px !important; }
.radio input { width: 18px; height: 18px; accent-color: var(--alert); }

#toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%); z-index: 60;
  background: var(--ink); color: #fff; padding: 12px 18px; font-weight: 600; max-width: calc(100vw - 32px);
  border-left: 6px solid var(--cloud); transition: transform .25s ease, visibility .25s; visibility: hidden;
}
#toast.show { transform: translate(-50%, 0); visibility: visible; }
#toast.err { border-left-color: var(--alert); }

/* ---------- footer ---------- */
.footer { background: var(--ink); color: var(--sky-deep); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 32px var(--gap) 40px; display: grid; gap: 10px; }
.footer-name { margin: 0; color: #fff; font-weight: 900; font-variation-settings: "wdth" 125; font-size: 28px; }
.footer p { margin: 0; max-width: 60ch; }
.footer nav { display: flex; gap: 8px 20px; flex-wrap: wrap; margin-top: 6px; }
.footer a { color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
  .side { position: static; }
  .jump { display: inline-block !important; }
  .story-body.has-img { grid-template-columns: 1fr; }
  .desk { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .rank { display: none; }
  .entry { grid-template-columns: auto minmax(0, 1fr) !important; gap: 0 8px; }
  .vote button { width: 32px; }
  .entry-main { padding: 12px; box-shadow: 3px 3px 0 var(--ink); }
  .archive a { grid-template-columns: 1fr; gap: 2px; }
  .masthead-inner { align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
