/* AllCount Supply Co. - the site's one stylesheet.
   A plain, slightly dated company look: beige paper, grey bars, one amber stripe.
   Colours live in the :root block below. Change one there and every page follows. */

@font-face {
  font-family: "Courier Prime";
  src: url("../fonts/CourierPrime-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --desk: #e3ded0;        /* the page behind the paper */
  --paper: #f7f5ef;       /* the main sheet */
  --paper-dim: #efebe1;   /* boxes on the sheet */
  --rule: #b8b2a2;        /* borders */
  --rule-dark: #8f897a;
  --ink: #222220;         /* body text */
  --ink-soft: #4d4b45;    /* small print (still 7:1 on paper) */
  --grey-ink: #66635b;    /* the catalog's grey rows (5:1 on the boxes, 5.5:1 on paper) */
  --link: #1f4e8c;
  --link-visited: #4a3a7a;
  --bar: #2e2d2a;         /* the top bar */
  --bar-ink: #f2efe6;
  --bar-ink-soft: #d3ccb8;
  --amber: #f2b632;       /* the AllCount mark's amber: stripes and buttons only, never text on paper */
  --nav-top: #e6e2d7;
  --nav-bottom: #cfcabc;
  --strip: #3a3934;
  --strip-ink: #ebe6d6;
  --box-head: #ddd8cb;
  --red: #8e1b1b;
  --green: #1e5e2e;
  --night: #1b1a18;
  --night-ink: #edeadf;
  --typed: "Courier Prime", "Courier New", Courier, monospace;
  --sans: Verdana, Tahoma, "DejaVu Sans", "Segoe UI", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
}

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

a { color: var(--link); text-underline-offset: 0.15em; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: normal;
  line-height: 1.25;
  color: #1d1c1a;
}
h1 { font-size: 1.9rem; margin: 0 0 0.6rem; }
h2 { font-size: 1.45rem; margin: 2rem 0 0.6rem; }
h3 { font-size: 1.12rem; margin: 1.3rem 0 0.4rem; font-weight: bold; }
h4 { font-family: var(--sans); font-size: 1rem; margin: 1.1rem 0 0.3rem; }

p, ul, ol, dl { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.3rem; }

/* --- Skip link ---------------------------------------------------------------------------------- */
.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  background: var(--paper);
  color: var(--link);
  padding: 10px 14px;
  border: 2px solid var(--link);
  z-index: 10;
}
.skip:focus { top: 8px; }

/* --- The sheet of paper ------------------------------------------------------------------------- */
.page {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--paper);
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.03);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Top bar ------------------------------------------------------------------------------------ */
.masthead {
  background: var(--bar);
  border-bottom: 4px solid var(--amber);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  color: var(--bar-ink);
  text-decoration: none;
}
.brand:visited { color: var(--bar-ink); }
.brand:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; }
.brand img { width: 52px; height: 52px; flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  line-height: 1.15;
}
.brand-slogan {
  font-family: var(--serif);
  font-style: italic;
  color: var(--bar-ink-soft);
  font-size: 1rem;
}

/* --- Main menu ---------------------------------------------------------------------------------- */
.mainnav {
  background: linear-gradient(var(--nav-top), var(--nav-bottom));
  border-bottom: 1px solid var(--rule-dark);
}
.mainnav ul {
  list-style: none;
  margin: 0;
  padding: 0 12px;
  display: flex;
  flex-wrap: wrap;
}
.mainnav li { margin: 0; }
.mainnav a {
  display: block;
  padding: 11px 14px;
  color: #1a2a44;
  text-decoration: none;
  font-size: 0.95rem;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}
.mainnav a:hover { text-decoration: underline; }
.mainnav a[aria-current="page"] {
  background: var(--paper);
  font-weight: bold;
  box-shadow: inset 0 -3px 0 var(--amber);
}

/* --- The status strip under the menu (home page) ------------------------------------------------ */
.status-strip {
  background: var(--strip);
  color: var(--strip-ink);
  font-family: var(--typed);
  font-size: 0.98rem;
  padding: 8px 20px;
  margin: 0;
}
.status-strip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}
.status-strip li { margin: 0; }
.status-strip b { color: var(--amber); font-weight: normal; }

/* --- Columns ------------------------------------------------------------------------------------ */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  padding: 26px 24px 32px;
  flex: 1 0 auto;
}
.layout.single { grid-template-columns: minmax(0, 780px); justify-content: center; }
.content > :first-child { margin-top: 0; }
.lede { font-size: 1.08rem; }

/* --- Boxes on the side -------------------------------------------------------------------------- */
.sidebox {
  background: var(--paper-dim);
  border: 1px solid var(--rule);
  margin-bottom: 20px;
}
.sidebox h2 {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--box-head);
  border-bottom: 1px solid var(--rule);
  margin: 0;
  padding: 7px 12px;
}
.sidebox-body { padding: 12px; font-size: 0.95rem; }
.sidebox-body > :last-child { margin-bottom: 0; }
.notices { list-style: none; padding: 0; }
.notices li {
  border-bottom: 1px dotted var(--rule-dark);
  padding: 0 0 8px;
  margin: 0 0 8px;
}
.notices li:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

.eotm { text-align: center; }
.eotm-month {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0;
}
.eotm-name { font-family: var(--serif); font-size: 1.3rem; margin: 2px 0 0; }
.eotm-dept { color: var(--ink-soft); margin: 0 0 6px; }
.eotm-line { font-style: italic; }
.eotm-small { font-size: 0.85rem; color: var(--ink-soft); }

/* --- The game box -------------------------------------------------------------------------------- */
.game-box {
  background: var(--night);
  color: var(--night-ink);
  border: 1px solid #000;
  border-top: 4px solid var(--amber);
  margin: 1.4rem 0 2rem;
}
.game-box img { width: 100%; }
.game-box-text { padding: 18px 20px 20px; }
.game-box h2 {
  color: #fffdf6;
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
}
.game-box p { margin-bottom: 0.8rem; }
.game-box .kicker {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #d9cfae;
  margin-bottom: 0.3rem;
}
.game-box .meta { color: #d2cdbf; font-size: 0.95rem; }
.game-box a:focus-visible { outline-color: var(--amber); }
.button,
.button:visited {
  display: inline-block;
  background: var(--amber);
  color: #1b1a18;
  font-weight: bold;
  text-decoration: none;
  padding: 11px 18px;
  border: 1px solid #a87b14;
  border-radius: 2px;
}
.button:hover { background: #ffc94d; text-decoration: underline; }
.button:focus-visible { outline: 3px solid #fffdf6; outline-offset: 2px; }
.game-box.compact { margin-top: 2.4rem; }
.game-box.compact .game-box-text { padding: 16px 18px; }

/* --- Services ------------------------------------------------------------------------------------ */
.services {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.services li {
  background: var(--paper-dim);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--rule-dark);
  padding: 12px 14px;
  margin: 0;
}
.services.pairs { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.services h3 { margin-top: 0; }
.services p { margin: 0; }

/* --- Pictures with captions ---------------------------------------------------------------------- */
.photo {
  margin: 0 0 1.2rem;
  border: 1px solid var(--rule);
  background: #fff;
  padding: 6px;
}
.photo figcaption {
  font-size: 0.88rem;
  color: var(--ink-soft);
  padding: 6px 2px 0;
}

/* --- Facts (a list of label: value) -------------------------------------------------------------- */
.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--rule);
  background: var(--paper-dim);
  font-size: 0.95rem;
}
.facts dt, .facts dd {
  margin: 0;
  padding: 6px 12px;
  border-bottom: 1px solid var(--rule);
}
.facts dt { font-weight: bold; background: #e7e2d5; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }

.values { counter-reset: none; }
.values li { margin-bottom: 0.5rem; }

/* --- A note from the studio (out of the story) --------------------------------------------------- */
.studio-note {
  border: 2px solid var(--link);
  background: #eef2f8;
  padding: 12px 16px;
  margin: 0 0 1.6rem;
}
.studio-note p { margin: 0 0 0.5rem; }
.studio-note p:last-child { margin: 0; }
.studio-note strong { color: #13325c; }

/* --- Job postings -------------------------------------------------------------------------------- */
.posting {
  border: 1px solid var(--rule);
  background: #fbfaf6;
  margin: 0 0 1.6rem;
}
.posting-head {
  background: var(--box-head);
  border-bottom: 1px solid var(--rule);
  padding: 10px 16px;
}
.posting-head h3 { margin: 0; font-size: 1.35rem; font-weight: normal; }
.posting-head .ref {
  font-family: var(--typed);
  color: var(--ink-soft);
  margin: 2px 0 0;
}
.posting-body { padding: 4px 16px 16px; }
.posting .facts { margin: 12px 0 0.6rem; }
.hr-note {
  font-family: var(--typed);
  background: #fffbe8;
  border: 1px dashed var(--rule-dark);
  padding: 10px 12px;
}
.apply { margin: 0; }
.apply a { overflow-wrap: anywhere; }
.stamp {
  display: inline-block;
  font-family: var(--typed);
  font-weight: bold;
  letter-spacing: 0.08em;
  border: 2px solid currentColor;
  padding: 0 8px;
  text-transform: uppercase;
}
.stamp.open { color: var(--green); }
.stamp.filled { color: var(--red); }
.closed-list { list-style: none; padding: 0; }
.closed-list li {
  border: 1px solid var(--rule);
  background: var(--paper-dim);
  padding: 10px 14px;
  margin-bottom: 10px;
}
.closed-list h3 { margin: 0 0 0.3rem; }
.closed-list p { margin: 0.3rem 0 0; }
.steps li { margin-bottom: 0.5rem; }

/* --- The portal notice --------------------------------------------------------------------------- */
.system-notice {
  font-family: var(--typed);
  background: #20231f;
  color: #d9e6cf;
  border: 6px solid #9c978a;
  border-radius: 6px;
  padding: 18px 20px;
  margin: 0 0 1.6rem;
  font-size: 1.05rem;
  line-height: 1.55;
}
.system-notice h1 {
  font-family: var(--typed);
  color: #f2f7ec;
  font-size: 1.35rem;
  margin: 0 0 0.8rem;
  letter-spacing: 0.04em;
}
.system-notice p { margin: 0 0 0.6rem; }
.system-notice p:last-child { margin: 0; }
.system-notice .alert { color: #ffd27a; }
.cursor::after {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 1.05em;
  background: #d9e6cf;
  vertical-align: text-bottom;
  margin-left: 4px;
}
@media (prefers-reduced-motion: no-preference) {
  .cursor::after { animation: blink 1.1s steps(1) infinite; }
}
@keyframes blink { 50% { opacity: 0; } }

.table-wrap { overflow-x: auto; margin: 0 0 1.4rem; }
table.log {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  background: var(--paper-dim);
}
table.log caption {
  text-align: left;
  font-weight: bold;
  padding: 0 0 6px;
}
table.log th, table.log td {
  border: 1px solid var(--rule);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
table.log thead th { background: var(--box-head); }
table.log td:first-child { font-family: var(--typed); white-space: nowrap; }

/* --- Contact desks ------------------------------------------------------------------------------- */
.desks { list-style: none; padding: 0; }
.desks li {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--rule-dark);
  background: var(--paper-dim);
  padding: 12px 16px;
  margin-bottom: 14px;
}
.desks h2 { margin: 0 0 0.3rem; font-size: 1.2rem; }
.desks p { margin: 0 0 0.4rem; }
.desks p:last-child { margin: 0; }
.mail { font-weight: bold; overflow-wrap: anywhere; }

/* --- 404 ----------------------------------------------------------------------------------------- */
.lost { text-align: left; }
.lost .code {
  font-family: var(--typed);
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0 0 0.3rem;
}

/* --- Read aloud only (screen readers), never shown ----------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- A menu item for the section you're in (a page below it) ------------------------------------- */
.mainnav a[aria-current="true"] {
  background: var(--paper);
  font-weight: bold;
  box-shadow: inset 0 -3px 0 var(--amber);
}

/* --- Who signed a notice ------------------------------------------------------------------------- */
.notice-from {
  display: block;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* --- A wider single column (the locations catalog) ----------------------------------------------- */
.layout.wide { grid-template-columns: minmax(0, 1fr); }

/* --- "You are here" line over a page's title ----------------------------------------------------- */
.crumbs {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
}
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0 6px; }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "\203A"; margin-right: 6px; color: var(--rule-dark); }

/* --- A place's title with its badge -------------------------------------------------------------- */
.place-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 0.8rem;
}
.place-head img { width: 76px; height: 76px; flex: none; }
.place-head h1 { margin: 0; }

/* --- The status board (a place's page: the status strip grown into a board) ---------------------- */
.status-board {
  background: var(--strip);
  color: var(--strip-ink);
  font-family: var(--typed);
  font-size: 0.98rem;
  padding: 10px 20px 12px;
  margin: 0;
}
.status-board-title { margin: 0 0 4px; letter-spacing: 0.04em; }
.status-board dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 2px 26px;
  margin: 0;
}
.status-board dt, .status-board dd { display: inline; margin: 0; }
.status-board dt::after { content: ": "; }
.status-board dd { color: var(--amber); }

/* --- A history, year by year --------------------------------------------------------------------- */
.timeline {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr);
  border-top: 1px solid var(--rule);
  margin: 0 0 1.4rem;
}
.timeline dt, .timeline dd {
  margin: 0;
  padding: 7px 10px;
  border-bottom: 1px solid var(--rule);
}
.timeline dt {
  font-family: var(--typed);
  font-weight: bold;
  border-right: 3px solid var(--amber);
  background: var(--paper-dim);
}

/* --- Records: plain ruled tables (the catalog, notices, deliveries, tapes, the wall, the directory) - */
table.records {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.93rem;
  background: var(--paper-dim);
}
table.records caption {
  text-align: left;
  font-weight: bold;
  padding: 0 0 6px;
}
table.records th, table.records td {
  border: 1px solid var(--rule);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
table.records thead th { background: var(--box-head); }
table.records .typed { font-family: var(--typed); }
table.records .nowrap { white-space: nowrap; }
table.records .num { font-family: var(--typed); white-space: nowrap; }
table.records.compact { font-size: 0.88rem; }
table.records.compact th, table.records.compact td { padding: 6px 7px; }
.table-note { font-size: 0.9rem; color: var(--ink-soft); margin-top: -0.6rem; }
.typed-line { font-family: var(--typed); letter-spacing: 0.03em; }
.nobreak { white-space: nowrap; }

/* The catalog: a badge beside each code. */
.code-cell { white-space: nowrap; font-family: var(--typed); }
.code-cell img { display: inline-block; width: 34px; height: 34px; max-width: none; vertical-align: middle; margin-right: 8px; }
table.records tr.live td { background: #fbfaf6; }
table.records tr.live td:first-child { box-shadow: inset 4px 0 0 var(--amber); }
table.records tr.live a { font-weight: bold; }

/* Grey rows: pages under review. Never remove a site from the list. Everyone counts. */
table.records tr.grey td { color: var(--grey-ink); }
table.records tr.grey img { opacity: 0.45; }

/* --- The house rules: a typed card --------------------------------------------------------------- */
.typed-card {
  font-family: var(--typed);
  background: #fffbe8;
  border: 1px dashed var(--rule-dark);
  padding: 12px 14px;
  font-size: 0.98rem;
}
.typed-card p { margin: 0 0 0.5rem; }
.typed-card ol { margin: 0 0 0.6rem; padding-left: 1.6rem; }
.typed-card .signed { text-align: right; margin: 0; }

/* --- Press releases ------------------------------------------------------------------------------ */
.release {
  border-bottom: 1px dotted var(--rule-dark);
  padding: 0 0 0.6rem;
  margin: 0 0 1.1rem;
}
.release:last-of-type { border-bottom: 0; }
.release-date {
  font-family: var(--typed);
  color: var(--ink-soft);
  margin: 0;
}
.release h3 { margin: 0.1rem 0 0.4rem; }

/* --- The staff newsletter ------------------------------------------------------------------------ */
.newsletter {
  background: #fbfaf6;
  border: 1px solid var(--rule-dark);
  border-top: 6px double var(--rule-dark);
  padding: 14px 18px 6px;
  margin: 1.4rem 0 1.6rem;
}
.newsletter-name {
  font-family: var(--serif);
  font-size: 1.9rem;
  margin: 0;
  line-height: 1.1;
}
.newsletter-issue {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  margin: 2px 0 10px;
}
.newsletter h3 { font-size: 1.02rem; margin: 0.9rem 0 0.2rem; }
.newsletter p { margin: 0 0 0.6rem; }

/* --- Footer -------------------------------------------------------------------------------------- */
.site-footer {
  background: #d9d4c7;
  border-top: 1px solid var(--rule-dark);
  color: #2f2e2a;
  font-size: 0.9rem;
  padding: 16px 24px 20px;
}
.site-footer p { margin: 0 0 0.5rem; }
.site-footer .fiction {
  font-weight: bold;
  color: #23221f;
}
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.footer-links li { margin: 0; }
.site-footer .small { color: #4a4843; font-size: 0.82rem; margin: 0; }

/* --- Phones -------------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 24px; gap: 8px; }
  .brand { padding: 12px 16px; }
  .brand img { width: 44px; height: 44px; }
  .brand-name { font-size: 1.3rem; }
  .mainnav ul { padding: 0 4px; }
  .mainnav a { padding: 11px 10px; }
  .status-strip { padding: 8px 16px; }
  .site-footer { padding: 16px 16px 20px; }
  h1 { font-size: 1.6rem; }
}
@media (max-width: 480px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { border-bottom: 0; padding-bottom: 0; background: transparent; }
  .facts dd { padding-top: 0; }
  .page { border: 0; box-shadow: none; }
  .system-notice { padding: 14px; border-width: 4px; font-size: 1rem; }
  table.log td:first-child { white-space: normal; }
  .system-notice h1 { font-size: 1.15rem; letter-spacing: 0; }
  .place-head img { width: 56px; height: 56px; }
  .timeline { grid-template-columns: 4.4rem minmax(0, 1fr); }
  .status-board dl { grid-template-columns: minmax(0, 1fr); }
  .newsletter { padding: 12px 14px 4px; }
}

/* --- Phones: records tables become one card per row, each cell labelled ------------------------- */
@media (max-width: 640px) {
  .status-board { padding: 8px 16px 10px; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack { background: transparent; }
  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  table.stack tr {
    border: 1px solid var(--rule);
    background: var(--paper-dim);
    margin: 0 0 10px;
  }
  table.stack td {
    border: 0;
    border-bottom: 1px dotted var(--rule);
    padding: 5px 10px;
  }
  table.stack td:last-child { border-bottom: 0; }
  table.stack td:empty { display: none; }
  table.stack td::before {
    content: attr(data-label) ": ";
    font-family: var(--sans);
    font-weight: bold;
    color: var(--ink);
  }
  table.stack td[data-label=""]::before { content: none; }
  /* Short fields share a line, so a row of six short facts reads in two or three lines. */
  table.stack.flow tr { padding: 4px 0; }
  table.stack.flow td { display: inline-block; width: auto; border-bottom: 0; padding: 2px 12px 2px 10px; }
  table.stack.flow td:empty { display: none; }
  table.stack .nowrap, table.stack .num, table.stack .code-cell { white-space: normal; }
  table.records tr.live td:first-child { box-shadow: none; }
  table.records tr.live { border-left: 4px solid var(--amber); }
}
