@import url("https://api.fontshare.com/v2/css?f[]=general-sans@200,400,600,700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap");

/* ------------------------------------------------------------------
   Project pages — shared template
   ------------------------------------------------------------------ */

:root {
  color-scheme: light;
  --ink: #111;
  --muted: #333333;
  --soft: #8a8a8a;
  --bg: #ffffff;
  --line: #e4e4e4;
  --gutter: clamp(20px, 5vw, 64px);
  --display: "Bebas Neue", "Oswald", "Arial Narrow", sans-serif;
  --text: "General Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--text);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

em {
  font-style: italic;
  font-weight: 600;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 24px var(--gutter);
  font-size: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
}

.topbar a {
  color: var(--ink);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
}

.topbar a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0%;
  background: currentColor;
  transition: width 0.2s ease;
}

.topbar a:hover::after,
.topbar a:focus-visible::after {
  width: 100%;
}

.topbar .index {
  font-weight: 200;
  color: var(--soft);
}

/* home link + previous / next project arrows */
.pager {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.pager a:first-child {
  margin-right: 18px;
}

.pager .index {
  font-variant-numeric: tabular-nums;
}

/* ---------- hero ---------- */

.hero {
  padding: 8vh var(--gutter) 48px;
}

.hero .number {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(44px, 8vw, 120px);
  overflow-wrap: break-word;
  line-height: 0.82;
  letter-spacing: -0.005em;
  text-transform: uppercase;
}

.hero .lede {
  max-width: 560px;
  margin: 32px 0 0;
  font-size: 20px;
  font-weight: 200;
  line-height: 1.4;
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
  margin: 48px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--ink);
}

.meta div {
  margin: 0;
}

.meta dt {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.meta dd {
  margin: 0;
  font-size: 15px;
  font-weight: 200;
  line-height: 1.5;
}

/* ---------- media ---------- */

.media {
  margin: 0;
  padding: 0 var(--gutter);
}

.media.narrow {
  max-width: calc(760px + 2 * var(--gutter));
  margin-left: auto;
  margin-right: auto;
}

.media video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.media + .media {
  margin-top: 16px;
}

.media.bleed {
  padding: 0;
}

.media.dark {
  background: #000;
}

.media figcaption {
  padding: 12px 0 0;
  font-size: 13px;
  font-weight: 200;
  color: var(--soft);
}

.media.bleed figcaption {
  padding-left: var(--gutter);
}

.media.dark figcaption {
  padding-bottom: 16px;
}

/* two images side by side, always the same height */
.pair {
  display: grid;
  grid-template-columns: 2.1fr 1fr;
  gap: 16px;
  align-items: stretch;
  padding: 0 var(--gutter);
}

.pair.even {
  grid-template-columns: 1fr 1fr;
}

.pair .media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* even pairs: both images cropped to the same 3:2 frame */
.pair.even .media img {
  aspect-ratio: 3 / 2;
}

/* drawings and sketches: never cropped, centred on white */
.pair.contain .media img {
  object-fit: contain;
  background: #fff;
}

/* wide + tall pairs: the wide image sets the height, the tall one fills it */
.pair:not(.even) > .media:first-child img {
  aspect-ratio: 3 / 2;
}

.pair:not(.even) > .media:last-child {
  position: relative;
}

.pair:not(.even) > .media:last-child img {
  position: absolute;
  inset: 0;
}

.pair + .pair,
.media + .pair,
.pair + .media,
.panel + .pair,
.pair + .panel {
  margin-top: 16px;
}

@media (max-width: 720px) {
  .pair:not(.even) > .media:last-child {
    position: static;
  }

  .pair:not(.even) > .media:last-child img {
    position: static;
    height: auto;
    aspect-ratio: 2 / 3;
  }
}

@media (max-width: 560px) {
  .pair.even {
    grid-template-columns: 1fr;
  }
}

.pair .media {
  padding: 0;
  margin: 0;
}

/* coloured panel holding a logo or artwork */
.panel {
  display: grid;
  place-items: center;
  margin: 0 var(--gutter);
  padding: clamp(48px, 10vw, 140px) var(--gutter);
  background: var(--panel, #f4f4f4);
}

.panel img {
  width: min(560px, 100%);
}

.panel.bleed {
  margin: 0;
}

/* colour swatches */
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.swatches li {
  aspect-ratio: 3 / 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
  font-size: 13px;
  line-height: 1.4;
  border: 1px solid var(--line);
}

.swatches b {
  font-weight: 600;
}

.block a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* ---------- text blocks ---------- */

.block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px;
  padding: 96px var(--gutter);
}

.block h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.block h2 span {
  display: block;
  font-weight: 200;
  color: var(--soft);
}

.block .body {
  max-width: 640px;
}

.block p {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 200;
  line-height: 1.5;
}

.block p:last-child {
  margin-bottom: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 6px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 15px;
}

.numbered {
  columns: 2;
  column-gap: 32px;
  margin: 24px 0 0;
  padding: 0 0 0 1.6em;
  font-size: 15px;
  font-weight: 200;
  line-height: 1.8;
}

.numbered li::marker {
  font-weight: 600;
}

/* problem → solution rows */
.solutions {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.solutions li {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  font-weight: 200;
  line-height: 1.4;
}

.solutions li::after {
  content: none;
}

.solutions .arrow {
  color: var(--soft);
}

.solutions b {
  font-weight: 600;
}

/* small labelled facts, e.g. interview numbers */
.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 32px 0 0;
}

.figures div {
  border-top: 1px solid var(--ink);
  padding-top: 12px;
}

.figures strong {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 64px;
  line-height: 1;
}

.figures span {
  font-size: 14px;
  font-weight: 200;
}

/* looping prototype clips */
.clips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0 var(--gutter);
}

.clips figure {
  margin: 0;
}

.clips video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.clips figcaption {
  padding-top: 10px;
  font-size: 13px;
  font-weight: 200;
  color: var(--soft);
}

@media (max-width: 720px) {
  .figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clips {
    grid-template-columns: 1fr;
  }

  .solutions li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .solutions .arrow {
    display: none;
  }
}

/* ---------- work index ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 16px;
  margin: 0;
  padding: 0 var(--gutter);
  list-style: none;
}

.work-grid a {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.work-grid img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.work-grid a:hover img,
.work-grid a:focus-visible img {
  opacity: 0.85;
}

.work-grid .label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-top: 14px;
}

.work-grid strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 0.9;
  text-transform: uppercase;
}

.work-grid small {
  font-size: 14px;
  font-weight: 200;
  color: var(--muted);
  text-align: right;
}

/* ---------- curriculum ---------- */

.cv-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.cv-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.cv-list b {
  font-size: 18px;
  font-weight: 600;
}

.cv-list span {
  grid-column: 1;
  font-size: 15px;
  font-weight: 200;
  color: var(--muted);
}

.cv-list time {
  grid-column: 2;
  grid-row: 1;
  font-size: 15px;
  font-weight: 200;
  color: var(--soft);
  white-space: nowrap;
}

.portrait {
  width: min(100%, 360px);
  margin-top: 20px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.block a.mail {
  font-size: 20px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .work-grid {
    grid-template-columns: 1fr;
  }
}

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

.next {
  display: block;
  padding: 48px var(--gutter) 64px;
  color: var(--ink);
  text-decoration: none;
  border-top: 1px solid var(--line);
  margin-top: 64px;
}

.next small {
  display: block;
  font-size: 16px;
  font-weight: 200;
  margin-bottom: 8px;
}

.next strong {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 80px);
  line-height: 0.9;
  text-transform: uppercase;
  transition: transform 0.3s ease;
}

.next:hover strong,
.next:focus-visible strong {
  transform: translateX(16px);
}

.next strong::after {
  content: " \2192";
}

footer.credits {
  padding: 0 var(--gutter) 48px;
  font-size: 13px;
  font-weight: 200;
  color: var(--soft);
}

/* ---------- old placeholder layout (pages not redesigned yet) ---------- */

.page {
  max-width: 900px;
  padding: 64px 24px 96px;
  margin: 0 auto;
}

.back {
  display: inline-block;
  margin-bottom: 32px;
  text-decoration: none;
  color: var(--ink);
}

.page h1 {
  margin: 0 0 16px;
  font-size: 40px;
  font-weight: 600;
}

.subtitle {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 32px;
  font-weight: 200;
}

.section {
  margin-top: 32px;
}

.section h2 {
  font-size: 20px;
  margin: 0 0 12px;
  font-weight: 600;
}

.section p,
.section ul {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 200;
  line-height: 1.6;
}

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  .meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .block {
    grid-template-columns: 1fr;
    padding: 64px var(--gutter);
  }

  .block p,
  .hero .lede {
    font-size: 18px;
  }

  .pair {
    grid-template-columns: 1fr;
  }

  .numbered {
    columns: 1;
  }
}

/* ---------- text: 16px regular, first lines aligned with headings ---------- */

.block h2,
.block p,
.block li,
.block b {
  line-height: 1.5;
}

.block p {
  font-size: 16px;
  font-weight: 400;
}

.block .body > :first-child {
  margin-top: 0;
}

.block h2 span,
.meta dd,
.figures span,
.cv-list span,
.cv-list time {
  font-weight: 400;
}

.numbered,
.solutions li {
  font-size: 16px;
  font-weight: 400;
}

.numbered li {
  margin-bottom: 4px;
}

.cv-list {
  border-top: 0;
}

.cv-list li:first-child {
  padding-top: 0;
}

.cv-list b {
  font-size: 16px;
}

.cv-list span,
.cv-list time {
  font-size: 14px;
}

.block a.mail {
  font-size: 16px;
}

/* work cards: project logo on its brand colour */
.work-grid .cover {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg, #f4f4f4);
  transition: opacity 0.3s ease;
}

.work-grid .cover img {
  width: 56%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

.work-grid .cover.full img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-grid a:hover .cover,
.work-grid a:focus-visible .cover {
  opacity: 0.85;
}

.work-grid a:hover img,
.work-grid a:focus-visible img {
  opacity: 1;
}

/* work cards: project names in 16px bold lowercase */
.work-grid strong {
  font-family: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-transform: lowercase;
}

.work-grid small {
  font-size: 14px;
  font-weight: 400;
}

/* curriculum: portrait top-aligned with the first line of the about text */
.about .portrait {
  margin-top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* curriculum header: name on the left, contacts on the right (as in the CV PDF) */
.hero--cv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 48px;
  align-items: start;
}

.hero--cv .cv-side {
  padding-top: 6px;
}

.cv-contacts {
  display: grid;
  grid-template-columns: repeat(2, auto);
  grid-template-areas:
    "residence birth"
    "email linkedin";
  gap: 18px 48px;
  margin: 0;
  text-align: right;
}

.cv-contacts .c-email { grid-area: email; }
.cv-contacts .c-residence { grid-area: residence; }
.cv-contacts .c-linkedin { grid-area: linkedin; }
.cv-contacts .c-website { grid-area: website; }
.cv-contacts .c-birth { grid-area: birth; }

.cv-contacts dt {
  font-size: 13px;
  font-weight: 400;
  color: var(--soft);
  margin-bottom: 2px;
}

.cv-contacts dd {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
}

.cv-contacts a {
  color: inherit;
  text-decoration: none;
}

.cv-contacts a:hover,
.cv-contacts a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero--cv .cv-links {
  display: flex;
  justify-content: flex-end;
  gap: 8px 28px;
  margin: 28px 0 0;
  font-size: 15px;
  font-weight: 400;
}

.hero--cv .cv-links a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.hero--cv .cv-links a:hover {
  text-decoration: none;
}

@media (max-width: 900px) {
  .hero--cv {
    display: block;
  }

  .hero--cv .cv-side {
    margin-top: 40px;
    padding-top: 0;
  }

  .cv-contacts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "residence birth"
      "email linkedin";
    text-align: left;
  }

  .hero--cv .cv-links {
    justify-content: flex-start;
  }
}

/* curriculum header: role line sits on the same baseline as the email row */
.hero--cv {
  align-items: last baseline;
}

.hero--cv .cv-side {
  position: relative;
  padding-top: 0;
}

.hero--cv .cv-links {
  position: absolute;
  top: 100%;
  right: 0;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .hero--cv .cv-links {
    position: static;
  }
}

/* phones: LinkedIn sits on the same row as the email, on the right */
@media (max-width: 560px) {
  .cv-contacts {
    grid-template-columns: auto auto;
    justify-content: space-between;
    column-gap: 16px;
  }

  .cv-contacts .c-email dd,
  .cv-contacts .c-linkedin dd {
    font-size: clamp(13px, 3.7vw, 16px);
  }
}

/* very narrow screens: not enough room for both, keep them stacked */
@media (max-width: 340px) {
  .cv-contacts {
    grid-template-areas:
      "residence birth"
      "email email"
      "linkedin linkedin";
  }
}
