/* One stylesheet for every page. Colours follow the Mac's light or dark setting. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #1d1d1f;
  --secondary: #6e6e73;
  --line: #e3e3e8;
  --panel: #f5f5f7;
  --accent: #1d1d1f;
  --on-accent: #ffffff;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --text: #f5f5f7;
    --secondary: #a1a1a6;
    --line: #2c2c2f;
    --panel: #1c1c1f;
    --accent: #f5f5f7;
    --on-accent: #111113;
  }
}

/* Copy Folder Path takes its blue from its own icon. */
.copy-folder-path { --accent: #0a66d6; --on-accent: #ffffff; }
@media (prefers-color-scheme: dark) {
  .copy-folder-path { --accent: #4a9bff; --on-accent: #06203f; }
}

/* Caffeine Modes takes the navy of its icon, and the pale blue of its steam in the dark. */
.caffeine-modes { --accent: #1d3557; --on-accent: #ffffff; }
@media (prefers-color-scheme: dark) {
  .caffeine-modes { --accent: #a8c8f5; --on-accent: #0e1a2c; }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.page { max-width: 1000px; margin: 0 auto; padding: 0 24px; }
.column { max-width: 660px; margin-left: auto; margin-right: auto; }

/* Header: the maker's name leads home. */
.top {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 22px 0;
  font-size: 15px;
}
.top .home { font-weight: 600; text-decoration: none; white-space: nowrap; }
.top nav { margin-left: auto; display: flex; gap: 22px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a { color: var(--secondary); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--text); }

/* The Copy Folder Path icon file has white corners outside its dark plate; this trims them. */
img[src$="/copy-folder-path.png"] { border-radius: 23.5%; }

/* Top of an app page */
.hero { text-align: center; padding: 56px 0 8px; }
.hero .icon { width: 176px; height: 176px; display: block; margin: 0 auto 20px; }
h1 {
  font-size: 60px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.032em;
  margin: 0;
}
.hero .job { font-size: 22px; line-height: 1.35; margin: 16px auto 0; max-width: 38em; text-wrap: balance; }

/* Install */
.install { text-align: center; padding: 28px 0 8px; }
.command {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 8px 8px 22px;
}
.command code { font: 15px/1.4 var(--mono); overflow-x: auto; white-space: nowrap; }
button.copy {
  flex: none;
  font: 600 14px/1 var(--sans);
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
}

/* The picture */
.shown { padding: 44px 0 8px; }
.shown img.screen {
  display: block;
  width: 100%;
  max-width: 920px;
  height: auto;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.shown figcaption { font-size: 15px; color: var(--secondary); text-align: center; margin: 14px auto 0; max-width: 40em; }
figure { margin: 0; }

/* Text */
.text { padding: 40px 0 0; }
h2 { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
.text p { margin: 0 0 14px; }
.text ul { margin: 0 0 14px; padding-left: 1.1em; }
.text li { margin: 0 0 8px; }
code { font-family: var(--mono); font-size: 0.86em; }
p code, li code { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }

/* Questions, closed until asked */
.questions details { border-top: 1px solid var(--line); }
.questions details:last-of-type { border-bottom: 1px solid var(--line); }
.questions summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 2px;
  font-weight: 600;
}
.questions summary::-webkit-details-marker { display: none; }
.questions summary::after { content: "+"; margin-left: auto; color: var(--secondary); font-weight: 400; font-size: 22px; line-height: 1; }
.questions details[open] summary::after { content: "–"; }
.questions details p { margin: 0 2px 16px; }

/* Home page: a plain list that stays readable with twenty or more apps */
.list { max-width: 660px; margin: 0 auto; padding-top: 44px; }
.list h1 { font-size: 34px; line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 30px; }
.list .item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 22px;
  align-items: center;
  text-decoration: none;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.list .item:last-of-type { border-bottom: 1px solid var(--line); }
.list .item img { width: 72px; height: 72px; display: block; }
.list .item h2 { font-size: 22px; margin: 0 0 3px; }
.list .item p { margin: 0; font-size: 17px; }
.list .item:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Footer: one line */
.foot {
  margin-top: 72px;
  padding: 22px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--secondary);
}

/* Copy Folder Path: the Finder scene, drawn in the page */
.scene {
  --window: #ffffff;
  --window-bar: #f6f6f6;
  --window-line: #dcdce0;
  --row-alt: #f5f5f7;
  --selected: #0a64dc;
  --dim: #8a8a8f;
  --desk: linear-gradient(160deg, #dfe7f1, #eef0ea);
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding: 70px 36px 36px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--desk);
  font: 13px/1.3 var(--sans);
  color: #1d1d1f;
}
@media (prefers-color-scheme: dark) {
  .scene {
    --window: #1e1e20;
    --window-bar: #2a2a2d;
    --window-line: #3a3a3d;
    --row-alt: #252528;
    --selected: #0a5fd0;
    --dim: #98989d;
    --desk: linear-gradient(160deg, #1b2230, #23211c);
    color: #f5f5f7;
  }
}
.scene .note {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 38px;
  border-radius: 19px;
  background: rgba(22, 24, 29, 0.92);
  color: #ffffff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.scene .note svg { width: 13px; height: 13px; stroke: rgb(101, 217, 117); }
.scene .window {
  background: var(--window);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22), 0 0 0 1px var(--window-line);
}
.scene .bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 16px;
  background: var(--window-bar);
  border-bottom: 1px solid var(--window-line);
  font-weight: 700;
}
.scene .lights { display: flex; gap: 8px; }
.scene .lights i { width: 12px; height: 12px; border-radius: 50%; }
.scene .lights i:nth-child(1) { background: #ff5f57; }
.scene .lights i:nth-child(2) { background: #febc2e; }
.scene .lights i:nth-child(3) { background: #28c840; }
.scene .head, .scene .row { display: grid; grid-template-columns: 1fr 150px 80px; gap: 12px; padding: 0 10px; align-items: center; }
.scene .head { height: 26px; margin: 0 6px; color: var(--dim); font-size: 12px; border-bottom: 1px solid var(--window-line); }
.scene .rows { padding: 4px 6px 10px; }
.scene .row { height: 26px; border-radius: 6px; }
.scene .row:nth-child(even) { background: var(--row-alt); }
.scene .row .name { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene .row .name svg { flex: none; width: 16px; height: 16px; }
.scene .row .when, .scene .row .size { color: var(--dim); white-space: nowrap; }
.scene .row.on { background: var(--selected); color: #ffffff; }
/* Neighbouring selected rows join into one block, as in Finder. */
.scene .row.on:has(+ .row.on) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.scene .row.on + .row.on { border-top-left-radius: 0; border-top-right-radius: 0; }
.scene .row.on .when, .scene .row.on .size { color: rgba(255, 255, 255, 0.82); }
.scene .folder { color: #2f9bf0; }
.scene .row.on .folder, .scene .row.on .doc { color: #ffffff; }
.scene .doc { color: var(--dim); }

/* A command-line tool's picture: a terminal, drawn in the page. Dark in both light and dark mode. */
.term {
  max-width: 760px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #17171a;
  color: #e8e8ed;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}
.term .bar { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 14px; background: #232327; color: #a1a1a6; font: 600 13px/1 var(--sans); }
.term .lights { display: flex; gap: 8px; }
.term .lights i { width: 12px; height: 12px; border-radius: 50%; }
.term .lights i:nth-child(1) { background: #ff5f57; }
.term .lights i:nth-child(2) { background: #febc2e; }
.term .lights i:nth-child(3) { background: #28c840; }
.term pre { margin: 0; padding: 18px 20px 20px; font: 14px/1.6 var(--mono); overflow-x: auto; white-space: pre; }
.term .typed { color: #ffffff; }
.term .prompt { color: #8a8a8f; }

/* A menu-bar app's picture: its menu, drawn in the page on the same desk as the Finder scene. */
.scene.menus { display: flex; justify-content: center; padding: 34px 20px 38px; font-size: 14px; }
.scene .menu { width: 310px; max-width: 100%; background: var(--window); border-radius: 10px; padding: 6px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22), 0 0 0 1px var(--window-line); }
.scene .mi { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 5px 10px 5px 28px; border-radius: 6px; white-space: nowrap; }
.scene .mi.dim { color: var(--dim); white-space: normal; }
.scene .mi.on::before { content: "✓"; position: absolute; left: 10px; font-weight: 600; }
.scene .mi.sub::after { content: "›"; color: var(--dim); font-size: 17px; line-height: 1; }
.scene .mi kbd { font: inherit; color: var(--dim); }
.scene .menu hr { border: 0; border-top: 1px solid var(--window-line); margin: 5px 10px; }

.pasted {
  max-width: 760px;
  margin: 16px auto 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  font: 14px/1.7 var(--mono);
  overflow-x: auto;
  white-space: pre;
}

@media (max-width: 700px) {
  body { font-size: 17px; }
  h1 { font-size: 42px; }
  .hero { padding-top: 36px; }
  .hero .icon { width: 132px; height: 132px; }
  .hero .job { font-size: 19px; }
  .list { padding-top: 28px; }
  .list h1 { font-size: 28px; }
  .list .item { grid-template-columns: 56px 1fr; gap: 16px; }
  .list .item img { width: 56px; height: 56px; }
  .top { flex-wrap: wrap; row-gap: 6px; padding: 18px 0; }
  .top nav { margin-left: 0; width: 100%; justify-content: flex-start; gap: 18px; }
  .command { flex-direction: column; align-items: stretch; gap: 10px; border-radius: 16px; padding: 14px; }
  .command code { font-size: 14px; white-space: normal; overflow-wrap: anywhere; text-align: left; }
  .scene { padding: 66px 12px 14px; }
  .term pre { font-size: 12px; padding: 16px 14px 18px; }
  .scene .head, .scene .row { grid-template-columns: 1fr 64px; }
  .scene .when { display: none; }
}
