/* Browser-native project interactions. Sources:
   site-components/PROJECT-UI.md. All styles are confined to project UI. */
body.personal-journal #projectList .project-card { position: relative; isolation: isolate; }
body.personal-journal #projectList .project-card > :not(.project-spotlight) { position: relative; z-index: 1; }
body.personal-journal #projectList .project-spotlight { position: absolute; z-index: 0; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; background: radial-gradient(280px circle at var(--project-x,50%) var(--project-y,40%),rgba(95,105,135,.09),transparent 75%); transition: opacity .25s ease; }
body.personal-journal #projectList .project-spotlight::after { position: absolute; inset: 0; border-radius: inherit; padding: 1px; content: ""; background: radial-gradient(240px circle at var(--project-x,50%) var(--project-y,40%),rgba(110,105,160,.5),transparent 75%); -webkit-mask: linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0); mask: linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
body.personal-journal #projectList .project-card:focus-within .project-spotlight { opacity: 1; }
@media (hover:hover) and (pointer:fine) {
  body.personal-journal #projectList .project-card:hover .project-spotlight { opacity: 1; }
}

/* The native links stay links, including on touch and without JavaScript. */
body.personal-journal #projects .project-actions a.project-cta,
.project-dialog .project-cta { position: relative; display: inline-flex; align-items: center; justify-content: center; isolation: isolate; min-height: 44px; gap: .5rem; padding: .55rem 2.25rem .55rem 1.6rem; border: 1px solid #e3e3e5; border-radius: 999px; overflow: hidden; background: #fff; color: #202020; text-decoration: none; font: inherit; font-size: .8rem; line-height: 1.4; white-space: nowrap; }
body.personal-journal #projects .project-actions a.project-cta::before,
.project-dialog .project-cta::before { content: ""; position: absolute; z-index: -1; left: 12px; top: calc(50% - 3px); width: 6px; height: 6px; border-radius: 50%; background: #202020; transition: transform .4s cubic-bezier(.22,1,.36,1); }
.project-cta-label { position: relative; transition: transform .3s ease, color .3s ease; }
.project-cta-arrow { position: absolute; right: 13px; opacity: 0; transform: translateX(-6px); transition: opacity .25s ease,transform .3s ease; }
body.personal-journal #projects .project-actions a.project-cta:is(:hover,:focus-visible),
.project-dialog .project-cta:is(:hover,:focus-visible) { color: #fff; }
.project-cta:is(:hover,:focus-visible)::before { transform: scale(65); }
.project-cta:is(:hover,:focus-visible) .project-cta-label { transform: translateX(-3px); }
.project-cta:is(:hover,:focus-visible) .project-cta-arrow { opacity: 1; transform: none; }
body.personal-journal #projects .project-story > summary.project-expand { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; list-style: none; }
body.personal-journal #projects .project-story > summary.project-expand::-webkit-details-marker { display: none; }
.project-expand::after { content: "+"; display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #f2f2f4; font-size: 1.05rem; transition: transform .2s ease; }
.project-expand:hover::after { transform: rotate(90deg); }

/* Top-layer popover escapes the horizontally scrolling gallery. */
.project-link-preview { position: fixed; inset: auto; margin: 0; padding: 0; width: min(340px,calc(100vw - 24px)); border: 1px solid #e6e6e9; border-radius: 16px; background: #fff; color: #202020; box-shadow: 0 12px 40px rgba(30,30,45,.16); overflow: hidden; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif; }
.project-link-preview:not(:popover-open) { display: none; }
.project-link-preview img { display: block; width: 100%; height: auto; aspect-ratio: 480 / 150; object-fit: contain; background: #f5f5f7; border-bottom: 1px solid #ededf0; }
.project-link-preview__text { padding: 14px 16px 16px; }
.project-link-preview__eyebrow { margin: 0 0 5px; color: #686872; font-size: 10px; font-weight: 600; letter-spacing: .09em; line-height: 1.4; text-transform: uppercase; }
.project-link-preview__title { margin: 0; color: #202020; font-size: 15px; font-weight: 600; line-height: 1.4; }
.project-link-preview__owner { display: block; margin-top: 7px; color: #63636b; font-size: 11px; line-height: 1.4; }

/* Native dialog handles keyboard focus, Escape, and inert background content. */
html.project-dialog-open, html.project-dialog-open body { overflow: hidden; }
.project-dialog { position: fixed; inset: 0; width: min(720px,calc(100% - 40px)); max-width: none; max-height: calc(100svh - 48px); margin: auto; padding: 0; border: 1px solid #e6e6e9; border-radius: 24px; overflow: hidden; background: #fff; color: #202020; box-shadow: 0 24px 80px rgba(0,0,0,.2); font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif; font-size: 1rem; line-height: 1.65; }
.project-dialog::backdrop { background: rgba(25,25,32,.4); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.project-dialog__panel { max-height: calc(100svh - 50px); min-width: 0; overflow-y: auto; overscroll-behavior: contain; overflow-wrap: anywhere; }
.project-dialog__bar { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 12px 20px 12px 28px; border-bottom: 1px solid #eeeeef; background: #fff; }
.project-dialog__context { margin: 0; color: #636363; font-size: .75rem; }
.project-dialog__close { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #f3f3f5; color: #202020; font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.project-dialog__content { padding: 24px 32px 32px; }
.project-dialog h2 { margin: 0 0 1.2rem; font: inherit; font-size: 1.8rem; font-weight: 600; line-height: 1.2; letter-spacing: -.04em; overflow-wrap: anywhere; }
.project-dialog .project-visual { margin: 0 0 1.2rem; overflow: hidden; border-radius: 16px; background: #f5f5f7; }
.project-dialog .project-visual img { display: block; width: 100%; height: auto; }
.project-dialog .project-summary { margin: 0 0 1.4rem; color: #636363; font-size: .94rem; }
.project-dialog .project-summary strong { color: #202020; font-weight: 600; }
.project-dialog .project-story__body h4 { margin: 1.3rem 0 .4rem; font: inherit; font-size: 1rem; font-weight: 600; }
.project-dialog .project-story__body p { margin: .6rem 0; color: #636363; font-size: .94rem; }
.project-dialog .project-story__body .project-note { color: #686872; font-size: .75rem; }
.project-dialog__actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid #ededf0; }
.project-dialog :is(a,button):focus-visible { outline: 3px solid #202020; outline-offset: 4px; }
@media (max-width:480px) {
  .project-dialog { width: calc(100% - 24px); max-height: calc(100svh - 24px); border-radius: 20px; }
  .project-dialog__panel { max-height: calc(100svh - 26px); }
  .project-dialog__bar { padding: 8px 12px 8px 20px; }
  .project-dialog__content { padding: 20px; }
  .project-dialog h2 { font-size: 1.5rem; }
  body.personal-journal #projects .project-footer { gap: 0 10px; }
  body.personal-journal #projects .project-story > summary.project-expand { font-size: .75rem; }
}
@media (prefers-reduced-motion:reduce) {
  .project-link-preview, .project-dialog *, .project-cta *, .project-cta::before { animation: none !important; transition: none !important; }
}
@media print {
  .project-link-preview, .project-dialog, .project-spotlight { display: none !important; }
  html.project-dialog-open,html.project-dialog-open body { overflow: visible; }
  body.personal-journal #projects .project-actions a.project-cta { border: 0; padding: 0; }
  body.personal-journal #projects .project-actions a.project-cta::before { display: none; }
}
