/* Agential Biology — Zoe
   Values measured off publicofficial.co/agentialbiology/thescience/ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Inter:wght@400;500;600&display=swap');

:root{
  --paper:#FFFFF1;         /* measured */
  --ink:#405284;           /* measured — everything is this one indigo */
  --ink-quiet:#8A97BC;
  --rule:#405284;
  --rule-soft:#C8CEE0;
  --menu:#405284;
  --menu-ink:#FFFFF1;
  --edge:clamp(16px,1.7vw,30px);
  --col-l:41%;
  --head:206px;   /* head block height = lead image offset */
  --gap:clamp(104px,7.5vw,168px);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;background:var(--paper);color:var(--ink);
  font:400 21px/30px Cormorant,Garamond,Georgia,serif;
  -webkit-font-smoothing:antialiased;
}
img,video{display:block;max-width:100%}
a{color:inherit}

/* ---------- contents control ---------- */
.topbar{position:fixed;top:26px;left:26px;z-index:60;
  display:flex;align-items:center;gap:16px}
/* two arrows, opposite directions — page back / page on */
.pagenav{position:fixed;top:26px;right:26px;z-index:60;display:flex;gap:14px;
  align-items:center;font-size:11px}
.pagenav .nav{display:inline-flex;color:var(--ink);text-decoration:none;padding:2px}
.pagenav svg{width:auto;height:.72em;display:block;overflow:visible}
.pagenav .nav:hover{opacity:.55}
.pagenav .nav:focus-visible{outline:2px solid var(--ink);outline-offset:3px}

.contents-btn{
  z-index:60;
  display:flex;align-items:center;gap:16px;
  background:none;border:0;padding:6px;cursor:pointer;color:var(--ink);
  font:600 11px/1 Inter,system-ui,sans-serif;letter-spacing:.19em;text-transform:uppercase;
}
/* a square mark: .72em wide and .72em tall — the cap height of CONTENTS */
/* stack height = the cap height of CONTENTS (0.72em), in em so it tracks the label */
.contents-btn .bars{display:grid;gap:.09em;width:.72em}   /* square: .72em on both sides */
.contents-btn .bars i{display:block;height:.18em;background:currentColor}
.contents-btn:focus-visible{outline:2px solid var(--ink);outline-offset:3px}

/* ---------- contents overlay ---------- */
.contents{position:fixed;inset:0;z-index:50;display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);visibility:hidden}
.contents[data-open="true"]{visibility:visible}
.contents .panel{
  background:var(--menu);color:var(--menu-ink);
  display:flex;flex-direction:column;justify-content:center;padding:5vh 0 5vh 8vw;
  transform:translateX(-100%);transition:transform .42s cubic-bezier(.4,0,.15,1);
}
.contents[data-open="true"] .panel{transform:none}
.contents .stage{background:var(--paper)}
.contents ol{list-style:none;margin:0;padding:0}
.contents li{line-height:43px}
.contents a{display:flex;gap:1.4rem;align-items:baseline;text-decoration:none;
  font-size:24px;line-height:43px;color:var(--menu-ink);opacity:.95}
.contents a:hover{opacity:1;text-decoration:underline;text-underline-offset:6px}
.contents .num{min-width:2.1em;opacity:.6}
.contents li[aria-current="page"] a{opacity:.45;cursor:default}
.contents li[aria-current="page"] a:hover{text-decoration:none}

/* ---------- the page ---------- */
.page{padding:0 var(--edge)}
/* two columns that flow independently, so neither waits on the other */
.spread{display:flex;align-items:stretch;gap:var(--gap)}
/* the left column is as tall as the text; the cluster is pushed to its foot,
   so the bottom of the mosaic lands on the bottom of the prose */
.left{flex:0 0 var(--col-l);min-width:0;display:flex;flex-direction:column}
.right{flex:1 1 auto;min-width:0}

.fig{margin:var(--head) 0 clamp(40px,7vh,96px)}   /* the least the cluster may come up */
/* the space is reserved from the file's own proportions, so nothing
   jumps while a video is still fetching its header */
figure.fig{aspect-ratio:var(--ar,1.5)}
.fig img,.fig video{width:100%;height:100%;display:block;object-fit:cover}

/* head, standfirst and rule pin together; the prose runs under them */
/* the block is exactly as tall as the image's top offset, so the rule at its
   foot lands on the same line as the top edge of the lead image */
.headwrap{position:sticky;top:0;z-index:5;background:var(--paper);
  height:var(--head);display:flex;flex-direction:column;justify-content:space-between}
.head{padding:44px 0 0;display:flex;align-items:baseline;position:relative;flex:0 0 auto}
.head .num{position:absolute;right:100%;padding-right:38px;white-space:nowrap;
  font-size:30px;line-height:35px}
.head h1{margin:0;font-weight:400;font-size:30px;line-height:35px;text-wrap:balance}
.topline{border:0;border-top:2px solid var(--rule);margin:0}
.lede{font-style:italic;font-size:25px;line-height:30px;margin:44px 0 40px}
.lede strong{font-style:normal;font-weight:500}

/* ---------- prose furniture ---------- */
.prose h2{
  font-size:25px;line-height:31px;font-weight:500;margin:46px 0 16px;
  padding-top:14px;border-top:1px solid var(--rule-soft);
}
.prose h2:first-child{margin-top:0}
.prose ul{list-style:none;margin:0 0 28px;padding:0}
.prose li{position:relative;padding-left:1.5em;margin:0 0 12px}
.prose li::before{
  content:"";position:absolute;left:.3em;top:.62em;
  width:5px;height:5px;border-radius:50%;background:var(--ink-quiet);
}
.prose blockquote{
  margin:34px 0;padding:0 0 0 24px;border-left:2px solid var(--rule-soft);
}
.prose blockquote p{font-style:italic;font-size:23px;line-height:31px;margin:0}
.prose blockquote cite{
  display:block;margin-top:12px;font-style:normal;
  font:500 10px/1 Inter,system-ui,sans-serif;letter-spacing:.16em;
  text-transform:uppercase;color:var(--ink-quiet);
}
.prose .notice{
  font-size:18px;line-height:26px;color:var(--ink-quiet);
  border-top:1px solid var(--rule-soft);border-bottom:1px solid var(--rule-soft);
  padding:16px 0;margin:0 0 28px;
}
/* a footnote sits below the run of the text, not in it */
.prose .note{color:var(--ink-quiet);font-size:17px;line-height:24px;margin:0 0 26px}
.prose .btnrow{margin:26px 0 30px;display:flex;flex-wrap:wrap;gap:10px}
/* solid: the paper's own colour set on the indigo, so a button reads as a
   button rather than as another ruled box */
.prose a.btn,.say p.cta a.btn{
  font:500 10px/1 Inter,system-ui,sans-serif;letter-spacing:.16em;
  text-transform:uppercase;text-decoration:none;
  color:var(--paper);background:var(--ink);
  border:1px solid var(--ink);padding:11px 15px;
}
.prose a.btn:hover,.say p.cta a.btn:hover{background:#334473;border-color:#334473}
.prose a.btn:focus-visible,.say p.cta a.btn:focus-visible{outline:2px solid var(--ink);outline-offset:3px}

.diagram{margin:0 0 36px}
.diagram svg{width:100%;height:auto;display:block}


/* ---------- the cluster ----------
   Each tile is placed by its own x / y / width, read off your composition,
   so the arrangement is the one you drew rather than whatever wrapping gives.
   Tiles keep their true proportions — nothing is cropped. */
/* The cluster rides the foot of the window while the reader is in the passage
   it belongs to — but only inside .hold, which begins below the lead picture,
   so it can never climb over it. */
.hold{flex:1;display:flex;flex-direction:column;justify-content:flex-end;min-height:0}
.mosaic{position:sticky;bottom:26px;overflow:hidden;
  display:flex;flex-wrap:wrap;gap:12px;justify-content:center;align-items:flex-start}
.tile{position:relative;flex:0 0 calc(var(--w,30) * 1%);
  aspect-ratio:var(--ar,1);overflow:hidden}
/* a page with a composition places every tile itself */
.mosaic.free{display:block;aspect-ratio:var(--mos,1.2)}
.mosaic.free .tile{position:absolute;top:0;
  left:calc(var(--x,0) * 1%);margin-top:calc(var(--y,0) * 1%);
  width:calc(var(--w,30) * 1%)}
.tile > img,.tile > video{width:100%;height:100%;display:block;object-fit:cover;
  will-change:transform}
/* the whole tile travels, and it is clipped by the mosaic's own foot —
   so a tile that has not arrived is genuinely behind the rule */
.mosaic.par .tile{transform:translate3d(0,var(--rise,0px),0)}

.pager{display:flex;justify-content:space-between;gap:16px;align-items:end;
  margin-top:clamp(40px,7vh,90px)}
/* the last page carries only the way back, so it keeps company with the
   buttons above it rather than sitting a screen away from them */
.pager.solo{margin-top:clamp(10px,1.4vh,18px);justify-content:flex-start}
.pager a{
  font:500 11px/1 Inter,system-ui,sans-serif;letter-spacing:.16em;
  text-transform:uppercase;text-decoration:none;color:var(--ink);
  border:1px solid var(--rule-soft);padding:11px 15px;
}
.pager a:hover{border-color:var(--ink)}
.pager .spacer{visibility:hidden}

footer.site{
  margin-top:48px;padding:16px 0 34px;border-top:1px solid var(--rule-soft);
  font:500 10px/1.6 Inter,system-ui,sans-serif;letter-spacing:.13em;
  text-transform:uppercase;color:var(--ink-quiet);
}

/* ---------- overture ---------- */
/* the cover is one full frame of film, the words set on it */
.overture{background:var(--paper)}
.cover{position:relative;height:100vh;z-index:1}
/* the film is fixed to the window and narrows into the image column as the
   reader leaves the cover — the same picture, not a second copy of it */
.reel{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:0;overflow:hidden;
  /* the film reads too pastel raw — this is graded, not re-encoded */
  filter:saturate(1.16) contrast(1.03)}
.reel video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
/* the iridescence: a few broad bands drifting across the film on the
   diagonal, laid on soft-light so it reads as light rather than as colour */
.sheen{position:absolute;inset:-40% -60%;pointer-events:none;
  mix-blend-mode:soft-light;opacity:.34;
  background:repeating-linear-gradient(-24deg,
    rgba(120,170,255,0) 0px, rgba(120,170,255,.55) 130px,
    rgba(255,225,190,.50) 260px, rgba(190,150,255,.45) 380px,
    rgba(120,170,255,0) 520px);
  animation:drift 26s linear infinite}
@keyframes drift{from{transform:translate3d(0,0,0)}
  to{transform:translate3d(520px,-232px,0)}}   /* one band, along the -24° */

.cover .plate{position:absolute;inset:auto 0 auto 0;top:50%;
  transform:translateY(-50%);text-align:center;
  padding:0 clamp(28px,6vw,80px);color:var(--paper);
  text-shadow:0 2px 26px rgba(20,24,40,.42)}
.overture .eyebrow{
  margin:0 0 clamp(16px,2.6vh,26px);
  font:500 11px/1 Inter,system-ui,sans-serif;letter-spacing:.28em;
  text-transform:uppercase;color:rgba(255,255,241,.82);
}
.overture h1{margin:0;font-weight:400;font-size:clamp(52px,8vw,116px);
  line-height:1;letter-spacing:.02em}
.cover .stand{margin:clamp(14px,2.4vh,26px) auto 0;
  font:400 clamp(13px,1.18vw,17px)/1.45 Inter,system-ui,sans-serif;
  letter-spacing:.09em;white-space:nowrap;color:rgba(255,255,241,.9)}

/* One picture carried through the whole overture: it arrives in the middle of
   the column in the first scene and climbs to the top of it in the second.
   The same element throughout — never a second copy fading in. */
.carry{position:fixed;top:0;left:0;z-index:2;overflow:hidden;
  width:1px;height:1px;opacity:0;will-change:transform,width}
.carry img,.carry video{width:100%;height:100%;object-fit:cover;display:block}


/* ---------- the scenes ----------
   The section is tall; the frame inside it is one screen and sticks, so the
   reader's scroll is spent inside the scene instead of pushing it past. */
.scene{position:relative}
.frame{position:sticky;top:0;height:100vh;overflow:hidden;
  display:grid;grid-template-columns:1fr 1fr;z-index:1}

.say{position:relative;z-index:3;background:var(--paper);padding:0 clamp(28px,4.4vw,72px);
  display:flex;flex-direction:column;justify-content:center;
  gap:clamp(18px,2.6vh,30px)}
/* the paragraphs stack: each arrives on its own beat and then stays */
.say p{
  margin:0;font-size:clamp(21px,1.9vw,28px);line-height:1.34;max-width:31ch;
  opacity:0;will-change:transform,opacity;
}
/* a list set in from the line that introduces it */
.say p.in{padding-left:1.5em}
/* the overture ends on the same button the pages use */
.say p.cta{max-width:none}
.field{position:relative;overflow:hidden}
.bed{position:absolute;inset:0;will-change:transform}
.bed img,.bed video{width:100%;height:100%;object-fit:cover;display:block}
/* the film that carries across a boundary: one element, fixed over the
   picture column, so it is never started a second time */
.stay{position:fixed;top:0;z-index:0;overflow:hidden;opacity:0;pointer-events:none}
.stay img,.stay video{width:100%;height:100%;object-fit:cover;display:block}
/* the grid that closes over the bed: every cell covers its share of the column,
   so when the last one lands the picture underneath is gone */
.grid{position:absolute;inset:0;z-index:1;display:grid;
  grid-template-columns:repeat(var(--cols,4),1fr);
  grid-auto-rows:1fr}
.cell{position:relative;overflow:hidden;opacity:0;
  transform:scale(1.06);will-change:opacity,transform}
.cell img,.cell video{width:100%;height:100%;object-fit:cover;display:block}
/* a picture that comes out of a vanishing point at the centre of the column:
   it grows at a steady relative rate, which is what makes it read as an
   approach out of infinity rather than a box being scaled up */
.emerge{position:absolute;left:50%;top:50%;z-index:2;opacity:0;
  transform:translate(-50%,-50%) scale(0.02);transform-origin:50% 50%;
  will-change:transform,opacity}
.emerge.cover{width:100%;height:100%}
.emerge.plate{width:calc(var(--w,47) * 1%);aspect-ratio:var(--ar,1);height:auto}
.emerge img,.emerge video{width:100%;height:100%;object-fit:cover;display:block}
/* four pictures that arrive from the four corners and close into one tile */
.quad{position:absolute;left:50%;top:50%;z-index:2;
  width:calc(var(--w,60) * 1%);aspect-ratio:1;transform:translate(-50%,-50%);
  display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:1fr}
.q{position:relative;overflow:hidden;will-change:transform,opacity;opacity:0}
.q img,.q video{width:100%;height:100%;object-fit:cover;display:block}
.grid{will-change:transform}

/* a stack of plates in the column: they slide in from the top or the foot
   and come to rest touching one another, the stack anchored at the top */
.plate-v{position:absolute;left:50%;z-index:2;width:calc(var(--w,74) * 1%);max-width:none;
  aspect-ratio:var(--ar,1);transform:translateX(-50%);
  will-change:transform;overflow:hidden;top:0}
.plate-v img,.plate-v video{width:100%;height:100%;object-fit:cover;display:block}

/* the arriving picture: it comes up the column and then holds */
.rise{position:absolute;left:50%;top:50%;width:calc(var(--w,30) * 1%);max-height:80%;
  aspect-ratio:var(--ar,.7);transform:translate(-50%,-50%);
  will-change:transform}
.rise img,.rise video{width:100%;height:100%;object-fit:cover;display:block;
  box-shadow:0 18px 60px rgba(0,0,0,.34)}

@media (max-width:900px){
  body{font-size:19px;line-height:27px}
  .spread{display:block}
  .fig{margin-top:0}
  .headwrap{position:static;background:none;margin-bottom:34px;height:auto;display:block}
  .lede{margin:26px 0}
  .head{height:auto;padding-top:80px;gap:1rem}
  .head .num{position:static;padding:0}
  .fig{margin:0 0 30px}
  .contents{grid-template-columns:1fr}
  .contents .stage{display:none}

  /* ---- the overture on a phone ----
     A scene splits left/right on a desktop. On a narrow screen that leaves
     the words about nineteen characters wide, so the scene stacks instead:
     the film takes a band across the top and the words have the full width
     underneath it. */
  .frame{grid-template-columns:1fr;grid-template-rows:42vh 1fr}
  .field{grid-row:1}
  .say{grid-row:2;justify-content:flex-start;
       padding:clamp(22px,5vh,40px) clamp(20px,5.5vw,34px) 0;
       gap:clamp(12px,1.8vh,20px)}
  .say p{font-size:clamp(17px,4.4vw,22px);line-height:1.38;max-width:none}
  .say p.in{padding-left:1.1em}

  /* the cover's own type, which was sized for a wide window */
  .overture h1{font-size:clamp(42px,14vw,74px)}
  .cover .stand{font:400 clamp(11px,3.2vw,15px)/1.45 Inter,system-ui,sans-serif;
    letter-spacing:.06em}
  .overture .eyebrow{margin-bottom:clamp(12px,2vh,20px);letter-spacing:.22em}
  /* the confidentiality line is held to one line on a wide screen; at phone
     width one line would be 626px, which is what was making the page slide
     sideways, so here it wraps */
  .overture .overture-note,
  .overture .overture-note p{font-size:11px;line-height:1.45;white-space:normal}
  .overture .overture-note{bottom:clamp(14px,2.4vh,22px)}

}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .sheen{animation:none}
  .mosaic.par .tile{transform:none}
  .contents .panel{transition:none}
}

/* the confidentiality line, at the foot of the cover — one line, ranged left */
.overture-note{
  position:absolute;left:0;right:0;bottom:clamp(18px,3vh,30px);margin:0;
  padding:0 clamp(28px,4.4vw,72px);text-align:left;
  color:rgba(255,255,241,.74);
  font-size:clamp(10px,1.02vw,14px);line-height:1.5;white-space:nowrap;
  text-shadow:0 1px 14px rgba(20,24,40,.55);
}
.overture-note p{margin:0}
.overture-note a{color:inherit;text-decoration:underline;text-underline-offset:3px}

/* the contents mark is cream while it sits on the film, indigo once past it */
.topbar.on-film .contents-btn,
.pagenav.on-film .nav{color:var(--paper)}
