/* Evan, The Dissector. The DM street look (tokens from the street kit), laid out for an essay.
   Type: Montserrat 800 caps for names, Manrope for prose (Google Fonts, linked in index.html). */
:root{
  --ground:#000000; --navy:#020308; --navy-2:#0a1220;
  --ink:#eae6dc; --ink-2:#a6adbf; --ink-3:#c9d0de; --ice:#dfe3ea; --rule:#182338;
  --light-a:44,76,138; --light-b:176,200,246; --blue:94,142,226;
  --ombre-bright:linear-gradient(135deg,#f4f0e6,#ece7db 52%,#e2dccd);
  --ombre-mark:linear-gradient(135deg,#a9c6f7,#d3dcf4 52%,#eef0f4);
  --caps:"Montserrat",ui-sans-serif,system-ui,sans-serif;
  --sans:"Manrope",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --axis:24px; --gap:48px; --side:31%; --feather:clamp(8px,1.1vw,16px);
  --out:cubic-bezier(.2,.7,.3,1); --fold:cubic-bezier(.65,0,.35,1);
}
*,*::before,*::after{box-sizing:border-box}
html{background:var(--ground);color-scheme:dark;scrollbar-gutter:stable;-webkit-text-size-adjust:100%}
/* the page moves up and down only: it can't be dragged or bounced sideways on a phone.
   clip (not hidden) so the sticky masthead keeps working. */
html,body{overflow-x:clip;overscroll-behavior-x:none}
body{touch-action:pan-y pinch-zoom}
body{margin:0;font:400 17px/1.62 var(--sans);color:var(--ink);
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent}
h1,h2,p,ul,figure,blockquote{margin:0;padding:0}
ul{list-style:none}
a{color:inherit}
img{display:block;max-width:100%;height:auto}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* ---- the one blue light ---- */
.lights{position:fixed;inset:0;z-index:-1;pointer-events:none;overflow:hidden}
.lt-broad,.lt-near{position:absolute;inset:-10%}
.lt-broad{background:radial-gradient(900px 760px at 24% 26%,rgba(var(--light-a),.24),transparent 62%);
  animation:st-drift 46s ease-in-out infinite alternate}
.lt-near{background:radial-gradient(460px 380px at 15% 15%,rgba(var(--light-b),.06),transparent 64%);
  animation:st-near 17s ease-in-out infinite alternate,st-breathe 7.5s ease-in-out infinite}
.lights::after{content:"";position:absolute;left:0;right:0;bottom:0;height:46%;
  background:linear-gradient(to bottom,transparent,rgba(0,0,0,.34))}
@keyframes st-drift{from{transform:translate3d(-2%,-1%,0)}to{transform:translate3d(5%,4%,0)}}
@keyframes st-near{from{transform:translate3d(0,0,0)}to{transform:translate3d(4%,3%,0)}}
@keyframes st-breathe{0%,100%{opacity:.7}50%{opacity:1}}
@keyframes st-wash{0%,100%{transform:translate3d(-54%,0,0)}50%{transform:translate3d(0,0,0)}}
@keyframes st-wordsweep{from{background-position:0 0}to{background-position:100% 0}}
@keyframes st-fadein{from{opacity:0}to{opacity:1}}
.appear{animation:st-fadein 1.4s ease both}

.wrap{position:relative;max-width:1680px;margin:0 auto;padding:0 var(--axis)}
.chapter h2,.bar-name span{-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent}

/* ---- masthead ---- */
.top{position:sticky;top:0;z-index:60;background:var(--navy);overflow:hidden;box-shadow:0 -70px 0 70px var(--navy);
  border-bottom:1px solid var(--rule);
  border-image:linear-gradient(90deg,rgba(var(--blue),.15),rgba(var(--blue),.75) 28%,rgba(var(--light-b),.7) 72%,rgba(var(--light-b),.15)) 1;
  -webkit-user-select:none;user-select:none}
.top::before{content:"";position:absolute;top:0;bottom:0;left:0;width:220%;pointer-events:none;
  background:linear-gradient(90deg,transparent,rgba(var(--light-a),.2) 40%,rgba(var(--light-a),.06) 70%,transparent);
  animation:st-wash 46s ease-in-out infinite}
.top-in{position:relative;display:flex;align-items:center;gap:16px;max-width:1680px;margin:0 auto;
  padding:calc(12px + env(safe-area-inset-top)) var(--axis) 12px}
.bar-name{flex:1 1 auto;min-width:0;min-height:24px;display:flex;align-items:center;gap:9px;margin:0;padding:0;border:0;background:none;cursor:pointer;text-align:left;touch-action:manipulation;
  font:800 min(17px,4.15vw)/1.3 var(--caps);letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}
.bar-name span{display:block;overflow:hidden;text-overflow:ellipsis;background-image:var(--ombre-mark);background-size:220% 100%;
  animation:st-wordsweep 38s steps(190) infinite alternate;opacity:1;transition:opacity .7s var(--out)}
.bar-name.out span{opacity:0;transition:opacity .45s ease}
.bar-name i{flex:none;width:7px;height:7px;margin-top:-4px;border-right:1.5px solid #a9c6f7;border-bottom:1.5px solid #a9c6f7;transform:rotate(45deg);
  transition:transform 1.1s var(--fold),margin-top 1.1s var(--fold),opacity .7s var(--out);opacity:.8}
/* the arrow goes out and comes back with the name, so it is never seen changing place */
.bar-name.out i{opacity:0;transition:transform 1.1s var(--fold),margin-top 1.1s var(--fold),opacity .34s ease}
.bar-name[aria-expanded="true"] i{transform:rotate(225deg);margin-top:4px}
.bar-name:focus-visible{outline:1px solid var(--ice);outline-offset:4px}
/* the sections, let down from the masthead */
.shade{position:fixed;inset:0;z-index:58;background:rgba(0,0,0,.6);opacity:0;pointer-events:none;transition:opacity 1.1s ease}
.outlined .shade{opacity:1;pointer-events:auto}
.outline{position:fixed;left:0;right:0;top:var(--top-h,49px);z-index:59;background:var(--navy);display:grid;grid-template-rows:0fr;
  transition:grid-template-rows 1.1s var(--fold);-webkit-user-select:none;user-select:none}
.outlined .outline{grid-template-rows:1fr}
.outline-in{min-height:0;overflow:hidden;visibility:hidden;transition:visibility 0s linear 1.1s}
.outlined .outline-in{visibility:visible;transition:visibility 0s}
.outline-pad{max-width:1680px;margin:0 auto;padding:8px var(--axis) 16px;display:flex;flex-direction:column;align-items:flex-start;
  border-bottom:1px solid var(--rule);opacity:0;transition:opacity .6s ease;
  max-height:calc(100vh - var(--top-h,49px));max-height:calc(100dvh - var(--top-h,49px));overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.grp{display:flex;flex-direction:column;align-items:flex-start}
.grp+.grp{margin-top:14px}
.outline a.group,.parts a.group{color:#a9c6f7}
.outlined .outline-pad{opacity:1;transition:opacity 1.2s ease .2s}
.outline a{display:inline-flex;align-items:center;min-height:38px;text-decoration:none;font:800 12px/1.3 var(--caps);letter-spacing:.1em;text-transform:uppercase;
  color:#979daa;transition:color .6s ease}
.outline a[aria-current="true"]{color:var(--ice)}
.outline a:focus-visible{outline:1px solid var(--ice);outline-offset:4px}
.index-mark{flex:none;display:inline-flex;align-items:center;gap:6px;align-self:flex-end;height:24px;color:#a6adbf;
  text-decoration:none;white-space:nowrap;transition:color 1.1s ease}
.index-mark:hover,.index-mark:focus-visible{color:#eae6dc}
.index-mark b{font:500 10px/1 var(--sans);letter-spacing:.08em;text-transform:uppercase}
.index-mark svg{flex:none;display:block;width:18px;height:18px}
.top.tight .index-mark b{display:none}

/* ---- title page: the paper's cover, then its credits ---- */
/* IGOR's title, its cover, then its credits; the first section on the page sits close under the masthead */
.wrap>section:first-of-type{padding-top:clamp(28px,5vh,56px)}
.hero .plate{max-width:560px}
.hero>.plate{margin-top:clamp(36px,4.4vw,72px)}
.by{margin-top:28px;font:500 12px/1.5 var(--sans);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-2)}
.by p+p{margin-top:4px}
/* the sections in a row beside the cover, on windows wide enough to hold them there */
.parts{display:none;flex-direction:column;align-items:flex-start;gap:14px var(--gap);margin-top:clamp(28px,3vw,44px);-webkit-user-select:none;user-select:none}
.parts .grp+.grp{margin-top:0}
.parts a{display:inline-flex;align-items:center;min-height:32px;text-decoration:none;touch-action:manipulation;
  font:800 12px/1.3 var(--caps);letter-spacing:.1em;text-transform:uppercase;color:#979daa;transition:color .6s ease}
.hero+.chapter{padding-top:clamp(72px,12vh,140px)}
main.wrap{transition:opacity .9s ease}
.away main.wrap{opacity:0;transition:opacity .45s ease}
/* the page shows once the quoted lines are in, so nothing moves after it appears */
html.wait main.wrap{opacity:0}

/* ---- sections ---- */
.chapter{padding-top:clamp(110px,20vh,230px);scroll-margin-top:0}
.chapter h2{font:800 clamp(30px,6.3vw,104px)/1.02 var(--caps);letter-spacing:.012em;text-transform:uppercase;
  background-image:var(--ombre-mark);background-size:220% 100%;animation:st-wordsweep 38s steps(190) infinite alternate;
  overflow-wrap:break-word}
.body{margin-top:clamp(36px,4.4vw,72px);max-width:66ch;color:var(--ink-3)}
.body>*+*{margin-top:1.05em}
.body em{font-style:italic}
.body strong{font-weight:700;color:var(--ink)}
.body a{color:var(--ice);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.22em;
  text-decoration-color:rgba(var(--blue),.55);transition:text-decoration-color .8s ease,color .8s ease}
.body sup{font-size:.66em;line-height:0;vertical-align:.5em;margin-left:.06em;color:var(--ink-2)}

/* the other writings: a title, then its own date or course lines, as the paper or letter gives them */
.piece .sub{margin-top:clamp(18px,2vw,30px);max-width:46ch;font:italic 500 clamp(16px,1.3vw,19px)/1.7 var(--sans);color:var(--ink-2)}
.piece .meta{margin-top:clamp(16px,1.6vw,24px)}
.body::after{content:"";display:block;clear:both}
.body>.subhead{margin-top:2.2em;font:800 12px/1.3 var(--caps);letter-spacing:.1em;text-transform:uppercase;color:#a9c6f7}
.body>.subhead+*{margin-top:1em}
.list{list-style:none;padding:0}
.list li{padding-left:1.9em;text-indent:-1.9em}
.list li+li{margin-top:.35em}
.list .num{display:inline-block;width:1.9em;text-indent:0;color:var(--ink-2);font-variant-numeric:tabular-nums}
ul.list li{padding-left:0;text-indent:0}

/* Evan likes hip hop: the spreadsheet's tabs, then a row of names, then that name's list.
   Changing either one fades the old list out, glides the space to the new list's height, and fades it in */
.switch>.picks{display:flex;flex-wrap:wrap;align-items:center;column-gap:22px;-webkit-user-select:none;user-select:none}
.switch>.picks button{display:inline-flex;align-items:center;min-height:32px;margin:0;padding:0;border:0;background:none;cursor:pointer;
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;
  font:800 12px/1.3 var(--caps);letter-spacing:.1em;text-transform:uppercase;color:#7b8293;transition:color .7s ease}
.switch>.picks button[aria-pressed="true"]{color:var(--ice);cursor:default}
.switch>.picks button:focus-visible{outline:1px solid var(--ice);outline-offset:4px}
.tabs>.picks{column-gap:28px}
.tabs>.picks button{min-height:40px;font-size:clamp(15px,1.3vw,18px);letter-spacing:.06em;color:#6f7687}
.tabs>.picks button[aria-pressed="true"]{color:#a9c6f7}
.tabs>.shown{margin-top:clamp(18px,2vw,28px)}
.chips>.shown{margin-top:clamp(22px,2.4vw,34px)}
.shown{transition:height .9s var(--fold)}
.shown.moving{overflow:hidden}
.panel{transition:opacity .9s ease}
.panel.off{opacity:0;transition:opacity .38s ease}
.names{columns:2;column-gap:24px}
.names li{break-inside:avoid;padding:.18em 0}
.rank{padding:0;list-style:none}
.rank li{display:grid;grid-template-columns:3.4em minmax(0,1fr);align-items:baseline;padding:.22em 0}
.rank .rk{font-size:13px;color:var(--ink-2);font-variant-numeric:tabular-nums}
.switch .subhead{margin:2em 0 .8em;font:800 12px/1.3 var(--caps);letter-spacing:.1em;text-transform:uppercase;color:#a9c6f7}
.switch .panel>.subhead:first-of-type{margin-top:0}
@media (hover:hover){.switch>.picks button:hover{color:var(--ice)}}

/* the quoted lines: a notch in, a size down, in italics like the paper */
.lyrics{margin:1.7em 0 1.7em 16px;font:italic 500 15.5px/1.68 var(--sans);color:var(--ink-3)}
.body>.lyrics+*{margin-top:0}
.lyrics .ln{display:block;padding-left:1.3em;text-indent:-1.3em}
.lyrics .gap{display:block;height:.55em}
.lyrics strong{font-weight:800;color:var(--ink)}
.lyr strong{font-weight:700;color:var(--ink)}
.miss{font:normal 600 10.5px/1 var(--sans);letter-spacing:.1em;text-transform:uppercase;color:#6a7182}
.lyrics .miss{display:block;line-height:1.68}

/* footnotes sit right under the paragraph they belong to */
.body>.note{margin-top:.8em;font-size:13px;line-height:1.55;color:var(--ink-2);overflow-wrap:anywhere}
.body>.lyrics+.note{margin-top:-.7em;margin-bottom:1.7em}
.note sup{color:var(--ink-2);margin:0 .2em 0 0}

/* the paper's last word */
.body>.call{margin-top:1.4em;font:600 clamp(22px,2.3vw,34px)/1.3 var(--sans);color:var(--ink);letter-spacing:-.005em}

.cites li{font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.cites li+li{margin-top:.7em}
.body>.cites{margin-top:1.6em}

/* ---- photographs ---- */
.plate{position:relative;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.body>.plate{margin:2.2em 0}
.body>.plate+*{margin-top:0}
/* the edges dissolve into the page, evenly on all four sides */
.plate img{width:100%;opacity:0;transition:opacity 1.6s ease;pointer-events:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 var(--feather),#000 calc(100% - var(--feather)),transparent),linear-gradient(180deg,transparent,#000 var(--feather),#000 calc(100% - var(--feather)),transparent);
  -webkit-mask-composite:source-in;
  mask-image:linear-gradient(90deg,transparent,#000 var(--feather),#000 calc(100% - var(--feather)),transparent),linear-gradient(180deg,transparent,#000 var(--feather),#000 calc(100% - var(--feather)),transparent);
  mask-composite:intersect}
.plate img.in{opacity:var(--dim,.94)}

/* ---- credits ---- */
.credits{position:relative;z-index:1;margin-top:clamp(110px,14vw,180px);background:var(--navy);border-top:1px solid var(--rule);
  padding-bottom:env(safe-area-inset-bottom)}
/* two lines, each led by its own mark in one shared column: the copyright sign, then the Index mark */
.credits-in{max-width:1680px;margin:0 auto;padding:18px var(--axis) 22px;display:flex;flex-direction:column;align-items:flex-start;gap:8px;
  font:500 12px/18px var(--sans);letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3)}
.credits .row{display:flex;align-items:flex-start;gap:8px;margin:0}
.credits .ic{flex:0 0 14px;width:14px;height:18px;display:grid;place-items:center;line-height:18px;letter-spacing:0}
/* the Index mark is drawn to the copyright sign's own circle: the script measures that sign in the loaded font
   and sets the mark's diameter (--c-d) and its place (--c-x, --c-y) to match */
.credits .ic svg{display:block;overflow:visible;position:relative;top:var(--c-y,0px);left:var(--c-x,0px);width:var(--c-d,10px);height:var(--c-d,10px)}
.credits a{text-decoration:none;color:var(--ice);transition:color 1.1s ease}
.parts a:focus-visible,.index-mark:focus-visible,.credits a:focus-visible,.body a:focus-visible{outline:1px solid var(--ice);outline-offset:4px}
@media (hover:hover){
  .credits a:hover,.parts a:hover,.outline a:hover{color:var(--ice)}
  .body a:hover{text-decoration-color:var(--ice)}
}

/* ---- wider windows: the pictures stand in the left column, beside the words they belong to ---- */
@media (min-width:960px){
  .hero{display:grid;grid-template-columns:minmax(0,var(--side)) minmax(0,1fr);column-gap:var(--gap);align-items:start}
  .hero>h2{grid-column:1/-1}
  .hero>.plate,.hero>.hero-side{margin-top:clamp(36px,4.4vw,72px)}
  .hero .plate{max-width:none}
  .hero .by{margin-top:0}
  .parts{display:flex;flex-direction:row;align-items:flex-start}
  .chapter{container-type:inline-size}
  .body{margin-left:calc(var(--side) + var(--gap))}
  .body>.plate{float:left;clear:left;width:31cqi;margin:1.4em 0 1.4em calc(-31cqi - var(--gap))}
  .body>.plate+*{margin-top:1.05em}
  .names{columns:3;column-gap:var(--gap)}
}
@media (min-width:1400px){.body{font-size:17.5px}}

/* scroll-linked motion, driven by the browser's own scroll position (nothing scripted):
   words rise and clear as they come into the window and thin out as they pass under the masthead,
   and each picture drifts a little against the page */
@supports (animation-timeline:view()){
  /* only what is near the window moves (the script marks it .live), so the phone never holds many moving layers */
  .body>p.live,h2.live{
    animation:rv-in linear both,rv-out linear forwards;
    animation-timeline:view(block 49px 0px),view(block 49px 0px);
    animation-range:entry 0px entry 190px,exit calc(100% - 110px) exit 100%}
  h2.live{animation-range:entry 0px entry 190px,exit 0% exit 100%}
  /* the italic lines only fade. Manrope has no italic, so the browser slants it, and moving slanted
     text by part of a pixel makes it double up */
  .body>.lyrics.live{animation:rv-in-still linear both,rv-out-still linear forwards;
    animation-timeline:view(block 49px 0px),view(block 49px 0px);
    animation-range:entry 0px entry 150px,exit calc(100% - 90px) exit 100%}
  .plate.live img{animation:plate-drift linear both;animation-timeline:view();animation-range:cover 0% cover 100%}
  /* what is not near the window is not painted at all; out of the window this is the same as fully faded */
  html.io .body>p:not(.live),html.io .body>.lyrics:not(.live),html.io .chapter h2:not(.live){opacity:0}
  html.io .body>.plate:not(.live){visibility:hidden}
  html.boot main.wrap{opacity:0}
}
@keyframes rv-in{from{opacity:0;translate:0 18px}to{opacity:1;translate:0 0}}
@keyframes rv-out{from{opacity:1;translate:0 0}to{opacity:0;translate:0 -12px}}
@keyframes rv-in-still{from{opacity:0}to{opacity:1}}
@keyframes rv-out-still{from{opacity:1}to{opacity:0}}
@keyframes plate-drift{from{translate:0 3%}to{translate:0 -3%}}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition-duration:.01s!important}
}
