/* Katie Kim — public site. Minimal on purpose: the art does the talking. */

:root {
  --bg: #fbfaf7;
  --ink: #1b1a19;
  --muted: #77716a;
  --line: #e7e3dc;
  --accent: #ff4a2a;
  --gap: 14px;
  --pad: clamp(16px, 4vw, 48px);
  --max: 1440px;
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) 72px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- header ---------- */

.site-header {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px) var(--pad) clamp(24px, 3.5vw, 40px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
  flex-wrap: wrap;
}

.brand { text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.brand-name {
  font-weight: 800;
  font-stretch: 125%;
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--accent);
}
.brand-logo { max-height: 72px; width: auto; }
.brand-tagline {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
  padding-left: 2px;
}

.site-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; padding-bottom: 4px; }
.site-nav a {
  text-decoration: none;
  text-transform: lowercase;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--ink);
  position: relative;
  padding: 2px 0;
}
.site-nav a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.site-nav a:hover::after, .site-nav a.active::after { transform: scaleX(1); }
.site-nav a.active { color: var(--accent); }

/* ---------- headings ---------- */

.page-heading {
  font-size: 15px;
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0 0 20px;
}
.page-intro { max-width: 60ch; margin-bottom: 24px; }
.empty { color: var(--muted); padding: 40px 0; }

/* ---------- grid ---------- */
/* Without JavaScript this is a plain 6-column CSS grid; pack.js then positions
   tiles absolutely in a tightly packed layout (class .is-packed). */

.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--gap);
  align-items: start;
}
.tile--s { grid-column: span 2; }
.tile--m { grid-column: span 3; }
.tile--l { grid-column: span 4; }
.tile--xl { grid-column: span 6; }
@media (max-width: 600px) {
  .grid:not(.is-packed) { grid-template-columns: 1fr; }
  .grid:not(.is-packed) .tile { grid-column: auto; }
}

.grid.is-packed { display: block; position: relative; }
.grid.is-packed > .tile { position: absolute; top: 0; left: 0; margin: 0; }

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--line);
  text-decoration: none;
  aspect-ratio: var(--ar);
}
.grid--square .tile { aspect-ratio: 1; }
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .3s;
}
.tile-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 14px 12px;
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  background: linear-gradient(transparent, rgba(0,0,0,.5));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s, transform .3s;
}
.tile-caption small { display: block; font-size: 12px; opacity: .85; }
@media (hover: hover) {
  a.tile:hover img, .tile-media:hover img { transform: scale(1.025); }
  .tile:hover .tile-caption, .tile:focus-visible .tile-caption { opacity: 1; transform: none; }
}
.tile:focus-visible, .tile-media:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* project page tiles: image + caption underneath */
.tile--figure { aspect-ratio: auto; background: none; overflow: visible; margin: 0; }
.tile-media {
  all: unset;
  display: block;
  width: 100%;
  aspect-ratio: var(--ar);
  overflow: hidden;
  background: var(--line);
  cursor: zoom-in;
}
.tile--figure figcaption { padding: 8px 0 4px; font-size: 14px; line-height: 1.45; }
.tile--figure figcaption .muted { color: var(--muted); }
.fig-desc { display: block; color: var(--muted); margin-top: 2px; }

/* ---------- project page ---------- */

.project-head { max-width: 760px; margin: clamp(8px, 3vw, 40px) 0 clamp(32px, 5vw, 64px); }
.project-title {
  font-size: clamp(36px, 6.4vw, 84px);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0 0 20px;
}
.project-sub { font-weight: 700; text-transform: uppercase; font-size: 15px; letter-spacing: 0.02em; margin: 0 0 18px; }
.project-sub span { font-weight: 500; }
.project-nav { margin-top: 56px; }

/* ---------- single piece ---------- */

.piece {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}
.piece-images { display: flex; flex-direction: column; gap: var(--gap); }
.piece-img {
  all: unset;
  cursor: zoom-in;
  display: block;
}
.piece-img:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.piece-img img { width: 100%; height: auto; max-height: 88vh; object-fit: contain; object-position: left top; }

.piece-info { position: sticky; top: 32px; }
.piece-title {
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 700;
  font-stretch: 112%;
  line-height: 1.1;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.piece-meta { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.piece-desc p { margin: 0 0 1em; }

.chips { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a {
  display: inline-block;
  font-size: 13px;
  padding: 3px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  text-transform: lowercase;
  transition: border-color .2s, color .2s;
}
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.chips a.tag { color: var(--muted); }

.piece-nav {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  font-size: 14px;
}
.piece-nav a { text-decoration: none; }
.piece-nav a:hover { color: var(--accent); }
.piece-nav [rel="next"] { text-align: right; }
.piece-back { color: var(--muted); text-align: center; }

/* photo viewer */
html.lightbox-open { overflow: hidden; }
.lightbox {
  border: 0; padding: 0; margin: 0;
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  /* soft grey veil: the gallery stays faintly visible behind the picture */
  background: rgba(58, 56, 53, .8);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  color: #f2efe9;
  overscroll-behavior: contain;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; animation: lb-in .25s ease; }
.lightbox::backdrop { background: transparent; }
@keyframes lb-in { from { opacity: 0; } }
.lightbox-stage {
  margin: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 56px clamp(16px, 8vw, 96px) 20px;
  cursor: zoom-out;
}
.lightbox-stage img {
  max-width: 100%; max-height: calc(100dvh - 120px); width: auto; height: auto;
  object-fit: contain; cursor: default;
  opacity: 0; transition: opacity .25s ease;
  box-shadow: 0 10px 50px rgba(0,0,0,.4);
}
.lightbox-stage img.loaded { opacity: 1; }
.lightbox-stage figcaption {
  display: flex; gap: 18px; align-items: baseline; justify-content: center;
  font-size: 14px; min-height: 1.4em; cursor: default;
}
.lightbox-count { color: #d6d1c9; font-variant-numeric: tabular-nums; font-size: 13px; }
.lightbox-nav, .lightbox-close, .lightbox-stage figcaption { text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.lightbox-nav, .lightbox-close {
  position: fixed; background: none; border: 0; color: #f2efe9; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.lightbox-nav {
  top: 50%; transform: translateY(-50%);
  width: 56px; height: 96px; font-size: 54px; line-height: 1; border-radius: 10px;
}
.lightbox-nav.prev { left: clamp(4px, 1.5vw, 24px); }
.lightbox-nav.next { right: clamp(4px, 1.5vw, 24px); }
.lightbox-nav:hover, .lightbox-close:hover { background: rgba(255,255,255,.08); color: var(--accent); }
.lightbox-nav span { margin-top: -8px; }
.lightbox-close { top: 12px; right: 14px; width: 48px; height: 48px; font-size: 34px; border-radius: 50%; }
.lightbox-nav:focus-visible, .lightbox-close:focus-visible { outline: 2px solid var(--accent); }
.lightbox.single .lightbox-nav { display: none; }
@media (max-width: 600px) {
  .lightbox-stage { padding: 56px 8px 16px; }
  .lightbox-nav { width: 40px; height: 72px; font-size: 40px; background: rgba(0,0,0,.25); }
}

/* gallery tiles open the viewer */
a.tile[data-lightbox] { cursor: zoom-in; }

/* ---------- about / contact ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: start;
}
.about:not(:has(.about-photo)) { grid-template-columns: minmax(0, 640px); }
.about-photo img { width: 100%; height: auto; }
.prose { font-size: 17px; max-width: 58ch; }
.prose p { margin: 0 0 1em; }
.sub-heading {
  font-size: 15px; font-weight: 500; color: var(--muted);
  text-transform: lowercase; margin: 36px 0 12px;
}

.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.contact-list li { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; }
.contact-list .label { width: 90px; color: var(--muted); font-size: 13px; text-transform: lowercase; }
.contact-list a { text-decoration: none; border-bottom: 1px solid var(--line); }
.contact-list a:hover { color: var(--accent); border-color: var(--accent); }

.contact { max-width: 760px; }
.contact-lede { font-size: 17px; margin: 0 0 12px; }
.contact-big {
  display: inline-block;
  font-size: clamp(24px, 4.4vw, 46px);
  font-weight: 700;
  font-stretch: 110%;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 36px;
  word-break: break-all;
}
.contact-big:hover { text-decoration: underline; text-underline-offset: 6px; }

.notfound a { color: var(--accent); }

/* ---------- footer ---------- */

.site-footer {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px var(--pad) 36px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--muted);
}
.footer-contact { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-contact a { text-decoration: none; }
.footer-contact a:hover { color: var(--accent); }

/* "Discourage saving" setting */
.protect-images img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .piece { grid-template-columns: 1fr; }
  .piece-info { position: static; }
  .piece-img img { max-height: none; }
  .about { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  :root { --gap: 10px; }
  .site-header { flex-direction: column; align-items: flex-start; }
  .site-nav { gap: 4px 18px; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
