@font-face { font-family: "Lato"; src: url("assets/fonts/Lato-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url("assets/fonts/Lato-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Roboto Slab"; src: url("assets/fonts/RobotoSlab-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #2e2e2e;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --accent: #8f0d0d;
  --chart-a: #c43b3b;
  --chart-b: #4a7fc1;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141414;
  --text: #e8e8e8;
  --muted: #9a9a9a;
  --line: #2a2a2a;
  --accent: #e06a6a;
  --chart-a: #e06a6a;
  --chart-b: #5b8ad1;
}

/* Without JavaScript there is no data-theme, so follow the system setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #141414;
    --text: #e8e8e8;
    --muted: #9a9a9a;
    --line: #2a2a2a;
    --accent: #e06a6a;
  --chart-a: #e06a6a;
  --chart-b: #5b8ad1;
  }
}

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

body {
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 "Lato", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 96px 20px 64px;
}

a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }

/* Top right: the language switch, and on the home page the theme toggle. */
.corner {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
}

/* Like the theme toggle, it shows the language a click switches to. */
.lang-switch {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}
.lang-switch:hover { color: var(--accent); }
.lang-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.theme-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 20px; height: 20px; }
/* The icon shows the theme a click switches to. */
:root[data-theme="dark"] .theme-toggle .moon,
:root[data-theme="light"] .theme-toggle .sun { display: none; }
/* Toggling needs JavaScript, which is also what sets data-theme. */
:root:not([data-theme]) .theme-toggle { display: none; }

.portrait { border-radius: 50%; display: block; margin-bottom: 24px; }
h1 { font: 700 2rem/1.2 "Roboto Slab", serif; letter-spacing: -0.01em; }
.role { color: var(--accent); font-weight: 700; margin-top: 4px; }
.meta { color: var(--muted); font-size: 0.94rem; }
.links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; font-weight: 700; }

section { margin-top: 56px; }
.lead { font-size: 1.12rem; }

h2 {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.item { display: flex; gap: 20px; align-items: flex-start; }
.item + .item { margin-top: 32px; }
.icon-link { flex-shrink: 0; }
.app-icon { border-radius: 22%; display: block; }
.item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
h3 { font-size: 1.06rem; }
h3 a { text-decoration: none; }
.date, .sub { color: var(--muted); font-size: 0.94rem; }
.date, .nowrap { white-space: nowrap; }
.sub { margin-bottom: 6px; }
.highlights { padding-left: 1.1em; margin-top: 6px; }
.highlights li + li { margin-top: 4px; }
.highlights li::marker { color: var(--muted); }
.tech { color: var(--muted); font-size: 0.94rem; margin-top: 8px; }
.tech + .sub { margin-top: 14px; }

.plain { list-style: none; padding: 0; }
.plain li + li { margin-top: 10px; }
.more { margin-top: 16px; }
.prose p + p { margin-top: 12px; }
.stack { color: var(--muted); }
.stack-group + .stack-group { margin-top: 16px; }

footer { margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--line); }
.cta-title { font: 700 1.75rem/1.25 "Roboto Slab", serif; letter-spacing: -0.01em; text-transform: none; color: var(--text); border: 0; padding: 0; margin-bottom: 8px; }
.cta { display: inline-block; margin-top: 12px; font-size: 1.12rem; font-weight: 700; color: var(--accent); text-decoration: none; overflow-wrap: anywhere; }
.cta:hover { text-decoration: underline; }
.legal-links { display: flex; gap: 20px; margin-top: 40px; color: var(--muted); font-size: 0.94rem; }

.back { color: var(--muted); font-size: 0.94rem; margin-bottom: 32px; }
.page h1 { margin-bottom: 8px; }
.page section { margin-top: 40px; }
.page h2 { margin-bottom: 16px; }
.page p + p { margin-top: 12px; }

.figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 24px; }
.figures dt { min-height: 2.8em; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.figures dd { margin-top: 4px; font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.figures .figure-note { color: var(--muted); font-size: 0.85rem; font-weight: 400; }

.chart { margin-top: 40px; }
.chart-title { font-weight: 700; margin-bottom: 12px; }
.chart-note { color: var(--muted); font-size: 0.85rem; margin-top: 12px; }

/* Horizontal bars on a shared scale, with a reference line at --target. */
.hbar-target { position: relative; height: 1.4em; margin-bottom: 2px; color: var(--muted); font-size: 0.8rem; }
.hbar-target span { position: absolute; left: var(--target); transform: translateX(-50%); white-space: nowrap; }
.hbar-row + .hbar-row { margin-top: 10px; }
.hbar-label { color: var(--muted); font-size: 0.94rem; }
.hbar-track { position: relative; display: flex; align-items: center; gap: 8px; height: 20px; }
.hbar-track::after { content: ""; position: absolute; left: var(--target); top: -2px; bottom: -2px; width: 1px; background: var(--text); }
.hbar { height: 16px; flex: none; border-radius: 0 4px 4px 0; background: var(--chart-a); }
.hbar-value { font-size: 0.94rem; white-space: nowrap; }

/* Stacked columns: the top segment is iPad to Mac, the bottom one Mac to Ableton Live. */
.legend { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; padding: 0; margin-bottom: 16px; color: var(--muted); font-size: 0.94rem; }
.swatch { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 2px; }
.swatch.a, .seg.a { background: var(--chart-a); }
.swatch.b, .seg.b { background: var(--chart-b); }
.panel + .panel { margin-top: 24px; }
.panel-title { font-size: 0.94rem; margin-bottom: 8px; }
.plot {
  position: relative;
  height: 160px;
  margin-left: 44px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat;
}
.tick { position: absolute; right: calc(100% + 8px); transform: translateY(50%); color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.cols { position: absolute; inset: 0; display: flex; gap: 2px; }
.col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.col:hover { background: var(--line); }
.seg { display: block; }
.seg.a { border-top: 2px solid var(--bg); }
.seg.b { border-radius: 2px 2px 0 0; }

.chart-data { margin-top: 12px; overflow-x: auto; font-size: 0.85rem; }
.chart-data summary { color: var(--muted); cursor: pointer; }
.chart-data table { width: 100%; margin-top: 8px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chart-data th, .chart-data td { padding: 2px 6px; text-align: right; border-bottom: 1px solid var(--line); }
.chart-data th { color: var(--muted); }

.steps { padding-left: 1.3em; margin-top: 32px; }
.steps li + li { margin-top: 10px; }

@media (max-width: 520px) {
  main { padding-top: 56px; }
  .item { flex-direction: column; gap: 12px; }
  .figures { grid-template-columns: 1fr; }
  .figures dt { min-height: 0; }
  .cols { gap: 1px; }
}
