/* ==========================================================================
   michaelshiaochen.com — all site styling lives in this one file.
   Change colours and fonts in the :root block below.
   ========================================================================== */
:root {
  --accent: #ff3354;          /* pink: headings, hover, video pop-up background */
  --text: #000;
  --bg: #fff;
  --placeholder: #e3e3e3;
  --gap: 8px;                 /* space between grid tiles */
  --edge: 28px;               /* space at the left/right page edges */

  --font-body: "Work Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-menu: Nunito, sans-serif;
  --font-heading: europa, "Work Sans", sans-serif;          /* Adobe Fonts */
  --font-tile: futura-pt, Futura, "Work Sans", sans-serif;  /* Adobe Fonts */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.3 var(--font-body); }
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }
img, video { display: block; max-width: 100%; height: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header ---------- */
.site-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 32px 32px 32px; }
.brand img { width: 200px; height: auto; }
.site-nav { display: flex; gap: 30px; font: 400 21px/1.3 var(--font-menu); padding-bottom: 2px; }
.site-nav a.active { color: var(--accent); }

/* ---------- Grids (work + play) ---------- */
.grid { list-style: none; margin: 0 0 32px; padding: 0 var(--edge); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.grid a { position: relative; display: block; overflow: hidden; background: var(--tile, var(--placeholder)); }
.work-grid a { aspect-ratio: 16 / 9; }
.play-grid a { aspect-ratio: 1 / 1; }
.play-grid li:nth-child(3n + 1) { grid-column: span 2; }   /* big, small, small, big … */
.grid img, .grid video { width: 100%; height: 100%; object-fit: cover; }

.tile-title {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 24px 45px; text-align: center; color: #fff; background: var(--tile, var(--accent));
  font: 600 38px/.9 var(--font-tile); letter-spacing: -2px;
  opacity: 0; transition: opacity .25s ease-in-out;
}
@media (hover: hover) {
  .grid a:hover .tile-title, .grid a:focus-visible .tile-title { opacity: 1; }
}

/* ---------- Project pages ---------- */
.project { padding: 0 var(--edge) 48px; }
.project-media > * { margin: 0 auto var(--gap); }
.embed { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.project-info { max-width: 960px; padding: 24px 4px 0; }
.project h1, .page-body h1 { margin: 0 0 20px; color: var(--accent); font: 700 40px/.95 var(--font-heading); letter-spacing: -.03em; }
.prose p { margin: 0 0 1.3em; }
.prose img { margin: 4px 0; }
.prose .embed { max-width: 640px; margin: 0 0 1.3em; }
.prose strong { font-weight: 600; }
.prose a { color: var(--accent); }
.prose a:hover { color: var(--text); }

/* ---------- About / simple pages ---------- */
.page-body { max-width: 900px; padding: 24px 60px 64px; }
.page-body .prose { font-size: 18px; }
.button {
  display: inline-block; margin-top: 16px; padding: 16px 32px 19px; border-radius: 4px;
  background: #000; color: #fff !important; font: 18px var(--font-heading); letter-spacing: -.02rem; transition: background .2s;
}
.button:hover { background: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { padding: 16px 32px 50px; }
.social { list-style: none; margin: 0; padding: 0; display: flex; justify-content: flex-end; gap: 12px; }
.social a { display: block; width: 25px; height: 25px; }
.social svg { width: 100%; height: 100%; fill: var(--text); transition: fill .15s; }
.social a:hover svg { fill: var(--accent); }

/* ---------- Video pop-up ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 64px 24px; background: var(--accent); }
.lightbox-frame { position: relative; width: min(100%, calc((100vh - 160px) * 16 / 9)); aspect-ratio: 16 / 9; background: #000; }
.lightbox-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lightbox-close { position: absolute; top: 8px; right: 20px; border: 0; background: none; color: #fff; font-size: 52px; line-height: 1; cursor: pointer; }
.lightbox-details { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: #fff; font: 600 16px var(--font-body); }
.lightbox-details:hover { color: #000; }

/* ---------- Small screens ---------- */
@media (max-width: 680px) {
  :root { --edge: 12px; }
  .site-header { padding: 20px 16px; align-items: center; }
  .brand img { width: 140px; }
  .site-nav { gap: 16px; font-size: 18px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .play-grid li:nth-child(3n + 1) { grid-column: auto; }
  .tile-title { font-size: 25px; letter-spacing: -1px; }
  .project h1, .page-body h1 { font-size: 32px; }
  .page-body { padding: 16px 16px 48px; }
  .site-footer { padding: 16px 16px 40px; }
}
