.note-detail { --note-accent: #a9c7ff; }
.note-detail .site-header { z-index: 90; }
.note-detail .note-hero { padding-top: 120px; }
.note-back { display: inline-flex; margin-bottom: 38px; color: var(--body); font-size: 15px; }
.note-back:hover { text-decoration: underline; text-underline-offset: 5px; }
.note-back:focus-visible, .note-rail a:focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; }
.note-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 7%; align-items: end; }
.note-kicker { margin: 0 0 18px; color: var(--note-accent); font: 500 11px/1.4 "IBM Plex Mono", monospace; letter-spacing: .07em; text-transform: uppercase; }
.note-hero h1 { max-width: 800px; margin: 0; font: 500 clamp(50px, 5.2vw, 76px)/1.02 "Barlow Condensed", sans-serif; letter-spacing: -.025em; text-wrap: balance; }
.note-deck { max-width: 610px; margin: 22px 0 0; color: var(--body); font-size: clamp(18px, 1.65vw, 21px); line-height: 1.45; }
.note-meta { padding-bottom: 5px; border-top: 1px solid var(--hairline); }
.note-meta p { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 12px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; }
.note-meta span { color: var(--muted); font: 400 11px/1.4 "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .06em; }
.note-hero-art { margin: 52px 0 0; }
.note-hero-art figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; }
.note-image-placeholder { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; width: 100%; min-height: 310px; padding: 24px; border: 1px solid var(--hairline); border-radius: 14px; background: var(--surface-solid); }
.note-image-placeholder--cover { min-height: 0; aspect-ratio: 16 / 7; }
.note-image-placeholder span { color: var(--muted); font: 500 11px/1.5 "IBM Plex Mono", monospace; letter-spacing: .04em; text-transform: uppercase; }
.note-image-placeholder strong { color: var(--body); font: 400 18px/1.3 "Barlow Semi Condensed", sans-serif; }
.note-reading-layout { display: grid; grid-template-columns: minmax(170px, 215px) minmax(0, 680px); justify-content: space-between; gap: clamp(50px, 7vw, 150px); padding-top: 76px; padding-bottom: 105px; }
.note-rail { position: sticky; top: 110px; align-self: start; }
.note-rail > p { margin: 0 0 22px; color: var(--muted); font: 500 12px/1.4 "IBM Plex Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.note-rail nav { display: flex; flex-direction: column; gap: 6px; border-left: 1px solid var(--hairline); }
.note-rail a { display: block; padding: 8px 0 8px 17px; border-left: 2px solid transparent; margin-left: -1px; color: var(--muted); font-size: 14px; line-height: 1.35; transition: color .2s ease, border-color .2s ease; }
.note-rail a[aria-current="true"] { color: var(--text); border-color: var(--note-accent); }
.note-body { min-width: 0; color: var(--body); font-size: clamp(17px, 1.4vw, 18px); line-height: 1.65; }
.note-section { scroll-margin-top: 100px; margin-bottom: 82px; }
.note-section > p { margin: 0 0 21px; }
.note-section h2 { margin: 0 0 24px; color: var(--text); font: 500 clamp(34px, 3.2vw, 44px)/1.08 "Barlow Condensed", sans-serif; letter-spacing: -.015em; text-wrap: balance; }
.note-lede { color: var(--text); font-size: clamp(19px, 1.8vw, 22px); line-height: 1.5; }
.note-pull { margin: 44px 0 0; padding: 24px 0 28px; border-top: 1px solid var(--hairline-strong); border-bottom: 1px solid var(--hairline-strong); }
.note-pull span, .note-example span, .note-figure figcaption span { color: var(--note-accent); font: 500 11px/1.5 "IBM Plex Mono", monospace; letter-spacing: .07em; }
.note-pull p { max-width: 18ch; margin: 15px 0 0; color: var(--text); font: 500 clamp(29px, 3vw, 40px)/1.1 "Barlow Condensed", sans-serif; }
.note-figure { margin: 38px 0 0; }
.note-figure figcaption { display: flex; gap: 18px; margin-top: 14px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.note-figure figcaption span { flex: none; }
.note-example { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 35px; }
.note-example > div { min-height: 145px; padding: 20px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); }
.note-example p { margin: 14px 0 0; color: var(--text); font-size: 17px; line-height: 1.45; }
.note-steps { margin: 35px 0 38px; padding: 0; list-style: none; counter-reset: steps; }
.note-steps li { display: grid; grid-template-columns: minmax(145px, .6fr) 1fr; gap: 22px; padding: 20px 0; border-top: 1px solid var(--hairline); counter-increment: steps; }
.note-steps li:last-child { border-bottom: 1px solid var(--hairline); }
.note-steps strong { color: var(--text); font-size: 17px; font-weight: 500; line-height: 1.4; }
.note-steps strong::before { display: block; margin-bottom: 8px; color: var(--note-accent); content: counter(steps, decimal-leading-zero); font: 12px/1 "IBM Plex Mono", monospace; }
.note-steps span { font-size: 17px; line-height: 1.5; }
html[data-theme="light"] .note-detail { --note-accent: #2458a6; }
@media (max-width: 850px) { .note-reading-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 65px; } .note-rail { position: relative; top: auto; min-width: 0; margin-bottom: 55px; } .note-rail nav { display: flex; flex-direction: row; gap: 8px; overflow-x: auto; border-left: 0; padding-bottom: 10px; } .note-rail a { flex: none; margin: 0; padding: 8px 12px; border: 1px solid var(--hairline); border-radius: 999px; } .note-rail a[aria-current="true"] { border-color: var(--note-accent); }  }
@media (max-width: 600px) { .note-detail .note-hero { padding-top: 100px; } .note-back { margin-bottom: 30px; } .note-hero-grid { grid-template-columns: 1fr; gap: 30px; } .note-hero h1 { font-size: clamp(44px, 11.4vw, 56px); } .note-deck { font-size: 18px; } .note-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; } .note-hero-art { margin-top: 34px; } .note-image-placeholder--cover { aspect-ratio: 16 / 9; } .note-image-placeholder { min-height: 220px; padding: 17px; } .note-reading-layout { padding-top: 48px; padding-bottom: 70px; } .note-section { margin-bottom: 67px; } .note-figure figcaption { display: block; } .note-figure figcaption span { display: block; margin-bottom: 5px; } .note-example { grid-template-columns: 1fr; } .note-example > div { min-height: 0; } .note-steps li { grid-template-columns: 1fr; gap: 6px; } }
@media (prefers-reduced-motion: reduce) { .note-rail a { transition: none; } }

/* Reading progress: a pixel energy meter beside the percentage. */
.note-rail-progress { display: flex; align-items: center; gap: 12px; margin-top: 30px; color: var(--muted); font: 12px/1.5 "IBM Plex Mono", monospace; }
.reading-label { display: inline-flex; flex: none; align-items: baseline; gap: .45em; white-space: nowrap; }
#readingPercent { color: var(--note-accent); min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
.reading-progress { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 2px; flex: 1; min-width: 90px; max-width: 136px; height: 16px; padding: 3px; border: 1px solid var(--note-accent); background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--surface-solid); clip-path: polygon(2px 0, calc(100% - 2px) 0, calc(100% - 2px) 2px, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 2px calc(100% - 2px), 0 calc(100% - 2px), 0 2px, 2px 2px); }
.reading-progress__pixel { display: block; min-width: 0; height: 100%; background: var(--note-accent); box-shadow: inset 0 2px 0 rgb(255 255 255 / .18); opacity: .12; transition: opacity 150ms linear; }
.reading-progress__pixel.is-filled { opacity: 1; }
.note-body > .note-section:last-child { margin-bottom: 0; }
@media (max-width: 850px) {
  .note-rail-progress { position: fixed; z-index: 80; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: 232px; max-width: calc(100vw - 32px); margin: 0; padding: 10px 12px; border: 1px solid var(--hairline-strong); background: var(--surface-solid); box-shadow: 0 4px 16px rgb(0 0 0 / .12); }
  .note-reading-layout { padding-bottom: 110px; }
}
@media (prefers-reduced-motion: reduce) { .reading-progress__pixel { transition: none; } }
