/* Fonts ------------------------------------------------------------------ */

@font-face {
  font-family: Syne;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/syne-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Syne;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/syne-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/jakarta-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/jakarta-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Tokens ----------------------------------------------------------------- */

:root {
  color-scheme: dark;

  --coal: #141414;
  --paper: #FAF9F6;
  --red: #D8241C;
  --stone: #DDD8CD;

  --display: Syne, "Arial Black", sans-serif;
  --text: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;

  --size-giant: clamp(2.75rem, 6.8vw, 8rem);
  --size-title: clamp(2.375rem, 5.9vw, 6rem);
  --size-panel: clamp(1.75rem, 3.3vw, 3.25rem);
  --size-lead: clamp(1.1875rem, 1rem + 0.85vw, 1.625rem);

  --gutter: clamp(1.25rem, 4.4vw, 4.5rem);
  --gap: clamp(0.75rem, 1.4vw, 1.375rem);
  --bar: 4rem;
  --out: cubic-bezier(0.16, 1, 0.3, 1);

  scroll-behavior: smooth;
  scroll-padding-top: var(--bar);
  scrollbar-color: #6B6862 var(--coal);
  scrollbar-gutter: stable;
  background: var(--coal);
}

[data-ground="coal"],
.panel--coal,
.sheet--coal {
  --ground: var(--coal);
  --ink: var(--paper);
  --mute: #ABA89F;
}

[data-ground="paper"],
.sheet--paper {
  --ground: var(--paper);
  --ink: var(--coal);
  --mute: #5E5C56;
}

[data-ground="red"],
.panel--red,
.sheet--red {
  --ground: var(--red);
  --ink: var(--paper);
  --mute: #FAF9F6;
}

[data-ground="stone"],
.panel--stone {
  --ground: var(--stone);
  --ink: var(--coal);
  --mute: #55534D;
}

.sheet--canvas {
  --ground: #F5F5F5; /* the workflow editor's own canvas */
  --ink: var(--coal);
  --mute: #5E5C56;
}

@property --cut {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 54%;
}

@property --e1 {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 13%;
}

@property --e2 {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 33%;
}

@property --e3 {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 55%;
}

@property --e4 {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 77%;
}

/* Base ------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--paper);
  font: 400 1.0625rem / 1.6 var(--text);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

a {
  color: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

h2 {
  font: 700 var(--size-title) / 1.02 var(--display);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h3 {
  font-family: var(--display);
  text-wrap: balance;
}

main > section {
  position: relative;
  z-index: 1;
  background: var(--ground);
  color: var(--ink);
}

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

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.skip {
  position: fixed;
  z-index: 40;
  top: 0.75rem;
  left: var(--gutter);
  padding: 0.6em 1em;
  background: var(--paper);
  color: var(--coal);
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

.button {
  display: inline-block;
  padding: 0.95em 1.2em;
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--ink);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
  transition: background-color 0.25s, color 0.25s, box-shadow 0.25s;
}

.button--red {
  background: var(--red);
  box-shadow: inset 0 0 0 2px var(--red);
  color: var(--paper);
}

.button--paper {
  background: var(--paper);
  color: var(--coal);
}

@media (hover: hover) {
  .button:hover {
    background: var(--ink);
    box-shadow: inset 0 0 0 2px var(--ink);
    color: var(--ground);
  }

  .button--paper:hover {
    background: var(--coal);
    box-shadow: inset 0 0 0 2px var(--coal);
    color: var(--paper);
  }
}

.made {
  color: var(--mute);
  font-size: 0.9375rem;
}

.zoom {
  display: block;
  width: 100%;
  cursor: zoom-in;
}

/* Running bar: wears the colour of the section beneath it ------------------ */

.bar {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: var(--bar);
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--gutter);
  background: var(--ground);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background-color 0.35s, color 0.35s;
}

.bar a {
  text-decoration: none;
}

.bar__mark {
  padding-block: 0.6rem;
  font: 800 1.375rem / 1 var(--display);
  letter-spacing: -0.02em;
}

.bar__nav {
  display: flex;
  gap: clamp(1rem, 2.6vw, 2.5rem);
}

.bar__nav a {
  padding-block: 0.75rem;
  background: linear-gradient(var(--line, var(--red)), var(--line, var(--red))) no-repeat 0 calc(100% - 0.5rem) / 0 2px;
  transition: background-size 0.4s var(--out);
}

.bar[data-ground="red"] {
  --line: var(--paper);
}

.bar__nav a[aria-current],
.bar__nav a:focus-visible {
  background-size: 100% 2px;
}

@media (hover: hover) {
  .bar__nav a:hover {
    background-size: 100% 2px;
  }
}

/* Cover ------------------------------------------------------------------- */

main > .cover {
  --head: min(100svh - var(--bar) - 1rem, 60vw); /* height of the portrait */

  position: sticky;
  z-index: 0;
  top: 0;
  height: 100svh;
  min-height: 34rem;
  overflow: clip;
}

.cover.is-covered {
  visibility: hidden;
}

.cover__portrait {
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: 50%;
  height: var(--head);
  aspect-ratio: 912 / 886;
  transform: translateX(-50%);
}

.cover__portrait img,
.cover__portrait canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cover__portrait canvas {
  opacity: 0;
}

.cover__portrait canvas.is-on {
  opacity: 1;
}

.cover__portrait img.is-off {
  opacity: 0;
}

.cover__name {
  position: absolute;
  z-index: 1;
  top: 41%;
  right: var(--gutter);
  left: var(--gutter);
  display: flex;
  justify-content: space-between;
  /* each name fills the space between the margin and the head, and just tucks in */
  font: 700 calc(((100vw - var(--head) * 0.535) / 2 - var(--gutter)) / 3.2) / 1 var(--display);
  letter-spacing: -0.04em;
  translate: 0 -50%;
}

.cover__name span {
  animation: from-behind 1.5s 0.25s var(--out) both;
}

.cover__name span:first-child {
  --from: 46%;
}

.cover__name span:last-child {
  --from: -46%;
}

@keyframes from-behind {
  from {
    opacity: 0;
    transform: translateX(var(--from));
  }
}

.cover__left,
.cover__right {
  position: absolute;
  z-index: 3;
  top: 60%;
  width: min(25rem, 26vw);
}

.cover__left {
  left: var(--gutter);
}

.cover__right {
  right: var(--gutter);
}

.cover__line {
  font-size: var(--size-lead);
  font-weight: 500;
  line-height: 1.35;
}

.cover__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

.cover__status {
  margin-top: 1.1rem;
  font-weight: 600;
}

.cover__status::before {
  display: inline-block;
  width: 1.5rem;
  height: 2px;
  margin-right: 0.75rem;
  background: var(--red);
  content: "";
  vertical-align: middle;
}

/* Work: sheets that stack on top of each other ------------------------------ */

.work {
  padding: clamp(6rem, 11vw, 11rem) var(--gutter) clamp(5rem, 9vw, 9rem);
}

.work h2 {
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.panel {
  position: relative;
  overflow: clip;
  background: var(--ground);
  box-shadow: 0 0 0 1px var(--ground); /* hides the sheet below at fractional widths */
  color: var(--ink);
}

.panel + .panel {
  margin-top: 1.25rem;
}

.panel__text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.panel h3 {
  font-size: var(--size-panel);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.panel .button {
  margin-top: 0.75rem;
}

.panel__shot img {
  width: 100%;
}

/* one screen, five themes: the one under the pointer opens up */
.prism {
  display: grid;
  overflow: clip;
  transition: --e1 0.5s var(--out), --e2 0.5s var(--out), --e3 0.5s var(--out), --e4 0.5s var(--out);
}

.prism img {
  grid-area: 1 / 1;
  clip-path: polygon(calc(var(--edge) + 8%) 0, 101% 0, 101% 100%, calc(var(--edge) - 8%) 100%);
}

.prism img:nth-child(1) {
  clip-path: none;
}

.prism img:nth-child(2) {
  --edge: var(--e1);
}

.prism img:nth-child(3) {
  --edge: var(--e2);
}

.prism img:nth-child(4) {
  --edge: var(--e3);
}

.prism img:nth-child(5) {
  --edge: var(--e4);
}

@media (min-width: 60rem) {
  .panel {
    position: sticky;
    top: calc(var(--bar) + var(--i) * 0.875rem);
    display: grid;
    height: clamp(34rem, 100svh - 7.5rem, 54rem);
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .panel__text {
    grid-column: 1 / span 5;
    justify-content: center;
    padding: clamp(2rem, 4vw, 4rem) 0 clamp(2rem, 4vw, 4rem) clamp(2rem, 4vw, 4rem);
  }

  .panel__shot {
    position: absolute;
    top: 50%;
    left: 45%;
    width: 60%;
    perspective: 1500px;
    translate: 0 -50%;
  }

  .panel__shot > *,
  .sheet--tilt .sheet__shot > img {
    box-shadow: 0 2.5rem 5rem rgb(0 0 0 / 0.28);
    transform: rotateX(5deg) rotateY(-13deg) rotateZ(1.5deg);
    transform-origin: 0 50%;
    transition-duration: 0.9s;
    transition-property: transform;
    transition-timing-function: var(--out);
  }

  .panel__shot > .prism {
    transition-duration: 0.9s, 0.5s, 0.5s, 0.5s, 0.5s;
    transition-property: transform, --e1, --e2, --e3, --e4;
  }

  #chatbot .panel__shot {
    left: 48%;
    width: min(45%, 72svh);
  }

  @media (hover: hover) {
    .panel__shot:hover > *,
    .sheet--tilt .sheet__shot:hover > img {
      transform: rotateX(0) rotateY(-3deg) rotateZ(0);
    }
  }
}

/* Tools: a wall of sheets, each one cut to its own picture ------------------- */

.tools {
  padding: clamp(6rem, 11vw, 11rem) var(--gutter);
}

.wall {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}

.sheet {
  position: relative;
  container-type: inline-size;
  display: flex;
  grid-column: 1 / -1;
  flex-direction: column;
  overflow: clip;
  background: var(--ground);
  color: var(--ink);
}

.sheet__shot {
  position: relative;
  min-height: 0;
  overflow: clip;
}

.sheet__shot:focus-visible {
  outline-color: var(--red);
  outline-offset: -4px;
}

.sheet__shot > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 0);
  transition: scale 0.8s var(--out);
}

.sheet__text {
  display: grid;
  gap: 0.6rem clamp(1.5rem, 3vw, 3rem);
  margin-top: auto;
  padding: clamp(1.25rem, 2vw, 1.875rem);
}

.sheet h3 {
  font-size: clamp(1.375rem, 2.1vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.sheet .made {
  margin-top: 0.6rem;
}

.sheet__link {
  display: inline-block;
  margin-top: 0.9rem;
  padding-block: 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration-color: var(--red);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  transition: text-underline-offset 0.25s var(--out);
}

.sheet--red .sheet__link {
  text-decoration-color: currentColor;
}

@container (min-width: 38rem) {
  .sheet__text {
    grid-template-columns: 5fr 7fr;
  }
}

/* the workflow, running */
.flow__strip {
  position: relative;
  display: block;
}

.flow__strip + .flow__strip {
  display: none;
}

.flow img {
  width: 100%;
  mask-image: linear-gradient(#000 78%, transparent);
}

.flow svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--red);
  stroke-width: 5;
}

.flow svg > * {
  opacity: 0;
}

.flow.is-running svg > * {
  animation: node 8.5s calc(var(--n) * 0.34s + 0.6s) infinite;
}

@keyframes node {
  0%,
  22%,
  100% {
    opacity: 0;
  }

  2%,
  10% {
    opacity: 1;
  }
}

/* light on one side of the cut, dark on the other */
.split {
  --cut: 54%;

  display: grid;
  transition: --cut 0.45s var(--out);
}

.split > img {
  grid-area: 1 / 1;
  width: calc(100% + 2px); /* no hairline of the sheet at fractional widths */
  max-width: none;
  height: auto;
  margin: -1px;
}

.split > img + img {
  clip-path: polygon(calc(var(--cut) + 6%) 0, 101% 0, 101% 100%, calc(var(--cut) - 6%) 100%);
}

.sheet__code {
  flex: none;
  aspect-ratio: 700 / 340;
}

.sheet__chat {
  aspect-ratio: 520 / 620;
}

.fan {
  aspect-ratio: 1 / 0.82;
  overflow: visible;
}

.fan > img {
  position: absolute;
  top: calc(5% + var(--k) * 15%);
  left: calc(5% + var(--k) * 10%);
  width: 70%;
  height: auto;
  filter: drop-shadow(0 1rem 1.5rem rgb(0 0 0 / 0.28));
  transition: transform 0.7s var(--out);
}

.fan > :nth-child(1) {
  --k: 0;
}

.fan > :nth-child(2) {
  --k: 1;
}

.fan > :nth-child(3) {
  --k: 2;
}

.cells {
  aspect-ratio: 1 / 0.82;
}

#cms .sheet__shot {
  aspect-ratio: 2 / 1;
}

#cms .sheet__shot > img {
  object-position: 0 0;
}

#cvplus .sheet__text {
  margin-top: 0;
}

#cvplus .sheet__shot {
  flex: 1;
  margin: 0 0 0 clamp(1.25rem, 2vw, 1.875rem);
  aspect-ratio: 1180 / 552;
}

.sheet__figure {
  padding: clamp(1.25rem, 2vw, 1.875rem) clamp(1.25rem, 2vw, 1.875rem) 0;
  color: var(--red);
  font: 700 clamp(4rem, 30cqi, 11rem) / 0.86 var(--display);
  letter-spacing: -0.05em;
}

/* rows, and where they are split */
.sheet__rows {
  flex: 1;
  min-height: 6.5rem;
  margin: clamp(1.25rem, 2vw, 1.875rem) clamp(1.25rem, 2vw, 1.875rem) 0;
  background: repeating-linear-gradient(var(--coal) 0 2px, transparent 2px 9px);
  mask-image: repeating-linear-gradient(#000 0 38px, transparent 38px 54px);
}

@media (hover: hover) {
  .sheet__link:hover {
    text-underline-offset: 0.5em;
  }

  .sheet__code:hover > img,
  .sheet__chat:hover > img,
  .cells:hover > img,
  #cms .sheet__shot:hover > img,
  #cvplus .sheet__shot:hover > img {
    scale: 1.035;
  }

  .fan:hover > :nth-child(1) {
    transform: translate(-3%, -4%) rotate(-5deg);
  }

  .fan:hover > :nth-child(3) {
    transform: translate(3%, 4%) rotate(4deg);
  }
}

@media (min-width: 60rem) {
  #kamu-takip {
    grid-column: 1 / span 8;
  }

  #cheap-flight {
    grid-row: 2 / span 2;
    grid-column: 9 / span 4;
  }

  #exam-countdown {
    grid-column: 1 / span 4;
  }

  #malaria {
    grid-column: 5 / span 4;
  }

  #cms {
    grid-column: 1 / span 7;
  }

  #cvplus {
    grid-column: 8 / span 5;
  }

  #guinea {
    grid-column: 1 / span 8;
  }

  #excel {
    grid-column: 9 / span 4;
  }

  .sheet__chat {
    flex: 1;
    aspect-ratio: auto;
  }

  .sheet__chat > img {
    position: absolute;
    inset: 0;
    object-position: 0 100%;
  }

  #exam-countdown .fan,
  #malaria .cells {
    flex: none;
  }

  .sheet--tilt {
    min-height: clamp(22rem, 33vw, 34rem);
    justify-content: center;
  }

  .sheet--tilt .sheet__text {
    width: 46%;
    margin-top: 0;
    grid-template-columns: 1fr;
    padding-left: clamp(1.5rem, 3vw, 3rem);
  }

  .sheet--tilt .sheet__shot {
    position: absolute;
    top: 50%;
    left: 48%;
    width: 72%;
    overflow: visible;
    perspective: 1500px;
    translate: 0 -50%;
  }

  .sheet--tilt .sheet__shot > img {
    height: auto;
  }
}

/* Client sites: a mosaic ---------------------------------------------------- */

.web {
  padding: clamp(6rem, 11vw, 11rem) var(--gutter);
}

.intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: end;
}

.intro h2 {
  grid-column: 1 / span 8;
}

.intro p {
  grid-column: 10 / -1;
  color: var(--mute);
}

.filter {
  display: none;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  margin-top: clamp(2rem, 4vw, 3.5rem);
}

.js .filter {
  display: flex;
}

.filter button {
  padding-block: 0.6rem;
  background: linear-gradient(var(--red), var(--red)) no-repeat 0 100% / 0 3px;
  color: var(--mute);
  font-weight: 600;
  transition: background-size 0.4s var(--out), color 0.2s;
}

.filter button[aria-pressed="true"] {
  background-size: 100% 3px;
  color: var(--ink);
}

@media (hover: hover) {
  .filter button:hover {
    color: var(--ink);
  }
}

.mosaic {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(2rem, 3.4vw, 3.25rem) var(--gap);
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.tile {
  container-type: inline-size;
  grid-column: span var(--span);
}

.tile[hidden] {
  display: none;
}

.mosaic.is-filtered .tile {
  --span: 4 !important;
  --tall: 20 !important;
}

.tile__shot {
  height: calc(var(--tall) * 1vw);
  max-height: calc(var(--tall) * 1.05rem);
  overflow: clip;
  background: var(--mat, var(--stone));
  transition: filter 0.5s;
}

.tile__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 0);
  transition: scale 0.8s var(--out);
}

.tile--logo .tile__shot img {
  object-fit: contain;
  object-position: center;
}

.tile--off .tile__shot {
  filter: grayscale(1);
}

@media (hover: hover) {
  .tile__shot:hover {
    filter: none;
  }

  .tile__shot:hover img {
    scale: 1.045;
  }
}

.tile__text {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem 1.25rem;
  align-items: baseline;
  padding-top: 0.85rem;
}

.tile h3 {
  font-size: clamp(1.125rem, 0.95rem + 0.55vw, 1.4375rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.tile h3 a {
  background: linear-gradient(var(--red), var(--red)) no-repeat 0 100% / 0 2px;
  text-decoration: none;
  transition: background-size 0.4s var(--out);
}

@media (hover: hover) {
  .tile h3 a:hover,
  .tile:has(.tile__visit:hover) h3 a {
    background-size: 100% 2px;
  }
}

.tile__kind {
  display: grid;
  grid-row: 1 / span 2;
  grid-column: 2;
  justify-items: end;
  align-self: start;
  color: var(--mute);
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: right;
}

.tile__visit {
  color: var(--red);
  font-weight: 600;
  text-underline-offset: 0.2em;
}

.tile__about {
  color: var(--mute);
  font-size: 0.9375rem;
  line-height: 1.5;
}

@container (max-width: 25rem) {
  .tile__text {
    grid-template-columns: 1fr;
  }

  .tile__kind {
    display: flex;
    flex-wrap: wrap;
    grid-row: auto;
    grid-column: 1;
    gap: 0 0.9rem;
    text-align: left;
  }
}

.web__more {
  margin-top: clamp(3rem, 6vw, 5rem);
  font: 700 clamp(1.5rem, 3vw, 2.75rem) / 1.1 var(--display);
  letter-spacing: -0.03em;
}

/* Lab: five slices, the one you point at opens ------------------------------- */

.lab {
  padding: clamp(6rem, 10vw, 10rem) var(--gutter) clamp(6rem, 10vw, 10rem);
}

.strip {
  display: grid;
  gap: 1.25rem;
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}

.slice {
  position: relative;
  overflow: clip;
}

.slice img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.slice figcaption {
  padding-top: 0.6rem;
  color: var(--mute);
  font-size: 0.9375rem;
}

@media (min-width: 60rem) {
  .strip {
    display: flex;
    height: clamp(26rem, 66svh, 46rem);
    gap: 0.625rem;
  }

  .slice {
    flex: 1 1 0;
    min-width: 0;
    transition: flex-grow 0.85s var(--out);
  }

  .slice.is-open {
    flex-grow: 7.5;
  }

  .slice .zoom,
  .slice img {
    height: 100%;
  }

  .slice img {
    position: absolute;
    top: 0;
    left: 50%;
    width: calc((100vw - 2 * var(--gutter)) * 0.64);
    max-width: none;
    aspect-ratio: auto;
    filter: saturate(0.55) brightness(0.72);
    transition: filter 0.6s;
    translate: -50% 0;
  }

  .slice.is-open img {
    filter: none;
  }

  .slice figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 0.7rem 1.1rem;
    background: var(--red);
    color: var(--paper);
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    white-space: nowrap;
  }

  .slice.is-open figcaption {
    opacity: 1;
    transition: opacity 0.35s 0.35s;
  }
}

.whole {
  white-space: nowrap;
}

/* About ---------------------------------------------------------------------- */

.about {
  padding: clamp(6rem, 11vw, 11rem) 0 clamp(6rem, 10vw, 10rem);
}

.about h2,
.about__grid {
  margin-inline: var(--gutter);
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(3rem, 6vw, 5.5rem) var(--gap);
  margin-top: clamp(2.5rem, 5vw, 4.5rem);
}

.about__story {
  grid-column: 1 / span 7;
  font-size: clamp(1.375rem, 1rem + 1.35vw, 2.125rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.32;
}

.about__count {
  display: grid;
  grid-column: 9 / -1;
  gap: 1.5rem;
  align-content: start;
}

.about__count li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  color: var(--mute);
}

.about__count b {
  color: var(--red);
  font: 800 clamp(3.25rem, 6.4vw, 6.5rem) / 0.85 var(--display);
  letter-spacing: -0.045em;
}

.about__list {
  grid-column: span 5;
}

.about__list:last-child {
  grid-column: 9 / -1;
}

.about__list h3 {
  font-size: 1.125rem;
  font-weight: 700;
}

.about__list p {
  margin-top: 0.4rem;
  color: var(--mute);
}

.jobs {
  margin-top: clamp(4rem, 8vw, 7rem);
}

.jobs li {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: baseline;
  padding: clamp(1rem, 1.7vw, 1.5rem) var(--gutter);
  transition: background-color 0.3s, color 0.3s;
}

.jobs li > span {
  grid-column: span 2;
  font-variant-numeric: tabular-nums;
}

.jobs h3 {
  grid-column: span 6;
  font-size: clamp(1.375rem, 2.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.jobs p {
  grid-column: 9 / -1;
  color: var(--mute);
  transition: color 0.3s;
}

@media (hover: hover) {
  .jobs li:hover {
    background: var(--red);
    color: var(--paper);
  }

  .jobs li:hover p {
    color: var(--paper);
  }
}

/* Contact --------------------------------------------------------------------- */

.contact {
  display: flex;
  min-height: 100svh;
  scroll-margin-top: calc(-1 * var(--bar));
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--bar) + clamp(2rem, 6vw, 5rem)) var(--gutter) 0;
  overflow: clip;
}

.contact__print {
  position: absolute;
  z-index: 1;
  right: -3vw;
  bottom: 0;
  width: min(56vw, 88svh);
  pointer-events: none;
}

.contact__text {
  position: relative;
}

.contact h2 {
  max-width: 7.6em;
  font-size: var(--size-giant);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.96;
}

.contact__mail {
  display: inline-block;
  margin-top: clamp(1.75rem, 3vw, 2.75rem);
  font-size: clamp(1.125rem, 2vw, 1.875rem);
  font-weight: 600;
  overflow-wrap: anywhere;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}

.contact__actions {
  display: flex;
  gap: 0.625rem;
  margin-top: 1.75rem;
}

.contact__foot {
  position: relative;
  z-index: 2;
  padding-block: 3rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.9375rem;
}

/* Enlarged picture -------------------------------------------------------------- */

.viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0 var(--gutter) var(--gutter);
  border: 0;
  background: var(--coal);
  color: var(--paper);
  cursor: zoom-out;
}

.viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.viewer::backdrop {
  background: var(--coal);
}

:root:has(.viewer[open]) {
  overflow: hidden;
}

.viewer__bar {
  display: flex;
  height: var(--bar);
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  font-weight: 600;
}

.viewer__bar button {
  padding: 0.6rem 0;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}

.viewer img {
  min-height: 0;
  max-height: 100%;
  margin: auto;
}

::view-transition-group(*) {
  animation-duration: 0.45s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
}

/* Narrow screens ------------------------------------------------------------------ */

@media (max-width: 59.99rem) {
  main > .cover {
    position: relative;
    display: grid;
    height: auto;
    min-height: 100svh;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    padding: calc(var(--bar) + 0.5rem) var(--gutter) 3rem;
  }

  .cover__portrait {
    position: relative;
    left: auto;
    width: min(118vw, 44rem);
    height: auto;
    grid-area: 1 / 1;
    margin: 8.5vw 0 0 50%;
    mask-image: linear-gradient(#000 80%, transparent);
    translate: -50% 0;
    transform: none;
  }

  .cover__name {
    position: static;
    z-index: auto;
    display: flex;
    grid-area: 1 / 1;
    flex-direction: column;
    font-size: clamp(3.5rem, 19.5vw, 9rem);
    translate: none;
  }

  .cover__name span {
    position: relative;
    z-index: 1;
  }

  .cover__name span:last-child {
    z-index: 3;
    align-self: end;
  }

  .cover__left,
  .cover__right {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    width: auto;
    max-width: 34rem;
  }

  .cover__left {
    margin-top: 2rem;
  }

  .cover__right {
    margin-top: 2rem;
    color: var(--mute);
  }

  .cover__status {
    color: var(--ink);
  }

  .panel__text {
    padding: 2rem 1.5rem 0;
  }

  .panel__shot {
    margin-top: 2rem;
  }

  .intro,
  .about__grid {
    display: block;
  }

  .intro p {
    margin-top: 1.25rem;
  }

  /* the workflow in two lines, one half under the other */
  .flow {
    padding-top: 1rem;
  }

  .flow__strip:first-child {
    display: none;
  }

  .flow__strip + .flow__strip {
    display: block;
  }

  .flow img {
    mask-image: linear-gradient(transparent, #000 20% 80%, transparent);
  }

  .mosaic,
  .mosaic.is-filtered {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile,
  .mosaic.is-filtered .tile {
    grid-column: span 2;
  }

  .tile__shot {
    height: auto;
    max-height: none;
    aspect-ratio: 16 / 10;
  }

  .about__count,
  .about__list {
    margin-top: 3rem;
  }

  .jobs li {
    display: block;
  }

  .jobs h3 {
    margin-block: 0.2rem 0.15rem;
  }

  .contact__print {
    right: -8vw;
    width: min(120vw, 70svh);
  }

  .contact {
    min-height: max(100svh, 46rem);
  }

  .contact h2 {
    font-size: min(calc((100vw - 2 * var(--gutter)) / 8.2), 5rem);
  }
}

@media (min-width: 34rem) and (max-width: 59.99rem) {
  #exam-countdown,
  #malaria {
    grid-column: span 6;
  }

  #cheap-flight {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    grid-template-rows: auto 1fr;
  }

  #cheap-flight .sheet__text {
    grid-template-columns: 1fr;
  }

  .sheet__chat {
    grid-row: 1 / span 2;
    grid-column: 1;
    aspect-ratio: auto;
  }

  .sheet__chat > img {
    position: absolute;
    inset: 0;
    object-position: 0 100%;
  }

  .tile,
  .mosaic.is-filtered .tile {
    grid-column: span 1;
  }

  .mosaic:not(.is-filtered) .tile:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 33.99rem) {
  .bar__nav {
    flex: 1;
    gap: 0;
    justify-content: space-between;
    margin-left: 1.75rem;
    font-size: 0.875rem;
  }

}

/* Preferences --------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
  }

  .flow.is-running svg > * {
    animation: none;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
