/* The final sheet opens directly onto a horizontally browsable work archive. */
body { overflow-x:clip; }
#work,.gallery-carousel { min-width:0; }
.gallery-carousel { width:100%; max-width:100%; }
#work .gallery-heading {
  display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap;
  gap:14px 36px; padding:0 0 clamp(16px,2vw,30px); border-bottom:1px solid var(--ink);
}
.gallery-heading h2 {
  margin:0; font-size:clamp(45px,5.6vw,88px); font-weight:550;
  letter-spacing:-.078em; line-height:1.04;
}
.gallery-heading h2 span { color:var(--blue); }
.gallery-types { display:flex; flex-wrap:wrap; align-items:center; gap:5px 18px; }
.gallery-filter {
  display:inline-flex; align-items:center; gap:5px; padding:7px 0; min-height:44px;
  background:transparent; font-size:14px; font-weight:470; color:#59616a;
}
.gallery-filter[aria-pressed=true] { color:var(--ink); box-shadow:inset 0 -2px var(--blue); }
.filter-count {
  font-size:12px; align-self:center; transform:translateY(-.38em);
  font-variant-numeric:tabular-nums; font-weight:550;
}
.gallery-filter[aria-pressed=true] .filter-count { color:var(--blue); }
.gallery-count {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip-path:inset(50%); white-space:nowrap;
}
.work-spread {
  --card-width:68%; --card-gap:clamp(18px,2.4vw,40px);
  position:relative; display:flex; align-items:flex-start; gap:var(--card-gap);
  width:100%; max-width:100%; list-style:none;
  padding:6px 0; margin:clamp(18px,2.3vw,36px) 0 0;
  overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain;
  scroll-snap-type:x mandatory; scroll-behavior:smooth; overflow-anchor:none;
  scrollbar-width:none; -ms-overflow-style:none; cursor:grab;
}
.work-spread::-webkit-scrollbar { display:none; }
.work-spread::after {
  content:""; flex:0 0 calc(100% - var(--card-width) - var(--card-gap));
  min-width:0; height:1px; pointer-events:none;
}
.archive-entry {
  flex:0 0 var(--card-width); min-width:0;
  scroll-snap-align:start; scroll-snap-stop:always;
}
.work-spread.is-dragging { scroll-snap-type:none; scroll-behavior:auto; }
.work-spread.is-dragging,#work .work-spread.is-dragging .archive-card { cursor:grabbing; }
#work .archive-card {
  display:block; width:100%; background:transparent; text-align:left; color:var(--ink); border-radius:0;
  cursor:grab; user-select:none; -webkit-user-select:none;
}
.archive-plate {
  display:grid; place-items:center; overflow:hidden; width:100%; aspect-ratio:1.58;
  padding:clamp(18px,2.4vw,45px); background:#e0e2e6;
  background:linear-gradient(140deg,#d2d6de 0%,#e8e9eb 57%,#d6dae1 100%);
}
.archive-plate img {
  display:block; width:100%; height:auto; max-height:100%; object-fit:contain;
  box-shadow:0 2px 3px #21283319,0 12px 25px -12px #17223b5c;
  transition:transform .45s var(--ease),box-shadow .45s var(--ease);
  -webkit-user-drag:none; user-select:none; pointer-events:none;
}
.archive-card[data-case=work-handwriting] .archive-plate {
  background:linear-gradient(130deg,#e5e0d7,#f1eee7 63%,#ded8cb);
}
.archive-caption {
  display:flex; justify-content:space-between; align-items:flex-end; gap:12px;
  padding:clamp(15px,1.6vw,26px) 0 0;
}
.archive-label { display:grid; gap:7px; min-width:0; }
.archive-kind { font-size:14px; font-weight:450; color:#515b63; }
.archive-caption strong { font-size:clamp(29px,2.8vw,47px); font-weight:550; letter-spacing:-.066em; line-height:1.1; overflow-wrap:anywhere; }
.archive-open {
  flex:none; padding-bottom:2px; border-bottom:1px solid #8f9699;
  color:#41494f; font-size:14px; line-height:1.45;
}
.work-spread[data-single=true] { scroll-snap-type:none; cursor:auto; }
.work-spread[data-single=true]::after { display:none; }
.work-spread[data-single=true] .archive-entry { flex-basis:100%; }
#work .work-spread[data-single=true] .archive-card {
  display:grid; grid-template-columns:minmax(0,1.36fr) minmax(0,1fr);
  gap:var(--card-gap); align-items:end; cursor:pointer;
}
.work-spread[data-single=true] .archive-caption {
  border-top:1px solid var(--rule); align-self:end;
}
.gallery-navigation {
  display:flex; justify-content:space-between; align-items:center; gap:16px;
  margin-top:22px; padding-top:16px; border-top:1px solid var(--rule);
}
.gallery-hint { margin:0; font-size:14px; line-height:1.5; color:#59616a; }
.gallery-controls { display:flex; align-items:center; gap:9px; margin-left:auto; flex:none; }
.gallery-position {
  min-width:56px; margin-right:7px; text-align:center; white-space:nowrap;
  font-size:14px; font-variant-numeric:tabular-nums; color:#515b63;
}
.gallery-previous,.gallery-next {
  display:grid; place-items:center; flex:none; width:46px; height:46px; padding:0;
  border:1px solid #aeb4b7; border-radius:50%; background:transparent;
  color:var(--ink); cursor:pointer; transition:color .2s,border-color .2s,background-color .2s;
}
.gallery-previous svg,.gallery-next svg {
  display:block; width:18px; height:18px; fill:none; stroke:currentColor;
  stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round;
}
.gallery-previous:disabled,.gallery-next:disabled { opacity:.35; cursor:default; }
.gallery-more { display:block; margin:40px auto 0; padding:12px 24px; min-height:44px; border:1px solid var(--rule); border-radius:24px; background:transparent; }
.gallery-empty { margin:32px 0; color:#515b63; }
.work-spread > [hidden],.gallery-more[hidden],.gallery-empty[hidden],
.gallery-navigation[hidden],.gallery-hint[hidden],.gallery-controls[hidden] { display:none; }
#work :is(.archive-card,.gallery-filter,.gallery-more,.gallery-previous,.gallery-next,.work-spread):focus-visible,.project-mobile summary:focus-visible {
  outline:2px solid var(--blue); outline-offset:4px;
}
#work .archive-card:focus-visible { outline-offset:-2px; }
@media (hover:hover) {
  .archive-card:hover .archive-plate img { transform:translateY(-2px); box-shadow:0 2px 3px #21283316,0 17px 28px -12px #17223b68; }
  .archive-card:hover .archive-open,.gallery-filter:hover,.gallery-more:hover { color:var(--blue); }
  :is(.gallery-previous,.gallery-next):hover:not(:disabled) { color:var(--blue); border-color:var(--blue); background:#243acb07; }
}

/* Read the design decision alongside the finished screen. */
#case[data-study^=work-] .case-intro { padding:clamp(28px,4vw,65px) 0 clamp(20px,2.4vw,38px); }
.project-spread {
  display:grid; grid-template-columns:minmax(0,1.8fr) minmax(245px,1fr);
  align-items:start; gap:clamp(24px,3.5vw,60px);
}
.project-views { min-width:0; }
.project-views figure { margin:0; }
.project-views img { display:block; border:1px solid var(--rule); width:100%; height:auto; }
.project-views figcaption { margin-top:9px; font-size:12px; color:#53606a; }
.project-mobile { margin-top:16px; border-top:1px solid var(--rule); }
.project-mobile summary {
  display:list-item; width:fit-content; cursor:pointer; padding:13px 0;
  min-height:44px; font-size:14px;
}
.project-mobile img { width:min(100%,320px); margin-bottom:15px; }
.project-notes { min-width:0; }
.project-decision { margin-bottom:clamp(24px,3vw,44px); }
.project-decision h3 {
  margin:0 0 .65rem; font-size:clamp(22px,2.1vw,34px);
  font-weight:550; line-height:1.25; letter-spacing:-.055em;
}
.project-decision p { margin:0; font-size:1rem; line-height:1.7; overflow-wrap:anywhere; }
#case[data-study^=work-] .case-intro h2 { margin-bottom:0; }
#case[data-study^=work-] .case-copy {
  margin-top:clamp(26px,4vw,60px); border-top:1px solid var(--rule);
  padding-block:clamp(23px,3.1vw,52px);
}
#case[data-study^=work-] .case-copy p { margin-top:0; }
#case[data-study^=work-] #case-consult { min-height:44px; }
.project-facts { border-top:2px solid var(--ink); }
.project-facts h3 {
  margin:18px 0 24px; font-size:clamp(24px,2.2vw,35px); font-weight:540;
  letter-spacing:-.055em;
}
.project-facts dl { display:grid; grid-template-columns:max-content 1fr; margin:0; }
.project-facts :is(dt,dd) { margin:0; padding:14px 0; border-top:1px solid var(--rule); font-size:14px; line-height:1.6; }
.project-facts dt { color:#535b60; padding-right:clamp(16px,2.4vw,42px); }
.project-facts dd { color:var(--ink); overflow-wrap:anywhere; }
.project-site-link {
  display:inline-flex; align-items:center; flex-wrap:wrap; gap:0 .4em;
  min-height:44px; max-width:100%; margin-top:.25rem;
  color:var(--blue); font-size:1rem; font-weight:550;
  text-decoration:underline; text-underline-offset:.25em;
}
.project-site-link:hover { color:var(--ink); }
.project-site-tab { font-size:.875rem; font-weight:400; }
/* Crawler/JS-off fallback cards; removed by work-gallery.js when interactive gallery mounts. */
.seo-fallback {
  list-style:none; margin:0; padding:1.25rem 0; border-top:1px solid var(--rule);
}
.seo-fallback article { margin:0; }
.seo-fallback h3 { margin:0 0 .35rem; font-size:clamp(1.35rem,2.4vw,2rem); font-weight:550; letter-spacing:-.04em; }
.seo-fallback p { margin:.25rem 0; font-size:14px; line-height:1.6; color:#535b60; }
.seo-fallback a { color:var(--blue); text-decoration:underline; text-underline-offset:.2em; }
@media (max-width:760px) {
  #work .gallery-heading { display:block; padding-bottom:0; }
  .gallery-heading h2 { font-size:clamp(40px,10vw,62px); }
  .gallery-types { margin-top:12px; gap:0 16px; }
  .gallery-filter { font-size:14px; }
  .work-spread { --card-width:87%; --card-gap:16px; margin-top:17px; }
  .archive-plate { aspect-ratio:1.53; padding:16px; }
  #work .work-spread[data-single=true] .archive-card { display:block; }
  .work-spread[data-single=true] .archive-caption { border:0; }
  .archive-label { gap:6px; }
  .archive-caption { padding-top:14px; flex-wrap:wrap; }
  .gallery-navigation { gap:12px; margin-top:18px; padding-top:14px; }
  .gallery-controls { gap:7px; }
  .gallery-position { min-width:50px; margin-right:3px; }
  .project-spread { grid-template-columns:minmax(0,1fr); gap:23px; }
  .project-facts h3 { margin:14px 0 18px; }
  .project-facts :is(dt,dd) { padding-block:11px; }
}
@media (prefers-reduced-motion:reduce) {
  .work-spread { scroll-behavior:auto; }
  .gallery-previous,.gallery-next { transition:none; }
  .archive-plate img { transition:none; }
  .archive-card:hover .archive-plate img { transform:none; }
}
