/* Ori Nozar portfolio. Tokens first, then shell, then the shared mock-screen kit. */
:root {
  --paper: #F5F6F2;
  --paper-2: #ECEEE8;
  --ink: #1C2230;
  --ink-2: #4B5260;
  --ink-3: #7B8290;
  --rule: #D6DAD2;
  --ledger: #1E5A45;
  --ledger-2: #2E7A5E;
  --ledger-tint: #E3EEE8;
  --mark: #F3E25A;
  --mark-2: #FBF3B0;
  --walk: #B4432F;
  --walk-tint: #F6E3DF;
  --amber: #B8860B;
  --amber-tint: #F7EFD6;
  --slate: #4C6A92;
  --slate-tint: #E2E9F2;
  --screen-bg: #FFFFFF;
  --rail-w: 232px;
  --measure: 62ch;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-ui: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --radius: 4px;
  --ease: cubic-bezier(.2,.7,.2,1);
}
*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-ui); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ledger); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ledger-2); }
:focus-visible { outline: 2px solid var(--ledger); outline-offset: 2px; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; margin: 0; line-height: 1.12; }
p { margin: 0 0 1em; max-width: var(--measure); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }

/* ---------- layout: rail + content ---------- */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail-w); padding: 28px 22px;
  border-right: 1px solid var(--rule); background: var(--paper); display: flex; flex-direction: column; gap: 22px; z-index: 20;
}
.rail .portrait { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; margin-bottom: -8px; }
.rail .who { font-family: var(--font-display); font-size: 22px; line-height: 1.1; color: var(--ink); text-decoration: none; }
.rail .who small { display: block; font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.4; }
.rail nav { display: flex; flex-direction: column; gap: 2px; }
.rail nav a { color: var(--ink-2); text-decoration: none; padding: 5px 8px; margin-left: -8px; border-radius: var(--radius); font-size: 14px; }
.rail nav a:hover { background: var(--paper-2); color: var(--ink); }
.rail nav a.active { color: var(--ledger); background: var(--ledger-tint); font-weight: 500; box-shadow: inset 3px 0 0 var(--ledger); }
.rail nav .group { font-size: 11.5px; color: var(--ink-3); margin: 12px 0 4px; }
.rail .foot { margin-top: auto; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.rail .foot a { color: var(--ink-2); }

.content { margin-left: var(--rail-w); }
.wrap { max-width: 1480px; padding: 0 clamp(24px, 3.2vw, 64px); margin: 0 auto; }
section.block { padding: 72px 0; border-top: 1px solid var(--rule); }

@media (max-width: 720px) {
  .rail { position: sticky; top: 0; inset: auto; width: auto; border-right: 0; border-bottom: 1px solid var(--rule); padding: 10px 16px; flex-direction: row; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
  section.block, .hero { scroll-margin-top: 120px; }
  .rail .who { font-size: 18px; white-space: nowrap; }
  .rail .who small, .rail .foot, .rail nav .group { display: none; }
  .rail .portrait { width: 28px; height: 28px; margin: 0; flex: none; }
  .rail nav { flex-direction: row; flex-wrap: wrap; gap: 2px 4px; flex: 1 1 100%; }
  .rail nav a { white-space: nowrap; padding: 4px 8px; margin: 0; font-size: 13px; }
  .content { margin-left: 0; }
  .wrap { padding: 0 16px; }
  section.block { padding: 48px 0; }
}

/* ---------- hero ---------- */
.hero { padding: 64px 0 64px; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, clamp(300px, 24vw, 380px)); gap: clamp(32px, 4vw, 72px); align-items: start; }
.hero .eyebrow { font-size: 14px; font-weight: 600; color: var(--ledger); margin: 0 0 16px; max-width: none; }
.hero .eyebrow span { font-weight: 400; color: var(--ink-3); margin-left: 10px; padding-left: 12px; border-left: 1px solid var(--rule); }
.hero h1 { font-size: clamp(34px, 4.1vw, 52px); font-weight: 400; max-width: 19ch; text-wrap: balance; }
.hero .lede { font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 56ch; margin: 22px 0 0; }
.hero .lede b { color: var(--ink); font-weight: 500; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.button { display: inline-block; font-size: 14.5px; font-weight: 500; text-decoration: none; color: var(--ink); background: var(--screen-bg); border: 1px solid var(--rule); border-radius: 999px; padding: 9px 18px; transition: border-color .15s var(--ease), background .15s var(--ease); }
.button:hover { border-color: var(--ledger); color: var(--ledger); }
.button.primary { background: var(--ledger); border-color: var(--ledger); color: var(--paper); }
.button.primary:hover { background: var(--ledger-2); border-color: var(--ledger-2); color: var(--paper); }
.idcard { background: var(--screen-bg); border: 1px solid var(--rule); border-top: 3px solid var(--ledger); border-radius: 6px; padding: 22px; box-shadow: 0 12px 32px -22px rgba(20,30,40,.3); }
.idcard img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; margin-bottom: 16px; }
.idcard dl { margin: 0; display: grid; gap: 12px; }
.idcard dt { font-size: 12px; color: var(--ink-3); }
.idcard dd { margin: 2px 0 0; font-size: 14px; line-height: 1.4; color: var(--ink); }
.stats { margin: 48px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stats > div { padding: 20px 20px 20px 0; }
.stats > div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.stats dt { font-family: var(--font-display); font-size: 32px; line-height: 1.1; color: var(--ledger); font-variant-numeric: tabular-nums; }
.stats dd { margin: 8px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.hero .demo-head { font-size: 30px; margin-top: 64px; }
@media (max-width: 1100px) {
  .hero-top { grid-template-columns: 1fr; gap: 28px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div { padding: 16px 12px 16px 0; }
  .stats > div + div { padding-left: 12px; }
  .stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
.hero .demo { margin-top: 24px; display: grid; grid-template-columns: minmax(240px, clamp(300px, 24vw, 380px)) minmax(0, 1fr); gap: 32px; align-items: start; }
.hero .demo .note { font-size: 15px; color: var(--ink-2); }
.hero .demo .note b { color: var(--ink); font-weight: 500; }
.hero .demo .note p { max-width: none; }
@media (max-width: 1100px) { .hero { padding: 48px 0 40px; } .hero .demo { grid-template-columns: 1fr; } }
.disclaimer { margin-top: 40px; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); max-width: 72ch; padding: 12px 14px; background: var(--paper-2); border-left: 3px solid var(--mark); border-radius: 0 var(--radius) var(--radius) 0; }
.disclaimer p { margin: 0; max-width: none; }

/* ---------- section heads ---------- */
.block h2 { font-size: 34px; max-width: 24ch; }
.block .intro { margin-top: 14px; font-size: 17px; color: var(--ink-2); max-width: 62ch; }

/* ---------- case: a project ---------- */
.case { display: grid; grid-template-columns: minmax(260px, clamp(330px, 26vw, 420px)) minmax(0, 1fr); gap: clamp(28px, 3vw, 48px); margin-top: 48px; align-items: start; }
.case + .case { margin-top: 64px; padding-top: 56px; border-top: 1px dashed var(--rule); }
.case h3 { font-size: 26px; }
.case .kicker { font-size: 14px; color: var(--ink-3); margin-top: 6px; }
.case .body { margin-top: 16px; font-size: 15.5px; color: var(--ink-2); }
.case .body p { max-width: none; }
.case .facts { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 14.5px; }
.case .facts li { padding-left: 14px; position: relative; color: var(--ink-2); }
.case .facts li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; background: var(--ledger); border-radius: 50%; }
.case .stack { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.case .stack span { font-size: 12px; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 2px 9px; }
.case .screen { position: sticky; top: 24px; }
@media (max-width: 1100px) { .case { grid-template-columns: 1fr; gap: 24px; } .case .screen { position: static; } }

/* ---------- the mock screen frame ---------- */
.screen { background: var(--screen-bg); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 12px 32px -20px rgba(20,30,40,.25); min-width: 0; }
.screen .bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-3); background: var(--paper-2); }
.screen .bar .title { color: var(--ink-2); font-weight: 500; }
.screen .bar .synthetic { margin-left: auto; background: var(--mark-2); color: var(--ink); padding: 1px 8px; border-radius: 999px; font-size: 11.5px; white-space: nowrap; }
.screen .pane { padding: 16px; font-size: 13.5px; }
.screen .pane h4 { font-family: var(--font-ui); font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--ink); }
.screen .pane h4 + .verdict-line { margin-top: -4px; }
.verdict-line { font-size: 12.5px; color: var(--ink-2); margin-bottom: 10px; }
.screen .tabwrap { position: relative; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
.screen .tabs { position: relative; display: flex; gap: 2px; padding: 0 10px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
.screen .tabs::-webkit-scrollbar { height: 6px; }
.screen .tabs::-webkit-scrollbar-thumb { background: var(--ink-3); border-radius: 3px; }
.screen .tabnav { position: absolute; top: 0; bottom: 6px; width: 34px; border: 0; cursor: pointer; font-size: 20px; line-height: 1; color: var(--ink); z-index: 2; }
.screen .tabnav.prev { left: 0; background: linear-gradient(90deg, var(--paper-2) 62%, transparent); text-align: left; padding-left: 8px; }
.screen .tabnav.next { right: 0; background: linear-gradient(270deg, var(--paper-2) 62%, transparent); text-align: right; padding-right: 8px; }
.screen .tabnav:hover { color: var(--ledger); }
.screen .tabnav[hidden] { display: none; }
.screen .tabs button { border: 0; background: transparent; padding: 9px 12px; font-size: 13px; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.screen .tabs button[aria-selected="true"] { color: var(--ledger); border-bottom-color: var(--ledger); }
.screen .tabs button:hover { color: var(--ink); }
.screen .toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.screen .toolbar input, .screen .toolbar select { font: inherit; font-size: 12.5px; padding: 4px 8px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--screen-bg); color: var(--ink); }
.screen .empty { padding: 28px 12px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* figures with provenance: click to open the source */
.fig { background: transparent; border: 0; padding: 0 2px; margin: 0 -2px; border-radius: 2px; cursor: pointer; font-variant-numeric: tabular-nums; text-decoration: underline dotted var(--ink-3); text-underline-offset: 3px; font-size: inherit; }
.fig.derived { text-decoration-style: dashed; }
.fig:hover { background: var(--mark-2); text-decoration-color: var(--ink); }
.fig[aria-expanded="true"] { background: var(--mark); color: #1C2230; }

/* tables inside screens */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl th { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.tbl td.r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.total td { font-weight: 600; border-top: 2px solid var(--ink); border-bottom: 0; }
.tbl tr.sub td { color: var(--ink-2); }
.tbl tr.rejected td { color: var(--ink-3); text-decoration: line-through; }
.tbl tbody tr:hover td { background: var(--paper-2); }
.tbl .tick { display: inline-block; font-size: 10.5px; border: 1px solid var(--ink-3); color: var(--ink-2); border-radius: 2px; padding: 0 4px; margin-left: 4px; line-height: 1.4; }

/* chips / pills */
.pill { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: var(--ledger-tint); border-color: transparent; color: var(--ledger); }
.pill.warn { background: var(--amber-tint); border-color: transparent; color: var(--amber); }
.pill.bad { background: var(--walk-tint); border-color: transparent; color: var(--walk); }
.pill.mark { background: var(--mark-2); border-color: transparent; color: var(--ink); }
.pill.info { background: var(--slate-tint); border-color: transparent; color: var(--slate); }

/* kpi strip inside screens */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px 10px; }
.kpi .v { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .l { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

/* buttons inside screens */
.btn { border: 1px solid var(--rule); background: var(--screen-bg); border-radius: var(--radius); padding: 5px 10px; font-size: 12.5px; cursor: pointer; color: var(--ink); }
.btn:hover { background: var(--paper-2); }
.btn.primary { background: var(--ledger); border-color: var(--ledger); color: #fff; }
.btn.primary:hover { background: var(--ledger-2); }
.btn.small { padding: 2px 7px; font-size: 11.5px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn[aria-pressed="true"] { background: var(--ledger-tint); border-color: var(--ledger); color: var(--ledger); }

/* two-column inside a pane */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .cols { grid-template-columns: 1fr; } }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.kanban .col { background: var(--paper-2); border-radius: var(--radius); padding: 8px; min-height: 160px; }
.kanban .col h5 { margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--ink-2); display: flex; justify-content: space-between; }
.card { background: var(--screen-bg); border: 1px solid var(--rule); border-radius: var(--radius); padding: 7px 8px; font-size: 12px; margin-bottom: 6px; }
.card .t { font-weight: 500; color: var(--ink); }
.card .m { color: var(--ink-3); font-size: 11.5px; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.card .acts { display: flex; gap: 4px; margin-top: 6px; }

/* ladder (opening / stretch / walk) */
.ladder { display: grid; gap: 8px; }
.ladder .rung { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; padding: 8px 12px; border-left: 3px solid var(--rule); background: var(--paper-2); border-radius: 0 var(--radius) var(--radius) 0; }
.ladder .rung.open { border-left-color: var(--ledger); }
.ladder .rung.stretch { border-left-color: var(--amber); }
.ladder .rung.walk { border-left-color: var(--walk); }
.ladder .rung b { font-weight: 500; }
.ladder .rung .why { font-size: 12.5px; color: var(--ink-2); }
.ladder .rung .px { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* source drawer: the evidence page that a figure opens */
.drawer { position: fixed; inset: 0; background: rgba(20,24,30,.45); display: none; z-index: 50; }
.drawer[open] { display: block; }
.drawer .sheet { position: absolute; right: 0; top: 0; bottom: 0; width: min(580px, 100%); background: var(--paper); border-left: 1px solid var(--rule); display: flex; flex-direction: column; box-shadow: -20px 0 50px -30px rgba(0,0,0,.5); }
.drawer .head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.drawer .head b { font-weight: 500; }
.drawer .head small { color: var(--ink-3); display: block; }
.drawer .head button { margin-left: auto; }
.drawer .doc { flex: 1; overflow: auto; padding: 22px; }
.drawer .tabs2 { display: flex; gap: 2px; padding: 0 18px; border-bottom: 1px solid var(--rule); }
.drawer .tabs2 button { border: 0; background: transparent; padding: 9px 12px; font-size: 13px; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; }
.drawer .tabs2 button[aria-selected="true"] { color: var(--ledger); border-bottom-color: var(--ledger); }
.page { background: #fff; color: #1C2230; border: 1px solid #cfd3cb; padding: 28px 32px; font-family: "Courier New", monospace; font-size: 12.5px; line-height: 1.5; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.page .hd { display: flex; justify-content: space-between; border-bottom: 1px solid #999; padding-bottom: 6px; margin-bottom: 14px; font-size: 11px; color: #555; }
.page .line { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.page .line.dim { color: #777; }
.page .line.head { font-weight: bold; margin-top: 8px; }
.page mark { background: var(--mark); padding: 0 3px; border-radius: 2px; box-shadow: 0 0 0 3px var(--mark); color: #1C2230; }
.page.ocr { background: repeating-linear-gradient(0deg, #fff 0 22px, #fbfbf9 22px 23px); filter: contrast(.97); }
.page.ocr .hd::after { content: "scanned page, OCR"; }
.drawer .why { padding: 14px 18px; border-top: 1px solid var(--rule); font-size: 13.5px; color: var(--ink-2); }
.drawer .why b { color: var(--ink); font-weight: 500; }
.drawer .why .inputs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.formula { font-family: "IBM Plex Mono", Consolas, monospace; font-size: 12.5px; background: var(--paper-2); padding: 8px 10px; border-radius: var(--radius); margin: 10px 0; }

/* resume */
.resume-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 36px; align-items: start; }
@media (max-width: 1100px) { .resume-grid { grid-template-columns: 1fr; } }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--rule); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline .when { font-size: 13px; color: var(--ink-3); padding-top: 3px; }
.timeline .what b { font-weight: 500; display: block; }
.timeline .what span { color: var(--ink-2); font-size: 14px; }
.timeline .what p { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); max-width: none; }
.pdf-frame { border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: var(--paper-2); }
.pdf-frame iframe { width: 100%; height: 780px; border: 0; display: block; background: #fff; }
.pdf-frame .foot { display: flex; gap: 14px; padding: 10px 14px; font-size: 13px; border-top: 1px solid var(--rule); }
.skills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.skills span { font-size: 13px; border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; color: var(--ink-2); }
.resume h3 { font-size: 20px; margin: 28px 0 10px; }
.resume h3:first-child { margin-top: 0; }

/* method */
.method { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 36px; }
.method h4 { font-size: 20px; }
.method p { font-size: 14.5px; color: var(--ink-2); margin-top: 8px; max-width: none; }
@media (max-width: 1100px) { .method { grid-template-columns: 1fr; } }

/* image gallery (design renders) */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery figure { margin: 0; position: relative; aspect-ratio: 4/3; overflow: hidden; border-radius: var(--radius); background: var(--paper-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 9px; font-size: 11.5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.gallery .wide { grid-column: span 2; }
@media (max-width: 700px) { .gallery { grid-template-columns: 1fr 1fr; } }
.compare { position: relative; aspect-ratio: 16/10; overflow: hidden; border-radius: var(--radius); background: var(--paper-2); user-select: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .after { clip-path: inset(0 0 0 var(--cut, 50%)); }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--cut, 50%); width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); pointer-events: none; }
.compare .lbl { position: absolute; top: 8px; font-size: 11.5px; background: rgba(0,0,0,.55); color: #fff; padding: 2px 8px; border-radius: 999px; pointer-events: none; }
.compare .lbl.a { left: 8px; } .compare .lbl.b { right: 8px; }
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.stages figure { margin: 0; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); position: relative; background: var(--paper-2); }
.stages img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stages figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 7px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
@media (max-width: 700px) { .stages { grid-template-columns: repeat(3, 1fr); } }

/* charts */
svg.chart { width: 100%; height: auto; display: block; font-family: var(--font-ui); }
svg.chart text { fill: var(--ink-3); font-size: 11px; }
svg.chart .axis { stroke: var(--rule); }
svg.chart .grid { stroke: var(--rule); stroke-dasharray: 2 3; }
svg.chart .pt { cursor: pointer; }
svg.chart .pt:hover { stroke-width: 3; }
.chart-cap { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* footer */
footer.site { padding: 40px 0 60px; border-top: 1px solid var(--rule); font-size: 13.5px; color: var(--ink-3); }
footer.site p { max-width: none; }

/* map (land plays) */
.map { position: relative; background: var(--paper-2); border-radius: var(--radius); overflow: hidden; }
.map svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* chat (knowledge Q&A) */
.chat { display: grid; gap: 10px; }
.chat .q, .chat .a { padding: 8px 12px; border-radius: 10px; font-size: 13px; max-width: 86%; }
.chat .q { background: var(--ledger-tint); color: var(--ink); justify-self: end; }
.chat .a { background: var(--paper-2); }
.chat .a .cite { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

/* toasts */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 999px; font-size: 13px; opacity: 0; transition: opacity .2s var(--ease); pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; }

/* checklists / progress */
.bar-h { height: 6px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.bar-h i { display: block; height: 100%; background: var(--ledger); }

/* targets.js, land.js: the selected row in a clickable table */
.tbl tbody tr.sel td { background: var(--ledger-tint); }

/* qoe.js: the document cards on the overview and the accept / reject buttons */
.docs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.docs .card { margin: 0; }
.docs .docfig { font-size: 15px; font-weight: 500; margin-top: 8px; }
@media (max-width: 700px) { .docs { grid-template-columns: 1fr 1fr; } }
.decide { display: flex; gap: 4px; white-space: nowrap; }
.btn.reject[aria-pressed="true"] { background: var(--walk-tint); border-color: var(--walk); color: var(--walk); }
.struck { text-decoration: line-through; color: var(--ink-3); }

/* orirm.js: the sample document and plain lists on the data model tab */
pre.json { margin: 0; padding: 12px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; line-height: 1.5; overflow-x: auto; color: var(--ink); }
.screen code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; }
ul.plain { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }

/* joon.js: the 3D stage, package cards, plan drawing and step list */
.stage3d { position: relative; aspect-ratio: 16/11; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: #f2f1eb; cursor: grab; touch-action: pan-y; }
.stage3d:active { cursor: grabbing; }
.stage3d canvas { display: block; width: 100%; height: 100%; }
.pkg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pkg .card { margin: 0; }
.pkg .card .m { display: block; line-height: 1.45; margin-top: 4px; }
@media (max-width: 700px) { .pkg { grid-template-columns: 1fr 1fr; } }
svg.plan { width: 100%; height: auto; display: block; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); font-family: var(--font-ui); }
svg.plan .wall { fill: #1c2230; } svg.plan .floor { fill: #fff; } svg.plan .win { fill: #a6bac0; stroke: #1c2230; stroke-width: 1; }
svg.plan .fx { fill: #f3f1ea; stroke: #1c2230; stroke-width: 1.2; }
svg.plan text { font-size: 10px; fill: #1c2230; } svg.plan .dim { stroke: #1e5a45; stroke-width: 1; } svg.plan .dimt { fill: #1e5a45; font-size: 10.5px; }
ol.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 6px; }
ol.steps li { counter-increment: step; display: grid; grid-template-columns: 26px 1fr; column-gap: 8px; font-size: 13px; }
ol.steps li::before { content: counter(step); grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; background: var(--ledger-tint); color: var(--ledger); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
ol.steps li b { font-weight: 600; } ol.steps li span { color: var(--ink-2); }
.formula > div + div { margin-top: 4px; }

/* page: five-up stats, sub-heads inside a case, earlier roles, web design shots */
.stats.five { grid-template-columns: repeat(5, 1fr); }
.stats.five dt { font-size: 28px; }
@media (max-width: 1100px) { .stats.five { grid-template-columns: 1fr 1fr; } .stats.five > div:nth-child(5) { padding-left: 0; border-left: 0; grid-column: span 2; } }
.case h4.sub { font-family: var(--font-ui); font-size: 14px; font-weight: 600; margin-top: 26px; color: var(--ink); }
.case h4.sub + .body { margin-top: 8px; }
.case .facts li b { color: var(--ink); font-weight: 600; }
.case .visit { margin: 20px 0 0; }
details.more { margin-top: 4px; }
details.more summary { cursor: pointer; font-size: 14px; color: var(--ledger); padding: 6px 0; }
details.more[open] summary { margin-bottom: 8px; }
.webshots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: sticky; top: 24px; }
.webshots figure { margin: 0; position: relative; aspect-ratio: 4/3; overflow: hidden; border-radius: 6px; border: 1px solid var(--rule); background: var(--paper-2); }
.webshots figure.wide { grid-column: span 2; aspect-ratio: 16/9; }
.webshots img { width: 100%; height: 100%; object-fit: cover; display: block; }
.webshots figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
@media (max-width: 1100px) { .webshots { position: static; } }

/* web design: landing-page showcase */
.webmeta { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; margin-top: 28px; align-items: start; }
.webmeta .facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 14.5px; }
.webmeta .facts li { padding-left: 14px; position: relative; color: var(--ink-2); }
.webmeta .facts li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; background: var(--ledger); border-radius: 50%; }
.webmeta .stack { display: flex; flex-wrap: wrap; gap: 6px; }
.webmeta .stack span { font-size: 12px; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 2px 9px; }
.webmeta .visit { margin: 16px 0 0; }
.showcase { display: grid; gap: 28px; margin-top: 40px; }
.shot { background: var(--screen-bg); border: 1px solid var(--rule); border-radius: 8px; padding: 26px 26px 24px; box-shadow: 0 12px 32px -24px rgba(20,30,40,.3); }
.shot header { margin-bottom: 18px; }
.shot .eyebrow { display: block; font-size: 12.5px; font-weight: 600; color: var(--ledger); margin-bottom: 6px; }
.shot h3 { font-size: 26px; }
.shot header p { margin: 8px 0 0; font-size: 15px; color: var(--ink-2); max-width: 68ch; }
.shot .row { display: flex; gap: 12px; align-items: stretch; }
.shot .row figure { flex: var(--r) 1 0; min-width: 0; margin: 0; position: relative; border-radius: 6px; overflow: hidden; background: #f4f2ec; border: 1px solid var(--rule); aspect-ratio: var(--r); }
.shot .row img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .row figure.contain img { object-fit: contain; }
.shot .tag { position: absolute; top: 10px; left: 10px; font-size: 12px; font-weight: 600; background: rgba(28,34,48,.86); color: #fff; padding: 3px 10px; border-radius: 999px; }
.shot .row figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 9px; font-size: 12.5px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.palette { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 16px 0 0; padding: 0; list-style: none; }
.palette li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink); }
.palette i { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(0,0,0,.14); flex: none; }
.palette small { display: block; font-size: 11px; color: var(--ink-3); font-family: "IBM Plex Mono", ui-monospace, monospace; }
.palettes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
.palettes .plabel { display: block; font-size: 12px; color: var(--ink-3); margin-top: 16px; }
.palettes .palette { margin-top: 8px; }

/* the roof measurement, drawn on a 12 second loop */
.roofgrid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 24px; align-items: start; }
.aerial { margin: 0; position: relative; border-radius: 6px; overflow: hidden; border: 1px solid var(--rule); aspect-ratio: 1560 / 800; background: #2a2f2a; }
.aerial img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aerial svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.aerial .credit { position: absolute; right: 8px; bottom: 6px; font-size: 10.5px; color: rgba(255,255,255,.85); text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.trace { fill: rgba(255,190,0,.22); stroke: #ffbe00; stroke-width: 3.5px; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; }
.trace.garage { fill: rgba(255,255,255,.26); stroke: #fff; }
.trace.house { animation: roofHouse 12s linear infinite; }
.trace.garage { animation: roofGarage 12s linear infinite; }
.lbl rect { fill: rgba(20,24,30,.82); } .lbl text { fill: #fff; font: 600 30px var(--font-ui); }
.lbl.house, .measure .r1 { animation: roofShow1 12s linear infinite; }
.lbl.garage, .measure .r2 { animation: roofShow2 12s linear infinite; }
.measure .r3 { animation: roofShow3 12s linear infinite; }
@keyframes roofHouse { 0%, 4% { stroke-dashoffset: 1; fill-opacity: 0; opacity: 1; } 24% { stroke-dashoffset: 0; fill-opacity: 0; } 29%, 94% { stroke-dashoffset: 0; fill-opacity: 1; opacity: 1; } 100% { stroke-dashoffset: 0; fill-opacity: 1; opacity: 0; } }
@keyframes roofGarage { 0%, 32% { stroke-dashoffset: 1; fill-opacity: 0; opacity: 1; } 48% { stroke-dashoffset: 0; fill-opacity: 0; } 53%, 94% { stroke-dashoffset: 0; fill-opacity: 1; opacity: 1; } 100% { stroke-dashoffset: 0; fill-opacity: 1; opacity: 0; } }
@keyframes roofShow1 { 0%, 26% { opacity: 0; } 30%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes roofShow2 { 0%, 50% { opacity: 0; } 54%, 94% { opacity: 1; } 100% { opacity: 0; } }
@keyframes roofShow3 { 0%, 58% { opacity: 0; } 63%, 94% { opacity: 1; } 100% { opacity: 0; } }
.measure table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.measure th, .measure td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--rule); font-weight: 400; }
.measure thead th { font-size: 12px; color: var(--ink-3); }
.measure td, .measure thead th + th { text-align: right; font-variant-numeric: tabular-nums; }
.measure tbody th { color: var(--ink); } .measure td { font-weight: 500; }
.measure .r3 th, .measure .r3 td { font-weight: 600; border-bottom: 0; border-top: 2px solid var(--ink); font-size: 16px; }
.measure .key { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 8px; border: 2px solid #ffbe00; background: rgba(255,190,0,.3); vertical-align: -1px; }
.measure .key.garage { border-color: var(--ink-3); background: transparent; }
.measure .steps { margin-top: 18px; }
@media (max-width: 1100px) {
  .webmeta, .roofgrid, .palettes { grid-template-columns: 1fr; gap: 18px; }
  .shot { padding: 18px 16px; } .shot h3 { font-size: 22px; }
  .shot .row { flex-direction: column; } .shot .row figure { flex: none; width: 100%; }
}

/* web design, second pass: page frames beside the project pictures */
.pageframe { border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: #f6f1e7; box-shadow: 0 16px 36px -26px rgba(20,30,40,.45); }
.pageframe .chrome { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--paper-2); border-bottom: 1px solid var(--rule); font-size: 12px; color: var(--ink-3); }
.pageframe .chrome i { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); }
.pageframe .chrome span { margin-left: 8px; background: var(--screen-bg); border: 1px solid var(--rule); border-radius: 999px; padding: 2px 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pageframe .chrome a { margin-left: auto; white-space: nowrap; font-size: 12px; }
.pageframe .viewport { height: var(--vh, 560px); overflow-y: auto; scrollbar-width: thin; }
.pageframe .viewport img { display: block; width: 100%; height: auto; }
.splitgrid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr); gap: 24px; align-items: start; }
.roofcol { display: grid; gap: 16px; }
.pics { display: grid; gap: 12px; align-items: start; }
.pics.two { grid-template-columns: 1fr 1fr; }
.pics.three { grid-template-columns: 0.75fr 0.75fr 1.277fr; }
.pics figure { margin: 0; }
.pics figure > img, .pics figure > svg { display: block; width: 100%; height: auto; aspect-ratio: var(--r); object-fit: cover; border-radius: 6px; border: 1px solid var(--rule); background: #fff; }
.pics figcaption { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.asked { grid-column: 1 / -1; background: var(--paper-2); border-radius: 6px; padding: 14px 18px; }
.asked .plabel { display: block; font-size: 12px; color: var(--ink-3); }
.asked ul { margin: 6px 0 0; padding: 0; list-style: none; columns: 2; column-gap: 28px; font-family: "Caveat", "Segoe Print", cursive; font-size: 21px; line-height: 1.35; color: #1d4ed8; }
.asked li { break-inside: avoid; padding-left: 16px; position: relative; }
.asked li::before { content: "-"; position: absolute; left: 0; }
.markup svg .lab { font: 600 12px var(--font-ui); fill: #4b5260; letter-spacing: .04em; }
.markup svg .print { font: 12px var(--font-ui); fill: #9aa09a; }
.markup svg .yard { fill: none; stroke: #b9bdb4; stroke-width: 1.5; stroke-dasharray: 6 5; }
.markup svg .patio { fill: #f6f5f0; stroke: #b9bdb4; stroke-width: 1.5; }
.markup svg .box { fill: #fff; stroke: #c9ccc4; stroke-width: 1.2; }
.markup svg .pen { fill: none; stroke: #1d4ed8; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.markup svg .pen.thin { stroke-width: 2; }
.markup svg .hand { font: 600 30px "Caveat", "Segoe Print", cursive; fill: #1d4ed8; }
.markup svg .hand.big { font-size: 46px; } .markup svg .hand.small { font-size: 22px; }
.pitch { display: grid; grid-template-columns: 210px 1fr; gap: 16px; align-items: center; background: var(--paper-2); border-radius: 6px; padding: 12px 16px; }
.pitch svg { width: 100%; height: auto; }
.pitch svg .tri { fill: var(--ledger-tint); stroke: var(--ledger); stroke-width: 2; stroke-linejoin: round; }
.pitch svg .sq { fill: none; stroke: var(--ledger); stroke-width: 1.5; }
.pitch svg text { font: 11.5px var(--font-ui); fill: var(--ink-2); } .pitch svg .hyp { fill: var(--ledger); font-weight: 600; }
.pitch p { margin: 0; font-size: 13.5px; color: var(--ink-2); max-width: none; } .pitch p b { color: var(--ink); font-weight: 600; }
.measure table { font-size: 13.5px; }
.measure td, .measure thead th + th { text-align: right; white-space: nowrap; padding-left: 10px; }
.measure .chart-cap { margin: 8px 0 0; max-width: none; }
.lbl text { font-size: 34px; }
@media (max-width: 1100px) {
  .splitgrid { grid-template-columns: 1fr; }
  .pageframe .viewport { height: min(var(--vh, 560px), 440px); }
  .pics.three { grid-template-columns: 1fr 1fr; } .pics.three figure:last-child { grid-column: 1 / -1; }
  .pitch { grid-template-columns: 1fr; } .pitch svg { max-width: 240px; }
  .asked ul { columns: 1; }
  .measure table { font-size: 12.5px; }
}
@media (max-width: 520px) { .pics.two { grid-template-columns: 1fr; } }

/* web design as a tabbed screen, like the other projects */
.webscreen { margin-top: 32px; }
.webscreen .pane { padding: 22px; }
.webscreen .shot { border: 0; padding: 0; box-shadow: none; background: transparent; }
.webscreen .shot h3 { font-size: 22px; }
.webscreen .pageframe .viewport { scrollbar-width: auto; }
.webstore { display: none; }
.slope { width: 100%; border-collapse: collapse; font-size: 13px; }
.slope th, .slope td { text-align: left; padding: 6px 0; border-bottom: 1px solid var(--rule); font-weight: 400; }
.slope thead th { font-size: 12px; color: var(--ink-3); }
.slope td + td, .slope th + th { padding-left: 12px; }
.slope td:last-child, .slope th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.slope tr.on td { font-weight: 600; color: var(--ledger); background: var(--ledger-tint); }
.slope tr.on td:first-child { box-shadow: inset 3px 0 0 var(--ledger); padding-left: 8px; }
.pitch { grid-template-columns: 190px 1fr; align-items: start; }
@media (max-width: 1100px) { .webscreen .pane { padding: 14px; } }

/* joon.js: finished designs */
.fincols { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fingrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
figure.fin { margin: 0; } figure.fin.wide { grid-column: 1 / -1; }
figure.fin img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--rule); background: #fff; }
figure.fin figcaption { font-size: 12px; color: var(--ink-2); margin-top: 5px; }
@media (max-width: 700px) { .fincols { grid-template-columns: 1fr; } }

/* condensed page frames on the landing-page tabs: just the top of the page */
.pageframe.mini img { display: block; width: 100%; height: auto; }
.webscreen .splitgrid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
@media (max-width: 1100px) { .webscreen .splitgrid { grid-template-columns: 1fr; } }

/* every web design tab is one full-width page frame; the roofing tab adds its measurement below */
.roofbelow { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--rule); }
.roofbelow h4 { font-family: var(--font-display); font-size: 20px; font-weight: 500; margin: 0 0 14px; }
.roofrow { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
figure.fin.markup svg { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--rule); background: #fff; }
@media (max-width: 1100px) { .roofrow { grid-template-columns: 1fr; } }
.roofrow .roofcol { display: contents; }
.roofrow .measure { grid-column: 2; grid-row: 1; }
.roofrow .pitch { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 200px minmax(0, 1fr); align-items: center; }
.slope th, .slope td { white-space: nowrap; }
@media (max-width: 1100px) { .roofrow .measure { grid-column: 1; grid-row: auto; } .roofrow .pitch { grid-row: auto; grid-template-columns: 1fr; } .slope th, .slope td { white-space: normal; } }

/* a working piece of a page laid over its capture: the 3D kitchen on the design page */
.pagewrap { position: relative; overflow: hidden; }
.pagewrap .livepart { position: absolute; border: 0; transform-origin: 0 0; transform: scale(var(--k, 0.7)); border-radius: 14px; background: #f2f1eb; }
.shot header .btn { font-size: 13px; padding: 6px 12px; }

/* wide screens: the page uses the window; charts and page frames stop growing before they get soft or oversized */
.hero h1 { max-width: 22ch; }
.hero .lede { max-width: 64ch; }
.screen svg.chart { max-width: 880px; }
.pageframe { max-width: 1280px; margin-inline: auto; }
.pageframe .viewport { height: clamp(380px, 66vh, 860px); }
.block .intro { max-width: 72ch; }

/* targets.js: pages and the sources picker */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.srclist { display: grid; gap: 4px; margin-bottom: 12px; }
.srcrow { display: grid; grid-template-columns: minmax(120px, 190px) 1fr 56px; gap: 10px; align-items: center; text-align: left; border: 1px solid transparent; background: transparent; border-radius: var(--radius); padding: 7px 8px; cursor: pointer; font-size: 13px; color: var(--ink); }
.srcrow:hover { background: var(--paper-2); }
.srcrow[aria-pressed="true"] { background: var(--ledger-tint); border-color: var(--ledger); }
.srcrow .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.srcrow .bar-h { height: 8px; }
.srcnote { border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; }
.srcnote p { margin: 2px 0 10px; font-size: 13px; color: var(--ink); max-width: none; }
.srcnote p:last-child { margin-bottom: 0; }

/* joon.js: photo beside model, and the design package tab */
.pairgrid { display: grid; grid-template-columns: 0.75fr 1fr; gap: 12px; align-items: start; }
.pairgrid.adu { grid-template-columns: 0.75fr 1.333fr; }
.pairgrid figure.fin img { aspect-ratio: auto; }
iframe.model3d { display: block; width: 100%; aspect-ratio: 1 / 1; border: 1px solid var(--rule); border-radius: var(--radius); background: #f2f1eb; }
.pkgviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: start; }
.pkgsheets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; align-items: start; }
.pkgsheets a { display: block; }
@media (max-width: 700px) { .pairgrid, .pairgrid.adu { grid-template-columns: 1fr; } .pkgviews { grid-template-columns: 1fr 1fr; } }

/* ---- balance: text and screen side by side without empty space ---- */
/* a narrower sidebar on mid-size windows, so it stays a sidebar instead of turning into a top bar */
@media (min-width: 721px) and (max-width: 1100px) {
  :root { --rail-w: 190px; }
  .rail { padding: 22px 14px; gap: 18px; }
  .rail .who { font-size: 19px; }
  .rail nav a { font-size: 13.5px; }
  .rail .foot { font-size: 11.5px; }
}
/* the screen never runs longer than the window: its body scrolls, with a scrollbar you can see.
   main.js also trims it to the height of the text beside it when that text is shorter. */
.screen .pane { scrollbar-width: thin; scrollbar-color: var(--ink-3) var(--paper-2); }
@media (min-width: 1101px) {
  .case .screen .pane, .hero .demo .screen .pane { max-height: clamp(400px, calc(100vh - 150px), 860px); overflow-y: auto; scrollbar-gutter: stable; }
}
/* the intro demo: its explanation sits above the workbench in three short columns, and the workbench takes the full width */
.hero .demo { grid-template-columns: 1fr; gap: 18px; }
.hero .demo .note { columns: 3; column-gap: 36px; max-width: none; }
.hero .demo .note p { break-inside: avoid; margin: 0 0 12px; }
@media (max-width: 1100px) { .hero .demo .note { columns: 2; } }
@media (max-width: 720px) { .hero .demo .note { columns: 1; } }
/* a chart with its note beside it, when the screen is wide enough */
.screen .pane { container-type: inline-size; }
.figrow { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: center; }
.figrow .chart-cap { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
@container (max-width: 600px) { .figrow { grid-template-columns: 1fr; gap: 6px; } }

/* phones: the section links stay on one line that scrolls sideways, with a scrollbar you can see */
@media (max-width: 520px) {
  .rail nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; padding-bottom: 4px; }
  .rail nav a { flex: none; }
  section.block, .hero { scroll-margin-top: 96px; }
}
