/* Xinyue MA — V13 CMS */

:root {
  --bg: #ffffff;
  --intro-bg: #f3f1eb;
  --ink: #171816;
  --muted: #73736d;
  --line: #d9d9d4;
  --green: #2e7953;
  --red: #d25037;
  --ochre: #a98946;

  --header-h: 58px;
  --content-top: 90px;
  --sidebar-left: 44px;
  --sidebar-width: 210px;
  --content-left: 248px;
  --work-control-block: 66px;

  --clock-width: min(34vw, 390px, calc((100svh - 118px) * .43));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Helvetica Neue",
    Helvetica,
    Arial,
    "Noto Sans SC",
    "PingFang SC",
    sans-serif;
}

body { overflow-x: hidden; }

button {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button, a { outline-offset: 4px; }

img {
  display: block;
  max-width: 100%;
  user-select: none;
}

/* ===================== INTRO ===================== */

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  min-height: 100svh;
  background: var(--intro-bg);
  transition: opacity .75s ease, visibility .75s ease;
}

.intro.is-gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-top {
  position: absolute;
  top: 22px;
  left: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.intro-name,
.portfolio-name {
  font-family:
    "Raleway",
    "Avenir Next",
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: .075em;
}

.intro-name {
  color: inherit;
  text-decoration: none;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .015em;
}

.language-switch {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-switch button {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  padding: 4px 5px 5px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  letter-spacing: .04em;
  transition: color .15s ease, border-color .15s ease;
}

.language-switch button:hover { color: var(--red); }

.language-switch button.is-active {
  color: var(--green);
  border-color: currentColor;
}

.clock-scene {
  width: 100%;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 58px 16px 34px;
}

.clock-art {
  position: relative;
  width: var(--clock-width);
  aspect-ratio: 1 / 2.27924;
}

.clock-face-img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  z-index: 2;
  filter: drop-shadow(0 7px 8px rgba(30, 26, 19, .08));
}

.clock-hands {
  position: absolute;
  z-index: 6;
  left: 53.830%;
  top: 45.652%;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.clock-hand {
  position: absolute;
  left: 0;
  bottom: 0;
  display: block;
  transform-origin: 50% 100%;
}

.clock-hand--hour {
  width: 8px;
  height: calc(var(--clock-width) * .34);
  margin-left: -4px;
  border-radius: 1px;
  background: #1d1e1b;
}

.clock-hand--minute {
  width: 6px;
  height: calc(var(--clock-width) * .49);
  margin-left: -3px;
  border-radius: 1px;
  background: #1d1e1b;
}

.clock-hand--second {
  width: 2.5px;
  height: calc(var(--clock-width) * .56);
  margin-left: -1.25px;
  border-radius: 1px;
  background: var(--red);
}

.clock-pin {
  position: absolute;
  width: 16px;
  height: 16px;
  left: -8px;
  top: -8px;
  border-radius: 50%;
  background: #2b261f;
  box-shadow:
    0 0 0 2px rgba(183, 138, 56, .62),
    0 2px 5px rgba(0,0,0,.16);
}

.pendulum {
  position: absolute;
  z-index: 5;
  top: 45.652%;
  left: 53.830%;
  width: 44%;
  height: calc(var(--clock-width) * 1.28);
  transform-origin: 50% 0;
  animation: pendulumSwing 1s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes pendulumSwing {
  from { transform: translateX(-50%) rotate(-12deg); }
  to   { transform: translateX(-50%) rotate(12deg); }
}

.pendulum.is-paused { animation-play-state: paused; }

.pendulum-button {
  position: absolute;
  z-index: 2;
  top: calc(var(--clock-width) * .655);
  left: 50%;
  width: 100%;
  transform: translateX(-50%);
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}

.pendulum-image-stack {
  position: relative;
  display: block;
  width: 100%;
}

.pendulum-img {
  width: 100%;
  transition: opacity .08s linear;
  filter: drop-shadow(0 5px 5px rgba(30, 26, 19, .08));
}

.pendulum-img--normal {
  position: relative;
  opacity: 1;
}

.pendulum-img--hover {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.pendulum-button.is-ready .pendulum-img--normal { opacity: 0; }
.pendulum-button.is-ready .pendulum-img--hover { opacity: 1; }

.intro-note {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .12em;
}

/* ===================== MAIN SITE ===================== */

.site {
  min-height: 100svh;
  background: #fff;
  opacity: 0;
  transition: opacity .55s ease .06s;
}

.site.is-visible { opacity: 1; }

.portfolio-header {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
}

.portfolio-header::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 0;
  height: 1px;
  background: rgba(23,24,22,.16);
  pointer-events: none;
}

.portfolio-name {
  grid-column: 2;
  justify-self: center;
  border: 0;
  background: transparent;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 25px;
  font-weight: 300;
  letter-spacing: .075em;
  line-height: 1;
}

.portfolio-name:hover { color: var(--green); }

.language-switch--site {
  grid-column: 3;
  justify-self: end;
}

/* ===================== SIDEBAR ===================== */

.sidebar {
  position: fixed;
  z-index: 50;
  top: var(--content-top);
  left: var(--sidebar-left);
  bottom: 20px;
  width: var(--sidebar-width);
  padding: 0 10px 22px 0;
  overflow-y: auto;
  overflow-x: visible;
  background: transparent;
  transition:
    top .38s cubic-bezier(.22,.72,.2,1),
    filter .22s ease,
    opacity .22s ease,
    transform .38s cubic-bezier(.22,.72,.2,1);
  will-change: top, filter, opacity, transform;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-item {
  width: max-content;
  max-width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: #4a4b48;
  line-height: 1.14;
  transition:
    color .2s ease,
    transform .22s cubic-bezier(.2,.75,.2,1),
    opacity .2s ease;
}

html[lang="zh-CN"] .sidebar .nav-item {
  font-family:
    "Songti SC",
    STSong,
    "Noto Serif SC",
    SimSun,
    serif;
  font-weight: 400;
  letter-spacing: .14em;
}

html[lang="en"] .sidebar .nav-item,
html[lang="fr"] .sidebar .nav-item {
  font-family:
    "Roboto Mono",
    Menlo,
    Monaco,
    Consolas,
    monospace;
}

.nav-item:hover { color: var(--red); }

.nav-item.is-active {
  color: var(--green);
  transform: translateX(3px);
}

.nav-item.is-activating {
  color: var(--green);
  transform: translateX(4px);
}

.nav-item--main {
  font-size: 18px;
  font-weight: 500;
}

.nav-item--static {
  cursor: default;
}

.nav-item--static:hover {
  color: #4a4b48;
}

.nav-item--sub {
  padding-left: 17px;
  font-size: 14px;
  font-weight: 400;
}

.nav-item--leaf {
  padding-left: 32px;
  font-size: 12.5px;
  font-weight: 400;
}

.submenu {
  display: flex;
  flex-direction: column;
}

.submenu--works {
  gap: 11px;
  max-height: none;
  opacity: 1;
  overflow: visible;
  pointer-events: auto;
  transform: none;
  margin-top: 2px;
}

.submenu--etc {
  gap: 9px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-5px);
  margin-top: 0;
  transition:
    max-height .32s cubic-bezier(.2,.75,.2,1),
    opacity .22s ease,
    transform .32s cubic-bezier(.2,.75,.2,1),
    margin .32s ease;
}

.submenu--etc.is-open {
  max-height: 190px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  margin-top: 8px;
}

.nav-item--etc[aria-expanded="true"] {
  color: var(--green);
}



/* V16: soften the navigation's vertical repositioning between views. */
.site.sidebar-in-motion .sidebar {
  filter: blur(.55px);
  opacity: .94;
  transform: translateY(1px);
}

/* V15: on work pages, align the top of the left navigation with the first row of work images. */
.site[data-current-section="painting"] .sidebar,
.site[data-current-section="object"] .sidebar,
.site[data-current-section="exhibition"] .sidebar,
.site[data-current-section="tattoo"] .sidebar,
.site[data-current-section="clock"] .sidebar,
.site[data-current-section="small"] .sidebar {
  top: calc(var(--content-top) + var(--work-control-block));
}

/* ===================== CONTENT ===================== */

.portfolio-main {
  min-height: 100svh;
  margin-left: var(--content-left);
  padding: var(--content-top) 48px 56px 0;
  background: #fff;
}

.site:not(.has-selection) .portfolio-main {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding-top: var(--content-top);
  padding-bottom: 18px;
}


/* V17: the home slideshow uses the viewport's true center axis,
   matching the centered artist name above it. */
.site:not(.has-selection) .portfolio-main {
  margin-left: 0;
  padding-left: 0;
  padding-right: 0;
}

.site:not(.has-selection) .content-panel--home,
.site:not(.has-selection) .hero-stage {
  width: 100vw;
  max-width: 100vw;
}

.site:not(.has-selection) .hero-image {
  object-position: 50% 50%;
}

.content-panel {
  display: none;
  min-height: calc(100svh - var(--content-top) - 30px);
}

.content-panel.is-active {
  display: block;
  animation: panelIn .4s cubic-bezier(.2,.75,.2,1) both;
}

.content-panel.is-exiting {
  display: block;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .17s ease, transform .17s ease;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.content-panel--home {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.hero-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.hero-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: 50% 50%;
  opacity: 1;
  transition: opacity .8s ease-in-out;
  will-change: opacity;
}

.hero-image.is-fading { opacity: 0; }

.hero-counter {
  position: absolute;
  right: 0;
  bottom: 0;
  color: var(--muted);
  font-family: "Roboto Mono", monospace;
  font-size: 10px;
  letter-spacing: .05em;
}

.work-panel {
  position: relative;
}

.work-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin: 0 0 24px;
  padding: 9px 0 12px;
}

.work-controls {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.work-controls__label {
  margin-right: 3px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .02em;
  text-transform: uppercase;
}


.grid-density {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 11px;
}

.grid-density__button {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  padding: 2px 0 3px;
  color: var(--muted);
  cursor: pointer;
  font-family: "Roboto Mono", monospace;
  font-size: 11px;
  line-height: 1;
  transition:
    color .16s ease,
    border-color .16s ease,
    opacity .16s ease;
}

.grid-density__button:hover {
  color: var(--red);
}

.grid-density__button.is-active {
  color: var(--green);
  border-color: currentColor;
}

.view-mode {
  border: 0;
  background: transparent;
  padding: 2px 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  border-bottom: 1px solid transparent;
}

.view-mode:hover { color: var(--red); }

.view-mode.is-active {
  color: var(--green);
  border-color: currentColor;
}

.work-grid {
  --work-cols: 3;
  display: grid;
  grid-template-columns: repeat(var(--work-cols), minmax(0, 1fr));
  gap: 58px 34px;
  align-items: start;
}


.work-grid[data-cols="3"] {
  --work-cols: 3;
}

.work-grid[data-cols="6"] {
  --work-cols: 6;
  gap: 40px 22px;
}

.work-grid[data-cols="9"] {
  --work-cols: 9;
  gap: 30px 14px;
}

.work-grid[data-cols="6"] .work-caption,
.work-grid[data-cols="9"] .work-caption {
  font-size: 10px;
}

.work-grid[data-cols="9"] .work-caption__meta {
  font-size: 9px;
}

.work-card {
  margin: 0;
  min-width: 0;
  cursor: pointer;
}

.work-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.work-caption {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}

.work-caption__title {
  display: block;
  margin-bottom: 2px;
}

.work-caption__meta {
  display: block;
  color: var(--muted);
}

.year-group-label {
  grid-column: 1 / -1;
  margin: 4px 0 -8px;
  font-family: "Roboto Mono", monospace;
  color: var(--ink);
  font-size: 12px;
}

.empty-category {
  grid-column: 1 / -1;
  min-height: 52vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

/* ===================== ABOUT ===================== */

.about-page,
.contact-page {
  position: relative;
  display: block;
  width: 100%;
  max-width: none;
  min-height: calc(100svh - var(--content-top) - 54px);
  padding: 0;
  overflow: hidden;
}

.about-page {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0 0 clamp(28px, 5vh, 60px);
}

.about-feature {
  display: block;
  width: min(var(--about-image-width, 440px), 100%);
  height: auto;
  max-height: none;
  margin: 0 0 clamp(42px, 6vh, 72px);
  object-fit: contain;
  object-position: left top;
  flex: 0 0 auto;
}

.about-intro {
  max-width: 720px;
  margin: 0 0 34px;
  color: #5a5b56;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.biography-list {
  display: grid;
  gap: 6px;
  width: min(940px, 100%);
}

.bio-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.bio-year {
  font-family: "Roboto Mono", monospace;
  color: #4f504c;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.58;
}

.bio-text {
  color: #565752;
  font-size: 14px;
  line-height: 1.58;
}


.about-subtitle {
  margin: 44px 0 17px;
  color: #656660;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .03em;
}

.exhibition-list {
  display: grid;
  gap: 7px;
  width: min(940px, 100%);
}

.exhibition-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) minmax(120px, 220px);
  gap: 30px;
  align-items: start;
}

.exhibition-year {
  font-family: "Roboto Mono", monospace;
  color: #4f504c;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.58;
}

.exhibition-title,
.exhibition-location {
  color: #565752;
  font-size: 14px;
  line-height: 1.58;
}

.exhibition-location {
  color: #777872;
}

/* ===================== CONTACT ===================== */

.contact-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(90px, 16vh, 180px) 0 clamp(60px, 10vh, 120px);
}

.contact-list {
  position: absolute;
  left: clamp(80px, 11vw, 190px);
  top: 38%;
  transform: translateY(-50%);
  display: grid;
  gap: 15px;
  width: min(520px, 44vw);
  z-index: 2;
}

.contact-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
}

.contact-label {
  font-family: "Roboto Mono", monospace;
  color: #868680;
  font-size: 10px;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.contact-value {
  width: max-content;
  max-width: 100%;
  color: #575853;
  font-size: 15px;
  line-height: 1.5;
  text-decoration: none;
}

a.contact-value {
  border-bottom: 1px solid rgba(87,88,83,.27);
  transition: color .16s ease, border-color .16s ease;
}

a.contact-value:hover {
  color: var(--red);
  border-color: currentColor;
}


.contact-art {
  position: absolute;
  z-index: 1;
  right: clamp(42px, 8vw, 130px);
  bottom: 14%;
  top: auto;
  width: clamp(124px, 14vw, 212px);
  max-height: 38vh;
  object-fit: contain;
  transform: none;
  transform-origin: 100% 100%;
  pointer-events: none;
  user-select: none;
}

/* ===================== WORK MODAL ===================== */

.work-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  background: rgba(255,255,255,.985);
  overflow: auto;
}

.work-modal.is-open { display: block; }

.work-modal__close {
  position: fixed;
  z-index: 205;
  top: 16px;
  right: 22px;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  font-size: 34px;
  font-weight: 300;
  cursor: pointer;
}

.work-modal__inner {
  width: min(1180px, calc(100% - 70px));
  margin: 70px auto 100px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, .8fr);
  gap: 50px;
}

.work-modal__images {
  display: grid;
  gap: 24px;
}

.work-modal__images img {
  width: 100%;
  height: auto;
  max-height: 82vh;
  object-fit: contain;
}

.work-modal__meta {
  position: sticky;
  top: 84px;
  align-self: start;
  font-size: 14px;
  line-height: 1.55;
}

.work-modal__meta h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 500;
}

.work-meta-row { margin: 7px 0; }

.work-meta-label {
  color: var(--muted);
  display: inline-block;
  min-width: 78px;
}

.work-description {
  margin-top: 24px;
  white-space: pre-wrap;
}

body.modal-open { overflow: hidden; }

/* ===================== RESPONSIVE ===================== */

@media (max-width: 1050px) {
  :root {
    --content-top: 84px;
    --sidebar-left: 30px;
    --sidebar-width: 172px;
    --content-left: 198px;
  }

  .work-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 44px 24px;
  }

  .portfolio-main {
    padding-right: 28px;
  }
}

@media (max-width: 700px) {

  .work-grid,
  .work-grid[data-cols="3"],
  .work-grid[data-cols="6"],
  .work-grid[data-cols="9"] {
    --work-cols: 1;
  }

  .work-toolbar {
    gap: 18px;
  }

  .grid-density {
    gap: 8px;
  }

  :root {
    --content-top: 72px;
    --sidebar-left: 16px;
    --sidebar-width: 108px;
    --content-left: 126px;
    --clock-width: min(76vw, 350px, calc((100svh - 112px) * .43));
  }

  .portfolio-header {
    height: 50px;
    padding: 0 10px;
  }

  .portfolio-header::after {
    left: 10px;
    right: 10px;
  }

  .portfolio-name {
    font-size: 20px;
    letter-spacing: .065em;
  }

  .language-switch--site button {
    font-size: 10px;
    padding-left: 2px;
    padding-right: 2px;
  }

  .intro-top {
    top: 16px;
    left: 18px;
    right: 18px;
  }

  .intro-name { font-size: 19px; }

  .clock-scene {
    padding: 54px 12px 28px;
  }

  .nav-item--main { font-size: 16px; }
  .nav-item--sub { padding-left: 10px; font-size: 12px; }
  .nav-item--leaf { padding-left: 20px; font-size: 10px; }

  .sidebar-nav { gap: 22px; }

  .portfolio-main {
    padding-right: 10px;
    padding-bottom: 36px;
  }

  .site:not(.has-selection) .portfolio-main {
    padding-bottom: 12px;
  }

  .work-grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .work-controls {
    top: -24px;
  }

  .about-page,
  .contact-page {
    max-width: none;
  }

  .bio-row {
    grid-template-columns: 58px minmax(0,1fr);
    gap: 13px;
  }

  .bio-year { font-size: 12px; }
  .bio-text { font-size: 14px; }

  .contact-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .contact-value { font-size: 16px; }

  .work-modal__inner {
    width: calc(100% - 28px);
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .work-modal__meta { position: static; }
}

@media (max-height: 680px) {
  :root {
    --clock-width: min(31vw, 270px, calc((100svh - 94px) * .40));
  }

  .intro-top { top: 12px; }
  .intro-note { bottom: 8px; }

  .clock-scene {
    padding-top: 42px;
    padding-bottom: 20px;
  }
}

/* V14 refinements */
@media (max-width: 700px) {
  .nav-item--main { font-size: 15px; }
  .nav-item--sub { padding-left: 9px; font-size: 11.5px; }
  .nav-item--leaf { padding-left: 18px; font-size: 10px; }

  .work-controls {
    min-height: 38px;
    margin-bottom: 18px;
    padding: 7px 0 9px;
  }

  .about-page,
  .contact-page {
    min-height: calc(100svh - var(--content-top) - 32px);
  }

  .about-page {
    padding: 28px 0 38px;
  }

  .about-feature {
    width: 132px;
    height: 92px;
    margin-bottom: 30px;
  }

  .bio-row {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
  }

  .bio-year { font-size: 11px; }
  .bio-text { font-size: 12.5px; }

  .contact-page {
    padding: 80px 0 70px;
  }

  .contact-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .contact-value { font-size: 14px; }
}

/* V15 responsive additions */
@media (max-width: 1050px) {
  :root { --work-control-block: 66px; }

  .contact-list {
    left: clamp(30px, 6vw, 80px);
    width: min(430px, 52vw);
  }

  .contact-art {
    right: 20px;
    width: clamp(150px, 24vw, 245px);
  }

  .exhibition-row {
    grid-template-columns: 74px minmax(0, 1fr) minmax(110px, 180px);
    gap: 18px;
  }
}

@media (max-width: 700px) {
  :root { --work-control-block: 56px; }

  .contact-page {
    overflow: visible;
    min-height: calc(100svh - var(--content-top) - 32px);
  }

  .contact-list {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    padding-top: 24vh;
  }

  .contact-art {
    right: 4px;
    top: 56%;
    width: min(34vw, 150px);
    max-height: 42vh;
    opacity: .95;
  }

  .exhibition-row {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
  }

  .exhibition-location {
    grid-column: 2;
    margin-top: -4px;
    font-size: 11.5px;
  }

  .exhibition-year { font-size: 11px; }
  .exhibition-title { font-size: 12.5px; }
  .about-subtitle { margin-top: 34px; }
}


/* V21 — stable touch entrance for iPhone / iPad.
   The visible pendulum keeps animating, but the actual touch target is static. */
.mobile-enter-hit {
  display: none;
}

@media (hover: none), (pointer: coarse) {
  .mobile-enter-hit {
    display: block;
    position: absolute;
    z-index: 30;
    left: 34%;
    right: -4%;
    top: 58%;
    bottom: -3%;
    border: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}


/* V22 — mobile/tablet work density.
   Desktop remains unchanged: 3 / 6 / 9 really means 3 / 6 / 9 columns. */

/* Phone portrait:
   button 3 = 1 column
   button 6 = 2 columns
   button 9 = 3 columns */
@media (max-width: 700px) and (orientation: portrait) {
  .work-grid[data-cols="3"] {
    --work-cols: 1 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    column-gap: 0 !important;
    row-gap: 42px !important;
  }

  .work-grid[data-cols="6"] {
    --work-cols: 2 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 14px !important;
    row-gap: 30px !important;
  }

  .work-grid[data-cols="9"] {
    --work-cols: 3 !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    column-gap: 8px !important;
    row-gap: 22px !important;
  }

  .work-grid[data-cols="6"] .work-caption {
    font-size: 9.5px;
  }

  .work-grid[data-cols="9"] .work-caption {
    font-size: 8px;
    line-height: 1.3;
  }

  .work-grid[data-cols="9"] .work-caption__meta {
    font-size: 7.5px;
  }

  /* Year labels should not steal one grid column. */
  .work-grid .year-group-label {
    grid-column: 1 / -1;
  }

  /* Phone-only Contact: move the three rows much higher. */
  .contact-page {
    padding-top: 28px !important;
  }

  .contact-list {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: 100% !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
}

/* Tablet / iPad portrait:
   button 3 = 2 columns
   button 6 = 3 columns
   button 9 = 4 columns */
@media (min-width: 701px) and (max-width: 1050px) and (orientation: portrait) {
  .work-grid[data-cols="3"] {
    --work-cols: 2 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 28px !important;
    row-gap: 48px !important;
  }

  .work-grid[data-cols="6"] {
    --work-cols: 3 !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    column-gap: 18px !important;
    row-gap: 36px !important;
  }

  .work-grid[data-cols="9"] {
    --work-cols: 4 !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    column-gap: 12px !important;
    row-gap: 28px !important;
  }

  .work-grid .year-group-label {
    grid-column: 1 / -1;
  }
}


/* V23 — density icons replacing 3 / 6 / 9 */
.grid-density__button {
  min-width: 20px;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
}

.density-icon {
  display: grid;
  width: 18px;
  height: 18px;
}

.density-icon i {
  display: block;
  border: 1px solid currentColor;
  box-sizing: border-box;
}

.density-icon--large {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px;
}

.density-icon--medium {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
}

.density-icon--small {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 1px;
}


/* Installation / media player */
.work-media {
  width: 100%;
  margin: 8px 0 34px;
}

.work-media--video {
  aspect-ratio: 16 / 9;
  background: #000;
}

.work-media-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.work-media-player {
  display: block;
  width: 100%;
  max-height: 82vh;
  margin: 8px 0 34px;
  background: #000;
}

.work-audio-player {
  display: block;
  width: min(100%, 720px);
  margin: 20px auto 34px;
}

.work-media-link {
  display: inline-block;
  margin: 12px 0 34px;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* Density icons final: 1x1 / 2x2 / 3x3 */
.density-icon--large {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  gap: 0;
}

.density-icon--large i:nth-child(n+2) {
  display: none;
}

.density-icon--medium {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px;
}

.density-icon--medium i:nth-child(n+5) {
  display: none;
}

.density-icon--small {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
}

.density-icon--small i:nth-child(n+10) {
  display: none;
}
