/* Self-hosted fonts (Google Fonts is unreachable on some networks) */
@font-face {
  font-family: "UnifrakturMaguntia";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/unifraktur.woff2) format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/fonts/newsreader.woff2) format("woff2-variations");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
  src: url(/fonts/newsreader-italic.woff2) format("woff2-variations");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(/fonts/jetbrains.woff2) format("woff2-variations");
}

:root {
  --paper: #f9f7f3;
  --paper-deep: #efeadf;
  --ink: #111111;
  --muted: #6e6a63;
  --rule: #c9c2b4;
  --accent: #111111;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --fraktur: "UnifrakturMaguntia", "Newsreader", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  /* faint paper grain */
  background-image: radial-gradient(
    rgba(17, 17, 17, 0.02) 0.5px,
    transparent 0.6px
  );
  background-size: 4px 4px;
}

.sheet {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 96px) clamp(22px, 6vw, 56px) 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---------- Masthead ---------- */
.masthead {
  text-align: center;
}

.dateline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: clamp(10px, 2.6vw, 13px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 12px;
  gap: 8px;
}
.dateline__mid {
  white-space: nowrap;
}

.rule {
  height: 1px;
  background: var(--ink);
  width: 100%;
}
.rule--thick {
  height: 3px;
}
.rule--thick + .mark {
  margin-top: 26px;
}

.mark {
  width: clamp(52px, 12vw, 72px);
  height: auto;
  display: inline-block;
  margin: 26px auto 10px;
}

.wordmark {
  font-family: var(--fraktur);
  font-weight: 400;
  font-size: clamp(56px, 15vw, 132px);
  line-height: 0.98;
  letter-spacing: 0.01em;
  margin: 0 0 22px;
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(16px, 3.6vw, 24px);
  color: #3a372f;
  margin: 16px 0;
}

/* ---------- Lead ---------- */
.lead {
  text-align: center;
  margin: clamp(34px, 7vh, 60px) auto 0;
  max-width: 60ch;
}
.kicker {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
}
.deck {
  font-size: clamp(18px, 4vw, 23px);
  line-height: 1.55;
  color: #2b2822;
  margin: 0;
}

/* ---------- Footer ---------- */
.foot {
  margin-top: clamp(46px, 9vh, 72px);
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.foot__sep {
  margin: 0 12px;
  opacity: 0.6;
}

/* ---------- Ticker ---------- */
.ticker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ink);
  color: var(--paper);
  border-top: 2px solid var(--ink);
  overflow: hidden;
  padding: 9px 0;
  z-index: 10;
}
.ticker__track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: marquee 42s linear infinite;
}
.ticker__item {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  padding: 0 26px;
}
.ticker__item b {
  font-weight: 500;
}
.ticker__item .up {
  color: #7fd39b;
}
.ticker__item .dn {
  color: #e7907f;
}
.ticker__item .dot {
  opacity: 0.4;
  margin-left: 26px;
}
@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ---------- Entrance motion ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(6px);
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes rise {
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none;
  }
  .ticker__track {
    animation: none;
  }
}

/* ---------- 8-bit newsroom ---------- */
.newsroom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 46px; /* sits on the ticker bar */
  height: 120px;
  pointer-events: none;
  z-index: 4;
}
.agent {
  position: absolute;
  bottom: 0;
}
.agent canvas {
  display: block;
  image-rendering: pixelated;
}
.bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -6px);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--ink);
  padding: 4px 8px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border: 4px solid transparent;
  border-top-color: var(--ink);
}
.bubble.on {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .newsroom {
    display: none;
  }
}
@media (max-width: 700px) {
  .newsroom {
    display: none;
  }
}

/* ---------- The paper (generated editions) ---------- */
.sheet--paper {
  max-width: 1020px;
}
.wordmark-link {
  text-decoration: none;
  color: inherit;
}
.paper-nav {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 10px 0 14px;
}
.paper-nav a {
  color: var(--muted);
  text-decoration: none;
}
.paper-nav a:hover {
  color: var(--ink);
}

.broadsheet {
  display: grid;
  grid-template-columns: 1.35fr 1px 1fr;
  gap: 0 36px;
  margin: 36px 0 48px;
  text-align: left;
}
.broadsheet::before {
  content: "";
  grid-column: 2;
  grid-row: 1 / span 3;
  background: var(--rule);
}
.broadsheet .story {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.broadsheet .story--lead {
  grid-column: 1;
  grid-row: 1 / span 3;
  border-bottom: 0;
}
.broadsheet .story:nth-child(n + 2) {
  grid-column: 3;
}
.broadsheet .story:last-child {
  border-bottom: 0;
}
.story__kicker {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.story__head {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(22px, 3.4vw, 34px);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.story--lead .story__head {
  font-size: clamp(30px, 5vw, 52px);
}
.story__head--small {
  font-size: clamp(19px, 2.6vw, 24px);
}
.story__rule {
  height: 1px;
  background: var(--rule);
  margin: 0 0 12px;
}
.story__sub {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  color: #3a372f;
  margin: 0;
}
.story__body {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  color: #3a372f;
  margin: 14px 0 0;
  white-space: pre-line;
}

.edtrail {
  margin: 10px 0 40px;
  text-align: left;
}
.edtrail__list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.edtrail__item {
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 7px 0;
  border-bottom: 1px solid var(--rule);
}
.edtrail__time {
  color: var(--muted);
  min-width: 74px;
}
.edtrail__kind {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  min-width: 64px;
}
.edtrail__remit {
  font-family: var(--serif);
  font-size: 15px;
  color: #3a372f;
}

.archive {
  list-style: none;
  margin: 24px 0 60px;
  padding: 0;
  text-align: left;
}
.archive__item a {
  display: flex;
  gap: 18px;
  align-items: baseline;
  text-decoration: none;
  color: var(--ink);
  padding: 12px 4px;
  border-bottom: 1px solid var(--rule);
}
.archive__item a:hover {
  background: #f1ece1;
}
.archive__no {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  min-width: 130px;
  color: var(--muted);
}
.archive__date {
  font-family: var(--serif);
  font-size: 18px;
}
.archive__state {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.archive__empty {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  padding: 20px 0;
}

/* ---------- The Newsroom (office page) ---------- */
.office {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(20px, 5vw, 64px);
  margin: 110px 0 30px;
  min-height: 160px;
  flex-wrap: wrap;
  row-gap: 90px;
}
.office__desk {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.office__desk canvas {
  width: 104px;
  height: 64px;
  image-rendering: pixelated;
  display: block;
}
.office__desk--editor canvas {
  width: 130px;
  height: 80px;
}
.office__label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.office__bubble {
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  width: max-content;
  max-width: 210px;
  z-index: 2;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--ink);
  padding: 5px 9px;
  opacity: 0;
  transition: opacity 0.3s ease;
  text-align: left;
}
.office__bubble.on {
  opacity: 1;
}
.office__bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border: 4px solid transparent;
  border-top-color: var(--ink);
}

.runlog {
  text-align: left;
  margin: 20px 0 70px;
}
.runlog__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.runlog__meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.runlog__feed {
  background: #16140f;
  color: #d8d2c2;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  padding: 18px 20px;
  height: 320px;
  overflow-y: auto;
  border: 1.5px solid var(--ink);
  white-space: pre-wrap;
}
.runlog__line--warn {
  color: #e0c068;
}
.runlog__line--error {
  color: #e7907f;
}

@media (max-width: 820px) {
  .broadsheet {
    grid-template-columns: 1fr;
  }
  .broadsheet::before {
    display: none;
  }
  .broadsheet .story--lead,
  .broadsheet .story:nth-child(n + 2) {
    grid-column: 1;
    grid-row: auto;
  }
}

.sheet--paper .dateline {
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  font-size: 11.5px;
}

.x-link {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  vertical-align: -1px;
}
.x-link:hover {
  color: var(--ink);
}

.story__head a {
  color: inherit;
  text-decoration: none;
}
.story__head a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.story__more {
  margin: 12px 0 0;
}
.story__more a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.story__more a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.office-strip {
  margin-top: 30px;
  text-align: center;
}
.office-strip + .office {
  margin-top: 90px;
}

.article {
  max-width: 720px;
  margin: 40px auto 60px;
  text-align: left;
}
.article__head {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 5.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
.article__sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.5;
  color: #3a372f;
  margin: 0 0 18px;
}
.article__body p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.7;
  color: #2b2822;
  margin: 0 0 18px;
}
.article__body p:first-child::first-letter {
  font-family: var(--fraktur);
  font-size: 3.2em;
  float: left;
  line-height: 0.85;
  padding: 4px 10px 0 0;
}
.article__byline {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 26px;
}
.article__byline a {
  color: var(--muted);
}

.sheet--paper .wordmark {
  margin: 34px 0 38px;
  line-height: 0.9;
}

/* ---------- $STOCKTIMES token strip ---------- */
.token {
  margin: 26px 0 6px;
  text-align: center;
  padding: 26px 20px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.token__blurb {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: #3a372f;
  margin: 0 0 16px;
}
.ca-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--ink);
  padding: 8px 14px;
  cursor: pointer;
}
.ca-pill--tba {
  cursor: default;
  color: var(--muted);
  border-color: var(--rule);
}
.ca-pill__label {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.ca-pill__hint {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--rule);
  padding-left: 10px;
}
.ca-pill:hover .ca-pill__hint {
  color: var(--ink);
}
.office-strip__link {
  margin: 10px 0 0;
}
.office-strip__link a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.office-strip__link a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.archissue {
  text-align: left;
  margin: 26px 0 8px;
}
.archissue__head {
  display: flex;
  gap: 18px;
  align-items: baseline;
  text-decoration: none;
  color: var(--ink);
  padding: 12px 4px;
  border-bottom: 2px solid var(--ink);
}
.archissue__stories {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
}
.archissue__stories li a {
  display: flex;
  gap: 16px;
  align-items: baseline;
  text-decoration: none;
  padding: 10px 4px;
  border-bottom: 1px solid var(--rule);
}
.archissue__stories li a:hover {
  background: #f1ece1;
}
.archissue__desk {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 140px;
}
.archissue__title {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
}

/* ---------- Recent story cards ---------- */
.cards-strip {
  margin-top: 8px;
  text-align: center;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 22px 0 6px;
  text-align: left;
}
.card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  background: #fffdf9;
  padding: 16px 16px 40px;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 var(--ink);
}
.card__head {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.15;
  margin: 0 0 8px;
}
.card__sub {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.45;
  color: #3a372f;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__date {
  position: absolute;
  left: 16px;
  bottom: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.cards__all {
  text-align: center;
  margin: 14px 0 8px;
}
.cards__all a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.cards__all a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.article__sources {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 22px;
}
.article__sources a {
  color: var(--muted);
}
.article__sources a:hover {
  color: var(--ink);
}

/* ---------- Payroll ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 30px 0 8px;
}
.stat {
  border: 1.5px solid var(--ink);
  background: #fffdf9;
  padding: 22px 18px;
  text-align: center;
}
.stat__label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.stat__value {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(20px, 3vw, 30px);
  margin: 0;
}
.paycount {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin: 18px 0 0;
}
.payrules {
  text-align: center;
  margin: 34px auto 0;
  max-width: 640px;
}
.payrules__list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  text-align: left;
}
.payrules__list li {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  color: #3a372f;
  padding: 9px 0 9px 26px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.payrules__list li::before {
  content: "ſ";
  font-family: var(--fraktur);
  position: absolute;
  left: 2px;
  color: var(--muted);
}
.paybook {
  margin: 40px 0 60px;
  text-align: center;
}
.paybook__table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  text-align: left;
}
.paybook__table th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding: 8px 10px;
  border-bottom: 2px solid var(--ink);
}
.paybook__table td {
  font-family: var(--mono);
  font-size: 14px;
  padding: 11px 10px;
  border-bottom: 1px solid var(--rule);
}
.paybook__table a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.paybook__rank {
  color: var(--muted);
  width: 40px;
}
.paybook__bal {
  font-variant-numeric: tabular-nums;
}
.paybook__ok {
  color: #1f6b3a;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 12px;
}
.paybook__wait {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
}
.paybook__note {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  margin-top: 14px;
}
.paybook__updated {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-top: 16px;
}
@media (max-width: 700px) {
  .stats {
    grid-template-columns: 1fr;
  }
}
