/* AI System 6 — official site. Static, zero JS.
   Visual vocabulary is cribbed from the app's own System 6 recipes
   (styles/00-foundation.css, styles/10-windows.css): Chicago faces,
   striped title bars, 50% dither desk. */

@font-face {
  font-family: Chicago;
  src: url("fonts/ChicagoFLF.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: Chicago_12;
  src: url("fonts/ChiKareGo2.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: Monaco;
  src: url("fonts/monaco.woff2") format("woff2");
  font-display: swap;
}

:root {
  --ink: #000;
  --paper: #fff;
  --ui-font: Chicago_12, Chicago, Charcoal, sans-serif;
  --display-font: Chicago, Charcoal, sans-serif;
  --mono-font: Monaco, "Courier New", monospace;
  /* 2x2 checkerboard = the System 6 50% gray desk pattern. */
  --desk-pattern: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="2" height="2"><rect width="2" height="2" fill="%23ffffff"/><rect width="1" height="1" fill="%23000000"/><rect x="1" y="1" width="1" height="1" fill="%23000000"/></svg>');
  --menu-bar-height: 26px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 40px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

body {
  font-family: var(--ui-font);
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  background-color: #808080;
}

/* The desk pattern lives on a fixed layer, not the scrolling body: a 2px
   tile repainted across the whole document on every scroll frame is what
   makes long pages smear gray. A fixed layer rasterizes once. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: var(--desk-pattern);
  background-size: 2px 2px;
}

/* ---------- Menu bar ---------- */

.menu-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--menu-bar-height);
  padding: 0 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
  /* No overflow clipping here: the pull-down menus hang below the bar. */
}

.menu-apple { font-size: 15px; line-height: 1; }
.menu-title { font-weight: normal; }
.menu-spacer { flex: 1; }

/* ---------- Pull-down menus ---------- */

details.menu { position: relative; }
details.menu > summary {
  list-style: none;
  cursor: default;
  padding: 3px 10px;
  white-space: nowrap;
}
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary {
  background: var(--ink);
  color: var(--paper);
}

.menu-list {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  min-width: 218px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-top: 0;
  box-shadow: 1px 1px 0 var(--ink);
  padding: 3px 0;
}
.menu-list a,
.menu-list .menu-dim {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 3px 14px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.menu-list a:hover,
.menu-list a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}
.menu-dim { color: #909090; }
.menu-dim kbd { font-family: var(--ui-font); }
.menu-sep {
  height: 1px;
  margin: 3px 1px;
  background-image: linear-gradient(to right, var(--ink) 50%, transparent 50%);
  background-size: 2px 1px;
}

.menu-link {
  color: var(--ink);
  text-decoration: none;
  padding: 2px 6px;
}
.menu-link:hover,
.menu-link:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Desk & windows ---------- */

.desk {
  max-width: 920px;
  margin: 0 auto;
  padding: 36px 16px 48px;
}

.window {
  background: var(--paper);
  border: 1px solid var(--ink);
  margin: 0 0 34px;
}

/* Slight stagger so the column reads as a desk, not a document.
   Margins, not transforms: the transform slot belongs to window dragging. */
.window:nth-of-type(even) { margin-left: 28px; }
.window:nth-of-type(3n)   { margin-left: -20px; margin-right: 20px; }

/* Finder-style window opening: a few coarse steps, not a tween. */
.js .window {
  opacity: 0;
}
.js .window.win-open {
  opacity: 1;
  animation: win-open 0.24s steps(4, end);
}
@keyframes win-open {
  from { transform: scale(0.55); opacity: 0.3; }
  to   { transform: scale(1); opacity: 1; }
}

/* System 6 drags an inverted dotted outline, then the window jumps once. */
.drag-outline {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  border: 1px dashed var(--paper);
  mix-blend-mode: difference;
}

.marquee {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  border: 1px dashed var(--paper);
  mix-blend-mode: difference;
}

/* Title bar: the app's racing-stripe recipe — 1px black lines every 2px,
   title on a white plate that interrupts the stripes. */
.tbar {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 25px;
  padding: 3px 4px;
  border-bottom: 1px solid var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(to bottom, var(--ink) 0 1px, transparent 1px 2px);
  background-size: 100% 2px;
  background-origin: content-box;
  background-clip: content-box;
}

.tbar h1,
.tbar h2 {
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: normal;
  line-height: 19px;
  background: var(--paper);
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 60px);
}

.close-box {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 13px;
  height: 13px;
  transform: translateY(-50%);
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 0 0 2px var(--paper);
}

.wbody { padding: 20px 22px 24px; }
.wbody > p + p { margin-top: 12px; }

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

.hero .wbody { text-align: center; }

.hero-head {
  font-family: var(--display-font);
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.1;
  margin: 10px 0 14px;
}
.hero-head::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.78em;
  margin-left: 8px;
  background: var(--ink);
  animation: caret-blink 1.06s steps(1, end) infinite;
}
@keyframes caret-blink {
  50% { opacity: 0; }
}

.hero-sub {
  max-width: 40em;
  margin: 0 auto 20px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 18px;
  margin: 4px 0 24px;
}

.btn {
  display: inline-block;
  font-family: var(--ui-font);
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 7px;
  padding: 5px 18px;
}
.btn:hover,
.btn:focus-visible {
  background: var(--ink);
  color: var(--paper);
}
.btn:active { transform: translateY(1px); }

/* Default button: the System 6 heavy outer ring. */
.btn-default {
  position: relative;
  margin: 4px;
}
.btn-default::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 3px solid var(--ink);
  border-radius: 11px;
  pointer-events: none;
}

.shot {
  display: block;
  border: 1px solid var(--ink);
  line-height: 0;
}
.shot img { width: 100%; height: auto; }

.shot-caption {
  margin-top: 10px;
  font-size: 16px;
}

/* ---------- Comparison table ---------- */

.table-scroll { overflow-x: auto; margin-top: 14px; }

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 17px;
}
th, td {
  border: 1px solid var(--ink);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
/* Inverted header row = the System 6 selection look. */
thead th {
  background: var(--ink);
  color: var(--paper);
  font-weight: normal;
}
th:first-child, td:first-child { width: 42%; }

/* ---------- Route ---------- */

.route-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  justify-content: center;
  font-family: var(--display-font);
  font-size: clamp(17px, 2.6vw, 24px);
  border: 1px solid var(--ink);
  padding: 12px 10px;
  margin: 6px 0 18px;
}

.route-list {
  margin: 0 0 14px;
  padding-left: 1.4em;
}
.route-list li { margin-bottom: 8px; }

/* ---------- Lists ---------- */

.impossible,
.built {
  list-style: none;
  margin-bottom: 14px;
}
.impossible li,
.built li {
  padding-left: 1.3em;
  margin-bottom: 9px;
  position: relative;
}
.impossible li::before { content: "◆"; position: absolute; left: 0; }
.built li::before { content: "■"; position: absolute; left: 0; }

/* ---------- Memory box (About This Macintosh gauge) ---------- */

.memory-box {
  border: 1px solid var(--ink);
  padding: 14px 16px;
  margin-top: 18px;
}
.memory-title { margin-bottom: 10px; }

.memory-row {
  display: grid;
  grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 90px;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 16px;
}
.memory-bar {
  display: block;
  height: 12px;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.memory-bar > span {
  display: block;
  height: 100%;
  background-image: var(--desk-pattern);
  background-size: 2px 2px;
  background-color: #808080;
}
.memory-bytes { text-align: right; font-family: var(--mono-font); font-size: 13px; }
.memory-total { border-top: 1px solid var(--ink); padding-top: 6px; margin-top: 8px; }
.memory-note { margin-top: 10px; font-size: 15px; }

/* ---------- Why ---------- */

.why {
  font-family: var(--display-font);
  font-size: clamp(20px, 3vw, 27px);
  line-height: 1.35;
}
.why-kicker { margin-top: 14px; }

/* ---------- Get it ---------- */

.get-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0;
  border: 1px solid var(--ink);
}
.get-cell {
  padding: 16px 18px 18px;
  border: 0 solid var(--ink);
}
/* Inner grid seams without doubled borders. */
.get-cell + .get-cell { border-left-width: 1px; }
@media (max-width: 760px) {
  .get-cell + .get-cell { border-left-width: 0; border-top-width: 1px; }
}

.get-cell h3 {
  font-weight: normal;
  font-size: 19px;
  margin-bottom: 8px;
}
.get-cell p { margin-bottom: 10px; font-size: 16px; }

pre {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono-font);
  font-size: 12px;
  line-height: 1.7;
  padding: 10px 12px;
  overflow-x: auto;
}

.get-model { margin-top: 14px; font-size: 16px; }

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

.site-footer {
  text-align: center;
  color: var(--paper);
  font-size: 16px;
  text-shadow: 1px 1px 0 var(--ink);
  padding: 8px 0 20px;
}
.site-footer a { color: var(--paper); }
.site-footer p { margin-bottom: 8px; }

.footer-shutdown {
  font-family: var(--display-font);
  margin-top: 18px;
  font-size: 18px;
}

/* ---------- Boot and shutdown ---------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: #808080;
  background-image: var(--desk-pattern);
  background-size: 2px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s steps(3, end);
}
.boot.boot-done { opacity: 0; }
.boot-box {
  font-family: var(--display-font);
  font-size: clamp(20px, 4vw, 30px);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--paper), 0 0 0 2px var(--ink);
  padding: 26px 44px;
}

.shutdown {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  text-align: center;
  padding: 0 20px;
}
.shutdown[hidden] { display: none; }
.shutdown p {
  font-family: var(--display-font);
  font-size: clamp(22px, 4.5vw, 34px);
  max-width: 18em;
}
.shutdown button {
  font-family: var(--ui-font);
  font-size: 18px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--paper);
  border-radius: 7px;
  padding: 5px 22px;
  cursor: pointer;
}
.shutdown button:hover,
.shutdown button:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .window { opacity: 1; animation: none; }
  .hero-head::after { animation: none; }
}

/* ---------- Small screens ---------- */

@media (max-width: 700px) {
  .menu-extra { display: none; }
  /* A real System 6 menu bar has no app-name label; the hero names the
     product, so the narrow bar keeps Apple, Special, and the two links. */
  .menu-title { display: none; }
  .window:nth-of-type(even),
  .window:nth-of-type(3n) { margin-left: 0; margin-right: 0; }
  /* The hero's default button already opens the live desktop; the menu-bar
     copy of that link is the one item 375px cannot afford. */
  .menu-link-live { display: none; }
  .menu-bar { gap: 12px; }
  /* Two-line gauge rows: the three-column row leaves the bar ~9px at 375px. */
  .memory-row { grid-template-columns: minmax(0, 1fr) 84px; row-gap: 3px; }
  .memory-label { grid-column: 1 / -1; }
  .wbody { padding: 16px 14px 18px; }
  body { font-size: 17px; }
}
