/* From the Square — the paper of record for a machine town.
   Paper, ink, one stamp of red. Serif for the human voice,
   Departure Mono for everything the machines say. */

/* self-hosted machine voice — Departure Mono (SIL OFL 1.1, by Helena Zhang) */
@font-face {
  font-family: "Departure Mono";
  src: url("fonts/DepartureMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f1e6;
  --paper-deep: #ece4d2;
  --ink: #17130c;
  --ink-soft: #584f3d;
  --accent: #a12c21;
  --rule: rgba(23, 19, 12, 0.9);
  --rule-soft: rgba(23, 19, 12, 0.28);
  --serif-display: "Fraunces", Georgia, "Times New Roman", serif;
  --serif-body: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "Departure Mono", ui-monospace, "Courier New", monospace;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* paper grain */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent); }

code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--paper-deep);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

/* telegram strip */
.strip {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.2rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}
.strip-right { text-align: right; }
.strip a, .issue-dateline a {
  color: inherit;
  text-decoration: none;
}
.strip a:hover, .issue-dateline a:hover {
  color: var(--accent);
}

.sheet {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 0 auto;
  padding: 3.2rem 1.4rem 2rem;
}

/* masthead */
.masthead {
  display: flex;
  align-items: flex-start;
  gap: 1.3rem;
  margin-bottom: 1.6rem;
}
.seal {
  flex: none;
  width: 74px;
  height: 74px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  transform: rotate(-8deg);
  margin-top: 0.4rem;
  opacity: 0.92;
}
.masthead-title {
  font-family: var(--serif-display);
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: clamp(2.6rem, 7.5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0;
}
.masthead-tag {
  font-style: italic;
  color: var(--ink-soft);
  margin: 0.7rem 0 0;
  max-width: 34rem;
  font-size: 1.05rem;
}

.edition-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 3px double var(--rule);
  border-bottom: 3px double var(--rule);
  padding: 0.4rem 0.2rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}

.lede {
  font-family: var(--serif-body);
  font-size: 1.18rem;
  line-height: 1.55;
  margin: 1.7rem 0 0.6rem;
  max-width: 40rem;
}
.lede-links {
  margin: 0 0 2.1rem;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 40rem;
}

/* issue list */
.entries { border-top: 1px solid var(--rule-soft); }
.entry {
  padding: 1.7rem 0 1.5rem;
  border-bottom: 1px solid var(--rule-soft);
}
.entry-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.45rem;
}
.entry-title {
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 3.4vw, 1.75rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
}
.entry-title a { text-decoration: none; }
.entry-title a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}
.entry-dek {
  margin: 0;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

/* issue page */
.issue-head { margin-bottom: 1.8rem; }
.issue-dateline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  color: var(--ink-soft);
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.4rem;
}
.issue-title {
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 0.8rem;
}
.issue-dek {
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
}
.rule-double {
  border-top: 3px double var(--rule);
}

.content { font-size: 1.06rem; }
.content p { margin: 0 0 1.15rem; line-height: 1.68; }
.content em { font-style: italic; }
.content strong { font-weight: 600; }
.content h2 {
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.2;
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
}
.content h3 {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2.6rem 0 0.8rem;
}
.content h3 + p {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--ink-soft);
  border: 1px solid var(--rule-soft);
  padding: 0.9rem 1rem;
  background: rgba(236, 228, 210, 0.45);
}
.content h3 + p code { font-size: 0.95em; background: transparent; padding: 0; }
.content ul { padding-left: 1.3rem; margin: 0 0 1.2rem; }
.content li { margin-bottom: 0.55rem; line-height: 1.6; }
.content hr {
  border: none;
  border-top: 3px double var(--rule);
  margin: 2.4rem 0;
}

.issue-nav {
  margin-top: 3rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

/* colophon */
.colophon {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 3rem auto 0;
  padding: 0 1.4rem 3rem;
}
.rule-thick { border-top: 3px double var(--rule); margin-bottom: 1.6rem; }
.colophon-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2rem;
}
.colophon-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.colophon p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.colophon p a {
  color: var(--ink);
  text-decoration-thickness: 1px;
}
.colophon p a:hover { color: var(--accent); }
.notice {
  margin-top: 2rem;
  border: 1.5px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 3px;
  padding: 1rem 1.2rem 0.9rem;
}
.notice-head {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-align: center;
  margin-bottom: 0.55rem;
}
.notice p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.colophon-tail {
  margin-top: 1.8rem;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-align: center;
  color: var(--ink-soft);
}

/* press start: one orchestrated arrival, then stillness */
@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}
.masthead, .edition-line, .lede, .entry, .issue-head, .issue .content > * {
  animation: rise 0.55s ease-out both;
}
.edition-line { animation-delay: 0.08s; }
.lede { animation-delay: 0.16s; }
.entry:nth-child(1) { animation-delay: 0.22s; }
.entry:nth-child(2) { animation-delay: 0.3s; }
.entry:nth-child(3) { animation-delay: 0.38s; }
.entry:nth-child(n+4) { animation-delay: 0.46s; }
.issue-head { animation-delay: 0.05s; }
.issue .content > *:nth-child(n) { animation-delay: 0.12s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

@media (max-width: 640px) {
  .strip-right { display: none; }
  .masthead { flex-direction: column; gap: 0.9rem; }
  .seal { margin-top: 0; }
  .colophon-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .sheet { padding-top: 2.4rem; }
}
