/* The opening of the home page: the headline alone in the middle of the first
   screen; as the page scrolls, the words tip back, the molecule turns in with four
   notes on the physics round it and the chapter line below (hero-*.js). */

/* the layer of notes, the chapter line and the scroll cue */
.t-layer{position:absolute;inset:0;pointer-events:none;z-index:1}
/* hero-notes.js lifts the layer out of the headline's pane (which is pinned while the
   words tip back) and makes it a direct child of the opening: Safari mispositions a
   fixed layer inside a pinned one while the page scrolls, and the notes shook. Held to
   the first screen's own height (100svh) like the molecule, so on a phone the notes
   stay put when the address bar hides. Under the molecule's canvas, as before. */
.t-layer.fixed{position:fixed;inset:0 0 auto;height:100vh;height:100svh;z-index:1;transition:none}
.t-mono{font:500 11px/1.2 var(--mono);letter-spacing:.16em;text-transform:uppercase;color:#93a3b5}
@media (prefers-reduced-motion: reduce){.t-layer *{animation:none!important;transition:none!important}}

/* the chapter line: the three chapters of the story, the first one lit */
.thread{position:absolute;left:50%;bottom:40px;transform:translateX(-50%);display:flex;align-items:center;gap:18px;white-space:nowrap;animation:fade-in 1s 1.8s cubic-bezier(.22,1,.36,1) both}
.thread .ch{display:flex;align-items:center;gap:10px}
.thread .ch b{font-weight:500;color:#5d6e82}
.thread .ch.on{color:#f5f5f7}
.thread .ch.on b{color:#ffd08d}
.thread .ch.on::before{content:"";width:6px;height:6px;border-radius:50%;background:#ffd08d}
.thread .seg{position:relative;width:72px;height:1px;background:rgba(147,163,181,.3);overflow:hidden}
.thread .seg.first::after{content:"";position:absolute;inset:0;background:#ffd08d;transform-origin:left;animation:grow 1.6s 2.4s cubic-bezier(.22,1,.36,1) both}
.scroll-cue{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);animation:fade-in 1s 2.6s cubic-bezier(.22,1,.36,1) both;color:#5d6e82}
@keyframes grow{from{transform:scaleX(0)}to{transform:scaleX(.35)}}
@keyframes fade-in{from{opacity:0}to{opacity:1}}
@media (max-width: 820px), (orientation: portrait){
  .thread{gap:10px;bottom:52px}
  .thread .seg{width:22px}
  .thread .ch span{display:none}
  .thread .ch.on span{display:inline}
}

/* the four notes: mostly formulas, each with one short caption */
.qn{position:absolute;width:max-content;max-width:40vw;display:grid;gap:6px;opacity:0;animation:qn-in 1.1s cubic-bezier(.22,1,.36,1) both}
.qn .k{font:500 10px/1.2 var(--mono);letter-spacing:.18em;text-transform:uppercase;color:#7d8da0}
.qn .k b{font-weight:500;color:#ffd08d;margin-right:.7em}
.qn .f{font:italic 400 clamp(16px,1.3vw,20px)/1.3 "Iowan Old Style","Palatino Linotype",Palatino,"Times New Roman",serif;color:#e4ebf2;white-space:nowrap;letter-spacing:.01em}
.qn .f.s{font-size:clamp(12.5px,.95vw,14.5px);color:#8e9fb1}
.qn .k + .f{margin-bottom:2px}
.qn .f .u{font-style:normal;font-weight:600}
.qn .f sub{font-size:.66em}
.qn .f sup{font-size:.66em;line-height:0}
.qn p{margin:4px 0 0;font-size:12.5px;line-height:1.4;color:#7d8da0;letter-spacing:.01em}
.qn::after{content:"";position:absolute;top:5px;width:clamp(24px,3vw,48px);height:1px}
.qn.l{right:calc(50% + clamp(250px,22vw,340px));text-align:right;justify-items:end}
.qn.l::after{left:calc(100% + 14px);background:linear-gradient(90deg,rgba(147,163,181,.5),rgba(147,163,181,0))}
.qn.r{left:calc(50% + clamp(250px,22vw,340px));justify-items:start}
.qn.r::after{right:calc(100% + 14px);background:linear-gradient(270deg,rgba(147,163,181,.5),rgba(147,163,181,0))}
.qn.q1{top:43%;animation-delay:2.2s}
.qn.q2{top:43%;animation-delay:2.6s}
.qn.q3{top:68%;animation-delay:3s}
.qn.q4{top:68%;animation-delay:3.4s}
.qn .legend{display:flex;align-items:center;gap:8px;font:500 9.5px/1 var(--mono);letter-spacing:.14em;text-transform:uppercase;color:#7d8da0}
.qn .legend i{display:block;width:60px;height:3px;border-radius:2px;background:linear-gradient(90deg,#1f8cff,#5c45ff 50%,#ff9a2e)}
@keyframes qn-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
/* a phone, or a window under 1040 px wide, has no room beside the molecule (the
   widest note would run off the screen edge): the four notes take turns under it */
@media (max-width: 1039px), (orientation: portrait){
  .qn{left:50%!important;right:auto!important;top:auto!important;bottom:92px;width:min(330px,88vw);max-width:none;transform:translateX(-50%);justify-items:center!important;text-align:center!important;animation:qn-turn 24s linear infinite both}
  .qn::after{display:none}
  .qn .f{white-space:normal}
  .qn .f.s{display:none}
  .qn p{font-size:12.5px}
  .qn.q1{animation-delay:2.2s}
  .qn.q2{animation-delay:8.2s}
  .qn.q3{animation-delay:14.2s}
  .qn.q4{animation-delay:20.2s}
  @keyframes qn-turn{0%{opacity:0;transform:translate(-50%,6px)}3%,22%{opacity:1;transform:translateX(-50%)}25%,100%{opacity:0;transform:translate(-50%,-4px)}}
}
@media (prefers-reduced-motion: reduce){
  .qn{opacity:1}
  @media (max-width: 1039px), (orientation: portrait){.qn.q1{opacity:1}.qn.q2,.qn.q3,.qn.q4{display:none}}
}

/* the first screen: the headline alone in the middle, the scroll cue at its foot,
   and room below for the molecule and the notes, which follow the scroll */
html[data-stage=scroll] .open-pane.lead{grid-template-rows:minmax(0,1fr) auto auto minmax(0,1.12fr);align-content:stretch;padding-top:var(--bar);padding-bottom:0;margin-bottom:62svh}
html[data-stage=scroll] .open h1 .sm{grid-row:2}
html[data-stage=scroll] .open h1 .big{grid-row:3}
html[data-stage=scroll] .open-sky canvas{transition:none}
.cue-wrap{position:absolute;left:0;right:0;bottom:0;height:60px;pointer-events:none}
html[data-stage=scroll] .qn.q1,html[data-stage=scroll] .qn.q2{top:27%}
html[data-stage=scroll] .qn.q3,html[data-stage=scroll] .qn.q4{top:57%}
@media (min-width: 1040px) and (orientation: landscape){
  html[data-stage=scroll] .qn,html[data-stage=scroll] .thread{animation:none;opacity:0}
}

/* the headline tips back as the page starts to scroll (hero-exit.js sets
   html.exit-pin only when motion is allowed): the first screen holds still while
   the words go and the headline moves as one box, no wider than its words, so its
   near edge never reaches past the screen as it tips. Nothing round the pinned
   layers clips them: in Safari a clipping box round pinned layers makes them shake
   while the page scrolls. */
html.exit-pin[data-stage=scroll] .open-pane.lead{position:sticky;top:0}
html.exit-pin .open h1{display:grid;margin:0;grid-column:1/13;grid-row:2/4;justify-self:center;width:max-content;max-width:100%;justify-items:center;transform-origin:50% 50%;will-change:transform}
html.exit-pin .open h1 .sm{grid-row:1;grid-column:1}
html.exit-pin .open h1 .big{grid-row:2;grid-column:1}
