:root {
  --black: #000;
  --white: #fff;
  --text: rgba(255, 255, 255, 0.86);
  --secondary: #aaa;
  --muted: rgba(255, 255, 255, 0.6);
  --quiet: rgba(255, 255, 255, 0.4);
  --faint: rgba(255, 255, 255, 0.22);
  --hairline: rgba(255, 255, 255, 0.12);
  --strong: rgba(255, 255, 255, 0.88);
  --hover: rgba(255, 255, 255, 0.7);
  --underline: rgba(255, 255, 255, 0.45);
  --signal-rgb: 255, 255, 255;
  --accent-rgb: 215, 240, 75;
  --shell: 37.8rem;
  --article: 45rem;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="light"] {
  color-scheme: light;
  --black: #f2f4f5;
  --white: #13171a;
  --text: rgba(19, 23, 26, 0.84);
  --secondary: #5f686f;
  --muted: rgba(19, 23, 26, 0.62);
  --quiet: rgba(19, 23, 26, 0.46);
  --faint: rgba(19, 23, 26, 0.24);
  --hairline: rgba(19, 23, 26, 0.14);
  --strong: rgba(19, 23, 26, 0.9);
  --hover: rgba(19, 23, 26, 0.74);
  --underline: rgba(19, 23, 26, 0.45);
  --signal-rgb: 19, 23, 26;
  --accent-rgb: 77, 92, 0;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  margin: 0;
  min-width: 20rem;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--black);
  color: var(--white);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}

::selection {
  background: var(--white);
  color: var(--black);
}

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

button {
  color: inherit;
  font: inherit;
}

:focus-visible {
  outline: 1px solid var(--white);
  outline-offset: 5px;
}

.shell,
.article-shell {
  width: calc(100% - 3rem);
  margin-inline: auto;
}

.shell {
  max-width: var(--shell);
}

.article-shell {
  max-width: var(--article);
}

.site-header {
  display: flex;
  min-height: 3.125rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 4.2rem;
  margin-bottom: 2.1rem;
  letter-spacing: 0.02em;
}

.primary-nav,
.social-nav,
.filters {
  display: flex;
  align-items: center;
}

.primary-nav {
  gap: 1.5rem;
}

.social-nav {
  gap: 1rem;
}

.pixel {
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 400;
  letter-spacing: 0.0125em;
}

.wordmark {
  font-size: 1.5rem;
  line-height: 1.4;
  opacity: 0.9;
  transition: opacity 150ms var(--ease);
}

.wordmark:hover {
  opacity: 1;
}

.nav-link {
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1.55;
  transition: color 150ms var(--ease), opacity 150ms var(--ease);
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--white);
}

.social-link {
  display: grid;
  width: 1.1rem;
  height: 1.1rem;
  place-items: center;
  color: var(--strong);
  font-family: "Geist Mono", monospace;
  font-size: 0.72rem;
  line-height: 1;
  opacity: 0.9;
  transition: opacity 150ms var(--ease), transform 150ms var(--ease);
}

.social-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.theme-toggle {
  display: grid;
  width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--strong);
  cursor: pointer;
  line-height: 1;
  opacity: 0.9;
  transition: color 150ms var(--ease), opacity 150ms var(--ease), transform 180ms var(--ease);
}

.theme-toggle:hover {
  opacity: 1;
  transform: rotate(8deg);
}

.theme-glyph {
  font-family: "Geist Mono", monospace;
  font-size: 1rem;
}

.theme-glyph--dark,
html[data-theme="light"] .theme-glyph--light {
  display: none;
}

html[data-theme="light"] .theme-glyph--dark {
  display: inline;
}

.intro-copy {
  max-width: 55ch;
  color: var(--text);
  line-height: 1.625;
  letter-spacing: 0.03em;
}

.intro-copy p {
  margin: 0 0 1.575rem;
}

.intro-copy p:last-child {
  margin-bottom: 0;
}

.inline-link {
  color: var(--strong);
  padding-inline: 0.12rem;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.22em;
  transition: color 150ms var(--ease), text-decoration-color 150ms var(--ease);
}

.inline-link:hover {
  color: var(--white);
  text-decoration-color: var(--underline);
}

.mark {
  display: inline-grid;
  width: 0.9rem;
  height: 0.9rem;
  place-items: center;
  margin-right: 0.25rem;
  color: var(--secondary);
  font-family: "Geist Mono", monospace;
  font-size: 0.65rem;
  vertical-align: 0.04rem;
}

.signal {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 1;
  margin-top: 3rem;
  overflow: hidden;
}

.signal::before,
.signal::after {
  position: absolute;
  z-index: 2;
  inset-block: 0;
  width: 13%;
  content: "";
  pointer-events: none;
}

.signal::before {
  left: 0;
  background: linear-gradient(90deg, var(--black), transparent);
}

.signal::after {
  right: 0;
  background: linear-gradient(-90deg, var(--black), transparent);
}

#signal-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.work-section {
  scroll-margin-top: 2.5rem;
  padding-top: 9rem;
  padding-bottom: 7rem;
}

.work-history {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0 0 2rem;
}

.work-history[hidden] {
  display: none;
}

.history-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.125rem;
  color: var(--white);
  opacity: 0.7;
  transition: opacity 150ms var(--ease);
}

.history-row:hover {
  opacity: 1;
}

.history-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.55rem;
}

.history-glyph {
  width: 1rem;
  color: var(--secondary);
  font-family: "Geist Mono", monospace;
  text-align: center;
}

.history-year {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.filters {
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 2rem;
}

.filter {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--quiet);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.45;
  transition: color 150ms var(--ease);
}

.filter:hover {
  color: var(--hover);
}

.filter[aria-pressed="true"] {
  color: var(--white);
}

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

.project-card {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 1.64 / 1;
  overflow: hidden;
  background: #080808;
  isolation: isolate;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}

.project-card[hidden] {
  display: none;
}

.project-card::after {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 55%;
  background: linear-gradient(to top, #000 5%, rgba(0, 0, 0, 0.78) 45%, transparent);
  content: "";
  pointer-events: none;
}

.project-art {
  position: absolute;
  inset: 0;
  opacity: 0.68;
  filter: saturate(0.55);
  transform: scale(1.01);
  transition: opacity 300ms var(--ease), filter 300ms var(--ease), transform 500ms var(--ease);
}

.project-card:hover .project-art,
.project-card:focus-visible .project-art {
  opacity: 1;
  filter: saturate(1);
  transform: scale(1.025);
}

.art-one {
  background:
    radial-gradient(circle at 27% 45%, rgba(210, 235, 82, 0.35), transparent 17%),
    repeating-linear-gradient(90deg, transparent 0 29px, rgba(210, 235, 82, 0.1) 30px),
    repeating-linear-gradient(0deg, transparent 0 29px, rgba(210, 235, 82, 0.08) 30px),
    #050604;
}

.art-two {
  background:
    linear-gradient(150deg, transparent 20%, rgba(255, 255, 255, 0.08) 20.5% 21%, transparent 21.5%),
    linear-gradient(30deg, transparent 35%, rgba(120, 145, 255, 0.2) 35.5% 36%, transparent 36.5%),
    radial-gradient(circle at 72% 38%, rgba(91, 110, 206, 0.35), transparent 25%),
    #04050a;
}

.art-three {
  background:
    repeating-radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.11) 0 1px, transparent 1.5px 12px),
    radial-gradient(circle at 50% 60%, rgba(255, 117, 65, 0.28), transparent 34%),
    #090402;
}

.art-four {
  background:
    linear-gradient(120deg, transparent 48%, rgba(255, 255, 255, 0.13) 49% 50%, transparent 51%),
    linear-gradient(60deg, transparent 48%, rgba(255, 255, 255, 0.09) 49% 50%, transparent 51%),
    radial-gradient(circle at 50% 50%, rgba(157, 98, 255, 0.27), transparent 32%),
    #050309;
  background-size: auto, auto, auto, auto;
}

.art-five {
  background:
    linear-gradient(90deg, rgba(5, 18, 16, 0.4), rgba(12, 80, 61, 0.3)),
    repeating-linear-gradient(0deg, transparent 0 14px, rgba(88, 255, 194, 0.06) 15px),
    #020706;
}

.art-six {
  background:
    radial-gradient(ellipse at 72% 65%, rgba(255, 255, 255, 0.12), transparent 7%),
    radial-gradient(ellipse at 53% 47%, rgba(255, 255, 255, 0.1), transparent 8%),
    radial-gradient(ellipse at 34% 58%, rgba(255, 255, 255, 0.08), transparent 6%),
    linear-gradient(135deg, #070707, #010101);
}

.project-meta {
  position: absolute;
  z-index: 3;
  inset: auto 1rem 0.9rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.project-title,
.project-year {
  margin: 0;
  line-height: 1.3;
  font-weight: 500;
}

.project-title {
  color: rgba(255, 255, 255, 0.8);
}

.project-year {
  color: rgba(255, 255, 255, 0.58);
  font-variant-numeric: tabular-nums;
}

.arrow {
  display: inline-block;
  font-family: "Geist Mono", monospace;
  font-size: 0.82em;
  transition: transform 180ms var(--ease);
}

.project-card:hover .arrow {
  transform: translate(2px, -2px);
}

.empty-state {
  display: none;
  padding: 3rem 0;
  color: var(--muted);
}

.empty-state[data-visible="true"] {
  display: block;
}

.case-study {
  position: relative;
  scroll-margin-top: 2rem;
  padding: 1.2rem 0 8rem;
}

.case-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3rem;
  color: var(--secondary);
}

.back-link,
.case-links a {
  transition: color 150ms var(--ease);
}

.back-link:hover,
.case-links a:hover {
  color: var(--white);
}

.case-links {
  display: flex;
  gap: 1.25rem;
}

.case-title {
  margin: 0;
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  text-align: center;
}

.case-date {
  margin: 1rem 0 4rem;
  color: var(--secondary);
  letter-spacing: 0.025em;
  text-align: center;
}

.case-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4rem;
  margin-bottom: 5rem;
}

.case-summary h2,
.article h2,
.article h3 {
  color: var(--white);
}

.case-summary h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 500;
}

.case-summary p {
  margin: 0;
  color: var(--secondary);
  line-height: 1.625;
}

.article {
  color: var(--secondary);
  font-size: 1rem;
  line-height: 1.65;
}

.article > p:first-child {
  margin-top: 0;
  font-size: 1.08rem;
}

.article h2 {
  margin: 5rem 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.35;
}

.article h3 {
  margin: 3.5rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 500;
}

.article p {
  margin: 0.6rem 0 0;
}

.diagram {
  position: relative;
  display: grid;
  min-height: 19rem;
  place-items: center;
  margin: 3.5rem 0 1rem;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb), 0.1), transparent 37%);
  background-size: 2.4rem 2.4rem, 2.4rem 2.4rem, auto;
}

.diagram-core {
  position: relative;
  z-index: 1;
  display: grid;
  width: 8rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  color: rgba(var(--accent-rgb), 0.9);
  font-family: "Geist Mono", monospace;
  font-size: 0.85rem;
}

.diagram-core::before,
.diagram-core::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 20rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.4), transparent);
  content: "";
  transform: translate(-50%, -50%);
}

.diagram-core::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.contact {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 7rem 0 3rem;
  border-top: 1px solid var(--hairline);
}

.contact-label {
  margin: 0 0 0.45rem;
  color: var(--muted);
}

.contact-link {
  font-size: clamp(1.4rem, 4vw, 2.3rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.contact-link .arrow {
  color: var(--muted);
}

.contact-link:hover .arrow {
  color: var(--white);
  transform: translate(3px, -3px);
}

.copyright {
  margin: 0;
  color: var(--quiet);
  font-size: 0.875rem;
  white-space: nowrap;
}

.reveal {
  opacity: 0;
  transform: translateY(0.8rem);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 47.99rem) {
  .site-header {
    padding-top: 4.2rem;
  }

  .social-nav {
    gap: 0.85rem;
  }

  .work-section {
    padding-top: 7.5rem;
  }

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

  .case-summary {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
  }

  .case-kicker {
    align-items: flex-start;
    gap: 1rem;
  }

  .case-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem 1rem;
  }

  .contact {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 25rem) {
  .primary-nav {
    gap: 1rem;
  }

  .wordmark {
    font-size: 1.25rem;
  }

  .nav-link {
    font-size: 1rem;
  }

  .social-nav {
    gap: 0.55rem;
  }

  .case-links {
    max-width: 8rem;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
