/* Fast layered depth of field: the components of the note, from the blog generator
   (/var/tmp/dof/blog/build.py, site/port_site.py). */
/* The note's palette, mapped to the site's. */
.note { --bg: #fff; --surface: var(--code-bg); --ink: var(--strong); --muted: #888; --line: #ddd;
  --accent: var(--brand); --accent-soft: #e8ecf3; --cool: var(--link); --cool-soft: #e6eef9;
  --display: var(--font); --body: var(--font); --mono: "Ubuntu Mono", monospace; }
.note .flow .fnode.light { border-color: #c25e12; background: #fbeee3; }
.note .flow .lanelab.light { color: #c25e12; }
.note .hero img, .note .wide img { border-radius: 2px; margin: 0; }
.note .eq-cap { text-align: center; color: var(--muted); font-size: .9rem; margin: -.4rem 0 1rem; }
.note .live input[type=range] { accent-color: var(--brand); }
.note .live-group > b { color: var(--strong); font-family: var(--font); }
.note .live canvas, .note .live-stage { border-radius: 2px; }

/* Figures, tables and the comparison. */
.note .hero img, .note .wide img { width: 100%; border-radius: 10px; display: block; }
.note .focus-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.note .focus-tabs button { font: 500 0.82rem/1 var(--mono); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.8rem; cursor: pointer; }
.note .focus-tabs button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.note .cmp-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; cursor: ew-resize; touch-action: none; user-select: none; }
.note .cmp-stage img { position: absolute; inset: 0; margin: 0; max-width: none; width: 100%; height: 100%; display: block; pointer-events: none; }
.note .cmp-stage #cmp-cpu { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.note .cmp-divider { position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 4px rgba(0,0,0,.5); }
.note .cmp-divider::after { content: "↔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 2rem; height: 2rem; border-radius: 50%; background: #fff; color: #333; font: 600 1rem/2rem sans-serif; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.note .cmp-divider:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.note .cmp-tag { position: absolute; top: 0.6rem; font: 500 0.75rem/1 var(--mono); color: #fff; background: rgba(0,0,0,.45); padding: 0.3rem 0.5rem; border-radius: 4px; pointer-events: none; }
.note .cmp-tag-l { left: 0.6rem; }
.note .cmp-tag-r { right: 0.6rem; }
.note .flow { display: grid; justify-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem 0.8rem; }
.note .fnode { width: min(100%, 23rem); box-sizing: border-box; background: var(--bg); border: 1.5px solid var(--muted); border-radius: 10px; padding: 0.55rem 0.8rem; display: grid; grid-template-columns: auto 1fr; column-gap: 0.65rem; }
.note .fnode .n { grid-row: span 2; align-self: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font: 600 0.85rem/1 var(--mono); }
.note .fnode b { font: 700 1.05rem/1.3 var(--display); }
.note .fnode small { font: 400 0.84rem/1.4 var(--mono); color: var(--muted); }
.note .fnode.io { grid-template-columns: 1fr; text-align: center; border-style: dashed; }
.note .fnode.layer { border-color: var(--cool); background: var(--cool-soft); }
.note .fnode.light { border-color: var(--accent); background: var(--accent-soft); }
.note .down { width: 2px; height: 1.3rem; background: var(--muted); position: relative; margin-bottom: 6px; }
.note .down::after { content: ""; position: absolute; left: -5px; bottom: -6px; border: 6px solid transparent; border-top: 7px solid var(--muted); border-bottom: 0; }
.note .fork { width: 100%; height: 22px; display: block; }
.note .fork path { stroke: var(--muted); stroke-width: 2; fill: none; vector-effect: non-scaling-stroke; }
.note .split { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.note .split .col { display: grid; justify-items: center; align-content: start; padding: 0 0.25rem; }
.note .split .fnode { width: 100%; }
.note .lanelab { font: 500 0.72rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 0.3rem; }
.note .lanelab.layer { color: var(--cool); }
.note ol.steps { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.55rem; }
.note ol.steps b { font-family: var(--display); font-weight: 700; }
.note .tablewrap { overflow-x: auto; }
.note .fig-svg svg { width: 100%; height: auto; display: block; }
.note .fig-svg .axis { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; fill: none; }
.note .fig-svg .lens { fill: var(--cool-soft); stroke: var(--cool); stroke-width: 1.5; }
.note .fig-svg .sensor { stroke: var(--ink); stroke-width: 3; }
.note .fig-svg .ray-f { stroke: var(--cool); stroke-width: 1.5; fill: none; }
.note .fig-svg .ray-n { stroke: #c7781a; stroke-width: 1.5; fill: none; }
.note .fig-svg .dot-f { fill: var(--cool); }
.note .fig-svg .dot-n { fill: #c7781a; }
.note .fig-svg .disc { stroke: #c7781a; stroke-width: 6; stroke-linecap: round; }
.note .fig-svg .ray-far { stroke: #5d9b5a; stroke-width: 1.5; fill: none; }
.note .fig-svg .dot-far { fill: #5d9b5a; }
.note .fig-svg .coc-plane { stroke: var(--cool); stroke-width: 2; stroke-dasharray: 6 4; }
.note .fig-svg text.coc-focus-t { fill: var(--cool); }
.note .fig-svg .coc-bar-near { stroke: #c7781a; stroke-width: 5; stroke-linecap: round; }
.note .fig-svg .coc-bar-far { stroke: #5d9b5a; stroke-width: 5; stroke-linecap: round; }
.note .fig-svg .coc-frame { fill: #15161c; stroke: var(--line); }
.note .fig-svg .coc-disc-near { fill: #c7781a; fill-opacity: 0.75; stroke: #f0a040; }
.note .fig-svg .coc-disc-far { fill: #5d9b5a; fill-opacity: 0.75; stroke: #8fd18a; }
.note .fig-svg text.coc-panel-t { fill: #c9ccd6; }
.note .coc-eq { margin-top: 0.6rem; font-size: 0.95rem; line-height: 1.7; font-variant-numeric: tabular-nums; }
.note .coc-eq b { font-weight: 600; display: inline-block; min-width: 2.6em; text-align: right; }
.note .coc-eq-name { display: inline-block; min-width: 2.6em; font: 500 0.82rem/1 var(--mono); }
.note .coc-eq-near .coc-eq-name, .note .coc-eq-near b { color: #c7781a; }
.note .coc-eq-far .coc-eq-name, .note .coc-eq-far b { color: #4f8a4c; }
.note .fig-svg .coc-drag { cursor: ew-resize; touch-action: none; outline: none; }
.note .fig-svg .coc-hit { fill: transparent; }
.note .fig-svg .coc-handle { fill: var(--cool); stroke: var(--bg); stroke-width: 2; }
.note .fig-svg .coc-drag:hover .coc-plane, .note .fig-svg .coc-drag.dragging .coc-plane, .note .fig-svg .coc-drag:focus-visible .coc-plane { stroke-width: 3; }
.note .fig-svg .coc-drag:focus-visible .coc-handle { stroke: var(--ink); }
.note .fig-svg .lead { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.note .fig-svg text { font: 400 13px var(--mono); fill: var(--muted); }
.note .fig-svg text.ink { fill: var(--ink); }
.note .fig-svg .s0 { fill: #c7781a; }
.note .fig-svg .s1 { fill: #5d9b5a; }
.note .fig-svg .s2 { fill: #4d6fb3; }
.note .fig-svg .pix { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.note .fig-svg .tline { stroke: var(--ink); stroke-width: 2; fill: none; }
.note tr.ours td { color: var(--ink); font-weight: 500; }

/* The interactive demo. */
.live { display: grid; gap: 0.7rem; margin: 1.2rem 0; }
.live-views { margin: 0; min-width: 0; }
.live-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000;
  cursor: ew-resize; touch-action: pan-y; user-select: none; --split: 50%; }
.live-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#live-out { clip-path: inset(0 0 0 var(--split)); }
.live-divider { position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; margin-left: -1px;
  background: #fff; box-shadow: 0 0 4px rgba(0,0,0,0.6); pointer-events: none; }
.live-divider span { position: absolute; top: 50%; left: 50%; width: 2rem; height: 2rem; margin: -1rem 0 0 -1rem;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(0,0,0,0.5); }
.live-divider span::before, .live-divider span::after { content: ""; position: absolute; top: 50%; margin-top: -5px;
  border: 5px solid transparent; }
.live-divider span::before { left: 3px; border-right: 6px solid #333; border-left: 0; }
.live-divider span::after { right: 3px; border-left: 6px solid #333; border-right: 0; }
.live-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.live-tag { position: absolute; top: 0.6rem; font: 500 0.72rem/1 var(--mono); color: #fff;
  background: rgba(0,0,0,0.5); padding: 0.3rem 0.5rem; border-radius: 5px; pointer-events: none; }
.live-tag.left { left: 0.6rem; } .live-tag.right { right: 0.6rem; }
.live-cap { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  font: 400 0.82rem/1.5 var(--mono); color: var(--muted); margin-top: 0.4rem; }
.live select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 0.1rem 0.3rem; }
.live-status { font-variant-numeric: tabular-nums; }
.live-group { display: grid; grid-template-columns: 4.5rem repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.4rem 1.1rem;
  align-items: end; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.live-group > b { font: 700 0.9rem/1.6 var(--display); align-self: start; grid-row: 1 / span 3; }
.live-row { display: grid; grid-template-columns: 1fr auto; column-gap: 0.5rem; align-items: center;
  font: 400 0.78rem/1.35 var(--mono); color: var(--muted); min-width: 0; }
.live-row output { color: var(--ink); font-variant-numeric: tabular-nums; }
.live-row input[type=range] { grid-column: 1 / -1; width: 100%; margin: 0.15rem 0 0; accent-color: var(--accent); }
.live-row > span { min-width: 0; }
.live-row select { grid-column: 1 / -1; margin-top: 0.15rem; }
.live-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  font: 400 0.78rem/1.5 var(--mono); color: var(--muted); }
.live-foot button { font: 500 0.8rem/1 var(--mono); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.8rem; cursor: pointer; }
.live-foot button:hover { border-color: var(--accent); }
@media (max-width: 560px) { .live-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-group > b { grid-column: 1 / -1; grid-row: auto; } }
