/* Fonts are self-hosted (SIL Open Font License, see assets/fonts): no third-party requests. */
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/overpass-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/overpass-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/overpass-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/overpass-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/overpass-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/overpass-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Overpass Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/overpass-mono-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Overpass Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/overpass-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Overpass Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/overpass-mono-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Overpass Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/overpass-mono-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* portfolio.dwiahmad.com v2
   Concept: the camera reads the page. Detection boxes are the only ornament and
   always mean "this is being looked at". Visitor mode is the product in daylight;
   Data scientist mode flips to the circuit board behind it (solder-mask green,
   silkscreen white, gold pads, copper traces) and exposes the machinery.
   Nothing moves position. */

:root {
  --ground: #F3F6F6;
  --surface: #FFFFFF;
  --ink: #10263B;
  --ink-2: #4B5E6F;
  --rule: #D5DEE3;
  --rule-2: #B9C7D0;
  --signal: #FFC21A;
  --signal-ink: #10263B;
  --box: #10263B;
  --data: #0A78AC;
  --data-soft: #E2EEF4;
  --focus: #0A78AC;
  --danger: #A2361B;
  --sans: "Overpass", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Overpass Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shell: 1320px;
  --chat-w: 400px;
  color-scheme: light;
}

html[data-mode="ds"] {
  /* the board behind the product: solder mask, silkscreen, ENIG gold, copper */
  --ground: #0F3B28;
  --surface: #134731;
  --ink: #F1F4EC;
  --ink-2: #A8C4B2;
  --rule: #23603F;
  --rule-2: #2F7550;
  --signal: #E8B941;
  --signal-ink: #0F3B28;
  --box: #E8B941;
  --data: #D9824F;
  --data-soft: #1D5A3D;
  --focus: #E8B941;
  --danger: #FF9A7A;
  color-scheme: dark;
}
html[data-mode="ds"] body {
  background-image: radial-gradient(circle at 2px 2px, rgba(241, 244, 236, 0.06) 1.2px, transparent 1.8px);
  background-size: 24px 24px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  font-feature-settings: "kern", "liga";
  transition: background-color .45s ease, color .45s ease;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--ground); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
.ds-only { display: none; }
html[data-mode="ds"] .ds-only { display: revert; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 28px;
  height: 64px; padding: 0 32px;
  background: var(--ground);
  border-bottom: 1px solid var(--rule);
  transition: background-color .45s ease, border-color .45s ease;
}
.brand { font-weight: 700; font-size: 17px; text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--ink); text-decoration: underline; }

.mode-switch {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 4px; border: 0; background: none; cursor: pointer;
  font-size: 15px; white-space: nowrap;
}
.ms-label { color: var(--ink-2); transition: color .3s; }
.mode-switch[aria-checked="false"] .ms-visitor,
.mode-switch[aria-checked="true"] .ms-ds { color: var(--ink); font-weight: 700; }
.ms-track {
  position: relative; width: 44px; height: 24px; border-radius: 12px;
  background: var(--rule-2); transition: background-color .3s;
}
.ms-knob {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); transition: transform .3s cubic-bezier(.3,.7,.2,1);
}
.mode-switch[aria-checked="true"] .ms-track { background: var(--signal); }
.mode-switch[aria-checked="true"] .ms-knob { transform: translateX(20px); background: var(--signal-ink); }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--chat-w);
  gap: 48px;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 32px;
  align-items: start;
}
.content { min-width: 0; padding-bottom: 64px; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 56px; border-bottom: 1px solid var(--rule); }
.who { margin: 0 0 28px; font-size: 17px; color: var(--ink-2); }
.who strong { color: var(--ink); font-weight: 700; }
.headline {
  margin: 0 0 28px;
  max-width: 19ch;
  font: 700 clamp(38px, 4.9vw, 64px)/1.3 var(--sans);
  letter-spacing: -0.022em;
}
.det { position: relative; white-space: nowrap; cursor: pointer; text-decoration: none; }
.det::before {
  content: ""; position: absolute; inset: 0.02em -0.14em -0.02em;
  border: 2px solid var(--box); border-radius: 2px;
  opacity: 0; transform: scale(1.07); transition: opacity .16s ease, transform .2s ease;
  pointer-events: none;
}
.det .tag {
  position: absolute; left: calc(-0.14em); bottom: calc(100% - 0.04em);
  font: 600 12px/1 var(--mono); letter-spacing: 0;
  padding: 4px 6px 3px; background: var(--signal); color: var(--signal-ink);
  white-space: nowrap; opacity: 0; transition: opacity .16s ease;
  pointer-events: none;
}
.det.on::before { opacity: 1; transform: none; }
.det.on .tag { opacity: 1; }
.lede { margin: 0 0 14px; max-width: 46ch; font-size: 21px; line-height: 1.5; color: var(--ink-2); }
.facts { margin: 0 0 32px; max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px 9px; border-radius: 8px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--ground); font-weight: 700; font-size: 16px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: transparent; color: var(--ink); }
.text-link { font-weight: 700; }

/* ---------- section heads ---------- */
.section { padding: 56px 0 8px; }
.section h2 { margin: 0 0 6px; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }
.section-sub { margin: 0 0 32px; color: var(--ink-2); max-width: 60ch; }

/* ---------- lab (data scientist mode) ---------- */
.lab-wrap { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .5s ease, opacity .4s ease; }
.lab-wrap > .lab { overflow: hidden; min-height: 0; }
html[data-mode="ds"] .lab-wrap { grid-template-rows: 1fr; opacity: 1; }
.lab { padding: 0; }
.lab-inner { padding: 48px 0 40px; border-bottom: 1px solid var(--rule); }
.lab-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lab-updated { font: 400 13px/1.4 var(--mono); color: var(--ink-2); }
.readouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin: 8px 0 36px; }
.readout { padding: 16px 0 14px; border-top: 1px solid var(--rule); }
.readout .v { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.readout .k { font-size: 15px; color: var(--ink); margin-top: 4px; }
.readout .how { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.lab-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; margin-bottom: 36px; }
.lab h3 { margin: 0 0 12px; font-size: 17px; }
.spark { position: relative; }
.spark svg { display: block; width: 100%; height: 120px; overflow: visible; }
.spark .tip {
  position: absolute; top: -8px; transform: translate(-50%, -100%);
  background: var(--ink); color: var(--ground); font: 400 12px/1.3 var(--mono);
  padding: 4px 7px; border-radius: 4px; white-space: nowrap; pointer-events: none; opacity: 0;
}
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) 2.5em; align-items: center; gap: 10px; font-size: 15px; }
.bars .bar { height: 8px; background: var(--data-soft); border-radius: 0 4px 4px 0; overflow: hidden; }
.bars .bar span { display: block; height: 100%; background: var(--data); border-radius: 0 4px 4px 0; }
.bars .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.evaltable { width: 100%; border-collapse: collapse; font-size: 15px; margin-bottom: 8px; }
.evaltable th, .evaltable td { text-align: left; padding: 8px 12px 6px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.evaltable th { font-weight: 700; }
.evaltable td.num, .evaltable th.num { text-align: right; padding-right: 0; padding-left: 12px; }
.lab-note { font-size: 14px; color: var(--ink-2); max-width: 64ch; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.topics li { border: 1px solid var(--rule-2); border-radius: 4px; padding: 4px 9px 3px; font-size: 14px; }
.topics li b { font-variant-numeric: tabular-nums; }
.pipeline { margin: 28px 0 0; font: 400 13px/1.7 var(--mono); color: var(--ink-2); }
.pipeline span { color: var(--ink); }

/* ---------- work: a contact sheet of frames ---------- */
.sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 32px; }
.shot { margin: 0; position: relative; }
.frame {
  position: relative; aspect-ratio: 16 / 10;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 4px;
  transition: background-color .45s ease, border-color .45s ease;
}
.frame canvas, .frame img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 3px; display: block; object-fit: cover; }
.frame .box {
  position: absolute; inset: -7px; border: 2px solid var(--box); border-radius: 3px;
  opacity: 0; transform: scale(1.03); transition: opacity .15s ease, transform .2s ease; pointer-events: none;
}
.frame .box .tag {
  position: absolute; left: -2px; bottom: 100%;
  font: 600 12px/1 var(--mono); padding: 4px 6px 3px;
  background: var(--signal); color: var(--signal-ink); white-space: nowrap;
}
.shot:hover .box, .shot:focus-within .box, .shot.lock .box { opacity: 1; transform: none; }
.shot figcaption { padding-top: 16px; }
.shot h3 { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; }
.shot .one { margin: 4px 0 2px; }
.shot .kind { margin: 0 0 12px; font-size: 15px; color: var(--ink-2); }
.shot .acts { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
.ask-btn {
  padding: 0; border: 0; background: none; cursor: pointer; font-weight: 700; font-size: 16px;
  text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px;
}
.ask-btn:hover { text-decoration-thickness: 2px; }
.shot .ext { font-size: 16px; color: var(--ink-2); }
.chunkmeta { margin: 10px 0 0; font: 400 13px/1.5 var(--mono); color: var(--ink-2); }
.shot.is-self .frame { border-color: var(--box); border-style: dashed; }

/* ---------- also built, stack, contact ---------- */
.archive { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 40px; }
.archive li { break-inside: avoid; padding: 0 0 18px; }
.archive b { display: block; }
.archive span { color: var(--ink-2); font-size: 16px; }
.archive a { font-size: 15px; }
.stack { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 28px; margin: 0; }
.stack dt { font-weight: 700; }
.stack dd { margin: 0; color: var(--ink-2); }
.contact-big { font-size: clamp(24px, 3vw, 34px); font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px; word-break: break-word; }
.contact-row { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
.colophon { margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-2); }
.colophon p { margin: 0 0 6px; max-width: 70ch; }

/* ---------- chat ---------- */
.chat {
  position: sticky; top: 84px; height: calc(100vh - 104px); height: calc(100dvh - 104px);
  display: flex; flex-direction: column; margin-top: 24px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
  transition: background-color .45s ease, border-color .45s ease;
}
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid var(--rule); }
.chat-head h2 { margin: 0; font-size: 17px; }
.grab { display: none; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--rule-2); display: inline-block; }
.status[data-state="live"] i { background: #1F9D61; }
.status[data-state="demo"] i { background: var(--signal); }
.chat-model { padding: 8px 16px; border-bottom: 1px solid var(--rule); font: 400 12px/1.5 var(--mono); color: var(--ink-2); }
.log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; overscroll-behavior: contain; }
.msg { max-width: 92%; }
.msg.me { align-self: flex-end; }
.bubble { padding: 10px 13px 8px; border-radius: 12px 12px 12px 4px; background: var(--ground); border: 1px solid var(--rule); font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.me .bubble { background: var(--ink); color: var(--ground); border-color: var(--ink); border-radius: 12px 12px 4px 12px; }
.bubble.streaming::after { content: ""; display: inline-block; width: .5em; height: 1em; margin-left: 2px; vertical-align: -0.12em; background: currentColor; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.srcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.src { font-size: 13px; padding: 2px 8px 1px; border-radius: 4px; background: var(--data-soft); text-decoration: none; }
.src:hover { text-decoration: underline; }
.msg-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.linkish { padding: 0; border: 0; background: none; cursor: pointer; color: var(--ink-2); text-decoration: underline; text-underline-offset: .18em; font-size: 13px; }
.linkish:hover { color: var(--ink); }
.thumb { padding: 3px; border: 0; background: none; cursor: pointer; color: var(--ink-2); line-height: 0; border-radius: 4px; }
.thumb svg { width: 16px; height: 16px; }
.thumb[aria-pressed="true"] { color: var(--ink); background: var(--data-soft); }
.hello-btn { padding: 5px 10px 3px; border-radius: 6px; border: 1px solid var(--ink); background: none; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink); }
.hello-btn[disabled] { border-color: var(--rule-2); color: var(--ink-2); cursor: default; }
.trace {
  display: none; margin-top: 8px; padding: 10px 12px 8px;
  border-left: 3px solid var(--signal); background: var(--ground);
  font: 400 12.5px/1.55 var(--mono); color: var(--ink-2);
}
.trace.open, html[data-mode="ds"] .trace { display: block; }
.trace .row { display: grid; grid-template-columns: 8.4em minmax(0, 1fr); gap: 2px 10px; }
.trace .row + .row { margin-top: 4px; }
.trace .k { color: var(--ink-2); }
.trace .val { color: var(--ink); }
.trace .hit { display: grid; grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr) 3.2em; gap: 8px; align-items: center; }
.trace .hb { height: 6px; background: var(--data-soft); border-radius: 0 3px 3px 0; overflow: hidden; }
.trace .hb span { display: block; height: 100%; background: var(--data); border-radius: 0 3px 3px 0; }
.trace .hs { text-align: right; color: var(--ink); }
.starters { display: flex; gap: 8px; padding: 2px 16px 12px; overflow-x: auto; scrollbar-width: none; }
.starters::-webkit-scrollbar { display: none; }
.starter { flex: none; white-space: nowrap; padding: 6px 12px 4px; border-radius: 999px; border: 1px solid var(--rule-2); background: none; cursor: pointer; font-size: 14px; color: var(--ink); text-align: left; }
.starter:hover { border-color: var(--ink); }
.composer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--rule); }
.composer input {
  flex: 1; min-width: 0; padding: 11px 12px 9px; border-radius: 8px;
  border: 1px solid var(--rule-2); background: var(--ground); color: var(--ink); font: 400 16px/1.3 var(--sans);
}
.composer input::placeholder { color: var(--ink-2); }
.send { padding: 0 16px; border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: var(--ground); font-weight: 700; cursor: pointer; }
.send.stop { background: transparent; color: var(--ink); }
.privacy { margin: 0; padding: 0 16px 12px; font-size: 12.5px; color: var(--ink-2); }

/* the moving detection box used by "Pick a random project" */
.scanbox {
  position: absolute; z-index: 20; border: 2px solid var(--box); border-radius: 3px; pointer-events: none;
  opacity: 0; transition: top .22s ease, left .22s ease, width .22s ease, height .22s ease, opacity .2s;
}
.scanbox .tag { position: absolute; left: -2px; bottom: 100%; font: 600 12px/1 var(--mono); padding: 4px 6px 3px; background: var(--signal); color: var(--signal-ink); white-space: nowrap; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  :root { --chat-w: 360px; }
  .layout { gap: 32px; padding: 0 24px; }
  .topbar { padding: 0 24px; }
}
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .content { padding-bottom: 110px; }
  .nav { display: none; }
  .mode-switch { margin-left: auto; }
  .chat {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; margin: 0;
    height: 86vh; height: 86dvh; border-radius: 16px 16px 0 0; border-bottom: 0;
    transform: translateY(calc(100% - 66px)); transition: transform .32s cubic-bezier(.3,.7,.2,1), background-color .45s;
    box-shadow: 0 -1px 0 var(--rule);
  }
  .chat.open { transform: translateY(0); }
  .chat.dragging { transition: none; }
  .chat-head { cursor: grab; touch-action: none; position: relative; padding-top: 20px; }
  .grab { display: block; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--rule-2); }
  .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .topbar { gap: 12px; height: 58px; padding: 0 16px; }
  .brand { font-size: 15px; }
  .mode-switch { font-size: 13px; gap: 6px; }
  .layout { padding: 0 16px; }
  .hero { padding: 40px 0 40px; }
  .headline { font-size: clamp(29px, 8.2vw, 38px); line-height: 1.62; }
  .lede { font-size: 18px; }
  .sheet { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .archive { columns: 1; }
  .stack { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .stack dd { margin-bottom: 10px; }
  .readouts { gap: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; scroll-behavior: auto !important; }
}
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
