/* Case study pages. Loaded after each page's own styles, so this file wins.

   Same system as the home page (see site.css): one text size, colour for
   hierarchy, a 566px text column, figures that break out to 792px, sections
   64px apart with hairline rules. Screens and screenshots keep their own look. */

:root{
  --paper:#fff;
  --ink:#000;
  --muted:#a1a1a1;
  --hair:rgba(163,163,163,.28);
  --accent:#000;
  --blue:#000;
  --accent-bg:none;
  --grain:none;
  --ui:var(--sans);
  --wide:var(--col);
  --shell:var(--col);
  --edge:var(--gutter);
  --rail:0px;
}

html{overflow-x:clip}

body{
  max-width:none;
  background:var(--white);
  color:var(--text);
  font-family:var(--sans);
  font-size:14px;
  line-height:24px;
}

/* no paper grain, no tinted bands */
body::after,.frame::after,.demo::after,.media::after,
.tint::before,section.block.band::before{display:none !important}

main{
  max-width:calc(var(--wide) + 2 * var(--gutter));
  margin-inline:auto;
  padding:0 var(--gutter);
}

/* ---------- the column ---------- */

/* everything sits in the narrow text column unless it is listed as a figure */
.lede > *,
.stmt-in,.band-in,
main > .tldr,
section.block > *,
article.pattern > *,
.onward-wrap > *{
  width:auto;
  max-width:var(--col);
  margin-inline:auto;
}

/* figures and widgets break out to the full width */
section.block > :is(figure,.pile,.moments,.practice,.asks,.qmap,.qdetail,.shift,article.pattern),
article.pattern > .demo{
  max-width:none;
}

section.block{display:block;padding:0}
section.block > *{grid-column:auto}

/* ---------- rhythm ---------- */

main > section,
main > .tint > section{
  margin:var(--gap) 0 0;
  padding:0;
}

/* numbered sections open with a hairline the width of the text column */
main > section.block:has(> .act)::before,
main > .tint > section.block:has(> .act)::before{
  content:"";
  display:block;
  max-width:var(--col);
  height:var(--gap);
  margin-inline:auto;
  border-top:.5px solid var(--line);
}

main > section.block:not(:has(*)){display:none}

main > .lede{margin-top:0;padding-top:40px}

.prose p:not(:first-of-type),
section.block > p + p{margin-top:20px}

section.block > :is(figure,.pile,.moments,.versus,.practice,.asks,.qmap,.shift,.stakes,.side,article.pattern){margin-block:40px}
section.block > :last-child{margin-bottom:0}

/* ---------- type: one size, three colours ---------- */

main :is(h1,h2,h3,h4){
  font-size:14px;
  line-height:24px;
  font-weight:400;
  letter-spacing:0;
  color:var(--black);
}

.prose p,.prose .aside,.meta p,.brief-3 p,.took li,.did li{
  font-size:14px;
  line-height:24px;
  letter-spacing:0;
  color:var(--text);
}

.prose .aside{color:var(--grey)}

/* the statements that used to be set large: now simply black */
.stmt p,.band:not(.block) p,.thesis p,.prose .claim,.took b,.did b{
  font-size:14px;
  line-height:24px;
  letter-spacing:0;
  font-weight:400;
  color:var(--black);
}
.stmt p + p,.band:not(.block) p + p{margin-top:4px;color:var(--text)}

.prose .claim{margin-block:20px 0 !important}

/* small labels: sentence case, light grey, no tracking */
.label,.scr-tag,.side-tag{
  font-size:14px;
  line-height:24px;
  letter-spacing:0;
  text-transform:none;
  color:var(--grey);
}

/* inside figures, labels and captions are fine print */
figure .label,figcaption,figcaption.label,.frame .label,.demo .label,.pile .label,
.turn .label,.moments .label,.versus .label,.practice .label{
  font-size:12px;
  line-height:20px;
}

figcaption{color:var(--grey);margin-top:12px}

/* ---------- section names, hand lettered ---------- */

section.block > .act{
  position:static;
  display:flex;
  flex-direction:row;
  align-items:baseline;
  gap:10px;
  margin-bottom:20px;
}

.num{
  font-size:14px;
  line-height:24px;
  letter-spacing:0;
  color:var(--grey);
}

.act .label.hand{
  font-family:var(--hand);
  font-size:17px;
  line-height:24px;
  letter-spacing:.04em;
  color:var(--black);
}

section.block > h2 + p,
section.block > .act + p{margin-top:0}
section.block > h2{margin-bottom:8px}

/* ---------- top of the page ---------- */

.lede > .label{display:block}
.lede h1{margin:0 auto;max-width:var(--col)}
.lede .dek{margin:20px auto 0;font-size:14px;line-height:24px;color:var(--text)}

/* facts and the brief read as rows, label on the left */
.meta,.brief-3{
  display:block;
  margin-top:32px;
  padding:0;
  border-top:.5px solid var(--line);
}
.brief-3{margin-top:0;border-top:0}

.meta li,.brief-3 li{
  display:grid;
  grid-template-columns:118px minmax(0,1fr);
  gap:32px;
  padding:16px 0;
  border-bottom:.5px solid var(--line);
}

.meta .label,.brief-3 .label{margin:0;color:var(--grey)}

/* ---------- surfaces: flat and square, like the home page ---------- */

.frame,.demo,.scr.now{
  background:var(--wash);
  border:.5px solid var(--line);
  border-radius:0;
}

.scr.now .scr-tag{color:var(--grey)}
.scr.now .scr-q,.scr-q{font-size:14px;line-height:24px;color:var(--text)}

.band:not(.block),.stmt{
  background:none;
  color:var(--black);
  padding-inline:0;
  border-radius:0;
  overflow:visible;
}

.took,.did{margin-top:20px;gap:20px}

/* ---------- next project ---------- */

main > .onward-wrap{margin-top:var(--gap);padding:0;border:0}
.onward-wrap::before{
  content:"";
  display:block;
  max-width:var(--col);
  height:var(--gap);
  margin-inline:auto;
  border-top:.5px solid var(--line);
}

.onward,.all-work{text-align:left}
.onward .label{margin-bottom:0}
.onward h2{margin:0;max-width:none;color:var(--black)}
.onward p{max-width:none;margin:0;font-size:14px;line-height:24px;color:var(--text);text-align:left}
.onward:hover h2{
  color:var(--black);
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:4px;
}

.all-work{margin-top:20px;font-size:14px;line-height:24px}
.all-work a{color:var(--grey);border-bottom:0;padding:0}
.all-work a:hover{color:var(--black)}

/* ---------- small screens ---------- */

@media (max-width:560px){
  .meta li,.brief-3 li{grid-template-columns:88px minmax(0,1fr);gap:20px}
  .lede{padding-top:28px}
}

/* diagrams drop their colour; screens and screenshots keep theirs */
figure.iso,figure.oflow,figure.cube,.who-mark{filter:grayscale(1)}

.scr-q{max-width:var(--col)}

/* every other small label follows the same fine-print style */
.hint,.one-top,.card-top,.brief dt,.stat span,.c-lab,.cube-q,.s-tag,.three-cols .who{
  font-size:12px;
  line-height:20px;
  letter-spacing:0;
  text-transform:none;
  color:var(--grey);
}
.oflow-steps .s-tag{font-size:12px;line-height:20px;letter-spacing:0;text-transform:none}
.demo h4{font-size:14px;line-height:24px}

/* figures now share the text column, so wide grids fold down */
.moments,.asks:not(.two),.navfig-grid,.qdetail,.practice-grid{grid-template-columns:minmax(0,1fr)}
.oflow-steps,.flow{grid-template-columns:repeat(2,minmax(0,1fr))}
.moments,.asks:not(.two),.navfig-grid{row-gap:32px}
.who{grid-template-columns:minmax(0,1fr);justify-items:start;row-gap:24px}
.flow{row-gap:20px}
.navfig .scr-q{max-width:none}
.three-cols{grid-template-columns:minmax(0,1fr);row-gap:24px}

/* ---------- the opening: category, title, one-line summary ----------
   The one place a case study steps outside the single text size, so the
   title reads as the title. It gets room above and below to stand alone. */

main > .lede{padding-top:112px}

.lede > .label{display:block;margin-bottom:10px;color:var(--grey)}

main .lede h1{
  font-size:24px;
  line-height:32px;
  letter-spacing:-.015em;
  color:var(--black);
  text-wrap:balance;
}

.lede .dek{margin-top:12px;color:var(--text)}

.lede .meta{margin-top:112px}

@media (max-width:560px){
  main > .lede{padding-top:64px}
  main .lede h1{font-size:22px;line-height:30px}
  .lede .meta{margin-top:64px}
}

/* ---------- side notes and pop-ups live in the right margin ----------
   Explanations of underlined terms, and the pattern preview in the Adobe
   case study, sit outside the text column so they never cover it. Below
   1180px there is no margin to use, so notes open in place under the text. */

section.block,.practice{position:relative}

.note{
  padding:0;
  border-radius:0;
  background:none;
  box-shadow:none;
  font-size:12px;
  line-height:20px;
  color:var(--text);
}

@media (min-width:1180px){
  .note{
    left:calc(100% + 32px) !important;
    width:min(260px, calc((100vw - var(--col)) / 2 - 56px)) !important;
    margin:0;
    padding-left:14px;
    border-left:.5px solid var(--line);
  }

  .practice .peek{
    display:block;
    position:absolute;
    top:0;
    bottom:0;
    left:calc(100% + 32px);
    width:min(296px, calc((100vw - var(--col)) / 2 - 56px));
  }
}

@media (max-width:1179px){
  .note{
    position:static !important;
    display:none;
    width:auto !important;
    max-width:var(--col);
    margin:12px auto 4px;
    padding-left:14px;
    border-left:.5px solid var(--line);
    opacity:1;
    visibility:visible;
    transform:none;
  }
  .note.on{display:block}
  .practice .peek{display:none}
}

.lede .meta{margin-top:64px}

/* ---------- Vyasa: the current product, playing in the page ---------- */
figure.now{margin-block:32px 0}
.now-stage{
  position:relative;
  overflow:hidden;
  background:var(--wash);
  border:.5px solid var(--line);
}
.now-stage iframe{
  position:absolute;
  top:0;
  left:0;
  width:1280px;
  height:800px;
  border:0;
  transform-origin:top left;
}
.now-replay{
  appearance:none;
  background:none;
  border:0;
  padding:0;
  font:inherit;
  color:var(--text);
  cursor:pointer;
  text-decoration:underline;
  text-decoration-color:var(--line);
  text-decoration-thickness:1px;
  text-underline-offset:4px;
}
.now-replay:hover{color:var(--black);text-decoration-color:var(--black)}

/* thesis: research images and the game drawing are shown without colour */
.qd-img,.board-fig img,.board-fig svg{filter:grayscale(1)}

/* "next up", spelled in beads above the next project */
.onward .next-up{margin-bottom:14px}
.onward .next-up img{width:30px;height:30px}
.onward .next-up{gap:4px 18px}

/* ---------- progress: one small mark per section, in the left margin ---------- */

.rail{
  position:fixed;
  top:50%;
  left:20px;
  transform:translateY(-50%);
  z-index:40;
}

.rail ol{list-style:none;display:grid;gap:2px}

/* each mark is a short line with a generous area to click */
.rail a{display:block;width:24px;padding:6px 0}
.rail a::before{
  content:"";
  display:block;
  width:10px;
  height:1.5px;
  background:var(--grey);
  opacity:.55;
  transition:width .25s ease,background .25s ease,opacity .25s ease;
}
.rail a.past::before{background:var(--black);opacity:1}
.rail a.on::before{width:20px;background:var(--black);opacity:1}
.rail a:hover::before{width:20px;opacity:1}

.readbar{
  display:none;
  position:fixed;
  top:52px;
  left:0;
  right:0;
  height:1.5px;
  background:var(--black);
  transform:scaleX(0);
  transform-origin:left;
  z-index:79;
}

/* no room for the map: fall back to a line under the navbar */
@media (max-width:1179px){
  .rail{display:none}
  .readbar{display:block}
}

/* ---------- anchor lines ----------
   The standalone statements between sections. Read on their own, top to
   bottom, they give the arc of the case study. They are set at title size
   and indented, with a short dash in the indent beside the first line. */

main > .stmt,
main > .band:not(.block){
  position:relative;
  max-width:var(--col);
  margin:104px auto;
  padding:0 0 0 44px;
}

.stmt p:first-child,
.band:not(.block) p:first-child{
  font-size:24px;
  line-height:32px;
  letter-spacing:-.015em;
  color:var(--black);
  text-wrap:balance;
}

.stmt p + p,
.band:not(.block) p + p{
  margin-top:12px;
  font-size:14px;
  line-height:24px;
  color:var(--text);
}

/* the dash, level with the middle of the first line */
main > .stmt::before,
main > .band:not(.block)::before{
  content:"";
  position:absolute;
  left:0;
  top:16px;
  width:28px;
  height:1.5px;
  background:var(--black);
}

@media (max-width:560px){
  main > .stmt,
  main > .band:not(.block){margin-block:80px;padding-left:32px}
  .stmt p:first-child,
  .band:not(.block) p:first-child{font-size:20px;line-height:28px}
  main > .stmt::before,
  main > .band:not(.block)::before{top:14px;width:20px}
}
