/* noahdemarest.com — site styles
   Visual system: STREAM brand (Franklin / Cormorant Garamond, grayscale, base-8 spacing).
   The code-reference apps in /tools/codes/ keep their own styles.css. */

:root {
  --ink: #111111;
  --ink-2: #4A4A4A;
  --ink-3: #888888;
  --rule: #CCCCCC;
  --paper-2: #F4F4F4;
  --paper: #FFFFFF;
  --neg: #B3261E;

  --font-sans: "Libre Franklin", "Franklin Gothic Book", "Franklin Gothic", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Cormorant Garamond", Garamond, Georgia, serif;

  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px;
  --s6: 48px; --s8: 64px; --s10: 80px; --s12: 96px;

  --max: 1120px;
  --measure: 680px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--s4); }
@media (max-width: 640px) { .wrap { padding: 0 var(--s2); } }

/* ── Header ─────────────────────────────── */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 72px; }
.wordmark { font-weight: 500; font-size: 19px; letter-spacing: .01em; text-decoration: none; color: var(--ink); white-space: nowrap; }
.wordmark:hover { color: var(--ink); }
.nav { display: flex; gap: var(--s3); }
.nav a {
  text-decoration: none; font-size: 12.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2); padding: var(--s1) 0; border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule); border-radius: 2px;
  font: inherit; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; padding: 6px 12px; cursor: pointer; color: var(--ink);
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 72px; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule); padding: var(--s1) var(--s2) var(--s2);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--paper-2); }
  .nav a[aria-current="page"] { border-bottom-color: var(--paper-2); font-weight: 700; }
}

/* ── Type ───────────────────────────────── */
h1, h2, h3 { font-weight: 500; line-height: 1.2; margin: 0; letter-spacing: -.005em; }
h1 { font-size: clamp(32px, 5vw, 48px); }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { margin: 0 0 var(--s2); }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s2); }
.lede { font-size: 20px; line-height: 1.55; color: var(--ink-2); max-width: var(--measure); }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.muted { color: var(--ink-3); }

/* ── Page sections ──────────────────────── */
.page-head { padding: var(--s10) 0 var(--s6); border-bottom: 1px solid var(--rule); }
.page-head h1 { margin-bottom: var(--s2); }
.section { padding: var(--s8) 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s4); flex-wrap: wrap; }
.section-head a { font-size: 12.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--ink-2); }
.section-head a:hover { color: var(--ink); }

/* ── Home hero ──────────────────────────── */
.hero { padding: var(--s12) 0 var(--s10); border-bottom: 1px solid var(--rule); }
.hero h1 { max-width: 15ch; margin-bottom: var(--s3); }
.hero .quote { font-family: var(--font-serif); font-style: italic; font-size: 24px; color: var(--ink-2); margin-top: var(--s4); }

/* Four doors into the site */
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.door {
  display: flex; flex-direction: column; gap: var(--s1); padding: var(--s4) var(--s3); min-height: 200px;
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink);
  transition: background .15s ease;
}
.door:hover { background: var(--paper-2); color: var(--ink); }
.door .num { font-size: 12px; letter-spacing: .16em; color: var(--ink-3); }
.door h2 { font-size: 22px; }
.door p { color: var(--ink-2); font-size: 15px; margin: 0; }
.door .go { margin-top: auto; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }

/* ── Cards / lists ──────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s3); }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
.card {
  display: flex; flex-direction: column; gap: var(--s1); padding: var(--s3); border: 1px solid var(--rule);
  background: var(--paper); text-decoration: none; color: var(--ink); transition: border-color .15s ease, background .15s ease;
}
a.card:hover { border-color: var(--ink); color: var(--ink); }
.card.soon { background: var(--paper-2); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s1); }
.card .kicker { font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.card h3 { font-size: 18px; }
.card p { color: var(--ink-2); font-size: 15px; margin: 0; }
.card .ref { font-size: 13px; color: var(--ink-3); }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: var(--s1); }
.badge {
  font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid var(--rule); padding: 2px 8px; color: var(--ink-2); background: var(--paper);
}
.badge.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tag { font-size: 12px; color: var(--ink-3); }
.tag::before { content: "#"; }
.card .extra { font-size: 13.5px; margin-top: var(--s1); }

/* Empty states */
.empty { border: 1px dashed var(--rule); padding: var(--s6) var(--s4); text-align: center; color: var(--ink-2); }
.empty .serif { font-size: 22px; display: block; margin-bottom: var(--s1); color: var(--ink); }

/* ── Filters ────────────────────────────── */
.filters { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s4); }
.filter-row { display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; }
.filter-label { font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-right: var(--s1); min-width: 72px; }
.chip {
  font: inherit; font-size: 13px; padding: 6px 14px; border: 1px solid var(--rule); background: var(--paper);
  color: var(--ink-2); cursor: pointer; border-radius: 100px; transition: all .12s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .count { opacity: .6; margin-left: 4px; font-size: 12px; }
.search {
  font: inherit; font-size: 15px; padding: 10px 14px; border: 1px solid var(--rule); width: 100%; max-width: 420px;
  background: var(--paper); color: var(--ink); border-radius: 0;
}
.search:focus { outline: none; border-color: var(--ink); }
.result-note { font-size: 13px; color: var(--ink-3); margin-bottom: var(--s2); }

.category-block { margin-bottom: var(--s6); }
.category-block .section-head { margin-bottom: var(--s2); }
.category-block .cat-desc { color: var(--ink-2); max-width: var(--measure); margin-bottom: var(--s3); font-size: 15px; }

/* ── Prose (About, articles) ────────────── */
.prose { max-width: var(--measure); }
.prose p { font-size: 18px; line-height: 1.7; }
.prose h2 { margin: var(--s6) 0 var(--s2); font-size: 22px; }
.prose ul { padding-left: 1.2em; margin: 0 0 var(--s2); }
.prose li { margin-bottom: var(--s1); }
.prose blockquote { margin: var(--s4) 0; padding-left: var(--s3); border-left: 1px solid var(--ink); font-family: var(--font-serif); font-style: italic; font-size: 24px; line-height: 1.4; color: var(--ink-2); }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s8); }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; gap: var(--s4); } }
.facts { border-top: 1px solid var(--ink); }
.facts div { padding: var(--s2) 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.facts dt { font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.facts dd { margin: 0; }

/* ── Footer ─────────────────────────────── */
.site-footer { border-top: 1px solid var(--rule); margin-top: var(--s8); padding: var(--s5) 0 var(--s6); font-size: 14px; color: var(--ink-3); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.site-footer nav { display: flex; gap: var(--s3); flex-wrap: wrap; }
.site-footer a { text-decoration: none; color: var(--ink-2); }
.site-footer a:hover { color: var(--ink); }

/* ── Artwork gallery ────────────────────── */
.gallery { columns: 3 280px; column-gap: var(--s4); }
.piece {
  display: block; width: 100%; break-inside: avoid; margin: 0 0 var(--s5); padding: 0; border: 0; background: none;
  text-align: left; font: inherit; color: var(--ink); cursor: zoom-in;
}
.piece img { width: 100%; height: auto; background: var(--paper-2); margin-bottom: var(--s2); transition: opacity .15s ease; }
.piece:hover img { opacity: .88; }
.piece-title { display: block; font-size: 16px; font-weight: 500; }
.piece-meta { display: block; font-size: 13.5px; color: var(--ink-3); }
.lightbox {
  border: 0; padding: 0; width: 100vw; height: 100vh; max-width: none; max-height: none;
  background: rgba(17,17,17,.96); color: #F4F4F4;
}
.lightbox::backdrop { background: rgba(17,17,17,.96); }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s8) var(--s8) var(--s4); gap: var(--s3); }
.lightbox img { max-width: 100%; max-height: calc(100vh - 220px); width: auto; height: auto; object-fit: contain; }
.lightbox figcaption { max-width: var(--measure); text-align: center; font-size: 15px; }
.lightbox figcaption p { margin: var(--s1) 0; color: #CCCCCC; }
.lb-title { display: block; font-size: 18px; font-weight: 500; }
.lb-meta { display: block; color: #888888; font-size: 13.5px; }
.lightbox button {
  position: absolute; background: none; border: 0; color: #F4F4F4; cursor: pointer; font: inherit;
}
.lb-close { top: var(--s2); right: var(--s3); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; padding: var(--s1); }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 48px; line-height: 1; padding: var(--s2); opacity: .7; }
.lb-prev:hover, .lb-next:hover { opacity: 1; }
.lb-prev { left: var(--s1); } .lb-next { right: var(--s1); }
@media (max-width: 640px) {
  .lightbox figure { padding: var(--s8) var(--s2) var(--s3); }
  .lb-prev, .lb-next { top: auto; bottom: var(--s1); transform: none; font-size: 36px; }
}

/* Negative numbers in tools built on this stylesheet */
.neg { color: var(--neg); }

@media print {
  .site-header, .site-footer, .filters { display: none; }
}
