/* journal-moves.css — The journal page: a drum of photographs to spin, a rail to grab, and photographs that fly open into their stories. */

/* journal-spin — the photo wall as a full drum seen from inside. Column-sized layers on one turning ring. */
html[data-moves] .kanji,html[data-moves] .intro-title{pointer-events:none}
html[data-spin-live] #wall>.tile{display:none}
html[data-spin-live] .mosaic{cursor:grab;touch-action:pan-y;user-select:none;-webkit-user-select:none}
html[data-spin-live] .mosaic.is-held{cursor:grabbing}
.spin-ring{position:absolute;left:0;top:0;width:0;height:0;transform-style:preserve-3d;will-change:transform}
.spin-col{position:absolute;left:0;top:0;display:flex;flex-direction:column;gap:3px;backface-visibility:hidden;-webkit-backface-visibility:hidden;will-change:transform}
.spin-col[data-off]{visibility:hidden}
.spin-tile{flex:none;width:100%;background-size:cover;background-position:50% 35%}
/* Phones: the drum is a band above the title, in place of the grid */
html[data-spin-live][data-plain] .mosaic{height:58svh;padding:0;overflow:hidden;perspective:620px}
html[data-spin-live][data-plain] .mosaic-wall{position:absolute;left:50%;top:50%;width:0;height:0;display:block;transform-style:preserve-3d}

/* journal-rail — the year rail becomes a handle on the whole page. Stops are evenly spaced, one per chapter. */
html[data-moves] .rail i,html[data-moves] .rail-marker,html[data-moves] .rail-read{display:none}
html[data-moves] .rail b{transition:opacity .25s}
html[data-moves] .rail b[data-off]{opacity:0}
.jr{--len:58vh;position:fixed;right:0;top:21vh;width:62px;height:var(--len);z-index:41;cursor:grab;touch-action:none;outline:none;user-select:none;-webkit-user-select:none}
.jr.is-held{cursor:grabbing}
.jr-stop{position:absolute;right:28px;width:9px;height:1px;background:rgba(255,255,255,.6);transform-origin:100% 50%;transition:transform .35s cubic-bezier(.16,1,.3,1),background-color .25s}
.jr-stop.is-on{background:var(--brass);transform:scaleX(2)}
.jr:hover .jr-stop,.jr.is-held .jr-stop{transform:scaleX(1.5)}
.jr:hover .jr-stop.is-on,.jr.is-held .jr-stop.is-on{transform:scaleX(2.6)}
.jr-grip{position:absolute;right:13.5px;top:0;width:30px;height:30px;margin-top:-15px;will-change:transform;pointer-events:none}
.jr-grip::before{content:"";position:absolute;left:50%;top:50%;width:9px;height:9px;margin:-4.5px 0 0 -4.5px;border-radius:50%;background:var(--brass);box-shadow:0 0 0 4px rgba(180,138,58,.25);transition:transform .35s cubic-bezier(.16,1,.3,1),box-shadow .35s}
.jr:hover .jr-grip::before{transform:scale(1.35)}
.jr.is-held .jr-grip::before{transform:scale(1.7);box-shadow:0 0 0 7px rgba(180,138,58,.22)}
.jr:focus-visible .jr-grip::before{box-shadow:0 0 0 2px var(--ground),0 0 0 4px var(--ivory)}
.jr-tip{position:fixed;right:76px;top:0;width:min(25rem,calc(100vw - 110px));box-sizing:border-box;padding:14px 18px 15px;background:var(--panel);border-right:2px solid var(--brass);color:var(--ivory);pointer-events:none;opacity:0;z-index:41;will-change:transform,opacity;transition:opacity .22s}
.jr-tip.is-on{opacity:1}
.jr-tip small{display:block;font-family:var(--mono);font-size:10.5px;letter-spacing:.04em;line-height:1.5;color:var(--brass)}
.jr-tip span{display:block;margin-top:5px;font-family:var(--serif);font-weight:600;font-size:clamp(17px,1.4vw,20px);line-height:1.22;letter-spacing:-.01em}
/* Below the rail's width: the same control along the foot of the screen */
@media (max-width:1023px){
  .jr{--len:calc(100vw - 32px);right:auto;left:16px;top:auto;bottom:0;bottom:env(safe-area-inset-bottom,0px);width:var(--len);height:46px}
  .jr::before{content:"";position:fixed;left:0;right:0;bottom:0;height:calc(46px + env(safe-area-inset-bottom,0px));background:#0d1612;border-top:1px solid rgba(255,255,255,.1);z-index:-1}
  .jr::after{content:"";position:absolute;left:0;right:0;top:50%;height:1px;background:rgba(255,255,255,.28)}
  .jr-stop{right:auto;top:calc(50% - 4px);width:1px;height:9px}
  .jr-stop.is-on,.jr:hover .jr-stop,.jr.is-held .jr-stop,.jr:hover .jr-stop.is-on,.jr.is-held .jr-stop.is-on{transform:none}
  .jr-grip{right:auto;left:0;top:50%;margin:-15px 0 0 -15px}
  .jr-tip{right:16px;left:16px;width:auto;top:auto;bottom:calc(58px + env(safe-area-inset-bottom,0px));border-right:0;border-left:2px solid var(--brass);transform:none!important}
  html[data-moves] .outro{padding-bottom:calc(12vh + 46px)}
}

/* journal-open — a photograph leaves the wall and becomes the screen, then the page is at its story. */
html[data-moves] .kanji,html[data-moves] .intro-title{pointer-events:none}
html[data-moves] .tile{cursor:zoom-in}
html[data-moves] .tile:focus-visible{outline:2px solid var(--brass);outline-offset:-2px}
html[data-moves]:not([data-plain]) .tile{transition:filter .25s}
html[data-moves]:not([data-plain]) .tile:hover{filter:saturate(1.1) brightness(1.1)}
html[data-moves] .chapter:focus{outline:none}
.jo{position:fixed;inset:0;z-index:60;overflow:hidden;touch-action:none}
.jo-veil{position:absolute;inset:0;background:var(--ground);opacity:0;will-change:opacity}
.jo-box{position:absolute;left:0;top:0;width:100vw;height:100vh;height:100lvh;overflow:hidden;transform-origin:0 0;will-change:transform}
.jo-img{position:absolute;left:0;top:0;display:block;max-width:none;transform-origin:0 0;will-change:transform}
.jo-shade{position:absolute;inset:0;background:linear-gradient(180deg,rgba(15,27,22,.1) 30%,rgba(15,27,22,.75) 100%);opacity:0;will-change:opacity}
.jo .ch-name{opacity:0;will-change:opacity,transform}

/* journal-phone — phones and tablets. The header takes a ground once the page moves; everything small grows a finger's reach */
@media (max-width:1023px),(hover:none){
  .jhead{padding:10px 16px;background:linear-gradient(180deg,rgba(15,27,22,.84),rgba(15,27,22,0));transition:opacity .8s,transform .28s cubic-bezier(.16,1,.3,1)}
  .jhead::before{content:"";position:absolute;inset:0;z-index:-1;background:rgba(13,22,18,.97);border-bottom:1px solid rgba(255,255,255,.1);opacity:0;transition:opacity .22s}
  .jhead.is-stuck{pointer-events:auto;text-shadow:none}
  .jhead.is-stuck::before{opacity:1}
  .jhead.is-tuck{transform:translateY(-100%)}
  .jhead nav{display:flex;align-items:center}
  .jhead .brand,.jhead nav a,.jhead .shell-btn{position:relative}
  .jhead .brand::after,.jhead nav a::after,.jhead .shell-btn::after{content:"";position:absolute;inset:-14px -6px}
  .jhead .shell-btn::after{inset:-6px 0}
}
@media (max-width:899.98px),(hover:none){
  /* a chapter: the title stands on its photograph, the story follows under it */
  html[data-plain] .chapter .stage{display:grid;grid-template-columns:minmax(0,1fr)}
  html[data-plain] .scene3d{grid-area:1/1;height:auto;min-height:66vh;min-height:66svh}
  html[data-plain] .plane-hero::after{background:linear-gradient(180deg,rgba(15,27,22,.08) 34%,rgba(15,27,22,.88) 100%)}
  html[data-plain] .chapter .ch-name{grid-area:1/1;position:relative;left:auto;bottom:auto;align-self:end;padding:84px 20px 26px;min-width:0;background:linear-gradient(180deg,rgba(15,27,22,0),rgba(15,27,22,.8) 76px,rgba(15,27,22,.92))}
  html[data-plain] .chapter .ch-stamp{color:var(--cream);line-height:1.6}
  html[data-plain] .chapter .ch-name h2{max-width:none;font-size:clamp(1.75rem,7.6vw,3rem);line-height:1.02;letter-spacing:-.035em;overflow-wrap:break-word}
  html[data-plain] .panel{grid-area:2/1;padding:30px 20px 34px;background:rgba(13,22,18,.97)}
  html[data-plain] .lede{font-size:12px;line-height:1.75}
  html[data-plain] .wide{margin-top:14px;font-size:17px;line-height:1.6}
  html[data-plain] .cols{margin-top:28px;gap:22px}
  html[data-plain] .col h4{font-size:11px}
  html[data-plain] .col p{font-size:16.5px;line-height:1.6;color:rgba(241,236,224,.76)}
  html[data-plain] .col p.hi{color:rgba(241,236,224,.92)}
  html[data-plain] .strip{height:clamp(120px,18vh,190px);margin-top:28px;margin-right:-20px;padding-right:20px;scrollbar-width:none}
  html[data-plain] .strip::-webkit-scrollbar{display:none}
  html[data-plain] .panel-links{gap:20px 28px;margin-top:24px;font-size:12px}
  html[data-plain] .panel-links a,html[data-plain] .outro .credit a{position:relative}
  html[data-plain] .panel-links a::after,html[data-plain] .outro .credit a::after{content:"";position:absolute;inset:-12px -4px}
  /* the opening and the close */
  html[data-plain] .intro-title{padding:30px 20px 18px}
  html[data-plain] .intro-title h1{font-size:clamp(2.4rem,11vw,3.6rem)}
  html[data-plain] .intro-title p{font-size:17px;line-height:1.6}
  html[data-plain] .counter{padding:0 20px;box-sizing:border-box;max-width:100%}
  html[data-plain] .counter .above,html[data-plain] .counter .below{line-height:1.6}
  html[data-plain] .outro{min-height:0;padding:64px 20px calc(44px + 46px + env(safe-area-inset-bottom,0px))}
  html[data-plain] .outro p{font-size:17px;line-height:1.6;margin-top:18px}
  html[data-plain] .outro .credit{font-size:12px;gap:22px 28px;align-items:center}
  html[data-plain] .outro .settings{min-height:44px}
}
/* Wide enough for the three notes to sit in two rows */
@media (min-width:700px) and (max-width:1180px) and (hover:none),(min-width:700px) and (max-width:899.98px){
  html[data-plain] .cols{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 40px}
  html[data-plain] .col:first-child{grid-column:1/-1}
  html[data-plain] .scene3d{min-height:58svh}
}
/* A phone on its side: the header steps aside on the way down, the drum and the title share the screen */
@media (max-height:500px) and (max-width:1023px),(max-height:500px) and (hover:none){
  .jhead{padding:6px 16px}
  .jr{height:40px}
  .jr::before{height:calc(40px + env(safe-area-inset-bottom,0px))}
  html[data-spin-live][data-plain] #intro .stage{display:grid;grid-template-columns:minmax(0,44%) minmax(0,1fr);align-items:center;min-height:100vh;min-height:100svh}
  html[data-spin-live][data-plain] .mosaic{height:auto;align-self:stretch}
  html[data-spin-live][data-plain] .intro-title{padding:48px 24px 48px 28px}
  html[data-spin-live][data-plain] .intro-title h1{margin-top:6px;font-size:clamp(2.1rem,6vw,3rem);max-width:none}
  html[data-spin-live][data-plain] .intro-title p{margin-top:10px;font-size:16px;line-height:1.5}
  html[data-plain] .scene3d{min-height:84svh}
  html[data-plain] .chapter .ch-name{padding:54px 24px 20px}
  html[data-plain] .chapter .ch-name h2{font-size:clamp(1.7rem,4.6vw,2.4rem)}
  html[data-plain] .panel{padding:24px 24px 28px}
  html[data-plain] .strip{height:128px;margin-right:-24px;padding-right:24px}
  html[data-plain] .counter .num{font-size:clamp(3.4rem,10vw,5rem)}
  html[data-plain] .outro{padding:40px 24px 84px}
}
/* An iPad on its side keeps the rail at the right edge: the reading column stays clear of it */
@media (min-width:1024px) and (hover:none){
  html[data-plain] .panel,html[data-plain] .chapter .ch-name,html[data-plain] .outro{padding-right:84px}
  html[data-plain] .intro-title{padding-right:84px}
}

/* A phone on its side: the notch can be on either edge, so the text and the bars step clear of it and the ground runs on behind */
@media (max-height:500px) and (hover:none){
  html[data-plain] #main{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
  .jhead{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
  .jr{--len:calc(100vw - max(16px,env(safe-area-inset-left)) - max(16px,env(safe-area-inset-right)));left:max(16px,env(safe-area-inset-left))}
}

/* The panel's text stops short of the year rail's labels */
html:not([data-plain]) .panel{padding-right:max(clamp(20px,5vw,72px),92px)}

/* Scrolling: ScrollTrigger cannot measure a scrolled page under CSS smooth scrolling, and turning a tablet makes it measure one */
html{scroll-behavior:auto}

/* The closing links sit on their own line height, so their underlines stay under the words beside the button */
.outro .credit{align-items:center}
