/* Relay v4: the shared system for every page (tokens, type, nav bar, sections, cards, the ending
   and footer, phones). Page-specific rules stay in each page. The rules are written up in
   docs/v4-style.md. */
:root {
  --chalk:#F6F6F4; --stone:#EEEEEB; --black:#0F0F10; --oxblood:#5C1D17;
  /* light page: stone, a touch warmer and more grounded than chalk; band, figures and placeholders one step darker */
  --bg:var(--stone); --fg:var(--black); --sub:#69685F; --line:#D5D5CF; --ph:#E2E2DD; --panel:#E5E5E0; --strip:#E5E5E0;
  --end-shadow:0 18px 28px -20px rgba(0,0,0,.30);
  --spark:#5C1D17; --photo:none; --logo:brightness(0); --logo-o:.55;
  /* the hero photo is held back a touch so it doesn't shout; a little more in dark mode */
  --hero-dim:brightness(.88) contrast(1.03);
  --foot-bg:#5C1D17; --on-ox:#F6F6F4; --on-ox-sub:#D9B9B3; --sel-bg:#5C1D17; --sel-fg:#F6F6F4;
  --fig-bg:#E5E5E0; --fig-sub:#69685F; --show-light:block; --show-dark:none;
  --sans:'Figtree', 'Helvetica Neue', Arial, sans-serif;
  --pad:clamp(16px, 4vw, 48px); --max:1280px; --bar:64px;
  /* Type scale: five sizes, nothing else on the page.
     xl 28  hero sentence, section titles, Strategy/Creative, Work With Us sentence
     l  20  case study names, the What We Do lead line
     m  17  body, descriptions, services, links, footer links
     s  15  nav
     xs 12  uppercase labels, copyright */
  --fs-xl:28px; --fs-l:20px; --fs-m:17px; --fs-s:15px; --fs-xs:12px;
}
@media (max-width:820px) { :root { --fs-xl:24px; --fs-l:19px; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg:#0F0F10; --fg:#F6F6F4; --sub:#9A9893; --line:#2A2A2C; --ph:#1C1C1E; --panel:#18181A; --strip:#161618;
  --spark:#C0675A; --photo:none; --hero-dim:brightness(.74) contrast(1.05); --logo:brightness(0) invert(1); --logo-o:.62;
  --foot-bg:#252528; --on-ox-sub:#A3A19C; --sel-bg:#C0675A; --sel-fg:#0F0F10; --end-shadow:0 18px 30px -18px rgba(0,0,0,.65);
  --fig-bg:#1A1A1C; --fig-sub:#9A9893; --show-light:none; --show-dark:block; color-scheme:dark; } }
:root[data-theme="dark"] {
  --bg:#0F0F10; --fg:#F6F6F4; --sub:#9A9893; --line:#2A2A2C; --ph:#1C1C1E; --panel:#18181A; --strip:#161618;
  --spark:#C0675A; --photo:none; --hero-dim:brightness(.74) contrast(1.05); --logo:brightness(0) invert(1); --logo-o:.62;
  --foot-bg:#252528; --on-ox-sub:#A3A19C; --sel-bg:#C0675A; --sel-fg:#0F0F10; --end-shadow:0 18px 30px -18px rgba(0,0,0,.65);
  --fig-bg:#1A1A1C; --fig-sub:#9A9893; --show-light:none; --show-dark:block; color-scheme:dark; }

* { box-sizing:border-box; }
[hidden] { display:none !important; }
/* images that only show in one mode (a dark lockup on a light ground and the reverse) */
.only-light { display:var(--show-light) !important; } .only-dark { display:var(--show-dark) !important; }
/* Soft fade between pages: the old page fades out as the new one fades in. The nav bar is its own
   layer, so it holds still (or slides in) instead of fading with the page. */
@view-transition { navigation:auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration:.2s; animation-timing-function:ease; }
::view-transition-group(site-bar) { animation-duration:.2s; animation-timing-function:ease; }
.bar { view-transition-name:site-bar; }
.bar.open { view-transition-name:none; }
@media (prefers-reduced-motion:reduce) { .foot-flag rect { animation:none !important; } ::view-transition-old(root), ::view-transition-new(root) { animation:none; } .menu, .menu li, .menu-more > * { transition:none !important; } }
::selection { background:var(--sel-bg); color:var(--sel-fg); }
body { margin:0; background:var(--bg); color:var(--fg); font-family:var(--sans); font-size:var(--fs-m); line-height:1.55;
  -webkit-font-smoothing:antialiased; transition:background .25s ease, color .25s ease; }
h1, h2, h3, p, ul, figure { margin:0; padding:0; }
a { color:inherit; }
img { display:block; max-width:100%; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.gutter { padding-left:max(var(--pad), env(safe-area-inset-left, 0px)); padding-right:max(var(--pad), env(safe-area-inset-right, 0px)); }
.wrap { max-width:calc(var(--max) + 2 * var(--pad)); margin:0 auto; }
a:focus-visible, button:focus-visible { outline:2px solid var(--fg); outline-offset:3px; }

/* type */
.intro { font-size:var(--fs-xl); line-height:1.32; letter-spacing:-.01em; text-wrap:pretty; }
.h2 { font-size:var(--fs-xl); line-height:1.2; letter-spacing:-.01em; font-weight:600; text-wrap:balance; }
.label { font-size:var(--fs-xs); letter-spacing:.12em; text-transform:uppercase; font-weight:500; color:var(--sub); }
.cap { font-size:var(--fs-xs); letter-spacing:.12em; text-transform:uppercase; color:var(--sub); margin-top:10px; }
.wm { display:block; height:auto; }
:root[data-theme="dark"] .wm { filter:invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wm { filter:invert(1); } }
.env { filter:var(--photo); transition:filter .4s ease; }

/* links: section-head links are text + arrow; the one primary call to action keeps its underline */
.go { display:inline-flex; align-items:center; gap:.45em; font-size:var(--fs-m); font-weight:500; text-decoration:none; white-space:nowrap; }
.go span { color:var(--spark); transition:transform .2s ease; }
.go:hover span { transform:translateX(3px); }
.go.primary { border-bottom:1px solid currentColor; padding-bottom:3px; }

/* ── NAV BAR ──
   Always there, on every page. Over the Work With Us band it takes the band's color; on a desktop
   screen it steps away once the ending fills the screen (v4.js sets on-end / away). */
.bar { position:fixed; top:0; left:0; right:0; z-index:30; padding-top:env(safe-area-inset-top, 0px);
  background:var(--bg); border-bottom:1px solid var(--line); }
/* no motion on the first paint, so a new page never slides its nav in */
.bar.ready { transition:transform .3s ease, background-color .3s ease; }
.bar.on-end { background:var(--strip); }
html body .bar.away { transform:translateY(-110%); }
/* a keyboard user tabbing into the nav always gets it back */
html body .bar:focus-within { transform:none; }
.bar-in { height:var(--bar); display:flex; align-items:center; justify-content:space-between; }
/* the bar's wordmark and links keep to the same edges as the page content on wide screens */
.bar-in { max-width:calc(var(--max) + 4 * var(--pad)); margin-inline:auto; }
.bar .wm { width:150px; }
.bar ul { display:flex; gap:28px; list-style:none; font-size:var(--fs-s); font-weight:500; }
.bar a { text-decoration:none; }
.bar ul a { opacity:.78; } .bar ul a:hover, .bar ul a[aria-current] { opacity:1; }
.menu-btn { display:none; }
/* desktop: the menu wrapper steps out of the way and only the links show in the bar */
.menu { display:contents; }
.menu-more { display:none; }
/* an external link's small arrow, drawn (a typed ↗ shows up as an emoji on iPhones) */
.ext { display:inline-block; width:.62em; height:.62em; margin-left:.12em; vertical-align:.02em; color:var(--spark); }

/* ── SECTIONS: one header pattern everywhere ── */
.sec { padding-top:96px; scroll-margin-top:var(--bar); }
.head { display:flex; justify-content:space-between; align-items:baseline; gap:24px; padding-bottom:16px; border-bottom:1px solid var(--line); margin-bottom:40px; }

/* work: three up, names a step bolder */
.grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:32px; }
.card { text-decoration:none; display:block; min-width:0; }
.card .ph { aspect-ratio:4/3; max-width:100%; overflow:hidden; background:var(--ph); margin-bottom:16px; }
.card .ph img { width:100%; height:100%; object-fit:cover; filter:var(--photo); transition:transform .6s ease, filter .4s ease; }
.card:hover .ph img { transform:scale(1.015); }
.card h3 { font-size:var(--fs-l); font-weight:600; letter-spacing:-.005em; margin-bottom:4px; }
.card p { font-size:var(--fs-m); line-height:1.5; color:var(--sub); }

/* ── THE ENDING: the Work With Us band and the footer, one full screen on a desktop ──
   The band (no visible title) sits at its natural height, one step darker than the page, and casts
   a soft shadow onto the footer below it; the footer fills the rest of the screen. */
.end { display:flex; flex-direction:column; min-height:100svh; margin-top:96px; }
.end-sec { position:relative; z-index:1; flex:none; background:var(--strip); box-shadow:var(--end-shadow); }
.end-body { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:40px 96px; align-items:center; padding-block:56px; }
.end-text { display:flex; flex-direction:column; align-items:flex-start; gap:30px; }
.end-text .intro { max-width:18em; }
/* Contact: a label, the address on a ruled line with an arrow; a click copies it */
.inq { width:min(100%, 440px); }
.inq .label { display:block; padding-bottom:12px; border-bottom:1px solid var(--line); }
.inq .inq-row { display:flex; justify-content:space-between; align-items:center; width:100%; padding-block:16px 6px; cursor:pointer; }
.inq .inq-row .arr { color:var(--spark); transition:transform .2s ease; }
.inq .inq-row:hover .arr { transform:translateX(4px); }
.inq .inq-row:hover { text-decoration:none; }
.inq .copied { display:block; margin:6px 0 0; color:var(--sub); min-height:1.4em; }
.end-img .ph { width:100%; aspect-ratio:2/1; overflow:hidden; background:var(--ph); }
.end-img img { width:100%; height:100%; object-fit:cover; }
/* the photo gives way on short windows, so the ending stays one screen where it can */
@media (min-width:821px) { .end-img .ph { max-height:calc(100svh - 520px); min-height:200px; } }

/* Email buttons (band and footer): a click copies the address */
.copy-mail { all:unset; cursor:pointer; font-size:var(--fs-m); }
.copy-mail:hover { text-decoration:underline; text-underline-offset:5px; text-decoration-thickness:1px; }
.copy-mail:focus-visible { outline:2px solid currentColor; outline-offset:3px; }
.copied { font-size:var(--fs-xs); letter-spacing:.12em; text-transform:uppercase; opacity:0; transition:opacity .25s ease; }
.copied.show { opacity:1; }

/* Footer: wordmark and Contact on the left, the pages at size xl on the right; the bottom row has X
   and LinkedIn left, the copyright in the middle, Light / Dark and the flag right. */
.foot { position:relative; z-index:0; flex:1 0 auto; display:flex; flex-direction:column; background-color:var(--foot-bg); color:var(--on-ox); padding-block:48px 24px; }
.foot > .wrap { flex:1; display:flex; flex-direction:column; width:100%; }
.foot-top { display:grid; grid-template-columns:1fr auto; grid-template-areas:"brand nav" "contact nav"; gap:40px 64px; align-items:start; margin-bottom:40px; }
.foot-brand { grid-area:brand; } .foot-contact { grid-area:contact; } .foot-nav { grid-area:nav; }
.foot .wm { width:220px; filter:invert(1); }
.foot h2 { font-size:var(--fs-xs); letter-spacing:.12em; text-transform:uppercase; font-weight:500; color:var(--on-ox-sub); margin-bottom:14px; }
.foot-contact .foot-mail { font-size:var(--fs-l); }
.foot-contact .foot-mail:hover { text-underline-offset:6px; }
.foot .foot-nav { list-style:none; display:grid; gap:2px; text-align:right; }
.foot .foot-nav a { font-size:var(--fs-xl); line-height:1.3; letter-spacing:-.01em; text-decoration:none; }
.foot .foot-nav a:hover { text-decoration:underline; text-underline-offset:6px; text-decoration-thickness:1px; }
.foot-base { margin-top:auto; padding-top:18px; border-top:1px solid color-mix(in srgb, var(--on-ox) 28%, transparent);
  display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:16px; font-size:var(--fs-xs); letter-spacing:.12em; text-transform:uppercase; color:var(--on-ox-sub); }
.foot-icons { display:flex; gap:18px; }
.foot-icons a { display:block; color:var(--on-ox-sub); }
.foot-icons a:hover { color:var(--on-ox); }
.foot-icons svg { width:20px; height:20px; display:block; }
.foot-end { justify-self:end; display:flex; align-items:center; gap:28px; }
.foot-flag { width:32px; height:auto; display:block; color:var(--on-ox-sub); overflow:visible; }
/* on hover the stripes ripple once, left to right, like cloth catching a breeze */
.foot-flag rect { transform-box:fill-box; }
.foot-flag:hover rect { animation:flag-wave .9s ease-in-out both; }
.foot-flag rect:nth-child(2) { animation-delay:.04s; } .foot-flag rect:nth-child(3) { animation-delay:.08s; }
.foot-flag rect:nth-child(4) { animation-delay:.12s; } .foot-flag rect:nth-child(5) { animation-delay:.16s; }
.foot-flag rect:nth-child(6) { animation-delay:.2s; } .foot-flag rect:nth-child(7) { animation-delay:.24s; }
.foot-flag rect:nth-child(8) { animation-delay:.28s; }
@keyframes flag-wave { 0%, 100% { transform:none; } 35% { transform:translateY(-.5px) skewY(-4deg); } 70% { transform:translateY(.4px) skewY(3deg); } }
/* light/dark switch: the current mode in full color, the other one quieter */
.foot-mode { display:flex; align-items:center; gap:8px; }
.foot-mode button { all:unset; cursor:pointer; color:var(--on-ox-sub); }
.foot-mode button[aria-pressed="true"], .foot-mode button:hover { color:var(--on-ox); }
.foot-mode button:focus-visible { outline:2px solid currentColor; outline-offset:3px; }
.foot-mode > span { opacity:.6; }

/* Desktop: the footer stays put at the bottom of the screen and the page slides up off it, uncovering
   it at the end. v4.js turns this on (html.foot-reveal) whenever the footer fits on screen and sets
   --foot-h to its height, which the ending keeps as empty space so the page ends exactly on it. */
html.foot-reveal body > :not(.end, .bar, script) { position:relative; z-index:1; background:var(--bg); }
html.foot-reveal main { padding-bottom:96px; }
html.foot-reveal .end { margin-top:0; }
html.foot-reveal .end::after { content:''; display:block; flex:none; height:var(--foot-h, 0px); }
html.foot-reveal .foot { position:fixed; left:0; right:0; bottom:0; }
/* No blank page past either end: no bounce, and if a browser bounces anyway the top shows the page
   color and the bottom the footer color. */
html { overscroll-behavior-y:none; background:linear-gradient(var(--bg) 50%, var(--foot-bg) 50%); }
body { overscroll-behavior-y:none; }

/* ── PHONE (820px and narrower) ── */
@media (max-width:820px) {
  .grid, .end-body { grid-template-columns:1fr; }
  .grid { gap:44px; }
  .sec { padding-top:72px; }
  .end-body { padding-block:40px; }
  /* nav: always there. The wordmark top left and a two-line button top right that opens the pages as
     a full-screen list under the bar (the lines turn into a cross). */
  .bar, html body .bar.away { transform:none; transition:background-color .3s ease, border-color .3s ease; }
  .bar.open { background:var(--bg); }
  .menu-btn { all:unset; display:block; position:relative; width:28px; height:28px; margin-right:-2px; cursor:pointer; }
  .menu-btn span { position:absolute; left:3px; right:3px; height:1.5px; background:currentColor; transition:top .25s ease, transform .25s ease; }
  .menu-btn span:first-child { top:10px; } .menu-btn span:last-child { top:17px; }
  .bar.open .menu-btn span:first-child { top:13.5px; transform:rotate(45deg); }
  .bar.open .menu-btn span:last-child { top:13.5px; transform:rotate(-45deg); }
  .menu-btn:focus-visible { outline:2px solid var(--fg); outline-offset:2px; }
  /* the menu panel fades in under the bar, its parts settling into place one after another: the pages
     in large type with room between them, then the newest case study and article side by side, then
     the email and X and LinkedIn. Everything flows from the top; nothing is pinned to the bottom. */
  .menu { display:block; position:fixed; left:0; right:0; bottom:0; top:calc(var(--bar) + env(safe-area-inset-top, 0px));
    overflow-y:auto; overscroll-behavior:contain; background:var(--bg);
    padding:36px max(16px, env(safe-area-inset-right, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    opacity:0; visibility:hidden; transition:opacity .3s ease, visibility 0s linear .3s; }
  .bar.open .menu { opacity:1; visibility:visible; transition:opacity .3s ease; }
  .bar ul { display:grid; gap:18px; font-size:var(--fs-xl); font-weight:400; letter-spacing:-.01em; line-height:1.2; }
  .bar ul a { opacity:1; display:block; }
  .menu li, .menu-more > * { opacity:0; transform:translateY(10px); transition:opacity .4s ease, transform .4s cubic-bezier(.2,.6,.2,1); }
  .bar.open .menu li, .bar.open .menu-more > * { opacity:1; transform:none; }
  .bar.open .menu li:nth-child(1) { transition-delay:.06s; } .bar.open .menu li:nth-child(2) { transition-delay:.1s; }
  .bar.open .menu li:nth-child(3) { transition-delay:.14s; } .bar.open .menu li:nth-child(4) { transition-delay:.18s; }
  .bar.open .menu-more > :nth-child(1) { transition-delay:.24s; } .bar.open .menu-more > :nth-child(2) { transition-delay:.3s; }
  .menu-more { display:grid; gap:36px; margin-top:44px; padding-top:28px; border-top:1px solid var(--line); }
  .menu-latest { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
  .menu-latest a { display:block; text-decoration:none; min-width:0; }
  .menu-latest img { width:100%; aspect-ratio:4/3; object-fit:cover; margin-bottom:12px; background:var(--ph); }
  .menu-latest .label { display:block; margin-bottom:4px; }
  .menu-latest .t { display:block; font-size:var(--fs-m); line-height:1.35; }
  .menu-contact .label { margin-bottom:8px; }
  /* X and LinkedIn on the left, the Light / Dark switch on the right */
  .menu-row { display:flex; justify-content:space-between; align-items:center; margin-top:16px; }
  .menu-contact .foot-icons a { color:var(--sub); } .menu-contact .foot-icons a:hover { color:var(--fg); }
  .menu-row .foot-mode button { color:var(--sub); padding:6px 2px; }
  .menu-row .foot-mode button[aria-pressed="true"], .menu-row .foot-mode button:hover { color:var(--fg); }
  html.menu-open, html.menu-open body { overflow:hidden; }
  /* footer: the wordmark, the pages in large type, the email, then X, LinkedIn and the flag.
     No copyright; the Light / Dark switch lives in the menu instead. */
  .foot { padding-block:40px 24px; }
  .foot .wm { width:180px; }
  .foot-top { grid-template-columns:1fr; grid-template-areas:"brand" "nav" "contact"; gap:32px; }
  .foot .foot-nav { text-align:left; gap:4px; }
  .foot-contact .foot-mail { font-size:var(--fs-m); }
  .foot-base { grid-template-columns:auto 1fr; }
  .foot-base .copy, .foot-base .foot-mode { display:none; }
}
