/* mlwangart.com — May L. Wang
   Every value below comes from May's Cargo site (styles + measured computed values).
   Craft refinements from moment.com and bvincentlee.com are marked "ref:". */

:root {
  /* Colour — May's swatches */
  --bg: #f5f5f5;   /* the neutral grey baked into the Tava boards, so they sit on the page with no visible edge */
  --bar-bg: rgba(255, 255, 255, .85);
  /* Two text colours, as on apple.com: near-black for content, one grey for supporting lines */
  --fg-1: #1d1d1f;
  --fg-2: #1d1d1f;
  --fg-3: #6e6e73;
  --fg-4: #86868b;
  --fg-5: rgba(0, 0, 0, .25);
  --fg-sub: #6e6e73;  /* Design subtitles */
  --logo: #1d1d1f;
  --accent: #8f1618;                    /* May's red: her name + keywords */
  --link-blue: rgb(0, 136, 255);        /* "NYT-selected" on Benevolent */
  --border: rgba(0, 0, 0, .16);
  --fill-pill: rgba(120, 120, 120, .15);
  --fill-pill-on: rgba(120, 120, 120, .3);

  /* Type — Cargo fonts are licensed to Cargo only; system stand-ins (flagged for May) */
  --font-body: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;   /* Social */
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;   /* labels, as bvincentlee.com (system font, no download) */
  --font-display: "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont, Arial, sans-serif;   /* Diatype, Monument Grotesk */
  /* One scale for every page. Weights: 400 for reading, 500 for UI and titles, 600 for card names and the logo. */
  --text-h2: 2.4rem;     --lh-h2: 1.4;          /* page titles, About intro */
  --text-title: 1.6rem;                         /* card and section titles */
  --text-lead: 1.6rem;                          /* card subtitles, About paragraphs */
  --text-body: 1.4rem;   --lh-body: 1.4;        /* body, nav, CV rows */
  --text-caption: 1.2rem; --lh-caption: 1.3;    /* medium lines, labels, tags */
  --text-small: 1.05rem;                        /* hover caption detail */
  --text-nav: 1.2rem;
  --text-logo: 1.8rem;

  /* Media — May's media style */
  --media-radius: .4rem;
  --media-shadow: drop-shadow(.2rem .2rem .5rem rgba(0, 0, 0, .14));

  /* Layout */
  --page-pad: 5.6rem;  /* one side edge for bar, index, grid and work pages (72px at 1440, as on bvincentlee.com) */
  --page-w: 80%;
  --page-w-narrow: 55%;
  --gutter: 1rem;

  /* Motion — ref: moment.com + bvincentlee.com */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-std: cubic-bezier(.4, 0, .2, 1);
  --ease-exit: cubic-bezier(.4, 0, 1, 1);
  --t-color: .2s;
  --t-reveal: .7s;
}

/* Cargo's rem is fluid (0.9vw on desktop, 11.76px on phones). Percent bounds keep the user's font-size setting. */
html { font-size: clamp(73.5%, .9vw, 100%); -webkit-text-size-adjust: 100%; scroll-padding-top: 8rem; scroll-behavior: smooth; }
@media (max-width: 767px) { html { font-size: 73.5%; } :root { --text-h2: 1.6rem; --page-pad: 1.6rem; } }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg-2);
  font: 400 var(--text-body)/var(--lh-body) var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
h1, h2, p, figure, ul { margin: 0; }
ul { padding: 0; list-style: none; }
::selection { background: var(--accent); color: #fff; } /* ref: moment.com */

a { color: var(--fg-4); text-decoration: none; transition: color var(--t-color) var(--ease-std), text-decoration-color var(--t-color) var(--ease-std), opacity var(--t-color) var(--ease-std); }
a:active { opacity: .7; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--fg-5); } /* ref: bvincentlee.com */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--fg-1); }
  .prose a:hover { text-decoration-color: currentColor; }
}

.skip { position: absolute; left: 1rem; top: -10rem; z-index: 100; padding: .8rem 1.6rem; background: #fff; color: var(--fg-1); border-radius: .8rem; }
.skip:focus { top: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Site bar: one row at every width ---------- */
/* Frosted, borderless bar: a faint hairline instead of a rule, a tonal capsule for Playground, a solid one for About. */
.bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.4rem var(--page-pad);
  background: var(--bar-bg); box-shadow: 0 .1rem 0 rgba(0, 0, 0, .05);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  transition: transform .3s ease;
}
.bar.is-hidden { transform: translateY(-100%); box-shadow: none; }
.logo { font: 700 var(--text-logo)/1 var(--font-display); letter-spacing: -.03em; color: var(--logo); }
.nav { display: flex; align-items: center; gap: .4rem; }
.pill { padding: .6rem 1.3rem; border-radius: 99rem; font: 400 var(--text-nav)/1.4 var(--font-display); letter-spacing: -.005em; color: var(--fg-1); transition: background-color .2s ease, color .2s ease; }
.pill:not(.pill--solid) { background: var(--fill-pill); }   /* tonal button beside the solid About */
.pill:not(.pill--solid)[aria-current="page"] { background: var(--fill-pill-on); }
.pill--solid { background: var(--fg-1); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .pill:hover { font-weight: 500; }   /* light at rest, firmer under the pointer */
  .pill:not(.pill--solid):hover { background: var(--fill-pill-on); }
  .pill--solid:hover { background: #3a3a3c; }
}

@media (max-width: 767px) {
  .bar { padding: 1rem var(--page-pad); }
  .logo { font-size: 1.3rem; }
  .pill { font-size: 1.1rem; padding: .45rem 1rem; }
}

/* ---------- Page frame ---------- */
main { display: block; }
.page { padding: 3rem var(--page-pad); }
.page--case { padding: 8rem var(--page-pad) 4rem; }
.page--art { padding: 4rem var(--page-pad); }
.page--narrow { width: var(--page-w-narrow); margin: 0 auto; padding-inline: 3rem; }
@media (max-width: 767px) {
  .page, .page--narrow { width: auto; padding: 5.6rem var(--page-pad) 4rem; }
}

h2, .h2 { font: 500 var(--text-h2)/1.2 var(--font-display); letter-spacing: -.015em; color: var(--fg-1); text-wrap: balance; }
.caption { font: 400 var(--text-caption)/var(--lh-caption) var(--font-display); color: var(--fg-3); }  /* May used --fg-4 (2.8:1); darkened to pass AA */
.title { font: 500 var(--text-title)/1.3 var(--font-display); }
.ic { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em; }
.nohref { color: var(--link-blue); }           /* "NYT-selected": no link on May's site either */
.dim { color: rgba(0, 0, 0, .65); }
.fg { color: var(--fg-2); }
.sub { font-style: italic; color: var(--fg-sub); }
.prose p { text-wrap: pretty; }

/* ---------- Media ---------- */
.media { margin: 0; }
.media img, .media video, .media .ph {
  width: 100%; border: 0; border-radius: var(--media-radius);
  filter: var(--media-shadow); background: rgba(0,0,0,.03);
}
.media figcaption { margin-top: .8rem; text-align: left; }
.vid { position: relative; }
/* The poster is a responsive <img>; the loop sits over it and fades in once it plays. */
.vid > video { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; margin: 0; object-fit: cover; opacity: 0; transition: opacity .2s var(--ease-std); }
.vid.is-playing > video { opacity: 1; }
.art .plate .media .vid > video { width: 100%; max-height: none; }
.vid button {
  position: absolute; right: .8rem; bottom: .8rem; z-index: 2;
  display: grid; place-items: center; width: 3.2rem; height: 3.2rem; min-width: 24px; min-height: 24px;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.85); color: #000; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.vid button svg { width: 45%; height: 45%; }
.vid button .i-play { display: none; }
.vid button[aria-pressed="true"] .i-play { display: block; }
.vid button[aria-pressed="true"] .i-pause { display: none; }
.vid-link { position: absolute; inset: 0; z-index: 1; border-radius: var(--media-radius); }

/* ---------- Work index: the five-card collage from May's Cargo home, then Design, then Illustration ---------- */
.page--index { padding-top: 4rem; }
/* Cards keep the spots and tilts measured on mlwangart.com at 1440 (gallery 1295 x 585), scaled to the page width. Not draggable. */
.collage { position: relative; aspect-ratio: 1295 / 585; margin: 2rem 0 10rem; }
.collage-card { position: absolute; left: var(--x); top: var(--y); width: var(--w); rotate: var(--r); transition: scale .3s ease; }
@media (hover: hover) and (pointer: fine) { .collage-card:hover { z-index: 10 !important; scale: 1.03; } }   /* the hovered card comes to the front, over its inline stacking order */
.collage-card :is(img, video) { display: block; border-radius: 1rem; filter: drop-shadow(.2rem .4rem 1.2rem rgba(0, 0, 0, .16)); -webkit-user-drag: none; user-select: none; }
.collage-card .vid > video { border-radius: 1rem; }
.collage-card:first-child .vid button { right: auto; left: .8rem; }   /* its right corner sits under Cockroaches */
/* Chips as tabs (the site's earlier filter, ref: news-site section tabs): All, Design, Illustration on one hairline,
   the chosen one dark with a bar under it that glides to the next. They don't hide work: Design and Illustration
   jump to their set, All to the top of the work. The row sticks under the bar so the sets stay one click apart. */
.chips { position: sticky; top: 0; z-index: 40; display: flex; gap: 4rem; margin-bottom: 3.2rem; margin-inline: calc(-1 * var(--page-pad)); padding-inline: var(--page-pad); background: linear-gradient(var(--border), var(--border)) bottom / calc(100% - 2 * var(--page-pad)) 1px no-repeat, var(--bg); overflow-x: auto; scrollbar-width: none; transition: top .3s ease, background-size .6s var(--ease-std); }  /* in the page, the hairline keeps to the side padding */
.chips.is-stuck { background-size: 100% 1px, auto; }   /* stuck under the bar, it grows out from the centre to both edges: a second nav layer */
html:has(.bar:not(.is-hidden)) .chips { top: var(--bar-h, 6rem); }
.chip { padding: 1.2rem 0 1.4rem; font: 500 var(--text-body)/1.4 var(--font-display); color: var(--fg-3); white-space: nowrap; transition: color .3s var(--ease-out); }
.chip[aria-current="true"] { color: var(--fg-1); box-shadow: inset 0 -2px var(--fg-1); }
/* The underline moves edge by edge: the leading edge reaches the new chip first and the trailing edge follows,
   so the line stretches across and settles instead of sliding as a rigid block. */
.js .chips::before { content: ""; position: absolute; bottom: 0; left: var(--l, 0); right: calc(100% - var(--r, 0px)); height: 2px; border-radius: 1px; background: var(--fg-1); }
.js .chips.is-set::before { transition: left .5s var(--ease-out), right .5s var(--ease-out); }
.js .chips.to-right::before { transition-duration: .55s, .32s; transition-delay: .06s, 0s; }
.js .chips.to-left::before { transition-duration: .32s, .55s; transition-delay: 0s, .06s; }
.js .chip[aria-current="true"] { box-shadow: none; }
@media (hover: hover) and (pointer: fine) { .chip:not([aria-current]):hover { color: var(--fg-1); } }
@media (prefers-reduced-motion: reduce) { .js .chips.is-set::before, .js .chips.is-set { transition: none; } }
.work-set { margin-bottom: 8rem; }
.set-tag { display: block; margin: 0 0 1.2rem; font: 500 .93rem/1.6 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-1); }
@media (max-width: 767px) {
  .page--index { padding-top: 2.4rem; }
  .collage { margin: 1.2rem 0 5.6rem; }
  .collage-card :is(img, video), .collage-card .vid > video { border-radius: .6rem; }
  .collage-card .vid button { display: none; }   /* too small to tap at this size; the loops still stop off screen */
  .work-set { margin-bottom: 5.6rem; }
  .chips { gap: 2.4rem; margin-bottom: 2.4rem; }
  .chip { padding: 1rem 0 1.2rem; }
}

.masonry a { display: block; color: inherit; }
/* Every card names its work the same way (ref: bvincentlee.com): the name, then a short tag, under the image; with a mouse they sit over the image on hover (see the hover rules below). */
figcaption.tile-cap, .study-card .meta { display: grid; row-gap: .15rem; margin-top: 1.2rem; font-family: var(--font-display); color: var(--fg-1); }
.tile-cap .t, .study-card .title { margin: 0; font: 600 var(--text-body)/1.45 var(--font-display); letter-spacing: -.01em; color: var(--fg-1); }
.tile-cap .m, .study-card .sub { margin: 0; font: 400 1.3rem/1.4 var(--font-display); font-style: normal; color: var(--fg-1); }
.masonry .col { row-gap: 3.2rem; }

/* ---------- Artwork ---------- */
/* Art and text are one group, centred in the window with a fixed gap, so a tall poster doesn't leave a wide hole before the text. */
.art { display: grid; grid-template-columns: minmax(0, max-content) minmax(28rem, 40rem); justify-content: center; align-items: center; gap: 6.4rem; min-height: calc(100svh - 14rem); }  /* window minus bar (6rem) and page padding (8rem) */
.art .plate .media img, .art .plate .media video, .art .plate .media .ph { border: 0; border-radius: 0; width: auto; max-width: 100%; max-height: calc(100svh - 18rem); margin: 0; }
.art .plate .vid { width: fit-content; margin: 0; }
.art .text .caption { margin: 0 0 1.96rem; }
.art .credits { margin-top: 3.2rem; }
.slides { display: grid; gap: var(--gutter); }
.slides-nav { display: none; }
.js .slides .slide[data-hidden] { display: none; }
.js .slides-nav { display: flex; justify-content: center; align-items: center; gap: 1.6rem; color: var(--fg-3); font: 400 var(--text-caption)/1 var(--font-display); }
.slides-nav button { min-width: 24px; min-height: 24px; padding: .6rem 1rem; border: 0; border-radius: 1.6rem; background: var(--fill-pill); color: var(--fg-1); font: inherit; cursor: pointer; }
.js .slides .slide img { cursor: pointer; }
@media (max-width: 767px) {
  .page--art { padding-top: 4rem; }
  .art { grid-template-columns: 1fr; gap: 2.4rem; min-height: 0; }
  .art .plate .media img, .art .plate .media video { margin: 0; max-height: none; }
  .art .plate .vid { margin: 0; }
}

/* ---------- Design index: one card per case study (ref: bvincentlee.com) ---------- */
/* Cards measured on bvincentlee.com at 1440: 56px row gap; column gap is the site --gutter, as on Playground, 1028:560 image, 4px radius, no shadow, 12px to an 18px title, 17px line under it. */
.studies { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4.3rem var(--gutter); padding-top: 1rem; }
.work-set .studies { padding-top: 0; }  /* the chip row already spaces the grid, same as the masonry set */
.study-card { position: relative; display: grid; align-content: start; gap: .9rem; color: inherit; text-decoration: none; }
.study-card .media img { aspect-ratio: 1028 / 560; object-fit: cover; display: block; filter: none; }
.study-card .meta { margin-top: 0; }
a.study-card:focus-visible { outline-offset: .6rem; }
/* Hover on any card (mouse only): the card grows a touch, the visual brightens, and the name and tag
   appear over the bottom of the image on a soft shade. Touch screens show them under the image instead. */
@media (hover: hover) and (pointer: fine) {
  .masonry figure, .study-card { position: relative; }
  /* `scale` (not transform) so it stacks on the scroll reveal; the transition list keeps the reveal's. */
  .js :is(.masonry figure, .study-card) { transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out), scale .4s var(--ease-out); }
  .masonry .col, .studies { row-gap: var(--gutter); }
  figcaption.tile-cap, .study-card .meta {
    position: absolute; inset: auto 0 0; margin: 0; padding: 4.8rem 1.6rem 1.4rem;
    border-radius: 0 0 var(--media-radius) var(--media-radius);
    background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
    opacity: 0; transition: opacity .3s var(--ease-out); pointer-events: none;
  }
  .tile-cap :is(.t, .m), .study-card .meta :is(.title, .sub) { color: #fff; }
  .masonry figure:is(:hover, :focus-within) figcaption.tile-cap, .study-card:is(:hover, :focus-within) .meta { opacity: 1; }
  /* "Coming soon" turns into a frosted tag at the bottom right of the shade. */
  .study-card .meta .soon {
    position: absolute; right: 1.6rem; bottom: 1.4rem; padding: .4rem 1rem; border-radius: 99rem;
    font-size: var(--text-caption); line-height: 1.3; background: rgba(255,255,255,.2);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .masonry figure:hover, a.study-card:hover { scale: 1.006; }
  a.study-card .media :is(img, video), .masonry figure :is(img, video) { transition: filter .4s var(--ease-out), opacity .2s var(--ease-std); }
  a.study-card:hover .media :is(img, video), .masonry figure:hover :is(img, video) { filter: var(--media-shadow) brightness(1.06); }
}
@media (prefers-reduced-motion: reduce) { .masonry figure:hover, a.study-card:hover { scale: none; } }
@media (max-width: 767px) { .studies { grid-template-columns: 1fr; gap: 4rem; padding-top: 2rem; } }

/* ---------- Case study ---------- */
/* Layout ref: bvincentlee.com case pages: one centred 1040px column; title, one-line summary, labelled facts,
   the first visual, then the Overview under it, then the rest of the work. */
.page--case { max-width: calc(80rem + 2 * var(--page-pad)); margin-inline: auto; padding-top: 7.6rem; }
.case-head h1 { margin: 0; font: 600 3.4rem/1.1 var(--font-display); letter-spacing: -.025em; color: var(--fg-1); text-wrap: balance; }
.case-head .lede { margin: .9rem 0 0; font: 400 1.55rem/1.4 var(--font-display); color: var(--fg-1); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3.2rem 1.85rem; margin-top: 5rem; }
.fact h2, .case-overview .label { margin: 0 0 .6rem; font: 500 .93rem/1.35 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); }
.fact p { margin: 0; font: 400 1.24rem/1.5 var(--font-display); color: var(--fg-1); }
.case-hero { margin: 5rem 0 0; }
.board img { filter: none; border-radius: 0; background: none; }   /* boards carry the page grey: no card edge */
.case-overview { margin: 9.6rem 0 8rem; }
.case-overview p { max-width: 46rem; margin: 0 0 1.2rem; font: 400 1.32rem/1.55 var(--font-display); color: var(--fg-1); }
.case-overview .label { margin-bottom: 1.6rem; }
.stack { display: grid; gap: var(--gutter); margin-bottom: var(--gutter); }
/* Cargo "columnized": items are dealt into the shortest column (gen + site.js), so order matches the live site. */
.cols { display: flex; align-items: flex-start; gap: var(--gutter); margin-bottom: var(--gutter); }
.col { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gutter); }   /* one track no wider than the column, so a narrow phone column scales its images down */
.grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: var(--gutter); margin-bottom: var(--gutter); }
@media (max-width: 767px) { .page--case { padding-top: 4rem; } .case-head h1 { font-size: 2.8rem; } .facts { grid-template-columns: 1fr 1fr; gap: 2.4rem 1.6rem; margin-top: 3.2rem; } .case-hero { margin-top: 3.2rem; } .case-overview { margin: 5.6rem 0; } }

/* ---------- Playground ---------- */
.page--narrow > .cols { margin-top: 2.8rem; }
.page--play > p { max-width: 64rem; }

/* ---------- About ----------
   Two vertical lines only: the page edge (portrait, section labels) and the text column
   (lede, bio, CV entries). Plain type, no keyword colour. */
.about-page { padding: 8rem max(16.8rem, calc((100% - 112rem) / 2)); }   /* a narrower measure than the work pages */
.about, .cv-row { display: grid; grid-template-columns: 1fr 2fr; column-gap: 4rem; }   /* a wide text column, so every CV entry sits on one line */
.about { align-items: start; margin-bottom: 8rem; }
.about .media img, .about .media video { border-radius: var(--media-radius); }
.about-intro { max-width: 56rem; }
.about-lede { margin: 0 0 2.4rem; font: 400 var(--text-h2)/1.25 var(--font-display); letter-spacing: -.01em; color: var(--fg-1); text-wrap: balance; }
.about-intro p { margin: 0 0 1.4rem; font-size: var(--text-body); line-height: 1.55; }
.cv-row { padding: 2rem 0; border-top: 1px solid var(--border); }
.cv-row h2 { margin: 0; font: 400 var(--text-caption)/var(--lh-body) var(--font-display); color: var(--fg-3); }   /* labels step back; the entries carry the row */
.cv-row ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; font-size: var(--text-caption); color: var(--fg-1); }
.cv-row li { display: flex; justify-content: space-between; gap: 2.4rem; }
.cv-row .yr { flex: none; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.cv-row .sub { font-style: normal; color: var(--fg-3); }
@media (max-width: 767px) {
  .about-page { padding: 4rem var(--page-pad) 8rem; }
  .about, .cv-row { grid-template-columns: 1fr; row-gap: 1.2rem; }
  .about { row-gap: 2.8rem; margin-bottom: 4rem; }
}

/* ---------- Motion: entrance + reveal (ref: bvincentlee.com) ---------- */
.enter { animation: blurIn .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes blurIn { from { opacity: 0; filter: blur(6px); transform: translateY(4px); } }
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Page-to-page fade, like Cargo's page transition (ref: moment.com exit curve) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .2s var(--ease-exit) both fadeOut; }
::view-transition-new(root) { animation: .35s var(--ease-out) both fadeIn; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .vid button { display: none; }
  .vid > video { display: none; }
}
