/* Evan Lynch portfolio.
   One column on a white page. Home is a one-sentence intro, then project rows that
   alternate image and text, each with a See more button. Project pages open on a
   one-sentence headline and four facts, then images and short sections.
   Fonts unchanged: Libre Caslon Text for headlines, Hanken Grotesk for everything else. */

:root {
  --bg: #ffffff;
  --ink: #111214;
  --ink-2: #474a51;
  --muted: #74777e;
  --line: #e7e7e4;
  --plate: #f3f3f0;

  --serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --max: 1160px;
  --pad: 40px;
  --measure: 680px;
  --phone-radius: 12% / 5.6%;
  --shadow: 0 1px 2px rgba(17, 18, 20, .06), 0 10px 28px rgba(17, 18, 20, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; padding: 8px 12px; border-radius: 6px; background: var(--ink); color: #fff; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(var(--pad), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad), env(safe-area-inset-right, 0px));
}

/* Header */
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 28px; font-size: 15px; }
.top .name { font-weight: 600; text-decoration: none; }
.top nav { display: flex; gap: 24px; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* Home: intro */
.hero { padding: 120px 0 144px; }
.hero h1 { max-width: 20.5em; font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1.2; letter-spacing: -0.012em; text-wrap: balance; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 28px; color: var(--muted); font-size: 15px; }

/* Home: project rows */
.work { display: grid; gap: 168px; scroll-margin-top: 56px; } /* the Work link lands with a little white space above the first project */
.row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; align-items: center; }
.row.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.row.flip .text { order: 2; }
.text { display: grid; gap: 14px; justify-items: start; align-content: start; max-width: 25rem; }
.kicker { color: var(--muted); font-size: 14px; }
.row h2 { font: 500 28px/1.2 var(--sans); letter-spacing: -0.01em; }
.text p:not(.kicker) { color: var(--ink-2); }
.btn { display: inline-block; margin-top: 10px; padding: 11px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; line-height: 1; text-decoration: none; }
.btn:hover { background: #2f3137; }
.media { display: block; }


/* Image plates */
.plate { position: relative; display: flex; align-items: center; justify-content: center; gap: 5%; padding: 7% 6%; border-radius: 3px; background: var(--plate); }
.media .plate { aspect-ratio: 5 / 4; }
.plate .phone { width: 31%; }
.plate.three .phone { width: 25%; }
.plate .popup { width: 36%; }
.phone { border-radius: var(--phone-radius); box-shadow: var(--shadow); }
.popup { border-radius: 10px; box-shadow: var(--shadow); }
.shot { border-radius: 10px; box-shadow: var(--shadow); }
.shot.square { border-radius: 4px; }
.browser { width: 100%; overflow: hidden; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.media .browser { width: 90%; }
.browser .bar { display: flex; gap: 6px; align-items: center; height: 24px; padding: 0 11px; border-bottom: 1px solid var(--line); }
.browser .bar i { width: 7px; height: 7px; border-radius: 50%; background: #d8d8d4; }
.plate .lab { position: absolute; top: 16px; left: 20px; color: var(--muted); font-size: 14px; }

/* A grid of screens on a plate. --n per row, each at most --w wide. */
.plate.screens {
  display: grid;
  grid-template-columns: repeat(var(--n, 3), minmax(0, var(--w, 250px)));
  justify-content: center;
  align-items: start;
  gap: 28px;
  padding: 48px 40px;
}
.plate.screens.six { gap: 16px; padding: 48px 28px 32px; }
.plate.screens > * { min-width: 0; }
.plate.screens img { width: 100%; }
.plate.screens a { display: block; }
/* Lightbox (lightbox.js): a screen opened large over the dimmed, blurred page */
.zoomable { cursor: zoom-in; }
img.zoomable:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.lightbox { position: fixed; inset: 0; z-index: 100; cursor: zoom-out; }
.lightbox:focus { outline: none; }
.lightbox-shade { position: absolute; inset: 0; background: rgba(17, 18, 20, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.lightbox-img { position: absolute; max-width: none; transform-origin: 0 0; box-shadow: 0 24px 80px rgba(0, 0, 0, .35); will-change: transform; }
.plate.screens figure { display: grid; gap: 10px; align-content: start; }
.plate.screens figcaption { color: var(--muted); font-size: 14px; line-height: 1.4; }

/* Project pages */
.page-head { display: grid; gap: 18px; padding: 104px 0 56px; }
.page-head h1 { max-width: 23em; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.22; letter-spacing: -0.01em; text-wrap: balance; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 32px; margin-top: 30px; font-size: 15px; line-height: 1.5; }
.facts dt { margin-bottom: 4px; color: var(--muted); }
.facts dd { margin: 0; }
.section .facts { margin-top: 0; }

.fig { display: grid; gap: 14px; }
.fig .plate + .plate { margin-top: 2px; }
.film { width: 100%; aspect-ratio: 16 / 9; border-radius: 3px; background: var(--plate); }
.note { color: var(--muted); font-size: 14px; }

.section { display: grid; gap: 28px; margin-top: 128px; }
.section h2 { max-width: 22em; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.25; letter-spacing: -0.008em; text-wrap: balance; }
.prose { display: grid; gap: 16px; max-width: var(--measure); }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { display: grid; gap: 8px; padding-left: 1.1em; }
.prose h3 { color: var(--ink); }
.prose.tight { gap: 8px; }

.points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 56px; max-width: 900px; }
.points.three { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; }
.points > div { display: grid; gap: 6px; align-content: start; }
.points p { color: var(--ink-2); }
.points h3, .prose h3 { font: 600 17px/1.4 var(--sans); }
/* A subhead inside a section (About: the process and the rules): a step above the titles under it. */
.section h3.subhead, .sub > .prose > h3 { font: 600 20px/1.35 var(--sans); color: var(--ink); }
.sub > .prose { gap: 8px; }
.rules { display: grid; gap: 20px; }

.subs { display: grid; gap: 80px; }
.sub { display: grid; gap: 24px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 32px; }
.stats div { display: grid; gap: 6px; align-content: start; }
.stats b { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 14px; line-height: 1.45; }


/* Case study cards on the Reps page */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 32px; }
.card { display: grid; gap: 24px; align-content: start; }
.card h3 { font: 500 28px/1.2 var(--sans); letter-spacing: -0.01em; }

.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 56px; max-width: 900px; }
.cols2 > div { display: grid; gap: 10px; align-content: start; }
.cols2 h3 { font: 600 17px/1.4 var(--sans); }
.cols2 ul { display: grid; gap: 6px; padding-left: 1.1em; color: var(--ink-2); }

.next { display: grid; gap: 10px; margin-top: 144px; padding-top: 40px; border-top: 1px solid var(--line); }
.next a { font-family: var(--serif); font-size: 30px; line-height: 1.25; letter-spacing: -0.008em; text-decoration: none; }
.next a:hover { text-decoration: underline; }

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pair figure { display: grid; gap: 10px; }
.pair figcaption { color: var(--muted); font-size: 14px; }
.pair.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Origin page: short sections, the two level cards, players' comments */
.section.first { margin-top: 32px; }
.stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Before/after slider (origin page): drag anywhere on the picture (media.js sets --p from 0 to 1);
   the hidden range keeps it usable from the keyboard. */
.compare { position: relative; overflow: hidden; border-radius: 4px; background: var(--plate); box-shadow: var(--shadow); cursor: ew-resize; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.compare img { width: 100%; pointer-events: none; -webkit-user-drag: none; }
.compare-top { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--p) * 100%) 0 0); }
.compare-range { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); border: 0; white-space: nowrap; }
.compare-handle { position: absolute; top: 0; bottom: 0; left: calc(var(--p) * 100%); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 12px rgba(17, 18, 20, .35); pointer-events: none; }
.compare-handle::after { content: ""; position: absolute; top: 50%; left: 50%; box-sizing: border-box; width: 52px; height: 52px; margin: -26px 0 0 -26px; border: 2.5px solid #fff; border-radius: 50%; background: rgba(17, 18, 20, .38) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 7.5 4.5 12 9 16.5M15 7.5l4.5 4.5-4.5 4.5'/%3E%3C/svg%3E") center / 23px no-repeat; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 4px 18px rgba(17, 18, 20, .3); transition: transform .15s ease; }
.compare.is-dragging .compare-handle::after { transform: scale(1.06); }
.compare-range:focus-visible ~ .compare-handle::after { outline: 2px solid #fff; outline-offset: 3px; }

/* Software collage (origin page): app windows overlapping like a desktop. Each image sets its own
   --l/--t/--w (percent of the box) and --r (tilt); on phones they fall into a 2x2 grid of tilted cards. */
.collage { position: relative; aspect-ratio: 1080 / 480; }
.section.after-collage { margin-top: 80px; }
.collage img { position: absolute; left: var(--l); top: var(--t); width: var(--w); box-shadow: 0 2px 4px rgba(17, 18, 20, .1), 0 14px 34px rgba(17, 18, 20, .2); transform: rotate(var(--r)); transition: transform .2s ease; }
.collage img:hover { z-index: 5; transform: rotate(0deg) scale(1.04); }
@media (max-width: 640px) {
  .section.after-collage { margin-top: 64px; }
  .collage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 16px 14px; aspect-ratio: auto; }
  .collage img { position: static; width: 100%; transform: rotate(calc(var(--r) * .6)); }
}

/* Players' comments (origin page): the real comment cards from the game, scattered a little */
.section.near { margin-top: 40px; }
.section > .spaced { margin-top: 44px; }
.comment-wall { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 20px; margin: 0 -40px; padding: 6px 0 20px; }
.comment-wall img { width: 100%; border-radius: 8px; box-shadow: 0 2px 4px rgba(17, 18, 20, .08), 0 12px 30px rgba(17, 18, 20, .16); transform: translate(var(--x), var(--y)) rotate(var(--r)); transition: transform .2s ease; }
.comment-wall img:hover { transform: translate(var(--x), var(--y)) rotate(0deg) scale(1.02); }
@media (max-width: 640px) {
  .section.near { margin-top: 32px; }
  .comment-wall { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .comment-wall img { width: 94%; transform: translateX(calc(var(--x) * .25)) rotate(calc(var(--r) * .6)); }
}

/* About */

/* About: the build process as four picture cards */
.process { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; padding: 0; list-style: none; }
.process li { display: grid; gap: 12px; align-content: start; }
.process img { width: 100%; aspect-ratio: 4 / 3; border-radius: 4px; }
.process p { font-weight: 600; font-size: 15px; }
.process p span { margin-right: 8px; color: var(--muted); font: 400 18px/1 var(--serif); }
@media (max-width: 980px) { .process { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* About: one aligned list, labels left, years at the right edge */
.cv { display: grid; max-width: 900px; border-top: 1px solid var(--line); }
.cv-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cv-row h2 { color: var(--muted); font: 400 15px/27px var(--sans); }
.cv-row ul { display: grid; gap: 6px; padding: 0; list-style: none; }
.cv-row li { display: flex; justify-content: space-between; gap: 24px; }
.cv-row li span:last-child:not(:first-child) { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) { .cv-row { grid-template-columns: minmax(0, 1fr); } }
/* About: the intro, with a portrait at the right (above the text on narrow screens) */
.intro { grid-template-columns: minmax(0, 1fr) 280px; column-gap: 64px; align-items: start; }
.intro-text { display: grid; gap: 18px; grid-row: 1; grid-column: 1; }
.intro-text .btn { justify-self: start; }
.portrait { grid-row: 1; grid-column: 2; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; }
@media (max-width: 860px) {
  .intro { grid-template-columns: minmax(0, 1fr); }
  .intro-text { grid-row: 2; }
  .portrait { grid-column: 1; width: 150px; }
}

/* Footer */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 168px; padding: 28px 0 48px; border-top: 1px solid var(--line); font-size: 15px; }
.foot a { color: var(--ink-2); }
.foot .links { display: flex; flex-wrap: wrap; gap: 20px; }

@media (max-width: 980px) {
  .hero h1 { font-size: 38px; }
  .work { gap: 104px; }
  .row, .row.flip { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .row .text, .row.flip .text { order: 2; }
  .facts, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comment-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
}

@media (max-width: 640px) {
  :root { --pad: 20px; }
  body { font-size: 16px; }
  .top { padding-top: 20px; }
  .hero { padding: 64px 0 80px; }
  .hero h1 { font-size: 30px; line-height: 1.22; }
  .work { gap: 80px; scroll-margin-top: 28px; }
  .row h2, .card h3 { font-size: 24px; }
  .media .plate { aspect-ratio: 1 / 1; }
  .plate.three .phone { width: 36%; }
  .plate.three .phone:nth-child(3) { display: none; }
  .page-head { padding: 56px 0 36px; }
  .page-head h1 { font-size: 28px; line-height: 1.25; }
  .facts { gap: 16px 20px; font-size: 14px; }
  .section { gap: 22px; margin-top: 80px; }
  .section h2 { font-size: 24px; }
  .subs { gap: 56px; }
  .points, .points.three, .cols2 { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .plate.screens { gap: 12px; padding: 32px 14px 20px; }
  .section h3.subhead, .sub > .prose > h3 { font-size: 18px; }
  .plate.screens.six { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 40px 14px 20px; }
  .plate.screens.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats b { font-size: 28px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .next { margin-top: 96px; }
  .next a { font-size: 24px; }
  .foot { margin-top: 104px; }
}
