/* The public site. Layered on brand.css, which owns the palette and the face.
 *
 * The design is a gallery wall: cream paper, the work at size, and type that
 * gets out of the way. That is not a style choice so much as a reading of the
 * subject — this is a drawing studio, and on a page about drawings the drawings
 * are the content and everything else is framing.
 *
 * ONE typeface, because only one is self-hosted and brand.css explains why a
 * CDN font is not an option here. Public Sans is variable across 100–900, so
 * the hierarchy is built from weight and letter-spacing instead of from two
 * families: hairline 200 at large sizes for display, 400 for reading, 600
 * tightly tracked for labels. A single well-ranged family beats a second one
 * loaded over the network.
 *
 * The old site was a four-column masonry grid with centred caps titles and a
 * category line underneath. That structure is kept — it suits work of wildly
 * different aspect ratios, which is what a portfolio of carpets, wallpapers and
 * ceramics is — and given air, a real type scale and a hover that does one
 * thing.
 */

:root {
  --measure: 62ch;          /* reading width for prose          */
  --wall: 1680px;           /* the grid may run wide; prose may not */
  --gap: clamp(1rem, 2.2vw, 2.25rem);
}

body.site {
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── the two type roles that are not body text ───────────────────────────── */
.display {
  font-weight: 200;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.15;
  text-wrap: balance;
}
.label {
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── header ──────────────────────────────────────────────────────────────── */
.site-head {
  max-width: var(--wall);
  margin: 0 auto;
  padding: clamp(1.75rem, 4vw, 3.25rem) var(--gap) clamp(1.25rem, 2.5vw, 2rem);
  text-align: center;
}
.wordmark {
  display: inline-block;
  font-size: clamp(1.45rem, 3.4vw, 2.3rem);
  font-weight: 200;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--accent); }
.tagline {
  /* brand.css puts `max-width: 68ch` on every <p>. Inherited text-align:center
   * then centres the TEXT inside that 68ch box — and the box itself is a block
   * at the left edge, so on a wide screen the tagline sits left of centre under
   * a centred wordmark. One line of type needs no measure. */
  max-width: none;
  margin: .7rem 0 0;
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.1rem, 3vw, 2.4rem);
  margin-top: clamp(1.25rem, 3vw, 2rem);
}
.site-nav a {
  position: relative;
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: .3rem;
}
/* The underline grows from nothing rather than appearing, which is the one
 * piece of motion on the page. The old theme had a .nav-line span doing this
 * with markup; a pseudo-element does it without. */
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .28s ease;
}
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ── the wall ────────────────────────────────────────────────────────────── */
.wall {
  max-width: var(--wall);
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 2rem) var(--gap) clamp(3rem, 7vw, 6rem);
  /* CSS columns, not grid. The work has no common aspect ratio — a 420×737
   * carpet beside a 420×420 ceramic — and columns let each piece keep its own
   * proportions instead of being cropped to a cell. Grid would need a row span
   * per item, computed from a height nobody knows until the image loads. */
  columns: 4 300px;
  column-gap: var(--gap);
}
@media (max-width: 760px) { .wall { columns: 2 150px; } }
@media (max-width: 420px) { .wall { columns: 1; } }

.piece {
  break-inside: avoid;
  margin: 0 0 clamp(1.75rem, 3.5vw, 3rem);
  display: block;
  text-decoration: none;
  color: inherit;
}
.piece figure { margin: 0; overflow: hidden; background: var(--line); }
.piece img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .3s ease;
}
.piece:hover img { transform: scale(1.035); }
.piece figcaption { padding-top: .85rem; text-align: center; }
.piece .piece-title {
  font-weight: 300;
  font-size: .92rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink);
}
.piece:hover .piece-title { color: var(--accent); }
.piece .piece-cat {
  display: block;
  margin-top: .3rem;
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .1em;
  color: var(--ink-soft);
  text-transform: none;
}
/* The unpublished marker, admin-side only — the public grid never renders one,
 * but the admin preview uses the same partial. */
.piece.draft figure { outline: 2px dashed var(--accent); outline-offset: 3px; }

/* ── one project ─────────────────────────────────────────────────────────── */
.work {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gap) clamp(3rem, 7vw, 6rem);
}
.work-head {
  text-align: center;
  padding: clamp(.5rem, 2vw, 1.5rem) 0 clamp(2rem, 5vw, 3.5rem);
}
.work-head h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4.4vw, 2.75rem);
}
.work-head .label { display: block; margin-top: .9rem; }
.work-body {
  max-width: var(--measure);
  margin: clamp(1.25rem, 3vw, 2rem) auto 0;
  text-align: left;
  color: var(--ink-soft);
}
.work-body p { margin: 0 0 1.1rem; }

.plates { display: flex; flex-direction: column; gap: clamp(1.5rem, 4vw, 3.5rem); }
.plate { margin: 0; }
.plate img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--line);
}
.plate figcaption {
  margin-top: .6rem;
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--ink-soft);
}

/* Prev / next. A hairline above, because a rule is enough of a boundary and a
 * box would compete with the work above it. */
.pager {
  display: flex;
  justify-content: space-between;
  gap: var(--gap);
  margin-top: clamp(2.5rem, 6vw, 5rem);
  padding-top: clamp(1.25rem, 3vw, 2rem);
  border-top: 1px solid var(--line);
}
.pager a {
  max-width: 45%;
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.pager a:hover { color: var(--accent); }
.pager .next { margin-left: auto; text-align: right; }
.pager small {
  display: block;
  font-weight: 400;
  letter-spacing: .1em;
  color: var(--ink-soft);
  margin-bottom: .25rem;
}

/* ── a standing page ─────────────────────────────────────────────────────── */
.sheet {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) var(--gap) clamp(3rem, 7vw, 6rem);
}
.sheet h1 {
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
  font-size: clamp(1.35rem, 3.6vw, 2.1rem);
  text-align: center;
}
.sheet p { margin: 0 0 1.15rem; }
.sheet a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line); }
.sheet a:hover { border-bottom-color: var(--accent); }

/* The press page is thirteen tear-sheets and no prose, so it gets a grid rather
 * than the reading column. */
.clippings {
  max-width: var(--wall);
  margin: 0 auto;
  padding: 0 var(--gap) clamp(3rem, 7vw, 6rem);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: var(--gap);
}
.clippings img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--line);
}

/* ── footer ──────────────────────────────────────────────────────────────── */
.site-foot {
  max-width: var(--wall);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) var(--gap) clamp(2rem, 5vw, 3rem);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.site-foot a { color: inherit; text-decoration: none; }
.site-foot a:hover { color: var(--accent); }

/* ── empty states ────────────────────────────────────────────────────────── */
.nothing {
  max-width: var(--measure);
  margin: clamp(3rem, 10vw, 7rem) auto;
  padding: 0 var(--gap);
  text-align: center;
  color: var(--ink-soft);
}
.nothing code {
  display: inline-block;
  margin-top: 1rem;
  padding: .45rem .7rem;
  background: var(--line);
  border-radius: var(--r-sm);
  font-size: .8rem;
  letter-spacing: 0;
  text-transform: none;
}

/* Keyboard focus stays visible. The hover states above are decoration; this is
 * how the page is used without a mouse. */
.site-nav a:focus-visible, .piece:focus-visible, .pager a:focus-visible,
.wordmark:focus-visible, .sheet a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .piece img, .site-nav a::after { transition: none; }
  .piece:hover img { transform: none; }
}
