@font-face {
  font-family: "Diatype Local";
  src: local("ABC Diatype Variable"), local("Diatype Variable"), local("ABC Diatype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #bfbfbf;
  --white-text: rgb(255 255 255 / .85);
  --black-text: rgb(0 0 0 / .85);
  font-size: max(3.2px, min(1.44vw, 1.44vh));
  color-scheme: light;
  touch-action: manipulation;
}

body {
  margin: 0;
  background: var(--paper);
}

.portfolio {
  margin: 0;
  container-type: inline-size;
  color: var(--white-text);
  font-family: "Diatype Local", Arial, Helvetica, sans-serif;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: break-word;
  -webkit-nbsp-mode: normal;
}

.portfolio :is(.red, .blue, .black, .white, .white-blue, .grey1, .green, .greygreen, .yellowsingular) {
  display: inline-block;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.2;
}

.portfolio :is(.white, .white-blue, .grey1, .green, .greygreen, .yellow, .yellowsingular) {
  color: var(--black-text);
}

.red { background: #ff0000; color: var(--white-text); }
.blue { background: #1900ff; color: rgb(254 255 0 / .85); }
.black { background: #000; color: var(--white-text); }
.white, .white-blue { background: #fff; }
.grey1 { background: var(--paper); }
.green { background: #26ff00; }
.greygreen { background: #8ed8b0; }
.yellow, .yellowsingular { background: #f5ff00; }
.yellow { display: block; }

.portfolio a { color: inherit; }
.portfolio a.white-blue {
  margin-block-end: -.4rem;
  border: .4rem solid #000dff;
  text-decoration: none;
}
.portfolio :is(a, .zoomable):active { opacity: .7; }

column-set {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  width: 100%;
  gap: 1rem;
  gap: round(1rem, 1px);
  contain: layout;
}
column-set:has(> column-unit[span]) {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
column-unit {
  display: block;
  position: relative;
  min-width: 0;
  container-type: inline-size;
}
column-unit[span="1"] { grid-column: span 1; }
column-unit[span="2"] { grid-column: span 2; }
column-unit[span="3"] { grid-column: span 3; }
column-unit[span="4"] { grid-column: span 4; }
column-unit[span="5"] { grid-column: span 5; }
column-unit[span="6"] { grid-column: span 6; }
column-unit[span="11"] { grid-column: span 11; }

media-item {
  display: inline-flex;
  vertical-align: bottom;
  flex-direction: column;
  width: var(--scale, 100%);
  width: var(--media-width, 100cqw);
  max-width: 100cqw;
  aspect-ratio: var(--aspect);
  position: relative;
}
media-item > a {
  display: block;
  cursor: zoom-in;
}
media-item img, .player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
media-item img { object-fit: contain; }
.player { position: absolute; inset: 0; }

.video .playback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #fff;
}
.video .playback span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgb(0 0 0 / .55);
  opacity: 0;
  transition: opacity .15s ease;
}
.video .playback:is(:hover, :focus-visible) span,
.video .playback[data-paused="true"] span { opacity: 1; }

.image-viewer {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 3rem;
  border: 0;
  background: #fff;
  overflow: hidden;
}
body:has(.image-viewer[open]) { overflow: hidden; }
.image-viewer[open] { display: grid; place-items: center; }
.image-viewer::backdrop { background: #fff; }
.image-viewer img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 6rem);
  object-fit: contain;
  cursor: zoom-out;
}
.image-viewer button {
  box-sizing: border-box;
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: rgb(87 87 87 / .35);
  color: rgb(255 255 255 / .9);
  font: 26px/1 Arial, sans-serif;
  cursor: pointer;
}
.image-viewer [data-close] { top: 20px; right: 20px; }
.image-viewer [data-step] { top: calc(50% - 15px); }
.image-viewer [data-step="-1"] { left: 20px; }
.image-viewer [data-step="1"] { right: 20px; }

@media (max-aspect-ratio: 4/5), (min-aspect-ratio: 2/3) and (max-height: 500px) {
  :root { font-size: max(4.48px, min(3.136vw, 3.136vh)); }
  column-set, column-set:has(> column-unit[span]) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .37rem;
    gap: round(.37rem, 1px);
  }
  column-unit:empty { display: none; }
  .image-viewer { padding: 1.2rem; }
  .image-viewer img { max-height: calc(100dvh - 2.4rem); }
  .image-viewer [data-close] { top: 10px; right: 10px; }
  .image-viewer [data-step="-1"] { left: 10px; }
  .image-viewer [data-step="1"] { right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .video .playback span { transition: none; }
}

.witness-controls {
  color: var(--black-text);
  font-size: max(13px, .72em);
  text-align: left;
}

.witness-controls [hidden] { display: none !important; }

.portfolio .witness-controls .witness-label {
  display: inline-block;
  font: inherit;
  padding-inline: .3em;
}

.witness-contract {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: .25em;
}

.witness-address { overflow-wrap: anywhere; }

.witness-action, .witness-gate select {
  border: 2px solid #000dff;
  border-radius: 0;
  background: #fff;
  color: var(--black-text);
  font: inherit;
}

.witness-action { cursor: pointer; }
.witness-action:disabled { cursor: default; opacity: .55; }
.witness-action:active { opacity: .7; }

.witness-gate { margin-block: .5em; }
.witness-gate .witness-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35em; }
.witness-gate fieldset { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.witness-gate legend { padding: 0; }
.witness-gate label { display: inline-block; }

.portfolio a.witness-x {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 1;
  display: grid;
  box-sizing: border-box;
  place-items: center;
  min-inline-size: 24px;
  min-block-size: 24px;
  margin: 0;
  border-width: 2px;
  font-size: max(13px, 1rem);
  line-height: 1;
}
