/* Homepage study, scoped to preserve the shared site shell. */
@scope (.site-home) {
.project-section {
  --project-code-key: #9ccaff;
  --project-code-value: #d2a8ff;
  --project-code-sql: #7ee4ba;
  --project-code-comment: #7fb278;
  position: relative;
  padding: 105px 0 100px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 96%, var(--ink));
  scroll-margin-top: 72px;
}
:scope.is-light .project-section {
  --project-code-key: #0550ae;
  --project-code-value: #8250df;
  --project-code-sql: #1a7f37;
  --project-code-comment: #27803c;
}
.project-heading h2 { max-width: 850px; margin: 0; font-size: var(--section-title-size); font-weight: 600; line-height: 1.03; letter-spacing: -.055em; text-wrap: balance; }
.project-intro { max-width: 750px; margin: 18px 0 0; color: var(--muted); font-size: 17px; line-height: 1.55; text-wrap: pretty; }
.project-phase-copy { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-height: 27px; margin: 16px 0 0; color: var(--muted); font-size: 17px; line-height: 1.55; }
.project-phase-copy > span:first-child { color: var(--accent); font: 750 12px/1.6 var(--fontStack-monospace); letter-spacing: .1em; white-space: nowrap; }
.project-phase-copy.is-changing > span { animation: project-phase-enter .48s cubic-bezier(.2, .8, .2, 1) both; }
.project-phase-copy.is-changing > span:last-child { animation-delay: 80ms; }
@keyframes project-phase-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

.project-explorer { min-width: 0; margin-top: 54px; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: var(--frame-bg); box-shadow: 0 30px 85px rgba(0, 0, 0, .16); }
.project-tabs { display: flex; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--frame-bg) 82%, var(--bg)); scrollbar-color: var(--border) transparent; scrollbar-width: thin; }
.project-tabs button { display: flex; flex: 1 0 170px; align-items: center; gap: 9px; min-width: 0; min-height: 42px; padding: 0 13px; border: 0; border-right: 1px solid var(--border); border-top: 2px solid transparent; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.project-tabs button:last-child { border-right: 0; }
.project-tabs button:hover { background: var(--glow); color: var(--ink); }
.project-tabs button[aria-selected="true"] { border-top-color: var(--accent); background: var(--bg); color: var(--ink); }
.project-explorer.is-autoplay .project-tabs button[aria-selected="true"] { position: relative; border-top-color: transparent; }
.project-explorer.is-autoplay .project-tabs button[aria-selected="true"]::before { position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: var(--accent); content: ''; transform-origin: left; animation: project-tab-progress var(--project-phase-duration) linear both; }
@keyframes project-tab-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.project-tabs button:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--accent); outline-offset: -3px; }
.project-yaml-icon { display: inline-grid; place-items: center; width: 16px; height: 18px; flex: none; border: 1px solid color-mix(in srgb, var(--accent) 65%, transparent); border-radius: 2px; color: var(--accent); font: 750 10px/1 var(--fontStack-monospace); }
.project-tab-filename { min-width: 0; overflow: hidden; font: 12px/1.2 var(--fontStack-monospace); text-overflow: ellipsis; white-space: nowrap; }

.project-editor { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.project-editor-breadcrumb { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 34px; padding: 0 20px; color: var(--muted); font: 11px/1.2 var(--fontStack-monospace); }
.project-editor-breadcrumb > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-editor-language { flex: none; color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.project-code-scroll { height: 402px; min-width: 0; overflow: auto; overscroll-behavior: contain; scrollbar-color: var(--border) transparent; scrollbar-width: thin; }
.project-code-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.project-code { width: max-content; min-width: 100%; margin: 0; padding: 15px 0 29px; color: var(--ink); font: 13px/1.8 var(--fontStack-monospace); tab-size: 2; }
.project-code-row { display: flex; min-height: 22px; padding-right: 24px; white-space: pre; }
.project-code-row:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.project-code-row.is-entering { animation: project-code-enter .4s both; animation-delay: calc(var(--enter-order) * 45ms); }
@keyframes project-code-enter { from { opacity: 0; transform: translateX(9px); } to { opacity: 1; transform: translateX(0); } }
.project-line-number { width: 58px; flex: none; padding-right: 17px; color: var(--muted); text-align: right; user-select: none; }
.project-code-text { white-space: pre; }
.project-syntax-key { color: var(--project-code-key); }
.project-syntax-value { color: var(--project-code-value); }
.project-syntax-sql { color: var(--project-code-sql); }
.project-syntax-comment { color: var(--project-code-comment); }

@media (max-width: 900px) {
  .project-section { padding-block: 85px; }
}
@media (max-width: 650px) {
  .project-section { padding-block: 73px 72px; }
    .project-intro { margin-top: 14px; font-size: 13px; }
  .project-phase-copy { max-width: 360px; min-height: 44px; margin-top: 12px; font-size: 13px; }
  .project-phase-copy > span:first-child { font-size: 10px; }
  .project-explorer { margin-top: 35px; }
  .project-tabs button { flex-basis: 157px; min-height: 42px; padding-inline: 11px; }
  .project-tab-filename { font-size: 11px; }
  .project-editor-breadcrumb { min-height: 32px; padding-inline: 12px; font-size: 10px; }
  .project-code-scroll { height: 370px; }
  .project-code { font-size: 11px; }
  .project-line-number { width: 41px; padding-right: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .project-phase-copy.is-changing > span { animation: none; }
  .project-code-row.is-entering { animation: none; }
}

}
