/* The screenshot reaches the card border; the card clips its overflow. */
#ai-dev-framework .project-body{--framework-bleed:23px}
#ai-dev-framework .framework-preview{display:block;position:relative;align-self:stretch;width:calc(100% + var(--framework-bleed));min-height:295px;margin:0 calc(-1 * var(--framework-bleed)) 0 0;padding:0;border:0;border-radius:14px 0 0 14px;background:#f1f6f3;overflow:hidden;cursor:zoom-in}
.framework-preview img{position:absolute;top:-3.5%;left:-3.5%;display:block;width:107%;height:107%;max-width:none;object-fit:cover;object-position:left top}
.framework-preview-zoom{position:absolute;right:12px;bottom:12px;display:flex;align-items:center;gap:7px;border:1px solid #dfe7e0;border-radius:999px;padding:7px 10px;background:rgba(255,255,255,.95);color:var(--accent);font-size:11px;font-weight:600;box-shadow:0 3px 12px rgba(24,35,29,.06)}
.framework-preview-zoom svg,.gallery-open-hint svg{width:14px;height:14px;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.framework-preview-zoom span{display:none}
.framework-preview:hover .framework-preview-zoom span,.framework-preview:focus-visible .framework-preview-zoom span{display:inline}
.project-dialog--framework .details-columns{grid-row:auto}
.framework-gallery{grid-column:1 / -1;min-width:0;margin:0;padding:20px 22px;background:#f5f8f5;border:1px solid #e0e8e1;border-radius:16px}
.gallery-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.gallery-header h3{font-size:18px;line-height:1.3;letter-spacing:-.02em;margin:0;color:var(--ink)}
.gallery-counter{flex:0 0 auto;font-size:12px;color:#627267;font-variant-numeric:tabular-nums}
.gallery-stage{display:grid;grid-template-columns:34px minmax(0,560px) 34px;align-items:center;justify-content:center;gap:14px;min-width:0}
.gallery-arrow{display:flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:1px solid #dbe5dd;border-radius:50%;background:#fff;color:var(--accent);cursor:pointer;flex:0 0 auto}
.gallery-arrow:hover{background:#e8f1eb;border-color:#bfcfc4}
.gallery-arrow svg{width:19px;height:19px;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.gallery-open{display:block;position:relative;min-width:0;width:100%;padding:0;aspect-ratio:16 / 9;border:1px solid #dce5de;border-radius:10px;background:#fff;overflow:hidden;cursor:zoom-in;box-shadow:0 4px 18px rgba(24,35,29,.035);touch-action:pan-y}
.gallery-open>img{display:block;width:100%;height:100%;object-fit:contain}
.gallery-open-hint{position:absolute;right:10px;bottom:10px;display:flex;align-items:center;gap:6px;padding:5px 8px;border:1px solid #dfe7e0;border-radius:7px;background:rgba(255,255,255,.96);color:var(--accent);font-size:10px;font-weight:550;opacity:0;transition:opacity .15s}
.gallery-open:hover .gallery-open-hint,.gallery-open:focus-visible .gallery-open-hint{opacity:1}
.gallery-thumbnails{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;max-width:440px;margin:14px auto 0}
.gallery-thumbnail{min-width:0;padding:5px 5px 6px;border:1px solid transparent;border-radius:9px;background:transparent;color:#617065;font:inherit;font-size:11px;cursor:pointer}
.gallery-thumbnail img{display:block;width:100%;height:auto;aspect-ratio:16 / 9;object-fit:contain;border:1px solid #e1e7e2;border-radius:5px;background:#fff;margin-bottom:5px}
.gallery-thumbnail[aria-pressed="true"]{border-color:#a6c3b0;background:#e8f0eb;color:#164d37;font-weight:600}
.gallery-thumbnail:hover{background:#edf3ee}
.image-viewer{width:calc(100vw - 32px);max-width:1800px;height:calc(100vh - 32px);height:calc(100dvh - 32px);max-height:none;padding:0;border:1px solid #dce5df;border-radius:16px;background:#f6f8f6;color:var(--ink);box-shadow:0 24px 100px rgba(17,30,22,.25);overflow:hidden}
.image-viewer[open]{display:flex;flex-direction:column}
.image-viewer::backdrop{background:rgba(16,29,22,.62);backdrop-filter:blur(5px)}
.image-viewer-header{display:flex;align-items:center;justify-content:space-between;gap:16px;flex:0 0 auto;padding:15px 20px;border-bottom:1px solid #e0e7e2;background:#fbfcfa}
.image-viewer-header h2{margin:0;font-size:17px;line-height:1.3;letter-spacing:-.02em}
.image-viewer-actions{display:flex;align-items:center;gap:9px;flex:0 0 auto}
.image-viewer-close,.image-viewer-zoom{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:8px 11px;border:1px solid #dce5df;border-radius:8px;background:#fff;color:#314939;font:inherit;font-size:12px;cursor:pointer}
.image-viewer-close:hover,.image-viewer-zoom:hover{background:#e9f1eb}
.image-viewer-close svg{width:18px;height:18px;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}
.image-viewer-viewport{display:flex;align-items:center;justify-content:center;flex:1;min-height:0;padding:16px;overflow:auto;overscroll-behavior:contain;touch-action:pan-y}
.image-viewer-image{display:block;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;border-radius:3px;cursor:zoom-in}
.image-viewer-viewport.is-zoomed{display:block;touch-action:auto}
.image-viewer-viewport.is-zoomed .image-viewer-image{max-width:none;max-height:none;margin:0 auto;cursor:zoom-out}
.image-viewer-navigation{display:flex;align-items:center;justify-content:center;gap:22px;flex:0 0 auto;min-height:58px;padding:8px 20px;border-top:1px solid #e0e7e2;background:#fbfcfa}
.image-viewer-counter{font-size:13px;color:#4e6254;min-width:64px;text-align:center;font-variant-numeric:tabular-nums}
.image-viewer-navigation .gallery-arrow[hidden]{display:none}
@media(max-width:1120px){#ai-dev-framework .project-body{--framework-bleed:19px}}
@media(max-width:650px){
 .framework-gallery{padding:15px 12px;border-radius:12px}
 .gallery-header{gap:8px;margin-bottom:12px}
 .gallery-header h3{font-size:16px}
 .gallery-stage{grid-template-columns:minmax(0,560px);gap:0}
 .gallery-stage>.gallery-arrow{display:none}
 .gallery-thumbnails{gap:4px;margin-top:10px}
 .gallery-thumbnail{font-size:10px;padding:3px}
 .gallery-open-hint{right:5px;bottom:5px;padding:3px 5px;font-size:9px;opacity:1}
 .gallery-open-hint svg{width:11px;height:11px}
 .image-viewer{width:calc(100vw - 12px);height:calc(100vh - 12px);height:calc(100dvh - 12px);border-radius:11px}
 .image-viewer-header{padding:12px;gap:8px}
 .image-viewer-header h2{font-size:14px;max-width:180px}
 .image-viewer-actions{gap:5px}
 .image-viewer-close,.image-viewer-zoom{padding:7px;font-size:11px}
 .image-viewer-close span{display:none}
 .image-viewer-viewport{padding:8px}
}
@media(max-width:560px){
 #ai-dev-framework .project-body{--framework-bleed:20px}
 #ai-dev-framework .framework-preview{min-height:310px}
 .framework-preview img{object-position:left top}
}
@media(prefers-reduced-motion:reduce){.gallery-open-hint{transition:none}}

/* v8: sharp native-size vector UI; decorative only. */
#ai-dev-framework .framework-preview{cursor:default;min-height:330px}
.framework-preview img{position:absolute;top:0;left:0;width:640px;height:380px;object-fit:initial;max-width:none}
.framework-gallery{padding:20px 18px}
.gallery-stage{position:relative;display:block;width:100%;padding:0 42px}
.gallery-open{width:100%}
.gallery-stage>.gallery-arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:1}
.gallery-stage>[data-gallery-action="previous"]{left:0}
.gallery-stage>[data-gallery-action="next"]{right:0}
@media(max-width:650px){.framework-gallery{padding:14px 10px}.gallery-stage{padding:0 29px}.gallery-stage>.gallery-arrow{display:flex;width:25px;height:25px}.gallery-header h3{font-size:15px}}

/* v9: image-only presentation, exact alignment with its heading. */
.framework-gallery{padding:0;background:transparent;border:0;border-radius:0}
.gallery-header{margin-bottom:16px;align-items:center}
.gallery-controls{display:flex;gap:8px;flex:0 0 auto}
.gallery-stage{padding:0}
.gallery-open{border:0;border-radius:10px;box-shadow:0 5px 20px rgba(24,35,29,.08)}
#ai-dev-framework .framework-preview::after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background:#d0d7de;pointer-events:none}
@media(max-width:650px){.framework-gallery{padding:0}.gallery-stage{padding:0}.gallery-controls .gallery-arrow{width:29px;height:29px}}

.project-body{--edge-bleed:23px}
.project-card .edge-preview{position:relative;display:block;align-self:stretch;grid-column:2;grid-row:2 / span 2;width:calc(100% + var(--edge-bleed));margin:0 calc(-1 * var(--edge-bleed)) 0 0;padding:0;border:1px solid #ccd2d8;border-right:0;border-radius:11px 0 0 11px;min-height:350px;overflow:hidden;background:white}
.edge-preview img{position:absolute;top:0;left:0;width:640px;height:350px;max-width:none;display:block}
.edge-preview.wordie-preview img{width:570px;height:360px}
.edge-preview.folders-preview{background:#15191d;border-color:#30363d}
.edge-preview.folders-preview img{width:640px;height:auto}
.project-full-image{grid-column:1 / -1;min-width:0}
.project-full-image h3{font-size:18px;margin:0 0 16px}
.project-image-open{display:block;width:100%;padding:0;border:0;border-radius:12px;background:transparent;box-shadow:0 5px 20px #18231d14;overflow:hidden;cursor:zoom-in}
.project-image-open img{display:block;width:100%;height:auto}
@media(max-width:1120px){.project-body{--edge-bleed:19px}}
@media(max-width:560px){.project-body{--edge-bleed:20px}.project-card .edge-preview{grid-column:1;grid-row:4;min-height:350px}}

/* v11: phone mockup and crisp native-size macOS app preview. */
.project-card .edge-preview.wordie-preview{border:0;background:transparent;border-radius:0;min-height:610px}
.edge-preview.wordie-preview img{width:280px;height:auto;left:12px;top:0}
.project-card .edge-preview.folders-preview{min-height:390px;border-color:#39414b}
.edge-preview.folders-preview img{width:640px;height:390px}
.project-card .edge-preview.folders-preview{height:390px;align-self:start}

/* v12: halve the phone and release the oversized card height. */
.project-card .edge-preview.wordie-preview{min-height:305px;align-self:start;height:305px}
.edge-preview.wordie-preview img{width:140px;height:auto;left:auto;right:-10px;top:0}

/* Approved layout: readable phone scale with a cropped viewport. */
.project-card .edge-preview.wordie-preview{min-height:340px;height:340px;align-self:start}
.edge-preview.wordie-preview img{width:280px;height:auto;left:12px;right:auto;top:0}

/* v14: the phone is clipped by the card's content boundary. */
#wordieup .project-body{--phone-bottom:25px}
.project-card .edge-preview.wordie-preview{height:auto;min-height:340px;align-self:stretch;margin-bottom:calc(-1 * var(--phone-bottom))}
@media(max-width:1120px){#wordieup .project-body{--phone-bottom:22px}}
@media(max-width:560px){#wordieup .project-body{--phone-bottom:20px}}

/* v15: quieter phone scale, preserving the bottom/right crop. */
.edge-preview.wordie-preview img{width:246px;left:auto;right:-14px;top:0}

/* v17: readable case-study sections and compact mobile cards. */
.contact-links{margin-top:24px}
.project-challenges{grid-column:1 / -1;min-width:0}
.project-challenges h3{margin:0 0 18px;font-size:19px;line-height:1.35;letter-spacing:-.02em}
.challenge-item{padding:18px 0;border-top:1px solid #e0e7e2}
.challenge-item:last-child{padding-bottom:0}
.challenge-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:32px}
.project-challenges .challenge-columns p{margin:0;line-height:1.7}
.challenge-columns strong{color:#283c30;font-weight:600}
@media(max-width:650px){
 #wordieup .wordie-preview{display:none}
 #wordieup .project-body{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto}
 .challenge-columns{grid-template-columns:1fr;gap:12px}
 .contact-links{margin-top:22px}
}

/* v18: compact shared row; sequential case-study prose. */
#wordieup .project-body,#po-papochkam .project-body{grid-template-rows:min-content min-content 1fr;align-content:start}
.project-card .edge-preview.wordie-preview{height:415px;min-height:0;align-self:start}
.project-challenges .challenge-item>p{margin:0 0 12px;line-height:1.7}
.project-challenges .challenge-item>p:last-child{margin-bottom:0}
.challenge-columns{display:block}
@media(max-width:560px){#po-papochkam .project-body{grid-template-rows:auto auto auto auto}}

/* v19: all framework details follow a single reading column. */
.project-dialog--framework .details-inner{grid-template-columns:minmax(0,1fr)}
.project-dialog--framework .details-columns{grid-column:1;grid-row:auto;grid-template-columns:minmax(0,1fr)}
.project-dialog--framework .meta-row{grid-template-columns:minmax(0,1fr);gap:5px}

/* v20: a plain list for multiple challenges, no repeated subheadings. */
.challenges-list{margin:0;padding-left:21px;list-style:disc}
.challenges-list>li{padding-left:4px;margin:0 0 22px}
.challenges-list>li:last-child{margin-bottom:0}
.challenges-list>li::marker{color:var(--accent)}
.project-challenges .challenges-list p,.project-challenges .challenge-prose p{margin:0 0 12px;line-height:1.7}
.project-challenges .challenges-list p:last-child,.project-challenges .challenge-prose p:last-child{margin-bottom:0}

/* v21: two-column framework introduction; single-column challenge list. */
.project-dialog--framework .details-inner{grid-template-columns:repeat(2,minmax(0,1fr))}
.project-dialog--framework .details-inner>.project-implemented{grid-column:1;grid-row:1}
.project-dialog--framework .details-columns{grid-column:2;grid-row:1;grid-template-columns:minmax(0,1fr)}
.edge-preview.wordie-preview img{width:194px;height:auto;left:auto;right:12px;top:0}
@media(max-width:650px){
 .project-dialog--framework .details-inner{grid-template-columns:minmax(0,1fr)}
 .project-dialog--framework .details-inner>.project-implemented{grid-column:1;grid-row:auto}
 .project-dialog--framework .details-columns{grid-column:1;grid-row:auto}
}

/* v22: phone close to the copy; only its bottom is clipped. */
#wordieup{align-self:start}
.project-card .edge-preview.wordie-preview{height:auto;min-height:350px;align-self:stretch}
.edge-preview.wordie-preview img{width:210px;height:auto;left:12px;right:auto;top:0}

/* v23: equal card and footer alignment; proportional folders preview. */
#wordieup{align-self:stretch}
@media(min-width:851px){
 .project-card .edge-preview.folders-preview{height:340px;min-height:340px}
 .edge-preview.folders-preview img{width:557.949px;height:340px}
}
