/* NewsMasher coming-soon page: The Wire Desk.
   Ground = teleprinter roll paper. Ink = navy. Stamps = royal blue. Bell = teal.
   Every typed line is Courier Prime; stamps and labels are Libre Franklin. */

:root {
  /* Brand sheet (brandsheet.mashertools.com/api/s/tfMjVdc77933): Cloud Mist,
     Midnight Navy, Electric Blue, Teal Spark. The rest are derived tints. */
  --paper: #eef0f3;
  --paper-deep: #e2e6ec;
  --ink: #031f44;
  --ink-soft: #364f78;
  --ink-faint: #b9c8e6;
  --blue: #0363fa;
  --blue-text: #0353d9;
  --teal: #2fd8b5;
  --rule: #c5cdd8;
  --mono: "Courier Prime", "Courier New", Courier, monospace;
  --grot: "Libre Franklin", "Franklin Gothic Medium", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(18px, 5vw, 72px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ink);
  scrollbar-color: var(--ink) var(--paper-deep);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--mono);
  caret-color: var(--blue);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--blue); color: var(--paper); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--blue-text); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
.head :focus-visible, .desk :focus-visible { outline-color: var(--teal); }

img { max-width: 100%; height: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------- the machine head */

.head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 72px;
  padding: 0.85rem var(--gutter);
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.55);
}

.head .lockup { display: block; line-height: 0; }
.head .lockup img { height: 40px; width: auto; }

.wirecode {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font: 700 0.75rem/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}
.wirecode .sep { color: var(--blue); }

.bellwrap { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--paper); }
.bell {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--teal);
  outline: 3px solid rgba(47, 216, 181, 0.22);
  outline-offset: 1px;
}
.bell.ring { animation: ring 0.16s steps(1, end) 6; }
@keyframes ring { 50% { opacity: 0.15; } }

/* ---------------------------------------------------------------- the roll */

.roll {
  position: relative;
  flex: 1 0 auto;
  background: var(--paper) url("/assets/paper-roll.png?v=20260909e") repeat;
  padding: clamp(36px, 6vw, 84px) var(--gutter) clamp(44px, 6vw, 72px);
}

/* the torn edge where the copy was ripped off the roll: the same paper,
   masked by a hand-torn line that tiles every 1440px */
.roll::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -24px;
  height: 24px;
  background: var(--paper) url("/assets/paper-roll.png?v=20260909e") repeat;
  -webkit-mask-image: url("/assets/torn-edge.svg?v=20260909e");
  mask-image: url("/assets/torn-edge.svg?v=20260909e");
  -webkit-mask-size: auto 100%;
  mask-size: auto 100%;
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
}

.bulletin { max-width: 70ch; }

/* the rubber stamp: heavy grotesque, double rule, ink pressed unevenly into paper */
.stamp {
  display: inline-block;
  margin: 0 0 0.2em 0.1em;
  padding: 0.12em 0.32em 0.08em;
  border: 0.09em double var(--blue-text);
  color: var(--blue-text);
  font: 900 clamp(2.5rem, 6.5vw, 5.5rem)/0.95 var(--grot);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  transform: rotate(-2.5deg);
  transform-origin: left bottom;
  mix-blend-mode: multiply;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -1.25 1.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -1.25 1.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  -webkit-mask-size: 260px 260px;
  mask-size: 260px 260px;
}

.lede {
  margin: 0.2em 0 0.8em;
  max-width: 34ch;
  font: 700 clamp(1.35rem, 2.7vw, 2rem)/1.3 var(--mono);
  text-wrap: balance;
}
.lede .dateline { white-space: nowrap; }
.lede .dateline .city { font-weight: inherit; text-transform: uppercase; }

.bulletin p { margin: 0 0 1.15em; max-width: 68ch; }
.bulletin .stamp { margin: 0 0 0.2em 0.1em; }
.bulletin .status { margin: 0.4em 0 0; }

/* the desk's status, typed on the roll like everything else */
.status {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin: 0.4em 0 0;
  font: 400 1rem/1.5 var(--mono);
  color: var(--ink);
}
.status .label { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.status .lamp { flex: none; align-self: center; }
.lamp {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink-faint);
  transition: background 0.4s;
}
.lamp.on { background: var(--teal); outline: 3px solid rgba(47, 216, 181, 0.25); outline-offset: 1px; }

/* ---------------------------------------------------------------- the wire */

.wire { margin-top: clamp(40px, 6vw, 72px); }

.wire-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0 0 0.75rem;
}
.wire-head h2 {
  margin: 0;
  font: 800 0.8rem/1.4 var(--grot);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hold {
  appearance: none;
  margin-left: auto;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  padding: 0.4em 0.9em 0.35em;
  font: 800 0.75rem/1.2 var(--grot);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom-width: 5px;
  transform: translateY(0);
  transition: transform 0.08s, background 0.15s, color 0.15s;
}
.hold:hover { background: var(--paper-deep); }
.hold:active, .hold[aria-pressed="true"] {
  transform: translateY(3px);
  border-bottom-width: 2px;
  background: var(--ink);
  color: var(--paper);
}

/* the platen bar holds the paper; the copy dissolves under it at both ends
   instead of being sliced by a rule */
.platen {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.tape {
  height: min(60vh, 540px);
  overflow-y: auto;
  padding: 1.1rem 0 1.4rem;
  font: 400 1rem/1.55 var(--mono);
  color: var(--ink);
  scrollbar-width: thin;
  overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 1.2em, #000 calc(100% - 1.4em), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 1.2em, #000 calc(100% - 1.4em), transparent);
}
.tape .story + .story { margin-top: 1.6em; }
.tape .line { margin: 0; max-width: 72ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.tape .slug { font-weight: 700; letter-spacing: 0.08em; }
.tape .flag { font-weight: 700; letter-spacing: 0.3em; color: var(--blue-text); }
.tape .meta { color: var(--ink-soft); }
.tape .src { color: var(--ink-soft); }
.tape .rw { color: var(--ink); }
.tape .stampline {
  margin: 0.55em 0 0.35em;
  font: 900 0.9rem/1.4 var(--grot);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-text);
}
.tape .headline { margin: 0.4em 0 0.2em; font-size: 1.2rem; font-weight: 700; line-height: 1.3; max-width: 46ch; }
.tape .dek { margin-bottom: 0.7em; color: var(--ink-soft); max-width: 60ch; }
.tape .rw + .rw { margin-top: 0.7em; }
.tape .end { margin-top: 0.4em; color: var(--ink-soft); }
.tape .code { color: var(--ink-soft); letter-spacing: 0.08em; }

.caret {
  display: inline-block;
  width: 0.62em; height: 1.05em;
  margin-left: 0.05em;
  vertical-align: -0.16em;
  background: var(--blue);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.thirty {
  margin: clamp(28px, 4vw, 44px) 0 0;
  font: 700 1rem/1 var(--mono);
  letter-spacing: 0.2em;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------ wide screens:
   the copy on the left of the desk, the sample run typing beside it */

@media (min-width: 1080px) {
  .roll {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: clamp(48px, 6vw, 112px);
    align-items: start;
  }
  .bulletin { grid-column: 1; }
  .stamp { width: min-content; }
  .stamp-sm { width: max-content; }
  .wire { grid-column: 2; grid-row: 1; margin-top: 0.6rem; }
  .tape { height: clamp(520px, calc(100vh - 230px), 820px); }
}

/* ---------------------------------------------------------------- the desk */

.desk {
  padding: clamp(34px, 5vw, 60px) var(--gutter) clamp(40px, 6vw, 72px);
  background: var(--ink);
  color: var(--ink-faint);
  font: 400 0.92rem/1.65 var(--mono);
}
.desk p { margin: 0 0 0.6em; max-width: 70ch; }
.desk a { color: var(--paper); }
.desk a:hover { color: var(--teal); }
.desk .fine { font-size: 0.82rem; }

/* ------------------------------------------------------ the desk's footer nav */

.desknav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5em 0.8em;
  margin: 0 0 1.1em;
  font: 700 0.82rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.desknav span { color: var(--blue); }

/* ------------------------------------------------------ documents on the roll
   (privacy, terms, contact): one typed column, pressed numerals on headings */

.roll.doc { display: block; }
.docwrap { max-width: 76ch; }
.stamp-sm { font-size: clamp(1.7rem, 4vw, 2.75rem); }
.docmeta { margin: 0.3em 0 1.8em; font: 400 0.95rem/1.5 var(--mono); color: var(--ink-soft); }
.docmeta b { color: var(--ink); }

.contents { margin: 0 0 2.6rem; padding: 0.9rem 1.2rem 1rem; border: 1px solid var(--rule); }
.contents ol { margin: 0; padding-left: 1.7em; columns: 2; column-gap: 2.2rem; font: 400 0.95rem/1.75 var(--mono); }
.contents li { break-inside: avoid; }
.contents a { text-decoration: none; }
.contents a:hover { text-decoration: underline; }

.doc h2 { margin: 2.2em 0 0.6em; font: 800 1.65rem/1.2 var(--grot); color: var(--ink); text-wrap: balance; }
.doc h2 .num {
  display: inline-block;
  margin-right: 0.65em;
  font: 900 0.78em/1 var(--grot);
  letter-spacing: 0.1em;
  color: var(--blue-text);
  vertical-align: 0.1em;
}
.doc h3 { margin: 1.7em 0 0.45em; font: 700 1.05rem/1.35 var(--mono); }
.doc p { margin: 0 0 1em; max-width: 70ch; }
.doc ul, .doc ol { margin: 0 0 1.1em; padding-left: 1.5em; }
.doc li { margin: 0.3em 0; max-width: 68ch; }
.doc dl { margin: 0 0 1.2em; }
.doc dt { font-weight: 700; margin-top: 0.9em; }
.doc dd { margin: 0.15em 0 0; max-width: 70ch; }
.doc .providers dd, .doc .rights dd, .doc .defs dd { color: var(--ink-soft); }
.doc .kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.35em 1.5em; }
.doc .kv dt { margin: 0; font-weight: 400; color: var(--ink-soft); }
.doc .kv dd { margin: 0; }
.doc .tags { list-style: none; margin: 0 0 1.2em; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45em 0.6em; }
.doc .tags li { margin: 0; padding: 0.2em 0.6em; border: 1px solid var(--rule); font-size: 0.9rem; }
.doc .note { margin: 0 0 1.2em; padding: 0.9em 1.1em 0.1em; border: 1px solid var(--rule); }
.tablewrap { overflow-x: auto; margin: 0 0 1.3em; }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.95rem; line-height: 1.45; }
.doc th, .doc td { padding: 0.55em 0.7em; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.doc th { font: 800 0.72rem/1.3 var(--grot); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.doc .thirty { margin-top: clamp(40px, 6vw, 72px); }

@media (max-width: 720px) {
  .contents ol { columns: 1; }
  .doc .kv { grid-template-columns: 1fr; gap: 0.1em 0; }
  .doc .kv dt { margin-top: 0.7em; }
  .doc h2 { font-size: 1.4rem; }
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 720px) {
  .head { min-height: 64px; gap: 1rem; }
  .head .lockup img { height: 34px; }
  .wirecode .date { display: none; }
  .wirecode { gap: 0.8rem; letter-spacing: 0.1em; font-size: 0.7rem; }
  .lede { font-size: 1.25rem; }
  .bulletin p:not(.stamp) { font-size: 1rem; line-height: 1.55; }
  .bulletin .status { font-size: 0.95rem; }
  .wire { margin-top: 28px; }
  .tape { height: min(58vh, 460px); font-size: 0.95rem; }
  .stamp { transform: rotate(-2deg); }
}
@media (max-width: 440px) {
  .wirecode .code, .wirecode time { display: none; }
}

/* ---------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  .bell.ring { animation: none; }
  .caret { animation: none; }
  .hold { transition: none; }
}
