/* Shared styles for case study pages (work/<project>/index.html) */
:root{
  --bg:#ffffff; --ink:#111111; --muted:#8a8780; --placeholder:#ececec;
  --pad:20px; --ease:cubic-bezier(.2,.7,.2,1);
  color-scheme:light;
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
html{scroll-padding-top:env(safe-area-inset-top,0px)}
*,*::before,*::after{box-sizing:inherit}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:"Helvetica Now Display","Helvetica Neue",Helvetica,Arial,sans-serif;
  font-size:18px; line-height:1.22; -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
button{font:inherit;color:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer;text-align:left}
a{color:inherit;text-decoration:none}
a:hover,button.link:hover{text-decoration:underline}
:focus-visible{outline:2px solid var(--ink);outline-offset:3px}

/* Header (same as the homepage) */
.site-header{
  display:grid; grid-template-columns:240px 400px auto; column-gap:40px;
  padding:16px var(--pad) 16px; align-items:start;
  position:sticky; top:env(safe-area-inset-top,0px); z-index:10; background:var(--bg);
}
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:10;background:var(--bg)}
.views,.info{display:flex;gap:14px}
.views a{color:var(--muted)}
.sizes{display:flex;gap:10px;margin-left:12px}
.sizes a{color:var(--muted)}

/* Project intro sits on the header's columns */
.intro{
  display:grid; grid-template-columns:240px 400px auto; column-gap:40px;
  padding:40px var(--pad) 56px;
}
.intro h1{margin:0;font-size:18px;font-weight:400}
.intro p{margin:0;max-width:32ch}
.credits{margin:0;display:grid;grid-template-columns:auto 1fr;column-gap:14px;row-gap:2px}
.credits dt{color:var(--muted)}
.credits dd{margin:0}

/* The header sits in a frame snapped to whole screen pixels (case.js); the picture bleeds 1px past it on every side,
   so no hairline of page can show at its edges whatever the window width or zoom */
.hero-frame{position:relative;overflow:hidden;width:100%;aspect-ratio:16/9}
.hero{position:absolute;top:-1px;left:-1px;display:block;width:calc(100% + 2px);height:calc(100% + 2px);object-fit:cover}


.row{display:flex;flex-wrap:wrap;align-items:flex-start;width:100%}
/* centred rows get an exact whole-pixel left pad in case.js */
.tile{
  display:block; position:relative; overflow:hidden; flex:none;
  cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M3 2 L3 20 L8 15.5 L11.5 22.5 L14.5 21 L11 14 L18 14 Z' fill='%2322ff4c' stroke='%23111111' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 3 2, pointer;
  background:var(--bg);
  transform-origin:100% 0;
  transition:transform .45s var(--ease);
}
.tile{scroll-margin-top:70px}
.tile.lift{z-index:5}
.tile img,.tile video{display:block;width:100%;height:100%;object-fit:cover}
.tile:focus-visible{outline-offset:-3px}

.site-footer{margin-top:120px;border-top:1px solid var(--ink);padding:20px var(--pad) 20px;display:flex;justify-content:space-between;gap:20px}

/* Projects menu, beside the size numbers */
.projects{position:relative;margin-left:12px}
.projects>button{color:var(--muted)}
.projects>button[aria-expanded="true"]{color:var(--ink);text-decoration:underline;text-underline-offset:3px}
/* A white band under the header, names lined up under the Projects link; the page stays visible below */
.proj-menu{position:fixed;left:0;right:0;top:var(--menu-top,60px);z-index:15;list-style:none;margin:0;padding:40px var(--pad) 56px var(--menu-left,var(--pad));background:var(--bg);line-height:1.22;text-align:left}
.proj-menu[hidden]{display:none}
.proj-menu a{color:var(--ink)}
.proj-menu a[aria-current="page"]{text-decoration:underline;text-underline-offset:3px}
@media (max-width:700px){
  .views{position:relative}
  .projects{position:absolute;right:0;top:calc(100% + 6px);margin-left:0;text-align:right}
  .proj-menu{text-align:right;padding-left:var(--pad)}
}
@media (max-width:900px){
  .site-header{grid-template-columns:1fr auto;row-gap:6px;padding-bottom:12px}
  .site-header .info{grid-column:1}
  .views{grid-column:2;grid-row:1}
  .intro{grid-template-columns:1fr;row-gap:22px;padding-top:24px;padding-bottom:40px}}
/* Small phones: tighten the nav so "Index Feed 1 2 3 4 5" stays inside the right margin */
@media (max-width:400px){
  .views{gap:10px}
  .sizes{gap:8px;margin-left:8px}
}
@media (prefers-reduced-motion:reduce){
  .tile{transition:none}
}
