/* Orion Cho — the front of the site: home, piece pages, exhibitions, about.
   Light by default, with lots of white space and her name set wide and heavy (the references
   she sent: anthonyburrill.com, claradelorenzi.com, leeporterdesign.com). The /art deck keeps
   its own darkroom styling in art.css; both read the same `theme` key, so a choice made on one
   carries to the other. */

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

:root {
  --bg: #fbfaf7;
  --fg: #141414;
  --dim: #6b6862;
  --line: rgba(20, 20, 20, 0.12);
  --tile-bg: #ecebe6;
  --accent: #b2261c;
  --gutter: clamp(16px, 4vw, 48px);
  --wide: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Archivo', -apple-system, 'Segoe UI', Roboto, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0e0e10;
  --fg: #ece9e4;
  --dim: #9a968f;
  --line: rgba(236, 233, 228, 0.14);
  --tile-bg: #1a191c;
  --accent: #ff6a5c;
}

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-head.scrolled { border-bottom-color: var(--line); }
.site-head .brand {
  font-family: var(--wide);
  font-stretch: 125%;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.site-head nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.site-head nav a {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--dim);
  transition: color 0.2s;
}
.site-head nav a:hover, .site-head nav a[aria-current="page"] { color: var(--fg); }
.theme-toggle {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: none;
  color: var(--fg);
  cursor: pointer;
}
.theme-toggle svg { width: 16px; height: 16px; }
:root[data-theme="dark"] .theme-toggle .i-moon,
:root:not([data-theme="dark"]) .theme-toggle .i-sun { display: none; }

@media (max-width: 560px) {
  .site-head { gap: 12px; }
  .site-head .brand { font-size: 0.8rem; }
  .site-head nav { gap: 12px; }
  .site-head nav a { font-size: 0.68rem; letter-spacing: 0.1em; }
  .site-head nav .ig { display: none; }
}

main { padding: 0 var(--gutter); }

/* ---------- home masthead ---------- */
.masthead { padding: clamp(48px, 10vw, 140px) 0 clamp(40px, 7vw, 96px); }
.masthead h1 {
  font-family: var(--wide);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(3rem, 13vw, 11rem);
  line-height: 0.86;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.masthead p {
  margin-top: 22px;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  color: var(--dim);
  letter-spacing: 0.04em;
}

.now-showing {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
  padding: 14px 0;
  margin-bottom: clamp(32px, 6vw, 72px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.now-showing .label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.now-showing .what { font-weight: 700; }
.now-showing .where { color: var(--dim); }
.now-showing:hover .what { text-decoration: underline; }

/* ---------- sections + tiles ---------- */
.section { margin-bottom: clamp(64px, 10vw, 140px); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.section-head h2 {
  font-family: var(--wide);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.section-head a {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  white-space: nowrap;
}
.section-head a:hover { color: var(--fg); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 28px);
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .grid { gap: 10px; } }

.tile { text-decoration: none; display: block; }
.tile .frame {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--tile-bg);
}
/* Cropped to fill the square, then panned along whichever axis was cropped, so no part of the
   work is permanently cut off — the hidden part slides into view. --p0/--p1 are set per tile
   from the image's own proportions in site.js. */
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--p0, 50% 50%);
  transition: object-position 7s ease-in-out, transform 0.6s ease;
}
@media (hover: hover) {
  .tile:hover img { object-position: var(--p1, 50% 50%); }
}
@media (hover: none) {
  .tile.in img { animation: pan 9s ease-in-out 0.8s 2 alternate; }
}
@keyframes pan {
  from { object-position: var(--p0, 50% 50%); }
  to   { object-position: var(--p1, 50% 50%); }
}
.tile .cap {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  font-size: 0.85rem;
}
.tile .cap .t { font-weight: 600; }
.tile .cap .m {
  color: var(--dim);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: right;
  padding-top: 3px;
}
@media (max-width: 560px) { .tile .cap .m { display: none; } }

/* ---------- scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2, .7, .2, 1);
}
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .tile img { transition: none; }
  .tile.in img { animation: none; }
}

/* ---------- piece page ---------- */
.piece {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
  padding: clamp(28px, 5vw, 64px) 0 clamp(48px, 8vw, 96px);
}
@media (max-width: 860px) { .piece { grid-template-columns: 1fr; } }
.piece figure img {
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  object-position: left top;
}
.piece figure a { display: block; cursor: zoom-in; }
.piece .text { position: sticky; top: 90px; }
@media (max-width: 860px) { .piece .text { position: static; } }
.piece .kicker {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
}
.piece h1 {
  font-family: var(--wide);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.02;
  text-transform: uppercase;
  margin: 10px 0 18px;
}
.piece dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; font-size: 0.92rem; }
.piece dt { color: var(--dim); }
.piece .statement { margin-top: 28px; }
.piece .statement p + p { margin-top: 1em; }
.piece .shown { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.92rem; }
.piece .shown h2 { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; font-weight: 600; }
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 64px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}
.pager a { text-decoration: none; color: var(--dim); }
.pager a:hover { color: var(--fg); }
.missing { padding: 120px 0; text-align: center; color: var(--dim); }

/* ---------- page heading (exhibitions, about) ---------- */
.page-title {
  font-family: var(--wide);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(2.4rem, 8vw, 6rem);
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  padding: clamp(40px, 8vw, 110px) 0 clamp(28px, 5vw, 64px);
}

/* ---------- exhibitions ---------- */
.show {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(28px, 4vw, 48px) 0 clamp(48px, 7vw, 88px);
  border-top: 1px solid var(--line);
}
@media (max-width: 860px) { .show { grid-template-columns: 1fr; } }
.show .status {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
}
.show .status.past { color: var(--dim); }
.show h2 {
  font-family: var(--wide);
  font-stretch: 125%;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 0.95;
  text-transform: uppercase;
  margin: 8px 0 6px;
}
.show .kind { color: var(--dim); margin-bottom: 18px; }
.show blockquote { font-style: italic; margin: 0 0 20px; }
.show dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 0.95rem; }
.show dt { color: var(--dim); }
.show .with { margin-top: 26px; }
.show .with h3 { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; font-weight: 600; }
.show .with .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flyers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.flyers a { display: block; }
.flyers img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }

/* ---------- about ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
  padding-bottom: clamp(48px, 8vw, 110px);
}
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }
.about img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.about .lines p { font-size: clamp(1.1rem, 2.2vw, 1.5rem); line-height: 1.35; }
.about .lines .role { font-weight: 700; }
.about .contact { margin-top: 32px; display: grid; gap: 8px; }
.about .contact a { font-size: 1rem; }

/* ---------- footer ---------- */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 28px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--dim);
}
.site-foot a { color: var(--dim); }
.site-foot a:hover { color: var(--fg); }
