.project-card-linked { position: relative; transition: border-color .2s, box-shadow .2s; }
.project-card-linked:hover, .project-card-linked:focus-within { border-color: var(--border-strong); box-shadow: inset 0 1px 0 var(--glass-top), 0 12px 32px var(--shadow); }
.project-detail-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 20px; }
.project-detail-link:focus-visible { outline: none; }
.project-detail-link:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -4px; }
.project-card-prompt { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 19px; margin-top: auto; color: var(--muted); font-size: 12px; }
.project-card-linked .technology-list { margin-bottom: 25px; }
.project-card-linked .project-content > p:last-of-type { margin-bottom: 22px; }
.project-card-prompt span { color: var(--accent); font-size: 20px; }
.project-detail { padding-top: 55px; }
.project-back-link { color: var(--muted); }
.project-back-link:hover > span[aria-hidden] { transform: translateX(-3px); }
.project-detail-header { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 70px; align-items: end; padding: 42px 0 52px; }
.project-detail-header h1 { font-size: clamp(40px, 5.8vw, 74px); line-height: 1.12; margin-top: 18px; overflow-wrap: anywhere; }
.project-detail-summary { max-width: 720px; font-size: 18px; line-height: 1.8; margin-top: 26px; }
.project-detail-facts { border-left: 1px solid var(--border); padding-left: 30px; }
.project-detail-facts .technology-list { margin: 13px 0 0; }
.project-detail-external-links { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; margin-top: 25px; }
.project-detail-facts > .sample-badge { display: inline-block; margin-top: 25px; }
.project-gallery-cover { border-radius: 20px; overflow: hidden; margin: 0; }
.project-gallery-cover > a { display: block; position: relative; background: var(--input); }
.project-gallery-cover img { width: 100%; height: auto; max-height: 650px; object-fit: contain; }
.project-gallery-cover > a:focus-visible { outline-offset: -5px; }
.gallery-expand { position: absolute; display: flex; align-items: center; gap: 18px; right: 20px; bottom: 20px; font-size: 12px; color: var(--text); background: var(--header); backdrop-filter: blur(16px); border: 1px solid var(--border-strong); padding: 11px 16px; border-radius: 10px; }
.gallery-expand > span { font-size: 18px; color: var(--accent); }
.project-gallery-cover figcaption { padding: 16px 22px; color: var(--muted); font-size: 13px; }
.project-gallery-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 25px 0 13px; }
.project-gallery-heading > p:last-child { font-size: 12px; }
.project-gallery-thumbnails { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.gallery-thumbnail { display: block; position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--glass); aspect-ratio: 8 / 5; }
.gallery-thumbnail:hover { border-color: var(--accent); }
.gallery-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbnail > span { position: absolute; bottom: 8px; left: 8px; padding: 2px 7px; border-radius: 5px; background: var(--header); color: var(--text); font-size: 10px; backdrop-filter: blur(12px); }
.project-detail-legacy-image { padding: 18px; border-radius: 20px; }
.project-detail-legacy-image img { max-height: 650px; margin: auto; object-fit: contain; }
.project-story { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr); gap: 70px; border-top: 1px solid var(--border); padding-top: 45px; margin-top: 50px; }
.project-story h2 { font-size: clamp(26px, 3vw, 36px); margin-top: 14px; max-width: 280px; }
.project-rich-text { color: var(--muted); font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; min-width: 0; }
.project-rich-text > :first-child { margin-top: 0; }
.project-rich-text > :last-child { margin-bottom: 0; }
.project-rich-text p, .project-rich-text ul, .project-rich-text ol, .project-rich-text pre, .project-rich-text blockquote { margin: 0 0 1.25em; }
.project-rich-text h2, .project-rich-text h3, .project-rich-text h4 { color: var(--text); font-weight: 500; margin: 1.6em 0 .65em; line-height: 1.3; }
.project-rich-text h2 { font-size: 29px; max-width: none; }.project-rich-text h3 { font-size: 24px; }.project-rich-text h4 { font-size: 20px; }
.project-rich-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.project-rich-text strong, .project-rich-text b { color: var(--text); font-weight: 600; }
.project-rich-text ul, .project-rich-text ol { padding-left: 1.5em; }.project-rich-text li { margin: .4em 0; }
.project-rich-text blockquote { border-left: 2px solid var(--accent); padding: 8px 0 8px 22px; margin-left: 0; }
.project-rich-text blockquote > :last-child { margin-bottom: 0; }
.project-rich-text pre { background: var(--input); padding: 20px; border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; white-space: pre; font-size: 13px; }
.project-rich-text code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88em; }
.project-rich-text :not(pre) > code { background: var(--glass-top); padding: 2px 5px; border-radius: 4px; }
.project-rich-text hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.gallery-dialog { width: min(1200px, calc(100% - 48px)); max-width: none; max-height: calc(100dvh - 48px); padding: 24px; border: 1px solid var(--border-strong); border-radius: 20px; color: var(--text); background: var(--bg); box-shadow: 0 24px 100px rgba(0,0,0,.4); }
.gallery-dialog::backdrop { background: rgba(0,0,0,.8); backdrop-filter: blur(8px); }
.gallery-dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.gallery-dialog-toolbar h2 { font-size: 18px; line-height: 1.4; }
.gallery-close { display: inline-flex; align-items: center; gap: 14px; background: var(--glass); border: 1px solid var(--border); border-radius: 8px; min-height: 44px; padding: 8px 13px; cursor: pointer; font-size: 12px; }
.gallery-close > span { font-size: 23px; line-height: 1; }
.gallery-dialog-figure { margin: 0; }
.gallery-dialog-figure img { width: 100%; height: min(66dvh, 740px); object-fit: contain; }
.gallery-dialog-figure figcaption { max-width: 850px; margin: 18px auto 0; color: var(--muted); font-size: 13px; text-align: center; }
.gallery-dialog-figure figcaption:empty { display: none; }
.gallery-dialog-controls { display: flex; justify-content: center; align-items: center; gap: 25px; margin-top: 20px; }
.gallery-dialog-controls button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--glass); cursor: pointer; font-size: 23px; }
.gallery-dialog-controls button:hover, .gallery-close:hover { background: var(--glass-top); }
.gallery-dialog-controls p { font-size: 12px; min-width: 50px; text-align: center; }
body.gallery-is-open { overflow: hidden; }
@media (max-width: 820px) {
  .project-detail-header { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .project-detail-facts { border-left: 0; border-top: 1px solid var(--border); padding: 24px 0 0; }
  .project-detail-external-links { flex-direction: row; flex-wrap: wrap; gap: 25px; }
  .project-story { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .project-story > div:first-child h2 { max-width: none; }
}
@media (max-width: 580px) {
  .project-detail { padding-top: 35px; }.project-detail-header { padding: 30px 0 35px; }
  .project-detail-header h1 { font-size: 43px; }.project-detail-summary { font-size: 16px; margin-top: 20px; }
  .project-gallery-cover { border-radius: 13px; }.project-gallery-cover figcaption { padding: 13px 16px; }
  .gallery-expand { bottom: 12px; right: 12px; padding: 8px 12px; font-size: 11px; }
  .project-gallery-thumbnails { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .project-story { padding-top: 30px; margin-top: 35px; }.project-rich-text { font-size: 15px; }
  .gallery-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); padding: 15px; border-radius: 14px; }
  .gallery-dialog-toolbar { gap: 14px; }.gallery-dialog-toolbar h2 { font-size: 16px; }
  .gallery-dialog-figure img { height: 55dvh; }
}
@media (prefers-reduced-motion: reduce) { .project-card-linked { transition: none; } }
