@font-face {
  font-family: Manrope;
  src: url("assets/manrope-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #080e1f;
  --surface: #142c59;
  --cobalt: #2958c8;
  --blue: #4f8fff;
  --link: #9fbeff;
  --text: #f4f7ff;
  --secondary: #b8cae4;
  --rule: #293852;
  --gutter: clamp(24px, 5.2vw, 80px);
  --shell: 1240px;
  --section-gap: clamp(1.5rem, 3.4vw, 2.6rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 880px 590px at 78% 210px, #172f60 0%, #0e1a36 53%, transparent 100%),
    var(--background);
  font-family: Manrope, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.68;
}

a { color: inherit; }

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 5px;
  border-radius: 2px;
}

img { display: block; max-width: 100%; }

h1, h2, h3, p, dl, dd, figure { margin: 0; }

h1, h2, h3 { text-wrap: balance; }

h2 {
  font-size: clamp(2rem, 3.7vw, 2.75rem);
  font-weight: 650;
  letter-spacing: -.043em;
  line-height: 1.12;
}

.shell {
  width: min(var(--shell), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  inset: .75rem auto auto .75rem;
  z-index: 5;
  padding: .55rem .9rem;
  background: var(--text);
  color: var(--background);
  transform: translateY(calc(-100% - 1rem));
}

.skip-link:focus { transform: none; }

.site-header {
  min-height: 56px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .75rem 2rem;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, #293d6d, #47629d 46%, #23324d) 1;
}

.site-name, .main-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  text-decoration: none;
}

.site-name {
  font-size: 1.0625rem;
  font-weight: 750;
  letter-spacing: -.028em;
}

.main-nav { display: flex; gap: clamp(1.125rem, 2.6vw, 2.4rem); }

.main-nav a {
  color: var(--secondary);
  font-size: .9375rem;
  font-weight: 650;
  text-underline-offset: .32em;
}

.main-nav a:hover, .main-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr);
  align-items: start;
  gap: clamp(1.5rem, 3.2vw, 3.4rem);
  padding-block: var(--section-gap) clamp(1.25rem, 2.15vw, 1.75rem);
}

.hero h1 {
  font-size: clamp(3.1rem, 5.2vw, 4.75rem);
  line-height: .99;
  letter-spacing: -.065em;
  font-weight: 650;
}

.hero h1 span { display: block; color: #a9c4fc; }

.hero-copy p {
  margin-top: 1.25rem;
  max-width: 42ch;
  color: var(--secondary);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
}

.hero-copy .availability {
  max-width: none;
  color: var(--text);
  font-size: 1rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.4rem;
}

.hero-links a {
  color: var(--link);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .28em;
}

.hero-links a:hover { color: var(--text); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hero-graph { min-width: 0; }

.graph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .15rem .8rem;
  margin-bottom: .4rem;
}

.graph-header h2 {
  font-size: clamp(1.03rem, 1.5vw, 1.26rem);
  font-weight: 750;
  letter-spacing: -.018em;
}

.graph-full-link {
  display: block;
  width: fit-content;
  margin-top: .65rem;
  color: var(--link);
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

.graph-full-link:hover { color: var(--text); }

.graph-controls { display: flex; align-items: center; gap: .3rem; }

.graph-controls button {
  position: relative;
  min-height: 44px;
  min-width: 40px;
  padding: .25rem .5rem;
  border: 0;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: .875rem;
  font-weight: 750;
  cursor: pointer;
}

.graph-controls button::before {
  content: "";
  position: absolute;
  inset: 5px 0;
  pointer-events: none;
}

.graph-controls button:hover { color: var(--text); text-decoration: underline; }
.graph-controls button:disabled { opacity: .55; cursor: default; text-decoration: none; }
.graph-controls button[aria-label] { font-size: 1.35rem; line-height: 1; }

.graph-canvas,
.graph-controls button::before,
.graph-picker select,
.project-media { border: 1px solid rgb(255 255 255 / .6); }

.graph-canvas {
  --graph-plot-height: clamp(300px, min(26vw, calc(100svh - 265px)), 378px);
  overflow: hidden;
  background-color: #101b33;
  background-image:
    linear-gradient(to right, rgb(114 152 210 / .07) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(114 152 210 / .07) 1px, transparent 1px);
  background-size: 25px 25px;
}

.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .9rem;
  padding: .45rem .7rem 0;
  color: var(--secondary);
  font-size: .8125rem;
  line-height: 1.35;
}

.graph-legend > span { display: inline-flex; align-items: center; gap: .35rem; }
.graph-key { width: .64rem; height: .64rem; flex: none; }
.graph-key--incident { border-radius: 50%; border: 1.5px solid #b8cae4; }
.graph-key--factor { background: #a1b9fc; }

.graph-svg, .graph-fallback { display: block; width: 100%; height: var(--graph-plot-height); }
.graph-canvas [hidden], .graph-detail-links[hidden], .graph-photo-link[hidden] { display: none; }
.graph-fallback { object-fit: contain; }
.graph-svg { cursor: grab; touch-action: pan-y; user-select: none; }
.graph-svg.is-dragging, .graph-svg.is-dragging .graph-node { cursor: grabbing; }

.graph-svg:focus-visible, .graph-controls button:focus-visible, .graph-picker select:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: -2px;
}

.graph-edge {
  fill: none;
  stroke: #859fc8;
  stroke-width: 1.1;
  opacity: .51;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.graph-edge.is-active { stroke: #a9cdff; stroke-width: 2; opacity: 1; }
.graph-edge.is-muted { opacity: .14; }
.graph-node { cursor: pointer; outline: none; }
.graph-node.is-dimmed { opacity: .64; }
.graph-node:is(:hover, :focus-visible) { opacity: 1; }
.graph-node-hit { fill: transparent; }
.graph-incident-ring { fill: #142543; stroke: #819bca; stroke-width: 2; }
.graph-factor-shape { fill: #a1b9fc; stroke: #e3ebff; stroke-width: 1; }
.graph-factor-center { fill: #1a2945; }
.graph-node[data-category="environment"] .graph-factor-shape { fill: #7bcddd; }
.graph-node[data-category="human"] .graph-factor-shape { fill: #e9ab9f; }

.graph-node:is(.is-selected, :hover, :focus-visible) :is(.graph-incident-ring, .graph-factor-shape) {
  stroke: #f4f7ff;
  stroke-width: 4;
}

.graph-node-label {
  fill: #e5efff;
  stroke: #111b31;
  stroke-width: 5.5;
  paint-order: stroke;
  font-size: 17px;
  font-weight: 700;
  pointer-events: none;
}

.graph-node--factor .graph-node-label { font-weight: 800; }

.graph-interface {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(145px, .38fr);
  align-items: start;
  gap: .45rem 1.25rem;
  margin-top: .75rem;
}

.graph-detail { min-height: 3.75rem; }
.graph-detail h3 { font-size: .9375rem; line-height: 1.4; }
.graph-detail-description { color: var(--secondary); font-size: .875rem; line-height: 1.5; margin-top: .23rem; }

.graph-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem 1rem;
  margin-top: .22rem;
  font-size: .8125rem;
}

.graph-detail-links a {
  color: var(--link);
  text-underline-offset: .2em;
  font-weight: 700;
}

.graph-picker select {
  width: 100%;
  min-height: 44px;
  padding: .2rem .4rem;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .875rem;
  text-overflow: ellipsis;
}

.graph-picker select:enabled { cursor: pointer; }
.graph-picker option, .graph-picker optgroup { background: #101b33; }

.work, .about { scroll-margin-top: 1.5rem; }

.work > .shell, .about {
  padding-top: var(--section-gap);
  border-top: 1px solid var(--rule);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3rem 2rem;
  margin-top: clamp(1.5rem, 3.4vw, 2.65rem);
}

.project {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.project-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface);
}

.project-destination {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 1rem;
  background: rgb(8 14 31 / .77);
  color: #fff;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  transition: opacity 210ms ease-out;
}

.project-media:focus-visible .project-destination { opacity: 1; }
.project-media:focus-visible { border-radius: 0; }

@media (hover: hover) and (pointer: fine) {
  .project-media:hover .project-destination { opacity: 1; }
}

@media (hover: none), (pointer: coarse), (max-width: 760px) {
  .project-destination {
    inset: auto 0 0;
    justify-items: start;
    padding: .9rem .75rem .55rem;
    background: linear-gradient(transparent, rgb(8 14 31 / .96));
    opacity: 1;
    font-size: .875rem;
    text-align: left;
  }

  .media--coin .project-destination, .media--piano .project-destination {
    inset: 0 0 auto;
    padding: .55rem .75rem .9rem;
    background: linear-gradient(rgb(8 14 31 / .96), transparent);
  }
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-media.media--scan { background: #000; }
.project-media.media--casentra { background: #e9eef5; }
.media--casentra img { object-fit: contain; }
.media--scan img { object-fit: contain; }
.media--coin img { object-position: center 72%; }
.media--piano img { object-position: center bottom; }

.project h3 {
  margin-top: 1.25rem;
  font-size: clamp(1.375rem, 2.15vw, 1.625rem);
  line-height: 1.22;
  font-weight: 750;
  letter-spacing: -.035em;
}

.project-subtitle {
  margin-top: .2rem;
  color: var(--link);
  font-size: .9375rem;
  font-weight: 650;
}

.project-summary {
  margin-top: .65rem;
  max-width: 54ch;
  color: var(--text);
  font-size: clamp(1rem, 1.45vw, 1.0625rem);
}

.project-stack, .image-caption {
  margin-top: .68rem;
  color: var(--secondary);
  font-size: .875rem;
  line-height: 1.55;
}

.project-stack strong { color: var(--text); }

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .55rem;
  color: var(--link);
  font-weight: 750;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .27em;
}

.icon-link:hover { color: var(--text); }

.about {
  margin-top: var(--section-gap);
  padding-bottom: clamp(1.8rem, 4vw, 3.15rem);
}

.about p {
  margin-top: .75rem;
  color: var(--secondary);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
}
.legacy-route { padding-block: 2rem; }
.legacy-route a { color: var(--link); text-underline-offset: .2em; }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  padding-block: .9rem;
  border-top: 1px solid var(--rule);
  color: var(--secondary);
}

.footer-links { display: flex; flex-wrap: wrap; gap: .15rem clamp(1rem, 3vw, 1.6rem); }
.site-footer small { font-size: .875rem; }

@media (max-width: 950px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-copy p { max-width: 46ch; }
  .graph-canvas { --graph-plot-height: clamp(320px, 55vw, 410px); }
}

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(ellipse 520px 520px at 72% 190px, #142b56 0%, #0c152c 69%, transparent 100%),
      var(--background);
  }

  .hero { gap: 1.35rem; }
  .hero h1 { font-size: clamp(2.75rem, 9vw, 3.75rem); }
  .hero-copy p { margin-top: 1.05rem; }
  .graph-canvas { --graph-plot-height: clamp(280px, 89vw, 354px); }
  .graph-header { gap: .35rem .3rem; }
  .graph-header h2 { font-size: .97rem; }
  .graph-controls button { min-width: 34px; padding-inline: .24rem; }
  .graph-interface { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .graph-detail { min-height: 0; }
  .graph-picker { grid-row: 1; }
  .graph-picker select { font-size: 1rem; }
  .graph-node--incident .graph-node-label { opacity: 0; }
  .graph-node--incident:is(.is-selected, :hover, :focus-visible) .graph-node-label { opacity: 1; }
  .graph-node-label { font-size: 22px; }
  .project-grid { grid-template-columns: minmax(0, 1fr); gap: 2.6rem; }
  .project h3 { margin-top: .85rem; }
}

@media (max-width: 420px) {
  .site-header { gap: .25rem .85rem; min-height: 52px; }
  .main-nav { gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .project-destination { transition: none; }
}
