.botanical {
  --nav-height: 70px;
  --page-edge: 4.6vw;
  position: relative;
  background: #eeece3;
  color: #25261f;
}
.botanical-panel {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12,minmax(0,1fr));
  grid-template-rows: minmax(0,1fr);
  align-items: center;
  height: calc(100svh - var(--nav-height));
  min-height: 470px;
  padding-inline: var(--page-edge);
  overflow: hidden;
}
.botanical-copy {
  position: relative;
  z-index: 1;
  grid-area: 1 / 1 / 2 / 7;
  width: 100%;
  padding-right: 1em;
}
.botanical-heading .label {margin-bottom: clamp(18px,2.8vh,32px);}
.botanical-heading h2 {
  max-width: 9em;
  font-size: clamp(52px,6vw,108px);
  line-height: 1.02;
  text-wrap: balance;
}
html:lang(zh) .botanical-heading h2 {
  font-size: clamp(50px,5.7vw,104px);
  line-height: 1.15;
}
.botanical-copy .side {
  max-width: 36ch;
  margin-top: clamp(22px,3.6vh,40px);
}
.botanical-copy .side p {
  font-size: clamp(15px,1.18vw,19px);
  line-height: 1.65;
  text-wrap: pretty;
}
html:lang(zh) .botanical-copy .side {max-width: 23em;}
.botanical-copy .action {margin-top: clamp(18px,2.8vh,30px);}
.botanical-art {
  position: relative;
  grid-area: 1 / 6 / 2 / 13;
  justify-self: end;
  align-self: end;
  width: 94%;
  height: 87%;
  overflow: hidden;
  container-type: size;
  pointer-events: none;
}
.botanical-art canvas {position:absolute;inset:0;width:100%;height:100%;}
.botanical-poster {
  position:absolute;left:50%;top:50%;
  height:min(215.55cqh,225cqw);width:auto;max-width:none;
  translate:-50% -50%;transform-origin:50% 76.5%;
}
.botanical-poster[hidden]{display:none;}
[data-flower="thistle"] .botanical-poster {height:min(200.9cqh,225cqw);transform-origin:50% 73.4%;}
.botanical-pair + .pan {margin-top:clamp(36px,6vw,100px);}
@media(max-width:800px){.botanical{--nav-height:60px;}}

@media(max-width:760px) and (orientation:portrait) {
  .botanical {--page-edge:6vw;}
  .botanical-panel {
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: auto minmax(0,1fr) auto;
    min-height: 510px;
  }
  .botanical-copy {display:contents;}
  .botanical-heading {
    grid-area:1 / 1;
    padding-top:clamp(22px,4.2svh,46px);
  }
  .botanical-heading .label {margin-bottom:10px;}
  .botanical-heading h2,html:lang(zh) .botanical-heading h2 {
    max-width:none;font-size:clamp(36px,9vw,62px);
  }
  .botanical-art {
    grid-area:2 / 1;
    align-self:stretch;justify-self:center;
    width:100%;height:auto;
  }
  .botanical-copy .side,html:lang(zh) .botanical-copy .side {
    grid-area:3 / 1;max-width:none;margin:0;
    border-top:1px solid #c9c6b9;
    padding:clamp(13px,2svh,24px) 0 clamp(18px,3.5svh,38px);
  }
  .botanical-copy .side p {font-size:14px;line-height:1.55;}
  .botanical-copy .action {font-size:13px;margin-top:12px;padding-bottom:3px;}
}
/* Both pictures share the same window. The marker keeps the second chapter link native. */
.botanical-pair {position:relative;--nav-height:70px;}
.botanical-entry {height:0;pointer-events:none;}
@media(max-width:800px){.botanical-pair{--nav-height:60px;}}
@media(prefers-reduced-motion:no-preference) {
  .botany-ready .botanical-pair {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:176svh calc(200svh - var(--nav-height));
    isolation:isolate;
  }
  .botany-ready .botanical-entry {grid-area:2 / 1;align-self:start;}
  .botany-ready .botanical {
    grid-area:1 / 1 / 3 / 2;align-self:start;
    position:sticky;top:var(--nav-height);height:fit-content;
  }
  .botany-ready [data-flower="thistle"] {background:transparent;z-index:1;}
  .botany-ready [data-flower="thistle"]::before {
    content:"";position:absolute;inset:0;background:#e8e8df;pointer-events:none;
  }
  .botany-ready [data-flower="thistle"][data-reveal="closed"] {visibility:hidden;}
  .botany-ready [data-flower="hydrangea"][data-covered] {visibility:hidden;}
  .botany-ready [data-reveal="opening"]::before,
  .botany-ready [data-reveal="opening"] .botanical-art {
    mask-image:radial-gradient(circle at var(--iris-x) var(--iris-y),#000 calc(var(--radius) - 4px),transparent calc(var(--radius) + 4px));
  }
  .botany-ready [data-reveal="opening"] .botanical-art {
    --iris-x:var(--art-x);--iris-y:var(--art-y);
  }
  .botany-ready .botanical-heading,.botany-ready .botanical-copy .side {
    opacity:var(--copy-alpha,1);
    transform:translateY(var(--copy-y,0px));
  }
}
@media(max-height:540px) and (orientation:landscape) {
  .botanical .botanical-panel {min-height:0;}
  .botanical-heading h2,html:lang(zh) .botanical-heading h2 {font-size:clamp(32px,4.7vw,54px);}
  .botanical-heading .label,.botanical-copy .side {margin:8px 0;}
  .botanical-copy .action {margin-top:10px;}
  .botanical-copy .side p {font-size:13px;}
}
