@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(fonts/plex-mono-400.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(fonts/plex-mono-500.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 700; font-display: swap; src: url(fonts/plex-mono-700.woff2) format('woff2'); }

:root { --ink: #000; --page: #f4eedd; --body: clamp(12px, min(1.05vw, 1.75vh), 19px); --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace; --small: clamp(14px, 1.05vw, 21px); --gutter: 1.75vw; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font-family: var(--mono); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
a { color: inherit; text-underline-offset: .25em; }
a:hover { text-decoration-thickness: 2px; }
.site-head { display: flex; justify-content: space-between; align-items: flex-start; padding: var(--gutter); font-size: var(--small); line-height: 1.2; }
.site-head a { text-decoration: none; }
.site-head nav { display: flex; gap: 2.2em; padding-top: .25em; }
.site-head nav a:hover { text-decoration: underline; }

.project { flex: 1; display: grid; grid-template-columns: minmax(0, 4.8fr) minmax(0, 7.2fr); column-gap: 3vw; align-content: start; padding: 3vh var(--gutter) 2vh; font-size: var(--small); line-height: 1.6; }
/* Left column: all the text, which scrolls. Right column: the website preview, which stays where it is. */
.info { display: contents; }
.head { grid-column: 1; grid-row: 1; }
.blurb { grid-column: 1; grid-row: 3; margin-top: 4vh; }
.head .back { display: inline-block; margin-bottom: 3vh; }
.head h1 { font-weight: 400; font-size: clamp(26px, min(3.6vw, 6vh), 84px); line-height: 1; letter-spacing: -.02em; margin: 0 0 .5em; overflow-wrap: anywhere; }
.tags { margin: 0 0 2.2vh; font-weight: 500; }
.facts { margin: 0 0 2.4vh; padding: 0; display: grid; gap: .3em; }
.facts div { display: grid; grid-template-columns: 6em 1fr; gap: 1em; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
.blurb p { margin: 0 0 .8em; max-width: 60em; font-size: var(--body); line-height: 1.6; }
.visit { display: inline-block; margin: .4em 0 2.4vh; padding: .6em 1.1em; border: 1px solid #000; text-decoration: none; transition: background .2s, color .2s; }
.visit:hover { background: #000; color: var(--page); }

/* pinned just below the top of the window, so it sits in the middle of the space above the project strip */
.browser { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: 11vh; align-self: start; width: 100%; margin: 0; border: 1px solid #000; background: #fff; }
.browser .bar { display: flex; align-items: center; gap: .8em; padding: .6em .9em; border-bottom: 1px solid #000; font-size: var(--small); background: var(--page); }
.browser .dots { display: flex; gap: .35em; }
.browser .dots i { width: .75em; height: .75em; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.browser .dots i:nth-child(1) { background: #ff5f57; }
.browser .dots i:nth-child(2) { background: #febc2e; }
.browser .dots i:nth-child(3) { background: #28c840; }
.browser .url { flex: 1; text-align: center; }
.viewport { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #fff; }
.viewport iframe { position: absolute; left: 0; top: 0; width: 1440px; height: 900px; border: 0; transform-origin: 0 0; }
.viewport .soon { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 2em; font-size: var(--small); }


@media (max-width: 860px) {
  :root { --gutter: 18px; }
  .site-head nav { gap: 1.2em; }
  .project { grid-template-columns: 1fr; row-gap: 2vh; }
  .head { position: static; grid-row: auto; }
  .head .back { margin-bottom: 4vh; }
}

/* Top-left ZC mark (same as the home page, turning with the scroll) */
.brand-mark { display: block; }
.brand-mark .zc { display: block; height: 2.4em; width: auto; overflow: visible; }

/* Project strip: all four projects, arrows at either edge of the page */
/* no background at all: only the logos and arrows float over the page */
.more { position: sticky; bottom: 0; z-index: 5; background: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2vw; padding: 1.4vh var(--gutter) var(--gutter); }
.arrow { font-size: clamp(30px, 3.4vw, 64px); line-height: 1; text-decoration: none; padding: .1em .25em; transition: transform .25s ease; }
.arrow:first-child:hover { transform: translateX(-.15em); }
.arrow:last-child:hover { transform: translateX(.15em); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1vw; width: 100%; max-width: 600px; margin: 0 auto; }
.tile { display: block; aspect-ratio: 2 / 1; padding: .2em; text-decoration: none; opacity: .6; transition: opacity .25s; }
.logo { display: block; width: 100%; height: 100%; background: var(--logo) center / contain no-repeat; }
.tile:hover, .tile[aria-current="page"] { opacity: 1; }

/* Arriving: content rises in and the strip slides up from the bottom. Moving between projects slides the page sideways (see transition.js). */
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes slide-up { from { transform: translateY(110%); } }
.head, .blurb, .case { animation: rise .8s cubic-bezier(.2, .7, .2, 1) .15s backwards; }
.browser { animation: rise .9s cubic-bezier(.2, .7, .2, 1) .3s backwards; }
.more { animation: slide-up .9s cubic-bezier(.2, .7, .2, 1) .45s backwards; }
/* In the transition preview everything must be in place well before the C has finished growing. */
.in-iris .head, .in-iris .blurb, .in-iris .case { animation-duration: .5s; animation-delay: 0s; }
.in-iris .browser { animation-duration: .55s; animation-delay: .06s; }
.in-iris .more { animation-duration: .55s; animation-delay: .12s; }
.no-enter .head, .no-enter .blurb, .no-enter .case, .no-enter .browser, .no-enter .more { animation: none; }
@media (prefers-reduced-motion: reduce) { .head, .blurb, .case, .browser, .more { animation: none; } }
@media (max-width: 860px) {
  .more { gap: 8px; }
  .tiles { gap: 8px; }
  .tile { font-size: 10px; padding: .3em; }
  .arrow { padding: 0 .1em; }
}

/* Both project pages sit in the same cell while one slides in and the other out; the strip below never moves. */
.pages { flex: 1; display: grid; overflow-x: clip; }
.pages > .project { grid-area: 1 / 1; min-width: 0; }

/* Static preview: shown instead of the live iframe on phones and tablets, where a scaled 1440px page is unreadable and slow. */
.shot { display: none; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  .viewport iframe { display: none; }
  .shot { display: block; position: absolute; inset: 0; }
}

/* The project in short: same column and type size as the paragraphs above it */
.case { grid-column: 1; grid-row: 2; margin-top: 4vh; font-size: var(--body); line-height: 1.6; }
.case-cols { display: grid; gap: .7em; margin: .7em 0 0; }
.case-cols > div { display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 1em; }
.case p { margin: 0; }
.label { margin: 0; font-weight: 700; font-size: var(--body); }
@media (max-width: 860px) {
  :root { --small: 15px; --body: 15px; }
  .case { margin-top: 4vh; }
  .case-cols > div { grid-template-columns: 1fr; gap: .2em; }
  .site-head nav { gap: .8em; }
  .browser { margin-top: 4vh; }
}
@media (hover: none) { .arrow:hover, .arrow:first-child:hover, .arrow:last-child:hover { transform: none; } }

/* Phones and narrow windows: one column, in reading order (kept last so it beats the desktop placement above) */
@media (max-width: 860px) {
  .project { grid-template-columns: 1fr; row-gap: 2vh; }
  .head { position: static; grid-column: 1; grid-row: auto; }
  .blurb, .case, .browser { grid-column: 1; grid-row: auto; margin-top: 4vh; }
  .head { order: 1; } .case { order: 2; } .blurb { order: 3; } .browser { order: 4; position: relative; top: auto; }   /* top: auto cancels the desktop pin offset, which was pushing it down past the page end */
  .project { padding-bottom: 4vh; }
}
