/* =========================================================================
   work.css — Work library and case studies.
   Load after collections.css. Every rule is scoped to .work-library or
   .work-case; tokens, .btn, .project-link, .collection-* come from shell.css
   and collections.css and are only tightened here. No shell or dock rules.
   ========================================================================= */

/* ---------- Library header ---------- */
.work-library{padding:28px 36px 36px}
.work-library .collection-heading{align-items:flex-start;flex-wrap:wrap;gap:14px 24px;margin-bottom:20px}
.work-library .collection-heading>div:first-child{flex:1 1 300px;min-width:0}
.work-library .collection-heading h1{font-size:32px;margin-bottom:6px;width:fit-content}
.work-library .collection-heading p{max-width:56ch}
.work-header-actions{display:flex;gap:8px;flex:none;padding-top:4px}
.work-library .btn{height:40px;font-size:14px}
.work-library .btn.primary{height:40px;padding:0 18px;font-size:14px}
.work-library .btn .ico,.work-library .btn svg{width:16px;height:16px}
.work-library .project-link{min-height:40px}

/* Tools: the existing filter and search rows, brought to a 40px hit area. */
.work-library .collection-tools{padding-bottom:12px}
.work-library .collection-filters button{min-height:40px}
.work-library .collection-search input{min-height:40px}
.work-library .collection-count{margin:12px 0 0}
.work-library .collection-count:empty{display:none}

/* ---------- Featured projects ---------- */
.work-featured{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px 24px;padding:18px 0 26px}
.work-feature{min-width:0;display:flex;flex-direction:column}
.work-feature-preview{display:block;position:relative;width:100%;aspect-ratio:1.75;border-radius:12px;overflow:hidden;background:var(--paper-2);border:1px solid var(--line)}
.work-feature-preview img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:top left}
.work-feature-preview:hover img{transform:none}
.work-feature-preview .ico,.work-feature-preview svg{width:64px;height:64px;margin:auto;color:#3f648f}
.work-feature-preview.work-analysis-preview{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:20px;padding:28px;background:linear-gradient(125deg,var(--paper-2),var(--paper));color:var(--ink);border-left:3px solid var(--blue-500)}
.work-analysis-preview .ico{margin:0;width:36px;height:36px;flex:none}
.work-analysis-preview>span{font-size:clamp(19px,2vw,27px);font-weight:550;line-height:1.35;letter-spacing:-.025em;max-width:24ch}
.work-feature-copy{padding-top:14px}
.work-feature h2{font-size:24px;font-weight:650;letter-spacing:-.03em;line-height:1.15;margin:4px 0 6px}
.work-feature-line{font-size:15px;line-height:1.5;color:var(--ink);max-width:52ch}
.work-role{font-size:13px;line-height:1.5;color:var(--ink-3);margin-top:3px;max-width:60ch}
.work-feature-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px 18px;margin-top:12px}

/* ---------- Supporting list ---------- */
.work-more{border-top:1px solid var(--line);padding-top:18px}
.work-more-only{border-top:0;padding-top:6px}
.work-more h2{font-size:16px;font-weight:650;letter-spacing:-.02em;margin-bottom:6px}
.work-rows{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 40px}
.work-row{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:14px;min-height:64px;padding:10px 0;border-bottom:1px solid var(--line)}
.work-row-thumb{width:80px;height:46px;display:grid;place-items:center;border-radius:6px;overflow:hidden;border:1px solid var(--line);background:var(--paper-2);color:#3f648f}
.work-row-thumb img{width:100%;height:100%;object-fit:cover;object-position:top left}
.work-row-thumb .ico,.work-row-thumb svg{width:28px;height:28px}
.work-row-copy{min-width:0}
.work-row-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.work-row h3{font-size:15px;font-weight:600;letter-spacing:-.015em;line-height:1.3}
.work-row-link{font:inherit;color:inherit;text-align:left;border-radius:4px}
/* The title is the control; its pseudo-element makes the whole row the hit area. */
.work-row-link::after{content:'';position:absolute;inset:0;border-radius:8px}
.work-row-meta{font-size:12px;line-height:1.4;color:var(--ink-3)}
.work-row-line{font-size:13.5px;line-height:1.45;color:var(--ink-2);margin-top:2px}
.work-row-chevron{display:inline-flex;color:var(--ink-3);transition:color var(--dur-fast) var(--ease-out)}
.work-row-chevron .ico,.work-row-chevron svg{width:16px;height:16px}
.work-row:hover h3{text-decoration:underline;text-underline-offset:4px}
.work-row:hover .work-row-chevron{color:var(--blue-700)}
.work-row:has(.work-row-link:focus-visible){outline:3px solid var(--blue-500);outline-offset:2px;border-radius:8px}
@supports selector(:has(a)){.work-row-link:focus-visible{outline:none}}

/* ---------- Case study ---------- */
.work-case{max-width:1180px}
.work-case-nav{margin-bottom:18px}
.work-back{height:40px;padding:0 14px 0 10px;font-size:13px;gap:6px}
.work-back .ico,.work-back svg{width:14px;height:14px;transform:scaleX(-1)}
.work-case-lead{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);gap:28px 40px;align-items:start;padding-bottom:28px;border-bottom:1px solid var(--line);margin-bottom:28px}
.work-case-copy{min-width:0}
.work-case h1{font-size:34px;font-weight:650;letter-spacing:-.04em;line-height:1.1;margin:6px 0 12px;width:fit-content}
.work-case-standfirst{font-size:17px;line-height:1.55;color:var(--ink);max-width:46ch}
.work-case .work-role{margin-top:10px;font-size:14px}
.work-case-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px 12px;margin-top:20px}
.work-case .btn{height:40px;font-size:14px}
.work-case .btn.primary{height:40px;padding:0 18px;font-size:14px}
.work-case .btn .ico,.work-case .btn svg{width:16px;height:16px}
.work-case-figure{margin:0;min-width:0}
.work-case-figure img{width:100%;aspect-ratio:1.6;object-fit:cover;object-position:top left;border-radius:12px;border:1px solid var(--line);background:var(--paper-2)}
.work-case-figure figcaption{font-size:12px;line-height:1.5;color:var(--ink-3);margin-top:8px}
.work-case-body{display:grid;gap:26px;max-width:860px}
.work-case-section{display:grid;grid-template-columns:150px minmax(0,1fr);gap:8px 32px;align-items:start}
.work-case-section h2{font-size:14px;font-weight:600;letter-spacing:.01em;color:var(--ink-3);padding-top:3px}
.work-case-section p,.work-case-section li{font-size:15px;line-height:1.6;color:var(--ink-2)}
.work-case-section strong{color:var(--ink);font-weight:600}
.work-case-section ul{margin:0;padding-left:18px;display:grid;gap:6px}
.work-explore{list-style:none;margin:0;padding:0;display:grid;gap:14px}
.work-explore li{display:grid;gap:4px}
.work-explore .project-link{min-height:40px;justify-self:start}

/* Headings receive the reading cursor, not a control-shaped outline.
   Interactive buttons and links retain the shared visible focus rings. */
.work-library h1[tabindex]:focus,.work-case h1[tabindex]:focus{outline:none}
.work-library h1[tabindex]:focus-visible,.work-case h1[tabindex]:focus-visible{outline:none}

/* ---------- Dark theme (site tokens carry the rest) ---------- */
:root[data-theme="dark"] .work-feature-preview .ico,:root[data-theme="dark"] .work-feature-preview svg,
:root[data-theme="dark"] .work-row-thumb{color:var(--blue-300)}
:root[data-theme="dark"] .work-row:hover .work-row-chevron{color:var(--blue-300)}
:root[data-theme="dark"] .work-feature-preview,:root[data-theme="dark"] .work-row-thumb,:root[data-theme="dark"] .work-case-figure img{border-color:var(--line-2)}

/* ---------- Preferences ---------- */
@media (prefers-reduced-motion:reduce){.work-feature-preview img{transition:none}.work-feature-preview:hover img{transform:none}}
:root[data-motion="reduced"] .work-feature-preview:hover img{transform:none}
@media (prefers-contrast:more){.work-role,.work-row-meta,.work-case-figure figcaption,.work-case-section h2{color:var(--ink-2)}}

/* ---------- Laptop and tablet ---------- */
@media (max-width:1100px){
  .work-featured{gap:24px 20px}
  .work-feature h2{font-size:22px}
}
@media (max-width:1000px){
  .work-rows{grid-template-columns:1fr;gap:0}
  .work-case-lead{gap:24px}
}
@media (max-width:900px){
  .work-case-lead{grid-template-columns:1fr}
  .work-case-figure{order:0}
  .work-case-standfirst{max-width:none}
}

/* ---------- Phones ---------- */
@media (max-width:760px){
  .work-library{padding:25px 20px 35px}
  .work-library .collection-heading{gap:12px 16px;margin-bottom:18px}
  .work-library .collection-heading h1{font-size:32px}
  .work-header-actions{padding-top:0}
  .work-header-actions .btn{padding-inline:14px;font-size:13px}
  .work-library .collection-count{margin-top:10px}
  .work-featured{grid-template-columns:1fr;gap:26px;padding:18px 0 22px}
  .work-feature-preview{aspect-ratio:1.6;max-height:none}
  .work-feature h2{font-size:22px}
  .work-feature-line{font-size:15px}
  .work-feature-actions{gap:8px 16px}
  .work-library .btn.primary{padding:0 16px}
  .work-library .project-link{min-height:44px}
  .work-more{padding-top:14px}
  .work-row{gap:12px;min-height:68px}
  .work-row-thumb{width:64px;height:40px}
  .work-row-line{font-size:13px}
  .work-case-nav{margin-bottom:14px}
  .work-case h1{font-size:32px;margin-bottom:10px}
  .work-case-standfirst{font-size:16px}
  .work-case-lead{gap:18px;padding-bottom:22px;margin-bottom:22px}
  .work-case-actions{gap:8px}
  .work-case-body{gap:22px}
  .work-case-section{grid-template-columns:1fr;gap:6px}
  .work-case-section h2{padding-top:0}
  .work-case-section p,.work-case-section li{font-size:15px}
  .work-explore .project-link{min-height:44px}
}
@media (max-width:380px){
  .work-header-actions{width:100%}
  .work-header-actions .btn{flex:1 1 0;padding-inline:10px}
  .work-case-actions .btn{flex:1 1 auto}
}

/* Quiet, explicit destinations for work that is not ready to present. */
.work-pending{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:28px}
.content-placeholder{padding:24px;border:1px dashed var(--line-2,var(--line));border-radius:8px;background:var(--paper);min-width:0}
.content-placeholder .placeholder-label{font-size:13px;color:var(--ink-3);margin:0 0 8px}
.content-placeholder h2{font:600 20px/1.3 -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:-.02em;margin:0 0 10px;color:var(--ink)}
.content-placeholder p:last-child{font-size:15px;line-height:1.6;max-width:58ch;color:var(--ink-2);margin:0}
.placeholder-page{max-width:850px;margin:0 auto;padding:40px 24px;display:grid;gap:20px}
.placeholder-page>.btn{justify-self:start}
.personal-feature-copy h2{font-family:inherit;font-size:30px;letter-spacing:-.025em}
@media(max-width:760px){.work-pending{grid-template-columns:1fr}.placeholder-page{padding:24px 16px}.content-placeholder{padding:20px}}
