/* Portfolio structure from /building, set in the shared writing-page theme. */
.work-page { width: min(1200px, calc(100% - 64px)); }
.work-page .site-header, .work-page .site-footer { font-family: inherit; }
.work-page .page-back { display: inline-flex; align-items: center; min-height: 44px; font-size: .75rem; margin-bottom: 24px; }
.page-hero { padding-bottom: 36px; border-bottom: 1px solid var(--rule); }
.page-hero h1 { max-width: 40ch; margin: 20px 0 24px; }
.page-hero__meta, .case-hero__top, .case-hero__links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.page-hero__meta { color: var(--muted); font-size: .75rem; }
.case-hero__top { justify-content: space-between; margin-bottom: 28px; }
.page-hero__brand { margin: 0; font-size: 1rem; color: var(--muted); }
.page-hero__lead { max-width: 110ch; margin: 0; font-size: 1.05rem; }
.page-hero__private, .case-hero__live { font-size: .7rem; }
.page-hero__private { color: var(--muted); margin-top: 22px; }
.wi { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 28px; margin: 32px 0 72px; }
.wi__item { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--rule); }
.wi__link { display: flex; flex: 1; flex-direction: column; color: var(--ink); }
.wi__link:hover { text-decoration: none; }
.wi__link:hover h2 { text-decoration: underline; text-underline-offset: .2em; }
.wi__shot { aspect-ratio: 16/10; overflow: hidden; border-bottom: 1px solid var(--rule); }
.wi__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.wi__body { padding: 22px; display: flex; flex: 1; flex-direction: column; gap: 12px; }
.wi__meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: .65rem; }
.wi__name { font-size: 1.18rem; line-height: 1.4; margin: 0; }
.wi__blurb { font-size: .8rem; line-height: 1.65; margin: 0; flex: 1; }
.wi__tags, .tag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { border: 1px solid var(--rule); padding: 3px 9px; font-size: .65rem; line-height: 1.6; }
.wi__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--rule); padding: 14px 22px; font-size: .6rem; }
.pill { color: var(--muted); }
.wi__live, .case-hero__live { display: inline-flex; align-items: center; min-height: 44px; }
.page-shot { margin: 36px 0 52px; min-width: 0; }
.page-shot img, .page-gallery img, .page-gallery__grid img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); }
.page-shot figcaption, .page-gallery figcaption { font-size: .75rem; color: var(--muted); margin-top: 12px; }
.page-gallery { margin-block: 48px 64px; }
.page-gallery h2 { font-size: 1.5rem; margin: 0 0 24px; }
.page-gallery__grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px; align-items: start; }
.page-gallery__grid:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3,minmax(0,1fr)); }
.page-gallery__grid > :last-child:nth-child(odd):not(:first-child), .page-screens__grid > :last-child:nth-child(odd):not(:first-child) { grid-column: 1 / -1; }
.page-gallery__grid:has(> :nth-child(3):last-child) > :last-child { grid-column: auto; }
.page-gallery__item { margin: 0; min-width: 0; }
.page-gallery__note { font-size: .8rem; padding-left: 20px; border-left: 2px solid var(--accent); margin-bottom: 28px; max-width: 110ch; }
.page-body > .prose { max-width: 110ch; margin-inline: 0; }
.prose h2 { margin: 48px 0 20px; }
.prose li { margin-bottom: 14px; }
.prose .tag-row { margin-top: 24px; }
.page-section, .related, .page-nav, .page-cta { margin-top: 64px; }
.section-head__title { font-size: .85rem; font-weight: 600; margin: 0 0 24px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.page-screens__grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 36px; }
.page-screens__grid .page-shot { margin: 0; }
.browser-frame { border: 1px solid var(--rule); }
.browser-frame__bar { display: flex; align-items: center; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--rule); color: var(--muted); font-size: .6rem; }
.browser-frame__dots { display: flex; gap: 4px; }
.browser-frame__dots i { display: block; width: 5px; height: 5px; background: var(--muted); border-radius: 50%; }
.browser-frame img { border: 0; }
.page-shot figcaption p { margin: 4px 0 0; }
.page-cta { border-top: 1px solid var(--rule); padding-top: 28px; }
.page-cta h2 { font-size: 1.5rem; margin: 0 0 20px; }
.page-cta__text { max-width: 110ch; }
.page-cta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; font-size: .75rem; }
.page-cta__actions .page-cta__service { border: 0; padding-inline: 0; }
.page-cta__actions .page-cta__service:hover { color: var(--accent); background: transparent; }
.related__grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px; }
.related__item { display: flex; flex-direction: column; gap: 10px; font-size: .85rem; }
.related__item span { color: var(--muted); font-size: .8rem; }
.page-nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-top: 1px solid var(--rule); padding-top: 28px; gap: 28px; }
.page-nav__link { display: flex; flex-direction: column; gap: 10px; min-height: 44px; }
.page-nav__link span { font-size: .7rem; }
.page-nav__link--next { text-align: right; grid-column: 2; }
.work-tail { max-width: 110ch; margin-inline: 0; }
.work-tail h2 { font-size: 1.5rem; }
.work-tail h3 { font-size: 1.18rem; }
.work-tail p { overflow-wrap: anywhere; }
.work-tail .contact { padding-top: 20px; }
.work-tail .section-title { border-bottom: 1px solid var(--rule); padding-bottom: 18px; }
.work-tail p a { text-decoration: underline; }
@media (max-width: 600px) {
  .work-page { width: calc(100% - 40px); }
  .page-hero h1 { font-size: 1.85rem; line-height: 1.3; }
  .page-hero__lead { font-size: 1rem; }
  .wi, .page-gallery__grid, .page-screens__grid, .related__grid, .page-gallery__grid:has(> :nth-child(3):last-child) { grid-template-columns: 1fr; }
  .wi { gap: 28px; }
  .wi__body { padding: 22px; }
  .wi__blurb { font-size: .9rem; }
  .wi__meta, .tag { font-size: .72rem; }
  .wi__foot { font-size: .65rem; }
  .page-hero__meta { font-size: .7rem; gap: 10px 18px; }
  .case-hero__top { gap: 12px; }
  .page-gallery__item figcaption { font-size: .8rem; }
  .page-section, .related, .page-nav, .page-cta { margin-top: 48px; }
  .page-nav { gap: 18px; font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .work-page *, .work-page *::before, .work-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .work-page { width: 100%; }
  .wi { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .page-shot, .page-gallery__item, .wi__item { break-inside: avoid; }
  .page-hero h1 { font-size: 28pt; }
}

.page-gallery__grid--phones { margin-top: 28px; }

/* Polish (task 79): even rows, no orphans, login heroes cropped to the form. */
.page-screens__grid:has(> :nth-child(3n):last-child), .related__grid:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3,minmax(0,1fr)); }
.page-screens__grid:has(> :nth-child(3n):last-child) > :last-child { grid-column: auto; }
.page-shot--focus > a, .page-shot--focus > span { display: block; overflow: hidden; border: 1px solid var(--rule); }
.page-shot--focus img { border: 0; transform: scale(1.5); }
#greenlight .wi__shot img, #repurpose-studio .wi__shot img { object-position: center; transform: scale(1.5); }
.wi__foot { min-height: 73px; }
@media (min-width: 601px) {
  .page-gallery__grid:not(.page-gallery__grid--phones) img { aspect-ratio: 16/10; object-fit: cover; object-position: top; }
}
@media (max-width: 600px) {
  .page-screens__grid:has(> :nth-child(3n):last-child), .related__grid:has(> :nth-child(3):last-child) { grid-template-columns: 1fr; }
}
.page-gallery__item--phone { width: 100%; max-width: 390px; margin-inline: auto; }

/* Owner 1 Nov: a way to get in touch right after the projects. */
.work-cta { margin: -40px 0 64px; font-size: 1rem; }
.work-cta a { display: inline-flex; align-items: center; min-height: 44px; }
