.site-nav [aria-current="page"], .mobile-nav [aria-current="page"] {
  text-decoration: underline .11em;
}

.project-cover {
  position: relative;
  isolation: isolate;
  padding-block: clamp(1.2rem, 2.5vw, 2.4rem) clamp(1.75rem, 4vw, 3.8rem);
  border-bottom: var(--line);
  background: color-mix(in srgb, var(--project) var(--tint), var(--surface));
}

.project-cover::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(var(--pattern) .75px, transparent .85px) 0 0 / 9px 9px;
  mask-image: linear-gradient(112deg, transparent 36%, black 92%);
  pointer-events: none;
  content: "";
}

.project-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .65rem;
  font-size: .875rem;
}

.project-breadcrumbs a, .project-text-link, .reference-link {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .22em;
}

.project-breadcrumbs a:hover, .project-text-link:hover, .reference-link:hover {
  text-decoration-thickness: .15em;
}

.project-cover-inner {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(1.8rem, 5vw, 5.5rem);
  padding-block: clamp(2rem, 4.8vw, 5rem);
}

.project-cover h1 {
  max-width: 15ch;
  font-size: clamp(2.85rem, 5.55vw, 6.7rem);
  line-height: .94;
  letter-spacing: -.082em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
[data-theme="dark"] .project-cover h1 { color: var(--project); }

.project-intro {
  max-width: 36ch;
  margin-top: clamp(.85rem, 2vw, 1.55rem);
  font-size: clamp(1rem, 1.5vw, 1.27rem);
  line-height: 1.42;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .85rem 1.4rem;
  margin-top: clamp(1.15rem, 2.5vw, 1.85rem);
}

.project-cover-frame {
  margin: 0 .52rem .52rem 0;
  padding: clamp(.32rem, .72vw, .64rem);
  border: var(--line);
  border-radius: 1.28rem;
  background: var(--surface);
  box-shadow: .52rem .52rem 0 var(--shadow);
}

.project-cover-image {
  display: block;
  width: 100%;
  aspect-ratio: 1.5;
  border: var(--line);
  border-radius: .86rem;
  background: var(--project);
  object-fit: cover;
  object-position: var(--cover-crop, 50% 50%);
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.5rem, 1.25vw, 1rem);
  margin: 0;
}

.project-facts-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.project-facts > div {
  min-width: 0;
  padding: .62rem clamp(.65rem, 1.6vw, 1.25rem);
  border: var(--line);
  border-radius: .65rem;
  background: var(--surface);
}

.project-facts dd {
  margin: .05rem 0 0;
  font-size: clamp(.875rem, 1.28vw, 1.08rem);
  font-weight: 700;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(15rem, 1fr);
  align-items: start;
  gap: clamp(2.1rem, 6vw, 7.5rem);
  padding-block: clamp(2.5rem, 6vw, 6.15rem);
}

.project-story { min-width: 0; }

.project-story > section + section {
  margin-top: clamp(2.25rem, 4.7vw, 4.6rem);
  padding-top: clamp(1.65rem, 3.5vw, 3.15rem);
  border-top: var(--line);
}

.project-story h2, .project-next-title {
  font: clamp(2.45rem, 4.1vw, 4.35rem)/.94 var(--serif);
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.project-story .chapter {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .65rem;
  font-size: .78rem;
}

.project-story .chapter .spark { color: var(--blue); }

.project-story p {
  max-width: 68ch;
  margin-top: .85rem;
  font-size: clamp(1rem, 1.27vw, 1.1rem);
}

.project-cover-category { margin-bottom: .7rem; }

.project-secret { padding-block: clamp(2rem, 5vw, 4.5rem); }

.project-secret-file {
  max-width: 54rem;
  padding: clamp(1.25rem, 4vw, 3rem);
  border: var(--line);
  border-radius: 1.05rem;
  background: color-mix(in srgb, var(--project) var(--tint-soft), var(--surface));
  box-shadow: .4rem .4rem 0 var(--shadow);
}

.project-secret-file .project-secret-stamp {
  display: inline-flex;
  margin-bottom: .95rem;
  padding: .3rem .55rem;
  border: 1px dashed currentColor;
  border-radius: .3rem;
  background: var(--surface);
}

.project-story ul {
  margin-block: 1rem 0;
  padding-left: 1.35rem;
}

.project-story li + li { margin-top: .38rem; }
.project-story li::marker { color: var(--blue); }

.tech-table {
  width: 100%;
  table-layout: fixed;
  margin-top: 1.15rem;
  border-spacing: 0;
  border: var(--line);
  border-radius: .8rem;
  overflow: hidden;
  background: var(--surface);
  line-height: 1.4;
}

.tech-table :is(th, td) {
  padding: .7rem clamp(.63rem, 1.5vw, 1.15rem);
  vertical-align: top;
  text-align: start;
  overflow-wrap: anywhere;
}

.tech-table th {
  width: 34%;
  border-right: var(--line);
  background: color-mix(in srgb, var(--project) var(--tint-soft), var(--surface));
}

.tech-table tr + tr :is(th, td) { border-top: var(--line); }

.status-note {
  margin-top: 1rem;
  padding: .86rem 1rem;
  border: var(--line);
  border-radius: .65rem;
  background: color-mix(in srgb, var(--lemon) var(--tint), var(--surface));
}
[data-theme="dark"] .status-note strong { color: var(--lemon); }

.status-note p { margin-top: .25rem; font-size: 1rem; }

.project-story details { margin-top: 1rem; }
.project-story summary { cursor: pointer; font-weight: 700; }

.code-card {
  margin-top: 1.15rem;
  border: var(--line);
  border-radius: .8rem;
  background: var(--code-surface);
  color: var(--code-text);
}

.code-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
  padding: .45rem .65rem .45rem .9rem;
  border-bottom: var(--line);
  border-radius: .67rem .67rem 0 0;
  background: color-mix(in srgb, var(--lilac) var(--tint), var(--surface));
  color: var(--ink);
  font-weight: 700;
}

.copy-code {
  min-height: 2.75rem;
  padding: .25rem .65rem;
  border: var(--line);
  border-radius: .5rem;
  background: var(--field);
  font-size: .875rem;
  font-weight: 700;
}

.copy-code:hover { background: var(--lemon); color: var(--accent-ink); }

.code-card pre {
  margin: 0;
  max-height: 28rem;
  padding: 1rem;
  overflow: auto;
  border-radius: 0 0 .67rem .67rem;
  font-size: .875rem;
  tab-size: 2;
}

.code-card pre:focus-visible { outline-color: var(--code-text); outline-offset: -5px; }

.file-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: .7rem;
  margin-top: .75rem;
  padding: .85rem;
  border: var(--line);
  border-radius: .75rem;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.file-row:first-of-type { margin-top: 1.2rem; }
.file-row:hover { background: color-mix(in srgb, var(--project) var(--tint-hover), var(--surface)); }
.file-row strong, .file-row small, .file-row code { display: block; }
.file-row small, .file-row code, .file-size { margin-top: .2rem; font-size: .8125rem; }
.file-row code { color: var(--muted); }
.file-size { white-space: nowrap; }

.file-row + .download-warning { margin-top: .55rem; }

.file-symbol, .project-next-arrow {
  display: grid;
  place-items: center;
  width: 2.35rem;
  aspect-ratio: 1;
  border: var(--line);
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}
.file-symbol { background: var(--project); color: var(--accent-ink); }

.demo-link { margin-top: 1rem; }

.project-guide {
  position: sticky;
  top: 6.5rem;
  padding: clamp(1rem, 2.4vw, 1.9rem);
  border: var(--line);
  border-radius: 1.05rem;
  background: color-mix(in srgb, var(--project) var(--tint-soft), var(--surface));
  box-shadow: 5px 5px 0 var(--shadow);
}

.project-guide h2 {
  margin-bottom: .6rem;
  font: clamp(1.9rem, 3vw, 2.85rem)/1 var(--serif);
  letter-spacing: -.03em;
}

.project-guide nav { display: grid; }

.project-guide nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .55rem;
  min-height: 2.75rem;
  padding-block: .54rem;
  border-block-start: 1px solid var(--stroke);
  font-weight: 700;
  line-height: 1.25;
}

.project-guide nav a:last-child { border-block-end: 1px solid var(--stroke); }
.project-guide nav a:hover { text-decoration: underline; text-underline-offset: .22em; }
.project-guide .button { margin-top: .9rem; }
.download-footnote { margin-top: .8rem; font-size: .875rem; }

.project-next { margin-bottom: clamp(2.8rem, 6.5vw, 6.25rem); }

.project-next-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .62fr) auto;
  align-items: center;
  gap: clamp(.8rem, 2vw, 1.9rem);
  padding: clamp(.8rem, 2vw, 1.75rem);
  border: var(--line);
  border-radius: 1.05rem;
  border-color: color-mix(in srgb, var(--next-color) var(--tint-edge), var(--stroke));
  background: color-mix(in srgb, var(--next-color) var(--tint), var(--surface));
  box-shadow: 5px 5px 0 var(--shadow);
  transition: transform .24s cubic-bezier(.2, .75, .25, 1.4), box-shadow .24s ease;
}

.project-next-card img {
  display: block;
  width: 100%;
  max-height: 12.5rem;
  aspect-ratio: 1.8;
  border: var(--line);
  border-radius: .75rem;
  object-fit: cover;
}

.project-next-title { display: block; margin-top: .28rem; }

.project-next-arrow {
  width: clamp(2.4rem, 4.15vw, 3.75rem);
  background: var(--surface);
  transition: color .22s, background-color .22s;
}

.project-next-card:is(:hover, :focus-visible) .project-next-arrow {
  color: var(--selected-text);
  background: var(--selected);
}

.project-footer { border-top: var(--line); }
.project-footer .project-text-link { font-size: .9rem; }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .project-next-card:hover {
    transform: translateY(-4px) rotate(-.4deg);
    box-shadow: 8px 9px 0 var(--shadow);
  }
}

@media (max-width: 54rem) {
  .project-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-facts-compact > :last-child { grid-column: 1 / -1; }
  .project-layout { grid-template-columns: minmax(0, 1fr); }
  .project-guide { position: static; }
}

@media (max-width: 39.999rem) {
  .project-cover-inner { grid-template-columns: minmax(0, 1fr); }
  .project-cover h1 { font-size: clamp(2.85rem, 10.8vw, 4.3rem); }
  .project-next-card { grid-template-columns: minmax(0, 1fr) auto; }
  .project-next-card img { grid-column: 1 / -1; grid-row: 1; }
  .project-next-title { font-size: clamp(2rem, 8.1vw, 3.4rem); }
  .project-next-arrow { grid-column: 2; }
  .file-row { grid-template-columns: auto minmax(0, 1fr); }
  .file-size { grid-column: 2; }
}
