:root {
  color-scheme: dark;
  --bg: #050a0e;
  --panel: #071017;
  --ink: #edf0f2;
  --muted: #9ba8b2;
  --line: #26343e;
  --blue: #5aa6dc;
  --blue-soft: #315f80;
  --logo-gray: #5b5b5a;
  --pad: clamp(1.25rem, 3vw, 3rem);
  --content-pad: clamp(1.5rem, 4vw, 4rem);
  font-family: "Cascadia Mono", "IBM Plex Mono", "Roboto Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-width: 20rem;
  height: 100svh;
  min-height: 100svh;
  margin: 0;
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 73% 35%, rgb(12 43 64 / 22%), transparent 30rem),
    var(--bg);
}

.matrix-rain {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.24;
}

.sidebar,
.main,
.footer {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
}

.sidebar {
  position: relative;
  min-height: 0;
  padding: 0 2.5rem 2.5rem;
  display: grid;
  grid-template-rows: 13rem minmax(0, 1fr);
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  scrollbar-color: var(--blue-soft) var(--bg);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar {
  width: 0.45rem;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--bg);
}

.sidebar::-webkit-scrollbar-thumb {
  border: 1px solid var(--bg);
  background: var(--blue-soft);
}

.brand {
  position: absolute;
  top: 5.75rem;
  left: 50%;
  display: block;
  width: 16rem;
  transform: translateX(-50%);
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.nav {
  grid-row: 2;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(1rem, 4vh, 2.5rem);
}

.nav ol {
  margin: 0;
  padding: 0;
  min-height: 0;
  max-height: 100%;
  align-self: center;
  display: grid;
  gap: clamp(0.75rem, 4vh, 2.5rem);
  overflow-y: auto;
  list-style: none;
  scrollbar-color: var(--blue-soft) transparent;
  scrollbar-width: thin;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 0.3rem 0;
  color: var(--ink);
  font-size: 1.25rem;
  letter-spacing: 0.055em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav a::after {
  content: "";
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--blue);
}

.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav a[aria-current="page"]:hover,
.nav a[aria-current="page"]:focus-visible {
  color: var(--blue);
}

.nav a[aria-current="page"]::after {
  color: var(--blue);
  content: "_";
}

.nav-toggle {
  display: none;
}

.header-contact-action {
  display: none;
}

.socials {
  margin-top: 0;
  display: flex;
  justify-content: space-between;
}

.social {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.55rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--blue-soft);
  border-radius: 0;
  color: var(--blue);
  background: transparent;
  cursor: not-allowed;
  opacity: 0.55;
}

.social:hover {
  border-color: var(--blue);
  color: #03101a;
  background: var(--blue);
}

.social svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.social:first-child svg,
.social:nth-child(2) svg,
.social-dot {
  fill: currentColor;
  stroke: none;
}

.social:nth-child(3) svg {
  stroke-width: 2.15;
  transform: scale(1.08);
  transform-origin: center;
}

@media (min-width: 56.0625rem) and (min-height: 42.0625rem) {
  .contact-page .main {
    overflow: hidden;
  }

  .subpage .content {
    padding-top: 4.75rem;
  }
}

.main {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.subpage .main {
  isolation: isolate;
}

.subpage-network,
.work-tree,
.contact-transfer {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.subpage-network {
  opacity: 0.72;
}

.work-tree {
  opacity: 0.42;
}

.contact-transfer {
  opacity: 0.54;
}

.content {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100%;
  padding: clamp(2.25rem, 6vh, 4.75rem) var(--content-pad);
}

.home {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  padding-bottom: 2.5rem;
  overflow: hidden;
}

.home.uart-hidden {
  grid-template-rows: minmax(0, 1fr);
}

.home-copy {
  grid-row: 1;
  align-self: center;
  width: min(100%, 50rem);
}

.home-divider {
  display: block;
  width: 2rem;
  height: 2px;
  margin: -0.15rem 0 1.6rem;
  background: var(--blue);
}

.eyebrow {
  margin: 0 0 1.25rem;
  color: var(--blue);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 54rem;
  margin-bottom: 1.8rem;
  font-size: 4rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  line-height: 1.05;
  text-transform: uppercase;
}

h1 .accent {
  color: var(--blue);
}

.lead {
  max-width: 47rem;
  margin-bottom: 0;
  color: #d6dce0;
  font-size: 1.15rem;
  line-height: 1.75;
}

.uart-console {
  position: relative;
  grid-row: 2;
  align-self: end;
  width: 100%;
  height: 18.5rem;
  color: var(--blue);
  opacity: 0.78;
  --gate-start: 5.5px;
  --gate-end-x: calc(100% - 5.5px);
  --gate-end-inset: 5.5px;
  --uart-baseline-offset: 1.125rem;
  --uart-decode-offset: 2.15rem;
}

.uart-console.is-hidden {
  display: none;
}

.uart-channel {
  position: absolute;
  z-index: 2;
  right: 0;
  left: 0;
  height: 1rem;
  color: var(--blue-soft);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.uart-channel::after {
  position: absolute;
  right: var(--gate-end-inset);
  left: var(--gate-start);
  top: 0;
  height: 1px;
  content: "";
  background: var(--blue-soft);
  opacity: 0.18;
  transform: translateY(var(--uart-baseline-offset, 1.125rem));
}

.uart-channel > span {
  position: absolute;
  top: 0;
  left: 0;
  padding-left: 0.5rem;
  transform: translateY(calc(-50% + var(--uart-baseline-offset, 1.125rem)));
  transition: color 180ms ease, text-shadow 180ms ease;
}

.uart-lane-decode {
  position: absolute;
  top: var(--uart-decode-offset, 2.15rem);
  right: calc(var(--gate-end-inset) + 0.9rem);
  left: auto;
  width: calc(var(--gate-end-x) - var(--gate-start) - 1.8rem);
  max-width: none;
  overflow: hidden;
  color: var(--blue);
  font-size: inherit;
  letter-spacing: inherit;
  line-height: 1;
  opacity: 0.62;
  text-align: right;
  text-overflow: clip;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateY(-50%);
}

.uart-rx .uart-lane-decode {
  right: auto;
  left: calc(var(--gate-start) + 0.9rem);
  text-align: left;
}

.uart-lane-decode.accepted {
  color: #5adc8a;
}

.uart-lane-decode.error {
  color: #e05f5f;
}

.uart-lane-decode.rabbit {
  color: #f5f8fb;
}

.uart-lane-decode.rabbit .uart-current-bit {
  color: inherit;
}

.uart-decoded-underscore {
  position: relative;
  display: inline-block;
  width: 1ch;
  color: transparent;
  vertical-align: baseline;
}

.uart-decoded-underscore::after {
  position: absolute;
  right: 0.08ch;
  bottom: 0.08em;
  left: 0.08ch;
  height: 1px;
  content: "";
  background: currentColor;
  background: var(--blue);
  opacity: 0.85;
}

.uart-channel.active > span {
  color: var(--blue);
  text-shadow: 0 0 0.5rem rgb(90 166 220 / 35%);
}

.uart-channel .uart-bit-label,
.uart-channel.active .uart-bit-label {
  top: var(--uart-decode-offset, 2.15rem);
  left: var(--gate-start);
  padding: 0;
  color: var(--blue);
  opacity: 0.55;
  text-shadow: none;
  transform: translate(-50%, -50%);
}

.uart-channel .uart-bit-end,
.uart-channel.active .uart-bit-end {
  left: var(--gate-end-x);
  transform: translate(-50%, -50%);
}

.uart-lane-decode .uart-current-bit,
.uart-channel.active .uart-current-bit {
  position: relative;
  z-index: 2;
  display: inline-block;
  min-width: 1ch;
  color: #73818b;
  font-weight: 700;
  opacity: 1;
  text-shadow: none;
}

.uart-current-bit:empty {
  display: none;
}

.uart-tx {
  top: var(--tx-channel-top, 3.375rem);
}

.uart-rx {
  top: var(--rx-channel-top, 11.125rem);
}

.uart-canvas {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 14.5rem;
  opacity: 0.42;
  pointer-events: none;
}

.uart-gate {
  position: absolute;
  z-index: 1;
  top: 0;
  width: 0;
  height: 14.5rem;
  background: transparent;
}

.uart-gate-start {
  left: var(--gate-start);
}

.uart-gate-end {
  right: var(--gate-end-inset);
}

.uart-gate i {
  position: absolute;
  left: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border: 1px solid var(--blue);
  border-radius: 1px;
  background: var(--dot-fill, var(--bg));
  box-shadow: 0 0 0.5rem rgb(90 166 220 / 38%);
  transform: translate(-50%, -50%);
}

.uart-dot-tx {
  top: var(--tx-dot-top, 5rem);
  opacity: var(--tx-dot-opacity, 0.35);
}

.uart-dot-rx {
  top: var(--rx-dot-top, 12.75rem);
  opacity: var(--rx-dot-opacity, 0.35);
}

.uart-form {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2.75rem;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) 11rem 2.75rem;
  border: 1px solid var(--blue-soft);
  background: rgb(5 10 14 / 82%);
  opacity: 0.82;
}

.uart-form label,
.uart-form input,
.uart-form button {
  border: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
}

.uart-form label {
  display: grid;
  place-items: center;
  color: var(--blue);
}

.uart-form input {
  min-width: 0;
  outline: 0;
}

.uart-form input::placeholder {
  color: var(--muted);
  opacity: 0.55;
}

.uart-form button {
  color: #03101a;
  background: var(--blue);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.uart-form .uart-submit {
  border-left: 1px solid var(--blue-soft);
  color: var(--blue);
  background: transparent;
}

.uart-form .uart-submit:hover,
.uart-form .uart-submit:focus-visible {
  color: #03101a;
  background: var(--blue);
}

.uart-form .uart-cancel {
  border-left: 1px solid var(--blue-soft);
  color: var(--blue);
  background: transparent;
}

.uart-form .uart-cancel:hover,
.uart-form .uart-cancel:focus-visible {
  color: #03101a;
  background: var(--blue);
}

.uart-form button:disabled,
.uart-form input:disabled {
  cursor: wait;
  opacity: 0.55;
}

.page-title {
  margin-bottom: clamp(1.75rem, 4vh, 3rem);
}

.page-title h1 {
  margin-bottom: 0.75rem;
  font-size: 3rem;
}

.service-list,
.work-list {
  max-width: 76rem;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.service,
.project {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: clamp(0.8rem, 1.7vw, 1.5rem);
  padding: clamp(1.6rem, 3.5vw, 2.6rem) 0;
  border-bottom: 1px solid var(--line);
}

.index {
  padding-top: 0.25rem;
  color: var(--blue);
  font-size: 0.82rem;
}

.service h2,
.project h2,
.about-section h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  font-weight: 500;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.service p,
.project p,
.about-section p {
  max-width: 62rem;
  color: var(--muted);
  line-height: 1.72;
}

.service .scenario {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 1px solid var(--blue);
  color: #cbd4da;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin: 1.4rem 0 0;
  padding: 0;
  color: var(--blue);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  list-style: none;
  text-transform: uppercase;
}

.project-more {
  margin-top: 1rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--blue-soft);
  color: var(--blue);
  background: transparent;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.project-more:hover,
.project-more:focus-visible {
  border-color: var(--blue);
  color: #03101a;
  background: var(--blue);
}

.debug-panel {
  max-width: 50rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
}

.debug-panel:last-child {
  border-bottom: 1px solid var(--line);
}

.debug-panel h2 {
  margin-bottom: 1rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.perf-toggles,
.debug-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.perf-toggle {
  min-height: 2.6rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--blue-soft);
  color: var(--blue);
  background: transparent;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.perf-toggle[aria-pressed="false"] {
  border-color: #5b2f36;
  color: #e05f5f;
}

.perf-toggle:hover,
.perf-toggle:focus-visible {
  border-color: var(--blue);
  color: #03101a;
  background: var(--blue);
}

.debug-links .project-more {
  margin-top: 0;
  text-decoration: none;
}

.case-dialog {
  width: min(58rem, calc(100vw - 3rem));
  max-height: min(44rem, calc(100svh - 3rem));
  padding: 0;
  border: 1px solid var(--blue-soft);
  color: var(--ink);
  background: var(--panel);
  scrollbar-color: var(--blue-soft) var(--bg);
  scrollbar-width: thin;
}

.case-dialog::-webkit-scrollbar {
  width: 0.55rem;
}

.case-dialog::-webkit-scrollbar-track {
  background: var(--bg);
}

.case-dialog::-webkit-scrollbar-thumb {
  border: 2px solid var(--bg);
  background: var(--blue-soft);
}

.case-dialog::backdrop {
  background: rgb(5 10 14 / 82%);
}

.case-panel {
  --case-pad: clamp(1.25rem, 3vw, 2rem);
  padding: 0;
}

.case-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: var(--case-pad);
  padding-bottom: calc(var(--case-pad) * 0.65);
  padding-right: calc(var(--case-pad) + 3rem);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.case-header h2 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  font-weight: 500;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.case-header .accent {
  color: var(--blue);
}

.dialog-close {
  position: absolute;
  top: var(--case-pad);
  right: var(--case-pad);
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--blue-soft);
  color: var(--blue);
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.dialog-close:hover,
.dialog-close:focus-visible {
  color: #03101a;
  background: var(--blue);
}

.case-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(14rem, 0.9fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  padding: var(--case-pad);
}

.case-copy p {
  color: var(--muted);
  line-height: 1.72;
}

.case-copy p + p {
  margin-top: 1rem;
}

.case-facts {
  margin: 1.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.case-facts div {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.case-facts dt {
  margin-bottom: 0.25rem;
  color: var(--blue);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-facts dd {
  margin: 0;
  color: #d7dde1;
  line-height: 1.45;
}

.case-media {
  min-height: 18rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, transparent 49%, rgb(90 166 220 / 10%) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgb(90 166 220 / 10%) 50%, transparent 51%);
  background-size: 2.4rem 2.4rem;
}

.case-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem var(--case-pad) var(--case-pad);
  border-top: 1px solid var(--line);
  color: var(--blue);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-dialog {
  width: min(46rem, calc(100vw - 3rem));
}

.legal-copy {
  padding: var(--case-pad);
}

.legal-copy p {
  color: var(--muted);
  line-height: 1.72;
}

.legal-copy p + p {
  margin-top: 1rem;
}

.contact-socials {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.75rem;
}

.contact-social {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--blue-soft);
  color: var(--blue);
  opacity: 0.55;
  cursor: not-allowed;
}

.contact-social svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.7;
}

.contact-social:first-child svg,
.contact-social:nth-child(2) svg,
.contact-social .social-dot {
  stroke: none;
}

.contact-social:nth-child(3) svg {
  fill: none;
  stroke-width: 2.15;
  transform: scale(1.08);
  transform-origin: center;
}

.contact-legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.contact-legal-actions .project-more {
  margin-top: 0.35rem;
}

.contact-about {
  align-items: stretch;
}

.contact-copy-column {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(8rem, 1fr);
  gap: clamp(1.5rem, 4vh, 2.75rem);
}

.contact-transfer-slot {
  min-height: clamp(8.75rem, 18vh, 11.25rem);
  --contact-transfer-y: 0.45;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(15rem, 0.75fr);
  gap: clamp(2.5rem, 7vw, 7rem);
}

.about-section + .about-section {
  margin-top: 3rem;
}

.facts {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.facts div {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  margin-bottom: 0.4rem;
  color: var(--blue);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.facts dd {
  margin: 0;
  color: #d7dde1;
  line-height: 1.5;
}

.footer {
  grid-column: 1 / -1;
  height: 6rem;
  padding: 1.25rem;
  border-top: 0;
  box-shadow: inset 0 1px var(--line);
  background: #04090d;
}

.contact-bar {
  height: 3.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12rem;
  border: 1px solid var(--blue);
}

.contact-prompt,
.contact-action {
  min-height: 0;
  display: flex;
  align-items: center;
}

.contact-prompt {
  padding: 0 1rem;
  color: #d9e0e4;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.prompt {
  margin-right: 0.7rem;
  color: var(--blue);
  font-weight: 700;
}

.contact-action {
  justify-content: center;
  padding: 0 1.5rem;
  border-left: 1px solid var(--blue);
  color: #03101a;
  background: var(--blue);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.contact-action:hover,
.contact-action:focus-visible {
  color: var(--blue);
  background: transparent;
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.main {
  scrollbar-color: var(--blue-soft) var(--bg);
  scrollbar-width: thin;
}

.main::-webkit-scrollbar {
  width: 0.55rem;
}

.main::-webkit-scrollbar-track {
  background: var(--bg);
}

.main::-webkit-scrollbar-thumb {
  border: 2px solid var(--bg);
  background: var(--blue-soft);
}

@media (max-width: 56rem) {
  :root {
    --content-pad: var(--pad);
  }
  body {
    height: 100svh;
    min-height: 100svh;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .sidebar {
    min-height: auto;
    padding: 1rem var(--pad);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: auto;
    align-items: center;
    gap: 0.5rem;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-gutter: auto;
  }

  .brand {
    position: static;
    width: clamp(6.5rem, 31vw, 12rem);
    margin: 0;
    transform: none;
  }

  .header-contact-action {
    min-height: 2.75rem;
    padding: 0 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--blue);
    color: #03101a;
    background: var(--blue);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .header-contact-action:hover,
  .header-contact-action:focus-visible {
    color: var(--blue);
    background: transparent;
  }

  .header-contact-action:active {
    color: #03101a;
    background: #4f95c9;
    box-shadow: inset 0 0 0 1px rgb(3 16 26 / 35%);
    transform: translateY(1px);
  }

  .nav {
    position: static;
    margin: 1.5rem 0 0;
  }

  .nav ol {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
  }

  .nav a {
    justify-content: center;
    width: auto;
    font-size: clamp(0.55rem, 2.7vw, 1.25rem);
    letter-spacing: clamp(0.01em, 0.2vw, 0.055em);
    white-space: nowrap;
  }

  .main {
    min-height: 0;
    overflow: auto;
  }

  .footer {
    display: none;
  }

  .content {
    min-height: 33rem;
    padding: clamp(1.75rem, 5.5svh, 3rem) var(--pad);
  }

  .home {
    position: relative;
    height: auto;
    min-height: 100%;
    grid-template-rows: auto minmax(12rem, 1fr);
    gap: clamp(0.65rem, 1.4svh, 1.15rem);
    padding-bottom: 1.25rem;
  }

  .home.uart-hidden {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .home-copy {
    align-self: start;
    width: min(100%, 50rem);
  }

  .home .uart-console {
    align-self: end;
    min-height: 12rem;
    height: clamp(12rem, 30svh, 18rem);
    max-height: 30rem;
    overflow: hidden;
  }

  .home .uart-canvas,
  .home .uart-gate {
    height: max(0px, calc(100% - 2.5rem));
  }

  .uart-channel::after {
    opacity: 0.28;
  }

  h1 {
    font-size: clamp(2.75rem, 6.15svh, 3.45rem);
  }

  .page-title h1 {
    font-size: 2.5rem;
  }

  .lead {
    font-size: clamp(0.96rem, 2.05svh, 1.08rem);
  }

  .uart-form {
    height: 2.5rem;
    grid-template-columns: 1.75rem minmax(0, 1fr) 7.4rem 2.5rem;
  }

  .uart-form button {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .contact-copy-column {
    min-height: 0;
    display: block;
  }

  .contact-transfer-slot {
    min-height: clamp(6.5rem, 15vh, 8rem);
    margin-top: 1.25rem;
    --contact-transfer-y: 0.08;
  }

  .case-dialog {
    width: calc(100vw - 2rem);
    max-height: calc(100svh - 2rem);
  }

  .case-body {
    grid-template-columns: 1fr;
  }

  .case-media {
    min-height: 12rem;
  }

}

@media (max-width: 56rem) {
  .sidebar {
    z-index: 3;
  }

  .brand {
    width: clamp(6.5rem, 31vw, 12rem);
  }

  .nav-toggle {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.65rem;
    display: grid;
    align-content: space-between;
    border: 1px solid var(--blue-soft);
    color: var(--blue);
    background: var(--bg);
  }

  .nav-toggle span {
    display: block;
    height: 1px;
    background: currentColor;
  }

  .nav {
    position: absolute;
    top: 100%;
    right: 0;
    bottom: auto;
    left: 0;
    max-height: calc(100svh - 4.75rem);
    margin: 0;
    padding: 0.75rem var(--pad) 1rem;
    display: none;
    overflow-y: auto;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    scrollbar-color: var(--blue-soft) var(--bg);
    scrollbar-width: thin;
  }

  .sidebar.nav-open .nav {
    display: block;
  }

  .nav ol {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .nav a {
    justify-content: flex-end;
    padding: 0.8rem 0.25rem;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    letter-spacing: 0.055em;
    text-align: right;
  }

  .nav li:last-child a {
    border-bottom: 0;
  }

  .socials {
    display: none;
  }
}

@media (max-width: 31rem) {
  .contact-bar {
    grid-template-columns: 1fr;
  }

  .contact-prompt {
    display: none;
  }

  .service,
  .project {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (min-width: 40rem) and (max-width: 56rem) {
  body {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .header-contact-action {
    display: none;
  }

  .footer {
    display: block;
  }

  .contact-bar {
    grid-template-columns: minmax(0, 1fr) 12rem;
  }

  .home {
    grid-template-rows: auto minmax(12rem, 1fr);
    align-content: stretch;
    gap: clamp(1.5rem, 3svh, 2.25rem);
  }

  .home h1 {
    font-size: clamp(3.65rem, 5.6svh, 4.35rem);
  }

  .home .lead {
    max-width: 58rem;
    font-size: 1.08rem;
  }

  .home .uart-console {
    align-self: end;
    width: 100%;
    height: clamp(12rem, 20svh, 15rem);
    max-height: none;
  }
}

@media (min-width: 40rem) and (max-width: 56rem) and (max-height: 31rem) {
  body {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .content {
    min-height: 28rem;
    padding: 1.25rem var(--pad);
  }

  .header-contact-action {
    display: flex;
  }

  .footer {
    display: none;
  }

  .home {
    align-content: start;
    gap: 0.75rem;
  }

  .home h1 {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 9svh, 2.45rem);
    line-height: 1.03;
  }

  .home-divider {
    margin-bottom: 1rem;
  }

  .home .lead {
    max-width: 44rem;
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .home .uart-console {
    width: 100%;
    height: 11rem;
  }
}

@media (max-width: 31rem) and (max-height: 43rem) {
  .content {
    padding-top: 1.5rem;
    padding-bottom: 1rem;
  }

  .home {
    gap: 0.75rem;
  }

  .home h1 {
    margin-bottom: 1.15rem;
    font-size: 2.55rem;
    line-height: 1.03;
  }

  .home-divider {
    margin-bottom: 1.25rem;
  }

  .home .lead {
    font-size: 0.94rem;
    line-height: 1.6;
  }
}

@media (max-width: 23rem) {
  .home h1 {
    margin-bottom: 1.2rem;
    font-size: 2.75rem;
    letter-spacing: 0.025em;
    line-height: 1.03;
  }

  .home-divider {
    margin-bottom: 1.25rem;
  }

  .uart-form {
    grid-template-columns: 1.5rem minmax(0, 1fr) 6.75rem 2.25rem;
  }

  .uart-form input {
    font-size: 0.92rem;
  }

  .uart-form button {
    font-size: 0.74rem;
  }
}

@media (max-width: 23rem) and (max-height: 43rem) {
  .home h1 {
    font-size: 2.55rem;
    letter-spacing: 0.025em;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .nav a,
  .contact-action,
  .contact-mail {
    transition: color 140ms ease, background-color 140ms ease;
  }
}
