.brand-mark { flex: none; box-shadow: 1px 1px 0 #191918; }
.ending .brand-mark { outline: 1px solid var(--ink); }
.project-reader {
  --sheet-height: clamp(320px, 30vw, 535px);
  --page-tab-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  align-self: stretch;
  min-height: 440px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  box-shadow: 3px 4px 0 #bfbaab, 6px 7px 0 #dfdbd1;
}
.project-reader-head {
  min-height: 84px;
  padding: 8px clamp(11px, 1.65vw, 25px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #494641;
}
.project-reader-head p { color: var(--accent-on-reader, var(--orange)); font-size: .68rem; letter-spacing: .075em; font-weight: 650; text-transform: uppercase; }
.project-reader-head h2 { font-size: clamp(1.08rem, 1.62vw, 1.65rem); letter-spacing: -.042em; line-height: 1.12; overflow-wrap: anywhere; }
.project-reader-head > div:first-child { min-width: 0; }
.project-reader-head h2 a { text-decoration: none; text-underline-offset: .17em; }
.project-reader-head h2 a:is(:hover, :focus-visible) { text-decoration: underline; }
.project-reader-meta { display: grid; justify-items: end; gap: 2px; min-width: max-content; }
.project-reader-hint { color: #cec6bb; font-size: .68rem; white-space: nowrap; }
.hint-swipe { display: none; }
@media (pointer: coarse) {
  .hint-wheel { display: none; }
  .hint-swipe { display: inline; }
}
.project-counter { color: #dbd3c7; font-size: .83rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.project-sheets { position: relative; min-width: 0; touch-action: pan-y pinch-zoom; overflow: clip; }
.project-sheet { min-width: 0; }
.project-reader:not(.reader-enhanced) .project-sheet:not(.project-overview, :target),
.project-reader:not(.reader-enhanced) .project-sheets:has(.project-sheet:target) .project-overview {
  display: none;
}
.project-reader:not(.reader-enhanced) .project-overview {
  min-height: calc(var(--sheet-height) + var(--page-tab-height) + 1px);
}
.project-sheet-cover { display: grid; background: #10100f; }
.project-sheet-cover figure { margin: 0; display: grid; place-items: center; }
.project-cover-link { position: relative; display: block; width: 100%; }
.project-sheet-cover img { display: block; width: 100%; height: auto; }
.project-cover-tip { display: none; }
.reader-enhanced .project-sheets {
  display: grid;
  min-height: var(--sheet-height);
  isolation: isolate;
}
.reader-enhanced .project-sheets > .project-sheet {
  grid-area: 1 / 1;
  min-height: 0;
  visibility: hidden;
  pointer-events: none;
}
.reader-enhanced .project-sheets > .project-sheet:is(.is-current, .is-leaving) { visibility: visible; }
.reader-enhanced .project-sheet.is-current a { pointer-events: auto; }
.reader-enhanced .project-sheet-cover figure { position: relative; }
.reader-enhanced .project-cover-link { position: absolute; inset: 0; }
.project-cover-link:focus-visible { z-index: 1; outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) {
  .reader-enhanced .project-cover-tip {
    position: absolute;
    z-index: 1;
    top: var(--tip-y, 12px);
    left: var(--tip-x, 12px);
    display: block;
    padding: 6px 11px;
    background: var(--orange);
    color: var(--accent-ink, var(--ink));
    font-size: .79rem;
    font-weight: 650;
    white-space: nowrap;
    visibility: hidden;
    pointer-events: none;
  }
  .reader-enhanced .project-cover-link.has-cover-pointer:hover .project-cover-tip { visibility: visible; }
}
.reader-enhanced .project-sheet-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.project-sheet-devices { display: flex; flex-direction: column; justify-content: center; gap: clamp(10px, 1.75vw, 28px); padding: clamp(12px, 2.2vw, 33px); background: #ece8de; color: var(--ink); min-height: 100%; }
.project-sheet-devices h3 { font-size: clamp(1.1rem, 2.1vw, 2rem); line-height: 1.11; letter-spacing: -.045em; }
.device-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, .8fr) minmax(0, .51fr); align-items: end; gap: clamp(4px, .7vw, 11px); }
.device { display: grid; gap: 7px; min-width: 0; color: #4b453d; text-align: center; font-size: clamp(.64rem, 1vw, .83rem); line-height: 1.25; }
.device a { display: block; min-width: 0; padding: 4px; background: #292621; }
.device.tablet a { border-radius: 6px; }
.device.phone a { border-radius: 7px; }
.device img { width: 100%; height: auto; }
.project-sheet-task { min-height: 100%; display: grid; align-items: center; border-left: clamp(5px, .7vw, 11px) solid var(--orange); background: var(--paper); color: var(--ink); padding: clamp(17px, 3.4vw, 55px); }
.project-task-content { max-width: 37ch; }
.project-task-content .eyebrow { color: #ad321a; font-size: .72rem; }
.project-task-content h3 { font-size: clamp(1.3rem, 2.4vw, 2.5rem); letter-spacing: -.045em; line-height: 1.05; margin-block: 9px 13px; overflow-wrap: anywhere; text-wrap: balance; }
.project-task-content p:not(.eyebrow) { color: #514d46; font-size: clamp(.85rem, 1.15vw, 1.08rem); }
.project-task-content a { margin-top: 15px; min-height: 42px; }
.project-controls { container-type: inline-size; }
.project-pages { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); color: var(--paper); border-top: 1px solid #5b5750; }
.project-pages a {
  display: flex;
  align-items: center;
  min-height: var(--page-tab-height);
  gap: 7px;
  padding: 7px clamp(5px, 1.2vw, 17px);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  font-size: clamp(.72rem, .98vw, .95rem);
  font-weight: 620;
}
.project-pages a + a { border-inline-start: 1px solid #5b5750; }
.project-pages a span { color: var(--accent-on-reader, var(--orange)); font-size: .74em; font-variant-numeric: tabular-nums; }
.project-pages a:is(:hover, [aria-current]) { background: #302824; }
.project-pages a[aria-current] { border-bottom-color: var(--accent-on-reader, var(--orange)); }
.project-pages a:focus-visible { outline-offset: -4px; }
@container (width <= 480px) {
  .project-pages a {
    display: grid;
    grid-template-rows: auto minmax(2lh, auto);
    align-content: center;
    align-items: center;
    justify-items: center;
    gap: 1px;
    padding: 8px 3px 5px;
    text-align: center;
    overflow-wrap: anywhere;
    line-height: 1.15;
  }
}
.project-overview {
  --tile-gap: clamp(3px, .4vw, 6px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  min-height: var(--sheet-height);
  gap: var(--tile-gap);
  padding: var(--tile-gap);
  background: var(--reader-stage, #10100f);
}
.project-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: block;
  overflow: clip;
  isolation: isolate;
  text-decoration: none;
  background: var(--reader-paper, var(--ink));
}
.project-tile img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.project-tile:focus-visible { z-index: 1; outline: 2px solid var(--accent-on-reader, var(--orange)); outline-offset: -2px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .project-tile img { transition: transform .28s ease; }
  .project-tile:hover img { transform: scale(1.035); }
}
/* The overview uses the space taken by the page tabs on project pages. */
.reader-enhanced.is-overview .project-sheets {
  --overview-extension: calc(var(--page-tab-height) + 1px);
  min-height: calc(var(--sheet-height) + var(--overview-extension));
  padding-bottom: var(--overview-extension);
}
.reader-enhanced.is-overview .project-sheet:not(.project-overview) {
  /* Hidden translated project pages should not resize the overview. */
  contain: size;
}
.reader-enhanced .project-overview.is-current {
  margin-bottom: calc(-1 * var(--overview-extension));
}

.project-preview {
  width: fit-content;
  min-width: min(calc(100vw - 24px), 320px);
  max-width: min(calc(100vw - 24px), 1460px);
  max-height: 92dvh;
  background: var(--reader-stage, #10100f);
}
.project-preview .dialog-bar { align-items: center; justify-content: space-between; gap: 8px; color: var(--ink); }
.project-preview .dialog-bar p { padding-inline-start: 13px; font-size: .9rem; font-weight: 650; }
.project-preview .dialog-bar button { flex: none; }
.project-preview img { cursor: zoom-out; display: block; width: auto; height: auto; max-width: 100%; max-height: calc(92dvh - 52px); object-fit: contain; margin-inline: auto; }
@media (min-width: 721px) {
  .hero:has(.project-reader) .hero-copy {
    align-self: start;
    padding-block-start: clamp(12px, calc(4vw - 20px), 50px);
    z-index: auto;
  }
}
@media (max-width: 720px) {
  .project-reader {
    --sheet-height: max(265px, min(57vw, 330px));
    --page-tab-height: 56px;
    min-height: 0;
  }
  .project-sheet-task { padding: 12px; }
  .project-task-content a { min-height: 38px; margin-top: 9px; }
}
@media (max-width: 365px) {
  .project-task-content p:not(.eyebrow) { font-size: .82rem; }
  .project-reader-head { gap: 8px; }
  .project-reader-head h2 { font-size: .89rem; }
  .project-reader-hint { font-size: .62rem; }
}

.hero:has(.project-reader) .hero-lead {
  /* Reserve the same space for the intro in both languages. */
  max-width: 39ch;
  min-block-size: calc(var(--hero-intro-lines, 6) * 1lh);
}
@media (width < 398px), (720px < width < 924px) {
  .hero:has(.project-reader) { --hero-intro-lines: 7; }
}
@media (width < 368px), (720px < width < 850px) {
  .hero:has(.project-reader) { --hero-intro-lines: 8; }
}
@media (width < 336px), (720px < width < 766px) {
  .hero:has(.project-reader) { --hero-intro-lines: 9; }
}

.contact > .block { container-type: inline-size; }
.contact h2 { text-wrap: balance; overflow-wrap: normal; }
.contact-main p { max-width: 55ch; overflow-wrap: anywhere; text-wrap: pretty; }

@media (max-width: 720px) {
  /* Leave room for the longest unbroken word across the translations. */
  .contact h2 { font-size: 14.9cqi; }
  .contact-main p {
    max-width: 100%;
    font-size: clamp(.875rem, var(--contact-copy-fit, 4.5cqi), 1.25rem);
    letter-spacing: -.025em;
  }
  /* Each translation occupies a different number of ems at the same font size. */
  .contact:lang(en) { --contact-copy-fit: 4.98cqi; }
  .contact:lang(fr) { --contact-copy-fit: 4.66cqi; }
  .contact:lang(es) { --contact-copy-fit: 4.57cqi; }
  .contact:lang(uz) { --contact-copy-fit: 5.01cqi; }
  .contact:lang(kk) { --contact-copy-fit: 4cqi; }
}

@media (max-width: 374px) {
  .contact .contact-actions { flex-direction: column; align-items: flex-start; }
}

@media (min-width: 721px) {
  .contact h2 { font-size: min(clamp(2.85rem, 9.4vw, 10rem), var(--contact-title-fit, 11cqi)); }
  .contact:lang(uz) { --contact-title-fit: 8.7cqi; }
  .contact-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: start;
  }
  .contact-main p { min-block-size: 2lh; }
}

/* The longer Spanish wordmark stays within its column at every width. */
.hero-copy:lang(es) { container-type: inline-size; }
.hero:lang(es) h1 { font-size: min(clamp(3.9rem, 7.5vw, 8.3rem), 15.25cqw); }
@media (max-width: 720px) {
  .hero:lang(es) h1 { font-size: min(clamp(3rem, 12.1vw, 5.5rem), 15.25cqw); }
}
