:root {
  --bg: #080808;
  --panel: rgba(20, 20, 21, .82);
  --text: #f4f4f4;
  --muted: #a3a3a3;
  --subtle: #6f6f73;
  --line: rgba(255, 255, 255, .11);
  --line-strong: rgba(255, 255, 255, .20);
  --white: #fff;
  --radius: 4px;
  --max: 1180px;
  --header-height: 82px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 10%, rgba(255, 255, 255, .045), transparent 28rem),
    linear-gradient(180deg, #080808 0%, #0a0a0b 46%, #080808 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

::selection {
  color: #000;
  background: #fff;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 36rem;
  height: 36rem;
  border: 1px solid rgba(255, 255, 255, .035);
  border-radius: 50%;
  pointer-events: none;
}

.ambient-one {
  top: -20rem;
  right: -12rem;
}

.ambient-two {
  bottom: -27rem;
  left: -18rem;
  width: 46rem;
  height: 46rem;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 max(24px, calc((100vw - var(--max))/2));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 8, .82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: .72rem;
  letter-spacing: .12em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: .92rem;
  letter-spacing: .02em;
}

.brand-text small {
  margin-top: .2rem;
  color: var(--subtle);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: .2rem;
}

.nav-link {
  position: relative;
  padding: .75rem .8rem;
  color: var(--muted);
  font-size: .78rem;
  text-decoration: none;
  transition: color .2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: .8rem;
  right: .8rem;
  bottom: .48rem;
  height: 1px;
  background: var(--white);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .25s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--white);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
}

.menu-button span {
  display: block;
  width: 17px;
  height: 1px;
  margin: 5px auto;
  background: var(--white);
}

.hero {
  min-height: calc(100vh - var(--header-height));
  max-width: var(--max);
  margin: 0 auto;
  padding: 7rem 24px 5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
  align-items: center;
  gap: 5rem;
}

.eyebrow {
  margin: 0 0 1.3rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.hero h1,
.project-hero h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(3.25rem, 7vw, 6.6rem);
  line-height: .98;
  letter-spacing: -.065em;
  font-weight: 600;
}

.hero h1 span {
  color: #8d8d91;
}

.hero-intro {
  max-width: 680px;
  margin: 2rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.hero-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 2.4rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.3rem;
  min-width: 180px;
  padding: .86rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: .82rem;
  transition: transform .2s ease, background .2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #090909;
  background: #f5f5f5;
}

.button-primary:hover {
  background: #fff;
}

.button-secondary {
  background: transparent;
}

.button-secondary:hover {
  background: rgba(255, 255, 255, .055);
}

.hero-visual {
  display: grid;
  place-items: center;
  min-height: 400px;
}

.orbital {
  position: relative;
  display: grid;
  place-items: center;
  width: min(30vw, 360px);
  aspect-ratio: 1;
}

.orbit {
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
}

.orbit-a {
  animation: orbit 18s linear infinite;
}

.orbit-b {
  inset: 26%;
  border-style: dashed;
  animation: orbitReverse 12s linear infinite;
}

.orbit::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
}

.core {
  display: grid;
  place-items: center;
  width: 34%;
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, .035);
  font-size: .76rem;
  letter-spacing: .28em;
}

.datum {
  position: absolute;
  padding: .32rem .45rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #0a0a0a;
  font-size: .62rem;
  letter-spacing: .15em;
}

.datum-a {
  top: 8%;
  right: 15%;
}

.datum-b {
  bottom: 18%;
  left: 4%;
}

.datum-c {
  right: 0;
  bottom: 30%;
}

.content-shell {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.home-content {
  padding: 7rem 0 9rem;
  border-top: 1px solid var(--line);
}

.home-markdown>h1:first-of-type {
  margin: 0 0 2.5rem;
  font-size: clamp(2.2rem, 5vw, 4.5rem);
}

.home-markdown>h2 {
  margin: 4rem 0 1rem;
  padding: 1.3rem 0 0;
  border-top: 1px solid var(--line);
}

.project-title-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
}

.project-title-link span {
  color: var(--subtle);
  transition: transform .2s ease, color .2s ease;
}

.project-title-link:hover span {
  color: #fff;
  transform: translate(3px, -3px);
}

.project-hero {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 5.5rem 0 4.5rem;
  border-bottom: 1px solid var(--line);
}

.back-link {
  display: inline-block;
  margin-bottom: 4rem;
  color: var(--muted);
  font-size: .78rem;
  text-decoration: none;
}

.back-link:hover {
  color: #fff;
}

.project-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
}

.project-hero h1 {
  max-width: 850px;
  font-size: clamp(3rem, 7vw, 6.2rem);
}

.status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: #d0d0d0;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aaa;
}

.status-done::before {
  background: #e8e8e8;
  box-shadow: 0 0 12px rgba(255, 255, 255, .55);
}

.status-progress::before {
  animation: pulse 1.8s ease-in-out infinite;
  background: #cfcfcf;
}

.status-paused::before {
  background: #777;
}

.scroll-hint {
  margin-top: 4rem;
  color: var(--subtle);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.project-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 760px);
  justify-content: space-between;
  gap: 5rem;
  padding: 5.5rem 0 8rem;
}

.toc {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  align-self: start;
  max-height: calc(100vh - var(--header-height) - 4rem);

  overflow: hidden;
}

.toc > p {
  margin: 0 0 1rem;
  color: var(--subtle);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.toc a {
  display: block;
  box-sizing: border-box;
  width: 100%;

  padding: .36rem 0 .36rem 0;

  color: #777;
  font-size: .72rem;
  line-height: 1.45;
  text-decoration: none;

  transition:
    color .2s ease,
    padding-left .2s ease;
}

.toc a:hover,
.toc a.active {
  color: #fff;
  padding-left: 6px;
}

.markdown-body {
  color: var(--muted);
  font-size: 1rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -.035em;
  scroll-margin-top: calc(var(--header-height) + 2rem);
}

.markdown-body h1 {
  margin: 0 0 2rem;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
}

.markdown-body h2 {
  margin: 5rem 0 1.4rem;
  font-size: clamp(1.75rem, 3vw, 2.65rem);
}

.markdown-body h3 {
  margin: 3rem 0 1rem;
  font-size: 1.35rem;
}

.markdown-body p {
  margin: 0 0 1.35rem;
}

.markdown-body strong {
  color: #e6e6e6;
  font-weight: 600;
}

.markdown-body em {
  color: #888;
}

.markdown-body hr {
  height: 1px;
  margin: 4.5rem 0;
  border: 0;
  background: var(--line);
}

.markdown-body ul,
.markdown-body ol {
  margin: 1.25rem 0 2rem;
  padding-left: 1.15rem;
}

.markdown-body li {
  margin: .45rem 0;
  padding-left: .35rem;
}

.markdown-body li::marker {
  color: #777;
}

.markdown-body a:not(.project-title-link) {
  color: #f1f1f1;
  text-underline-offset: .2em;
  text-decoration-color: #555;
}

.markdown-body table {
  display: table;
  width: 100%;
  margin: 2rem 0 3rem;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .018);
  font-size: .88rem;
}

.markdown-body th,
.markdown-body td {
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  text-align: left;
}

.markdown-body th {
  color: #eee;
  background: rgba(255, 255, 255, .035);
  font-weight: 500;
}

.media-frame {
  position: relative;
  min-height: 260px;
  margin: 2.2rem 0 .8rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 255, 255, .04), transparent), #101011;
}

.media-frame img {
  display: block;
  width: 100%;
  max-height: 720px;
  object-fit: cover;
}

.image-placeholder {
  display: none;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: .45rem;
  padding: 2rem;
  color: var(--subtle);
  text-align: center;
  background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 28px 28px;
}

.image-placeholder strong {
  color: #bbb;
  font-size: .82rem;
  font-weight: 500;
}

.image-placeholder small {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: .68rem;
}

.placeholder-icon {
  font-size: 2rem;
  color: #555;
}

.media-frame.image-missing .image-placeholder {
  display: grid;
}

.next-project {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto 7rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}

.next-project>p {
  color: var(--subtle);
  font-size: .67rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.next-links a {
  display: flex;
  justify-content: space-between;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font-size: 1.25rem;
}

.next-links a span {
  color: var(--subtle);
  transition: transform .2s ease;
}

.next-links a:hover span {
  transform: translate(3px, -3px);
}

.site-footer {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  color: #5e5e62;
  border-top: 1px solid var(--line);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .75, .25, 1);
}

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

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes orbitReverse {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: .55;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, .15);
  }

  50% {
    opacity: 1;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0);
  }
}

@media (max-width:920px) {
  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    display: none;
    padding: 1rem 24px 1.5rem;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 8, 8, .97);
  }

  .main-nav.open {
    display: flex;
  }

  .nav-link {
    padding: .8rem 0;
  }

  .nav-link::after {
    left: 0;
    right: 0;
  }

  .menu-button {
    display: block;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding-top: 5rem;
  }

  .hero-visual {
    min-height: 300px;
  }

  .orbital {
    width: min(70vw, 330px);
  }

  .project-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .toc {
    position: static;
    display: none;
  }
}

@media (max-width:640px) {
  :root {
    --header-height: 70px;
  }

  .site-header {
    padding-inline: 18px;
  }

  .brand-text small {
    display: none;
  }

  .hero,
  .content-shell,
  .project-hero,
  .next-project,
  .site-footer {
    width: auto;
    margin-left: 18px;
    margin-right: 18px;
  }

  .hero {
    padding-inline: 0;
    min-height: auto;
  }

  .hero h1 {
    font-size: clamp(2.9rem, 15vw, 4.4rem);
  }

  .hero-visual {
    min-height: 260px;
  }

  .home-content {
    padding-top: 5rem;
  }

  .project-hero {
    padding-top: 4rem;
  }

  .back-link {
    margin-bottom: 2.5rem;
  }

  .project-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 1.5rem;
  }

  .project-layout {
    padding-top: 3.8rem;
  }

  .markdown-body h2 {
    margin-top: 4rem;
  }

  .markdown-body table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .site-footer {
    flex-direction: column;
    gap: .5rem;
  }
}

@media (prefers-reduced-motion:reduce) {

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

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