/* Shared styles for the project case-study pages */
:root { color-scheme: light; --ink: #000; --soft: #7a7a7a; --line: #e0e0e0; --frame: 1080px; --pad: 44px; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: "Inter", system-ui, sans-serif; color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.frame {
  max-width: var(--frame); margin: 0 auto; padding: 0 var(--pad); position: relative;
  border-left: 1px solid var(--guide, var(--line)); border-right: 1px solid var(--guide, var(--line));
}

/* top bar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .frame { display: flex; justify-content: space-between; align-items: center; height: 64px; }
.back { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; text-decoration: none; }
.back:hover { opacity: .6; }
.name-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; padding: 5px 12px 5px 6px; border-radius: 999px; background: #fff; box-shadow: 0 4px 14px -4px rgba(0,0,0,.14); text-decoration: none; }
.name-pill img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; }

/* hero */
.p-hero { background: var(--brand); color: #fff; --guide: rgba(255,255,255,.35); }
.p-hero .frame { padding-top: 88px; padding-bottom: 64px; }
.eyebrow { font-size: 14px; font-weight: 500; opacity: .8; }
.p-hero h1 { font-size: 64px; line-height: 1.08; font-weight: 300; letter-spacing: -.04em; margin: 18px 0 40px; max-width: 860px; }
.p-hero h1 b { font-weight: 500; }
.intro { display: grid; grid-template-columns: 1fr 390px; gap: 60px; align-items: end; }
.intro p { font-size: 17px; line-height: 28px; max-width: 520px; }   /* text styles: large 17/28, body 16/26, small 14/22 */
.meta { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(255,255,255,.35); }
.meta div { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.35); }
.meta dt { font-size: 12px; opacity: .7; margin-bottom: 4px; }
.meta dd { font-size: 14px; font-weight: 500; }
.live { display: inline-flex; gap: 8px; margin-top: 22px; font-size: 16px; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.live:hover { opacity: .75; }
.p-cover { margin-top: 56px; overflow: hidden; }
.p-cover img { width: 100%; aspect-ratio: 764/465; object-fit: cover; }

/* body blocks */
.block .frame { padding-top: 96px; padding-bottom: 0; }
.block:last-of-type .frame { padding-bottom: 110px; }
.block-head { display: grid; grid-template-columns: 357px 1fr; gap: 0; margin-bottom: 36px; }
.block-head h2 { font-size: 30px; line-height: 1.15; font-weight: 400; letter-spacing: -.03em; }
.block-head p { font-size: 16px; line-height: 26px; color: #555; max-width: 520px; }
.cols-1 > figure + figure { margin-top: 24px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cols-wide { display: grid; grid-template-columns: 556fr 322fr; gap: 0; }
figure { position: relative; }
figure img { width: 100%; background: #f2f2f2; }
figcaption { font-size: 13px; color: var(--soft); margin-top: 10px; }
.zoom { cursor: zoom-in; transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .5s; }
.zoom:hover { transform: translateY(-3px); box-shadow: 0 24px 40px -24px rgba(0,0,0,.35); }

/* scrollable device frames for full-length pages */
.devices { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.browser { border: 1px solid #ddd; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 30px 60px -30px rgba(0,0,0,.3); }
.browser .bar { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 14px; background: #f3f3f3; border-bottom: 1px solid #e3e3e3; }
.browser .bar i { width: 10px; height: 10px; border-radius: 50%; background: #d6d6d6; }
.scroller { height: 620px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.scroller img { width: 100%; background: none; }
.phone { border: 10px solid #111; border-radius: 40px; overflow: hidden; background: #111; box-shadow: 0 30px 60px -30px rgba(0,0,0,.4); }
.phone .scroller { height: 600px; border-radius: 30px; }
.devices.solo { grid-template-columns: 1fr; }
.phones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; max-width: 900px; }
.phones .phone img { width: 100%; border-radius: 30px; background: none; }
.hint { font-size: 13px; color: var(--soft); margin-top: 12px; display: flex; gap: 6px; align-items: center; }

.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stats div { flex: 1; min-width: 180px; border: 1px solid var(--line); padding: 26px 22px; }
.stats b { display: block; font-size: 44px; font-weight: 400; letter-spacing: -.04em; }
.stats span { font-size: 14px; color: var(--soft); }

/* next project */
.next { display: block; background: var(--next); color: #fff; text-decoration: none; --guide: rgba(255,255,255,.35); }
.next .frame { padding-top: 72px; padding-bottom: 80px; }
.next .label { font-size: 14px; opacity: .75; }
.next h3 { font-size: 56px; font-weight: 300; letter-spacing: -.04em; margin-top: 10px; display: flex; align-items: center; gap: 20px; }
.next h3 span { transition: transform .35s ease; display: inline-block; }
.next:hover h3 span { transform: translateX(10px); }

/* footer */
.footer { background: #000; color: #fff; }
.footer .frame { border: 0; display: flex; justify-content: space-between; align-items: center; padding-top: 36px; padding-bottom: 40px; font-size: 14px; }
.footer a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.footer .muted { color: #8a8a8a; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.88); display: none; overflow: auto; padding: 40px; cursor: zoom-out; }
.lightbox.open { display: block; }
.lightbox img { margin: 0 auto; max-width: min(1400px, 100%); }

/* reveal */
.reveal.in { animation: rise .8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { transform: translateY(18px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

@media (max-width: 1100px) {
  .frame { border: 0; padding: 0 24px; }
  .p-hero h1 { font-size: clamp(36px, 8vw, 64px); }
  .intro, .block-head, .devices { grid-template-columns: 1fr; gap: 28px; }
  .block-head { gap: 12px; }
  .devices .phone { max-width: 300px; }
  .next h3 { font-size: clamp(34px, 8vw, 56px); }
}
@media (max-width: 640px) {
  .cols-2, .cols-wide { grid-template-columns: 1fr; gap: 20px; }
  .phones { grid-template-columns: 1fr 1fr; gap: 16px; }
  .scroller { height: 460px; }
  .footer .frame { flex-direction: column; gap: 12px; align-items: flex-start; }
  .lightbox { padding: 12px; }
}

  /* images wipe in from left to right as they scroll into view (only once JS is running) */
  .wipe-on .wipe { clip-path: inset(0 100% 0 0); }
  .wipe-on .wipe.wiped { clip-path: inset(0 0 0 0); transition: clip-path 1.2s cubic-bezier(.77,0,.18,1); transition-delay: var(--wd, 0s); }
  @media (prefers-reduced-motion: reduce) { .wipe-on .wipe { clip-path: none; } }

/* ---------- Case-study layout v2: colour bands tie each page back to its project ---------- */
.p-hero { color: var(--brand-ink, #fff); }
.p-hero .meta, .p-hero .meta div { border-color: color-mix(in srgb, currentColor 30%, transparent); }
.p-hero, .p-quote { --guide: color-mix(in srgb, var(--brand-ink, #fff) 28%, transparent); }

/* media blocks: heading and text stacked above the images, like a story */
.block-head { grid-template-columns: 1fr; gap: 12px; max-width: 660px; }
.block-head h2 { font-size: 32px; }

/* client / team quote on the project colour */
.p-quote { background: var(--brand); color: var(--brand-ink, #fff); margin-top: 110px; }
.p-quote .frame { padding-top: 96px; padding-bottom: 96px; text-align: center; }
.p-quote .qmark { width: 28px; height: 22px; opacity: .8; }
.p-quote blockquote { font-size: 32px; line-height: 1.3; letter-spacing: -.025em; font-weight: 400; max-width: 860px; margin: 26px auto 28px; text-wrap: balance; }
.p-quote .by { font-size: 14px; line-height: 22px; opacity: .85; }
.p-quote .by b { font-weight: 600; }

/* more projects: each card wears its own project colour */
.more .frame { padding-top: 110px; padding-bottom: 110px; }
.more h2 { font-size: 44px; font-weight: 500; letter-spacing: -.035em; margin-bottom: 36px; }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.more-card { display: flex; flex-direction: column; gap: 18px; padding: 16px 16px 22px; border-radius: 18px; background: var(--card); color: var(--card-ink); text-decoration: none; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.more-card:hover { transform: translateY(-4px); }
.more-card img { width: 100%; aspect-ratio: 764 / 465; object-fit: cover; border-radius: 10px; }
.more-meta { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 0 6px; align-items: end; }
.more-meta b { font-size: 24px; font-weight: 500; letter-spacing: -.02em; }
.more-meta span { grid-row: 2; font-size: 14px; opacity: .8; }
.more-meta i { grid-row: 1 / 3; grid-column: 2; font-style: normal; font-size: 14px; font-weight: 600; align-self: center; transition: transform .25s ease; }
.more-card:hover .more-meta i { transform: translateX(4px); }

/* closing call to action */
.p-cta { background: #000; color: #fff; }
.p-cta .frame { border: 0; padding-top: 110px; padding-bottom: 40px; }
.p-cta h2 { font-size: 64px; line-height: 1.05; font-weight: 500; letter-spacing: -.045em; }
.p-cta h2 span { color: #7d7d7d; }
.cta-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 48px; padding-bottom: 28px; border-bottom: 1px solid #3a3a3a; }
.cta-mail { font-size: 22px; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.cta-links { display: flex; gap: 22px; font-size: 15px; }
.cta-links a { text-decoration: none; color: #bdbdbd; }
.cta-links a:hover, .cta-mail:hover { color: #fff; opacity: .8; }
.cta-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; font-size: 13px; color: #8a8a8a; }

@media (max-width: 1100px) {
  .p-quote blockquote { font-size: clamp(22px, 5vw, 32px); }
  .p-cta h2 { font-size: clamp(36px, 9vw, 64px); }
}
@media (max-width: 640px) {
  .more-grid { grid-template-columns: 1fr; }
  .p-quote { margin-top: 80px; }
  .p-quote .frame { padding-top: 64px; padding-bottom: 64px; }
  .cta-mail { font-size: 17px; word-break: break-all; }
}

/* ---------- Same floating nav as the home page ---------- */
:root { --ink-soft: #7a7a7a; }
.topnav ul { margin: 0; padding: 0; }
  /* frosted band behind the nav: content scrolling up blurs and fades out */
  .top-glass { position: fixed; top: 0; left: 0; right: 0; z-index: 45; pointer-events: none;
    height: calc(80px + env(safe-area-inset-top, 0px));
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.6) 40%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.6) 40%, transparent 100%); }

  /* ---------- Top nav ---------- */
  .topnav {
    position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 50;
    display: flex; align-items: center; gap: 34px; white-space: nowrap;
    background: rgba(255,255,255,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(0,0,0,.08); border-radius: 999px; padding: 6px 6px 6px 7px;
    box-shadow: 0 10px 30px -14px rgba(0,0,0,.25);
  }
  .topnav .me { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; text-decoration: none; color: #000; }
  .topnav .me img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: 50% 28%; }
  .topnav ul { display: flex; gap: 22px; list-style: none; font-size: 14px; font-weight: 500; }
  .topnav ul a { text-decoration: none; color: #000; }
  .topnav ul a:hover { color: var(--ink-soft); }
  .topnav .nav-cta { font-size: 14px; font-weight: 600; text-decoration: none; color: #000; background: #f2f2f2; border: 1px solid #e4e4e4; border-radius: 999px; padding: 9px 18px; }
  .topnav .nav-cta:hover { background: #000; color: #fff; border-color: #000; }
  a:focus-visible { outline: 2px solid #29aeff; outline-offset: 3px; border-radius: 4px; }

  /* nav keeps its width: while scrolling down the links fade out and a typed line fades in, in the same spot */
  .topnav { gap: 0; width: max-content; }   /* centred with left: 50%, so without this it is capped at half the screen and squeezes the menu */
  .nav-swap { display: grid; align-items: center; margin-left: 34px; overflow: hidden;
    width: var(--menu-w, auto); transition: width .55s cubic-bezier(.2,.8,.2,1); }
  .topnav.collapsed:not(.peek):not(:focus-within) .nav-swap { width: var(--msg-w, auto); }
  .topnav.collapsed.peek .nav-swap { width: max(var(--menu-w, 0px), var(--msg-w, 0px)); }   /* never shrink on hover */
  .nav-swap > * { grid-area: 1 / 1; }
  .nav-menu { display: flex; align-items: center; gap: 34px; white-space: nowrap; transition: opacity .3s ease, transform .3s ease; }
  .nav-msg { display: block; opacity: 0; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: clip; font-size: 14px; font-weight: 500; color: #555; transition: opacity .3s ease; }
  .topnav.collapsed:not(.peek):not(:focus-within) .nav-menu { opacity: 0; transform: translateY(-3px); pointer-events: none; }
  .topnav.collapsed:not(.peek):not(:focus-within) .nav-msg { opacity: 1; }
  .nav-msg .caret { display: inline-block; width: 1.5px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: currentColor; animation: blink 1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { .nav-menu, .nav-msg { transition: none; } .nav-msg .caret { animation: none; } }


.p-hero .frame { padding-top: 129px; }   /* 64px below the nav pill, same as the home page */
@media (max-width: 1100px) { .p-hero .frame { padding-top: 113px; } }   /* 48px on smaller screens */
@media (max-width: 1100px) {
  .topnav ul { display: none; }
  .nav-swap { margin-left: 14px; }
  .nav-menu { justify-self: end; }
}
@media (max-width: 640px) { .topnav .surname { display: none; } }


/* no orphans: balance headings, avoid a lone last word in running text */
h1, h2, h3, h4, blockquote, .info h3, .older-text b { text-wrap: balance; }
/* the nav, buttons and labels must stay on one line (text-wrap would override white-space) */
.topnav, .topnav *, .nav-cta, .cta, .older-go, .deck-next, .copy, .badge, .name-pill { text-wrap: nowrap; white-space: nowrap; }
p, figcaption, .tags, .lede, .who span, .older-text span { text-wrap: pretty; }

/* ---------- site footer: identical to the home page ---------- */
.site-foot { background: #000; color: #fff; overflow: hidden; }
.site-foot .frame { border: 0; padding-top: 110px; }
.site-foot h2 { color: #fff; font-size: 80px; line-height: 1.02; letter-spacing: -.045em; font-weight: 500; }
.site-foot h2 .soft { color: #7d7d7d; }
.site-foot .where-row { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 32px; }
.site-foot .copyright { font-size: 14px; color: #8a8a8a; }
.site-foot .where { font-size: 16px; line-height: 24px; color: #8a8a8a; display: flex; align-items: flex-start; gap: 10px; }
.site-foot .where::before { content: ""; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: #22c55e; flex: none; }   /* level with the first line when it wraps */
.site-foot .contact-row { display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 32px; padding: 64px 0 34px; border-bottom: 1px solid #3a3a3a; }
.site-foot .label { font-size: 14px; font-weight: 500; color: #8a8a8a; margin-bottom: 12px; opacity: 1; }
.site-foot .mail-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.site-foot .mail { font-size: 22px; letter-spacing: -.01em; text-decoration: none; color: #fff; user-select: all; }
.site-foot .copy { font: inherit; font-size: 12px; font-weight: 600; color: #fff; background: #1d1d1d; border: 1px solid #333; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.site-foot .copy:hover { background: #2a2a2a; }
.site-foot .book { font-size: 22px; letter-spacing: -.01em; color: #fff; }
.site-foot .mail:hover { opacity: .7; }
.site-foot .socials { display: flex; gap: 8px; }
.site-foot .icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #000; text-decoration: none; transition: background .2s, transform .2s; }
.site-foot .icon-btn:hover { background: #ccc; transform: translateY(-2px); }
.site-foot .icon-btn svg { width: 17px; height: 17px; }
.site-foot .foot-links { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; padding: 30px 0 0; font-size: 14px; }
.site-foot .foot-links ul { list-style: none; display: grid; grid-template-columns: auto auto; gap: 10px 28px; justify-content: start; }
.site-foot .foot-links .cases ul { grid-template-columns: repeat(4, auto); justify-content: space-between; }
.site-foot .foot-links a { text-decoration: none; color: #fff; }
.site-foot .foot-links a:hover { color: #8a8a8a; }
/* block, not inline: inline text sat on the 320px parent baseline and slid out of view */
.site-foot .giant span { display: block; width: max-content; letter-spacing: -.04em; }
.site-foot .giant {
  font-size: 320px; font-weight: 600; line-height: .78; white-space: nowrap;
  margin: 56px 0 0; color: #fff; height: 200px; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0,0,0,.2) 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0,0,0,.2) 100%);
}
@media (max-width: 1100px) {
  .site-foot h2 { font-size: clamp(42px, 10vw, 80px); }
  .site-foot .contact-row { grid-template-columns: 1fr; }
  .site-foot .foot-links { grid-template-columns: 1fr; }
  .site-foot .foot-links .cases ul { grid-template-columns: auto auto; justify-content: start; }
}
@media (max-width: 560px) { .site-foot .mail { font-size: 17px; word-break: break-all; } }

/* an odd last screen in a two-column grid spans the full width instead of sitting alone */
.cols-2 > figure:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* phones */
@media (max-width: 640px) {
  .phones > figure:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 8px); }   /* odd last phone sits centred, not alone at the left */
  .stats div { flex-basis: 100%; }   /* impact numbers stack evenly, one per row */
}

/* before / after comparison */
.compare { position: relative; overflow: hidden; border-radius: 12px; aspect-ratio: 1200 / 750; max-width: 100%; background: #eee; user-select: none; touch-action: pan-y; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.compare .c-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare .c-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.12); pointer-events: none; }
.compare .c-handle::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; font-size: 18px; font-weight: 600; letter-spacing: 2px; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.compare:has(input:focus-visible) .c-handle::after { outline: 2px solid #29aeff; outline-offset: 2px; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare .c-label { position: absolute; top: 14px; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; pointer-events: none; }
.compare .c-l { left: 14px; } .compare .c-r { right: 14px; }
@media (max-width: 640px) { .compare { border-radius: 8px; } .compare .c-label { top: 10px; font-size: 11px; padding: 5px 10px; } .compare .c-l { left: 10px; } .compare .c-r { right: 10px; } .compare .c-handle::after { width: 38px; height: 38px; font-size: 16px; } }

/* four phones sit in one row on wide screens (two by two on phones) */
@media (min-width: 641px) { .phones:has(> figure:nth-child(4)) { grid-template-columns: repeat(4, 1fr); max-width: none; } }
