/* GILME artist site — shared styles
   Design tokens first; every page uses only these values. */
:root {
  --bg: #f7f3e7;          /* page background (from the artist's exhibition poster) */
  --ink: #111111;         /* primary text */
  --muted: #6b6b6b;       /* secondary text — 4.8:1 on --bg */
  --line: #e2dbc9;        /* section dividers */
  --underline: #a89f8e;   /* resting underline of clickable titles */
  --sep: #b9b0a0;         /* "KO / EN" slash */
  --placeholder: #efe9da; /* image placeholder fill */
  --font: 'IBM Plex Sans KR', system-ui, sans-serif;
  --pad-x: 40px;
  --container: 1120px;
  --ease-calm: cubic-bezier(0.22, 0.61, 0.36, 1);  /* scroll reveals, collage */
  --ease-panel: cubic-bezier(0.4, 0, 0.2, 1);      /* expand / collapse panels */
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--muted); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
.muted { color: var(--muted); }

/* ---------- header (same on every page) ---------- */
.site-header { flex: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 40px; padding: 28px var(--pad-x); }
.logo { font-size: 17px; font-weight: 500; letter-spacing: 0.24em; }
.nav { display: flex; align-items: center; gap: 32px; font-size: 14px; letter-spacing: 0.02em; }
.nav a { color: var(--muted); }
.nav a[aria-current="page"] { color: var(--ink); }
.lang { display: flex; align-items: center; gap: 6px; margin-left: 8px; font-size: 12px; letter-spacing: 0.06em; }
.lang button { padding: 12px 2px; color: var(--muted); }
.lang button[aria-pressed="true"] { color: var(--ink); }
.lang .slash { color: var(--sep); }

/* ---------- page container + CV-style sections (About, Music, Art index) ---------- */
.page { min-height: 100vh; overflow-x: clip; }
.container { max-width: var(--container); margin: 0 auto; padding: 96px var(--pad-x) 140px; display: flex; flex-direction: column; gap: 72px; }
.row { display: flex; flex-wrap: wrap; gap: 12px 48px; border-top: 1px solid var(--line); padding-top: 24px; }
.row-label { flex: 0 0 180px; margin: 0; font-size: 13px; font-weight: 400; letter-spacing: 0.04em; color: var(--muted); }
.row-body { flex: 999 1 520px; min-width: 0; }
.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.list li { display: flex; gap: 24px; font-size: 15px; line-height: 1.65; }
.list .year { flex: 0 0 40px; color: var(--muted); font-variant-numeric: tabular-nums; }
.list .text { flex: 1 1 auto; min-width: 0; word-break: keep-all; }
.ul-link { text-decoration: underline; text-underline-offset: 0.3em; text-decoration-thickness: 1px; text-decoration-color: var(--underline); }

/* ---------- 4-column thumbnail grid (Art index, Music) ---------- */
.grid4 { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 56px 32px; }
.grid4 li { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.thumb-caption { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.5; word-break: keep-all; }
@media (max-width: 900px) { .grid4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 16px; } }

/* ---------- scroll reveal: slow rise + fade, staggered by --d ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 1.2s var(--ease-calm) var(--d, 0ms), transform 1.4s var(--ease-calm) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* ================= ART (index.html) ================= */
body.is-slide { height: 100vh; overflow: hidden; }
.art-root { display: flex; flex-direction: column; min-height: 100vh; }
body.is-slide .art-root { height: 100vh; }
body.is-slide .art-index, body.is-index .art-slide { display: none !important; }

.art-slide { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.stage-wrap { flex: 1 1 auto; min-height: 0; display: flex; padding: 8px var(--pad-x) 0; }
.stage { flex: 1 1 auto; min-height: 0; min-width: 0; position: relative; }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 0.8s ease; }
.stage img.on { opacity: 1; }

.art-footer { flex: none; padding: 20px var(--pad-x) 28px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 40px; }
.caption { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 13px; line-height: 1.6; text-align: left; }
button.caption .cap-title { text-decoration: underline; text-underline-offset: 0.3em; text-decoration-thickness: 1px; text-decoration-color: var(--underline); }
button.caption[aria-expanded="true"] .cap-title { text-decoration-color: var(--ink); }
button.caption { cursor: pointer; }
.controls { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.icon-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.vsep { width: 1px; height: 16px; background: #ddd5c2; margin: 0 8px; }

.info { height: 0; overflow: hidden; visibility: hidden; transition: height 1s var(--ease-panel), visibility 1s; }
.info.open { height: 136px; visibility: visible; }
.info-scroll { height: 100%; padding-top: 16px; overflow-y: auto; opacity: 0; transition: opacity 0.8s ease 0.2s; }
.info.open .info-scroll { opacity: 1; }
.info p { max-width: 640px; margin: 0; word-break: keep-all; }
.info .note { margin-bottom: 12px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.info .desc { font-size: 14px; line-height: 1.8; white-space: pre-line; }

.art-index .container { gap: 120px; }
.exhibition { display: flex; flex-direction: column; gap: 40px; }
.ex-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 40px; border-top: 1px solid var(--line); padding-top: 16px; }
.ex-title-wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; }
.ex-title { margin: 0; font-size: 20px; font-weight: 400; letter-spacing: 0.02em; }
.ex-title button { letter-spacing: inherit; text-align: left; text-decoration: underline; text-underline-offset: 0.3em; text-decoration-thickness: 1px; text-decoration-color: var(--underline); }
.ex-title button[aria-expanded="true"] { text-decoration-color: var(--ink); }
.ex-meta { font-size: 13px; color: var(--muted); }
.intro { display: grid; grid-template-rows: 0fr; margin-top: -40px; visibility: hidden; transition: grid-template-rows 1s var(--ease-panel), margin-top 1s var(--ease-panel), visibility 1s; }
.intro.open { grid-template-rows: 1fr; margin-top: 0; visibility: visible; }
.intro > div { min-height: 0; overflow: hidden; }
.intro-body { display: flex; flex-direction: column; gap: 16px; max-width: 640px; opacity: 0; transition: opacity 0.8s ease 0.2s; }
.intro.open .intro-body { opacity: 1; }
.intro-body p { margin: 0; }
.intro .tagline { font-size: 13px; color: var(--muted); }
.intro .st-title { font-size: 15px; }
.intro .statement { font-size: 14px; line-height: 1.85; word-break: keep-all; white-space: pre-line; }
.work-thumb { display: block; width: 100%; }
.work-thumb img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; object-position: center bottom; }

/* ================= ABOUT ================= */
.intro-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 40px 64px; }
.profile-img { flex: 0 0 280px; width: 280px; height: auto; }
.statement-col { flex: 1 1 400px; min-width: 0; }
.statement-col .paras { display: flex; flex-direction: column; gap: 24px; max-width: 720px; }
.statement-col p { margin: 0; font-weight: 300; word-break: keep-all; font-size: 22px; line-height: 1.85; }
html[lang="en"] .statement-col p { font-size: 24px; line-height: 1.65; }
.bio { margin: 0; font-size: 15px; line-height: 1.8; word-break: keep-all; }
.contact { display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.65; }

/* photo collage: positions are % of the box, so it scales with width */
.collage-row { display: flex; flex-wrap: wrap; gap: 12px 48px; padding-bottom: 24px; }
.collage-row .spacer { flex: 0 0 180px; }
.collage { --k: 1; --kx: 1; flex: 999 1 520px; min-width: 0; position: relative; aspect-ratio: 892 / 620; }
.toss {
  position: absolute; display: block; left: calc(var(--x) * var(--kx)); top: var(--y); width: calc(var(--w) * var(--k));
  background: #ffffff; padding: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  transform: rotate(var(--r)); transform-origin: var(--ox, center) center; z-index: var(--z);
  transition: transform 0.45s var(--ease-panel), box-shadow 0.45s ease;
  cursor: default; -webkit-tap-highlight-color: transparent; outline: none;
}
.toss:hover, .toss:focus { transform: rotate(0deg) scale(1.5); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22); z-index: 50; }
.toss img { width: 100%; height: auto; pointer-events: none; user-select: none; -webkit-user-select: none; }
.collage:not(.in) .toss { opacity: 0; }
.collage.in .toss { animation: toss-in 1.6s var(--ease-calm) var(--dl, 0s) backwards; }
@keyframes toss-in {
  0% { opacity: 0; transform: translateY(-28px) rotate(calc(var(--r) * 2.2)) scale(1.08); }
  45% { opacity: 1; }
  100% { opacity: 1; transform: rotate(var(--r)); }
}

/* ================= MUSIC ================= */
.cover { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--placeholder); }

/* ================= mobile ================= */
@media (max-width: 640px) {
  .profile-img { flex: 1 1 100%; width: 100%; }
  .collage { --k: 1.55; --kx: 0.85; aspect-ratio: 1 / 1; }
  .toss { padding: 4px; }
  .toss:hover, .toss:focus { transform: rotate(0deg) scale(1.3); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .collage .toss { animation: none !important; opacity: 1 !important; }
  .stage img, .info, .info-scroll, .intro, .intro-body { transition: none; }
}
