/* ==========================================================================
   Lin Jiamin — PCG Technical Artist portfolio
   Visual language shared with Poffi Studio (Beads): cool light neutrals,
   white rounded panels, violet-blue gradient accent. Light theme only.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --sunken: #eceef4;
  --sunken-hover: #e2e5ed;
  --ink: #16181f;
  --ink-soft: #353844;
  --muted: #6a6f7d;
  --line: #e2e4ec;
  --faint: #c7cbd6;
  --violet: #6f5cf2;
  --grad: linear-gradient(100deg, #9d6bff, #3e8bff);
  --grad-shadow: rgba(94, 107, 255, 0.55);
  --shadow-lift: rgba(30, 30, 60, 0.45);

  /* Inter covers Latin and digits; Chinese glyphs fall through to PingFang / YaHei */
  --ui: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: var(--ui);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --r-lg: 24px;
  --r-md: 20px;
  --r-sm: 14px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
::selection { background: var(--violet); color: #fff; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 4px; }

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

.wrap { max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: calc(var(--max) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

.eyebrow,
.label,
figcaption,
.back,
.count,
.card-no,
.chapter-no {
  font-family: var(--ui);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.label { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 4px; }
.accent { color: var(--violet); }

/* Gradient text used for the emphasised word in big titles */
.next-title .arrow {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead { font-size: clamp(16px, 1.4vw, 18px); line-height: 1.75; color: var(--ink-soft); max-width: 38em; }

/* ---------- Buttons ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 42px; padding: 0 18px; border-radius: 12px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line);
  font-size: 14px; font-weight: 700; white-space: nowrap;
  transition: box-shadow 0.2s, background 0.2s, filter 0.2s;
}
.pill:hover { box-shadow: 0 0 0 1px var(--ink); }
.pill-solid { background: var(--ink); color: #fff; box-shadow: none; }
.pill-solid:hover { background: #2a2d38; box-shadow: none; }
.pill-grad { background: var(--grad); color: #fff; box-shadow: 0 10px 22px -12px var(--grad-shadow); }
.pill-grad:hover { filter: brightness(1.06); box-shadow: 0 12px 26px -12px var(--grad-shadow); }
.pill-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
.pill-grad { transition: transform 0.2s var(--ease), box-shadow 0.2s, filter 0.2s; }
.pill-grad:hover { transform: translateY(-2px); }
.pill-grad .arr { display: inline-block; transition: transform 0.25s var(--ease); }
.pill-grad:hover .arr { transform: translateX(3px); }
.pill-ghost { color: var(--ink-soft); }
.pill-ghost:hover { color: var(--violet); box-shadow: 0 0 0 1px var(--violet); }

/* ---------- Header ---------- */

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 60px; padding-inline: var(--gutter);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: 0.02em;
}
.brand-en { font-family: var(--ui); font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.brand-mark {
  flex: none; width: 18px; height: 20px; background: var(--grad);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  transition: transform 0.6s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(60deg); }

.site-nav { display: flex; gap: 4px; font-size: 14px; font-weight: 700; }
.site-nav a { padding: 8px 12px; border-radius: 12px; color: var(--ink-soft); transition: background 0.2s, color 0.2s; }
.site-nav a:hover { background: var(--sunken); color: var(--ink); }

/* ---------- Profile (top) ---------- */

.profile {
  /* Equal-height columns: contact list spans from the eyebrow to the bio's last line */
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; align-items: stretch;
  padding-top: clamp(104px, 14vh, 136px); padding-bottom: 36px;
}
.profile-main .eyebrow { margin-bottom: 10px; }
.profile-name {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px;
  font-family: var(--display); font-size: clamp(34px, 3.4vw, 44px); line-height: 1.1; letter-spacing: 0.03em; font-weight: 700;
}
.profile-name span { font-size: 0.5em; font-weight: 600; color: var(--muted); letter-spacing: -0.01em; }
.profile-role { margin-top: 8px; font-size: 16px; font-weight: 700; color: var(--ink); }
.profile-role .sep { color: var(--faint); margin: 0 4px; }
.profile-bio { margin-top: 10px; max-width: 34em; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }

/* Rows spread between the eyebrow (top) and the bio's last line (bottom) */
.profile-contact { margin: 0; display: flex; flex-direction: column; justify-content: space-between; }
.profile-contact > div {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--line);
}
.profile-contact > div:first-child { padding-top: 0; }
.profile-contact > div:last-child { padding-bottom: 0; border-bottom: 0; }
.profile-contact dt { font-family: var(--ui); font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.profile-contact dd { margin: 0; font-size: 14.5px; line-height: 1.6; font-weight: 700; overflow-wrap: anywhere; }
.profile-contact dd a:hover { color: var(--violet); }

/* ---------- Project index ---------- */

.toc {
  position: sticky; top: 60px; z-index: 40;
  display: flex; align-items: center; gap: 20px;
  padding-top: 12px; padding-bottom: 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.toc .label { margin: 0; white-space: nowrap; }
.toc ol { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.toc ol::-webkit-scrollbar { display: none; }
.toc a {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 6px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 700; color: var(--ink-soft);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.toc a:hover,
.toc a.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.toc-no { font-family: var(--ui); font-size: 11px; color: var(--violet); }

/* ---------- Project showcase ---------- */

.showcase { padding: clamp(64px, 9vh, 96px) 0; border-bottom: 1px solid var(--line); scroll-margin-top: 112px; }
.sc-head {
  /* Title block and summary share a bottom line; highlights sit in their own row below */
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: end;
}
.sc-title { grid-column: 1 / span 5; }
.sc-no { display: block; font-family: var(--ui); font-size: 12px; line-height: 1.5; font-weight: 700; color: var(--violet); }
.sc-title h2 {
  margin-top: 8px; font-family: var(--display);
  font-size: clamp(28px, 3vw, 40px); line-height: 1.1; letter-spacing: -0.022em; font-weight: 700;
}
.sc-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 8px; line-height: 1.6; }
.sc-zh { font-size: 16px; color: var(--ink-soft); font-weight: 700; letter-spacing: 0.02em; }
.sc-tools { font-family: var(--ui); font-size: 12.5px; color: var(--muted); }
.sc-tools::before { content: "·"; margin-right: 12px; color: var(--faint); }
.sc-summary { grid-column: 7 / span 6; color: var(--ink-soft); font-size: 15px; line-height: 1.8; }

.sc-points {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
  margin: 28px 0 32px;
}
.sc-points li {
  position: relative; padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--ink); font-size: 14px; line-height: 1.65;
}
/* Short gradient accent on top of each column's divider */
.sc-points li::before {
  content: ""; position: absolute; left: 0; top: -1px; width: 32px; height: 2px; border-radius: 2px;
  background: var(--grad);
}

.sc-main .frame,
.sc-item .frame {
  position: relative; display: block; width: 100%; overflow: hidden;
  border-radius: var(--r-md); background: var(--sunken);
}
.sc-main .frame { aspect-ratio: 16 / 8; }
.sc-item .frame { aspect-ratio: 4 / 3; border-radius: var(--r-sm); }
.sc-main img, .sc-main video,
.sc-item img, .sc-item video { width: 100%; height: 100%; object-fit: cover; }
.sc-main figcaption,
.sc-item figcaption { display: block; margin-top: 8px; font-family: var(--ui); font-size: 12px; color: var(--muted); }
.sc-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
button.frame { cursor: zoom-in; }
.sc-main img, .sc-item img { transition: transform 0.6s var(--ease); }
button.frame:hover img { transform: scale(1.02); }

.sc-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.text-link { font-size: 14px; font-weight: 700; color: var(--muted); }
.text-link:hover { color: var(--violet); }

/* ---------- About ---------- */

.about {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px 32px; align-items: start;
  padding-top: clamp(72px, 10vh, 104px); padding-bottom: 24px; scroll-margin-top: 80px;
}
.about-head { grid-column: 1 / span 4; display: grid; gap: 14px; }
.statement {
  font-family: var(--display); font-size: clamp(20px, 1.8vw, 24px); line-height: 1.45;
  letter-spacing: -0.01em; font-weight: 700; color: var(--ink);
}
.about-text { color: var(--ink-soft); font-size: 14.5px; line-height: 1.8; }
.about-col { grid-column: span 4; }
.about-col h3 { padding-bottom: 8px; border-bottom: 1px solid var(--ink); margin-bottom: 0; }
.exp li { display: grid; gap: 3px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.exp-date { font-family: var(--ui); font-size: 12px; font-weight: 600; color: var(--violet); font-variant-numeric: tabular-nums; }
.exp strong { display: block; font-weight: 700; font-size: 15px; }
.exp em { display: block; font-style: normal; font-family: var(--ui); font-size: 11.5px; color: var(--muted); margin: 1px 0 4px; }
.exp p { font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); }
.tools li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tools strong { font-weight: 700; }
.tools span { font-family: var(--ui); font-size: 11.5px; color: var(--muted); text-align: right; }

/* ---------- Project page ---------- */

.project-hero { padding-top: clamp(100px, 13vh, 132px); }
.back {
  display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 12px;
  background: var(--surface); box-shadow: 0 0 0 1px var(--line); color: var(--ink-soft);
  margin-bottom: 28px; transition: box-shadow 0.2s;
}
.back:hover { box-shadow: 0 0 0 1px var(--ink); color: var(--ink); }
.project-title {
  font-family: var(--display);
  font-size: clamp(40px, 5.6vw, 76px); line-height: 1.05; letter-spacing: -0.025em; font-weight: 700;
  margin-top: 12px;
}
.project-zh { font-size: clamp(17px, 1.5vw, 21px); color: var(--muted); margin-top: 8px; }
.project-intro {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: start;
  margin-top: 32px;
}
.project-intro .lead { grid-column: 1 / span 7; }
.meta-grid {
  grid-column: 8 / span 5; display: grid; gap: 14px; padding: 20px 22px;
  background: var(--surface); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line);
  font-size: 14px; font-weight: 700;
}

.project-cover { max-width: calc(var(--max) + var(--gutter) * 2); margin: clamp(36px, 6vh, 56px) auto 0; padding-inline: var(--gutter); }
.project-cover img {
  width: 100%; aspect-ratio: 2.3 / 1; object-fit: cover;
  border-radius: var(--r-lg); background: var(--sunken);
  box-shadow: 0 30px 60px -36px var(--shadow-lift);
}

.chapter {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  margin-top: clamp(72px, 10vh, 112px);
}
.chapter-head { grid-column: 1 / span 4; align-self: start; }
.chapter-head::before {
  content: ""; display: block; width: 36px; height: 4px; border-radius: 4px;
  background: var(--grad); margin-bottom: 16px;
}
.chapter-no { color: var(--violet); display: block; margin-bottom: 6px; }
.chapter-head h2 { font-family: var(--display); font-size: clamp(22px, 2vw, 28px); line-height: 1.3; letter-spacing: 0.03em; font-weight: 700; }
.chapter-body {
  grid-column: 6 / span 7; padding-top: 20px;
  display: grid; gap: 14px; font-size: 15.5px; line-height: 1.9; color: var(--ink-soft); max-width: 44em;
}
.chapter-media { grid-column: 1 / -1; margin-top: 32px; display: grid; gap: 14px; }

.media-row { display: grid; gap: 14px; align-items: start; }
.media-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.media-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.media { min-width: 0; }
.media .frame,
.media .zoom {
  position: relative; display: block; width: 100%;
  overflow: hidden; border-radius: var(--r-sm); background: var(--sunken);
}
.media img,
.media video { width: 100%; height: auto; }
.media-row:not(.cols-1) .frame,
.media-row:not(.cols-1) .zoom { aspect-ratio: 16 / 10; }
.media-row:not(.cols-1) img,
.media-row:not(.cols-1) video { height: 100%; object-fit: contain; }
.media .zoom { cursor: zoom-in; }
.media .zoom img { transition: transform 0.5s var(--ease); }
.media .zoom:hover img { transform: scale(1.02); }

/* ---------- Video player (controls injected by main.js) ---------- */

.player video { cursor: pointer; }

/* Big centre play button: shown until the video has started */
.vplay {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.92); color: var(--ink);
  box-shadow: 0 12px 30px -12px rgba(20, 22, 40, 0.6);
  transition: transform 0.2s var(--ease), opacity 0.2s, background 0.2s, color 0.2s;
}
.vplay svg { width: 26px; height: 26px; margin-left: 3px; }
.vplay:hover { transform: scale(1.06); background: var(--grad); color: #fff; }
.player.is-started .vplay { opacity: 0; pointer-events: none; }
.sc-item .vplay { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
.sc-item .vplay svg { width: 22px; height: 22px; }

/* Slim control bar */
.vbar {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 8px 0 4px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px) saturate(1.4); -webkit-backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: 0 10px 28px -14px rgba(20, 22, 40, 0.55);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.2s, transform 0.25s var(--ease);
}
.player:hover .vbar,
.player:focus-within .vbar,
.player.is-scrubbing .vbar,
.player.is-started:not(.is-playing) .vbar { opacity: 1; transform: none; }
@media (hover: none) {
  .player.is-started .vbar { opacity: 1; transform: none; }
}
.sc-item .vbar { left: 8px; right: 8px; bottom: 8px; height: 34px; gap: 6px; }

.vbtn {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; color: var(--ink);
  transition: background 0.2s;
}
.vbtn:hover { background: var(--sunken); }
.vbtn svg { width: 18px; height: 18px; }
.sc-item .vbtn { width: 28px; height: 28px; }
.sc-item .vbtn svg { width: 16px; height: 16px; }

.vtime,
.vdur { flex: none; font-family: var(--ui); font-size: 11.5px; font-weight: 500; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.vdur { color: var(--muted); }
.sc-item .vtime,
.sc-item .vdur { font-size: 10.5px; }

.vtrack {
  position: relative; flex: 1; height: 20px; cursor: pointer; touch-action: none;
}
.vtrack::before,
.vbuf,
.vfill { position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; }
.vtrack::before { content: ""; right: 0; background: var(--sunken-hover); }
.vbuf { width: 0; background: var(--faint); opacity: 0.6; }
.vfill { width: 0; background: var(--grad); }
.vknob {
  position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 2px var(--violet), 0 2px 6px rgba(0, 0, 0, 0.2);
  transform: scale(0); transition: transform 0.15s;
}
.vtrack:hover .vknob,
.vtrack:focus-visible .vknob,
.player.is-scrubbing .vknob { transform: scale(1); }

/* Fullscreen: letterbox on black, show the whole frame */
.player.is-fullscreen { display: grid; place-items: center; background: #000; border-radius: 0; aspect-ratio: auto; }
.player.is-fullscreen video { width: 100%; height: 100%; object-fit: contain; }
.player.is-fullscreen .vbar { left: 50%; right: auto; width: min(960px, calc(100% - 48px)); transform: translateX(-50%); bottom: 24px; }
.player.is-fullscreen:hover .vbar,
.player.is-fullscreen.is-started:not(.is-playing) .vbar { transform: translateX(-50%); }

figcaption { display: flex; gap: 10px; margin-top: 8px; color: var(--muted); }
.fig-no { color: var(--violet); font-weight: 700; }

.watch { margin-top: 48px; }

.next-project { display: block; margin-top: clamp(88px, 12vh, 128px); }
.next-card {
  display: block; padding: clamp(28px, 4vw, 44px);
  background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow 0.2s, transform 0.2s;
}
.next-project:hover .next-card { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line), 0 24px 50px -28px var(--shadow-lift); }
.next-title {
  display: block; margin-top: 10px;
  font-family: var(--display); font-size: clamp(32px, 4.2vw, 56px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 700;
}
.next-title .arrow { display: inline-block; transition: transform 0.4s var(--ease); }
.next-project:hover .arrow { transform: translateX(0.15em); }
.next-zh { display: block; margin-top: 6px; color: var(--muted); font-size: 16px; }

/* ---------- Footer ---------- */

.site-footer { padding: clamp(72px, 10vh, 112px) 0 28px; }
.footer-card {
  position: relative; overflow: hidden;
  padding: clamp(28px, 5vw, 56px);
  background: var(--surface); border-radius: 28px; box-shadow: 0 0 0 1px var(--line);
}
.footer-card::before {
  content: ""; position: absolute; right: -10%; top: -40%; width: 60%; height: 120%;
  background: radial-gradient(closest-side, rgba(157, 107, 255, 0.16), rgba(62, 139, 255, 0.08) 55%, transparent);
  pointer-events: none;
}
.footer-card > * { position: relative; }
.footer-title {
  margin-top: 14px; font-family: var(--display);
  font-size: clamp(30px, 4.6vw, 64px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 700;
}
.footer-mail {
  display: inline-flex; align-items: baseline; gap: 0.25em; margin-top: 24px;
  font-family: var(--display); font-size: clamp(20px, 2.6vw, 34px); letter-spacing: -0.01em; font-weight: 600;
  color: var(--violet); overflow-wrap: anywhere;
  transition: color 0.2s;
}
.footer-mail:hover { color: #3e8bff; }
.footer-mail span { font-size: 0.7em; }
.footer-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: end;
  margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 15px; font-weight: 700;
}
.footer-grid a:not(.pill):hover { color: var(--violet); }
.footer-grid .pill { margin-top: 2px; }
.footer-base {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 24px; padding-inline: 4px;
  font-family: var(--ui); font-size: 12px; color: var(--muted);
}
.footer-base a:hover { color: var(--ink); }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: rgba(16, 18, 26, 0.9);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 64px var(--gutter) 32px;
  animation: fade 0.22s ease;
}
.lightbox[hidden] { display: none; }
.lightbox-stage { width: 100%; height: 100%; display: grid; place-items: center; }
.lightbox-stage img,
.lightbox-stage video { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: var(--r-sm); }
.lightbox-close {
  position: absolute; top: 16px; right: var(--gutter);
  font-family: var(--ui); font-size: 12px; font-weight: 700; color: var(--ink);
  padding: 8px 14px; border-radius: 12px; background: #fff;
}
.lightbox-close:hover { background: var(--sunken); }
@keyframes fade { from { opacity: 0; } }

/* ---------- 404 ---------- */

.notfound .footer-title { letter-spacing: 0.03em; }
.notfound { min-height: 70vh; padding-top: 160px; display: grid; align-content: start; gap: 28px; }

/* ---------- Reveal ---------- */

.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .dot { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .profile { grid-template-columns: 1fr; gap: 28px; align-items: start; }
  .sc-title,
  .sc-summary,
  .about-head { grid-column: 1 / -1; }
  .about-col { grid-column: span 6; }
  .chapter-head { grid-column: 1 / -1; }
  .chapter-body { grid-column: 1 / -1; max-width: none; padding-top: 14px; }
  .project-intro .lead { grid-column: 1 / span 7; }
  .meta-grid { grid-column: 8 / span 5; }
}

@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .site-header { height: 56px; }
  .brand-en { display: none; }
  .site-nav a { padding: 6px 8px; }

  .toc { top: 56px; gap: 12px; }
  .toc .label { display: none; }
  .showcase { padding: 48px 0; scroll-margin-top: 104px; }
  .sc-head { gap: 16px; }
  .sc-points { grid-template-columns: 1fr; gap: 0; margin: 20px 0 24px; }
  .sc-points li { padding: 10px 0; }
  .sc-main .frame { aspect-ratio: 4 / 3; }
  .sc-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sc-gallery figure:nth-child(3) { grid-column: 1 / -1; }
  .sc-gallery figure:nth-child(3) .frame { aspect-ratio: 16 / 9; }
  .about-col { grid-column: 1 / -1; }

  .project-intro { grid-template-columns: 1fr; gap: 20px; }
  .project-intro .lead,
  .meta-grid { grid-column: 1 / -1; }
  .meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; font-size: 13px; }
  .project-cover img { aspect-ratio: 4 / 3; border-radius: var(--r-md); }

  .media-row.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-row.cols-2 { grid-template-columns: 1fr; }
  .media-row.cols-2 .frame,
  .media-row.cols-2 .zoom { aspect-ratio: auto; }
  .media-row.cols-2 img,
  .media-row.cols-2 video { height: auto; }
  .chapter-body { font-size: 15px; }

  .footer-grid { grid-template-columns: 1fr; gap: 18px; align-items: start; }
  .footer-grid .pill { justify-self: start; }
}

@media (max-width: 420px) {
  .site-nav { gap: 0; font-size: 13px; }
  .media-row.cols-3 { grid-template-columns: 1fr; }
  .media-row.cols-3 .frame,
  .media-row.cols-3 .zoom { aspect-ratio: auto; }
  .media-row.cols-3 img,
  .media-row.cols-3 video { height: auto; }
  .meta-grid { grid-template-columns: 1fr; }
}
