/* Shared project index and native detail dialog. */
.project-collection { margin-top: 1.6rem; }
.collection-intro { display: flex; align-items: start; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.collection-intro h2 { margin: 0 0 .6rem; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.16; letter-spacing: -.045em; font-weight: 500; }
.collection-intro p { max-width: 39rem; margin: 0; color: var(--gray-500); font-size: .95rem; }
.collection-guide, .collection-footer { display: flex; justify-content: space-between; gap: 1rem; color: var(--gray-500); font: 400 .7rem/1.6 'Geist Mono', monospace; }
.collection-guide { padding: 0 0 .8rem; }
.project-index { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.project-entry { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--gray-200); border-radius: .85rem; background: var(--background); transition: transform 220ms cubic-bezier(.22,1,.36,1), background 180ms ease, border-color 180ms ease, box-shadow 220ms ease; }
.project-entry::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--ink); transform: scaleY(0); transform-origin: center; transition: transform 220ms cubic-bezier(.22,1,.36,1); pointer-events: none; }
.project-entry summary { list-style: none; display: flex; align-items: flex-start; gap: .8rem; height: 100%; padding: 1rem 1.1rem; cursor: pointer; border-radius: inherit; }
.project-entry summary::-webkit-details-marker { display: none; }
.index-number { padding-top: .05rem; color: var(--gray-500); font: 400 .68rem/1.6 'Geist Mono', monospace; }
.index-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; gap: .22rem; }
.index-category { color: var(--gray-500); font: 400 .62rem/1.45 'Geist Mono', monospace; }
.index-title { font-size: .98rem; font-weight: 600; line-height: 1.28; letter-spacing: -.025em; text-wrap: balance; }
.index-description { font-size: .75rem; color: var(--gray-500); line-height: 1.4; }
.index-status { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--gray-200); border-radius: 20px; padding: .08rem .44rem; font-size: .62rem; line-height: 1.45; color: var(--gray-500); white-space: nowrap; }
.index-copy .index-status { margin-top: .18rem; }
.index-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #28834f; }
:root[data-theme='dark'] .index-status::before { background: #85cf9e; }
.index-arrow { display: grid; place-items: center; width: 1.65rem; height: 1.65rem; flex-shrink: 0; border: 1px solid var(--gray-200); border-radius: 50%; color: var(--gray-500); transition: transform 220ms cubic-bezier(.22,1,.36,1), color 180ms ease, background 180ms ease, border-color 180ms ease; }
@media (hover: hover) and (pointer: fine) {
  .project-entry:hover, .project-entry:focus-within { border-color: var(--gray-300); background: var(--gray-50); box-shadow: 0 14px 30px -20px rgb(0 0 0 / 45%); }
  .project-entry:hover { transform: translateY(-3px); }
  .project-entry:hover::before, .project-entry:focus-within::before { transform: scaleY(1); }
  .project-entry:hover .index-arrow { transform: translate(2px,-2px) rotate(4deg); color: var(--background); background: var(--ink); border-color: var(--ink); }
}
.project-entry summary:focus-visible, .project-dialog button:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.project-entry summary:active { background: var(--gray-100); }
.collection-footer { margin: 1rem 0 0; }
.project-dialog-lock { overflow: hidden; }
.project-dialog { width: min(800px, calc(100% - 32px)); max-width: none; height: min(880px, calc(100dvh - 48px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; color: var(--ink); background: var(--background); border: 1px solid var(--gray-300); border-radius: 1.4rem; box-shadow: 0 32px 100px #0005; overflow: hidden; }
.project-dialog[open] { display: flex; flex-direction: column; animation: project-appear 300ms cubic-bezier(.22,1,.36,1) both; }
.project-dialog::backdrop { background: rgb(8 10 14 / 65%); backdrop-filter: blur(5px); animation: backdrop-appear 220ms ease both; }
.project-dialog.is-closing { animation: project-disappear 180ms ease both; }
.project-dialog.is-closing::backdrop { animation: backdrop-disappear 180ms ease both; }
.dialog-toolbar, .dialog-navigation { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1.3rem; background: var(--background); }
.dialog-toolbar { border-bottom: 1px solid var(--gray-200); }
.project-dialog button { min-height: 44px; background: transparent; color: var(--ink); border: 0; font: inherit; font-size: .8rem; cursor: pointer; border-radius: .4rem; padding: .4rem .65rem; }
.project-dialog button:hover { background: var(--gray-100); }
.dialog-close { display: flex; align-items: center; gap: .7rem; }
.dialog-close span { font-size: 1.5rem; line-height: 1; }
.dialog-content { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.dialog-navigation { border-top: 1px solid var(--gray-200); }
.dialog-navigation > span { font: .72rem 'Geist Mono', monospace; color: var(--gray-500); }
.detail-media { background: var(--gray-100); padding: 1.2rem; }
.detail-media img { width: 100%; height: auto; display: block; border-radius: .65rem; border: 1px solid var(--gray-200); }
.detail-copy { padding: 1.5rem 2rem 2rem; text-transform: none; }
.detail-eyebrow { font: .72rem/1.5 'Geist Mono', monospace; color: var(--gray-500); margin: 0 0 .65rem; }
.detail-copy h2 { margin: 0 0 1rem; font-size: clamp(1.45rem, 4vw, 2rem); line-height: 1.16; letter-spacing: -.035em; text-wrap: balance; }
.detail-copy p, .detail-copy li { font-size: .95rem; line-height: 1.7; color: var(--gray-500); }
.detail-description { margin: 0; }
.detail-section { margin-top: 1.35rem; padding-top: 1.1rem; border-top: 1px solid var(--gray-200); }
.detail-section h3 { font-size: .8rem; font-weight: 600; margin: 0 0 .55rem; }
.detail-section p { margin: 0; }
.detail-section ul { padding-left: 1.2rem; margin: 0; }
.detail-section li + li { margin-top: .4rem; }
.detail-stack { display: flex; flex-wrap: wrap; gap: .45rem; }
.detail-stack span { border: 1px solid var(--gray-200); background: var(--gray-50); border-radius: .4rem; padding: .35rem .6rem; font: .75rem/1.5 'Geist Mono', monospace; }
.detail-security { gap: .4rem; }
.detail-security span { background: color-mix(in srgb, var(--ink) 5%, var(--gray-50)); }
@keyframes project-appear { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes project-disappear { to { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes backdrop-appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-disappear { to { opacity: 0; } }
@media (max-width: 640px) {
  .project-index { grid-template-columns: 1fr; gap: .65rem; }
  .collection-intro { gap: 1rem; margin-bottom: 1.5rem; }
  .collection-intro h2 { font-size: 1.5rem; }
  .collection-intro p { font-size: .85rem; }
  .collection-guide { font-size: .62rem; }
  .project-entry summary { padding: .85rem .8rem; gap: .6rem; }
  .index-number { padding-top: .02rem; font-size: .58rem; }
  .index-copy { gap: .16rem; }
  .index-category { font-size: .5rem; line-height: 1.25; }
  .index-title { font-size: .88rem; line-height: 1.2; }
  .index-description { font-size: .68rem; line-height: 1.35; }
  .index-status { max-width: 100%; padding: .06rem .3rem; font-size: .5rem; line-height: 1.35; white-space: normal; }
  .index-arrow { width: 1.35rem; height: 1.35rem; font-size: .75rem; }
  .collection-footer { flex-direction: column; gap: .15rem; }
  .project-dialog { width: calc(100% - 16px); height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); border-radius: 1.1rem; }
  .dialog-toolbar, .dialog-navigation { padding: .4rem .75rem; }
  .dialog-navigation { padding-bottom: max(.4rem, env(safe-area-inset-bottom)); }
  .detail-media { padding: .65rem; }
  .detail-copy { padding: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .project-dialog[open], .project-dialog::backdrop, .project-dialog.is-closing, .project-dialog.is-closing::backdrop { animation: none; }
  .project-entry, .index-arrow { transition: none; }
}
.project-archive .topbar { display: flex; }
.project-archive .page-shell { width: 100%; max-width: 76rem; margin: 0 auto; }
@media (max-width: 400px) { .project-archive .topbar-actions .resume-button:first-of-type { display: none; } }
