/* Work page: every case study on one page, built from the same parts as the case studies, About and Contact
   (Hanken Grotesk, white page, charcoal ink, red accent, pill header, case-study hero) */
:root {
  --ink: #1b1a17;
  --ink-2: #57544c;
  --paper: #ffffff;
  --soft: #f4f3ef;
  --line: rgba(27, 26, 23, 0.14);
  --accent: #D92D20;
  --f: "Hanken Grotesk", system-ui, sans-serif;
  --f-body: var(--f);
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html.lenis, html.lenis body { height: auto; }
body { background: var(--paper); color: var(--ink); font-family: var(--f); font-size: 17px; line-height: 1.55; }
a { color: inherit; }
em { font-style: italic; }
h1 em, h2 em, h3 em, h4 em { font-style: normal; }   /* headings stay upright; colour does the contrast */
img { display: block; max-width: 100%; height: auto; }

/* header */
.h-header { position: fixed; inset: 0 0 auto; z-index: 50; display: flex; justify-content: space-between; align-items: center; padding: 18px var(--gutter); pointer-events: none; }
.pill {
  pointer-events: auto; text-decoration: none; font-weight: 600; font-size: 13px; letter-spacing: 0.02em;
  padding: 8px 15px; border-radius: 999px; background: rgba(255, 255, 255, 0.88); color: var(--ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 0 0 1px var(--line);
}
.h-crumb { font-weight: 500; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.pill-line { background: var(--ink); color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16); }   /* the faint edge keeps it visible over dark sections */
.pill:hover { background: var(--ink); color: #fff; }
.pill-line:hover { background: var(--accent); }
.pill:focus-visible, main a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* shared bits */
section { padding: clamp(80px, 11vw, 150px) var(--gutter); }
.h-label { font-weight: 500; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.h-h2 { font-weight: 500; font-size: clamp(38px, 5vw, 76px); line-height: 0.98; letter-spacing: -0.045em; margin-top: 14px; }
.h-h2 span { color: #6b675f; }
.h-sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 48px; flex-wrap: wrap; margin-bottom: clamp(36px, 5vw, 64px); }
.h-sec-note { color: var(--ink-2); max-width: 24rem; }
.h-no { font-weight: 600; font-size: 13px; color: var(--accent); font-variant-numeric: tabular-nums; }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- hero (mirrors .p-hero on the case studies) ---------- */
.h-hero { padding-top: 17vh; padding-bottom: clamp(56px, 7vw, 100px); }
.h-title { font-weight: 500; font-size: clamp(64px, 14.5vw, 250px); line-height: 0.86; letter-spacing: -0.06em; margin-left: -0.04em; }
.h-line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.h-line > span { display: inline-block; }
.h-line:first-child > span { color: var(--accent); }
.js .h-line > span { transform: translateY(105%); transition: transform 1.1s cubic-bezier(0.7, 0, 0.2, 1); }
.js .h-line:nth-child(2) > span { transition-delay: 0.08s; }
.is-ready .h-line > span { transform: none; }
.h-intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); margin: clamp(32px, 5vw, 64px) 0 clamp(40px, 6vw, 72px); }
.h-lede { font-size: clamp(20px, 1.8vw, 28px); line-height: 1.42; letter-spacing: -0.01em; max-width: 34rem; text-wrap: pretty; }
.h-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; align-content: start; }
.h-meta dt { font-weight: 500; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.h-meta dd { font-size: 16px; line-height: 1.4; }
.h-meta a { text-decoration: none; border-bottom: 1px solid currentColor; }
.h-meta a:hover { color: var(--accent); }
.h-clock { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.h-dot, .ct-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2fae63; margin-right: 8px; vertical-align: 1px; }

/* client logos on their own brand colours */
.h-clients { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.h-clients li { aspect-ratio: 16 / 10; border-radius: 14px; background: var(--wb); display: grid; place-items: center; overflow: hidden; }
.h-clients img { width: var(--lw); height: auto; max-height: 62%; object-fit: contain; transition: transform 0.5s var(--ease); }
.h-clients li:hover img { transform: scale(1.06); }
.h-word { font-weight: 700; font-size: clamp(14px, 1.4vw, 20px); letter-spacing: 0.18em; }

/* ---------- selected work ---------- */
.h-work { border-top: 1px solid var(--line); }
.h-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 5vw, 72px) clamp(16px, 2vw, 28px); }
.h-card { display: flex; flex-direction: column; gap: 18px; text-decoration: none; }
.h-card-wide { grid-column: 1 / -1; }
.h-media { aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; background: var(--cb, var(--soft)); }
.h-card-wide .h-media { aspect-ratio: 16 / 9; }
.h-media img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.9s var(--ease); }   /* whole cover; the brand colour fills any spare edge */
.h-card:hover .h-media img { transform: scale(1.035); }
.h-card-text { display: grid; grid-template-columns: 3rem 1fr; column-gap: 8px; align-items: baseline; }
.h-card-text .h-no { grid-row: span 2; }
.h-card h3 { font-weight: 500; font-size: clamp(24px, 2.2vw, 34px); line-height: 1.05; letter-spacing: -0.03em; }
.h-card-wide h3 { font-size: clamp(30px, 3.2vw, 48px); }
.h-arrow { display: inline-block; color: var(--accent); transition: transform 0.35s var(--ease); }
.h-card:hover .h-arrow { transform: translateX(6px); }
.h-tags { margin-top: 6px; font-size: 15px; color: var(--ink-2); }

/* ---------- what I do ---------- */
.h-services { background: var(--soft); }
.h-more { font-weight: 600; text-decoration: none; padding: 12px 20px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--ink); transition: background 0.2s ease, color 0.2s ease; }
.h-more span { display: inline-block; transition: transform 0.3s ease; }
.h-more:hover { background: var(--ink); color: #fff; }
.h-more:hover span { transform: translateX(3px); }
.h-svc { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.h-svc li { display: flex; flex-direction: column; gap: 10px; padding: 24px 22px 26px; border-radius: 18px; background: #fff; min-height: 240px; }
.h-svc h3 { margin-top: auto; font-weight: 500; font-size: clamp(22px, 1.9vw, 28px); line-height: 1.05; letter-spacing: -0.03em; }
.h-svc p { font-size: 15px; color: var(--ink-2); }

/* ---------- journey teaser ---------- */
.h-journey-card {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: stretch;
  text-decoration: none; padding: clamp(24px, 3.5vw, 48px); border-radius: 24px; box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.3s ease;
}
.h-journey-card:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.h-journey-text { display: flex; flex-direction: column; }
.h-years { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: clamp(28px, 4vw, 48px) 0 32px; }
.h-years li { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--soft); font-size: 14px; color: var(--ink-2); }
.h-years b { font-weight: 600; font-size: 16px; color: var(--ink); }
.h-years li:last-child { background: var(--ink); color: rgba(255, 255, 255, 0.7); }
.h-years li:last-child b { color: #fff; }
.h-btn { margin-top: auto; align-self: flex-start; font-weight: 600; font-size: 15px; line-height: 1; padding: 16px 24px; border-radius: 999px; background: var(--accent); color: #fff; transition: background 0.2s ease; }
.h-btn span { display: inline-block; transition: transform 0.3s ease; }
.h-journey-card:hover .h-btn { background: #B8231A; }
.h-journey-card:hover .h-btn span { transform: translateX(4px); }
.h-journey-media { align-self: center; justify-self: end; width: min(100%, 380px); aspect-ratio: 1091 / 1364; border-radius: 16px; overflow: hidden; background: var(--soft); }   /* the portrait's own shape: nothing cut */
.h-journey-media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.25) brightness(1.05); transition: filter 0.8s ease, transform 0.9s var(--ease); }
.h-journey-card:hover .h-journey-media img { filter: none; transform: scale(1.03); }   /* pencil grey to colour, like the journey itself */

/* ---------------- Contact: the dark closing block ---------------- */
.contact {
  --c-ink: #141412; --c-line: rgba(255, 255, 255, 0.14); --c-dim: rgba(255, 255, 255, 0.58);
  position: relative; overflow: hidden; background: var(--c-ink); color: #fff;
  min-height: 100svh; padding: clamp(120px, 16vh, 180px) var(--gutter) 28px;
  display: flex; flex-direction: column; gap: clamp(56px, 8vw, 110px);
}
.ct-eyebrow { font-weight: 500; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-dim); margin-bottom: 22px; }
.ct-title { font-weight: 500; font-size: clamp(52px, 8.4vw, 132px); line-height: 0.94; letter-spacing: -0.05em; }
.ct-title em { color: rgba(255, 255, 255, 0.5); }
.ct-mark { position: relative; display: inline-block; color: #fff; }
.ct-mark svg { position: absolute; left: -2%; bottom: -0.1em; width: 104%; height: 0.24em; overflow: visible; }
.ct-mark path { fill: none; stroke: #D92D20; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 320; stroke-dashoffset: 320; transition: stroke-dashoffset 1.2s cubic-bezier(0.6, 0, 0.2, 1) 0.2s; }
.contact.is-in .ct-mark path { stroke-dashoffset: 0; }

.ct-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 110px); align-items: end; }
.ct-label { font-weight: 500; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-dim); }
.ct-email {
  display: inline-flex; align-items: flex-start; gap: 0.12em; margin-top: 14px; color: #fff; text-decoration: none;
  font-weight: 500; font-size: clamp(30px, 4.6vw, 76px); line-height: 1.05; letter-spacing: -0.04em;
  background: linear-gradient(#D92D20, #D92D20) 0 100% / 0 3px no-repeat; padding-bottom: 8px; transition: background-size 0.5s cubic-bezier(0.6, 0, 0.2, 1);
}
.ct-email:hover, .ct-email:focus-visible { background-size: 100% 3px; }
.ct-arrow { font-size: 0.55em; color: #D92D20; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ct-email:hover .ct-arrow { transform: translate(4px, -4px); }
.ct-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.ct-btn {
  font: 600 15px/1 var(--f); cursor: pointer; text-decoration: none; color: #fff; border: 0;
  padding: 16px 24px; border-radius: 999px; background: #D92D20; transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.ct-btn span { display: inline-block; transition: transform 0.3s ease; }
.ct-btn:hover { background: #B8231A; }
.ct-btn:hover span { transform: translateX(4px); }
.ct-btn-line { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35); }
.ct-btn-line:hover { background: #fff; color: var(--c-ink); box-shadow: none; }
.ct-btn-line.is-done { background: #fff; color: var(--c-ink); }
.contact :focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.ct-facts { display: flex; flex-direction: column; }
.ct-fact { display: grid; grid-template-columns: 8.5rem 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--c-line); }
.ct-fact:last-child { border-bottom: 1px solid var(--c-line); }
.ct-fact .ct-label { padding-top: 4px; }
.ct-fact dd { font-size: 17px; font-weight: 500; }
.ct-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3ecf7a; margin-right: 10px; vertical-align: 2px; }
.ct-clock { color: var(--c-dim); font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: 6px; }
.ct-links { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ct-links a { color: #fff; text-decoration: none; transition: color 0.2s ease; }
.ct-links a:hover { color: #ff6b5e; }

.ct-foot { margin-top: auto; }
.ct-wordmark {
  font-weight: 600; font-size: 15.5vw; line-height: 0.8; letter-spacing: -0.065em; white-space: nowrap;
  margin: 0 0 0 -0.05em; color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, 0.22);
  user-select: none;
}
.ct-fine { display: flex; flex-wrap: wrap; gap: 10px 36px; padding-top: 22px; margin-top: 18px; border-top: 1px solid var(--c-line); font-size: 14px; color: var(--c-dim); }
.ct-top { color: #fff; text-decoration: none; font-weight: 600; }
.ct-top:hover { color: #ff6b5e; }

@media (max-width: 820px) {
  .ct-grid { grid-template-columns: 1fr; }
  .ct-fact { grid-template-columns: 7rem 1fr; }
  .ct-email { font-size: clamp(24px, 7.6vw, 40px); }
  .ct-wordmark { font-size: 17vw; }
  .ct-fine { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .ct-mark path { transition: none; stroke-dashoffset: 0; }
  .ct-email, .ct-arrow, .ct-btn, .ct-btn span { transition: none; }
}

/* grain */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.8s steps(4) infinite;
}
@keyframes grain { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } }

@media (max-width: 1080px) {
  .h-clients { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .h-svc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .h-crumb { display: none; }
  .h-hero { padding-top: 120px; }
  .h-intro { grid-template-columns: 1fr; }
  .h-clients { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .h-clients li:last-child { grid-column: 1 / -1; aspect-ratio: 32 / 10; }
  .h-grid { grid-template-columns: 1fr; }
  .h-svc { grid-template-columns: 1fr; }
  .h-svc li { min-height: 0; }
  .h-svc h3 { margin-top: 12px; }
  .h-journey-card { grid-template-columns: 1fr; }
  .h-journey-media { order: -1; justify-self: start; width: min(100%, 300px); }
}
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .js .reveal, .js .h-line > span { transition: none; opacity: 1; transform: none; }
  .h-media img, .h-journey-media img, .h-clients img, .h-arrow { transition: none; }
}
