/* amir.art — paper and ink. The work is loud, the interface whispers. */

/* ---------- Faces ---------- */
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/source-serif-4.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/source-serif-4-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --paper: #F6F5F1;
  --ink: #111111;
  --ink-2: #6E6E6A;
  --rule: #DAD8D2;

  /* Neue Haas Grotesk via the Adobe Fonts kit in site.json (weights 400 and 700 only). Until it loads,
     Apple devices use Helvetica Neue and everything else uses self-hosted Inter. */
  --sans: "neue-haas-grotesk-display", "Neue Haas Grotesk Display Pro", "Helvetica Neue", "Inter", Helvetica, Arial, sans-serif;
  --sans-text: "neue-haas-grotesk-text", "Neue Haas Grotesk Text Pro", "Helvetica Neue", "Inter", Helvetica, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --u: 8px;
  --margin: 24px;
  --gutter: 32px;
  --row-gap: 48px;
  --cols: 5;
  --masthead: 56px;
  --measure: 68ch;
}
/* Dark mode is P1: tokens ready, toggle not shipped yet. */
:root[data-theme="dark"] { --paper: #111111; --ink: #F6F5F1; --ink-2: #9A9A95; --rule: #2A2A28; }

@media (max-width: 1023px) { :root { --cols: 3; } }
@media (max-width: 639px)  { :root { --cols: 2; --margin: 16px; --gutter: 16px; --row-gap: 32px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font-family: var(--sans-text); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--margin); top: -40px; background: var(--ink); color: var(--paper); padding: 4px 8px; z-index: 100; }
.skip:focus { top: 8px; }

/* ---------- Type roles ---------- */
.sys { font-family: var(--sans-text); font-size: 12px; font-weight: 400; text-transform: uppercase; letter-spacing: .04em; line-height: 1.2; }
.cap { font-family: var(--mono); font-size: 11px; font-weight: 400; text-transform: uppercase; letter-spacing: .04em; line-height: 1.45; }
.muted { color: var(--ink-2); }
.title { font-family: var(--sans); font-weight: 400; font-size: clamp(28px, 2.6vw, 40px); line-height: 1.08; letter-spacing: -.02em; }
.section-label { color: var(--ink-2); margin-bottom: calc(var(--u) * 2); }

.prose { font-family: var(--serif); font-size: 18px; line-height: 1.5; max-width: var(--measure); font-optical-sizing: auto; }
.prose p + p { margin-top: 1em; }
.prose p { hanging-punctuation: first; }
.prose a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose blockquote { margin: 1em 0; padding-left: 1em; border-left: 1px solid var(--rule); font-style: italic; }
.prose h2 { font-family: var(--sans-text); font-size: 18px; font-weight: 700; margin: 1.6em 0 .5em; }
.prose-small { font-size: 16px; }

/* Text links in system type: hand-drawn underline on hover */
.link, .enquire, .prevnext a, .meta dd a, .filters a, .nav a { position: relative; }
.link { border-bottom: 1px solid var(--rule); }
.link:hover { border-color: transparent; }
.link::after, .enquire::after, .meta dd a::after, .nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 6px;
  background: currentColor; opacity: 0; pointer-events: none;
  -webkit-mask: url("/assets/marks/underline.svg") center / 100% 100% no-repeat;
          mask: url("/assets/marks/underline.svg") center / 100% 100% no-repeat;
}
.link:hover::after, .enquire:hover::after, .meta dd a:hover::after, .nav a:not([aria-current]):hover::after { opacity: 1; }

.mark { color: var(--ink); overflow: visible; }
.rule-hand { width: 100%; height: 18px; color: var(--ink); opacity: .9; }

/* ---------- Masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: var(--u) calc(var(--u) * 3);
  min-height: var(--masthead); padding: 12px var(--margin);
  background: var(--paper);
}
.wordmark { font-family: var(--sans-text); font-weight: 700; font-size: 15px; letter-spacing: -.01em; text-transform: lowercase; }
.nav { display: flex; gap: 2px; }
.nav a { display: block; padding: 4px 7px 3px; }
.nav a::after { left: 7px; right: 7px; bottom: -3px; }
.nav a[aria-current] { background: var(--ink); color: var(--paper); }
@media (max-width: 420px) {
  .masthead { flex-wrap: wrap; padding-bottom: 8px; }
  .masthead nav { width: 100%; }
  .nav { justify-content: space-between; margin: 0 -7px; }
}

/* ---------- Filters: one quiet line; Year and Tag open beneath it ---------- */
.filters { padding: calc(var(--u) * 3) var(--margin) calc(var(--u) * 5); display: grid; gap: 6px; }
.filters > * { min-width: 0; }
.filter-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 2px; }
.filter-media { display: flex; flex-wrap: wrap; gap: 2px; }
.filter-sep { color: var(--rule); padding: 0 8px; }
.filter-end { margin-left: auto; display: flex; align-items: baseline; gap: 2px; }
.filter-count { margin-right: 16px; }
.filter-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px; }
.filter-label { width: 48px; flex: none; }
.filters a, .filter-toggle { padding: 1px 5px; }
.filter-toggle { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; cursor: pointer; display: none; }
.js .filter-toggle { display: inline-block; }
.js .filter-sub:not(.is-open) { display: none; }
.filters a:hover, .filter-toggle:hover, .filter-toggle[aria-expanded="true"] { background: var(--rule); }
.filters a.is-active, .filters a.is-active:hover { background: var(--ink); color: var(--paper); }
@media (max-width: 639px) {
  .filter-media { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(var(--margin) * -1); padding-right: var(--margin); }
  .filter-media::-webkit-scrollbar { display: none; }
  .filter-media > * { flex: none; }
  .filter-sep { display: none; }
  .filter-line .filter-toggle:first-of-type { margin-left: -5px; }
  .filter-count { display: none; }
}

/* ---------- Grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: var(--gutter); grid-auto-flow: row dense;
  padding: 0 var(--margin);
  /* Rows are half a column tall, so 2 rows = 1 column, 4 rows = 2 columns. Tiles span --cs x --rs. */
  --colw: calc((100cqw - 2 * var(--margin) - (var(--cols) - 1) * var(--gutter)) / var(--cols));
  grid-auto-rows: calc((var(--colw) - var(--gutter)) / 2);
}
.item > a { display: flex; flex-direction: column; height: 100%; }
.archive { container-type: inline-size; }
.item { grid-column: span var(--cs, 1); grid-row: span var(--rs, 2); min-height: 0; }
.thumb { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; background: var(--rule); }
.thumb picture, .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; }
.thumb img { object-fit: cover; }
.item-cap { margin-top: var(--u); padding-right: var(--u); }
.item-cap .c-medium { display: none; }
.item-cap .c-count, .item-cap .c-sep, .item-cap .c-date { color: var(--ink-2); }
.item a:hover .c-title { background: var(--ink); color: var(--paper); }
.item[hidden] { display: none; }

.note-tile { position: absolute; inset: 0; padding: 0 var(--u) 0 0; overflow: hidden; }
.note-tile p { font-family: var(--serif); font-size: 16px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical; overflow: hidden; }
.note-tile.is-poem p { display: block; white-space: pre-line; height: 100%; -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); }
@media (max-width: 639px) { .note-tile p { font-size: 14px; -webkit-line-clamp: 5; } }
.is-note .thumb { background: transparent; }

/* List view */
.archive[data-view="list"] .grid { display: block; }
.archive[data-view="list"] .item { grid-row: auto; grid-column: auto; }
.archive[data-view="list"] .item { border-top: 1px solid var(--rule); }
.archive[data-view="list"] .item:last-child { border-bottom: 1px solid var(--rule); }
.archive[data-view="list"] .thumb { display: none; }
.archive[data-view="list"] .item > a { display: block; }
.archive[data-view="list"] .item-cap {
  display: grid; grid-template-columns: 80px minmax(0, 1fr) 140px 40px; gap: var(--u) var(--gutter);
  margin: 0; padding: 9px 0;
}
.archive[data-view="list"] .item-cap > * { grid-row: 1; }
.archive[data-view="list"] .c-date { grid-column: 1; color: var(--ink-2); }
.archive[data-view="list"] .c-kind { display: none; }
.archive[data-view="list"] .c-title { grid-column: 2; justify-self: start; }
.archive[data-view="list"] .c-medium { display: block; grid-column: 3; color: var(--ink-2); }
.archive[data-view="list"] .c-count { grid-column: 4; text-align: right; }
.archive[data-view="list"] .c-sep { display: none; }
@media (max-width: 639px) {
  .archive[data-view="list"] .item-cap { grid-template-columns: 64px minmax(0, 1fr) 72px; }
  .archive[data-view="list"] .c-count { display: none; }
}

.empty { padding: calc(var(--u) * 10) var(--margin); display: grid; justify-items: center; gap: calc(var(--u) * 2); text-align: center; }
.empty .mark { width: 120px; height: auto; }
.empty a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Work page ---------- */
.work {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 var(--gutter);
  padding: calc(var(--u) * 3) var(--margin) 0;
}
/* Details sit at the image's bottom edge like a plate caption, and stay in view while scrolling a series. */
.work-images { grid-column: 1 / span 10; display: grid; gap: calc(var(--u) * 6); }
.work-figure { display: grid; justify-items: start; }
.work-figure img { width: auto; max-height: calc(100vh - var(--masthead) - 48px); object-fit: contain; }
.work-figure figcaption { margin-top: var(--u); justify-self: start; color: var(--ink-2); }
.work-meta { grid-column: 11 / span 2; align-self: end; position: sticky; bottom: calc(var(--u) * 3); display: grid; gap: calc(var(--u) * 2); background: var(--paper); }
.work-meta .title { font-family: var(--sans-text); font-size: 24px; letter-spacing: -.01em; }
.work-meta .meta { grid-template-columns: 64px minmax(0, 1fr); }
.work-meta .prose-small { font-size: 15px; }
@media (min-width: 1024px) and (max-width: 1279px) {
  .work-images { grid-column: 1 / span 9; }
  .work-meta { grid-column: 10 / span 3; }
}

.meta { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 4px var(--u); border-top: 1px solid var(--rule); padding-top: 12px; }
.meta dt { color: var(--ink-2); }
.enquire { display: inline-block; background: var(--ink); color: var(--paper); padding: 3px 8px; }
.enquire::after { display: none; }

@media (max-width: 1023px) {
  .work-images { grid-column: 1 / -1; }
  .work-meta { grid-column: 1 / -1; position: static; margin-top: calc(var(--u) * 4); max-width: 560px; }
}

/* ---------- Related, prev/next ---------- */
.related { margin-top: calc(var(--u) * 12); }
.related .section-label { padding: 0 var(--margin); }
.prevnext {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--gutter);
  margin-top: calc(var(--u) * 12); padding: 16px var(--margin); border-top: 1px solid var(--rule);
}
.prevnext a { display: inline-flex; align-items: center; gap: 12px; }
.prevnext .pn-next { justify-self: end; text-align: right; }
.prevnext .pn-label { display: block; color: var(--ink-2); }
.prevnext .mark { width: 32px; height: 14px; flex: none; transition: transform .15s; }
.prevnext .pn-prev:hover .mark { transform: translateX(-3px); }
.prevnext .pn-next:hover .mark { transform: translateX(3px); }
@media (max-width: 639px) { .prevnext .pn-index { display: none; } .prevnext { grid-template-columns: 1fr 1fr; } }

/* ---------- Notes ---------- */
.notes-index, .note, .page { padding: calc(var(--u) * 6) var(--margin) 0; }
.intro { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--u) var(--gutter); margin-bottom: calc(var(--u) * 6); }
.intro .title { grid-column: 1 / span 4; }
.intro .prose { grid-column: 5 / span 7; }
@media (max-width: 1023px) { .intro .title, .intro .prose { grid-column: 1 / -1; } }
.notes-index .rule-hand { margin-bottom: calc(var(--u) * 2); }

.note-list li { border-bottom: 1px solid var(--rule); }
.note-list a { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px var(--gutter); padding: 18px 0 20px; align-items: baseline; }
.nl-date { grid-column: 1 / span 2; }
.nl-title { grid-column: 3 / span 3; font-family: var(--sans-text); font-size: 20px; font-weight: 400; letter-spacing: -.005em; line-height: 1.2; }
.nl-excerpt { grid-column: 6 / span 6; font-family: var(--serif); font-size: 16px; line-height: 1.45; color: var(--ink-2); max-width: var(--measure); }
.note-list a:hover .nl-title { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
@media (max-width: 1023px) {
  .nl-date, .nl-title, .nl-excerpt { grid-column: 1 / -1; }
}

.note { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 var(--gutter); }
.note-head { grid-column: 3 / span 8; margin-bottom: calc(var(--u) * 5); display: grid; gap: calc(var(--u) * 2); }
.note-head a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 2px; }
.note > .prose { grid-column: 3 / span 8; }
.note-sketch { grid-column: 3 / span 6; margin-top: calc(var(--u) * 6); }
.note-sketch figcaption { margin-top: var(--u); color: var(--ink-2); }
@media (max-width: 1023px) { .note-head, .note > .prose, .note-sketch { grid-column: 1 / -1; } }

/* ---------- Selected ---------- */
.selected { padding: calc(var(--u) * 3) var(--margin) 0; display: grid; gap: calc(var(--u) * 14); }
.sel-entry { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--u) var(--gutter); align-items: end; }
.sel-image { grid-column: 1 / span 8; display: block; }
.sel-image img { width: auto; max-height: calc(100vh - var(--masthead) - 48px); }
.sel-meta { grid-column: 10 / span 3; display: grid; gap: calc(var(--u) * 2); }
.sel-entry:nth-of-type(even) .sel-image { grid-column: 5 / span 8; grid-row: 1; justify-self: end; }
.sel-entry:nth-of-type(even) .sel-meta { grid-column: 1 / span 3; grid-row: 1; }
@media (max-width: 1023px) {
  .sel-image, .sel-meta, .sel-entry:nth-of-type(even) .sel-image, .sel-entry:nth-of-type(even) .sel-meta { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  .selected { gap: calc(var(--u) * 10); }
}

/* ---------- Info ---------- */
.page-title { margin-bottom: calc(var(--u) * 6); }
.page-body.prose { max-width: none; }
.info-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: calc(var(--u) * 8) var(--gutter); }
.info-bio { grid-column: 1 / span 6; }
.info-bio p { max-width: var(--measure); }
.info-contact { grid-column: 9 / span 4; display: grid; gap: 6px; align-content: start; }
.info-contact p + p { margin-top: 0; }
.info-cv { grid-column: 1 / span 8; }
.info-cv h3 { margin: calc(var(--u) * 3) 0 var(--u); }
.cv { border-collapse: collapse; width: 100%; }
.cv td { border-top: 1px solid var(--rule); padding: 7px 0; vertical-align: top; }
.cv td:first-child { width: 96px; color: var(--ink-2); }
@media (max-width: 1023px) { .info-bio, .info-contact, .info-cv { grid-column: 1 / -1; } }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: calc(var(--u) * 3); text-align: center; padding: var(--margin); }
.notfound .mark { width: 96px; height: auto; }

/* ---------- Footer ---------- */
.colophon { margin-top: calc(var(--u) * 16); padding: 0 var(--margin) calc(var(--u) * 3); }
.colophon .rule-hand { margin-bottom: 12px; color: var(--ink-2); }
.colophon-row { display: flex; justify-content: space-between; gap: var(--gutter); color: var(--ink-2); }
.colophon-row a:hover { color: var(--ink); }

/* ---------- Motion: ~150ms fade on load, nothing else ---------- */
.js img.fade { opacity: 0; transition: opacity .15s ease-out; }
.js img.fade.is-loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .js img.fade { opacity: 1; transition: none; }
  .prevnext .mark { transition: none; }
}

/* ---------- Print: the site as a catalogue ---------- */
@media print {
  .masthead, .filters, .prevnext, .colophon, .related { display: none; }
  .js img.fade { opacity: 1; }
  .work-meta { position: static; }
}

[hidden] { display: none !important; }


.prose.is-poem { white-space: pre-line; }
