/*
  Simple layout for p5.js sketch projects (layouts/p5-project.njk) — title,
  subject/year, the interactive sketch itself, and a short write-up. Reuses the
  site's own tokens/fonts but doesn't try to match any Figma reference; these
  pages are intentionally plain, per direct request.
*/
.p5-project {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(96px, 10vw, 160px) 20px clamp(64px, 8vw, 120px);
  text-align: center;
}

.p5-project__title {
  color: var(--color-white);
  font-family: var(--font-bold);
  font-size: clamp(32px, 4vw, 56px);
  margin: 0 0 24px;
}

.p5-project__meta {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 4vw, 48px);
  margin: 0 0 48px;
}

.p5-project__meta dt {
  color: var(--color-bg-fog);
  font-family: var(--font-regular);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
}

.p5-project__meta dd {
  color: var(--color-white);
  font-family: var(--font-medium);
  font-size: 18px;
  margin: 0;
}

.p5-project__sketch-section {
  margin: 0 0 48px;
}

.p5-project__sketch {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
}

.p5-project__sketch canvas {
  display: block;
  width: 100%;
  height: auto;
}

/*
  Opt-in variant (frontmatter `fullbleedSketch: true`) for sketches built around
  createCanvas(windowWidth, windowHeight) instead of a fixed size — e.g. Aves de
  Chile. Breaks the sketch out of .p5-project's centered 900px column edge-to-edge
  (the calc(50% - 50vw) trick works regardless of the ancestor's own width, as
  long as it's centered) instead of scaling a fixed-aspect canvas into a capped
  box like the rest of this file does.
*/
.p5-project__sketch-section--fullbleed {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.p5-project__sketch--fullbleed {
  max-width: none;
  width: 80vw;
  height: 80vh;
  margin: 0 auto;
  border-radius: 0;
}

.p5-project__sketch--fullbleed canvas {
  width: 100% !important;
  height: 100% !important;
}

/* The hint inherits the fullbleed section's 100vw width otherwise — keep it a
   normal readable paragraph width, centered, regardless of the sketch below it. */
.p5-project__sketch-section--fullbleed .p5-project__hint {
  max-width: 50vw;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 50px;
}

.p5-project__hint {
  color: var(--color-bg-fog);
  font-family: var(--font-regular);
  font-size: 14px;
  font-style: italic;
  margin: 0 0 16px;
}

.p5-project__description {
  color: var(--color-white);
  font-family: var(--font-regular);
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.6;
  margin: 0 auto;
  max-width: 640px;
}

.p5-project__code {
  margin: 48px 0 0;
  text-align: left;
}

.p5-project__code-title {
  color: var(--color-white);
  font-family: var(--font-bold);
  font-size: clamp(20px, 2vw, 28px);
  margin: 0 0 16px;
}

.p5-project__code-subtitle {
  color: var(--color-bg-fog);
  font-family: var(--font-medium);
  font-size: 16px;
  margin: 24px 0 8px;
}

.p5-project__code-subtitle:first-of-type {
  margin-top: 0;
}

.p5-project__code-block {
  background-color: #101717;
  border-radius: 12px;
  padding: 24px;
  overflow-x: auto;
  max-height: 600px;
  overflow-y: auto;
}

.p5-project__code-block code {
  display: block;
  color: var(--color-bg-fog);
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
}
