/* 540 frame. The sheet is a photograph of a cyanotype; the tree is set on its open blue in the paper's white.
   Rows: family 52, genus 44, species 38. The column runs from x = 30 to 284, clear of the sprig. */
.cy {
  --paper: #eceef0;
  --blue: #03336f;
  --open: 300ms cubic-bezier(0.3, 0, 0.1, 1);
  position: absolute;
  inset: 0;
  background: url("./cyanotype-cherry.jpg") center / 540px 540px;
  color: var(--paper);
  font-family: "EB Garamond Variable", serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.cy * {
  box-sizing: border-box;
}

.cy-tree {
  position: absolute;
  top: 36px;
  left: 30px;
  width: 254px;
}

.cy [data-slot="tree"],
.cy [data-slot="tree-item"] {
  outline: 0;
}

.cy-row {
  display: flex;
  align-items: baseline;
  height: 38px;
  padding: 0 10px 0 38px;
  font-size: 26px;
  line-height: 37px;
  white-space: nowrap;
  cursor: default;
}

.cy-row[data-level="1"] {
  height: 52px;
  padding-left: 8px;
  font-size: 42px;
  line-height: 50px;
  letter-spacing: -0.01em;
}

.cy-row[data-level="2"] {
  height: 44px;
  padding-left: 20px;
  font-size: 33px;
  font-style: italic;
  line-height: 42px;
}

/* The binomials stand on one right edge. */
.cy-latin {
  margin-left: auto;
  font-size: 18px;
}

.cy-mark {
  flex: none;
  width: 18px;
}

.cy-mark svg {
  display: block;
  width: 11px;
  height: 11px;
  fill: currentColor;
  translate: 0 -4px;
  transition: rotate 200ms cubic-bezier(0.3, 0, 0.1, 1);
}

.cy-row[data-level="2"] .cy-mark svg {
  translate: 0 -3px;
}

.cy-mark[data-expanded] svg {
  rotate: 90deg;
}

/* A genus opens downwards: its species are uncovered and the genera under it move down. */
.cy-group {
  height: var(--tree-group-height);
  overflow: hidden;
  transition: height var(--open);
}

.cy-group:is([data-starting-style], [data-ending-style]) {
  height: 0;
}

/* The strip: a band of the sheet left uncoated, with the tree again on it in the print's blue, masked to the
   focused row. paper.jpg is this column of the photograph as bare paper (the margin's colour, the sheet's own
   grain); the mask's edges are pieces of the print's brushed coat edge. Both from prep_tree_strip.py. */
.cy-strip {
  background: url("./paper.jpg") 0 0 / 254px 450px no-repeat;
  color: var(--blue);
  mask: url("./strip-mask.png") 0 var(--top) / 100% var(--height) no-repeat;
  transition:
    mask-position 150ms cubic-bezier(0.4, 0, 0.4, 1),
    mask-size 150ms cubic-bezier(0.4, 0, 0.4, 1);
  pointer-events: none;
}

.cy-strip:not([data-on]) {
  visibility: hidden;
}
