/* =========================================================
   Kim Hye Jung — works raster
   Palette: 5 values only. Type: Inter only.
   ========================================================= */

:root {
  --ink: #000000;
  --paper: #ffffff;
  --grey-600: #6b6b6b; /* secondary type */
  --grey-300: #c9c9c9; /* dim / disabled */
  --rule: #e4e4e4; /* hairlines */
  --page-accent: #d8d5ca;

  --thumb-w: 120px;
  --thumb-h: 90px;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);

  --t: 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  background: var(--paper);
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

/* Author `display` declarations below (.view, .raster) would otherwise beat
   the user-agent [hidden] rule, since author styles always win over UA styles
   regardless of specificity. Keep this before any layout rules. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.75rem;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}

/* ---------------------------------------------------------
   Masthead
   --------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: var(--gutter) var(--gutter) 0;
}

.masthead__name {
  letter-spacing: 0.01em;
}

.masthead__nav {
  display: flex;
  gap: 1.25rem;
}

.nav-link {
  display: inline-block;
  color: var(--grey-600);
  padding: 0 .18em;
  margin: 0 -.18em;
  transition: color var(--t), background-color var(--t);
}
.nav-link:hover,
.nav-link.is-current,
.nav-link:focus-visible {
  color: var(--ink);
  background: var(--link-accent, var(--page-accent));
}

body[data-page="landing"] { --page-accent: #d8d5ca; }
body[data-page="works"] { --page-accent: #cbd7d2; }
body[data-page="about"] { --page-accent: #d6ced4; }
body[data-page="info"] { --page-accent: #d3d8c8; }
body[data-page="exhibitions"] { --page-accent: #d9cfc1; }
body[data-page="contact"] { --page-accent: #d8cfc9; }

/* ---------------------------------------------------------
   Shell
   --------------------------------------------------------- */

.shell {
  flex: 1 0 auto;
  padding: clamp(3rem, 9vh, 6.5rem) var(--gutter) 0;
}

/* ---------------------------------------------------------
   Works raster
   --------------------------------------------------------- */

.raster {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 0.75rem;
}

/* Each thumb is exactly the image footprint, so the colour revealed on hover
   fills the same rectangle the painting occupied. */
.thumb {
  position: relative;
  display: block;
  width: var(--thumb-w);
  height: var(--thumb-h);
  background-color: var(--swatch, var(--rule));
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--t);
}

.thumb:hover img,
.thumb:focus-visible img {
  opacity: 0;
}

/* Title/year appear only while a thumb is engaged, so the grid stays
   wordless at rest. */
.thumb::after {
  content: attr(data-label);
  position: absolute;
  left: 0;
  top: calc(100% + 0.4rem);
  width: 190%;
  color: var(--grey-600);
  font-size: 0.6875rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}

.thumb:hover::after,
.thumb:focus-visible::after {
  opacity: 1;
}

/* ---------------------------------------------------------
   Detail
   --------------------------------------------------------- */

.view--detail {
  max-width: 62rem;
}

.detail__back {
  display: inline-block;
  margin-bottom: clamp(2rem, 6vh, 3.5rem);
  color: var(--grey-600);
  transition: color var(--t);
}
.detail__back::before {
  content: "← ";
}
.detail__back:hover {
  color: var(--ink);
}

.detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10rem;
  gap: clamp(2rem, 7vw, 6rem);
  align-items: start;
}

.detail__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail__aside {
  padding-top: clamp(8rem, 24vh, 15rem);
}

.detail__thumbnails {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-top: 2rem;
}

.detail__thumb {
  appearance: none;
  border: 1px solid transparent;
  padding: 0;
  background: none;
  cursor: pointer;
  opacity: 0.58;
}
.detail__thumb:hover,
.detail__thumb.is-selected { opacity: 1; border-color: var(--ink); }
.detail__thumb img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }


/* The stage is a button so the zoom toggle is keyboard-reachable, but it must
   not read as one. */
.detail__stage {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  font: inherit;
  color: inherit;
  display: block;
  width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  text-align: left;
  cursor: zoom-in;
}

/* Cap the unzoomed painting so the caption and nav stay in view without
   scrolling; the zoomed state below is free to overflow and pan. */
.detail__stage:not(.is-zoomed),
.detail__stage:not(.is-zoomed) img {
  max-height: 58vh;
}

.detail__stage img {
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: left top;
}

.detail__stage.is-zoomed {
  cursor: zoom-out;
}
.detail__stage.is-zoomed img {
  width: 190%;
  max-width: none;
  max-height: none;
}

.detail__caption {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 34rem;
}

.detail__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.detail__spec,
.detail__note {
  margin: 0;
  color: var(--grey-600);
}

.detail__note {
  margin-top: 0.5rem;
  text-wrap: pretty;
}

.detail__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  color: var(--grey-600);
  font-size: 1.25rem;
}
.detail__grid { font-size: 1.7rem; line-height: 1; }


.detail__nav a {
  transition: color var(--t);
}
.detail__nav a:hover {
  color: var(--ink);
}
.detail__nav a[aria-disabled="true"] {
  color: var(--grey-300);
  pointer-events: none;
}

/* ---------------------------------------------------------
   Info / Contact
   --------------------------------------------------------- */

.view--text {
  max-width: 40rem;
}

.about-view { max-width: 62rem; }
.about-layout { display: grid; grid-template-columns: minmax(14rem, 22rem) minmax(0, 1fr); gap: clamp(2rem, 7vw, 6rem); align-items: start; }
.about-portrait { min-height: 22rem; margin: 0; background: var(--grey-100); overflow: hidden; }
.about-portrait img { display: block; width: 100%; height: auto; object-fit: cover; }
@media (max-width: 40rem) { .about-layout { grid-template-columns: 1fr; } .about-portrait { min-height: 18rem; } }

.view__title {
  margin: 0 0 clamp(2rem, 6vh, 3rem);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.prose p {
  margin: 0 0 1.25rem;
  max-width: 36rem;
  text-wrap: pretty;
}
.prose em {
  font-style: italic;
}

.facts {
  margin: clamp(2rem, 6vh, 3rem) 0 0;
  display: flex;
  flex-direction: column;
}

.facts__row {
  display: flex;
  gap: 1.5rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--rule);
}

.facts dt {
  flex: 0 0 8.5rem;
  color: var(--grey-600);
}

.facts dd {
  margin: 0;
}

.facts a {
  padding: 0 .18em;
  margin: 0 -.18em;
  transition: color var(--t), background-color var(--t);
}
.facts a:hover,
.facts a:focus-visible {
  color: var(--ink);
  background: var(--page-accent);
}

/* ---------------------------------------------------------
   Exhibition index + hover preview
   --------------------------------------------------------- */
.archive-view { max-width: none; display: grid; grid-template-columns: minmax(30rem, 1fr) minmax(20rem, 36vw); gap: clamp(3rem, 10vw, 10rem); align-items: start; }
.archive-view--inverted { grid-template-columns: minmax(20rem, 36vw) minmax(30rem, 1fr); }
.exhibition-index { min-width: 0; }
.exhibition-list { border-top: 1px solid var(--rule); }
.exhibition-row { display: grid; grid-template-columns: 3rem minmax(8rem, 1fr) minmax(11rem, 1.2fr); gap: 1rem; align-items: baseline; padding: .75rem .35rem; margin: 0 -.35rem; border-bottom: 1px solid var(--rule); color: var(--grey-600); transition: color var(--t), background-color var(--t); }
.exhibition-row em { color: var(--ink); font-style: normal; }
.exhibition-row:hover, .exhibition-row:focus-visible, .exhibition-row.is-active { color: var(--ink); background: var(--row-accent, var(--page-accent)); }
.exhibition-row:hover em, .exhibition-row:focus-visible em, .exhibition-row.is-active em { color: var(--ink); }
.exhibition-preview { position: sticky; top: 5rem; margin: 0; }
.exhibition-preview img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--grey-100); }
.exhibition-preview__gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin-top: .35rem; }
.exhibition-preview__gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--grey-100); }
.exhibition-preview figcaption { margin-top: .65rem; color: var(--grey-600); font-size: .6875rem; }

/* ---------------------------------------------------------
   Colophon
   --------------------------------------------------------- */

.colophon {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(4rem, 12vh, 7rem) var(--gutter) var(--gutter);
  color: var(--grey-300);
  font-size: 0.6875rem;
}

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

@media (max-width: 40rem) {
  :root {
    --thumb-w: 88px;
    --thumb-h: 66px;
  }

  .raster {
    gap: 1.25rem 0.5rem;
  }

  /* No hover on touch, so the label would never be reachable. */
  .thumb::after {
    display: none;
  }

  .detail__stage.is-zoomed img {
  width: 260%;
  }

  .detail__layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .detail__aside { padding-top: 0; }
  .detail__nav { max-width: 10rem; }
  .detail__thumbnails { max-width: 16rem; margin-top: 1.25rem; }

  .facts__row {
    flex-direction: column;
    gap: 0.25rem;
  }

  .archive-view, .archive-view--inverted { display: block; }
  .archive-view--inverted .exhibition-preview { margin-top: 0; margin-bottom: 3rem; }
  .exhibition-preview { position: static; margin-top: 3rem; }
  .exhibition-row { grid-template-columns: 3rem 1fr; gap: .5rem 1rem; }
  .exhibition-row span:last-child { grid-column: 2; color: var(--grey-600); }

  .facts dt {
    flex: none;
  }
}

/* Landing / fold-out menu */
.landing { min-height: 100vh; display: grid; place-items: center; position: fixed; inset: 0; z-index: 20; overflow: hidden; background: var(--paper); }
.landing__video, .landing__veil { position: absolute; inset: 0; width: 100%; height: 100%; }
.landing__video { object-fit: cover; object-position: center; }
.landing__veil { background: rgba(255, 255, 255, .18); pointer-events: none; }
.landing__name { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; color: var(--ink); line-height: 1; transition: transform 700ms cubic-bezier(.16,1,.3,1); }
.landing__ko { font-size: clamp(3.5rem, 11vw, 9rem); font-weight: 400; letter-spacing: -.12em; margin-right: -.12em; transition: letter-spacing 600ms ease, transform 600ms ease; }
.landing__latin { margin-top: 1.2rem; font-size: clamp(.8rem, 1.5vw, 1.2rem); letter-spacing: .6em; margin-right: -.6em; transition: letter-spacing 600ms ease; }
.landing__name { padding: .5rem .75rem; transition: background-color var(--t); }
.landing__name:hover, .landing__name:focus-visible { background: var(--page-accent); }
.landing__name:hover .landing__ko, .landing__name:focus-visible .landing__ko { letter-spacing: .12em; transform: scaleX(.86); }
.landing__name:hover .landing__latin, .landing__name:focus-visible .landing__latin { letter-spacing: .18em; }
.landing__prompt { position: absolute; bottom: 2rem; margin: 0; color: var(--grey-600); font-size: .6875rem; letter-spacing: .12em; text-transform: lowercase; }
body.is-inside .landing { display: none; }
@media (prefers-reduced-motion: reduce) { .landing__video { display: none; } }
.masthead { position: relative; z-index: 10; padding-top: 1.5rem; }
.masthead__name span { color: var(--grey-600); margin-left: .45rem; font-size: .6875rem; letter-spacing: .12em; }
.menu-toggle { appearance: none; border: 0; padding: 0; background: transparent; color: var(--grey-600); font: inherit; cursor: pointer; }
.masthead__nav { position: absolute; top: 3.25rem; right: var(--gutter); display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; max-height: 0; overflow: hidden; opacity: 0; transform: translateY(-.35rem); transition: max-height 280ms ease, opacity 180ms ease, transform 280ms ease; }
.masthead__nav.is-open { max-height: 12rem; opacity: 1; transform: translateY(0); }
.masthead__nav .nav-link { color: var(--ink); }
.masthead__nav .nav-link:hover, .masthead__nav .nav-link.is-current { background: var(--page-accent); }
.contact-form { display: flex; flex-direction: column; max-width: 28rem; gap: .5rem; }
.contact-form label { color: var(--grey-600); margin-top: .75rem; }
.contact-form input, .contact-form textarea { border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; padding: .35rem 0; background: transparent; color: var(--ink); font: inherit; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: 0; border-color: var(--ink); }
.contact-form button { align-self: flex-start; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); padding: .45rem .8rem; margin-top: 1rem; font: inherit; cursor: pointer; }
.form-status { color: var(--grey-600); margin: .75rem 0 0; }
@media (max-width: 40rem) { .masthead__name span { display: none; } .masthead__nav { right: var(--gutter); } }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}
