/* ==========================================================================
   MoofStation — moofstation.com
   A classic Macintosh emulator, so the site is built out of classic Mac
   parts: 1-bit chrome, pinstriped title bars, square corners, hard shadows.
   No web fonts — Helvetica and Monaco shipped with the machines this
   emulates, and they are already on every Mac.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */

:root {
  --ink:        #1b1b1b;   /* not pure black: easier to read at length */
  --ink-2:      #55555c;
  --ink-3:      #8a8a93;
  --paper:      #ffffff;
  --paper-2:    #f4f4f2;
  --rule:       #1b1b1b;
  --rule-soft:  #c9c9c6;
  --desk:       #93939a;   /* the classic dithered desktop */
  --link:       #1a3fd0;
  --link-hover: #0a2299;
  --shadow:     rgba(0, 0, 0, .28);

  --font-ui: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica,
    Arial, sans-serif;
  --font-mono: Monaco, Menlo, 'Courier New', monospace;

  --wrap: 1120px;
  --gut: clamp(1.1rem, 4vw, 2.25rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:       #e9e9ec;
    --ink-2:     #a9a9b4;
    --ink-3:     #7c7c88;
    --paper:     #17171a;
    --paper-2:   #1f1f24;
    --rule:      #55555f;
    --rule-soft: #33333b;
    --desk:      #0e0e11;
    --link:      #7aa2ff;
    --link-hover:#a8c2ff;
    --shadow:    rgba(0, 0, 0, .6);
  }
}

/* --- Reset -------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 78px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--desk);
  /* The 50% dither the Finder painted its desktop with, one pixel at a time. */
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.14) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.14) 75%),
    linear-gradient(45deg, rgba(255,255,255,.14) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.14) 75%);
  background-size: 4px 4px;
  background-position: 0 0, 2px 2px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.015em; }
ul, ol { margin: 0; padding: 0; }

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 500;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--rule); padding: .6rem 1rem; font-weight: 700;
}
.skip:focus { left: 1rem; top: 1rem; }

/* --- Layout ------------------------------------------------------------- */

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

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

/* --- Classic Mac window ------------------------------------------------- */
/* Square corners, a 1px rule all round, and the hard offset shadow the
   Finder drew. The title bar is six pinstripes with the title knocked out. */

.win {
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: 3px 3px 0 0 var(--shadow);
}

.win__bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 4px 8px;
  border-bottom: 1px solid var(--rule);
  background-image: repeating-linear-gradient(
    to bottom,
    var(--rule) 0 1px,
    transparent 1px 3px
  );
  background-size: 100% 12px;
  background-position: center;
  background-repeat: repeat-x;
  min-height: 22px;
}

/* The close box: a small square, as on every window from 1984 onward. */
.win__close {
  flex: none;
  width: 12px; height: 12px;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.win__title {
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1;
  padding: 3px 10px;
  background: var(--paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win__body { padding: clamp(1.1rem, 3vw, 2rem); }
.win__body--flush { padding: 0; }

/* --- Header ------------------------------------------------------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-head__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand img { width: 26px; height: 26px; }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(.5rem, 1.6vw, 1.15rem);
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: .9375rem;
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--ink); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

.nav-toggle {
  display: none;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: .35rem .5rem;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: .35rem var(--gut) .8rem;
  }
  .nav:not(.is-open) { display: none; }
  .nav a { padding: .55rem 0; border-bottom: 1px solid var(--rule-soft); }
  .nav a:hover { border-bottom-color: var(--rule-soft); background: var(--paper-2); }
}

/* --- Buttons ------------------------------------------------------------ */
/* The System 6 default button: a rounded rect inside a second, heavier ring. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font: inherit;
  font-weight: 700;
  font-size: .9375rem;
  line-height: 1;
  padding: .8rem 1.4rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 2px 2px 0 0 var(--shadow);
  transition: transform .06s ease, box-shadow .06s ease;
}
.btn:hover { color: var(--ink); background: var(--paper-2); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 0 var(--shadow); }

.btn--default {
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--rule), 2px 2px 0 0 var(--shadow);
  margin: 4px;
}
.btn--default:active {
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px var(--rule), 0 0 0 0 var(--shadow);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

/* --- Type helpers ------------------------------------------------------- */

.h-hero {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -.035em;
}
.h-sec {
  font-size: clamp(1.35rem, 3.2vw, 1.9rem);
  line-height: 1.15;
  letter-spacing: -.03em;
}
.h-sub { font-size: 1.0625rem; letter-spacing: -.01em; }

.lede { color: var(--ink-2); font-size: clamp(1rem, 1.5vw, 1.125rem); max-width: 62ch; }
.small { font-size: .875rem; }
.muted { color: var(--ink-2); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-2);
  margin-bottom: .6rem;
}

kbd, code, .mono { font-family: var(--font-mono); font-size: .9em; }
kbd {
  border: 1px solid var(--rule-soft);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: .05em .35em;
  background: var(--paper-2);
  white-space: nowrap;
}

.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }

/* --- Hero --------------------------------------------------------------- */

.hero { padding-block: clamp(2rem, 5vw, 3.5rem); }

.hero__grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); }
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.1rem;
  font-size: .875rem;
  color: var(--ink-2);
  font-family: var(--font-mono);
}

/* --- Machines table ----------------------------------------------------- */

.table-scroll { overflow-x: auto; }

table.machines {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
  min-width: 620px;
}
table.machines th,
table.machines td {
  text-align: left;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
table.machines thead th {
  border-bottom: 1px solid var(--rule);
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
table.machines tbody tr:last-child td { border-bottom: 0; }
table.machines td:first-child { font-weight: 700; white-space: nowrap; }
table.machines .mono-cell { font-family: var(--font-mono); font-size: .875rem; }

/* --- Card grids --------------------------------------------------------- */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: 2px 2px 0 0 var(--shadow);
  padding: 1.2rem 1.3rem;
}
.card h3 { font-size: 1rem; margin-bottom: .45rem; }
.card p { color: var(--ink-2); font-size: .9375rem; }

/* --- Shots -------------------------------------------------------------- */

.shot { margin: 0; }
.shot img { width: 100%; border-bottom: 1px solid var(--rule); }
.shot figcaption {
  padding: .6rem .8rem;
  font-size: .875rem;
  color: var(--ink-2);
  background: var(--paper);
}

.shots {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.6rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
}

/* --- Steps -------------------------------------------------------------- */

.steps { list-style: none; counter-reset: step; }
.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .2rem 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.steps > li:last-child { border-bottom: 0; }
.steps > li::before {
  content: counter(step);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  grid-row: 1 / span 2;
  color: var(--ink-3);
}
.steps h3 { font-size: 1rem; }
.steps p { color: var(--ink-2); font-size: .9375rem; }
.steps .stack-sm { grid-column: 2; }

/* --- Notes -------------------------------------------------------------- */

.note {
  border: 1px solid var(--rule);
  border-left-width: 5px;
  background: var(--paper-2);
  padding: 1rem 1.15rem;
  font-size: .9375rem;
}
.note strong { font-weight: 700; }

/* --- Prose (manual, changes, privacy) ----------------------------------- */

.prose { max-width: 72ch; }
.prose h2 {
  font-size: 1.35rem;
  margin-top: 2.4rem;
  margin-bottom: .7rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--rule);
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.0625rem; margin-top: 1.6rem; margin-bottom: .4rem; }
.prose p { margin-bottom: .9rem; color: var(--ink-2); }
.prose li { margin-bottom: .4rem; color: var(--ink-2); }
.prose ul, .prose ol { margin: 0 0 1rem 1.3rem; }
.prose ul { list-style: square; }
.prose strong { color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.2rem; font-size: .9375rem; }
.prose th, .prose td {
  text-align: left; padding: .5rem .7rem;
  border-bottom: 1px solid var(--rule-soft); vertical-align: top;
  color: var(--ink-2);
}
.prose thead th { border-bottom: 1px solid var(--rule); color: var(--ink); }
.prose pre {
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  padding: .8rem 1rem;
  overflow-x: auto;
  font-size: .875rem;
  margin-bottom: 1rem;
}
.prose pre code { font-size: inherit; }
.prose code { background: var(--paper-2); padding: .1em .3em; border: 1px solid var(--rule-soft); }
.prose pre code { background: none; padding: 0; border: 0; }
.prose hr { border: 0; border-top: 1px solid var(--rule-soft); margin: 2rem 0; }

/* Table of contents on the long documents. */
.toc { font-size: .9375rem; }
.toc ul { list-style: none; margin: 0; }
.toc li { margin-bottom: .3rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.doc-layout { display: grid; gap: clamp(1.25rem, 3vw, 2.5rem); grid-template-columns: 1fr; }
@media (min-width: 1000px) {
  .doc-layout { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; }
  .doc-layout .toc-col { position: sticky; top: 74px; }
}

/* --- Page head ---------------------------------------------------------- */

.page-head { padding-block: clamp(1.75rem, 4vw, 2.75rem); }

/* --- Footer ------------------------------------------------------------- */

.site-foot {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
  font-size: .9375rem;
}

.foot-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  margin-bottom: 1.5rem;
}
.foot-col h4 { font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .6rem; }
.foot-col ul { list-style: none; }
.foot-col li { margin-bottom: .35rem; }
.foot-col a { color: var(--ink-2); text-decoration: none; }
.foot-col a:hover { color: var(--link); text-decoration: underline; }

.disclaimer {
  border: 1px solid var(--rule);
  border-left-width: 5px;
  background: var(--paper-2);
  padding: .9rem 1.1rem;
  font-size: .875rem;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
}
.disclaimer b { color: var(--ink); }

.legal {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  border-top: 1px solid var(--rule-soft);
  padding-top: 1rem;
  color: var(--ink-2);
  font-size: .875rem;
}

/* --- Print -------------------------------------------------------------- */

@media print {
  body { background: #fff; }
  .site-head, .site-foot, .nav-toggle, .btn { display: none; }
  .win { box-shadow: none; border: 0; }
}
