/* Copenhagen studio, in cobalt. One type size, a strict 12-column grid, one giant word.
   Spacing system: every vertical gap is a whole number of text lines (--l). */
:root {
  --bg: #1d3ec7; --ink: #f4f3ef; --grey: rgba(244, 243, 239, .62); --rule: rgba(244, 243, 239, .26);
  --mark: #f4f3ef; --dot: #f2b630;
  --w: min(100vw, 170vh); /* never wider than 1.7x the screen height, so ultrawides keep the laptop composition */
  --g: clamp(16px, calc(var(--w) * .011), 28px);
  --pad: clamp(20px, calc(var(--w) * .014), 36px);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  --l: 1.4em;
  background: var(--bg); color: var(--ink);
  font: 400 clamp(13px, calc(var(--w) * .0068), 18px)/1.4 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .006em; -webkit-font-smoothing: antialiased;
  min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  width: 100%; max-width: var(--w); margin: 0 auto;
}
::selection { background: var(--ink); color: var(--bg); }
a { color: inherit; text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .6; }
a.on { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.g { color: var(--grey); }
img, video { display: block; width: 100%; height: 100%; object-fit: cover; }
ul, ol { list-style: none; }
.u { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; text-decoration-color: var(--grey); }
.u:hover { opacity: 1; text-decoration-color: var(--ink); }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); padding-left: var(--pad); padding-right: var(--pad); }

/* header and footer share the same four columns: 1, 4, 7, 10 */
.top { padding-top: var(--l); }
.top > * { grid-column: span 3; }
.top nav a { display: block; }
.top nav { grid-column: 10 / 13; }
.foot { padding-top: calc(var(--l) * .75); padding-bottom: var(--l); }
.foot > * { grid-column: span 3; }
.foot > :nth-child(2) { grid-column: 7 / 10; }

main.grid { flex: 1; row-gap: calc(var(--l) * 3); align-content: start; padding-top: calc(var(--l) * 6); padding-bottom: calc(var(--l) * 4); }
.copy p + p, .block p + p { margin-top: var(--l); }
.block .g + p { margin-top: 0; }
.fig .m { filter: grayscale(1); }

/* home: three equal three-column blocks under the header's 4th, 7th and 10th columns, centred between header and name */
.p-index main.grid { align-content: center; padding-top: calc(var(--l) * 2); padding-bottom: calc(var(--l) * 2); }
.intro { grid-column: 4 / 7; }
.index { grid-column: 7 / 10; }
.portrait { grid-column: 10 / 12; align-self: start; margin-top: .35em; } /* top edge sits on the cap height of the first text line */
.portrait .m { aspect-ratio: 4 / 5; }

/* about: fits one screen. Opening line on top, the four sections in a 2x2 under the home page's text columns,
   the photos as one small cluster where the home portrait sits. */
.p-about main.grid { align-content: center; row-gap: calc(var(--l) * 2); padding-top: calc(var(--l) * 2); padding-bottom: calc(var(--l) * 2); }
.p-about .lede { grid-column: 4 / 10; grid-row: 1; font-size: 2.1em; line-height: 1.16; letter-spacing: -0.022em; text-wrap: balance; }
.sec h2 { font: inherit; color: var(--grey); }
.sec ul { padding-right: 1em; }
.sec li + li { margin-top: calc(var(--l) * .2); }
.secs { grid-column: 4 / 10; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--g); row-gap: calc(var(--l) * 1.5); align-self: start; }
/* four single prints, each on its own, one column wide, whole (2:3 originals), set around the text */
.p-about .ph { width: 100%; height: auto; filter: grayscale(1); align-self: start; }
/* loosely scattered: different sizes and heights, never touching the text columns (4–9) */
.p-about .p1 { grid-column: 1 / 3; grid-row: 1 / 3; width: 46%; justify-self: start; margin-top: calc(var(--l) * -1.5); }
.p-about .p3 { grid-column: 2 / 4; grid-row: 1 / 3; width: 64%; justify-self: center; align-self: end; margin-bottom: calc(var(--l) * -2.5); }
.p-about .p2 { grid-column: 10 / 13; grid-row: 1 / 3; width: 44%; justify-self: end; margin-top: calc(var(--l) * 2.5); }
.p-about .p4 { grid-column: 10 / 12; grid-row: 1 / 3; width: 52%; justify-self: start; align-self: end; margin-bottom: calc(var(--l) * -.5); }

/* recommends: same footprint as home. Titles under the blurb column, author and type under the second column,
   one small picture where the portrait sits. */
.p-recommends main.grid { align-content: center; padding-top: calc(var(--l) * 2); padding-bottom: calc(var(--l) * 2); }
.recs { grid-column: 4 / 7; }
.recs li + li { margin-top: calc(var(--l) * .35); }
.recs a { display: block; }
.recs a:hover { opacity: 1; }
.recs .t { transition: opacity .15s; }
.recs:has(a.cur) a:not(.cur) .t { opacity: .55; }
.peek { grid-column: 7 / 9; align-self: start; margin-top: .35em; aspect-ratio: 16 / 9; } /* fixed frame, so the list never moves */
.peek img { width: 100%; height: 100%; object-fit: contain; object-position: left top; } /* shown whole, no crop, in colour */

/* contact: words and the list in the home page's two text columns; six single prints scattered around them, shown whole */
.p-contact main.grid { align-content: center; grid-template-rows: minmax(min(64vh, 620px), auto); padding-top: calc(var(--l) * 2); padding-bottom: calc(var(--l) * 2); }
.say { grid-column: 4 / 7; grid-row: 1; align-self: center; }
.how { grid-column: 7 / 10; grid-row: 1; align-self: center; }
.how li { display: grid; grid-template-columns: 1fr 2fr; }
.em { position: relative; }
.copied { position: absolute; left: 100%; margin-left: .6em; color: var(--dot); opacity: 0; transition: opacity .2s; white-space: nowrap; }
.copied.on { opacity: 1; }
.cp { grid-row: 1; height: auto; }
.c1 { grid-column: 1 / 3; width: 40%; justify-self: start; align-self: start; }
.c2 { grid-column: 2 / 3; width: 100%; justify-self: start; align-self: center; margin-top: calc(var(--l) * 2); }
.c3 { grid-column: 1 / 3; width: 46%; justify-self: center; align-self: end; }
.c4 { grid-column: 10 / 13; width: 74%; justify-self: end; align-self: start; margin-top: calc(var(--l) * 1); }
.c5 { grid-column: 10 / 12; width: 62%; justify-self: start; align-self: center; margin-top: calc(var(--l) * 3); }
.c6 { grid-column: 11 / 13; width: 40%; justify-self: end; align-self: end; }
.cp { filter: grayscale(1); }

/* giant word */
.mark { padding: 0 var(--pad); overflow: hidden; }
.mark h1 { font-weight: 500; color: var(--mark); letter-spacing: -0.055em; line-height: .74; white-space: nowrap; font-size: calc((var(--w) - 2 * var(--pad)) * .2679); /* = full width in Helvetica Neue, so it renders right on the first frame */ display: inline-block; padding-right: .055em; margin-left: -.04em; transform: translateY(.02em); }

@media (prefers-reduced-motion: reduce) { a, .copied, .recs .t { transition: none; } }

@media (max-width: 860px) {
  .top > *, .foot > *, .foot > :nth-child(2) { grid-column: span 6; }
  .top nav { grid-column: 7 / 13; }
  .foot { row-gap: calc(var(--l) * .5); }
  main.grid, .p-index main.grid, .p-recommends main.grid, .p-contact main.grid { padding-top: calc(var(--l) * 4); padding-bottom: calc(var(--l) * 3); row-gap: calc(var(--l) * 2); align-content: start; }
  .intro, .say { grid-column: 1 / 13; }
  .index { grid-column: 1 / 8; }
  .portrait { grid-column: 8 / 13; }
  .p-about main.grid { align-content: start; padding-top: calc(var(--l) * 3); }
  .p-about .lede { font-size: 1.6em; grid-column: 1 / 13; }
  .secs { grid-column: 1 / 13; grid-row: auto; grid-template-columns: 1fr; }
  /* phone: prints stand on their own between the sections, stepping left and right */
  .secs { display: contents; }
  .p-about .lede { grid-row: auto; grid-column: 1 / 13; order: 0; }
  .secs > .sec { grid-row: auto; grid-column: 1 / 13; }
  .p-about .ph, .p-about .p1, .p-about .p2, .p-about .p3, .p-about .p4 { grid-row: auto; width: 100%; margin: 0; align-self: start; justify-self: stretch; }
  .p-about .p1 { grid-column: 1 / 7; order: 1; }  .secs > .sec:nth-child(1) { order: 2; }
  .p-about .p2 { grid-column: 8 / 13; order: 3; } .secs > .sec:nth-child(2) { order: 4; }
  .p-about .p3 { grid-column: 3 / 9; order: 5; }  .secs > .sec:nth-child(3) { order: 6; }
  .p-about .p4 { grid-column: 7 / 12; order: 7; } .secs > .sec:nth-child(4) { order: 8; }
  .recs { grid-column: 1 / 13; }
  .recs:has(a.cur) a:not(.cur) .t { opacity: 1; }
  .peek { display: none; }
  .p-contact main.grid { grid-template-rows: none; }
  .say, .how { grid-column: 1 / 13; grid-row: auto; }
  .cp, .c1, .c2, .c3, .c4, .c5, .c6 { grid-row: auto; grid-column: span 4; width: 100%; margin: 0; align-self: start; justify-self: stretch; }
  .p-contact main.grid { row-gap: var(--g); }
  .p-contact .how { margin-bottom: var(--l); }
}
