/* ============================================================
   Ziggy Hicks — public stylesheet
   Stark, archival, mono-led. The paintings carry the color.
   ============================================================ */

/* ---- Fonts ------------------------------------------------ */
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("../fonts/ibm-plex-mono-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

/* ---- Tokens ----------------------------------------------- */
:root {
  --bg:        #fafaf8;
  --ink:       #111111;
  --ink-soft:  #5f5f5a;
  --rule:      #d9d9d3;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --pad: clamp(20px, 5vw, 64px);
  --maxw: 1440px;

  --reveal-ms: 520ms;
}

/* ---- Reset ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 1.5px solid var(--ink); outline-offset: 3px;
}
hr { border: 0; }

/* ---- Masthead --------------------------------------------- */
.masthead { text-align: center; padding: clamp(40px, 7vw, 72px) var(--pad) 0; }
.wordmark {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-size: clamp(36px, 7vw, 80px);
  line-height: 1.02;
}
.masthead__line {
  margin: 14px 0 0;
  font-size: clamp(14px, 1.4vw, 19px);
  color: var(--ink-soft);
  letter-spacing: 0;
}
.masthead__line:first-of-type { margin-top: 18px; }

/* inner-page masthead: quiet top bar */
.masthead--inner {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 14px 28px;
  text-align: left;
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(28px, 4vw, 44px) var(--pad) 0;
}
.wordmark--inner { font-size: clamp(22px, 2.4vw, 30px); }
.subnav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; }
.subnav a { color: var(--ink-soft); transition: color .15s ease; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ---- Main shell ------------------------------------------- */
.main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(40px, 5vw, 64px) var(--pad) 0;
  width: 100%;
}

/* ---- Grid ------------------------------------------------- */
.grid {
  display: grid;
  align-items: start;
  gap: 30px 22px;
}
.grid--home    { grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); }
.grid--archive { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 40px 26px; }

.tile { position: relative; display: block; }
.tile__link { display: block; color: inherit; }
.tile__frame { display: block; overflow: hidden; }
.tile__img {
  width: 100%; height: auto; display: block;
  transition: opacity .2s ease, transform .2s ease;
}
.tile__img--empty { aspect-ratio: 1 / 1; }

/* hover: subtle lift + metadata caption beneath, sitting above the row gap */
.tile__meta {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  display: block;
  font-size: 12.5px;
  line-height: 1.3;
  letter-spacing: 0;
  background: var(--bg);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
  z-index: 3;
}
.tile__title { display: block; color: var(--ink); }
.tile__sub   { display: block; color: var(--ink-soft); }
.tile:hover .tile__img,
.tile:focus-within .tile__img { transform: translateY(-1px); }
.tile:hover .tile__meta,
.tile:focus-within .tile__meta { opacity: 1; transform: translateY(0); }

/* dim the rest of the wall a touch when one tile is engaged */
.js-grid:hover .tile { transition: opacity .2s ease; }
.js-grid:hover .tile:not(:hover) { opacity: .62; }

/* ---- Reveal animation ------------------------------------- */
.grid[data-reveal] .tile { opacity: 0; }
.grid[data-reveal].is-ready .tile {
  opacity: 1;
  animation: tileIn var(--reveal-ms) cubic-bezier(.22,.61,.36,1) both;
  animation-delay: var(--d, 0ms);
}
@keyframes tileIn {
  from { opacity: 0; transform: translateY(7px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* ---- View-all + controls ---------------------------------- */
.viewall { margin: clamp(36px, 5vw, 56px) 0 0; font-size: 16px; }
.viewall a { border-bottom: 1px solid transparent; transition: border-color .15s ease; }
.viewall a:hover { border-color: var(--ink); }

.controls {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 10px 30px; margin-bottom: clamp(28px, 3vw, 40px);
  font-size: 14px;
}
.controls__group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.controls__label { color: var(--ink-soft); }
.ctrl {
  appearance: none; background: none; border: 0; padding: 2px 0; margin: 0;
  font: inherit; color: var(--ink-soft); cursor: pointer;
  border-bottom: 1px solid transparent;
}
.ctrl:hover { color: var(--ink); }
.ctrl[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.controls__count { margin-left: auto; color: var(--ink-soft); }

.branch-note, .empty {
  margin: 0 0 clamp(28px,3vw,40px); color: var(--ink-soft); font-size: 15px; max-width: 60ch;
}
.branch-note a, .empty a { color: var(--ink); border-bottom: 1px solid var(--rule); }

/* ---- Work detail ------------------------------------------ */
.work {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.work__images { display: grid; gap: 24px; }
.work__fig { margin: 0; }
.work__img { width: 100%; height: auto; }
.work__img--empty { aspect-ratio: 1/1; }
.work__cap { margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.work__meta { position: sticky; top: 28px; }
.work__title { margin: 0 0 18px; font-size: clamp(20px, 2.2vw, 26px); font-weight: 500; }

.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 2px 18px; margin: 0; font-size: 14px; }
.meta-list dt { color: var(--ink-soft); }
.meta-list dd { margin: 0; }
.work__desc { margin: 22px 0 0; font-size: 14.5px; color: var(--ink); max-width: 46ch; }
.work__action { margin-top: 26px; }
.work__back { margin-top: 30px; font-size: 14px; }
.work__back a { color: var(--ink-soft); }
.work__back a:hover { color: var(--ink); }

/* ---- Buttons + forms -------------------------------------- */
.btn {
  display: inline-block; font: inherit; font-size: 14px; cursor: pointer;
  background: none; color: var(--ink);
  border: 1px solid var(--ink); padding: 9px 18px; border-radius: 0;
  transition: background .15s ease, color .15s ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: #000; }

[hidden] { display: none !important; }
.inquiry-form { display: grid; gap: 14px; margin-top: 18px; max-width: 420px; }
.inquiry-form--open { margin-top: 0; }
.inquiry-form label { display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.inquiry-form input, .inquiry-form textarea, .inquiry-form select {
  font: inherit; font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid var(--rule); padding: 9px 11px; border-radius: 0;
}
.inquiry-form textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__ok  { color: var(--ink); font-size: 14px; }
.form__err { color: #8a1f1f; font-size: 13px; margin: 2px 0 0; }

/* ---- Info / CV -------------------------------------------- */
.info, .contact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: clamp(32px,4vw,56px) clamp(40px,6vw,96px);
  max-width: 1040px;
}
.info__h {
  margin: 0 0 14px; font-size: 13px; font-weight: 500;
  text-transform: lowercase; letter-spacing: .02em; color: var(--ink-soft);
}
.info__body { font-size: 14.5px; max-width: 52ch; }
.info__body a { border-bottom: 1px solid var(--rule); }
.cv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cv-row { display: grid; grid-template-columns: 56px 1fr; gap: 14px; font-size: 14px; }
.cv-year { color: var(--ink-soft); }
.cv-title { display: block; }
.cv-place { display: block; color: var(--ink-soft); font-size: 13px; }
.cv-type  { display: block; color: var(--ink-soft); font-size: 12px; }
.contact__direct { margin-top: 22px; font-size: 14px; color: var(--ink-soft); }
.contact__direct a { color: var(--ink); border-bottom: 1px solid var(--rule); }

/* ---- Prints ----------------------------------------------- */
.prints { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(40px,5vw,72px); }
.print { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(240px,1fr); gap: clamp(24px,4vw,56px); align-items: start; }
.print__title { margin: 0 0 14px; font-size: clamp(18px,2vw,22px); font-weight: 500; }
.print__status { color: var(--ink-soft); font-size: 14px; }
.print__img--empty { display:block; aspect-ratio: 4/5; background: #eee; }

/* ---- Footer ----------------------------------------------- */
.footer { max-width: var(--maxw); margin: 0 auto; padding: clamp(48px,6vw,80px) var(--pad) clamp(32px,4vw,48px); }
.rule { height: 1px; background: var(--rule); margin: 0 0 24px; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 12px 40px; font-size: 16px; }
.footer__nav a { color: var(--ink-soft); transition: color .15s ease; }
.footer__nav a:hover { color: var(--ink); }
.footer__copy { margin: 22px 0 0; font-size: 14px; color: var(--ink-soft); }

/* ---- Responsive ------------------------------------------- */
@media (max-width: 900px) {
  .work { grid-template-columns: 1fr; }
  .work__meta { position: static; }
  .info, .contact { grid-template-columns: 1fr; }
  .print { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid--home    { grid-template-columns: repeat(3, 1fr); }
  .grid--archive { grid-template-columns: repeat(2, 1fr); }
  .subnav { font-size: 14px; }
  .footer__nav { font-size: 14px; gap: 10px 24px; }
}

/* ---- Reduced motion --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .grid[data-reveal] .tile,
  .grid[data-reveal].is-ready .tile { opacity: 1 !important; animation: none !important; }
  * { scroll-behavior: auto !important; }
}

/* ---- Product detail page (work) --------------------------- */
.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.85fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.pdp__main-img { width: 100%; height: auto; display: block; transition: opacity .18s ease; }
.pdp__main-img--empty { aspect-ratio: 1/1; }
.pdp__thumbs { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pdp-thumb {
  width: 72px; height: 72px; padding: 0; cursor: pointer; overflow: hidden;
  border: 1px solid var(--rule); background: none;
  transition: border-color .15s ease;
}
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-thumb:hover { border-color: var(--ink-soft); }
.pdp-thumb.is-active { border-color: var(--ink); }

.pdp__info { position: sticky; top: 28px; }
.pdp__title { margin: 0 0 8px; font-size: clamp(20px, 2.2vw, 26px); font-weight: 500; }
.pdp__price { margin: 0 0 22px; font-size: 18px; color: var(--ink); }
.pdp__desc { margin: 22px 0 0; font-size: 14.5px; color: var(--ink); max-width: 46ch; }
.pdp__action { margin-top: 26px; max-width: 420px; }
.pdp__unavail { margin-top: 24px; color: var(--ink-soft); font-size: 14px; }
.pdp__back { margin-top: 30px; font-size: 14px; }
.pdp__back a { color: var(--ink-soft); }
.pdp__back a:hover { color: var(--ink); }

.btn--block { display: block; width: 100%; text-align: center; }
.inquiry-form .btn--block { margin-top: 4px; }

@media (max-width: 900px) {
  .pdp { grid-template-columns: 1fr; }
  .pdp__info { position: static; }
}

/* ---- Product image zoom + lightbox ------------------------ */
.pdp__zoom-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; position: relative; }
.pdp__zoom-hint {
  position: absolute; bottom: 10px; right: 10px;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); background: rgba(250,250,248,.85); border: 1px solid var(--rule);
  padding: 4px 9px; opacity: 0; transition: opacity .15s ease; pointer-events: none;
}
.pdp__zoom-btn:hover .pdp__zoom-hint,
.pdp__zoom-btn:focus-visible .pdp__zoom-hint { opacity: 1; }

.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(17,17,17,.95);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 96vw; max-height: 92vh; width: auto; height: auto; display: block; cursor: zoom-out; }
.lightbox__close {
  position: absolute; top: 14px; right: 22px;
  font-size: 30px; line-height: 1; color: #fafaf8; background: none; border: 0; cursor: pointer;
}
.lightbox__close:hover { opacity: .7; }

/* purchase + inline inquiry on product page */
.pdp__or { margin: 12px 0 0; font-size: 13px; color: var(--ink-soft); }
.link-inline { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-inline:hover { opacity: .7; }
