/* Project feature system
   Media-led project stories that keep the F1 race as the portfolio's main event. */

.playfolio-page.project-page {
  --project-accent: var(--pf-accent-2);
  --project-accent-text: color-mix(in srgb, var(--project-accent) 54%, var(--pf-ink));
  --project-panel: color-mix(in srgb, var(--pf-surface) 68%, var(--pf-bg));
  --project-panel-strong: color-mix(in srgb, var(--pf-surface) 82%, var(--pf-bg));
  --project-measure: 64ch;
  --project-mono: var(--pf-mono, ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace);
  min-height: 100vh;
  background: var(--pf-bg) !important;
  color: var(--pf-ink);
}

.project-page.project-page--algorithms { --project-accent: #7c5cff; }
.project-page.project-page--budget { --project-accent: #26966f; }
.project-page.project-page--clipclop { --project-accent: #3b82f6; }
.project-page.project-page--contextkey { --project-accent: #4d8fe8; }
.project-page.project-page--dream2detect { --project-accent: #159782; }
.project-page.project-page--drsorriso { --project-accent: #e76f2e; }
.project-page.project-page--evolve { --project-accent: #9a5bd4; }
.project-page.project-page--gengame { --project-accent: #e85d75; }
.project-page.project-page--holo { --project-accent: #159eb3; }
.project-page.project-page--noir { --project-accent: #d2a91e; }
.project-page.project-page--noty { --project-accent: #d98b15; }
.project-page.project-page--paddockjs { --project-accent: #7c66cf; }
.project-page.project-page--remainder { --project-accent: #d85c9f; }
.project-page.project-page--victoria { --project-accent: #3977d4; }
.project-page.project-page--vigil { --project-accent: #8d63cf; }
.project-page.project-page--unity { --project-accent: #4f7cff; }
.project-page.project-page--mattyflow { --project-accent: #2f9d73; }
.project-page.project-page--mosaic { --project-accent: #e56d2f; }
.project-page.project-page--databases-ie { --project-accent: #c88a1b; }
.project-page.project-page--ghoststroke { --project-accent: #9b8a73; }

.project-page code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.project-page :not(pre) > code {
  padding: 0.14em 0.34em;
  border-radius: 4px;
  background: var(--project-panel-strong);
  color: var(--pf-ink);
}

.project-page [hidden] {
  display: none !important;
}

.project-skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2200;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: var(--pf-ink);
  color: var(--pf-bg) !important;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(calc(-100% - 1rem));
  transition: transform 160ms ease;
}

.project-skip-link:focus {
  transform: translateY(0);
}

.project-reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 2050;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}

.project-reading-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--project-accent);
  transform: scaleX(var(--project-read-progress, 0));
  transform-origin: left center;
  transition: transform 90ms linear;
}

/* Route containment */
.playfolio-page.project-page main > section.py-5 {
  margin: 0;
  padding: clamp(1rem, 3vw, 2.5rem) 0 clamp(3.5rem, 7vw, 6.5rem) !important;
}

.playfolio-page.project-page main > section > .container {
  width: min(var(--pf-max), calc(100% - (var(--pf-pad) * 2)));
  max-width: none;
  margin-inline: auto;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.project-shell {
  display: grid;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.project-shell > * {
  min-width: 0;
  margin: 0;
}

.project-shell > section {
  padding-block: 0;
}

/* First viewport: story on the left, proof on the right. */
.project-intro-stage {
  display: grid;
  grid-template-columns: minmax(18rem, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
  min-height: 0;
  padding: clamp(1rem, 2.5vw, 2rem) 0 clamp(2.5rem, 5vw, 4rem);
}

.project-intro-stage > .project-hero {
  container-type: inline-size;
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--pf-ink);
}

.project-intro-stage > .project-hero::before,
.project-intro-stage > .project-hero::after {
  display: none !important;
}

.project-eyebrow,
.project-hero .project-section-eyebrow,
.project-section-eyebrow {
  margin: 0 0 0.8rem;
  color: var(--project-accent-text) !important;
  font-family: var(--project-mono);
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  line-height: 1.35;
  text-transform: uppercase !important;
}

.project-hero h1,
.project-title {
  max-width: 100%;
  margin: 0 0 1.2rem;
  color: var(--pf-ink) !important;
  font-size: clamp(2.35rem, 11.8cqi, 4.75rem);
  font-weight: 850;
  letter-spacing: -0.06em;
  line-height: 1.02;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.project-hero .lead {
  max-width: 72ch;
  margin: 0 0 1.4rem;
  color: var(--pf-muted) !important;
  font-size: clamp(1rem, 1.45vw, 1.18rem);
  line-height: 1.56;
  text-wrap: pretty;
}

.project-pills,
.project-tags,
.project-stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin: 0;
  padding: 0;
}

.project-pill,
.project-tag,
.project-stack-list li,
.tech-badge {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: var(--pf-muted) !important;
  font-family: var(--project-mono);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.025em;
  line-height: 1.3;
  list-style: none;
}

.project-pills > :not(:last-child)::after,
.project-tags > :not(:last-child)::after,
.project-stack-list > :not(:last-child)::after {
  content: "/";
  margin-left: 0.45rem;
  color: var(--project-accent-text);
  opacity: 0.72;
}

.project-intro-panel {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: clamp(0.9rem, 1.7vw, 1.35rem) !important;
  align-self: start;
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.project-intro-panel.project-media-panel--without-media {
  align-content: start;
}

.project-intro-stage:has(.project-media-panel--without-media) {
  align-items: start;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.6vw, 1.35rem);
  margin: 0;
  padding: 1rem 0 0;
  border: 0;
  border-top: 1px solid var(--pf-line);
  border-radius: 0;
  background: transparent;
}

.hero-meta-card {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.hero-meta-card .label,
.metric-label,
.flow-index {
  color: var(--pf-muted) !important;
  font-family: var(--project-mono);
  font-size: 0.62rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.055em !important;
  line-height: 1.35;
  text-transform: uppercase !important;
}

.hero-meta-card .value {
  margin: 0;
  color: var(--pf-ink) !important;
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.35;
  text-wrap: pretty;
}

.project-intro-stage--solo {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.project-intro-stage--solo > .project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(17rem, 0.65fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
}

.project-intro-stage--solo .hero-meta {
  align-self: end;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Proof media */
.project-media-stage,
.project-media-panel > .ratio,
.project-video-frame,
.video-container {
  position: relative;
  width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 0 !important;
  border-radius: 10px !important;
  background: var(--project-panel-strong) !important;
  box-shadow: none !important;
}

.project-media-stage iframe,
.project-media-stage video,
.project-media-stage img,
.project-media-panel > .ratio > iframe,
.project-video-frame iframe,
.video-container iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
  object-fit: contain;
}

.project-media-stage--noty {
  aspect-ratio: 4 / 3;
}

.project-media-stage--noty img {
  inset: 10%;
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.project-media-stage--app-icon {
  aspect-ratio: 4 / 3;
}

.project-media-stage--app-icon img {
  inset: 9%;
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.project-media-stage--image {
  cursor: zoom-in;
}

.project-media-stage--image img {
  --project-media-x: 0px;
  --project-media-y: 0px;
  transform: translate3d(var(--project-media-x), var(--project-media-y), 0) scale(1);
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1), filter 180ms ease;
}

.project-media-stage--image:hover img,
.project-media-stage--image:focus-visible img {
  filter: saturate(1.04) contrast(1.02);
  transform: translate3d(var(--project-media-x), var(--project-media-y), 0) scale(1.01);
}

.project-media-stage--image:focus-visible {
  outline: 2px solid var(--project-accent-text);
  outline-offset: 3px;
}

/* Compact summary and real actions */
.project-sidecard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.project-sidecard > h2,
.project-sidecard > h3,
.project-sidecard > p {
  grid-column: 1;
}

.project-sidecard > .sidecard-highlight,
.project-sidecard > .sidecard-links,
.project-sidecard > .sidecard-footnote {
  grid-column: 1;
}

.project-sidecard h2,
.project-sidecard h3 {
  max-width: 34ch;
  margin: 0;
  color: var(--pf-ink) !important;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem);
  font-weight: 830;
  letter-spacing: -0.045em;
  line-height: 1.03;
  text-wrap: balance;
}

.project-sidecard p,
.sidecard-highlight li,
.sidecard-footnote {
  color: var(--pf-muted) !important;
  font-size: 0.92rem;
  line-height: 1.58;
  text-wrap: pretty;
}

.project-sidecard p,
.sidecard-footnote {
  margin: 0;
}

.sidecard-highlight {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.sidecard-highlight li {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidecard-highlight i {
  display: none;
}

.sidecard-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
}

.sidecard-links a,
.project-back-link,
.back-button {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.68rem 0.82rem !important;
  border: 1px solid color-mix(in srgb, var(--project-accent) 65%, var(--pf-line-strong)) !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: var(--pf-ink) !important;
  font-family: var(--project-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
  touch-action: manipulation;
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.sidecard-links a:hover,
.project-back-link:hover,
.back-button:hover {
  background: color-mix(in srgb, var(--project-accent) 12%, transparent) !important;
  transform: translateX(3px);
}

.sidecard-links a i,
.project-back-link i,
.back-button i {
  transition: transform 160ms ease;
}

.sidecard-links a:hover i,
.project-back-link:hover i,
.back-button:hover i {
  transform: translateX(2px);
}

.sidecard-links a:focus-visible,
.project-back-link:focus-visible,
.back-button:focus-visible,
.gallery-card:focus-visible,
.gallery-item:focus-visible,
.image-modal-close:focus-visible {
  outline: 2px solid var(--project-accent-text);
  outline-offset: 3px;
}

/* Evidence sections */
.playfolio-page.project-page .project-shell > .project-section {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
  align-items: start;
  padding: clamp(2.5rem, 3.5vw, 3.75rem) 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.project-section-header {
  grid-column: 1 / span 4;
  align-self: start;
  margin: 0;
}

.project-section-header::before {
  display: none !important;
}

.project-section-header h2 {
  max-width: 100%;
  margin: 0;
  color: var(--pf-ink) !important;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  font-weight: 835;
  letter-spacing: -0.052em;
  line-height: 0.98;
  text-wrap: balance;
}

.project-section > :not(.project-section-header) {
  min-width: 0;
  grid-column: 5 / -1;
}

/* Sections whose payload is a multi-item grid or scroller claim the full width:
   heading on top, content below — so nothing is crammed into 8 columns. */
.playfolio-page.project-page .project-shell > .project-section:has(> .project-keypoints, > .project-insight-grid, > .project-module-grid, > .project-data-strip, > .project-flow-steps, > .project-timeline, > .project-gallery, > .project-severity-ladder, > .project-status-list) {
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.35rem, 2.4vw, 2rem);
}

.playfolio-page.project-page .project-shell > .project-section:has(> .project-keypoints, > .project-insight-grid, > .project-module-grid, > .project-data-strip, > .project-flow-steps, > .project-timeline, > .project-gallery, > .project-severity-ladder, > .project-status-list) > .project-section-header,
.playfolio-page.project-page .project-shell > .project-section:has(> .project-keypoints, > .project-insight-grid, > .project-module-grid, > .project-data-strip, > .project-flow-steps, > .project-timeline, > .project-gallery, > .project-severity-ladder, > .project-status-list) > :not(.project-section-header) {
  grid-column: 1 / -1;
}

/* A full-width heading can breathe wider than the cramped 14ch sidebar version. */
.playfolio-page.project-page .project-shell > .project-section:has(> .project-keypoints, > .project-insight-grid, > .project-module-grid, > .project-data-strip, > .project-flow-steps, > .project-timeline, > .project-gallery, > .project-severity-ladder, > .project-status-list) > .project-section-header h2 {
  max-width: 100%;
}

.project-copy,
.project-section > p,
.project-insight-card p,
.project-insight-card ul,
.project-keypoints p,
.project-module p,
.project-flow-step > div p,
.flow-body p,
.metric-copy,
.gallery-card figcaption,
.gallery-item figcaption,
.project-timeline-content p {
  color: var(--pf-muted) !important;
}

.project-copy,
.project-section > p {
  max-width: var(--project-measure);
  margin: 0;
  font-size: clamp(1rem, 1.45vw, 1.12rem);
  line-height: 1.72;
  text-wrap: pretty;
}

.project-keypoints,
.project-insight-grid,
.project-module-grid,
.project-data-strip,
.project-flow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.6vw, 2.25rem);
  margin: 0;
  padding: 1.4rem 0 0;
  border: 0;
  border-top: 1px solid var(--pf-line);
  border-radius: 0;
  background: transparent;
  overflow: visible;
  list-style: none;
}

.project-keypoints li,
.project-insight-card,
.project-module,
.project-data-strip li {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.project-keypoints li::before,
.project-insight-card::before,
.project-module::before {
  display: none !important;
}

.project-keypoints h3,
.project-keypoints h4,
.project-insight-card h3,
.project-insight-card h4,
.project-module h3,
.project-module h4,
.project-flow-step > div h3,
.flow-body h3,
.flow-body h5 {
  margin: 0;
  color: var(--pf-ink) !important;
  font-size: 1.08rem;
  font-weight: 820;
  line-height: 1.22;
  text-wrap: balance;
}

.project-keypoints p,
.project-insight-card p,
.project-module p,
.project-flow-step > div p,
.flow-body p,
.project-insight-card ul {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.58;
  text-wrap: pretty;
}

.project-insight-card ul {
  display: grid;
  gap: 0.4rem;
  padding-left: 1rem;
}

.project-flow {
  background: transparent !important;
}

.project-flow-steps {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-flow-step {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.75rem;
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.flow-index {
  align-self: start;
  color: var(--project-accent-text) !important;
  font-variant-numeric: tabular-nums;
}

.project-flow-step > div h3,
.flow-body h3,
.flow-body h5 {
  margin-bottom: 0.38rem;
}

.project-video-section .project-video-frame,
.project-video-section .video-container {
  grid-column: 5 / -1;
}

/* Metrics and research evidence */
.project-data-strip {
  font-variant-numeric: tabular-nums;
}

.project-data-strip .metric-value,
.metric-value {
  color: var(--project-accent-text) !important;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  font-weight: 850;
  letter-spacing: -0.05em;
  line-height: 1;
}

.metric-copy {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.52;
}

.project-section--severity {
  overflow: hidden;
}

.project-section--severity .project-section-header::after {
  content: "Drag or scroll the image run →";
  display: block;
  margin-top: 0.9rem;
  color: var(--pf-muted);
  font-family: var(--project-mono);
  font-size: 0.66rem;
  font-weight: 750;
  line-height: 1.4;
  text-transform: uppercase;
}

.project-severity-ladder {
  display: grid;
  grid-template-columns: repeat(10, minmax(8.5rem, 1fr));
  gap: 0.7rem;
  overflow-x: auto;
  padding: 0 0 0.7rem;
  background: transparent;
  scroll-snap-type: x proximity;
  scrollbar-color: var(--project-accent) transparent;
}

.project-severity-ladder:focus-visible {
  outline: 2px solid var(--project-accent-text);
  outline-offset: 3px;
}

.project-severity-ladder figure {
  min-width: 8.5rem;
  margin: 0;
  border-radius: 8px;
  background: var(--project-panel);
  overflow: hidden;
  scroll-snap-align: start;
}

.project-severity-ladder img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0;
  object-fit: cover;
}

.project-severity-ladder figcaption {
  padding: 0.55rem 0.65rem;
  color: var(--pf-muted);
  font-family: var(--project-mono);
  font-size: 0.64rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Image gallery becomes a genuine horizontal filmstrip. */
.project-gallery {
  display: flex;
  gap: 1rem;
  width: 100%;
  margin: 0;
  padding: 0 0 0.8rem;
  overflow-x: auto;
  background: transparent;
  list-style: none;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--project-accent) transparent;
}

.gallery-card,
.gallery-item {
  position: relative;
  display: grid;
  flex: 0 0 min(72%, 36rem);
  align-content: start;
  min-width: 0;
  margin: 0;
  padding: 0 !important;
  overflow: visible;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: zoom-in;
  scroll-snap-align: start;
}

.gallery-card img,
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  max-height: none;
  border-radius: 9px;
  object-fit: contain;
  background: var(--project-panel);
  transition: filter 180ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-card:hover img,
.gallery-item:hover img,
.gallery-card:focus-visible img,
.gallery-item:focus-visible img {
  filter: saturate(1.04) contrast(1.02);
  transform: scale(1.018);
}

.gallery-card figcaption,
.gallery-item figcaption {
  padding: 0.7rem 0.1rem 0;
  font-size: 0.78rem;
  line-height: 1.5;
}

/* One strong takeaway surface per page. */
.playfolio-page.project-page .project-shell > .project-spotlight {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
  margin: clamp(1.5rem, 3vw, 2.5rem) 0 !important;
  padding: clamp(2rem, 5vw, 4rem) !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: color-mix(in srgb, var(--project-accent) 15%, var(--project-panel)) !important;
  color: var(--pf-ink) !important;
}

.playfolio-page.project-page .project-shell > .project-spotlight > h2,
.playfolio-page.project-page .project-shell > .project-spotlight > h3 {
  grid-column: 1 / span 5;
  max-width: 100%;
  margin: 0;
  color: inherit !important;
  font-size: clamp(1.65rem, 3.1vw, 2.65rem);
  font-weight: 830;
  letter-spacing: -0.045em;
  line-height: 1.02;
  text-wrap: balance;
}

.playfolio-page.project-page .project-shell > .project-spotlight > p {
  grid-column: 6 / -1;
  max-width: var(--project-measure);
  margin: 0;
  color: var(--pf-muted) !important;
  font-size: 0.96rem;
  line-height: 1.68;
  text-wrap: pretty;
}

/* Timelines are grouped facts, not ornamental rails. */
.project-timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.6vw, 2.25rem);
  margin: 0;
  padding: 1.4rem 0 0;
  border-top: 1px solid var(--pf-line);
  border-radius: 0;
  background: transparent;
}

.project-timeline-item {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.project-timeline-marker {
  display: none;
}

.project-timeline-content {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.project-timeline-content h3,
.project-timeline-content h5 {
  margin: 0 0 0.38rem;
  color: var(--pf-ink);
  font-size: 1rem;
  font-weight: 820;
}

.project-timeline-content p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.58;
}

.sidecard-footnote code {
  color: var(--project-accent-text);
}

/* Plain-language status / roadmap list — readable sentences, not tag pills. */
.project-status-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem clamp(1.75rem, 3.5vw, 3rem);
  margin: 0;
  padding: 1.4rem 0 0;
  border-top: 1px solid var(--pf-line);
  border-radius: 0;
  background: transparent;
  list-style: none;
}

.project-status-list li {
  position: relative;
  margin: 0;
  padding: 0 0 0 1.15rem;
  color: var(--pf-muted) !important;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 450;
  letter-spacing: normal;
  line-height: 1.6;
  text-transform: none;
}

.project-status-list li::before {
  content: "";
  position: absolute;
  top: 0.66em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--project-accent);
}

.project-status-list li::after {
  content: none !important;
}

/* Return to the live race. */
.project-shell > .text-center {
  display: flex;
  justify-content: flex-end;
  padding: clamp(2.5rem, 5vw, 4rem) 0 0;
  text-align: left !important;
}

/* Accessible gallery and hero-media dialog. */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
}

.image-modal[hidden] {
  display: none;
}

.image-modal-close {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.56);
  color: #fff;
  font-size: 1.9rem;
  line-height: 1;
}

.image-modal-content {
  display: block;
  max-width: min(100%, 1180px);
  max-height: min(88vh, 820px);
  border-radius: 10px;
  object-fit: contain;
}

body:has(.image-modal:not([hidden])) > :not(.image-modal) {
  pointer-events: none;
  user-select: none;
}

/* Entrance hierarchy: one stage, then evidence blocks. */
.project-motion-ready .project-shell > .project-intro-stage,
.project-motion-ready .project-shell > .project-section,
.project-motion-ready .project-shell > .text-center {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 440ms ease, transform 440ms cubic-bezier(0.22, 1, 0.36, 1);
}

.project-motion-ready .project-shell > .is-project-visible {
  opacity: 1;
  transform: translateY(0);
}

.project-motion-ready .project-intro-stage > .project-hero,
.project-motion-ready .project-intro-stage > .project-media-panel {
  opacity: 0;
  transition: opacity 520ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.project-motion-ready .project-intro-stage > .project-hero {
  transform: translateX(-16px);
}

.project-motion-ready .project-intro-stage > .project-media-panel {
  transform: translateX(16px);
}

.project-motion-ready .project-intro-stage.is-project-visible > .project-hero,
.project-motion-ready .project-intro-stage.is-project-visible > .project-media-panel {
  opacity: 1;
  transform: translateX(0);
}

.project-motion-ready .project-intro-stage.is-project-visible > .project-media-panel {
  transition-delay: 80ms;
}

@media (max-width: 1100px) {
  .project-intro-stage {
    grid-template-columns: minmax(16rem, 0.76fr) minmax(0, 1.24fr);
    gap: clamp(2rem, 4vw, 3.5rem);
  }

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

  .project-sidecard > h2,
  .project-sidecard > h3,
  .project-sidecard > p,
  .project-sidecard > .sidecard-highlight,
  .project-sidecard > .sidecard-links,
  .project-sidecard > .sidecard-footnote {
    grid-column: 1;
  }
}

@media (max-width: 900px) {
  .project-intro-stage {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1.75rem, 5vw, 2.5rem);
    min-height: 0;
    padding: clamp(1rem, 4vw, 2rem) 0 clamp(3.5rem, 8vw, 5rem);
  }

  .project-intro-stage > .project-hero,
  .project-intro-stage > .project-media-panel {
    grid-column: 1;
  }

  .project-intro-stage--solo > .project-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .project-hero h1,
  .project-title {
    max-width: 100%;
    font-size: clamp(2.35rem, 11.8cqi, 4.75rem);
  }

  .hero-meta,
  .project-intro-stage--solo .hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .playfolio-page.project-page .project-shell > .project-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
    padding: clamp(2.4rem, 6vw, 3.5rem) 0 !important;
  }

  .project-section-header,
  .project-section > :not(.project-section-header),
  .project-video-section .project-video-frame,
  .project-video-section .video-container {
    grid-column: 1;
  }

  .project-section-header h2 {
    max-width: 100%;
  }

  .playfolio-page.project-page .project-shell > .project-spotlight > h2,
  .playfolio-page.project-page .project-shell > .project-spotlight > h3,
  .playfolio-page.project-page .project-shell > .project-spotlight > p {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .playfolio-page.project-page main > section.py-5 {
    padding-top: 0.75rem !important;
  }

  .project-intro-stage {
    gap: 1.5rem;
  }

  .project-hero h1,
  .project-title {
    margin-bottom: 1rem;
    font-size: clamp(2.1rem, 11.8cqi, 4rem);
  }

  .project-hero .lead {
    margin-bottom: 1.15rem;
    font-size: 0.96rem;
    line-height: 1.53;
  }

  .project-intro-panel {
    gap: 0.85rem !important;
  }

  .project-media-stage,
  .project-media-panel > .ratio {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .project-media-stage--noty {
    aspect-ratio: 1 / 1;
  }

  .project-media-stage--app-icon {
    aspect-ratio: 1 / 1;
  }

  .hero-meta {
    gap: 0.8rem 1rem;
    padding: 0.85rem 0 0;
  }

  .project-sidecard {
    gap: 0.85rem;
  }

  .project-keypoints,
  .project-insight-grid,
  .project-module-grid,
  .project-data-strip,
  .project-flow-steps,
  .project-timeline,
  .project-status-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-keypoints,
  .project-insight-grid,
  .project-module-grid,
  .project-data-strip,
  .project-flow-steps,
  .project-timeline,
  .project-status-list {
    padding: 1.15rem 0 0;
  }

  .sidecard-links {
    display: grid;
  }

  .sidecard-links a,
  .project-back-link,
  .back-button {
    min-height: 2.75rem;
  }

  .gallery-card,
  .gallery-item {
    flex-basis: 88%;
  }

  .playfolio-page.project-page .project-shell > .project-spotlight {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding: 1.5rem !important;
  }
}

/* Project accents and entry motion. */

/* Section + hero eyebrows get a short accent lead-in rule. */
.project-hero .project-section-eyebrow,
.project-section-header .project-section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.project-hero .project-section-eyebrow::before,
.project-section-header .project-section-eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  border-radius: 2px;
  background: var(--project-accent);
}

/* Insight sub-points get accent dots to match the status list. */
.project-insight-card ul {
  padding-left: 0;
  list-style: none;
}

.project-insight-card ul li {
  position: relative;
  padding-left: 1.05rem;
}

.project-insight-card ul li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--project-accent);
}

/* Flow step numbers carry each project accent. */
.flow-index {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid color-mix(in srgb, var(--project-accent) 55%, var(--pf-line-strong));
  border-radius: 50%;
  font-size: 0.66rem !important;
}

/* Spotlight edge picks up the accent to match its tinted fill. */
.playfolio-page.project-page .project-shell > .project-spotlight {
  border: 1px solid color-mix(in srgb, var(--project-accent) 32%, transparent) !important;
}

/* A short stagger introduces the content as its section appears. */
@media (prefers-reduced-motion: no-preference) {
  .project-motion-ready .is-project-visible .project-keypoints li,
  .project-motion-ready .is-project-visible .project-insight-card,
  .project-motion-ready .is-project-visible .project-module,
  .project-motion-ready .is-project-visible .project-data-strip li,
  .project-motion-ready .is-project-visible .project-flow-step,
  .project-motion-ready .is-project-visible .project-timeline-item {
    animation: project-child-rise 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .project-motion-ready .is-project-visible :is(.project-keypoints li, .project-insight-card, .project-module, .project-data-strip li, .project-flow-step, .project-timeline-item):nth-child(2) {
    animation-delay: 70ms;
  }

  .project-motion-ready .is-project-visible :is(.project-keypoints li, .project-insight-card, .project-module, .project-data-strip li, .project-flow-step, .project-timeline-item):nth-child(3) {
    animation-delay: 140ms;
  }

  .project-motion-ready .is-project-visible :is(.project-keypoints li, .project-insight-card, .project-module, .project-data-strip li, .project-flow-step, .project-timeline-item):nth-child(4) {
    animation-delay: 210ms;
  }

  .project-motion-ready .is-project-visible :is(.project-data-strip li, .project-module):nth-child(5),
  .project-motion-ready .is-project-visible :is(.project-data-strip li, .project-module):nth-child(6) {
    animation-delay: 280ms;
  }
}

@keyframes project-child-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-reading-progress {
    display: none;
  }

  .project-skip-link,
  .sidecard-links a,
  .sidecard-links a i,
  .project-back-link,
  .project-back-link i,
  .back-button,
  .back-button i,
  .gallery-card img,
  .gallery-item img,
  .project-media-stage--image img,
  .project-motion-ready .project-shell > *,
  .project-motion-ready .project-intro-stage > .project-hero,
  .project-motion-ready .project-intro-stage > .project-media-panel {
    transition: none !important;
  }

  .project-media-stage--image img,
  .gallery-card img,
  .gallery-item img,
  .project-motion-ready .project-shell > *,
  .project-motion-ready .project-intro-stage > .project-hero,
  .project-motion-ready .project-intro-stage > .project-media-panel {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================================
   Family identities — one skeleton, five characters.
   research · game · app · robotics · systems
   ============================================================ */

/* Corner language per family (drives panels + media + spotlight). */
.project-page[data-project-family="research"] { --panel-radius: 4px; }
.project-page[data-project-family="game"]     { --panel-radius: 18px; }
.project-page[data-project-family="app"]      { --panel-radius: 20px; }
.project-page[data-project-family="robotics"] { --panel-radius: 2px; }
.project-page[data-project-family="systems"]  { --panel-radius: 9px; }

.project-page[data-project-family] .project-media-stage,
.project-page[data-project-family] .project-media-panel > .ratio,
.project-page[data-project-family] .project-video-frame,
.playfolio-page.project-page[data-project-family] .project-shell > .project-spotlight {
  border-radius: var(--panel-radius) !important;
}

/* ---------- RESEARCH · lab notebook: sharp corners and numbered steps ---------- */

.project-page[data-project-family="research"] .flow-index {
  border-radius: 3px;
}

/* ---------- GAME · bold arcade: rounded media, filled accent, heavy type ---------- */

.project-page[data-project-family="game"] .project-hero h1,
.project-page[data-project-family="game"] .project-title {
  font-weight: 900;
  letter-spacing: -0.065em;
}

.project-page[data-project-family="game"] .project-section-header h2 {
  font-weight: 900;
}

.project-page[data-project-family="game"] .project-section-eyebrow {
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--project-accent) 15%, transparent);
  color: var(--project-accent-text) !important;
}

.project-page[data-project-family="game"] .project-section-eyebrow::before {
  display: none;
}

.project-page[data-project-family="game"] .flow-index {
  border-color: var(--project-accent);
  background: var(--project-accent);
  color: var(--pf-bg) !important;
}

/* ---------- APP · calm product: soft media corners and lighter type ---------- */

.project-page[data-project-family="app"] .project-hero h1,
.project-page[data-project-family="app"] .project-title {
  font-weight: 800;
  letter-spacing: -0.045em;
}

.project-page[data-project-family="app"] .project-section-header h2 {
  font-weight: 780;
  letter-spacing: -0.035em;
}

.project-page[data-project-family="app"] .project-section-eyebrow::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.project-page[data-project-family="app"] .flow-index {
  border-color: transparent;
  background: color-mix(in srgb, var(--project-accent) 15%, transparent);
}

/* ---------- ROBOTICS · command deck: sharp media and bracketed labels ---------- */

.project-page[data-project-family="robotics"] .project-section-eyebrow::before {
  content: "[";
  width: auto;
  height: auto;
  background: none;
  color: var(--project-accent);
  font-family: var(--project-mono);
  font-weight: 800;
}

.project-page[data-project-family="robotics"] .project-section-eyebrow::after {
  content: "]";
  margin-left: 0.5rem;
  color: var(--project-accent);
  font-family: var(--project-mono);
  font-weight: 800;
}

.project-page[data-project-family="robotics"] .flow-index {
  border-radius: 2px;
  border-color: var(--project-accent);
}

/* ---------- SYSTEMS · workshop: precise corners and prompt mark ---------- */

.project-page[data-project-family="systems"] .project-section-eyebrow::before {
  content: "\203A";
  width: auto;
  height: auto;
  background: none;
  color: var(--project-accent);
  font-weight: 900;
  font-size: 0.95rem;
  line-height: 1;
}
