/* Project sub-page styles. Layered on top of the main styles.css token
   system; only adds page-shape rules that the home page doesn't need. */

.subpage .site-header.subpage-header {
  position: sticky;
  top: 0;
  z-index: 70;
  border-bottom: 1px solid var(--line-soft);
}

.subpage-header .brand-copy small {
  color: var(--text-muted);
}

.breadcrumb {
  margin: 0 0 var(--space-3);
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--line-strong);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--line-strong);
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--text-primary);
  border-bottom-color: var(--brand-primary);
}

.subpage-hero {
  padding: 3.4rem 0 1.5rem;
}

.subpage-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0 0 0.85rem;
  font-weight: 900;
  /* Balance wrapped lines so the last line isn't a stranded short word.
     Chrome 114+ / Safari 17.5+ / FF 121+ honour this. */
  text-wrap: balance;
}

.subpage-lede {
  max-width: 42rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
  /* Pretty wrapping for body copy avoids orphan words on the last line.
     Less aggressive than balance — preserves natural paragraph rhythm. */
  text-wrap: pretty;
}

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

@media (min-width: 48rem) {
  .project-grid--gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 72rem) {
  .project-grid--gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
  }
}

.project-card-link {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: inherit;
  text-decoration: none;
  outline: 0;
}

.project-card-link strong {
  color: var(--text-primary);
  font-size: 1.18rem;
  letter-spacing: -0.012em;
  font-weight: 800;
}

.project-card-link p {
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.project-card-cta {
  margin-top: 0.6rem;
  color: var(--brand-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-card-cta.is-disabled {
  color: var(--text-muted);
  border: 1px dashed var(--line-soft);
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  align-self: flex-start;
  font-size: 0.7rem;
}

.project-card--placeholder {
  opacity: 0.65;
}

.project-card--placeholder:hover {
  transform: none;
}

.project-card .project-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-m);
}

.project-card:focus-within {
  border-color: color-mix(in srgb, var(--brand-primary) 60%, var(--line-soft));
}

@supports not (background: color-mix(in srgb, red, blue)) {
  .project-card:focus-within {
    border-color: var(--brand-primary);
  }
}

/* ── Single project page layout ── */
.project-page-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
  padding: 1rem 0 4rem;
}

.project-page-main h2 {
  font-size: 1.6rem;
  letter-spacing: -0.018em;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

.project-page-main h2:first-of-type {
  margin-top: 0;
}

.project-page-main p {
  color: var(--text-primary);
  line-height: 1.7;
  margin: 0 0 0.85rem;
  max-width: 42rem;
}

.project-page-main ul,
.project-page-main ol {
  margin: 0 0 0.85rem 1.1rem;
  color: var(--text-primary);
  line-height: 1.7;
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-radius: var(--radius-m);
  overflow: hidden;
  margin: 1.5rem 0 2rem;
}

.project-facts dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

.project-facts dd {
  margin: 0.35rem 0 0;
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.35;
}

.project-facts > div {
  padding: 0.9rem 1rem 1rem;
  background: var(--surface-ink);
}

.project-toc {
  position: sticky;
  top: calc(var(--anchor-offset) - 1rem);
  align-self: start;
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-m);
  background: var(--surface-panel);
}

.project-toc h2 {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
  font-weight: 700;
}

.project-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.project-toc a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.4;
  display: block;
  padding: 0.15rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.6rem;
}

.project-toc a:hover,
.project-toc a:focus-visible {
  color: var(--text-primary);
  border-left-color: var(--brand-primary);
}

@media (min-width: 60rem) {
  .project-page-main {
    grid-template-columns: minmax(15rem, 0.25fr) minmax(0, 0.75fr);
    gap: var(--space-10);
  }
  .project-page-main > .project-content {
    order: 2;
  }
  .project-page-main > .project-toc {
    order: 1;
  }
}

.project-resources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-3);
  margin: 1rem 0 2rem;
}

.project-resource {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-s);
  background: var(--surface-ink);
  color: inherit;
  text-decoration: none;
  transition: border-color 180ms ease;
}

.project-resource:hover,
.project-resource:focus-visible {
  border-color: var(--brand-primary);
}

.project-resource small {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.project-resource strong {
  color: var(--text-primary);
  font-weight: 700;
}

.other-projects-heading {
  font-size: 1.4rem;
  margin: 0 0 1rem;
}
