/*
  MPC2000 MODS
  One typeface for everything (Barlow Semi Condensed, self-hosted).
  Colours are taken from the MPC2000 panel artwork: chassis ivory, key caps,
  slate pad panel, function-key blue, OPEN WINDOW amber, logo red, LCD sage.
*/

@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/barlow-semi-condensed-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/barlow-semi-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/barlow-semi-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/barlow-semi-condensed-800.woff2") format("woff2"); }

:root {
  --font: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;

  /* dark: LCD bezel */
  --bg: #22282d;
  --bg-inset: #1a1f23;
  --bg-raised: #2d353b;
  --line: #3b444b;
  --text: #e4e6dc;
  --text-2: #c3c9bd;
  --muted: #9aa29a;

  /* light: chassis */
  --ivory: #d6d7c8;
  --ivory-key: #dcdbb6;
  --ivory-lite: #ededd6;
  --ivory-line: #a9ab98;
  --ink: #23282a;
  --ink-2: #454b47;

  /* panel colours */
  --slate: #a5acb1;
  --blue: #335c79;
  --blue-dk: #22415a;
  --amber: #dca835;
  --red: #a42d35;
  --lcd: #b3c2a4;
  --lcd-ink: #070e13;

  --gutter: 24px;
  --arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14'%3E%3Cpath d='M1 7h16M11.5 1.5 17.5 7l-6 5.5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='square'/%3E%3C/svg%3E");
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
code, kbd, samp, table, button { font-family: inherit; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }

/* hairlines stop at the content edge instead of running through the gutters */
.site-header, .section, .support-section, .site-footer {
  --hairline: linear-gradient(var(--line), var(--line));
  --hairline-w: min(calc(100% - var(--gutter) * 2), calc(1120px - var(--gutter) * 2));
}
.site-header { background: var(--hairline) center bottom / var(--hairline-w) 1px no-repeat; }
.section, .support-section, .site-footer { background: var(--hairline) center top / var(--hairline-w) 1px no-repeat; }

.skip-link { position: absolute; left: -9999px; top: 8px; }
.skip-link:focus { left: 8px; z-index: 10; background: var(--amber); color: var(--ink); padding: 8px 14px; font-weight: 700; }

.label {
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- inline pieces ---------- */

/* arrows are drawn, so nothing depends on glyphs the typeface does not have */
i.a {
  display: inline-block;
  width: 1.05em;
  height: 0.72em;
  margin: 0 0.16em;
  vertical-align: -0.06em;
  font-style: normal;
  text-indent: 200%;
  white-space: nowrap;
  overflow: hidden;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
}
i.a.up { transform: rotate(-90deg); margin: 0 0.1em; }
i.a.ne { transform: rotate(-45deg); margin: 0 0 0 0.2em; width: 0.8em; }

kbd {
  display: inline-block;
  padding: 0 0.5em;
  background: var(--ivory-key);
  color: var(--ink);
  border: 1px solid #68735b;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.45;
  vertical-align: 0.06em;
  white-space: nowrap;
}

code {
  padding: 0 0.35em;
  background: var(--lcd);
  color: var(--lcd-ink);
  border-radius: 2px;
  font-size: 0.92em;
  font-weight: 600;
  letter-spacing: 0.02em;
}

strong { font-weight: 700; }

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 20px;
}

.wordmark { font-weight: 800; font-size: 1.35rem; letter-spacing: 0.02em; text-decoration: none; }

.site-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 26px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--text); }

/* ---------- hero ---------- */

.hero { padding-block: 64px 72px; }

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: end;
  margin-bottom: 48px;
}

.eyebrow { color: var(--amber); margin-bottom: 14px; }

.hero h1 {
  font-weight: 800;
  font-size: clamp(3.4rem, 10vw, 6.4rem);
  line-height: 0.9;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.hero-description { max-width: 34em; margin-top: 22px; color: var(--text-2); font-size: 1.2rem; line-height: 1.45; }

.lcd img { border-radius: 4px; }
.lcd figcaption { margin-top: 10px; color: var(--muted); }
.hero .lcd { width: 460px; max-width: 100%; }
.hero .lcd img { width: 100%; }

.machines { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; scroll-margin-top: 20px; }

.machine {
  --sub: #3a403d;
  display: flex;
  flex-direction: column;
  padding: 28px 28px 24px;
  border-radius: 4px;
  color: var(--ink);
}
.machine--classic { background: var(--ivory); }
.machine--xl { background: var(--slate); }

.machine-name { font-weight: 800; font-size: 2.1rem; line-height: 1; letter-spacing: 0.01em; text-transform: uppercase; }
.machine-file { margin: 14px 0 22px; color: var(--ink); }
.machine code { background: var(--ivory-lite); color: var(--ink); }
.machine--xl code { background: var(--lcd); }

.download-options { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border: 1.5px solid transparent;
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn--primary { background: var(--blue); border-color: var(--blue-dk); color: var(--ivory-lite); }
.btn--primary:hover { background: #2b506a; }
.btn--secondary { border-color: var(--ink); color: var(--ink); }
.btn--secondary:hover { background: rgb(35 40 42 / 0.08); }

.download-meta a { color: inherit; text-underline-offset: 3px; }
.download-meta { margin-top: 16px; color: var(--sub); font-size: 0.92rem; line-height: 1.45; }

.hero-note { max-width: 46em; margin-top: 28px; color: var(--muted); font-size: 0.98rem; }
.hero-note a { color: var(--text-2); }

/* ---------- generic sections ---------- */

.section { padding-block: 72px; }

h2.title {
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 2.7rem);
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.section-intro { max-width: 40em; margin: 14px 0 40px; color: var(--text-2); }

/* ---------- mods ---------- */

.mods-list { list-style: none; padding: 0; counter-reset: mod; border-top: 1px solid var(--line); }

.mods-list > li {
  counter-increment: mod;
  display: grid;
  grid-template-columns: 44px minmax(0, 0.8fr) minmax(0, 1.6fr);
  gap: 20px;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
}
.mods-list > li::before {
  content: counter(mod, decimal-leading-zero);
  padding-top: 4px;
  color: var(--amber);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mods-list h3 { font-weight: 700; font-size: 1.35rem; line-height: 1.15; }
.mod-scope { margin-top: 6px; color: var(--muted); }
.mod-description { color: var(--text-2); }

/* ---------- installation ---------- */

.setup-section { padding-block: 72px; background: var(--ivory); color: var(--ink); }
.setup-section .section-intro { color: var(--ink-2); }
.setup-section a:not(.btn) { color: var(--ink); }
.setup-section code { background: var(--ivory-lite); color: var(--ink); }

.originals { margin-bottom: 48px; padding-bottom: 44px; border-bottom: 1px solid var(--ivory-line); }
.originals h3 { font-weight: 800; font-size: 1.6rem; line-height: 1; text-transform: uppercase; }
.originals-intro { max-width: 40em; margin: 10px 0 24px; color: var(--ink-2); }
.originals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.original { display: flex; flex-direction: column; padding: 24px 24px 22px; background: var(--ivory-lite); border-radius: 4px; }
.original h4 { font-weight: 800; font-size: 1.45rem; line-height: 1; text-transform: uppercase; }
.original p { color: var(--ink); }
.original .original-version { margin: 8px 0 12px; color: var(--red); }
.original .original-note { margin-top: 14px; color: var(--ink-2); font-size: 0.95rem; }
.original .download-options { margin-top: 16px; }
.setup-section .original code { background: var(--lcd); color: var(--lcd-ink); }

.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; margin-bottom: 44px; }

.setup-col h3 { font-weight: 800; font-size: 1.6rem; line-height: 1; text-transform: uppercase; }
.setup-target { margin: 8px 0 20px; color: var(--ink-2); }

.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 13px 0 13px 44px;
  border-top: 1px solid var(--ivory-line);
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 14px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--blue);
  color: var(--ivory-lite);
  border-radius: 2px;
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.steps h4 { margin-bottom: 2px; font-weight: 700; font-size: 1.05rem; line-height: 1.3; }
.steps p { color: var(--ink-2); font-size: 1rem; }

.notice {
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--ivory-lite);
  border-left: 3px solid var(--red);
  border-radius: 0 3px 3px 0;
  color: var(--ink-2);
  font-size: 1rem;
}
.notice strong { color: var(--ink); }

.compatibility { padding: 28px 30px; background: var(--bg); color: var(--text); border-radius: 4px; }
.compatibility h3 { margin-bottom: 8px; font-weight: 800; font-size: 1.25rem; text-transform: uppercase; }
.compatibility dl > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding-block: 12px; border-top: 1px solid var(--line); }
.compatibility dt { padding-top: 3px; color: var(--amber); }
.compatibility dd { color: var(--text); }
.compatibility dd small { display: block; color: var(--muted); font-size: 0.95rem; }
.compatibility code { background: var(--lcd); color: var(--lcd-ink); }

/* ---------- documentation ---------- */

.docs-section { padding-top: 72px; }
.docs-head .section-intro { margin-bottom: 28px; }

.docs-index { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 40px; padding: 0; list-style: none; }
.docs-index a {
  display: block;
  padding: 7px 13px;
  background: var(--ivory-key);
  color: var(--ink);
  border: 1px solid #68735b;
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}
.docs-index a:hover { background: var(--ivory-lite); }

.docs-block {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 56px;
  padding-block: 48px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 0;
}

.docs-block-head { position: sticky; top: 24px; align-self: start; }
.docs-tag {
  display: inline-block;
  margin-bottom: 14px;
  padding: 3px 10px;
  background: var(--lcd);
  color: var(--lcd-ink);
  border-radius: 2px;
}
.docs-block-head h3 { margin-bottom: 8px; font-weight: 800; font-size: 1.7rem; line-height: 1.05; text-transform: uppercase; }
.docs-machines { margin-bottom: 12px; color: var(--amber); }
.docs-block-head p:last-child { color: var(--muted); font-size: 1rem; }

.docs-body { min-width: 0; }
.docs-body h4 { margin: 34px 0 12px; color: var(--amber); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.1em; text-transform: uppercase; }
.docs-body h4:first-child { margin-top: 0; }
.docs-body > p { margin-bottom: 16px; color: var(--text-2); }
.docs-body > p strong { color: var(--text); }
.docs-body .steps { margin-bottom: 20px; }

.docs-body .steps > li { border-top-color: var(--line); color: var(--text); }
.docs-body .steps > li:first-child { border-top: 0; padding-top: 0; }
.docs-body .steps > li:first-child::before { top: 0; }

.docs-note {
  margin: 0 0 20px;
  padding: 12px 16px;
  background: var(--bg-inset);
  border-left: 3px solid var(--amber);
  border-radius: 0 3px 3px 0;
  color: var(--text-2);
  font-size: 1rem;
}
.docs-note strong { color: var(--text); }

.docs-body .lcd { margin: 6px 0 22px; }

.tw { margin-bottom: 22px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 18px 9px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
td { color: var(--text-2); }
td:first-child { color: var(--text); }
.tw--keys td:first-child { white-space: nowrap; }

/* ---------- source ---------- */

.source-grid { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px 48px; }
.source-grid .section-intro { margin-bottom: 0; }

/* ---------- support ---------- */

.support-section { padding-block: 72px; }
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }

.maker { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.maker img { width: 44px; height: 44px; border-radius: 50%; }
.maker strong { font-weight: 800; font-size: 1.2rem; }

.support-copy h2, .social-section h2 { font-weight: 800; font-size: 1.7rem; line-height: 1.05; text-transform: uppercase; }
.support-copy p, .social-section > p { margin-top: 12px; max-width: 30em; color: var(--text-2); }

.support-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 20px; }

.text-link { color: var(--amber); font-weight: 700; letter-spacing: 0.04em; text-decoration: none; text-transform: uppercase; font-size: 0.95rem; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.social-links { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }

.social-profile {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  text-decoration: none;
}
.social-profile:hover { border-color: var(--muted); }
.social-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: var(--muted); }
.social-icon { width: 24px; height: 24px; color: var(--text); }
.social-profile strong { font-weight: 800; font-size: 1.25rem; }
.social-handle { color: var(--muted); }
.social-action { margin-top: 12px; color: var(--amber); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 34px 44px;
}
.site-footer p { color: var(--muted); font-size: 0.95rem; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .hero-top { grid-template-columns: 1fr; gap: 32px; }
  .machines, .originals-grid, .setup-grid,   .setup-grid,   .docs-block { grid-template-columns: 1fr; gap: 24px; }
  .docs-block-head { position: static; }
}

@media (max-width: 680px) {
  :root { --gutter: 16px; }
  .site-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .site-nav { justify-content: flex-start; gap: 4px 20px; }
  .hero { padding-block: 40px 56px; }
  .machine { padding: 22px 20px 20px; }
  .section, .setup-section, .support-section { padding-block: 52px; }
  .mods-list > li { grid-template-columns: 36px minmax(0, 1fr); gap: 4px 12px; }
  .mods-list > li .mod-description { grid-column: 2; }
  .compatibility { padding: 22px 18px; }
  .compatibility dl > div { grid-template-columns: 1fr; gap: 2px; }
  .social-links { grid-template-columns: 1fr; }
  .docs-block { padding-block: 36px; }

  /* the cheat sheet is read at the machine, often on a phone: one card per row */
  .tw--stack table, .tw--stack tbody, .tw--stack tr, .tw--stack td { display: block; width: 100%; }
  .tw--stack thead { position: absolute; left: -9999px; }
  .tw--stack tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .tw--stack td { padding: 2px 0; border: 0; }
  .tw--stack td:first-child { padding-bottom: 4px; font-weight: 700; }
  .tw--stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-top: 6px;
    color: var(--amber);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

.st { white-space: nowrap; }

