/* ==========================================================================
   The Lens of Peet: site.css (V2)
   Hand-written. No framework, no build step.
   Owns: tokens, reset, base type, shared chrome (.skip, .site-header,
   .progress, .site-footer), generic classes (.wrap, .label, .btn, .rule,
   .vh, .on-dark, .aside), the motion primitives that site.js drives, and
   every homepage section. notes.css and page <style> blocks build on these
   and must not redefine them.
   System: his portfolio. Wide heavy Archivo headlines, Plex Mono red labels,
   #121212 / white / #ff0000, square corners, 3px section rules. Motion draws
   a number or a chart, pulls a photograph into focus, or answers a hover.
   ========================================================================== */

/* 1. Tokens
   ========================================================================== */
:root {
  --paper: #ffffff;
  --ink: #121212;
  --red: #ff0000;       /* fills, rules, bars, rings, buttons */
  --red-t: #eb0000;     /* red TEXT on white (4.6:1). Dark blocks reset it to --red. */
  --mute: #8a8a8a;      /* grey text on dark blocks */
  --mute-d: #6b6b6b;    /* grey text on white (AA) */
  --rule: #121212;
  --dark: #121212;
  --grey: #b8b8b8;      /* chart grey */
  --wash: #f2f2f2;      /* chart track */
  --tint: #ffecec;      /* above-water band */

  --ui: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --display: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --data: 'IBM Plex Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --gutter: 16px;
  --header-h: 48px;
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
}

/* 2. Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 8px);
}

body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; }
img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border-radius: 0; }
table { border-collapse: collapse; }

/* 3. Base type
   ========================================================================== */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headline voice: Archivo, wide and heavy. Sentence case, full stop. */
h1, h2, h3 {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(28px, 4vw, 54px); }
h2 { font-size: clamp(24px, 3.1vw, 42px); }
h3 { font-size: clamp(18px, 1.7vw, 23px); font-weight: 800; line-height: 1.1; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 160ms var(--ease);
}
a:hover { color: var(--red-t); }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

strong, b { font-weight: 800; }

::selection { background: var(--red); color: var(--ink); }

/* 4. Generic classes (shared with notes.css and the case-study pages)
   ========================================================================== */

/* Gutter container. Backgrounds and rules sit on the parent. */
.wrap {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Label voice: Plex Mono, uppercase, tracked, red by default. */
.label {
  font-family: var(--data);
  font-size: 11px;
  font-stretch: normal;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red-t);
}
.label--red { color: var(--red-t); }
.label--ink { color: var(--ink); }
.label--mute { color: var(--mute-d); }
.label--paper { color: var(--paper); }

/* Bracketed aside: Plex Mono grey, lowercase. */
.aside {
  font-family: var(--data);
  font-size: 12px;
  line-height: 1.5;
  color: var(--mute-d);
}

/* Dark block: #121212 ground, white type, 4px red bar on top. */
.on-dark {
  --red-t: var(--red);
  border-top: 4px solid var(--red);
  background: var(--dark);
  color: var(--paper);
}
.on-dark .label--mute,
.on-dark .aside { color: var(--mute); }
.on-dark ::selection { color: var(--paper); }

/* Rectangle button. Hover fills red with a left-to-right wipe. */
.btn {
  position: relative;
  z-index: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--data);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 240ms var(--ease);
}
.btn:hover,
.btn:focus-visible {
  border-color: var(--red);
  color: var(--ink);
}
.btn:hover::before,
.btn:focus-visible::before { transform: scaleX(1); }
.btn[disabled] { cursor: default; }
.btn--ghost {
  background: var(--paper);
  color: var(--ink);
}
/* Red primary: black type on red, wipes to white. */
.btn--red {
  border-color: var(--red);
  background: var(--red);
  color: var(--ink);
}
.btn--red::before { background: var(--paper); }
.btn--red:hover,
.btn--red:focus-visible { border-color: var(--paper); }
.on-dark .btn:not(.btn--red) {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}
.on-dark .btn--ghost:not(.btn--red) {
  background: var(--dark);
  color: var(--paper);
}
.on-dark .btn:hover,
.on-dark .btn:focus-visible { color: var(--ink); }
.on-dark .btn:not(.btn--red):hover,
.on-dark .btn:not(.btn--red):focus-visible { border-color: var(--red); }
.on-dark .btn:focus-visible { outline-color: var(--paper); }

/* Rule. 1px by default, .rule--heavy is the 3px section rule. */
.rule {
  display: block;
  width: 100%;
  height: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--rule);
}
.rule--heavy { border-top-width: 3px; }

/* Visually hidden. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 5. Skip link
   ========================================================================== */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--data);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}
.skip:focus { left: 0; }

/* 6. Site header
   Wordmark left, mono links right. The segmented bar across the top is the
   live scroll indicator (site.js fills .progress, one segment per
   [data-section]).
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  font-family: var(--data);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.progress {
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  gap: 4px;
  height: 3px;
  pointer-events: none;
}
.progress span {
  flex: 1 1 0;
  background: #dedede;
  transition: background-color 200ms var(--ease);
}
.progress .is-done { background: var(--ink); }
.progress .is-current { background: var(--red); }

.site-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.site-header__logo {
  display: flex;
  align-items: center;
  flex: none;
  height: 100%;
}
/* The PNG is 1250x250 with wide transparent side margins around "peet.".
   Crop to the mark so it sits flush with the gutter. */
.site-header__logo img {
  width: 54px;
  height: 32px;
  max-width: none;
  object-fit: cover;
  object-position: 50% 50%;
}
.site-header__nav {
  display: flex;
  align-items: stretch;
  flex: none;
  gap: 20px;
}
.site-header__nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.site-header__nav a:hover,
.site-header__nav a.is-active,
.site-header__nav a[aria-current] { color: var(--red-t); }

/* Small screens: three links (Work, Notes, Contact). */
@media (max-width: 639px) {
  .site-header__nav { gap: 8px; }
  .site-header__nav a:nth-child(2),
  .site-header__nav a:nth-child(4) { display: none; }
}

/* 7. Site footer
   ========================================================================== */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 32px;
  padding: 24px var(--gutter) 32px;
  --red-t: var(--red);
  border-top: 1px solid #333333;
  background: var(--dark);
  color: var(--paper);
  font-family: var(--data);
  font-size: 11px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-footer__place { color: var(--mute); }
/* Each link is a 44px-wide target at least. 8px side padding + 4px gap
   keeps the text 20px apart; the negative margin lines the first one up
   with the gutter. */
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
  margin-left: -8px;
}
.site-footer__links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  color: var(--paper);
  text-decoration: none;
}
.site-footer__links a:hover { color: var(--red); }
.site-footer__year { margin-left: auto; color: var(--red); }

@media (max-width: 639px) {
  .site-footer { flex-direction: column; gap: 4px; }
  .site-footer__year { margin-left: 0; }
}

/* 8. Motion primitives (driven by site.js)
   Hidden-until-revealed states only exist under .js, so the page is whole
   without JavaScript. site.js adds .reduce to <html> for reduced motion
   (or ?motion=off) and marks everything .is-in at once.
   ========================================================================== */

/* data-reveal="up|fade|focus", optional style="--d:120ms" */
.js [data-reveal] {
  opacity: 0;
  transition:
    opacity 700ms var(--ease) var(--d, 0ms),
    transform 700ms var(--ease) var(--d, 0ms),
    filter 900ms var(--ease) var(--d, 0ms);
}
.js [data-reveal="up"],
.js [data-reveal=""] { transform: translate3d(0, 24px, 0); }
/* Rack focus: photographs and frames only. */
.js [data-reveal="focus"] {
  opacity: 1;
  filter: blur(14px);
  transform: scale(1.04);
}
.js [data-reveal].is-in {
  opacity: 1;
  filter: none;
  transform: none;
}

/* data-count: keep digits from jittering while they run. */
[data-count] { font-variant-numeric: tabular-nums; }

/* data-loupe: the loupe element site.js appends to <body>. */
.loupe {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: 200px;
  height: 200px;
  overflow: hidden;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--dark);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease);
}
.loupe.is-on { opacity: 1; }
.loupe img {
  position: absolute;
  max-width: none;
  object-fit: cover;
}

/* Hand-drawn grease-pencil mark. Put .grease on an <svg> whose <path> has
   pathLength="1"; it draws when the nearest [data-chart] gets .is-in. */
.grease {
  position: absolute;
  overflow: visible;
  pointer-events: none;
}
.grease path,
.grease use {
  fill: none;
  stroke: var(--red);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 900ms var(--ease) var(--d, 300ms);
}
/* 3px on screen. --u is viewBox units per pixel; site.js measures it. */
.grease path { stroke-width: calc(var(--u, 1.5) * 3); }
/* A ring over a video steps aside while it plays (site.js sets .is-playing
   on the video's parent) and comes back on pause or end. */
.grease { transition: opacity 300ms var(--ease); }
.is-playing > .grease {
  opacity: 0;
  transition-delay: 1500ms;
}
.js [data-chart]:not(.is-in) .grease path,
.js [data-chart]:not(.is-in) .grease use { stroke-dashoffset: 1; }

.reduce *,
.reduce *::before,
.reduce *::after {
  transition: none !important;
  animation: none !important;
}

/* ==========================================================================
   HOMEPAGE
   Scoped to <body class="home"> so section class names cannot collide with
   notes.css or the case-study pages. Sections are full-bleed and butted.
   ========================================================================== */

/* 9. Shared homepage parts
   ========================================================================== */

/* Alias anchors (#case-studies, #apply, #selected-work, #field-notes). */
.home main > section { position: relative; }
.home main > section > span[id] {
  position: absolute;
  top: 0;
  left: 0;
}

/* Section head: mono label, wide heavy title, optional link at right. */
.home .head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 24px;
  padding: 28px var(--gutter) 22px;
  border-top: 3px solid var(--rule);
}
.home .on-dark > .head { border-top: 0; }
.home .head h2 { max-width: 22em; }
.home .head__link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--data);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (min-width: 900px) {
  .home .head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    padding-top: 40px;
    padding-bottom: 28px;
  }
  .home .head .label { grid-column: 1 / -1; }
  .home .head__link,
  .home .head .aside { justify-self: end; }
}

/* Index rows (experience, field notes). */
.home .rows { list-style: none; }
.home .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 18px var(--gutter) 22px;
  border-top: 1px solid var(--rule);
}
.home .row__date {
  font-family: var(--data);
  font-size: 12px;
  line-height: 1.5;
  color: var(--mute-d);
}
.home .row__date b {
  margin-right: 10px;
  color: var(--red-t);
  font-weight: 600;
}
.home .row__main h3,
.home h3.row__main { transition: color 200ms var(--ease), transform 200ms var(--ease); }
.home .row:hover h3 {
  color: var(--red-t);
  transform: translateX(6px);
}
.home .row__main p {
  max-width: 68ch;
  margin-top: 8px;
}
.home .row__main .row__role { margin-top: 10px; }
.home .row__main .row__plain { margin-top: 0; }
.home .row__main a { text-decoration: none; }
.home h3.row__main a {
  display: block;
  margin: -13px 0;
  padding: 13px 0;
}
.home .row__list {
  max-width: 76ch;
  margin-top: 12px;
  padding-left: 18px;
  list-style: square;
  font-size: 15px;
  line-height: 1.5;
}
.home .row__list li::marker { color: var(--red); }
.home .row__list li + li { margin-top: 6px; }

@media (min-width: 900px) {
  .home .row {
    grid-template-columns: 220px minmax(0, 1fr) 200px;
    gap: 24px;
    align-items: baseline;
    padding-top: 22px;
    padding-bottom: 26px;
  }
  .home .row__main { grid-column: 2; }
  .home .row__aside {
    grid-column: 3;
    justify-self: end;
    text-align: right;
  }
}

/* 10. Hero: the portfolio cover, alive
   Dark panel butted against the portrait. Headline lines rise in and the
   portrait pulls into focus. Sized so the proof row shows above the fold.
   ========================================================================== */
.home .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.home .hero__media {
  position: relative;
  order: -1;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--paper);
}
.home .hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 36%;
}
.home .hero__cap {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 8px var(--gutter);
  background: var(--dark);
  color: var(--paper);
}
.home .hero__panel { padding: 18px var(--gutter) 28px; }
.home .hero__mark {
  display: none;
  width: 78px;
  height: auto;
  margin-bottom: 14px;
  filter: brightness(0) invert(1);
}
.home .hero__panel > .label {
  font-size: 10px;
  letter-spacing: 0.16em;
}
.home .hero h1 {
  margin-top: 10px;
  font-size: clamp(22px, 6.7vw, 34px);
}
.home .hero h1 span {
  display: block;
  white-space: nowrap;
}
.home .hero__name {
  margin-top: 10px;
  color: var(--mute);
  font-stretch: 125%;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}
.home .hero__sub {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.45;
}
.home .hero__cta { margin-top: 18px; }
.home .hero__actions {
  display: flex;
  gap: 8px;
}
.home .hero__actions .btn {
  flex: 1 1 auto;
  padding: 0 10px;
  font-size: 11px;
  letter-spacing: 0.1em;
}
.home .hero .aside { margin-top: 14px; }

@media (min-width: 900px) {
  .home .hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .home .hero__media {
    order: 0;
    aspect-ratio: auto;
  }
  .home .hero__media img { object-position: 60% 30%; }
  .home .hero__panel { padding: 22px 40px 24px var(--gutter); }
  .home .hero__mark { display: block; }
  .home .hero__panel > .label {
    font-size: 11px;
    letter-spacing: 0.22em;
  }
  .home .hero h1 {
    margin-top: 12px;
    font-size: clamp(30px, 3.4vw, 50px);
  }
  .home .hero__name { margin-top: 12px; font-size: 17px; }
  .home .hero__sub {
    margin-top: 16px;
    font-size: 17px;
    line-height: 1.5;
  }
  .home .hero__cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    margin-top: 20px;
  }
  .home .hero__actions .btn {
    flex: none;
    padding: 0 20px;
    font-size: 12px;
    letter-spacing: 0.14em;
  }
  .home .hero .aside { margin-top: 0; }
}

/* 11. Proof row: four tiles, count-up numerals, unit glyphs
   ========================================================================== */
.home .proof__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  list-style: none;
}
@media (min-width: 900px) {
  .home .proof .head {
    padding-top: 20px;
    padding-bottom: 14px;
  }
  .home .proof .head h2 { max-width: none; }
}
.home .tile {
  padding: 20px var(--gutter) 24px;
  border-top: 3px solid var(--rule);
}
.home .tile--red { background: var(--red); }
.home .tile__n {
  font-stretch: 125%;
  font-size: clamp(44px, 13vw, 64px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.home .tile .label { margin-top: 14px; }
.home .tile__src {
  max-width: 34ch;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
}

/* Unit glyphs: the little device under each number. */
.c-glyph {
  display: flex;
  align-items: flex-end;
  height: 22px;
  margin-top: 12px;
}
.c-glyph i { display: block; }
/* nine squares = nine audited accounts */
.c-glyph--nine { gap: 3px; width: max-content; }
.c-glyph--nine i { width: 12px; height: 12px; background: var(--ink); }
/* three segments = 425 / 400+ / 485 */
.c-glyph--three { gap: 3px; max-width: 220px; }
.c-glyph--three i {
  flex: var(--w) 1 0;
  height: 12px;
  background: var(--ink);
  transform-origin: left center;
  transition: transform 500ms var(--ease) calc(700ms + var(--i) * 160ms);
}
.c-glyph--three i:nth-child(2) { background: var(--mute-d); }
.c-glyph--three i:nth-child(3) { background: var(--grey); }
.js [data-chart]:not(.is-in) .c-glyph--three i { transform: scaleX(0); }
/* bar pair = client-made video, then mine at twice the length */
.c-glyph--pair {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  max-width: 160px;
}
.c-glyph--pair i {
  width: 50%;
  height: 8px;
  background: #990000;
  transform-origin: left center;
  transition: transform 600ms var(--ease) 700ms;
}
.c-glyph--pair i + i {
  width: 100%;
  background: var(--ink);
  transition-delay: 900ms;
}
.js [data-chart]:not(.is-in) .c-glyph--pair i { transform: scaleX(0); }
/* baseline with -11 hanging under it and +18 standing on it */
.c-glyph--lift {
  position: relative;
  align-items: stretch;
  gap: 6px;
  width: 120px;
  height: 31px;
  margin-top: 3px;
}
.c-glyph--lift::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 18px;
  border-top: 1px solid var(--ink);
}
.c-glyph--lift i {
  width: 34px;
  height: 11px;
  margin-top: 19px;
  background: var(--grey);
  transform-origin: center top;
  transition: transform 500ms var(--ease) 700ms;
}
.c-glyph--lift i + i {
  height: 18px;
  margin-top: 0;
  background: var(--red);
  transform-origin: center bottom;
  transition-delay: 1000ms;
}
.js [data-chart]:not(.is-in) .c-glyph--lift i { transform: scaleY(0); }

@media (min-width: 640px) {
  .home .proof__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .tile:nth-child(even) { border-left: 1px solid var(--rule); }
}
@media (min-width: 1000px) {
  .home .proof__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home .tile {
    padding-top: 18px;
    padding-bottom: 32px;
  }
  .home .tile + .tile { border-left: 1px solid var(--rule); }
  .home .tile__n { font-size: clamp(44px, 4.6vw, 76px); }
}

/* 12. Problem / why it stays / what I do
   ========================================================================== */
.home .trio {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 3px solid var(--rule);
}
.home .trio__item { padding: 20px var(--gutter) 28px; }
.home .trio__item + .trio__item { border-top: 1px solid var(--rule); }
.home .trio__item p {
  max-width: 30em;
  margin-top: 12px;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.4;
}

@media (min-width: 900px) {
  .home .trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home .trio__item { padding-top: 26px; padding-bottom: 48px; }
  .home .trio__item + .trio__item {
    border-top: 0;
    border-left: 1px solid var(--rule);
  }
}

/* 13. Selected work for (logo wall)
   Real colours on white, sized by optical weight per file. Logos stagger
   in and lift on hover.
   ========================================================================== */
.home .work__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px var(--gutter) 22px;
  border-top: 1px solid var(--rule);
}
.home .work__logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
  list-style: none;
}
.home .work__logos li:nth-child(2) { --d: 60ms; }
.home .work__logos li:nth-child(3) { --d: 120ms; }
.home .work__logos li:nth-child(4) { --d: 180ms; }
.home .work__logos li:nth-child(5) { --d: 240ms; }
.home .work__logos li:nth-child(6) { --d: 300ms; }
.home .work__logos li:nth-child(7) { --d: 360ms; }
.home .work__logos li:nth-child(8) { --d: 420ms; }
.home .work__logos img {
  width: auto;
  height: 26px;
  max-width: none;
  transition: transform 200ms var(--ease);
}
.home .work__logos li:hover img { transform: translateY(-4px); }
/* Per-file optical sizing: some files carry padding or a tall mark. */
.home .work__logos .logo--goodo { height: 34px; }
.home .work__logos .logo--lendingtree { height: 38px; }
.home .work__logos .logo--withings { height: 52px; }
.home .work__logos .logo--utiva { height: 46px; }
.home .work__logos .logo--geviti { height: 24px; }
.home .work__logos .logo--ferosom { height: 36px; }
.home .work__logos .logo--govplus { height: 20px; }
.home .work__logos .logo--wellow { height: 24px; }
.home .work__logos .logo--molson { height: 32px; }
.home .work__logos .logo--daikin { height: 18px; }
.home .work__logos .logo--w { height: 14px; }
.home .work__logos .logo--pmi { height: 32px; }
.home .work__logos .logo--rb { height: 26px; }
.home .work__logos .logo--mk { height: 38px; }
.home .work__logos .logo--hayla { height: 22px; }
.home .work__logos .logo--disco { height: 12px; }
/* These five files are white (or white-text) artwork made for a dark
   ground. brightness(0) renders the same shapes in solid black so they
   read on white. Swap in dark-on-clear files and delete this rule. */
.home .work__logos .logo--lendingtree,
.home .work__logos .logo--w,
.home .work__logos .logo--mk,
.home .work__logos .logo--hayla,
.home .work__logos .logo--disco { filter: brightness(0); }
.home .work__before { font-weight: 500; }

@media (min-width: 900px) {
  .home .work__row {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    min-height: 88px;
  }
  .home .work__logos { gap: 20px 28px; }
}

/* 14. Reads and the chart kit (global: any page can use these)
   Results: eight reads, each with a chart that draws itself
   ========================================================================== */
.reads__list { list-style: none; }
.read {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding: 24px var(--gutter) 32px;
  border-top: 1px solid var(--rule);
}
.read h3 {
  max-width: 22em;
  margin-top: 12px;
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 900;
  line-height: 1.06;
  transition: color 200ms var(--ease), transform 200ms var(--ease);
}
.read:hover h3 {
  color: var(--red-t);
  transform: translateX(6px);
}
.read__text > p:not(.label) {
  max-width: 60ch;
  margin-top: 12px;
}
.read__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 6px;
  font-family: var(--data);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (min-width: 900px) {
  .read {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
    gap: 56px;
    align-items: start;
    padding-top: 32px;
    padding-bottom: 40px;
  }
}

/* Chart kit. Flat, black / red / grey, mono axis text, hard edges. The
   finished state is the base CSS; ".js [data-chart]:not(.is-in)" holds the
   start state, so no-JS and reduced motion both show the final chart. */
.c-chart {
  font-family: var(--data);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.c-chart b {
  font-family: var(--ui);
  font-stretch: 125%;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.c-chart .k { color: var(--mute-d); }
.c-chart .red { color: var(--red-t); }
.c-chart i { display: block; font-style: normal; }
.c-chart svg { width: 100%; height: auto; overflow: visible; }
.c-chart text {
  font-family: var(--data);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: none;
  fill: var(--mute-d);
}
.c-chart text.v {
  font-family: var(--ui);
  font-stretch: 125%;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  fill: var(--ink);
}
.c-chart text.red { fill: var(--red-t); }

/* label | track | value */
.c-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 104px;
  gap: 10px;
  align-items: center;
  min-height: 22px;
}
.c-row > :last-child { text-align: right; }
.c-row + .c-row { margin-top: 5px; }
.c-gap { margin-top: 16px !important; }
.c-cap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.c-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}
.c-note { margin-top: 12px; }
.c-big {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 18px;
}
.c-chart .c-big b { font-size: 30px; line-height: 1; }

/* Horizontal bar: width from --w, grows from the left. */
.c-bar {
  width: var(--w, 100%);
  height: 14px;
  background: var(--ink);
  transform-origin: left center;
  transition: transform 900ms var(--ease) calc(var(--i, 0) * 140ms);
}
.c-bar--red { background: var(--red); }
.c-bar--grey { background: var(--grey); }
.c-bar--end { margin-left: auto; transform-origin: right center; }
.js [data-chart]:not(.is-in) .c-bar { transform: scaleX(0); }
/* A bar that starts at the old value and drops to the new one. */
.js [data-chart]:not(.is-in) .c-bar--drop { transform: scaleX(var(--from)); }

/* Stepped wipe: children appear one at a time, left to right. --n = count. */
.c-wipe {
  clip-path: inset(0 0 0 0);
  transition: clip-path calc(var(--n) * var(--step, 60ms)) steps(var(--n)) calc(var(--i, 0) * var(--row, 140ms));
}
.js [data-chart]:not(.is-in) .c-wipe { clip-path: inset(0 100% 0 0); }

.c-sq { display: flex; gap: 3px; width: max-content; }
.c-sq i { width: 12px; height: 12px; background: var(--ink); }

.c-ticks { display: flex; gap: 2px; }
.c-ticks i { flex: 1 1 0; height: 18px; background: var(--ink); }
.c-ticks--red i { background: var(--red); }

/* Benchmark: -11 hangs under the baseline, +18 stands on it. */
.c-bench {
  display: grid;
  grid-template-columns: minmax(0, 132px) minmax(0, 1fr);
  gap: 20px 16px;
  align-items: start;
}
@media (min-width: 900px) {
  .c-bench {
    grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
    column-gap: 28px;
  }
}
/* Under 375px the 181px dot grid no longer fits beside the plot: stack them. */
@media (max-width: 374px) {
  .c-bench { grid-template-columns: minmax(0, 1fr); }
  .c-bench__plot { max-width: 150px; }
}
.c-bench__plot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 100px auto;
  column-gap: 8px;
}
.c-bench__plot > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.c-bench__up {
  justify-content: flex-end;
  border-bottom: 2px solid var(--ink);
}
.c-bench__down { gap: 5px; }
.c-chart .c-bench__plot b { font-size: 20px; line-height: 1.3; }
.c-vbar {
  width: 100%;
  height: var(--h);
  background: var(--grey);
  transform-origin: center top;
  transition: transform 700ms var(--ease);
}
.c-vbar--red {
  background: var(--red);
  transform-origin: center bottom;
  transition-delay: 500ms;
}
.js [data-chart]:not(.is-in) .c-vbar { transform: scaleY(0); }

/* 110 judged videos, 11 per row. Colour comes from position. */
.c-dots {
  position: relative;
  width: max-content;
  max-width: 100%;
}
.c-dots__row {
  --n: 11;
  --step: 22ms;
  --row: 242ms;
  display: flex;
  gap: 6px;
  width: max-content;
}
.c-dots__row + .c-dots__row { margin-top: 6px; }
.c-dots__row i { width: 11px; height: 11px; background: var(--ink); }
.c-dots__row .r { background: var(--red); }
.c-dots__row .g { background: var(--grey); }
/* Homepage grid: 6 red, 51 black, 53 grey, coloured by position. */
.home .c-dots__row:first-child i:nth-child(-n+6) { background: var(--red); }
.home .c-dots__row:nth-child(6) i:nth-child(n+3),
.home .c-dots__row:nth-child(n+7) i { background: var(--grey); }
.home .c-dots .grease {
  left: -3px;
  top: -3px;
  width: 102px;
  height: 17px;
  max-width: none;
}
.home .c-dots .grease use { stroke-width: 1.5; }
.c-legend {
  margin-top: 12px;
  list-style: none;
}
.c-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.c-legend li + li { margin-top: 3px; }
.c-legend i { flex: none; width: 9px; height: 9px; background: var(--ink); }
.c-legend .r { background: var(--red); }
.c-legend .g { background: var(--grey); }

/* Three numbers in a row. */
.c-trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.c-trio p { border-top: 3px solid var(--ink); padding-top: 8px; }
.c-chart .c-trio b {
  display: block;
  font-size: clamp(20px, 6vw, 26px);
  line-height: 1.1;
}

/* The 15-second spot. */
.c-strip {
  position: relative;
  height: 20px;
  margin-top: 44px;
  margin-bottom: 20px;
  background: var(--wash);
}
.c-strip .c-bar {
  height: 100%;
  background: var(--grey);
  transition-duration: 1500ms;
  transition-timing-function: linear;
}
.c-strip__m {
  position: absolute;
  top: -20px;
  bottom: 0;
  left: var(--x);
  border-left: 2px solid var(--ink);
  white-space: nowrap;
  transition: opacity 300ms var(--ease) var(--d);
}
.c-strip__m span {
  position: absolute;
  right: 6px;
  top: -2px;
}
.c-strip__m--red {
  top: 0;
  bottom: -20px;
  border-color: var(--red);
  color: var(--red-t);
}
.c-strip__m--red span { top: auto; bottom: -2px; }
.js [data-chart]:not(.is-in) .c-strip__m { opacity: 0; }

/* SVG line charts. */
.c-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1600ms var(--ease);
}
.js [data-chart]:not(.is-in) .c-line { stroke-dashoffset: 1; }
.c-pt { transition: opacity 300ms var(--ease) calc(var(--i, 0) * 300ms); }
.js [data-chart]:not(.is-in) .c-pt { opacity: 0; }
.c-rule { stroke: var(--ink); stroke-width: 1; }
.c-rule--grid { stroke: #dedede; }
.c-mark {
  stroke: var(--red);
  stroke-width: 2;
  stroke-dasharray: 3 4;
}

/* Head to head: black left for lower CPA, red right for higher ROAS. */
.c-h2h {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 88px minmax(0, 1fr) 62px;
  gap: 6px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #dedede;
}
.c-h2h:first-child {
  padding-top: 0;
  border-top: 0;
}
.c-h2h > :nth-child(3) { text-align: center; }
.c-h2h > :first-child { text-align: right; }

/* Six pages shipped. */
.c-pages { display: flex; gap: 8px; }
.c-pages i {
  position: relative;
  width: 38px;
  height: 50px;
  border: 2px solid var(--ink);
  border-top-width: 8px;
  transition: opacity 300ms var(--ease) calc(var(--i) * 140ms), transform 300ms var(--ease) calc(var(--i) * 140ms);
}
.c-pages i::after {
  content: '';
  position: absolute;
  left: 5px;
  right: 9px;
  top: 7px;
  height: 9px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--grey);
}
.c-pages--red i { border-color: var(--red); }
.js [data-chart]:not(.is-in) .c-pages i {
  opacity: 0;
  transform: translateY(8px);
}

/* 15. Contact-sheet frames (global)
   Production: a contact sheet on black, the selects circled in red
   ========================================================================== */
.sheet__strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 6px;
  padding: 0 var(--gutter) 40px;
  list-style: none;
}
.frame { position: relative; }
.frame__btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.frame__edge {
  display: flex;
  justify-content: space-between;
  padding-bottom: 5px;
  color: var(--mute);
  font-family: var(--data);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.frame__img {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #1e1e1e;
  filter: grayscale(1);
  transition: filter 240ms var(--ease);
}
.frame__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.frame__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 7px 8px;
  background: var(--dark);
  color: var(--paper);
  font-family: var(--data);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 200ms var(--ease);
}
.frame__btn:focus-visible .frame__img,
.frame__btn[aria-pressed="true"] .frame__img { filter: none; }
.frame__btn:focus-visible .frame__cap,
.frame__btn[aria-pressed="true"] .frame__cap { opacity: 1; }
/* Hover only where a pointer can hover. On touch a tap toggles
   aria-pressed, so nothing sticks. */
@media (hover: hover) {
  .frame__btn:hover .frame__img { filter: none; }
  .frame__btn:hover .frame__cap { opacity: 1; }
}
/* The ellipse spills past the frame like a real grease-pencil ring. */
.frame .grease {
  left: -5%;
  top: 6%;
  width: 110%;
  height: 96%;
  max-width: none;
}

.home .sheet__foot {
  padding: 0 var(--gutter) 36px;
  color: var(--mute);
}

@media (min-width: 900px) {
  .sheet__strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 30px 8px;
    padding-bottom: 48px;
  }
}

/* 16. CNN interview
   ========================================================================== */
.home .cnn {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding: 32px var(--gutter) 44px;
  border-top: 1px solid #333333;
}
.home .cnn h2 { margin-top: 12px; font-size: clamp(24px, 2.9vw, 40px); }
.home .cnn__body {
  max-width: 56ch;
  margin-top: 18px;
}
.home .cnn__frame { position: relative; }
.home .cnn__frame .frame__edge { gap: 16px; }
.home .cnn__frame .frame__edge span:first-child { flex: none; }
.home .cnn__frame .frame__edge span:last-child { text-align: right; }
.home .cnn video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000000;
}
/* The ring pokes out past the frame by 3%, but never further than the page
   gutter, so wide screens do not get a sideways scroll. */
.home .cnn__frame .grease {
  --poke: min(3%, calc(var(--gutter) - 6px));
  left: calc(-1 * var(--poke));
  top: 2%;
  width: calc(100% + 2 * var(--poke));
  height: 92%;
  max-width: none;
}
.home .cnn__frame .grease { --u: 0.6; }
.home .cnn__sound { margin-top: 12px; }

@media (min-width: 900px) {
  .home .cnn {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 56px;
    align-items: center;
    padding-top: 56px;
    padding-bottom: 64px;
  }
}

/* 17. Contact: dark block, icon row, short form
   ========================================================================== */
.home .contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  padding: 36px var(--gutter) 48px;
}
.home .contact h2 { margin-top: 12px; }
.home .contact__body {
  max-width: 52ch;
  margin-top: 18px;
}
.home .contact__ask { margin-top: 18px; max-width: 44ch; }
.home .contact__rows { margin-top: 24px; }
.home .contact__rows div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 11px 0;
  border-top: 1px solid #3a3a3a;
}
.home .contact__rows div:last-child { border-bottom: 1px solid #3a3a3a; }
@media (max-width: 389px) {
  .home .contact__rows div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
}
.home .contact__rows dd { overflow-wrap: anywhere; }
.home .contact__rows a {
  display: inline-block;
  margin: -10px 0;
  padding: 10px 0;
}
.home .social {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 18px 0 0 -11px;
  list-style: none;
}
.home .social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--paper);
  transition: color 200ms var(--ease), transform 200ms var(--ease);
}
.home .social a:hover,
.home .social a:focus-visible {
  color: var(--red);
  transform: translateY(-3px);
}
.home .social i {
  display: block;
  width: 21px;
  height: 21px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.home .social .s-linkedin { --icon: url(/assets/social-icons/linkedin.svg); }
.home .social .s-instagram { --icon: url(/assets/social-icons/instagram.svg); }
.home .social .s-tiktok { --icon: url(/assets/social-icons/tiktok.svg); }
.home .social .s-x { --icon: url(/assets/social-icons/x.svg); }
.home .social .s-facebook { --icon: url(/assets/social-icons/facebook.svg); }
.home .social .s-mail { --icon: url(/assets/social-icons/mail.svg); }

.home .form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px 16px;
  align-content: start;
}
.home .form__title { font-size: clamp(20px, 2vw, 26px); }
.home .field { display: block; }
.home .field .label { display: block; margin-bottom: 7px; }
.home .field input,
.home .field select,
.home .field textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--mute);
  border-radius: 0;
  background: var(--dark);
  color: var(--paper);
  font-size: 16px;
  line-height: 1.4;
  transition: border-color 200ms var(--ease);
}
.home .field textarea { min-height: 120px; resize: vertical; }
.home .field input:hover,
.home .field select:hover,
.home .field textarea:hover { border-color: var(--paper); }
.home .field input:focus,
.home .field select:focus,
.home .field textarea:focus {
  border-color: var(--red);
  outline: 2px solid var(--red);
  outline-offset: 0;
}
.home .form__honey {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.home .form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.home .form__status { color: var(--mute); }
.home .form__status.is-error { color: var(--paper); }
.home .form__status.is-success { color: var(--paper); }

@media (min-width: 640px) {
  .home .form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .form > .field--wide,
  .home .form > .form__title,
  .home .form > .form__foot { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .home .contact {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 64px;
    padding-top: 56px;
    padding-bottom: 72px;
  }
}

/* Chart kit on dark blocks: captions and plain ticks flip to light. */
.on-dark .c-chart .k { color: var(--mute); }
.on-dark .c-ticks:not(.c-ticks--red) i { background: var(--paper); }

/* Print: reveals, charts and counters show their finished state on paper.
   site.js marks every [data-reveal] and [data-chart] .is-in on beforeprint and
   restores the counters; transitions are off so nothing prints mid-draw. Dark
   blocks keep their ground so white type stays readable. */
@media print {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; }
  .site-header { position: static; }
  .loupe, .progress { display: none; }
  .read, .tile, .frame, .row, .c-chart, .note__pull {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .on-dark, .site-footer, .tile--red {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
