@font-face {
  font-family: "Instrument Sans";
  src: url("vendor/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

.folio {
  --paper: #fafbfc;
  --ink: #253245;
  --muted: #526173;
  --line: #d6dee7;
  --accent: #214bb9;
  --accent-light: #e8eefb;
  --display: "Instrument Sans", var(--font);
  --header-height: 68px;
  --ease: cubic-bezier(.22, .8, .28, 1);
  background: var(--paper);
  color: var(--ink);
}
.folio .shell { max-width: 1220px; }
.folio ::selection { color: #2349a8; background: #dae5fb; }
.folio .skip-link { z-index: 7; color: white; background: var(--accent); }
.folio :is(#main, #linger-preview, #engineering, #projects, .lab) {
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.folio-header {
  position: sticky;
  z-index: 5;
  top: 0;
  border-color: #e0e6ed;
  background: #fafbfc;
}
.folio-header .header-inner { min-height: var(--header-height); }
.folio-wordmark { color: #25364c; font-size: 1.37rem; font-weight: 690; letter-spacing: -.062em; }
.folio-header nav a { min-width: 39px; justify-content: center; }
.folio-header nav .nav-resume { color: var(--accent); }

.folio-hero { padding-block: clamp(37px, 5.15vw, 72px) 0; }
.folio-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 7px 20px;
  margin-bottom: clamp(25px, 4vw, 49px);
}
.folio-intro h1 {
  margin-inline-start: -.028em;
  font: 635 clamp(3rem, 7.4vw, 6.4rem)/.97 var(--display);
  letter-spacing: -.071em;
}
.folio-byline {
  display: grid;
  gap: 3px;
  padding-block-end: 4px;
  color: #3e4f64;
  font-size: clamp(.97rem, 1.25vw, 1.08rem);
  font-weight: 600;
  line-height: 1.44;
  text-align: end;
}
.folio-byline span { color: var(--muted); font-size: .9rem; font-weight: 475; }

.folio-button {
  display: inline-flex;
  min-height: 44px;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  font-weight: 610;
  font-size: .92rem;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
}
.folio-primary { color: white; background: var(--accent); }
.folio-primary:hover { background: #183d9f; }
.folio-subtle { color: #465974; background: transparent; padding-inline: 9px; }
.folio-subtle:hover { color: var(--accent); background: #eef2f7; }
.folio-button:disabled, .folio-button[aria-disabled="true"] { opacity: .64; cursor: default; }

.handoff { min-width: 0; }
.handoff-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid #dce3ec;
  border-radius: 4px 4px 0 0;
  background: #e9eef4;
}
.handoff-top {
  display: flex;
  align-items: baseline;
  gap: 9px 13px;
  min-height: 58px;
  padding: 16px clamp(15px, 2.5vw, 33px) 10px;
}
.handoff-top h2 {
  color: #26364c;
  font: 630 clamp(1.45rem, 2.45vw, 2.18rem)/1 var(--display);
  letter-spacing: -.054em;
}
.handoff-top p { color: #526276; font-size: .91rem; line-height: 1.3; }

.route-art {
  position: relative;
  display: grid;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 3.2;
  max-height: 392px;
  min-height: 278px;
}
.route-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.route-art[data-webgl="ready"] .route-fallback { visibility: hidden; }
.route-hint {
  position: absolute;
  z-index: 1;
  top: clamp(15px, 1.98vw, 27px);
  right: clamp(14px, 2.5vw, 31px);
  display: none;
  color: #556579;
  font-size: .85rem;
  font-weight: 500;
  pointer-events: none;
  user-select: none;
}

.route-fallback { position: relative; min-height: 100%; }
.route-path { position: absolute; inset: 59% 21% auto; height: 3px; border-radius: 3px; background: #aebdce; }
.route-path i { position: absolute; top: -3px; left: 2%; width: 9px; height: 9px; opacity: 0; border: 1px solid white; border-radius: 50%; background: var(--accent); }
.handoff:is([data-stage="sending"], [data-stage="replying"], [data-stage="replay"]) .route-path i { opacity: 1; }
.route-device {
  position: absolute;
  display: grid;
  height: clamp(105px, 16vw, 235px);
  aspect-ratio: 1.3;
  place-items: center;
}
.route-device::before {
  position: absolute;
  z-index: -1;
  inset: 44% 1% 7%;
  transform: skewY(-11deg);
  border: 1px solid #9dabbc;
  border-radius: 3px;
  background: #e6ebf1;
  box-shadow: 0 8px 0 #9dabbc;
  content: "";
}
.route-device > i {
  position: relative;
  display: grid;
  align-content: center;
  gap: 6px;
  width: 73%;
  height: 61%;
  padding: 8%;
  margin-bottom: 20%;
  transform: skewY(-6deg);
  border: 4px solid #647992;
  border-radius: 5px;
  background: #f5f8fc;
  box-shadow: 4px 3px 0 #647992;
}
.route-device b { display: block; width: 72%; height: 4px; border-radius: 3px; background: #a1b5d0; }
.route-device b:first-child { width: 59%; background: #4a6ab6; }
.route-device b:last-child { width: 52%; }
.route-device-desktop { bottom: 15%; left: 14%; }
.route-device-hub { bottom: 20%; left: 50%; transform: translateX(-50%); }
.route-device-hub > i { width: 56%; height: 35%; margin: 1% 0 0; border-color: #31569d; background: #3c63bc; box-shadow: 4px 3px 0 #31569d; }
.route-device-hub b:first-child { width: 49%; background: #dce8ff; }
.route-device-phone { right: 14%; bottom: 14%; }
.route-device-phone > i { width: 38%; height: 79%; border-color: #7c8da1; border-radius: 7px; box-shadow: 4px 3px 0 #7c8da1; }

.handoff-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 10px clamp(17px, 2.3vw, 36px);
  min-height: 69px;
  padding: 10px clamp(14px, 2.35vw, 32px);
  border: 1px solid #dde4ec;
  border-top: 0;
  background: white;
}
.route-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px clamp(7px, 1.7vw, 24px);
  padding: 0;
  list-style: none;
}
.route-labels li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 0 3px;
  color: #5b6b7d;
  font-size: .86rem;
  font-weight: 565;
  white-space: nowrap;
}
.route-labels li span { width: 6px; height: 6px; border: 1px solid #95a2b2; border-radius: 50%; }
.route-labels [data-active] { color: var(--accent); }
.route-labels [data-active] span { border-color: var(--accent); background: var(--accent); }

.handoff-status { display: flex; align-items: baseline; flex-wrap: wrap; gap: 1px 9px; min-width: 0; text-align: end; }
.handoff-status strong { color: #354a66; font-weight: 680; font-size: .93rem; }
.handoff-status span:not(:empty) { color: var(--muted); font-size: .84rem; }
.handoff-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 3px; }
.handoff-actions .folio-primary { min-width: 96px; }

.handoff-log { padding: 0 2px; border-bottom: 1px solid var(--line); }
.handoff-log summary, .project-notes summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  cursor: pointer;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 580;
  list-style: none;
}
.handoff-log summary::-webkit-details-marker, .project-notes summary::-webkit-details-marker { display: none; }
.handoff-log summary::before, .project-notes summary::before {
  width: 7px;
  height: 7px;
  margin-inline: 2px 3px;
  transform: rotate(-45deg);
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  content: "";
}
.handoff-log[open] summary::before, .project-notes[open] summary::before { transform: rotate(45deg); }
.handoff-log summary code { margin-inline-start: auto; color: var(--muted); font: .82rem var(--mono); }
.handoff-log ol { margin: 2px 0 17px; padding-inline-start: 24px; color: var(--muted); font-size: .91rem; }
.handoff-log ol li + li { margin-top: 3px; }
.handoff-log li::marker { color: var(--accent); }
.handoff-log li code { font: .84rem var(--mono); overflow-wrap: anywhere; }
.demo-noscript { padding: 9px 0; color: var(--muted); }

.folio-engineering { padding-block: clamp(57px, 7vw, 99px); }
.folio-section-head { margin-bottom: clamp(22px, 3.25vw, 40px); }
.folio-section-head h2 {
  font-size: clamp(2rem, 4vw, 3.45rem);
  font-weight: 670;
  line-height: 1.12;
  letter-spacing: -.06em;
}
.lab-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(24px, 5vw, 69px); }
.lab {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  align-items: start;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.lab-project { display: inline-flex; color: var(--muted); font-weight: 580; font-size: .91rem; text-underline-offset: 4px; }
.lab-project:hover { color: var(--accent); }
.lab h3 { margin-top: 6px; font-size: clamp(1.45rem, 2.65vw, 2.06rem); font-weight: 660; letter-spacing: -.05em; line-height: 1.2; }
.process-display, .sync-display {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(122px, 13.5vw, 186px);
  margin-top: clamp(15px, 2vw, 24px);
  overflow: hidden;
  border: 1px solid #dce4ec;
  border-radius: 4px;
  background: #edf1f6;
}
.process-display { isolation: isolate; }
.process-client {
  position: absolute;
  inset: 15% auto auto 15%;
  display: grid;
  gap: 9px;
  width: 47%;
  height: 61%;
  align-content: center;
  padding: 15px;
  transform: rotate(-7deg);
  border: 1px solid #9daec1;
  border-radius: 4px;
  box-shadow: 0 6px 10px #233a5514;
  background: #d1dce8;
}
.process-client i { width: 78%; height: 4px; border-radius: 3px; background: #8ba2bb; }
.process-client i:nth-child(2) { width: 55%; }
.process-client i:nth-child(3) { width: 64%; }
.lab-process[data-window="closed"] .process-client { transform: translate(-52%, -28%) rotate(-19deg) scale(.8); opacity: 0; }
.process-daemon {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(7px,1.2vw,13px);
  max-width: 88%;
  min-width: min(243px,81%);
  margin-top: 16px;
  padding: 11px;
  transform: translateX(11%);
  border: 1px solid #a6b5c6;
  border-radius: 5px;
  color: #33485f;
  background: #fbfcfe;
  box-shadow: 0 7px 13px #233a551a;
}
.lab-process[data-window="closed"] .process-daemon { transform: translateX(0); }
.process-daemon strong { display: block; font-size: .92rem; white-space: nowrap; }
.process-daemon code { color: #65778e; font: .8rem var(--mono); white-space: nowrap; }
.process-elapsed { padding: 3px 5px; border-radius: 3px; color: var(--accent); background: #e9eef8; font: .86rem var(--mono); white-space: nowrap; }
.daemon-motif { display: flex; align-items: center; justify-content: center; gap: 3px; width: 36px; height: 36px; border-radius: 4px; background: #e7edf6; }
.daemon-motif i { width: 3px; height: 14px; border-radius: 2px; background: #4d70b4; scale: 1 .55; }
.daemon-motif i:nth-child(2) { scale: 1 1.2; }
.daemon-motif i:nth-child(3) { scale: 1 .7; }
.daemon-motif i:nth-child(4) { scale: 1 .44; }

.sync-display { gap: clamp(9px, 1.9vw, 22px); padding: 12px; }
.sync-counter {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  justify-items: center;
  width: min(104px, 28%);
  padding: 10px 7px;
  border: 1px solid #b5c2d0;
  border-radius: 4px;
  color: var(--muted);
  background: #f9fbfd;
}
.sync-counter strong { color: #345484; font: 655 clamp(1.65rem, 3.25vw, 2.18rem)/1 var(--display); font-variant-numeric: tabular-nums; }
.sync-counter span { font-size: .82rem; font-weight: 570; }
.sync-track { position: relative; width: min(80px, 22%); height: 1px; background: #98abc0; }
.sync-track i { position: absolute; top: -4px; left: 0; width: 9px; height: 9px; opacity: 0; border: 1px solid #fcfdff; border-radius: 50%; background: var(--accent); }
.lab-sync[data-network="offline"] .sync-track { height: 0; border-top: 1px dashed #92a4ba; background: none; }
.lab-sync[data-network="working"] .sync-track i { opacity: 1; }
.lab-result { min-height: 1.74em; margin-top: 12px; color: var(--muted); font-size: .91rem; line-height: 1.54; }
.lab-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.lab-button, .sync-add { border-color: #aebed0; color: #2f4f7b; background: white; }
.lab-button:hover, .sync-add:hover { border-color: #8ba5cb; background: #ecf1f8; }

.folio-footer { background: #fafbfc; }
.folio-footer .footer-inner { min-height: 74px; }
.folio-footer nav a:hover { color: var(--accent); }
.folio.resume-page .resume-document { border-radius: 5px; }
.folio.resume-page .resume-intro h1 { font: 630 clamp(2.25rem, 6.65vw, 4.55rem)/.99 var(--display); letter-spacing: -.07em; }
.folio.resume-page .button-secondary { border-color: #a9bbd0; color: var(--accent); background: #f4f7fc; }

@media (prefers-reduced-motion: no-preference) {
  .folio-button, .route-labels li, .handoff-log summary::before, .project-notes summary::before { transition: background-color 160ms, border-color 160ms, color 160ms, transform 200ms var(--ease); }
  .folio-button:active:not([aria-disabled="true"]):not(:disabled) { transform: translateY(1px); }
  .route-art[data-webgl="ready"] { cursor: grab; touch-action: pan-y pinch-zoom; }
  .route-art[data-dragging] { cursor: grabbing; }
  .route-art[data-webgl="ready"] + .route-hint { display: block; }
  .process-daemon { transition: transform 430ms var(--ease); }
  .process-client { transition: transform 435ms var(--ease), opacity 330ms var(--ease); }
  .lab-process[data-visible] .daemon-motif i { animation: daemon-tick 1.36s ease-in-out infinite alternate; animation-delay: calc(var(--bar-delay,1) * -.2s); }
  .daemon-motif i:nth-child(2) { --bar-delay: 2; }
  .daemon-motif i:nth-child(3) { --bar-delay: 3; }
  .daemon-motif i:nth-child(4) { --bar-delay: 4; }
  .lab-sync[data-network="working"] .sync-track i { animation: sync-travel 540ms var(--ease) infinite; }
  .handoff[data-stage="sending"] .route-path i { animation: path-travel 1s var(--ease) both; }
  .handoff[data-stage="replying"] .route-path i { animation: path-travel 1.05s var(--ease) reverse both; }
  .handoff[data-stage="replay"] .route-path i { animation: path-travel 650ms var(--ease) reverse both; }
  @keyframes daemon-tick { from { scale: 1 .65; } to { scale: 1 1.22; } }
  @keyframes path-travel { from { left: 2%; } to { left: calc(100% - 9px); } }
  @keyframes sync-travel { from { left: 0; } to { left: calc(100% - 9px); } }
}

@media (max-width: 800px) {
  .folio { --header-height: 61px; }
  .route-art { min-height: 222px; aspect-ratio: 2.55; }
  .handoff-toolbar { grid-template-columns: minmax(190px,1fr) auto auto; gap: 7px 12px; }
  .handoff-status { justify-content: flex-end; }
}
@media (max-width: 620px) {
  .folio { --gutter: clamp(16px, 5.2vw, 33px); }
  .folio-hero { padding-top: 30px; }
  .folio-intro { align-items: start; flex-direction: column; gap: 9px; margin-bottom: 21px; }
  .folio-intro h1 { font-size: clamp(2.48rem, 10.8vw, 4rem); }
  .folio-byline { display: flex; flex-wrap: wrap; align-items: baseline; text-align: start; gap: 4px 9px; padding: 0; }
  .folio-byline span { border-inline-start: 1px solid var(--line); padding-inline-start: 9px; }
  .route-art { min-height: 165px; aspect-ratio: 1.91; }
  .route-device { height: clamp(66px, 20vw, 108px); }
  .route-device > i { border-width: 3px; }
  .route-device-desktop { left: 9%; }
  .route-device-phone { right: 8%; }
  .route-hint { font-size: .78rem; }
  .handoff-top { min-height: 45px; padding-top: 13px; padding-bottom: 7px; gap: 8px; }
  .handoff-top p { font-size: .82rem; }
  .handoff-toolbar {
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas: "path path" "status action";
    gap: 4px 9px;
    padding: 7px 11px 9px;
  }
  .route-labels { grid-area: path; gap: 4px 13px; }
  .route-labels li { min-height: 27px; }
  .handoff-status { grid-area: status; display: block; align-self: center; text-align: start; }
  .handoff-status span:not(:empty) { display: block; }
  .handoff-actions { grid-area: action; align-self: center; }
  .handoff-actions .folio-primary { min-width: auto; padding-inline: 9px; }
  .handoff-actions .folio-subtle { padding-inline: 6px; }
  .lab-grid { grid-template-columns: minmax(0,1fr); gap: 29px; }
  .process-daemon { transform: translateX(5%); }
}
@media (max-width: 370px) {
  .route-art { min-height: 150px; }
  .handoff-top { padding-inline: 11px; }
  .route-hint { top: 15px; right: 10px; }
  .folio-footer nav { gap: 9px; }
}
@media print {
  .folio.resume-page { background: white; color: #000; }
  .folio.resume-page .resume-document { border: 0; border-radius: 0; }
}
