/* ============================================================================
   TANGUN.CA CASE STUDY PAGES  (work/<project>.html, 2026-10-06)

   One stylesheet for every page written by tangun-ca/tools/build_case_pages.py.
   The anatomy is the one Akin liked on the ADWORKS project pages: a dark
   opening with the breadcrumb, tags, headline, one paragraph and a row of
   facts; the lead picture rising out of it; then chapters, each a small label
   and a headline on the left with its explanation on the right and the
   pictures underneath; then the next project and a way to get in touch.

   The dress is tangun.ca's own: Unna for headlines, Inter for reading, the
   home page's paper and near-black. Each page sets one colour of its own,
   --pj, on <body>, taken from the project.

   Not used by sutas-ayran.html, dodoner.html or the two Miller pages: those
   are hand-made and still on work.css.
   ============================================================================ */

:root {
  --font-serif: "Unna", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --paper: #f4f4f4;
  --paper-alt: #eae9e6;
  --ink: #222;
  --ink-2: #3d3d3d;
  --ink-3: #6f6f6f;
  --line: rgba(34, 34, 34, 0.15);
  --dark: #1a1a17;
  --on-dark: #f4f4f4;
  --on-dark-2: #c9c9c9;
  --on-dark-3: #969696;
  --pj: #4eb2ba;
  --wrap: 1180px;
  --edge: clamp(20px, 5vw, 80px);
  --gap: clamp(12px, 1.6vw, 22px);
  --ease-quart-out: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-expo-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video { display: block; max-width: 100%; }
h1, h2, p, dl, dd, figure { margin: 0; }
a { color: inherit; }
::selection { background: var(--pj); color: #fff; }
:focus-visible { outline: 2px solid var(--pj); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--edge) * 2);
  margin: 0 auto;
  padding: 0 var(--edge);
}

/* ---- the two fixed corner pieces, as on every tangun.ca page -------------- */

.cs-chrome {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px clamp(16px, 2.5vw, 36px);
  pointer-events: none;
}
.cs-chrome a { pointer-events: auto; }
.cs-mark img { width: 30px; height: auto; filter: invert(1) brightness(2); transition: filter 0.3s var(--ease-quart-out); }
.cs-chrome.is-light .cs-mark img { filter: none; }
.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.3s var(--ease-quart-out), color 0.3s var(--ease-quart-out), gap 0.3s var(--ease-quart-out);
}
.cs-back:hover { background: var(--ink); color: var(--paper); gap: 14px; }

/* ---- the opening ---------------------------------------------------------- */

.cs-hero {
  background: var(--dark);
  color: var(--on-dark);
  padding: clamp(120px, 17vh, 190px) 0 clamp(150px, 21vw, 290px);
}
.cs-crumb {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-dark-3);
}
.cs-crumb a { text-decoration: none; transition: color 0.3s var(--ease-quart-out); }
.cs-crumb a:hover { color: var(--on-dark); }
.cs-crumb i { font-style: normal; padding: 0 0.6em; opacity: 0.6; }
.cs-crumb b { font-weight: 400; color: var(--on-dark); }

.cs-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(28px, 4vw, 46px); }
.cs-tag {
  padding: 5px 11px;
  border: 1px solid rgba(244, 244, 244, 0.28);
  border-radius: 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-dark-2);
}
.cs-tag--lead { border-color: var(--pj); background: var(--pj); color: #fff; }

.cs-hero h1 {
  max-width: 17ch;
  margin-top: 22px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(42px, 6.3vw, 92px);
  line-height: 1;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.cs-hero h1 em, .cs-text h2 em, .cs-cta h2 em { font-style: italic; color: var(--pj); }
.cs-sub {
  max-width: 62ch;
  margin-top: clamp(22px, 2.6vw, 34px);
  font-size: clamp(16px, 1.25vw, 18.5px);
  font-weight: 300;
  line-height: 1.6;
  color: var(--on-dark-2);
}

.cs-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 clamp(18px, 3vw, 44px);
  margin-top: clamp(40px, 5vw, 68px);
  padding-top: 22px;
  border-top: 1px solid rgba(244, 244, 244, 0.2);
}
.cs-facts dt {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-dark-3);
}
.cs-facts dd { margin-top: 7px; font-size: 14.5px; line-height: 1.5; color: var(--on-dark); }
.cs-facts a { text-decoration-color: rgba(244, 244, 244, 0.4); text-underline-offset: 3px; }
.cs-facts a:hover { text-decoration-color: var(--pj); }

/* The lead picture is pulled up into the opening, so the page's first image
   is half on the dark and half on the paper. */
.cs-lead { margin-top: calc(-1 * clamp(110px, 16vw, 230px)); position: relative; z-index: 2; }
.cs-lead > figure, .cs-lead > .cs-film {
  overflow: hidden;
  border-radius: 6px;
  background: #111;
  box-shadow: 0 30px 80px rgba(20, 20, 18, 0.28);
}
.cs-lead img, .cs-lead video { width: 100%; }
.cs-lead--paper > figure { background: #fff; }

/* ---- a chapter -------------------------------------------------------------- */

.cs-chapter { padding: clamp(72px, 9.5vw, 140px) 0; }
.cs-chapter--alt { background: var(--paper-alt); }
.cs-chapter--dark { background: var(--dark); color: var(--on-dark); }

.cs-text {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(20px, 5vw, 80px);
  align-items: start;
  margin-bottom: clamp(34px, 4.5vw, 62px);
}
.cs-text:last-child { margin-bottom: 0; }
.cs-eyebrow {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pj);
}
.cs-text h2 {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(30px, 3.5vw, 50px);
  line-height: 1.04;
  letter-spacing: -0.008em;
  text-wrap: balance;
}
.cs-text p {
  max-width: 58ch;
  font-size: clamp(15.5px, 1.15vw, 17px);
  font-weight: 300;
  color: var(--ink-2);
}
.cs-text p + p { margin-top: 1em; }
.cs-chapter--dark .cs-text p { color: var(--on-dark-2); }
.cs-text p a { text-decoration-color: var(--pj); text-underline-offset: 3px; }
.cs-text > div:last-child { padding-top: clamp(0px, 2.2vw, 32px); }

/* ---- pictures and films ----------------------------------------------------- */

.cs-fig { overflow: hidden; border-radius: 6px; background: var(--paper-alt); }
.cs-chapter--alt .cs-fig { background: #dddcd8; }
.cs-fig img, .cs-fig video { width: 100%; }
.cs-fig--paper { background: #fff; }
.cs-fig--pad { display: grid; place-items: center; padding: clamp(28px, 6vw, 80px); }
.cs-fig--pad img { width: min(100%, 520px); }
.cs-fig--green { background: #23420f; }
.cs-cap {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.cs-chapter--dark .cs-cap { color: var(--on-dark-3); }

.cs-grid { display: grid; gap: var(--gap); align-items: start; }
.cs-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs-grid + .cs-fig, .cs-fig + .cs-grid, .cs-grid + .cs-grid, .cs-item + .cs-item.cs-item--block { margin-top: var(--gap); }
.cs-item--block { display: block; }

/* Upright clips: never wider than they need to be, side by side, centred. */
.cs-talls { display: flex; justify-content: center; gap: var(--gap); flex-wrap: wrap; }
.cs-talls .cs-item { width: min(100%, 360px); }
.cs-talls .cs-fig video { aspect-ratio: 9 / 16; object-fit: cover; }
.cs-square { width: min(100%, 720px); margin: 0 auto; }

/* A website screen in a browser frame, its phone version at the side. */
.cs-shot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(110px, 17%, 190px);
  gap: var(--gap);
  align-items: end;
}
.cs-shot + .cs-shot { margin-top: clamp(28px, 4vw, 56px); }
.cs-shot .cs-cap { grid-column: 1 / -1; margin-top: 0; }
.cs-browser { overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 18px 50px rgba(20, 20, 18, 0.16); }
.cs-browser__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 30px;
  padding: 0 12px;
  background: #e3e2df;
  font-size: 11px;
  color: var(--ink-3);
}
.cs-browser__bar i { display: flex; gap: 5px; }
.cs-browser__bar b { width: 8px; height: 8px; border-radius: 50%; background: #bdbcb8; }
.cs-phone { overflow: hidden; border-radius: 14px; border: 5px solid #222; background: #222; box-shadow: 0 18px 50px rgba(20, 20, 18, 0.2); }

/* A table that sets two things side by side (COG). */
.cs-versus { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.cs-versus th, .cs-versus td { padding: 14px 16px 14px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; font-weight: 300; }
.cs-versus thead th { border-top: 0; font-family: var(--font-serif); font-size: 22px; font-weight: 400; }
.cs-versus tbody th { width: 16%; font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding-top: 18px; }
.cs-versus b { font-weight: 600; }
.cs-sw { display: flex; gap: 4px; margin-bottom: 8px; }
.cs-sw i { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(34, 34, 34, 0.12); }

/* A boxed side note (Tom Ford on the Reveal Box page): framed, smaller than a
   chapter, its picture beside its words. */
.cs-box {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(18px, 2.6vw, 34px);
  border: 1px solid var(--ink);
  background: var(--paper);
}
.cs-box .cs-item { opacity: 1; transform: none; }
.cs-box__text h2 {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(26px, 2.8vw, 38px);
  line-height: 1.06;
}
.cs-box__text h2 em { font-style: italic; color: var(--pj); }
.cs-box__text p:not(.cs-eyebrow) { max-width: 46ch; margin-top: 14px; font-size: 15.5px; font-weight: 300; color: var(--ink-2); }
@media (max-width: 700px) { .cs-box { grid-template-columns: 1fr; } }

/* ---- figures: a few sourced numbers, each with where it comes from --------- */

.cs-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: clamp(20px, 4vw, 60px); }
.cs-figures b {
  display: block;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(44px, 5.4vw, 78px);
  line-height: 1;
  color: var(--pj);
}
.cs-figures span { display: block; margin-top: 10px; font-size: 15px; color: var(--ink-2); }
.cs-chapter--dark .cs-figures span { color: var(--on-dark-2); }

/* ---- next project ------------------------------------------------------------- */

.cs-next { border-top: 1px solid var(--line); padding: clamp(40px, 5vw, 70px) 0; }
.cs-next__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cs-next__card { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 30px); text-decoration: none; min-width: 0; }
.cs-next__card img {
  width: clamp(96px, 12vw, 160px);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  background: var(--paper-alt);
  transition: transform 0.8s var(--ease-expo-out);
}
.cs-next__card:hover img { transform: scale(1.04); }
.cs-next__card small { display: block; font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.cs-next__card b {
  display: block;
  margin-top: 6px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.05;
}
.cs-next__card b i { font-style: normal; display: inline-block; transition: transform 0.4s var(--ease-expo-out); }
.cs-next__card:hover b i { transform: translate(4px, -4px); }

.cs-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 22px;
  border: 1px solid currentColor;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.3s var(--ease-quart-out), color 0.3s var(--ease-quart-out), border-color 0.3s var(--ease-quart-out);
}
.cs-btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.cs-btn--solid { background: var(--pj); border-color: var(--pj); color: #fff; }
.cs-btn--solid:hover { background: var(--on-dark); border-color: var(--on-dark); color: var(--dark); }

/* ---- get in touch -------------------------------------------------------------- */

.cs-cta { background: var(--dark); color: var(--on-dark); padding: clamp(80px, 11vw, 160px) 0; text-align: center; }
.cs-cta .cs-eyebrow { color: var(--on-dark-3); }
.cs-cta h2 {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 86px);
  line-height: 1;
}
.cs-cta p { max-width: 46ch; margin: 22px auto 0; font-weight: 300; color: var(--on-dark-2); }
.cs-cta .cs-btn { margin-top: 34px; }
.cs-cta small { display: block; margin-top: 22px; font-size: 13px; color: var(--on-dark-3); }
.cs-cta small a { text-underline-offset: 3px; }

.cs-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px var(--edge);
  background: var(--dark);
  border-top: 1px solid rgba(244, 244, 244, 0.14);
  color: var(--on-dark-3);
  font-size: 12.5px;
}
.cs-foot a { text-decoration: none; }
.cs-foot a:hover { color: var(--on-dark); }

/* ---- arriving ------------------------------------------------------------------
   Only once the script has said it is running (.cs-js on <html>), so a page
   with no script shows everything. */
.cs-js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.8s var(--ease-quart-out), transform 1s var(--ease-expo-out); }
.cs-js .reveal.is-in { opacity: 1; transform: none; }
.cs-js .reveal.d1 { transition-delay: 0.08s; }
.cs-js .reveal.d2 { transition-delay: 0.16s; }

@media (max-width: 860px) {
  .cs-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
  .cs-text { grid-template-columns: 1fr; gap: 16px; }
  .cs-text > div:last-child { padding-top: 0; }
  .cs-grid--3 { grid-template-columns: 1fr; }
  .cs-versus tbody th { width: 24%; }
}
@media (max-width: 600px) {
  .cs-grid--2 { grid-template-columns: 1fr; }
  .cs-grid--2.cs-grid--keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-talls .cs-item { width: calc(50% - var(--gap) / 2); }
  .cs-talls--one .cs-item { width: min(100%, 300px); }
  .cs-back span:first-child { display: none; }
  .cs-versus { font-size: 13px; }
  .cs-versus thead th { font-size: 17px; }
  .cs-next__in { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01s !important; }
}
