/* Qi Zhang ceramics — one stylesheet for every page */

:root {
  --ink: #1a1a1a;
  --text: #555;
  --muted: #6e6e6e;
  --line: #e6e6e6;
  --blob: #ececea;
  --band: #eaf3ef; /* pale celadon */
  --page: #fff;
  --max: 1180px;
  --font: "Raleway", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; width: 100%; }
body > .site-header { width: 100%; }

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

a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #000; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: #000; color: #fff; padding: 8px 14px; z-index: 50;
}
.skip:focus { left: 8px; }

:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 3px; }

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

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 32px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 40px;
  flex-wrap: wrap;
}

.site-name {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px 36px;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-block;
  padding: 10px 0;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

main { max-width: var(--max); margin: 0 auto; padding: 0 32px; }

/* ---------- shared type ---------- */

.label,
h1, h2 {
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

h1 { font-size: 19px; margin: 0 0 22px; }
h2 { font-size: 17px; margin: 0 0 18px; }

.prose { max-width: 720px; }
.prose p { margin: 0 0 1.1em; }

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

.site-footer {
  margin-top: 96px;
  background: var(--band);
  padding: 52px 32px 40px;
  text-align: center;
}
.footer-links {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 28px;
  font-size: 15px;
  letter-spacing: 0.04em;
}
.footer-links a { color: var(--ink); }
.footer-small {
  margin: 18px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.ig-icon { width: 26px; height: 26px; display: block; }
.ig-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
}
.ig-link:hover { color: #000; }
.ig-inline { display: inline-flex; align-items: center; gap: 10px; }
.ig-inline .ig-icon { width: 22px; height: 22px; }

/* ---------- celadon band under the header (Work page) ---------- */

.sub-band { background: var(--band); }
.sub-band ul {
  list-style: none;
  margin: 0 auto;
  padding: 22px 32px;
  display: flex;
  justify-content: center;
  gap: 8px 48px;
  flex-wrap: wrap;
}
.sub-band a {
  display: inline-block;
  padding: 10px 0;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.sub-band a:hover { border-bottom-color: var(--ink); }

/* ---------- home ---------- */

.home-pair {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 40px 0 8px;
}

.home main { max-width: 1440px; }
.home .site-header { max-width: 1402px; }

.home-frame {
  position: relative;
  width: min(430px, 30vw);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f6f6f5;
}

.home-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 1.4s ease;
}

.home-frame img.is-hidden { opacity: 0; }

.home-enter {
  text-align: center;
  margin: 36px 0 0;
}
.home-enter a {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- work ---------- */

.statement { padding: 56px 0 8px; }

.contact-art { width: 100%; max-width: 480px; margin: 0 auto; }

.jump {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  gap: 8px 28px;
  flex-wrap: wrap;
}
.jump a { display: inline-block; padding: 8px 0; }

.work-group { padding-top: 72px; scroll-margin-top: 16px; }

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.tile {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #f6f6f5;
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.tile:hover img { transform: scale(1.03); }

/* ---------- enlarged view ---------- */

.viewer {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  color: var(--text);
}
.viewer::backdrop { background: #fff; }

.viewer-inner {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 40px;
  padding: 72px 48px 40px;
}

.viewer-figure {
  margin: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewer-figure img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-side {
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.viewer-caption { margin: 0; }
.viewer-caption dt {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.viewer-caption dd { margin: 0 0 14px; color: var(--ink); }

.viewer-views { display: flex; gap: 10px; flex-wrap: wrap; }
.viewer-views button {
  width: 64px; height: 64px;
  padding: 0;
  border: 1px solid transparent;
  background: #f6f6f5;
  cursor: pointer;
}
.viewer-views button img { width: 100%; height: 100%; object-fit: cover; }
.viewer-views button[aria-pressed="true"] { border-color: var(--ink); }

.viewer-steps { display: flex; gap: 24px; }

.text-button {
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 12px 0;
  cursor: pointer;
}
.text-button:hover { color: var(--ink); }

.viewer-close {
  position: absolute;
  top: 18px;
  right: 32px;
}

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

.split {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px 72px;
  padding: 40px 0 0;
}

.split-art { flex: 1 1 340px; max-width: 480px; }
.split-text { flex: 999 1 420px; min-width: 0; }

.shape { width: 100%; height: auto; display: block; }

.portrait-frame {
  display: block;
  width: min(300px, 100%);
  height: auto;
  margin: 0 auto;
}
.portrait-frame .ring { fill: #cde2d8; }
.shape .back { fill: var(--blob); }

.contact-list { margin: 0 0 40px; }
.contact-list dt {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-list dd { margin: 0 0 18px; color: var(--ink); }

.rule { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  body { font-size: 16px; }
  .site-header { padding: 24px 20px 12px; }
  .site-name { font-size: 19px; letter-spacing: 0.22em; }
  .site-nav ul { gap: 4px 24px; }
  main { padding: 0 20px; }
  .home-pair { flex-direction: column; align-items: center; gap: 14px; padding-top: 24px; }
  .home-frame { width: calc(100vw - 40px); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .work-group { padding-top: 56px; }
  .viewer-inner {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 64px 20px 24px;
    gap: 20px;
  }
  .viewer-close { right: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-frame img, .tile img { transition: none; }
}
