/* Engineering Notebook download site.
   Everything is local: system fonts, inline SVG icons, no images from
   anywhere else. Colours are tokens so dark mode is one block below. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #142033;
  --ink-2: #3a475a;
  --muted: #5e6a7c;
  --line: #dde2ea;
  --grid: rgba(36, 86, 214, .07);
  --grid-strong: rgba(36, 86, 214, .12);
  --accent: #2456d6;
  --accent-ink: #ffffff;
  --accent-soft: #e8eefe;
  --accent-text: #1f4bbd;
  --good: #1d7a46;
  --good-soft: #e3f4ea;
  --shadow: 0 1px 2px rgba(20, 32, 51, .06), 0 12px 32px -12px rgba(20, 32, 51, .18);
  --radius: 14px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --serif: "Cambria Math", "STIX Two Math", "STIX Two Text", Cambria, "Latin Modern Roman", "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1218;
    --surface: #161b23;
    --ink: #e7ebf1;
    --ink-2: #c3cad5;
    --muted: #97a1b0;
    --line: #2a313c;
    --grid: rgba(111, 155, 255, .06);
    --grid-strong: rgba(111, 155, 255, .1);
    --accent: #6f9bff;
    --accent-ink: #0b1220;
    --accent-soft: #1c2840;
    --accent-text: #9dbbff;
    --good: #5fd08f;
    --good-soft: #15301f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
b, strong { font-weight: 650; }
code, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--accent-soft); color: var(--ink); padding: .1em .35em; border-radius: 5px; overflow-wrap: anywhere; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); letter-spacing: -.02em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: 12px; top: -60px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 20; box-shadow: var(--shadow); }
.skip:focus { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 10px;
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, box-shadow .15s, transform .15s;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -8px var(--accent); }
.btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn.ghost { color: var(--ink); border-color: var(--line); background: var(--surface); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.big { min-height: 52px; padding: 0 26px; font-size: 16px; width: 100%; max-width: 340px; }
.btn[aria-disabled="true"] { background: var(--line); color: var(--muted); box-shadow: none; cursor: default; transform: none; filter: none; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.top-row { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; white-space: nowrap; }
.brand img { border-radius: 7px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 15px; }
.nav a:hover { background: var(--accent-soft); color: var(--ink); }
.nav a.nav-cta { color: var(--accent-text); font-weight: 600; }
@media (max-width: 560px) {
  .nav a:not(.nav-cta) { display: none; }
  .brand span { font-size: 15px; }
}

/* Hero, on faint engineering paper that fades out */
.hero { position: relative; padding: 72px 0 88px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 80% 75% at 60% 35%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 75% at 60% 35%, #000 30%, transparent 78%);
}
.hero-row { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-block; margin: 0 0 18px; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-text); font-size: 13.5px; font-weight: 600;
}
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.7rem); letter-spacing: -.035em; line-height: 1.06; font-weight: 750; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-2); margin: 22px 0 30px; max-width: 34em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* The example notepad */
.sheet { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sheet-bar { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.sheet-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.sheet-title { margin-left: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.sheet-paper {
  padding: 22px 26px 18px 44px; position: relative;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px;
  font: 19px/1.5 var(--serif);
}
.sheet-paper::before { content: ""; position: absolute; left: 28px; top: 0; bottom: 0; width: 1px; background: color-mix(in srgb, var(--accent) 35%, transparent); }
.note { margin: 0 0 10px; font: 600 12.5px/1.4 var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.line { display: flex; align-items: center; flex-wrap: wrap; gap: 0 .4em; min-height: 2.15em; white-space: nowrap; }
.line .m { font-style: italic; }
.line .op { color: var(--muted); padding: 0 .1em; }
.line sup { font-size: .62em; line-height: 0; }
.frac { display: inline-flex; flex-direction: column; align-items: center; font-size: .82em; line-height: 1.25; vertical-align: middle; }
.frac > span { padding: 0 .25em; }
.frac > span:first-child { border-bottom: 1.3px solid currentColor; }
.ans { background: var(--accent-soft); color: var(--accent-text); padding: 0 .45em; border-radius: 6px; font-family: var(--serif); }
.check .ok { font: 600 13px/1 var(--sans); color: var(--good); background: var(--good-soft); padding: 5px 9px; border-radius: 999px; margin-left: .4em; }
.dim { margin: 14px 0 0; width: 100%; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.2; opacity: .7; }
.dim-label { margin: 0; text-align: center; font: italic 14px/1.4 var(--serif); color: var(--muted); }

@media (max-width: 900px) {
  .hero { padding: 48px 0 64px; }
  .hero-row { grid-template-columns: 1fr; gap: 40px; }
  .sheet { max-width: 520px; }
}
@media (max-width: 420px) {
  .sheet-paper { font-size: 16.5px; padding: 18px 16px 14px 34px; }
  .sheet-paper::before { left: 20px; }
}

/* Download chooser */
.download { padding: 80px 0; border-top: 1px solid var(--line); background: var(--surface); }
.section-lede { color: var(--ink-2); margin: 10px 0 0; max-width: 40em; font-size: 1.05rem; }
.chooser { margin-top: 32px; }

/* Without JavaScript the tabs do nothing, so they are hidden and every
   system's panel is shown one under another. */
.tabs { display: none; }
.js .tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.tab {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; border-radius: 12px; cursor: pointer;
  background: var(--bg); border: 1.5px solid var(--line); color: var(--ink);
  font: inherit; transition: border-color .15s, background .15s, box-shadow .15s;
}
.tab svg { width: 28px; height: 28px; flex: none; fill: currentColor; color: var(--muted); }
.tab svg.stroke { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.tab strong { font-size: 16.5px; }
.tab small { color: var(--muted); font-size: 13px; }
.tab:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.tab[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.tab[aria-selected="true"] svg { color: var(--accent); }

.status { margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-weight: 550; }

.panel {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 40px;
  padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.panel + .panel { margin-top: 16px; }
/* With JavaScript only the chosen system shows; the attribute on <html> is
   set before the first paint, so nothing jumps. */
.js .panel { display: none; }
.js[data-os="windows"] #p-windows, .js[data-os="macos"] #p-macos, .js[data-os="linux"] #p-linux { display: grid; }
.js .panel + .panel { margin-top: 0; }
.panel h3 { font-size: 1.5rem; }
.for { color: var(--muted); margin: 4px 0 22px; }
.file { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 22px 0 0; font-size: 14.5px; }
.file dt { color: var(--muted); }
.file dd { margin: 0; overflow-wrap: anywhere; }
.steps h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.steps ol { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 14px 40px; color: var(--ink-2); }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1.5px solid var(--accent); color: var(--accent-text);
  font: 650 13px/1 var(--sans);
}
.steps q { font-style: italic; }
.cmd { display: block; margin: 8px 0 2px; padding: 10px 12px; border-radius: 8px; line-height: 1.5; white-space: normal; }
.aside { margin: 2px 0 0 40px; color: var(--muted); font-size: 14.5px; }
.terms { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

.notes { margin-top: 16px; padding: 16px 18px; border-radius: 12px; border: 1px dashed var(--line); }
.notes h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.notes p { margin: 0; white-space: pre-line; color: var(--ink-2); }

.checksum { margin-top: 16px; color: var(--muted); font-size: 14.5px; }
.checksum summary { cursor: pointer; width: fit-content; }
.checksum p { margin: 8px 0; }
.hash { display: block; padding: 10px 12px; overflow-wrap: anywhere; word-break: break-all; }

@media (max-width: 760px) {
  .js .tabs { gap: 8px; }
  .tab { flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 6px; }
  .tab span { align-items: center; }
  .tab small { font-size: 12px; }
  .panel { grid-template-columns: 1fr; gap: 28px; padding: 22px 18px; }
  .btn.big { max-width: none; }
}

/* Features */
.features { padding: 84px 0; }
/* Three across, with units (the point of the app) taking two places. */
.feature-grid { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature-grid li.wide { grid-column: span 2; }
.feature-grid li.wide p { max-width: 34em; }
@media (max-width: 860px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } .feature-grid li.wide { grid-column: auto; } }
.feature-grid li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; }
.feature-grid svg { width: 36px; height: 36px; padding: 7px; border-radius: 10px; background: var(--accent-soft); fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 14px; }
.feature-grid li:last-child svg { fill: var(--accent); stroke: none; }
.feature-grid h3 { font-size: 1.05rem; margin-bottom: 6px; }
.feature-grid p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* Privacy and updates */
.privacy { padding: 84px 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.privacy-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.ticks { list-style: none; margin: 26px 0 0; padding: 0; }
.ticks li { position: relative; padding: 0 0 14px 34px; color: var(--ink-2); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 20px; height: 20px; border-radius: 50%;
  background: var(--good-soft);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--good) 45%, transparent);
}
.ticks li::after {
  content: ""; position: absolute; left: 7px; top: calc(.2em + 4px); width: 5px; height: 9px;
  border: solid var(--good); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.ticks b { color: var(--ink); }
.more { margin: 6px 0 0 34px; font-size: 15px; }
.updates { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.updates h3 { font-size: 1.2rem; margin-bottom: 16px; }
.updates p { color: var(--ink-2); margin: 14px 0 0; font-size: 15.5px; }
.switch-demo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
.switch { width: 44px; height: 26px; border-radius: 999px; background: var(--accent); position: relative; flex: none; }
.switch span { position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
@media (max-width: 860px) { .privacy-row { grid-template-columns: 1fr; gap: 32px; } }

/* Closing band and footer */
.closing { padding: 56px 0; }
.closing-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 28px 32px; border-radius: 18px; background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.closing p { margin: 0; font-size: 1.15rem; color: var(--ink-2); }
.closing strong { color: var(--ink); }
@media (max-width: 560px) { .closing-row { padding: 22px 18px; } .closing .btn { width: 100%; } }

.foot { padding: 28px 0 40px; color: var(--muted); font-size: 14.5px; }
.foot-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot nav { display: flex; gap: 18px; }
.foot a { color: var(--muted); }

/* Plain text pages: privacy note and 404 */
.page { padding: 64px 0 80px; }
.page .wrap { max-width: 760px; }
.page h1 { font-size: clamp(2rem, 4.6vw, 2.8rem); letter-spacing: -.03em; margin-bottom: 14px; }
.page h2 { font-size: 1.3rem; margin: 34px 0 8px; }
.page p, .page li { color: var(--ink-2); }
.page .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.page-note { font-size: 14.5px; }
.page p.page-note { color: var(--muted); }

/* The licence page: the text of LICENSE, word for word, on a sheet of its own */
.licence { margin-top: 30px; padding: 26px 28px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.licence .lic-title { margin-top: 0; }
.page .licence .lic-title b { color: var(--ink); }
.page .licence h2 { font-size: 1.1rem; margin: 26px 0 6px; }
.lic-items { list-style: none; margin: 0 0 16px; padding: 0; }
.lic-items li { position: relative; padding-left: 28px; margin-bottom: 10px; }
.lic-mark { position: absolute; left: 0; font-weight: 650; color: var(--ink); }
.lic-caps { font-size: 14px; }
@media (max-width: 560px) { .licence { padding: 18px 16px 6px; } }
.big-mark { font: italic 96px/1 var(--serif); color: var(--accent); margin-bottom: 8px; }
