/* noahglynn.com. Look taken from youlikemodernart.com: white page, black ink,
   browser-blue links, Arial at 13px, Georgia for page titles, pale rules,
   one 12-column grid (12 x 100px, 16px gutters, 32px margins at 1440). */

:root {
  --ink: #000;
  --secondary: #595959;
  --link: #0000ee;
  --visited: #551a8b;
  --rule: #c9c9c4;
  --field: #f5f5f5;
  --gap: 16px;
  --margin: 32px;
  --max: 1376px;
  --sans: Arial, Helvetica, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 13px/18px var(--sans);
}
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:visited { color: var(--visited); }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.skip, .visually-hidden { position: absolute; left: -9999px; }
.skip:focus { left: var(--margin); top: 8px; }

.page {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  max-width: calc(var(--max) + 2 * var(--margin));
  padding: 56px var(--margin) 96px;
}

/* Header: rail, Dan-style lines, aside */
.rail { grid-column: 1 / 3; font-weight: 700; }
.rail a { color: var(--ink); text-decoration: none; }
.lines { grid-column: 3 / 8; line-height: 24px; }
.lines p { margin: 0; min-height: 24px; }
.lines .label::after { content: ": "; }
.aside { grid-column: 10 / 13; line-height: 24px; }
.aside p { margin: 0; }

/* Index */
.groups { grid-column: 3 / 13; margin-top: 64px; border-top: 1px solid var(--rule); }
.group { display: block; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--rule); cursor: pointer; list-style: none; }
.group-head::-webkit-details-marker { display: none; }
.group-head h2::before { content: "+"; display: inline-block; width: 16px; color: var(--secondary); }
.group[open] > .group-head h2::before { content: "\2212"; }
.group-head:hover h2 { color: var(--link); }
.group[open] > .rows { margin-bottom: 40px; }
.group-head h2 { font: inherit; margin: 0; }
.group-head .count { color: var(--secondary); font-size: 11px; }
.group-note { margin: 16px 0 4px; max-width: 60ch; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); column-gap: var(--gap); padding: 9px 0; border-bottom: 1px solid #ececea; }
.row .date { grid-column: 1; color: var(--secondary); font-size: 11px; }
.row .title { grid-column: 2 / 5; }
.row .what { grid-column: 5 / 9; }
.row .where { grid-column: 9 / 11; text-align: right; color: var(--secondary); font-size: 11px; overflow-wrap: anywhere; }

/* Work page. One grid with the index: the page's 12 columns (100px at 1440, 16px gutters).
   The sheet takes them over as a subgrid, so every edge below is a page column edge.
   Desktop: labels hang in the name's column (1-2), as Experimental Jetset hangs its labels at
   the margin; the description reads in 3-6, a 15px measure of about 60 characters; the images
   fill 7-12, from the page's midpoint to its right margin (Loyal, Jasper Morrison).
   Vertical steps are multiples of 6px, the unit the 18px and 24px leadings share. */
.crumbs { grid-column: 3 / 13; display: flex; justify-content: space-between; gap: 16px; }
.count-nav { display: flex; gap: 12px; }
.count-nav .of, .off { color: var(--secondary); }
.sheet { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: start; margin-top: 60px; }
.sheet::before { content: ""; grid-column: 3 / -1; grid-row: 1; border-top: 1px solid var(--rule); margin-bottom: 23px; }
.sheet-head, .sheet-text, .sec { display: grid; grid-template-columns: subgrid; }
.sheet-head { grid-column: 1 / -1; align-items: baseline; padding-bottom: 30px; }
.sheet-head h1 { grid-column: 3 / -1; font: 38px/42px var(--serif); font-weight: 400; margin: 0; }
.sheet-text { grid-column: 1 / 7; grid-row: 2; }
.sheet-media { grid-column: 7 / -1; grid-row: 2; display: grid; grid-template-columns: subgrid; row-gap: 48px; padding-bottom: 48px; }
.sec { grid-column: 1 / -1; padding-bottom: 30px; }
.sec-label { grid-column: 1 / 3; font: inherit; line-height: 24px; margin: 0; }
.sheet-head .sec-label { color: var(--secondary); font-size: 11px; }
.sec > :not(.sec-label) { grid-column: 3 / -1; }
.summary { margin: 0; font-size: 15px; line-height: 24px; }
.info { line-height: 24px; }
.info p { margin: 0; display: grid; grid-template-columns: calc((100% - 3 * var(--gap)) / 4) minmax(0, 1fr); column-gap: var(--gap); }
.info .label { color: var(--secondary); }
.body p { font-size: 15px; line-height: 24px; margin: 0 0 18px; }
.body p:last-child { margin-bottom: 0; }
.ledger { list-style: none; margin: 0; padding: 0; line-height: 24px; }
.ledger li { display: grid; grid-template-columns: 24px 1fr; }
.ledger .n { color: var(--secondary); font-size: 11px; }
.ledger .here { font-weight: 700; }
.more { margin: 0; display: flex; justify-content: space-between; gap: 16px; }

/* Images: two across (3 columns each), three across from 10 images (2 each), one image across all 6.
   Each keeps its own proportions and carries its number; a click opens the full view. */
.grid { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; row-gap: 24px; align-items: start; list-style: none; margin: 0; padding: 0; }
.grid li { grid-column: span 3; }
.grid.three li { grid-column: span 2; }
.grid.one li { grid-column: 1 / -1; }
.grid a { display: block; color: var(--secondary); text-decoration: none; font-size: 11px; line-height: 18px; }
.grid a:hover span, .grid a:focus-visible span { color: var(--link); }
.grid img { display: block; width: 100%; height: auto; background: var(--field); margin-bottom: 6px; }
.demos { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; row-gap: 48px; }
.demos .demo { grid-column: span 2; }
.demo { margin: 0; }
/* The screen is .phone's padded content box in every engine: one grid cell whose tracks can't grow
   with a video's natural size (Safari overflowed a block .phone). Its background matches the
   frame so a sub-pixel edge never shows a light line. demo/scripts/phone_frame.py models this. */
.phone { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); aspect-ratio: 402 / 874; padding: 2.7%; border-radius: 16.4% / 7.55%; background: #1d1d1f; box-shadow: inset 0 0 0 1px #3a3a3c; }
.phone video { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 13.6% / 6.26%; background: #1d1d1f; }
.demo figcaption { margin-top: 12px; font-size: 13px; line-height: 20px; color: var(--secondary); max-width: 34ch; }

/* Without subgrid (older browsers), each level gets the same tracks itself: 12 for the sheet,
   6 for each half and what it holds. Same column edges, so the layout matches. */
@supports not (grid-template-columns: subgrid) {
  .sheet { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
  .sheet-text, .sheet-head, .sec, .sheet-media, .grid, .demos { grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: var(--gap); }
}

/* Full view: hidden until its address is opened; white, still, the number and the way out on top.
   A figure: margin 0 drops the browser's 1em 40px default, which inset the fixed box from the edges. */
.view { display: none; margin: 0; }
.view:target { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 18px; position: fixed; inset: 0; z-index: 10; background: #fff; padding: 24px var(--margin); }
.view-nav { display: flex; gap: 16px; }
.view-nav .of { color: var(--secondary); }
.view-nav .close { margin-left: auto; }
.view img { width: 100%; height: 100%; object-fit: contain; }

/* Contact page: title and facts */
.back { grid-column: 3 / 13; }
.work { grid-column: 4 / 10; margin-top: 82px; }
.work h1 { font: 38px/42px var(--serif); margin: 0 0 24px; padding-top: 24px; border-top: 1px solid var(--rule); font-weight: 400; }
.facts { margin: 0 0 24px; line-height: 24px; }
.facts p { margin: 0; }
.facts .label::after { content: ": "; }

footer.foot { grid-column: 3 / 13; margin-top: 96px; color: var(--secondary); font-size: 11px; }

@media (max-width: 899px) {
  .page { display: block; padding: 24px 20px 64px; }
  .rail { margin-bottom: 20px; }
  .aside { margin-top: 24px; }
  .groups { margin-top: 40px; }
  .group-note { margin: 12px 0 0; }
  .row { grid-template-columns: 56px 1fr; column-gap: 12px; row-gap: 2px; }
  .row .date { grid-column: 1; grid-row: 1; padding-top: 1px; }
  .row .title, .row .what, .row .where { grid-column: 2; text-align: left; }
  .row .where { display: none; }
  .work { margin-top: 32px; }
  .work h1, .sheet-head h1 { font-size: 30px; line-height: 34px; }
  /* Phones: title, then the images two across, then the text; labels above what they name */
  .sheet { display: flex; flex-direction: column; margin-top: 30px; }
  .sheet::before { order: -3; margin-bottom: 18px; }
  .sheet-text { display: contents; }
  .sheet-head { order: -2; }
  .sheet-media { order: -1; }
  .sheet-head, .sec, .sheet-media { display: block; }
  .sheet-head { padding-bottom: 24px; }
  .sheet-head .sec-label { display: block; margin-bottom: 6px; }
  .sheet-media { padding-bottom: 36px; }
  .sec { padding-bottom: 30px; }
  .grid, .demos { grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .grid li, .grid.three li, .demos .demo { grid-column: auto; }
  .grid.one li { grid-column: 1 / -1; }
  .info { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; line-height: 18px; }
  .info p { display: block; }
  .info .label { display: block; }
  .more { flex-direction: column; gap: 6px; }
  .view:target { padding: 18px 20px; }
}
