/* meshmud.pl: ration-coupon paper, print black, one official red stamp,
   and a white ZX81 screen. Fonts are self-hosted (no third-party requests). */

@font-face { font-family: "Big Shoulders"; font-weight: 800; font-display: swap;
  src: url("/fonts/big-shoulders-display-latin-ext-800-normal.woff2") format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Big Shoulders"; font-weight: 800; font-display: swap;
  src: url("/fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Mono"; font-weight: 600; font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; font-weight: 600; font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #e3ebd9;   /* ration-coupon paper */
  --paper-2: #d6e1c9; /* a coupon printed on slightly greener stock */
  --ink: #000;        /* print black */
  --ink-soft: #4a5644;
  --stamp: #c1272d;   /* official stamp red: used once per screen at most */
  --screen: #fff;     /* the ZX81 draws black on white */
  --display: "Big Shoulders", "Arial Narrow", sans-serif;
  --mono: "Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--mono); }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--stamp); }
:focus-visible { outline: 3px solid var(--stamp); outline-offset: 3px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* masthead */
.mast { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 20px; padding: 22px 0 10px; border-bottom: 3px solid var(--ink); }
.mast nav a { white-space: nowrap; }
.mark { font: 800 34px/1 var(--display); letter-spacing: .01em; text-decoration: none; }
.mast nav { display: flex; gap: 18px; font-size: 14px; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 56px 0 64px; }
.hero h1 { font: 800 clamp(48px, 7.5vw, 92px)/.92 var(--display); margin: 0 0 22px; letter-spacing: -.005em; }
.hero p.lede { max-width: 34em; margin: 0 0 30px; font-size: 17px; }

.cmd { position: relative; display: flex; align-items: stretch; max-width: 36em; border: 3px solid var(--ink); background: var(--screen); }
.cmd code { flex: 1; padding: 14px 16px; font: 600 15px/1.4 var(--mono); overflow-x: auto; white-space: nowrap; }
.cmd button { font: 600 14px var(--mono); border: 0; border-left: 3px solid var(--ink); background: var(--ink); color: var(--screen); padding: 0 18px; cursor: pointer; }
.cmd button:hover { background: var(--stamp); }
.stamp { position: absolute; right: -14px; top: -34px; transform: rotate(-7deg); color: var(--stamp); border: 3px solid var(--stamp); padding: 2px 10px; font: 800 18px/1.2 var(--display); letter-spacing: .04em; background: transparent; pointer-events: none; opacity: .92; }
.hint { font-size: 13px; color: var(--ink-soft); margin: 12px 0 0; }

/* the ZX81: black case, white screen, 32 columns */
.zx { margin: 0; background: var(--ink); padding: 18px 18px 26px; border-radius: 6px; }
/* Exactly 32 columns, like the real ZX81: the font scales to the case. */
.zx pre { margin: 0 auto; width: calc(32ch + 28px); max-width: 100%; background: var(--screen); color: var(--ink);
  font: 400 clamp(10px, calc((100vw - 120px) / 19.6), 15px)/1.35 var(--mono); padding: 14px; height: 24.5em; overflow: hidden; white-space: pre-wrap; }
@media (min-width: 861px) { .zx pre { font-size: clamp(11px, calc((50vw - 140px) / 19.6), 15px); } }
.zx .k { background: var(--ink); color: var(--screen); }
.zx figcaption { color: #9aa58f; font-size: 12px; margin-top: 10px; }

/* coupons: features printed as a ration-card sheet */
section { padding: 56px 0; border-top: 3px solid var(--ink); }
h2 { font: 800 clamp(34px, 4.6vw, 52px)/1 var(--display); margin: 0 0 28px; }
.sheet { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 3px solid var(--ink); }
.coupon { padding: 18px 18px 22px; border-right: 2px dashed var(--ink); background: var(--paper); }
.coupon:nth-child(even) { background: var(--paper-2); }
.coupon:last-child { border-right: 0; }
.coupon .tag { font: 800 40px/1 var(--display); }
.coupon h3 { font: 800 24px/1.05 var(--display); margin: 10px 0 8px; }
.coupon p { margin: 0; font-size: 14px; }

/* how to start: a real sequence, so it is numbered */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; max-width: 46em; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 14px; counter-increment: step; }
.steps li::before { content: counter(step); font: 800 52px/.9 var(--display); }
.steps h3 { font: 600 16px/1.4 var(--mono); margin: 4px 0 4px; }
.steps p { margin: 0; }
pre.code { background: var(--screen); border: 3px solid var(--ink); padding: 14px 16px; overflow-x: auto; font: 400 14px/1.5 var(--mono); max-width: 40em; }

.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
.two p, .faq dd { max-width: 38em; }
.faq dt { font-weight: 600; margin-top: 18px; }
.faq dd { margin: 4px 0 0; }

footer { border-top: 3px solid var(--ink); padding: 28px 0 48px; font-size: 13px; color: var(--ink-soft); }
footer .row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; }

/* long-form pages (privacy) */
.doc { max-width: 44em; padding: 40px 0 60px; }
.doc h1 { font: 800 clamp(40px, 6vw, 64px)/1 var(--display); margin: 0 0 24px; }
.doc h2 { font-size: 30px; margin: 34px 0 10px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc th, .doc td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--ink-soft); padding: 8px 8px 8px 0; }

@media (max-width: 860px) {
  .hero, .two { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hero { padding-top: 36px; }
  .sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coupon:nth-child(2) { border-right: 0; }
  .coupon:nth-child(-n+2) { border-bottom: 2px dashed var(--ink); }
  .stamp { right: -6px; }
}
@media (max-width: 480px) {
  .cmd code { font-size: 13px; padding: 12px; }
  .cmd button { padding: 0 12px; }
  .sheet { grid-template-columns: minmax(0, 1fr); }
  .coupon { border-right: 0; border-bottom: 2px dashed var(--ink); }
  .coupon:last-child { border-bottom: 0; }
  .mast nav { gap: 12px; }
  .zx pre { height: 26em; }
}

/* long unbreakable strings (key fingerprints) may wrap anywhere */
p code, dd code { overflow-wrap: anywhere; }

/* catalogue (generated by cmd/catalog): a ration card with many cells */
.doc.wide { max-width: none; }
.doc.wide > p, .doc.wide > ul { max-width: 44em; }
.cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); border: 3px solid var(--ink); overflow: hidden; margin: 18px 0 8px; }
.cat .coupon:nth-child(n) { border-right: 2px dashed var(--ink); border-bottom: 2px dashed var(--ink); margin: 0 -2px -2px 0; }
.cat .coupon:nth-child(even) { background: var(--paper-2); }
.cat .coupon .tag { font-size: 28px; color: var(--stamp); }
.cat .coupon h3 { font-size: 22px; }
.cat .coupon p.hint { margin-top: 10px; }
.ach { columns: 2 16em; padding-left: 1.2em; }
