/* Third Option — style sketch.
   Same type, colours and spacing as the Above Board brand book, with no colour accents. */

@font-face { font-family: 'Helvetica Neue'; font-weight: 700; font-display: swap; src: url(fonts/helvetica-neue-bold.woff2) format('woff2'), url(fonts/helvetica-neue-bold.otf) format('opentype'); }
@font-face { font-family: 'DM Mono'; font-weight: 400; font-display: swap; src: url(fonts/dm-mono-400-latin.woff2) format('woff2'); }
@font-face { font-family: 'DM Mono'; font-weight: 400; font-display: swap; src: url(fonts/dm-mono-400-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+1E00-1EFF; }
@font-face { font-family: 'DM Mono'; font-weight: 500; font-display: swap; src: url(fonts/dm-mono-500-latin.woff2) format('woff2'); }

:root {
  --white: #ffffff;
  --ink: #0a0a0a;
  --grey-3: #aaaaaa;
  --grey-4: #666666;
  --pad: clamp(10px, 1.4vw, 20px);   /* page margin, also the gap between grid columns */
  --cols: 4;                           /* one grid for the whole page */
  --half: calc(50% - var(--pad) / 2);  /* exactly two grid columns */
  --nav-h: 44px;
  --font-display: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, Menlo, monospace;
  --small: clamp(10px, .78vw, 12px);
  --copy: clamp(12px, .95vw, 15px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font-family: var(--font-mono); font-size: var(--small); line-height: 1.45; letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--grey-4); }
p { margin: 0 0 1em; }
img { display: block; width: 100%; height: auto; }
/* Read by search engines and screen readers, not shown */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Top bar: logo left, three words right */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 10; height: var(--nav-h);
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 var(--pad); background: var(--white);
}
.logo img { height: 8px; width: auto; }
.links a { margin-left: 1.6em; }
/* Contact shows the address on hover; a click opens the mail app */
.contact .email { display: none; }
.contact:hover .label, .contact:focus-visible .label { display: none; }
.contact:hover .email, .contact:focus-visible .email { display: inline; }

.title {
  margin: 0; font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  letter-spacing: -.035em; line-height: 1; font-size: clamp(28px, 3.4vw, 52px);
}
.copy { font-size: var(--copy); line-height: 1.5; text-wrap: pretty; }
.copy--block { width: var(--half); }
.label { color: var(--grey-4); margin-bottom: 1.4em; }
.kicker { font-weight: 500; }
.meta { color: var(--grey-4); }
.u { text-decoration: underline; text-underline-offset: 3px; }


section { padding: 10vh var(--pad) 0; }
/* First screen: menu on top, the work list in the middle of the screen (main.js sets the space above it),
   the footer at the bottom. An opened project simply makes the page longer. */
main { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; padding-top: var(--nav-h); }
#index { padding-top: 8vh; }
main > .foot { margin-top: auto; }

/* Project index: one quiet line per project */
.list { list-style: none; margin: 0; padding: 0; }
.row-link {
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: var(--pad);  /* same grid as everything else */
  padding: .12em 0; cursor: pointer;
}
.row--soon .row-link { cursor: default; }   /* listed, not opened yet (The Big Safari) */
.row-link .t { text-transform: uppercase; }
.row-link .ty { grid-column: span 2; color: var(--grey-3); }
a.row-link:hover .t, .row.is-open .t { text-decoration: underline; text-underline-offset: 3px; }

/* An opened project: title, text, then just the pictures */
.project { display: none; padding: 8vh 0 4vh; }
.row.is-open .project { display: block; }
.project .title { margin-bottom: .5em; }
.project .meta:first-of-type { margin-bottom: 4vh; }
.project .copy p { margin-bottom: 1em; }
.project .copy .meta { margin-top: 2em; }

/* The shared grid: same columns and gap everywhere */
.grid, .cols { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: var(--pad); }
.grid {
  grid-auto-flow: dense;
  margin-top: 8vh; align-items: start;
}
.grid figure { margin: 0; }
.grid .wide, .grid .big, .tiles .wide { grid-column: span 2; }
/* Wider spans close short rows (see fill_spans in tools/case_studies.py) */
.s3 { grid-column: span 3 !important; }
.s4 { grid-column: span 4 !important; }
/* Video stills: always two across on a computer, rows lined up; one at a time on a phone */
.grid.frames { grid-template-columns: 1fr 1fr; grid-auto-flow: row; }
.grid.frames + .grid, .grid.full + .grid { margin-top: var(--pad); }
/* Highlight loop: plays on its own, full width, 2.40:1 like a cinema frame (SFAS is 2.50:1) */
.loop { margin: 8vh 0 0; }
.loop video { display: block; width: 100%; height: auto; background: var(--ink); }
.loop figcaption { padding-top: .8em; }
.photo-note { margin: 0; padding-top: .8em; grid-column: 1 / -1; }   /* a line under a photo grid (Above Board shop) */
.loop + .grid { margin-top: var(--pad); }
.close { margin-top: 4vh; }
/* A special insert among the photos (the Tracking animation spotlight): the film full width in the
   photo grid's rhythm, its words underneath like a caption */
.insert { margin-top: var(--pad); }
.insert .loop { margin: 0; }
.insert .copy { padding-top: .8em; }
.insert + .grid { margin-top: var(--pad); }



.foot { padding: 5vh var(--pad) 3vh; }
.foot p { margin: 0 0 .3em; }
.social a { margin-right: 1.2em; }
.copy-r { color: var(--grey-3); margin-top: 1.2em !important; }
/* Copyright left, credit right on the same line */
.copy-r { display: flex; justify-content: space-between; gap: 1em; flex-wrap: wrap; }


/* ---------- Case studies list (landing, under the work list) ---------- */
#cases { padding-top: 4vh; }
#cases .label { margin-bottom: .6em; }

/* ---------- Logo tiles: square rows on the shared grid ---------- */
.project, .cs { container-type: inline-size; }
.tiles {
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: var(--pad);
  grid-auto-rows: calc((100cqw - (var(--cols) - 1) * var(--pad)) / var(--cols));
  grid-auto-flow: dense; margin-top: var(--pad);
}
.project .tiles:first-of-type { margin-top: 8vh; }
.tile { margin: 0; background: #f2f2f2; display: flex; align-items: center; justify-content: center; padding: 14%; min-width: 0; }
.tile.wide { grid-column: span 2; padding: 7% 10%; }
.tile img { width: 100%; height: 100%; object-fit: contain; }
.tile.swatches { padding: 0; flex-direction: column; align-items: stretch; }
.chip { flex: 1; display: flex; align-items: flex-end; padding: .7em .8em; font-size: var(--small); }
.chip.light { color: #fff; }
.chip.dark { color: var(--ink); }
.tiles + .grid { margin-top: var(--pad); }
.tiles + .tiles, .grid + .tiles { margin-top: var(--pad); }
.tile.dark { background: #000; }
.ink-white { filter: invert(1); }   /* black artwork shown white on a black tile */
.tile.swatches.wide { flex-direction: row; }
.tile.swatches.wide .chip { align-items: flex-end; }
/* Above Board type specimens: the two lines at their own sizes, labels under each */
.tile.type-tile { flex-direction: column; gap: 3.2em; padding: 6% 8%; }
.type-spec { width: 100%; display: flex; flex-direction: column; align-items: center; }
.type-spec img { height: auto; }
.type-spec img.w482 { width: 66%; }
.type-spec img.w411 { width: 56.3%; }   /* 411/482 of the first: same type size */
.type-spec p { margin: 1.2em 0 0; font-size: var(--small); color: var(--grey-4); }

/* ---------- Case study page ---------- */
.cs { padding: 0 var(--pad); }
.cs-head { padding-top: calc(var(--nav-h) + 14vh); }
.cs-title { text-align: left; font-size: clamp(40px, 8vw, 132px); margin: .1em 0 .5em; }
.cs-meta { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: var(--pad); }
.cs-meta p { margin: 0; }
.cs-meta-label { color: var(--grey-3); margin-bottom: .3em !important; }
.cs-lede { font-family: var(--font-display); font-weight: 700; letter-spacing: -.03em; line-height: 1.05;
  font-size: clamp(22px, 2.6vw, 40px); width: var(--half); margin: 10vh 0 0; }
.cs-hero { margin: 10vh 0 0; }

.chapter {
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 0 var(--pad);
  padding: 16vh 0 0; align-items: start;   /* no side padding: .cs already has the page margin */
}
.grid.solo figure { grid-column: 2 / span 2; }
.grid.solo.full figure { grid-column: 1 / -1; }   /* one photo across the whole grid (masonry leaves .solo alone) */
.ch-label { grid-column: 1; font-weight: 500; margin: 0; }
.ch-num { color: var(--grey-3); margin-right: 1.2em; font-weight: 400; }
.ch-body { grid-column: 2 / span 2; margin: 0; }
.ch-body p { margin: 0 0 1em; }
.ch-body:empty { display: none; }
.ch-rows { grid-column: 2 / span 3; display: grid; grid-template-columns: subgrid; row-gap: 1.2em; margin-top: 3vh; }
.ch-row-label { grid-column: 1; margin: 0; color: var(--grey-4); white-space: pre-line; }
.ch-row-text { grid-column: 2 / span 2; max-width: 46em; font-size: var(--copy); line-height: 1.5; }
.ch-body:empty + .ch-rows { margin-top: 0; }
.ch-row-text p { margin: 0 0 .6em; }
.chapter > .grid, .chapter > .tiles { grid-column: 1 / -1; margin-top: 6vh; }
.chapter > .tiles + .tiles { margin-top: var(--pad); }
.cs-quote { grid-column: 2 / span 3; font-family: var(--font-display); font-weight: 700; letter-spacing: -.03em;
  line-height: 1.05; font-size: clamp(26px, 3.4vw, 52px); text-transform: uppercase; margin: 8vh 0 0; }
.cs-link { grid-column: 2 / span 2; margin: 2vh 0 0; }
.soon { color: var(--grey-3); }
.case .foot { padding-top: 18vh; }

@media (max-width: 760px) {
  .grid.frames { grid-template-columns: 1fr; }
  .s3, .s4 { grid-column: span 2 !important; }
  :root { --cols: 2; --half: 100%; }
  .ch-label { grid-column: 1 / -1; margin-bottom: 1.4em; }
  .ch-body, .ch-rows, .cs-quote, .cs-link { grid-column: 1 / -1; }
  .ch-rows { grid-template-columns: 1fr; }
  .ch-row-label, .ch-row-text { grid-column: 1; }
  .cs-meta div:last-child { grid-column: 1 / -1; }
  .row-link .ty { display: none; }
}
