/* Personal Notes: a quiet, self-hosted reading room. */
:root {
  color-scheme: light;
  --paper: #f6f5f0;
  --surface: #fffefa;
  --ink: #242923;
  --muted: #60675f;
  --line: #d8dcd1;
  --accent: #28533e;
  --soft: #e9ede3;
  --code: #edf0e8;
  --error: #9b312c;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --paper: #171c19; --surface: #1d2420; --ink: #e6e9e1;
    --muted: #aab6aa; --line: #364238; --accent: #a5cdb1;
    --soft: #25342a; --code: #232c25; --error: #ffaca2;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #171c19; --surface: #1d2420; --ink: #e6e9e1;
  --muted: #aab6aa; --line: #364238; --accent: #a5cdb1;
  --soft: #25342a; --code: #232c25; --error: #ffaca2;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--paper); }
a { color: var(--accent); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a, button, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.container { width: min(1120px, calc(100% - 96px)); margin-inline: auto; }
.skip-link { position: fixed; top: -100px; left: 20px; padding: 12px 20px; z-index: 10; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 16px; }
.site-header { border-bottom: 1px solid var(--line); }
.site-header > .container { display: flex; min-height: 104px; gap: 32px; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); font-size: 20px; font-weight: 650; white-space: nowrap; letter-spacing: -.6px; }
.brand svg { width: 32px; height: 32px; }
.brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; background: var(--accent); color: var(--paper); border-radius: 7px; font: 14px/1 var(--mono); letter-spacing: -1px; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 22px; }
.site-nav a { display: inline-flex; min-height: 44px; align-items: center; color: var(--muted); text-decoration: none; font-size: 14px; }
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--ink); }
.site-nav a[aria-current='page'] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 9px; }
#theme-toggle { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 5px; font-size: 12px; padding: 7px 10px; min-height: 38px; white-space: nowrap; }
#theme-toggle:hover { border-color: var(--accent); color: var(--ink); }
main.container { min-height: 65vh; padding-block: 68px 92px; }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 500; color: var(--ink); }
h1 { max-width: 850px; margin: 14px 0 24px; font: 500 clamp(40px, 5.2vw, 68px)/1.08 var(--serif); letter-spacing: -2px; }
h2 { font: 500 32px/1.2 var(--serif); letter-spacing: -.7px; margin: 0 0 20px; }
h3 { font: 500 24px/1.25 var(--serif); letter-spacing: -.3px; }
p { margin: 0 0 1.25em; }
.eyebrow, .kicker { margin-bottom: 18px; color: var(--accent); font: 12px/1.5 var(--mono); text-transform: uppercase; letter-spacing: 1.4px; }
.intro, .lede { max-width: 650px; color: var(--muted); font-size: 20px; line-height: 1.65; }
.hero { position: relative; padding-bottom: 52px; border-bottom: 1px solid var(--line); margin-bottom: 46px; }
.hero .intro { max-width: 620px; }
.hero h1 { max-width: 740px; }
.hero-aside { position: absolute; right: 0; top: 76px; width: 220px; color: var(--muted); font: 12px/1.9 var(--mono); }
.hero-symbol { display: block; padding: 24px 0 28px; margin-bottom: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font: 38px/1.4 var(--mono); color: var(--accent); letter-spacing: -3px; }
.text-link { font-size: 14px; font-weight: 600; }
.section + .section { margin-top: 56px; }
.closing-note { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; border-top: 1px solid var(--line); margin-top: 54px; padding-top: 26px; }
.closing-note p { font: italic 21px/1.5 var(--serif); color: var(--muted); margin: 0; }
.hero-actions, .actions, .button-row, .tool-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hero-actions { margin-top: 28px; }
.section-heading { display: flex; gap: 20px; align-items: baseline; justify-content: space-between; margin: 38px 0 8px; }
.section-heading h2 { margin-bottom: 12px; }
.section-heading > a { font-size: 14px; }
.article-list { margin: 0; padding: 0; list-style: none; }
.article-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.article-row > a, .article-row h2 a, .article-row h3 a { text-decoration: none; color: var(--ink); }
.article-row:hover h2, .article-row:hover h3 { color: var(--accent); }
.article-row h2, .article-row h3 { margin: 4px 0 10px; font-size: 27px; }
.article-row p { margin: 0; color: var(--muted); max-width: 680px; font-size: 15px; }
.article-number, .article-index { font: 12px/1.6 var(--mono); color: var(--muted); padding-top: 7px; }
.article-meta, .meta { color: var(--muted); font: 12px/1.7 var(--mono); }
.article-arrow { align-self: center; color: var(--accent); font-size: 24px; }
.tools-grid, .tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 24px; }
.tool-card, .tool-panel { background: var(--surface); padding: 30px; border: 1px solid var(--line); border-radius: 7px; }
.tool-card { text-decoration: none; color: var(--ink); }
.tool-card:hover { border-color: var(--accent); }
.tool-meta { color: var(--accent); font: 11px/1.6 var(--mono); }
.tool-card h2, .tool-card h3, .tool-panel h2 { margin: 0 0 14px; }
.tool-card p { color: var(--muted); font-size: 15px; }
.tool-icon { color: var(--accent); font: 24px/1.4 var(--mono); display: block; margin-bottom: 22px; }
.tool-panel { margin: 32px 0; }
.tool-panel > p { max-width: 740px; color: var(--muted); }
.button, button { font: 600 14px/1.35 var(--sans); border-radius: 5px; border: 1px solid var(--accent); background: var(--accent); color: var(--paper); padding: 12px 18px; cursor: pointer; min-height: 44px; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; }
.button:hover, button:hover { filter: brightness(1.12); }
.button-secondary, button[type='button'], .secondary { background: transparent; border-color: var(--line); color: var(--ink); }
button:disabled { cursor: not-allowed; opacity: .5; filter: none; }
form { margin-top: 22px; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
input, textarea { border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink); font: 14px/1.7 var(--mono); padding: 12px 14px; max-width: 100%; }
textarea { display: block; width: 100%; min-height: 200px; resize: vertical; tab-size: 2; overflow-wrap: normal; }
textarea[readonly] { background: var(--code); }
input[type='number'] { width: 120px; min-height: 46px; }
textarea + label, .tool-actions + label, .button-row + label, .actions + label { margin-top: 24px; }
.tool-actions, .button-row, form .actions { margin-block: 14px 22px; }
form button { margin: 10px 6px 10px 0; }
.form-grid, .json-grid, .editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.uuid-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 18px; margin-bottom: 24px; }
.uuid-controls button { margin: 0; }
.tool-navigation { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 14px; }
.tool-status, [role='status'] { font-size: 14px; min-height: 1.7em; color: var(--accent); margin: 12px 0 0; }
[data-state='error'] { color: var(--error); }
.note, .callout, noscript p { border-left: 3px solid var(--accent); background: var(--soft); padding: 16px 20px; font-size: 15px; margin: 24px 0; }
.note p:last-child, .callout p:last-child { margin-bottom: 0; }
.page-header { margin-bottom: 42px; max-width: 830px; }
.breadcrumbs { color: var(--muted); font: 13px/1.5 var(--mono); margin-bottom: 30px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 12px; }
.article-bottom { display: flex; flex-wrap: wrap; gap: 18px 32px; border-top: 1px solid var(--line); margin-top: 45px; padding-top: 26px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 740px) minmax(180px, 1fr); gap: 70px; align-items: start; }
.prose { max-width: 740px; overflow-wrap: break-word; }
.prose h2 { margin-top: 42px; margin-bottom: 18px; }
.prose h3 { margin-top: 28px; margin-bottom: 12px; }
.prose p, .prose li { line-height: 1.85; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin-bottom: 8px; }
.prose strong { font-weight: 650; }
code { font: .88em/1.6 var(--mono); padding: 2px 5px; background: var(--code); border-radius: 3px; }
pre { padding: 20px; background: var(--code); border: 1px solid var(--line); border-radius: 5px; overflow: auto; font: 13px/1.8 var(--mono); }
pre code { padding: 0; background: transparent; font-size: inherit; }
blockquote { margin-inline: 0; padding-left: 22px; border-left: 2px solid var(--accent); color: var(--muted); }
.toc, .article-layout aside { position: sticky; top: 30px; border-top: 1px solid var(--line); padding-top: 18px; font-size: 13px; }
.toc h2, .toc h3, .article-layout aside h2, .article-layout aside h3 { font: 600 12px/1.5 var(--sans); text-transform: uppercase; letter-spacing: 1px; }
.toc ol, .toc ul, .article-layout aside ul { list-style: none; padding: 0; margin: 0; }
.toc li, .article-layout aside li { margin-bottom: 12px; }
.toc a, .article-layout aside a { text-decoration: none; color: var(--muted); }
.toc a:hover, .article-layout aside a:hover { color: var(--accent); text-decoration: underline; }
img, svg { max-width: 100%; }
img { height: auto; }
figure { margin: 30px 0; }
figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { background: var(--soft); font-weight: 600; }
.site-footer { border-top: 1px solid var(--line); padding: 30px 0 36px; color: var(--muted); font-size: 13px; }
.site-footer > .container { display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; }
.footer-brand { color: var(--ink) !important; font-weight: 600; text-decoration: none; }
@media (max-width: 1000px) {
  .site-header > .container { gap: 16px; flex-wrap: wrap; padding-block: 22px; }
  .site-nav { gap: 4px 20px; }
  .article-layout { gap: 36px; grid-template-columns: minmax(0, 1fr) 180px; }
  .hero-aside { display: none; }
}
@media (max-width: 720px) {
  .container { width: calc(100% - 40px); }
  .site-header > .container { display: grid; grid-template-columns: 1fr auto; gap: 14px; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; gap: 4px 22px; }
  .site-nav a { font-size: 13px; }
  #theme-toggle { justify-self: end; font-size: 11px; }
  main.container { padding-block: 44px 64px; }
  h1 { font-size: 43px; letter-spacing: -1.5px; }
  h2 { font-size: 28px; }
  .intro, .lede { font-size: 18px; }
  .hero { padding-bottom: 34px; margin-bottom: 32px; }
  .article-row { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-block: 24px; }
  .article-row h2, .article-row h3 { font-size: 24px; }
  .article-arrow { display: none; }
  .tools-grid, .tool-grid, .form-grid, .json-grid, .editor-grid { grid-template-columns: 1fr; }
  .tool-card, .tool-panel { padding: 23px 20px; }
  .article-layout { display: flex; flex-direction: column; gap: 20px; }
  .article-layout aside { position: static; order: -1; width: 100%; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
  .article-layout aside ul, .article-layout aside ol { display: flex; flex-wrap: wrap; gap: 6px 16px; }
  .article-layout aside li { margin-bottom: 2px; }
  .prose { width: 100%; }
  pre { padding: 14px; font-size: 12px; }
  .section-heading { flex-wrap: wrap; gap: 0 16px; }
  .site-footer > .container { flex-direction: column; gap: 12px; }
  .closing-note { display: block; }
  .closing-note p { margin-bottom: 14px; }
}
@media (max-width: 380px) {
  .container { width: calc(100% - 32px); }
  .site-nav { gap: 4px 18px; }
  .brand { font-size: 18px; gap: 8px; }
  h1 { font-size: 38px; }
  .tool-card, .tool-panel { padding: 18px 15px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  :root { --paper: white; --ink: black; --muted: #444; --line: #ccc; --accent: black; --code: #f4f4f4; }
  body { font-size: 11pt; }
  .container { width: 100%; }
  .site-nav, #theme-toggle, .skip-link, .article-layout aside { display: none; }
  .article-layout { display: block; }
  main.container { padding-block: 24px; }
  h1 { font-size: 32pt; }
  pre { white-space: pre-wrap; }
}
