@font-face{font-family:'Cormorant Garamond';font-style:normal;font-weight:500;font-display:swap;src:url(fonts/CormorantGaramond-500-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Manrope';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/Manrope-400-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Manrope';font-style:normal;font-weight:600;font-display:swap;src:url(fonts/Manrope-600-latin.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
:root {
  --bg: #f7f6f1;
  --blue: #171bff;
  --yellow: #ffe546;
  --ink: #1a1b3a;
  --mute: #4a4b6e;
  --white: #ffffff;
  --pad: clamp(20px, 10vw, 260px); /* inner pages: content is 80% of the screen width */
  --pad-home: clamp(20px, 7.5vw, 200px); /* home: 85% */
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --header-h: 112px;
  --logo: 88px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.8 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body.page-about { background: var(--white); }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 500; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--white); color: var(--blue); padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- header ---------- */
.site-header {
  background: var(--blue);
  height: var(--header-h);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 20;
}
.brand { position: relative; display: block; width: var(--logo); height: var(--logo); flex: none; }
.brand .pe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* scrolling nav (same idea as yuehyueh.co): the links drift right-to-left and pause on hover */
.marquee { flex: 1 1 0; max-width: 640px; margin-left: auto; min-width: 0; overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 14s linear infinite; will-change: transform; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; flex: none; }
.marquee-group a { color: var(--white); text-decoration: none; display: inline-flex; align-items: center; gap: 10px;
  font-size: 18px; line-height: 1.4; letter-spacing: .08em; padding-right: 44px; white-space: nowrap; }
.marquee-group a:hover, .marquee-group a:focus-visible { text-decoration: underline; text-underline-offset: 5px; }
.marquee .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); flex: none; }
@keyframes marquee { to { transform: translateX(-25%); } }

/* ---------- shared ---------- */
.wrap { padding-left: var(--pad); padding-right: var(--pad); }
.serif { font-family: var(--serif); font-weight: 500; }
.blue { color: var(--blue); }
.meta { font-size: 14px; letter-spacing: .04em; line-height: 1.35; color: var(--blue); }
figure { margin: 0; }
figure img { width: 100%; border-radius: 0; }

.foot-slogan { margin: 0 0 14px; font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.1; letter-spacing: -.01em; }
.page-about .foot-slogan { display: none; }
.foot-slogan + p { margin: 0; }
.site-footer { text-align: center; padding: 24px var(--pad) 48px; font-size: 14px; line-height: 1.35; color: var(--mute); }

/* ---------- home ---------- */
body.page-home { background: var(--blue); color: var(--white); }
body.page-home .site-header { padding: 0 var(--pad-home); }
body.page-home .site-footer { color: var(--white); padding-top: 40px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.home-grid { padding: 12px var(--pad-home) 0; display: flex; flex-direction: column; gap: 12px; }
.home-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.tile { position: relative; display: flex; flex-direction: column; color: var(--white); text-decoration: none; }
.tile .media { position: relative; display: block; overflow: hidden; aspect-ratio: var(--ar); background: rgba(255, 255, 255, .12); }
.tile.fill .media { aspect-ratio: auto; flex: 1; }
.tile .media.padded > img { inset: 9% 12%; width: 76%; height: 82%; object-fit: contain; }
.tile .media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
a.tile:hover .media > img, a.tile:focus-visible .media > img { transform: scale(1.02); }
/* hover caption: a small pill that fades in at the bottom-left of the image (as on roingchen.com) */
.tile .label { position: absolute; left: 20px; bottom: 10px; max-width: calc(100% - 40px); padding: 5px 12px; border-radius: 15px;
  background: var(--yellow); color: var(--blue); font-size: 15px; line-height: 1.4; opacity: 0; transition: opacity .4s; pointer-events: none; }
.tile:hover .label, .tile:focus-visible .label, .tile.empty .label { opacity: 1; }
.tile.empty .media { border: 1px dashed rgba(255, 255, 255, .55); }
.tile.empty .no { position: absolute; top: 12px; left: 16px; font-family: var(--serif); font-size: 40px; line-height: 1; color: var(--yellow); }

/* animated hero: five books that swap covers one at a time */
.media.covers { position: relative; overflow: hidden; aspect-ratio: auto; width: 100%; background: #f7f6f1; display: flex; justify-content: center; align-items: center; gap: 12px; padding: 56px 24px; }
.media.flatlay, .comp { background-color: #efede8;
  background-image: repeating-linear-gradient(0deg, rgba(60, 50, 30, .018) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(60, 50, 30, .018) 0 1px, transparent 1px 3px); }
.comp { position: relative; display: block; overflow: hidden; aspect-ratio: var(--ar, 4 / 3); }
.fl-grid { position: absolute; left: -20%; top: -30%; width: 140%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 3%; transform: rotate(-11deg); transform-origin: center; }
.fl-card, .cf-card { display: block; aspect-ratio: 595 / 808; border-radius: 3%; overflow: hidden; box-shadow: 0 6px 14px rgba(40, 30, 20, .22); background: #ddd; }
.fl-card img, .cf-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fl-box { display: block; aspect-ratio: 595 / 808; transform: scale(1.32); position: relative; z-index: 2; border-radius: 1.5%; overflow: hidden; box-shadow: 0 14px 30px rgba(40, 30, 20, .4); }
.fl-box img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cf-card { position: absolute; width: var(--w); left: var(--x); top: var(--y); transform: rotate(var(--r, 0deg)); transform-origin: var(--o, 50% 50%); }
.book { position: relative; flex: 1 1 0; min-width: 0; max-width: 260px; aspect-ratio: 420 / 668; }
.book img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s ease; }
.book img.on { opacity: 1; }


/* ---------- project page ---------- */
.backlink { padding: 28px var(--pad) 0; font-size: 15px; line-height: 1.35; }
.backlink a { color: var(--blue); text-decoration: none; }
.backlink a:hover { text-decoration: underline; text-underline-offset: 4px; }
.project-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: end; padding: 28px var(--pad) 44px; }
.project-head h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(52px, 6.25vw, 90px); line-height: .86; letter-spacing: -.025em; color: var(--blue); }
.project-head .intro { display: flex; flex-direction: column; gap: 20px; padding-bottom: 8px; }
.project-head .intro p:not(.status):not(.meta) { font-size: 20px; line-height: 1.6; }
.status { align-self: flex-start; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); border: 1px solid var(--blue); border-radius: 999px; padding: 2px 12px; line-height: 1.6; }
.project-head h1.title-sm { font-size: clamp(44px, 5vw, 72px); }
.project-head h1.title-md { font-size: clamp(48px, 5.55vw, 80px); }
.hero { padding: 0 var(--pad); }
.info { display: grid; grid-template-columns: 366fr 762fr; gap: 56px; padding: 96px var(--pad) 44px; }
.info h2 { font-family: var(--serif); font-size: clamp(32px, 3.33vw, 48px); line-height: 1; color: var(--blue); }
.info .body { max-width: 620px; display: flex; flex-direction: column; gap: 18px; line-height: 1.8; }
.small-lines { font-size: 14px; line-height: 1.9; margin-top: 18px; }
.small-lines strong, .credits strong { font-weight: 600; }
.block { padding: 0 var(--pad); margin-top: 32px; }
.block.wide figure { margin-left: auto; margin-right: auto; }
.block.offset figure { margin-left: auto; }
.block.row { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 20px; align-items: start; }
.block.intro { margin-top: 0; padding-top: 88px; padding-bottom: 8px; display: flex; flex-direction: column; gap: 16px; }
.block.intro h2 { font-family: var(--serif); font-size: clamp(32px, 3.33vw, 48px); line-height: 1; color: var(--blue); }
.block.intro p { max-width: 520px; font-size: 17px; line-height: 1.7; }
.panel-box { display: flex; align-items: center; justify-content: center; aspect-ratio: var(--ar, 1184 / 360); padding: 2%; }
.panel-box img { width: 41%; height: auto; max-height: 100%; object-fit: contain; }
.cardgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px 16px; }
.cg-card { display: block; border-radius: 3%; overflow: hidden; box-shadow: 0 3px 9px rgba(40, 30, 20, .16); aspect-ratio: 595 / 808; background: #ddd; }
.cg-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.swatch { display: flex; flex-direction: column; gap: 10px; }
.swatch .chip { display: block; height: 140px; }
.swlabel { font-size: 13px; line-height: 1.4; }
.mock-box { display: flex; align-items: center; justify-content: center; gap: var(--gap, 6.1%); aspect-ratio: var(--ar, 1184 / 640); }
.mock-box.shadow .mock-im img { box-shadow: 0 10px 28px rgba(30, 60, 80, .22); }
.mock-im { display: block; }
.mock-im img { width: 100%; height: auto; }
.hero-covers { margin-top: 0; }
.credits { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; padding: 96px var(--pad) 40px; font-size: 14px; line-height: 1.9; }
.prevnext { display: flex; justify-content: space-between; gap: 24px; padding: 28px var(--pad); font-size: 16px; line-height: 1.4; }
.prevnext a { color: var(--blue); text-decoration: none; }
.prevnext a:hover { text-decoration: underline; text-underline-offset: 4px; }
.prevnext .next { margin-left: auto; text-align: right; }

/* videos */
.tile .media > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.autovid { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; transform: scale(1.02); } /* the 2% zoom hides the light edge line the screen recordings have */
.vidblock figure { overflow: hidden; }
.vidblock figure { aspect-ratio: var(--ar, 16 / 9); background: #000; }
.vidblock.bleed { padding-left: 0; padding-right: 0; }
/* laptop and phone drawn in CSS: thin bezels, camera, aluminium base; the phone overlaps the laptop's lower right */
.devices .stage { position: relative; padding-bottom: 5%; }
.laptop { width: 84%; margin: 0; }
.devices.solo .laptop { width: 100%; }
.laptop .lid { position: relative; background: #0b0b0d; border-radius: 12px 12px 3px 3px; padding: 1.1% 1.1% 1.5%; box-shadow: inset 0 0 0 1px #3a3a3e; }
.laptop .lscreen { aspect-ratio: var(--ar); background: #000; border-radius: 4px; overflow: hidden; }
.laptop .cam { position: absolute; left: 50%; top: .55%; width: 5px; height: 5px; margin-left: -2px; border-radius: 50%; background: #25252a; }
.laptop .lbase { position: relative; height: 13px; margin: 0 -4%; background: linear-gradient(#d9d9dc 0, #b4b4b9 55%, #8c8c92 100%); border-radius: 0 0 16px 16px / 0 0 12px 12px; box-shadow: 0 18px 30px rgba(0, 0, 0, .55); }
.laptop .lbase i { position: absolute; left: 50%; top: 0; width: 14%; height: 5px; margin-left: -7%; background: #9d9da2; border-radius: 0 0 8px 8px; }
/* iPhone 16 style: thin titanium frame, Dynamic Island, side buttons */
.phone { position: absolute; right: 0; bottom: 0; width: 17%; margin: 0; padding: .5%; background: #101012;
  border-radius: 15% / 7.1%; box-shadow: inset 0 0 0 1.5px #6e6e74, 0 0 0 1px #2b2b2f, 0 22px 44px rgba(0, 0, 0, .65); }
.phone::before { content: ""; position: absolute; left: -1.6%; top: 14%; width: 1.6%; height: 5%; background: #3a3a3f; border-radius: 2px 0 0 2px;
  box-shadow: 0 130% 0 #3a3a3f, 0 250% 0 #3a3a3f; }
.phone::after { content: ""; position: absolute; right: -1.6%; top: 22%; width: 1.6%; height: 10%; background: #3a3a3f; border-radius: 0 2px 2px 0; }
.phone .pscreen { aspect-ratio: var(--ar); background: #000; border-radius: 12.6% / 6%; overflow: hidden; }
.phone .island { position: absolute; left: 50%; top: 2.2%; width: 28%; height: 2.6%; margin-left: -14%; background: #000; border-radius: 99px; z-index: 2; }
@media (max-width: 700px) {
  .laptop { width: 100%; }
  .phone { position: relative; width: 40%; margin: -12% 4% 0 auto; right: auto; }
  .devices .stage { padding-bottom: 0; }
}

/* dark project pages */
body.page-dark { background: #0a0a0a; color: #ececec; }
body.page-dark .backlink a, body.page-dark .prevnext a, body.page-dark .meta { color: var(--yellow); }
body.page-dark .project-head h1, body.page-dark .info h2, body.page-dark .block.intro h2 { color: #fff; }
body.page-dark .site-footer { color: #9a9a9e; }

/* photo carousel (crossfade) */
.carousel { position: relative; aspect-ratio: var(--ar, 3 / 2); overflow: hidden; background: #ddd; }
.carousel .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; }
.carousel .slide.on { opacity: 1; }
.carousel .slide img { width: 100%; height: 100%; object-fit: cover; }
.dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 10px; }
.dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .55); cursor: pointer; }
.dots button.on { background: var(--blue); box-shadow: 0 0 0 2px #fff; }

/* Picture-book gallery */
.swipe { width: var(--swipe-width, 46%); max-width: 100%; margin-inline: auto; }
.swipe-frame { position: relative; box-shadow: 0 10px 28px rgba(30, 60, 80, .22); }
.swipe-track {
  position: relative;
  display: flex;
  gap: 4px;
  aspect-ratio: var(--ar, 5 / 7);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.swipe-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.swipe-slide img { width: 100%; height: 100%; object-fit: cover; }
.swipe-arrow {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--blue);
  font: 600 23px/1 var(--sans);
  cursor: pointer;
}
.swipe-prev { left: -64px; }
.swipe-next { right: -64px; }
.swipe-arrow:disabled, .swipe-arrow[aria-disabled="true"] { opacity: .35; cursor: default; }
.swipe-arrow:not(:disabled, [aria-disabled="true"]):hover { background: var(--blue); color: #fff; }
.swipe-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 10px; margin-top: 12px; }
.swipe-dots { display: flex; flex-wrap: wrap; justify-content: center; }
.swipe-dots button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
}
.swipe-dots button:disabled { cursor: default; }
.swipe-dots button::before { content: ""; width: 8px; height: 8px; border: 1px solid currentColor; border-radius: 50%; }
.swipe-dots button[aria-current="true"]::before { background: currentColor; }
.swipe button:focus-visible { outline-color: var(--blue); outline-offset: 0; }
.swipe-counter { color: var(--mute); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.swipe-caption { margin-top: 6px; text-align: center; font-size: 14px; line-height: 1.5; }
@media (min-width: 701px) and (hover: hover) and (pointer: fine) {
  .swipe-arrow { display: grid; place-items: center; }
}
@media (max-width: 700px) {
  .swipe { width: 100%; }
}

/* card fan: a hand of cards; one at a time is "drawn" up out of the fan, then slips back */
.stack { position: relative; aspect-ratio: 16 / 9; background: #f6eec4; overflow: hidden; --k: 1; --cw: 19%; }
.scard { position: absolute; left: 50%; top: 20%; width: var(--cw); aspect-ratio: 595 / 808; margin-left: calc(var(--cw) / -2);
  transform-origin: 50% 190%; transform: rotate(calc(var(--a) * var(--k))); transition: transform .9s cubic-bezier(.3, .7, .2, 1); cursor: pointer; }
.scard .face { position: absolute; inset: 0; display: block; border-radius: 3%; overflow: hidden; background: #234;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35); transition: transform .9s cubic-bezier(.3, .7, .2, 1), box-shadow .9s, filter .6s; transform-origin: 50% 70%; }
.scard .face img { width: 100%; height: 100%; object-fit: cover; }
.scard.drawn { transform: rotate(0deg); z-index: 50 !important; }
.scard.drawn .face { transform: translateY(-16%) scale(1.32); box-shadow: 0 18px 40px rgba(0, 0, 0, .5); }
.stack.has-drawn .scard:not(.drawn) .face { filter: brightness(.72); }
@media (max-width: 700px) {
  .stack { aspect-ratio: 4 / 3; --k: .8; --cw: 29%; }
  .scard { top: 24%; }
}

/* ---------- about: three columns with a small photo in the third (as on roingchen.com/about) ---------- */
.about-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, .85fr);
  grid-template-areas: "head bio photo" "ed exp proj"; column-gap: clamp(24px, 3.4vw, 48px); row-gap: clamp(44px, 6vw, 80px);
  align-items: start; padding: clamp(32px, 5.6vw, 72px) var(--pad) clamp(56px, 7.5vw, 96px); }
.ag-head { grid-area: head; display: flex; flex-direction: column; gap: 16px; }
.ag-bio { grid-area: bio; }
.portrait { grid-area: photo; width: 100%; aspect-ratio: 3 / 4; background: #eeeef1; display: flex; align-items: center; justify-content: center; color: var(--mute); font-size: 14px; letter-spacing: .04em; }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.s-ed { grid-area: ed; } .s-exp { grid-area: exp; } .s-proj { grid-area: proj; }
.ag-head h1 { font-family: var(--serif); font-size: clamp(40px, 4.4vw, 64px); line-height: .9; letter-spacing: -.025em; color: var(--blue); }
.ag-head .name { font-size: 18px; line-height: 1.5; margin-top: 8px; }
.ag-head .sub { line-height: 1.6; }
.ag-head .role { font-size: 14px; line-height: 1.6; color: var(--mute); margin-top: -8px; }
.links { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.links a { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; width: fit-content; }
.bio { display: flex; flex-direction: column; gap: 16px; }
.about-section { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid #d9d9e3; padding-top: 14px; }
.about-section h2 { font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--blue); margin-bottom: 4px; }
.row { display: flex; flex-direction: column; gap: 2px; }
.row .t { font-size: 15px; font-weight: 600; line-height: 1.45; }
.row .d { font-size: 14px; line-height: 1.6; color: var(--mute); }
.row .t a { color: var(--blue); text-underline-offset: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .project-head { grid-template-columns: 1fr; gap: 20px; padding: 20px var(--pad) 28px; align-items: start; }
  .info { grid-template-columns: 1fr; gap: 16px; padding-top: 56px; }
  .credits { grid-template-columns: 1fr; gap: 16px; padding-top: 56px; }
  .about-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "head photo" "bio bio" "ed exp" "proj proj"; }
}
@media (max-width: 700px) {
  :root { --header-h: 72px; --logo: 56px; --pad: clamp(20px, 6vw, 40px); --pad-home: clamp(16px, 4vw, 28px); }
  body { font-size: 16px; line-height: 1.8; }
  .marquee-group a { font-size: 16px; padding-right: 40px; }
  .home-row { grid-template-columns: 1fr; }
  .home-row .tile { grid-column: auto !important; }
  .home-row .tile .media { aspect-ratio: 4 / 3; }
  .home-row .tile.fill .media { aspect-ratio: 4 / 3; flex: none; }
  .media.covers { aspect-ratio: auto; padding: 28px 14px; gap: 8px; }
  .book:nth-child(n+4) { display: none; }
  .project-head .intro p:not(.status):not(.meta) { font-size: 17px; }
  .meta { font-size: 13px; }
  .small-lines, .credits { font-size: 14px; }
  .block.row { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cardgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .swatch .chip { height: 96px; }
  .block.row[style*="--cols:3"], .block.row[style*="--cols:5"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .block.wide figure, .block.offset figure { width: 100% !important; }
  .block.intro { padding-top: 56px; }
  .block.intro p { font-size: 16px; }
  .prevnext { font-size: 14px; }
  .about-main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "photo" "bio" "ed" "exp" "proj"; }
  .portrait { max-width: 240px; }
  .ag-head h1 { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .brand .pe-anim { display: none; }
  .tile .media > img, .tile .label { transition: none; }
}

/* touch and small screens have no hover: show the caption under the image */
@media (hover: none), (max-width: 700px) {
  .tile .label { position: static; opacity: 1; background: none; color: var(--white); padding: 8px 0 0; max-width: none; border-radius: 0; font-size: 14px; letter-spacing: .02em; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .marquee { -webkit-mask-image: none; mask-image: none; overflow: visible; }
  .marquee-group[aria-hidden="true"] { display: none; }
  .book img { transition: none; }
  .carousel .slide, .scard, .scard .face { transition: none; }
  .autovid { }
}

/* one-line project title */
.project-head h1.title-line { grid-column: 1 / -1; font-size: clamp(30px, 4.05vw, 58px); line-height: 1; white-space: nowrap; }
.project-head h1.title-line + .intro { grid-column: 2; }
@media (max-width: 900px) { .project-head h1.title-line { white-space: normal; font-size: clamp(34px, 9vw, 52px); } .project-head h1.title-line + .intro { grid-column: 1; } }

/* Flip desk calendar. The front, spine and rear board share one 3D scene. */
.flipcal {
  --turn-time: 1800ms;
  --front-lean: 22deg;
  --rear-lean: -32deg;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.37' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .44 0 0 0 0 .30 0 0 0 0 .17 2.45 0 0 0 -1.53'/%3E%3C/filter%3E%3Cpath fill='white' filter='url(%23g)' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
  position: relative;
  aspect-ratio: var(--ar, 1184 / 940);
  overflow: hidden;
  isolation: isolate;
  perspective: clamp(650px, 125vw, 1600px);
  perspective-origin: 50% 45%;
  background: var(--grain), linear-gradient(155deg, #a79a86 68%, #83796c);
}
.flipcal::before,
.flipcal .cal-set,
.flipcal .cal-set::after {
  position: absolute;
  pointer-events: none;
}
.flipcal::before {
  content: "";
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 66% 100%, 0 100%);
  background: repeating-linear-gradient(162deg, rgba(78,40,15,.18) 0 1px, transparent 1px 3px),
              linear-gradient(96deg, #8a532a 50%, #a66937);
}
.flipcal .cal-set {
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 100% 84%, 63% 100%, 0 100%);
  background: var(--grain),
              radial-gradient(ellipse at 19% 32%, #fff6e5, transparent 78%),
              linear-gradient(145deg, var(--desk, #f7f6f1), #ddc7ab);
}
.flipcal .cal-set::after {
  content: "";
  inset: -8%;
  background:
    linear-gradient(119deg, transparent 24%, rgba(86,60,40,.20) 24.4% 26%, transparent 26.5%),
    linear-gradient(25deg, transparent 17%, rgba(91,64,45,.25) 18% 20%, transparent 21% 31%,
      rgba(87,61,43,.20) 32% 34%, transparent 35% 56%, rgba(87,61,43,.18) 57% 59%,
      transparent 60% 76%, rgba(87,61,43,.15) 77% 86%, transparent 87%);
  filter: blur(clamp(3px, .65vw, 9px));
}
.flipcal .cal {
  --camera-yaw: 29deg;
  --camera-scale-y: .94;
  --stand-height: 104%;
  --stand-recess: -5px;
  --board-thickness: clamp(2px, .3vw, 4px);
  --floor-depth: calc(tan(var(--front-lean)) - tan(var(--rear-lean)));
  position: absolute;
  top: 31%;
  left: 51%;
  width: calc(var(--cw, 49%) * .95);
  aspect-ratio: var(--pa, 748 / 578);
  transform: translateX(-50%) scaleY(var(--camera-scale-y)) rotateZ(-4deg) rotateX(-17deg) rotateY(var(--camera-yaw));
  transform-origin: 50% 0;
  transform-style: preserve-3d;
}
/* Both boards end at the same height. Their horizontal runs set the floor's two folds. */
.flipcal .cal-floor,
.flipcal .cal-shadow {
  position: absolute;
  top: var(--stand-height);
  transform-origin: 50% 0;
}
.flipcal .cal-floor {
  left: -.6%;
  right: -.6%;
  height: calc(var(--stand-height) * var(--floor-depth));
  transform: translateZ(var(--stand-recess)) rotateX(90deg)
    translateY(calc(100% * tan(var(--rear-lean)) / var(--floor-depth)));
  transform-style: preserve-3d;
  background: linear-gradient(90deg, rgba(255,221,130,.2), transparent 28%),
              linear-gradient(180deg, #946625, #c89538 24%, #d8a840 66%, #ac792a);
}
.flipcal .cal-floor::before,
.flipcal .cal-floor::after,
.flipcal .cal-front::before,
.flipcal .cal-rear::before {
  content: "";
  position: absolute;
}
.flipcal .cal-floor::before,
.flipcal .cal-front::before,
.flipcal .cal-rear::before {
  inset: 0 auto 0 0;
  width: var(--board-thickness);
  transform: rotateY(90deg);
  transform-origin: left;
}
.flipcal .cal-floor::before {
  background: linear-gradient(90deg, #bc8a3d, #715021);
}
.flipcal .cal-floor::after {
  inset: 100% 0 auto;
  height: var(--board-thickness);
  transform: rotateX(-90deg);
  transform-origin: top;
  background: linear-gradient(180deg, #b9873a, #7c5524);
}
.flipcal .cal-shadow {
  left: -2%;
  width: 181%;
  height: 180%;
  transform: translateY(1px) rotateX(-90deg) translateY(-25%);
  filter: blur(clamp(3px, .85vw, 11px));
}
.flipcal .cal-shadow::before,
.flipcal .cal-shadow::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.flipcal .cal-shadow::before {
  inset: 1% 0 4%;
  clip-path: polygon(0 47%, 1% 15%, 35% 0, 96% 13%, 83% 61%, 62% 88%, 26% 66%);
  background: radial-gradient(ellipse at 33% 54%, rgba(66,39,18,.58), rgba(77,51,30,.35) 42%, transparent 87%);
}
.flipcal .cal-shadow::after {
  inset: 0 44% 0 0;
  background: radial-gradient(ellipse 49% 5% at 50% 3%, rgba(64,37,15,.48), transparent),
              radial-gradient(ellipse 49% 6% at 50% 59%, rgba(64,37,15,.43), transparent);
}
.flipcal .cal-front,
.flipcal .cal-rear,
.flipcal .cal-edges {
  position: absolute;
  transform-origin: 50% 0;
}
.flipcal .cal-front {
  inset: 0 -.6% auto -.6%;
  height: calc(var(--stand-height) / cos(var(--front-lean)));
  transform: translateZ(var(--stand-recess)) rotateX(var(--front-lean));
  transform-style: preserve-3d;
  background: linear-gradient(107deg, #d7a632, #f4d060 30%, #e5b946 73%, #c08e31);
  box-shadow: inset 0 1px #ffe485, inset 0 -1px rgba(255,226,151,.47);
}
.flipcal .cal-front::before {
  background: linear-gradient(90deg, #b88739, #8a6027);
}
.flipcal .cal-rear {
  inset: 0 -.6% auto -.6%;
  /* Extend the fold into the floor's thickness to avoid a subpixel gap. */
  height: calc(var(--stand-height) / cos(var(--rear-lean)) + 1px);
  transform: translateZ(var(--stand-recess)) rotateX(var(--rear-lean));
  transform-style: preserve-3d;
  background: linear-gradient(180deg, transparent 64%, rgba(104,62,19,.3)),
              linear-gradient(110deg, #d6a744, #b17d29 35%, #8f5f24 76%);
}
.flipcal .cal-rear::before {
  transform: rotateY(-90deg);
  background: linear-gradient(90deg, #c29343, #e2ba6c);
}
.flipcal .cal-edges {
  inset: 0 -.7% -1.15% 0;
  transform: rotateX(var(--front-lean)) translateZ(-3px);
  background: repeating-linear-gradient(177deg, #ded8c9 0 1px, #f5f0e2 1px 2px);
  box-shadow: 1px 2px 3px rgba(61,44,14,.34);
}
.flipcal .fstack, .flipcal .fpage {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.flipcal .fpage {
  visibility: hidden;
  transform: rotateX(var(--front-lean));
  transform-origin: 50% 0;
}
.flipcal .fpage.is-current,
.flipcal .fpage.is-next {
  visibility: visible;
}
.flipcal .fpage.is-next {
  transform: rotateX(var(--front-lean)) translateZ(-1.5px);
}
.flipcal .ffront, .flipcal .fback {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 1px;
}
.flipcal .ffront {
  background: #f8f6ef;
  box-shadow: 0 1px 1px rgba(56,47,31,.22);
}
.flipcal .ffront img, .flipcal .fback img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.flipcal .fback {
  background: linear-gradient(132deg, #f5f4f1, #e9e7e3 75%, #dfdcd6);
  transform: rotateX(180deg);
}
.flipcal .fback img:not(.is-loaded) { visibility: hidden; }
.flipcal .ffront::before, .flipcal .fback::before,
.flipcal .ffront::after, .flipcal .fback::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.flipcal .ffront::before, .flipcal .fback::before {
  inset: 0;
  background: linear-gradient(180deg, rgba(48,33,19,.17), transparent 12%),
              linear-gradient(113deg, rgba(255,235,198,.15), transparent 42%, rgba(82,60,41,.07)),
              linear-gradient(23deg, transparent 9%, rgba(82,60,41,.09) 16% 20%, transparent 28%);
}
.flipcal .ffront::after, .flipcal .fback::after {
  inset: .75% 2.5% auto;
  height: 2.1%;
  background: radial-gradient(ellipse at 38% 50%, #211d16 0 25%, #82796a 36%, transparent 47%) left top,
              radial-gradient(ellipse at 62% 50%, #211d16 0 25%, #82796a 36%, transparent 47%) right top;
  background-size: calc(100% / 22) 100%;
  background-repeat: repeat-x;
}
.flipcal .fback::after { inset: auto 2.5% .75%; }
.flipcal .cal-rings {
  position: absolute;
  inset: -3.5% 2.5% auto;
  height: 5.5%;
  display: grid;
  grid-template-columns: repeat(22, 1fr);
  pointer-events: none;
  transform: rotateX(var(--front-lean)) translateZ(3px);
  transform-origin: 50% 64%;
}
.flipcal .cal-rings i {
  position: relative;
}
.flipcal .cal-rings i::before, .flipcal .cal-rings i::after {
  content: "";
  position: absolute;
  top: 0;
  left: 24%;
  width: 27%;
  height: 100%;
  border: clamp(1px, .15vw, 2px) solid #262525;
  border-top-color: #666462;
  border-left-color: #53504c;
  border-radius: 52% 51% 45% 48%;
  box-shadow: inset 1px 0 rgba(255,255,255,.32), 1px 1px 1px rgba(36,30,20,.24);
  transform: skewX(7deg);
}
.flipcal .cal-rings i::after { left: 49%; }
.flipcal .fpage.is-turning {
  animation: flipcal-turn var(--turn-time) both;
}
.flipcal .is-turning .ffront::before,
.flipcal .is-turning .fback::before {
  background: linear-gradient(171deg, rgba(34,28,20,.44), rgba(34,28,20,.16) 23%, transparent 49%, rgba(255,255,255,.45) 72%, rgba(52,43,29,.17));
  animation: flipcal-shade var(--turn-time) ease-in-out both;
}
.flipcal .is-next .ffront::before {
  background: linear-gradient(180deg, rgba(34,28,20,.31), rgba(34,28,20,.10) 18%, transparent 55%);
  animation: flipcal-reveal var(--turn-time) ease-out both;
}
.flipcal:not(.is-playing) .fpage.is-turning,
.flipcal:not(.is-playing) .is-next .ffront::before,
.flipcal:not(.is-playing) .is-turning .ffront::before,
.flipcal:not(.is-playing) .is-turning .fback::before {
  animation-play-state: paused;
}
@keyframes flipcal-turn {
  0% {
    transform: rotateX(var(--front-lean)) scaleY(1) skewX(0);
    animation-timing-function: cubic-bezier(.48,.03,.71,.72);
  }
  52% {
    transform: rotateX(170deg) scaleY(.40) skewX(-2deg);
    animation-timing-function: cubic-bezier(.3,.24,.52,1);
  }
  100% { transform: rotateX(328deg) scaleY(1) skewX(0); }
}
@keyframes flipcal-shade {
  0%, 100% { opacity: .28; }
  43%, 70% { opacity: 1; }
}
@keyframes flipcal-reveal {
  0%, 20% { opacity: 1; }
  100% { opacity: .42; }
}
@media (max-width: 900px) {
  .flipcal .cal { --camera-scale-y: 1; width: 57%; }
  .flipcal { aspect-ratio: 8 / 7; }
}
@media (max-width: 600px) {
  .flipcal .cal {
    --camera-yaw: 23deg;
    left: 46.5%;
    width: min(calc(54% + 36px), 64%);
  }
  .flipcal { aspect-ratio: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .flipcal .fpage.is-turning,
  .flipcal .is-next .ffront::before,
  .flipcal .is-turning .ffront::before,
  .flipcal .is-turning .fback::before { animation: none; }
  .flipcal .fpage:not(:first-child) { visibility: hidden; }
  .flipcal .fpage:first-child { visibility: visible; }
}

.hero-vid { margin: 0; aspect-ratio: var(--ar, 16 / 9); overflow: hidden; background: #3da4de; }
.vidpair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.vidpair figure { margin: 0; aspect-ratio: var(--ar, 9 / 16); overflow: hidden; background: #000; }
.extlink { color: var(--blue); text-decoration: none; }
.extlink:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 900px) { .vidpair { gap: 12px; } }

/* the serif's hyphen is drawn slanted; use the sans hyphen in big titles */
.hy { font-family: var(--sans); font-weight: 400; font-size: .78em; display: inline-block; transform: translateY(-.06em); margin: 0 .02em; }
