/* =====================================================================
   Dan Griffiths — shared styles (homepage + case studies)
   Print-shop paste-up: paper, ink, cobalt, chrome-yellow accents.
   Everything is drawn on a 1440 design grid: N * var(--u) = N design px,
   so the page scales with the window like the Paper artboard, with
   readable minimums on small screens.
   ===================================================================== */
:root {
  --paper: #ECEAE3;
  --paper-hi: #F8F7F2;
  --ink: #121212;
  --graphite: #55524B;
  --rule: #C9C5BA;
  --cobalt: #1F3BFF;
  --chrome: #FFD84A;
  --f-display: "Gasoek One", "Arial Black", Impact, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --f-body: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --s: 1;
  --u: calc(100vw / 1440);   /* replaced by the exact value from JS */
  --gutter: max(16px, calc(48 * var(--u)));
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("paper-scan-tile.webp");
  background-size: calc(900 * var(--u)) calc(600 * var(--u));
  background-position: calc(270 * var(--u)) calc(185 * var(--u));
  font-family: var(--f-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--chrome); outline-offset: 4px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; white-space: nowrap; }

/* shared little type styles */
.mono {
  font: 400 12px/16px var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
}
.label { color: var(--graphite); }

/* ---------- role pills ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--ink); border-radius: 999px; padding: 7px 12px;
  font: 400 12px/16px var(--f-mono); letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap;
}
.pill--ai { background: var(--ink); color: var(--paper); }

/* ---------- nav (on cobalt) ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 28px 48px;
  border-bottom: 1px solid rgba(236, 234, 227, .35);
  font: 400 13px/16px var(--f-mono); letter-spacing: .04em; text-transform: uppercase;
  color: var(--paper);
}
.nav a { color: inherit; text-decoration: none; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav-left { display: flex; gap: 28px; align-items: center; }
.nav-left b { font-weight: 600; }
.nav-left span { color: rgba(236, 234, 227, .75); }

/* ---------- section heading ("Selected work", "Out of home") ---------- */
.sec-head {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between;
  border-bottom: 1px solid var(--ink); padding-bottom: calc(20 * var(--u));
}
.sec-head h2 {
  margin: 0; color: var(--cobalt);
  font: 400 max(38px, calc(96 * var(--u))) / .96 var(--f-display); text-transform: uppercase;
}
.sec-head p { margin: 0; max-width: 360px; color: var(--graphite); font: 400 max(15px, calc(17 * var(--u))) / 1.41 var(--f-body); }

/* ---------- section menu pills (top of Selected work) ---------- */
.sec-menu {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.sec-pill {
  display: inline-flex; align-items: center;
  padding: 14px 26px; border: 1px solid var(--ink); border-radius: 999px;
  font: 400 15px/20px var(--f-mono); letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.sec-pill:hover, .sec-pill.is-active { background: var(--ink); color: var(--paper); }
@media (max-width: 640px) { .sec-pill { padding: 11px 18px; font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { .sec-pill { transition: none; } }

/* homepage: the paper texture lives on .page (which is sticky), not on body,
   so it holds still while the tear plays and then scrolls with the content */
.page {
  background-color: var(--paper);
  background-image: url("paper-scan-tile.webp");
  background-size: calc(900 * var(--u)) calc(600 * var(--u));
  background-position: calc(270 * var(--u)) calc(185 * var(--u));
}

/* =====================================================================
   HOMEPAGE — Selected work
   ===================================================================== */
.work {
  padding: max(16px, calc(19 * var(--u))) var(--gutter) 0;
  display: flex; flex-direction: column; gap: max(24px, calc(40 * var(--u)));
}
/* two-column project grid (Dan, 6 Oct): 660 + 24 + 660 at 1440 */
.work-grid {
  display: grid; grid-template-columns: 1fr 1fr; align-items: start;
  gap: calc(64 * var(--u)) calc(24 * var(--u));
}
.card { display: flex; flex-direction: column; gap: max(14px, calc(20 * var(--u))); min-width: 0; color: inherit; text-decoration: none; }
.shot { position: relative; aspect-ratio: 16 / 9; background: var(--ink); overflow: hidden; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.shot img.zoom120 { transform: scale(1.2); }   /* Lloyds: cropped in 20% (Dan, 5 Oct) */
.shot img { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.card:hover .shot img, .card:focus-visible .shot img { transform: scale(1.025); }
.card:hover .shot img.zoom120, .card:focus-visible .shot img.zoom120 { transform: scale(1.23); }
/* role pills under each project title: smaller than the case-study ones */
.caption .pills { gap: 6px; }
.caption .pill { padding: 5px 9px; font-size: 10px; line-height: 16px; }
.caption {
  display: flex; flex-direction: column; align-items: flex-start; gap: max(14px, calc(20 * var(--u)));
}
.caption h3 {
  margin: 0; color: var(--cobalt);
  font: 400 max(26px, calc(40 * var(--u))) / 1 var(--f-display); text-transform: uppercase;
}

/* =====================================================================
   FOOTER — Let's talk (cobalt with a torn top edge and grain)
   ===================================================================== */
.footer {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; gap: calc(64 * var(--u));
  padding: max(110px, calc(150 * var(--u))) var(--gutter) 36px;
  color: var(--paper);
}
.footer .cobalt, .footer .grain {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  -webkit-mask-image: url("footer-cobalt-mask@2x.png"), linear-gradient(#000, #000);
          mask-image: url("footer-cobalt-mask@2x.png"), linear-gradient(#000, #000);
  -webkit-mask-size: 100% calc(100 * var(--u)), 100% calc(100% - 99 * var(--u));
          mask-size: 100% calc(100 * var(--u)), 100% calc(100% - 99 * var(--u));
  -webkit-mask-position: top, bottom;  mask-position: top, bottom;
  -webkit-mask-repeat: no-repeat;      mask-repeat: no-repeat;
}
.footer .cobalt { background: var(--cobalt); }
.footer .grain {
  background: url("paper-grain-overlay.webp") 50% 50% / calc(900 * var(--u)) calc(600 * var(--u)) repeat;
  mix-blend-mode: overlay; z-index: 2;
}
.footer .fringe {
  position: absolute; left: 0; top: 0; width: 100%; height: calc(100 * var(--u)); z-index: 1; pointer-events: none;
  background: url("footer-edge-shadow-fringe@2x.png") center / 100% 100% no-repeat;
}
.contact-row {
  display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between;
  border-top: 1px solid rgba(236, 234, 227, .5); padding-top: 24px;
}
.contact-row .ask { display: flex; flex-direction: column; gap: 12px; }
.contact-row .email {
  font: 500 max(24px, calc(40 * var(--u))) / 1.1 var(--f-body); letter-spacing: -.02em; text-decoration: none;
}
.contact-row .email:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.socials { display: flex; flex-wrap: wrap; gap: 16px 40px; }
.socials a { font: 400 13px/16px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.socials a:hover { text-decoration: underline; text-underline-offset: 4px; }
.legal { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.legal span { font: 400 11px/14px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: rgba(236, 234, 227, .75); }

/* ---------- "coming soon" toast (cards without a case study yet) ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--chrome);
  font: 500 12px/16px var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .work-grid { grid-template-columns: 1fr; gap: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .toast, .shot img { transition: none; }
}
