:root {
  --bg: #e3d8c3;
  --panel: #d3c6ac;
  --paper: #efe5d1;
  --ink: #211d18;
  --muted: rgba(33, 29, 24, 0.68);
  --quiet: rgba(33, 29, 24, 0.42);
  --line: rgba(33, 29, 24, 0.18);
  --red: #d21f2b;
  --red-deep: #8f171d;
  --black: #11100e;
  --maple-soft: rgba(210, 31, 43, 0.14);
  --mono:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  --serif: Georgia, "Times New Roman", serif;
  --pad: clamp(1rem, 4vw, 2.2rem);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

.signal-mark {
  left: 0;
  opacity: 0.55;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: clamp(5.8rem, 10vw, 7.8rem);
  z-index: 0;
}

.signal-mark svg {
  display: block;
  height: clamp(2.4rem, 5vw, 3.6rem);
  overflow: visible;
  width: 100%;
}

.signal-mark path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.thread-main {
  animation: signal-drift 22s ease-in-out infinite;
  opacity: 0.28;
  stroke: var(--red);
  stroke-dasharray: 430 18 72 24 130 18;
  stroke-dashoffset: 0;
  stroke-width: 1.2;
}

.thread-shadow {
  animation: thread-shadow-drift 22s ease-in-out infinite;
  opacity: 0.08;
  stroke: var(--ink);
  stroke-dasharray: 180 34;
  stroke-dashoffset: 36;
  stroke-width: 0.7;
}

.thread-weave {
  opacity: 0.08;
  stroke: var(--red);
  stroke-width: 0.65;
}

.thread-weave-a {
  animation: thread-weave-a-drift 26s ease-in-out infinite;
  stroke-dasharray: 140 42 32 58;
}

.thread-weave-b {
  animation: thread-weave-b-drift 30s ease-in-out infinite;
  opacity: 0.06;
  stroke-dasharray: 96 52 210 46;
}

.thread-points {
  animation: thread-points-drift 22s ease-in-out infinite;
  fill: var(--red);
  opacity: 0.16;
}

.thread-points circle {
  animation: thread-point-pulse 5.8s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.thread-points circle:nth-child(2) {
  animation-delay: 1.4s;
}

.thread-points circle:nth-child(3) {
  animation-delay: 2.8s;
}

.thread-points circle:nth-child(4) {
  animation-delay: 3.6s;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--red);
}

::selection {
  background: var(--red);
  color: var(--paper);
}

.skip-link {
  background: var(--ink);
  color: var(--bg);
  left: 0.75rem;
  padding: 0.45rem 0.6rem;
  position: absolute;
  top: 0.75rem;
  transform: translateY(-150%);
  z-index: 20;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.page-shell,
.site-footer {
  margin: 0 auto;
  max-width: 720px;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.site-header {
  align-items: baseline;
  border-bottom: 1px solid rgba(33, 29, 24, 0.08);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding-top: 1.45rem;
  position: relative;
  z-index: 2;
}

.mark,
.site-nav,
.eyebrow,
.project-number,
figcaption,
.intro-note,
.site-footer {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mark {
  color: var(--ink);
}

.mark::before {
  color: var(--red);
  content: "// ";
}

.site-nav {
  display: flex;
  gap: clamp(0.8rem, 3vw, 2rem);
}

.page-shell {
  padding-top: clamp(2.4rem, 6vw, 3.8rem);
  position: relative;
  z-index: 1;
}

.intro {
  display: grid;
  gap: 0.42rem;
  padding-bottom: clamp(2.2rem, 6vw, 3.6rem);
}

.eyebrow {
  color: var(--red-deep);
  margin: 0;
}

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

h1 {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.4vw, 1.65rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
  max-width: 18rem;
}

h1::after {
  background: var(--red);
  content: "";
  display: block;
  height: 1px;
  margin-top: 0.85rem;
  width: min(7rem, 38vw);
}

.intro-note {
  color: var(--quiet);
  margin: 0;
}

.project {
  border-top: 1px dotted var(--line);
  display: grid;
  gap: 0.75rem;
  padding: clamp(1.25rem, 3vw, 2rem) 0;
}

.project-heading {
  align-items: baseline;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto;
}

.project-number,
figcaption {
  color: var(--quiet);
  margin: 0;
}

.project-number {
  color: var(--red);
}

h2 {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
}

.gallery-notes {
  display: grid;
  gap: 0.55rem;
  justify-items: start;
}

.gallery-label {
  color: var(--quiet);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  line-height: 1.2;
  margin: 0;
  text-transform: uppercase;
}

.thumb-grid {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.thumb {
  background: rgba(239, 229, 209, 0.36);
  border: 1px solid rgba(33, 29, 24, 0.14);
  margin: 0;
  padding: 0.28rem;
}

.thumb a {
  display: block;
}

.thumb img,
.thumb canvas {
  height: auto;
  object-fit: contain;
  width: 100%;
}

.thumb img {
  filter: saturate(0.82) contrast(0.94) sepia(0.06);
}

.thumb-main {
  width: min(100%, 320px);
}

.thumb-small {
  width: min(34vw, 120px);
}

.thumb-canvas {
  background: transparent;
  border: 0;
  padding: 0;
  width: 88px;
}

.thumb-canvas canvas {
  background: var(--black);
  border: 1px solid rgba(33, 29, 24, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 0.28rem rgba(210, 31, 43, 0.1);
}

.project-waveform .project-heading a {
  color: var(--red-deep);
  width: max-content;
}

.site-footer {
  border-top: 1px dotted var(--line);
  color: var(--quiet);
  display: flex;
  justify-content: space-between;
  padding-bottom: 2rem;
  padding-top: 1rem;
}

.site-footer p {
  margin: 0;
}

:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 0.25rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .signal-mark path,
  .thread-points,
  .thread-points circle {
    animation: none;
  }
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-heading {
    grid-template-columns: 2rem minmax(0, 1fr);
  }

  .project-heading a {
    grid-column: 2;
  }

  .thumb-grid {
    gap: 0.55rem;
  }

  .thumb-main {
    width: min(100%, 300px);
  }

  .thumb-small {
    width: min(38vw, 112px);
  }
}

@media (max-width: 440px) {
  body {
    font-size: 12px;
  }

  h1 {
    font-size: clamp(1.2rem, 8vw, 1.55rem);
  }

  h2 {
    font-size: clamp(1.05rem, 6vw, 1.3rem);
  }
}

@keyframes signal-drift {
  0% {
    d: path("M-20 92 C 120 96, 170 82, 260 88 S 410 116, 520 88 S 680 64, 790 94 S 970 122, 1220 78");
    opacity: 0.34;
    stroke-dashoffset: 0;
    transform: translate3d(-0.35rem, 0, 0);
  }

  38% {
    d: path("M-20 96 C 110 86, 180 108, 275 90 S 420 76, 530 98 S 686 118, 804 88 S 980 70, 1220 94");
    opacity: 0.48;
    stroke-dashoffset: -38;
    transform: translate3d(0.25rem, 0.16rem, 0);
  }

  64% {
    d: path("M-20 86 C 98 104, 178 78, 262 96 S 408 126, 522 92 S 668 70, 786 86 S 974 112, 1220 82");
    opacity: 0.38;
    stroke-dashoffset: -74;
    transform: translate3d(0.08rem, -0.12rem, 0);
  }

  100% {
    d: path("M-20 92 C 120 96, 170 82, 260 88 S 410 116, 520 88 S 680 64, 790 94 S 970 122, 1220 78");
    opacity: 0.34;
    stroke-dashoffset: -112;
    transform: translate3d(-0.35rem, 0, 0);
  }
}

@keyframes thread-shadow-drift {
  0% {
    d: path("M-20 100 C 120 104, 170 90, 260 96 S 410 124, 520 96 S 680 72, 790 102 S 970 130, 1220 86");
    stroke-dashoffset: 36;
    transform: translate3d(-0.18rem, 0.12rem, 0);
  }

  50% {
    d: path("M-20 104 C 108 94, 184 116, 278 98 S 424 84, 536 106 S 690 126, 810 96 S 984 78, 1220 102");
    stroke-dashoffset: -26;
    transform: translate3d(0.2rem, 0.25rem, 0);
  }

  100% {
    d: path("M-20 100 C 120 104, 170 90, 260 96 S 410 124, 520 96 S 680 72, 790 102 S 970 130, 1220 86");
    stroke-dashoffset: -88;
    transform: translate3d(-0.18rem, 0.12rem, 0);
  }
}

@keyframes thread-weave-a-drift {
  0% {
    d: path("M-20 82 C 118 78, 190 94, 286 86 S 432 70, 542 88 S 690 108, 816 84 S 986 74, 1220 96");
    stroke-dashoffset: 0;
    transform: translate3d(-0.12rem, -0.08rem, 0);
  }

  48% {
    d: path("M-20 78 C 116 96, 196 74, 292 90 S 438 112, 548 84 S 698 70, 820 96 S 988 116, 1220 84");
    stroke-dashoffset: -62;
    transform: translate3d(0.24rem, 0.08rem, 0);
  }

  100% {
    d: path("M-20 82 C 118 78, 190 94, 286 86 S 432 70, 542 88 S 690 108, 816 84 S 986 74, 1220 96");
    stroke-dashoffset: -124;
    transform: translate3d(-0.12rem, -0.08rem, 0);
  }
}

@keyframes thread-weave-b-drift {
  0% {
    d: path("M-20 110 C 126 116, 188 98, 284 106 S 426 132, 540 104 S 696 82, 814 112 S 986 138, 1220 98");
    stroke-dashoffset: 36;
    transform: translate3d(0.12rem, 0.18rem, 0);
  }

  52% {
    d: path("M-20 114 C 116 96, 190 120, 286 104 S 430 84, 544 110 S 696 132, 816 102 S 990 86, 1220 112");
    stroke-dashoffset: -48;
    transform: translate3d(-0.24rem, 0, 0);
  }

  100% {
    d: path("M-20 110 C 126 116, 188 98, 284 106 S 426 132, 540 104 S 696 82, 814 112 S 986 138, 1220 98");
    stroke-dashoffset: -132;
    transform: translate3d(0.12rem, 0.18rem, 0);
  }
}

@keyframes thread-points-drift {
  0%,
  100% {
    transform: translate3d(-0.16rem, 0, 0);
  }

  50% {
    transform: translate3d(0.16rem, 0.12rem, 0);
  }
}

@keyframes thread-point-pulse {
  0%,
  100% {
    opacity: 0.18;
    transform: scale(0.75);
  }

  45% {
    opacity: 0.45;
    transform: scale(1);
  }
}
