/* ==========================================================================
   Benjamin Murphy — site styles
   Converted from the Claude Design export (design system + page styles).
   Fonts are loaded with <link> tags in each page's <head> rather than
   @import, so the browser can start fetching them straight away.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Colour — base */
  --ink-900: #141311;
  --ink-700: #2A2825;
  --ink-500: #585553;
  --ink-300: #A6A29C;
  --ink-100: #E8E4DD;
  --paper: #F7F5F0;
  --paper-warm: #EFEBE2;
  --accent-red: #B2372C;

  /* Colour — semantic */
  --text-primary: var(--ink-900);
  --text-secondary: var(--ink-500);
  --text-muted: var(--ink-300);
  --surface-page: var(--paper);
  --rule: var(--ink-100);
  --accent: var(--accent-red);

  /* Type */
  --font-display: 'Raleway', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  --fs-h2: clamp(28px, 3.2vw, 44px);
  --fs-h3: 22px;
  --fs-h4: 18px;
  --fs-body: 15px;

  /* Spacing */
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --gutter: clamp(20px, 4vw, 64px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 700; margin: 0; line-height: 1.2; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a {
  color: var(--ink-900);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: opacity .2s ease;
}
a:hover { opacity: .55; }
:focus-visible { outline: 2px solid var(--accent-red); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--ink-900); color: var(--paper); }

.bm-sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* Skip link: hidden until focused with the keyboard */
.bm-skip {
  position: absolute; left: var(--gutter); top: 8px; z-index: 200;
  background: var(--paper); padding: 8px 12px; border: 1px solid var(--ink-900);
  transform: translateY(-200%);
}
.bm-skip:focus { transform: none; }

/* ---------- Header ---------- */
.bm-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 32px;
  padding: 32px var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.bm-wordmark {
  display: inline-block;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1;
  border-bottom: 0;
}
.bm-wordmark__name { display: block; font-size: 14px; }
.bm-wordmark__tagline {
  display: block; margin-top: 8px;
  font-family: var(--font-body); font-weight: 400; font-size: 11px;
  letter-spacing: 0.28em; color: var(--text-secondary);
}

.bm-nav ul { display: flex; gap: 32px; margin: 0; padding: 0; list-style: none; }
.bm-nav a {
  font-family: var(--font-body); font-size: 12px; letter-spacing: 0.22em;
  text-transform: uppercase; padding: 2px 0;
  color: var(--text-primary);
  border-top: 1px solid transparent; border-bottom: 0;
}
/* aria-current marks the page you're on — accent colour + top rule */
.bm-nav a[aria-current="page"] { color: var(--accent); border-top-color: var(--accent); }

.bm-menu-btn {
  display: none;
  flex-direction: column; justify-content: center; gap: 7px;
  width: 32px; height: 32px; background: none; border: 0; padding: 0; cursor: pointer;
}
.bm-menu-btn span { display: block; height: 1px; width: 100%; background: var(--ink-900); }

/* ---------- Mobile drawer ---------- */
.bm-drawer {
  position: fixed; top: 0; right: 0; height: 100%;
  width: min(340px, 82vw);
  background: var(--paper);
  border-left: 1px solid var(--rule);
  z-index: 120;
  display: flex; flex-direction: column;
  padding: var(--s-6) var(--s-7);
  transform: translateX(101%);
  visibility: hidden;
  /* visibility waits for the slide-out to finish before hiding */
  transition: transform 300ms ease, visibility 0s linear 300ms;
}
.bm-drawer.is-open { transform: translateX(0); visibility: visible; transition: transform 300ms ease; }
.bm-drawer__top { display: flex; justify-content: flex-end; margin-bottom: var(--s-7); }
.bm-drawer__close {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--font-body); font-size: 12px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--text-secondary);
}
.bm-drawer ul {
  display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-5);
  margin: 0; padding: 0; list-style: none; text-align: right;
}
.bm-drawer ul a {
  font-family: var(--font-display); font-weight: 400;
  font-size: calc(var(--fs-h4) * 1.6); line-height: 1.1;
  display: inline-block; border-bottom: 0; color: var(--ink-900);
}
.bm-drawer ul a[aria-current="page"] { color: var(--accent); }
.bm-drawer__foot {
  margin-top: auto; padding-top: var(--s-6); border-top: 1px solid var(--rule);
  text-align: right; font-size: 11px; letter-spacing: 0.1em; color: var(--text-secondary);
}
.bm-drawer-catch {
  position: fixed; inset: 0; z-index: 115;
  background: none; border: 0; padding: 0; cursor: default;
}

@media (max-width: 900px) {
  .bm-nav { display: none; }
  .bm-menu-btn { display: flex; }
}

/* ---------- Shared type components ---------- */
.bm-section { padding: var(--s-9) var(--gutter); }

/* "/ Label" — tracked caps section marker */
.bm-label {
  font-family: var(--font-body); font-size: 12px; font-weight: 400;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-primary); line-height: 1.4;
}
.bm-heading {
  font-size: var(--fs-h2); line-height: 1.05; letter-spacing: -0.01em;
  margin-bottom: calc(var(--s-5) + 10px);
}
.bm-text { font-size: 15px; line-height: 1.65; color: var(--text-primary); max-width: 64ch; }

/* ---------- Home: about ---------- */
.bm-about-grid {
  display: grid; grid-template-columns: minmax(220px, 28%) 1fr;
  gap: var(--s-8); margin-bottom: var(--s-8);
}
.bm-about-grid img { width: 100%; }

.bm-quotes {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-7);
  margin-bottom: var(--s-9); border-top: 1px solid var(--rule); padding-top: var(--s-6);
}
.bm-quotes blockquote {
  margin: 0; font-family: var(--font-display); font-style: italic; font-weight: 700;
  font-size: var(--fs-h4); line-height: 1.35;
}
.bm-quotes footer {
  margin-top: var(--s-3); font-family: var(--font-body); font-style: normal; font-weight: 400;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary);
}

/* ---------- Home: tabs ---------- */
.bm-tabs { display: flex; gap: var(--s-6); border-bottom: 1px solid var(--rule); }
.bm-tab {
  background: none; border: 0; padding: 0 0 var(--s-3);
  font-family: var(--font-body); font-size: 12px; font-weight: 400;
  letter-spacing: 0.22em; text-transform: uppercase; cursor: pointer;
  color: var(--text-secondary); border-bottom: 1px solid transparent;
}
.bm-tab[aria-selected="true"] { color: var(--ink-900); border-bottom-color: var(--ink-900); }

.bm-tabpanel { padding-top: var(--s-8); }
.bm-tabpanel[hidden] { display: none; }

.bm-lists { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-8); }
.bm-lists + .bm-list { margin-top: var(--s-8); }
.bm-text + .bm-list { margin-top: var(--s-6); }

/* Index list: bulleted, 14px, tight 2px rhythm */
.bm-list__title {
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; margin-bottom: 18px;
}
.bm-list ul { margin: 0; padding: 0 0 0 1.1em; }
.bm-list li { padding: 2px 0; font-size: 14px; line-height: 1.55; list-style: disc outside; }
.bm-list li::marker { color: var(--text-muted); font-size: 0.85em; }

/* ---------- Artwork ---------- */
.bm-page-head {
  margin-bottom: var(--s-6); border-bottom: 1px solid var(--rule); padding-bottom: var(--s-5);
}
.bm-masonry { column-count: 3; column-gap: var(--gutter); }
.bm-masonry figure { margin: 0 0 var(--gutter); break-inside: avoid; }
/* Each image is a link to the full file, so it still works without JS;
   the script turns the click into the lightbox. */
.bm-masonry a { display: block; border-bottom: 0; padding: 0; cursor: zoom-in; }
.bm-masonry img { width: 100%; transition: opacity 200ms ease; }
.bm-masonry a:hover { opacity: 1; }
.bm-masonry a:hover img { opacity: 0.55; }
@media (max-width: 980px) { .bm-masonry { column-count: 2; } }
@media (max-width: 560px) { .bm-masonry { column-count: 1; } }

/* With JS, switch to a grid so artworks read left-to-right in number order
   (1, 2, 3 across the top) while keeping the uneven masonry look. Each figure
   spans as many 1px rows as its height; site.js sets the span. Without JS
   the column layout above is used (order runs down each column). */
.bm-masonry.is-grid {
  column-count: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: var(--gutter);
  grid-auto-rows: 1px;
  align-items: start;
}
@media (max-width: 980px) { .bm-masonry.is-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .bm-masonry.is-grid { grid-template-columns: 1fr; } }

/* ---------- Lightbox ---------- */
.bm-lightbox {
  position: fixed; inset: 0; z-index: 100; background: var(--paper);
  display: flex; flex-direction: column;
}
.bm-lightbox[hidden] { display: none; }
.bm-lightbox__bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-5);
  padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--rule);
}
.bm-lightbox__count {
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-secondary);
}
.bm-lightbox__close {
  background: none; border: 1px solid var(--ink-900); padding: 8px 16px; cursor: pointer;
  font-family: var(--font-body); font-size: 12px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-900);
}
.bm-lightbox__stage {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: var(--s-4) var(--s-4) var(--s-5);
}
.bm-lightbox__arrows { display: flex; align-items: center; gap: 18px; margin-bottom: 10px; }
.bm-lightbox__arrows button {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--font-body); font-size: 13px; line-height: 1; color: var(--ink-900);
}
.bm-lightbox__img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; min-height: 0;
  object-fit: contain; user-select: none; touch-action: pan-y;
}

/* ---------- Newsletter (Mailchimp) ---------- */
.bm-newsletter { border-top: 1px solid var(--rule); padding: var(--s-8) var(--gutter); }
#mc_embed_signup {
  display: flex; flex-wrap: wrap; gap: var(--s-6) var(--s-8);
  align-items: flex-start; justify-content: space-between;
}
.bm-newsletter__intro { flex: 1 1 280px; max-width: 46ch; }
.bm-newsletter__intro h2 {
  font-size: var(--fs-h3); line-height: 1.2; color: var(--text-primary); text-wrap: pretty;
}
#mc-embedded-subscribe-form { flex: 1 1 360px; max-width: 560px; margin: 0; }
#mc_embed_signup_scroll { display: flex; flex-direction: column; gap: var(--s-3); }
.bm-newsletter__row { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: flex-end; }
.bm-newsletter__field { flex: 1 1 240px; display: block; }
.bm-newsletter__field > span {
  display: block; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-secondary); margin-bottom: 6px;
}
.bm-req { color: var(--accent); }
#mce-EMAIL {
  font-family: var(--font-body); font-size: 15px; background: transparent;
  border: 0; border-bottom: 1px solid var(--ink-900); border-radius: 0;
  padding: 10px 0; width: 100%; color: var(--ink-900); outline: none;
}
#mce-EMAIL:focus { border-bottom-color: var(--accent); }
#mc-embedded-subscribe {
  font-family: var(--font-body); font-size: 12px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; padding: 14px 22px;
  border: 1px solid var(--ink-900); border-radius: 0;
  background: var(--ink-900); color: var(--paper); cursor: pointer;
  transition: background .18s ease, color .18s ease; -webkit-appearance: none;
}
#mc-embedded-subscribe:hover { background: transparent; color: var(--ink-900); }
#mc-embedded-subscribe:disabled { cursor: progress; }
.bm-newsletter__note { font-size: 12px; color: var(--text-secondary); }
#mce-responses { font-size: 15px; line-height: 1.6; }
#mce-error-response { color: var(--accent); }
/* Mailchimp's own honeypot field: must stay in the form but off-screen */
.bm-honeypot { position: absolute; left: -5000px; }

/* ---------- Footer ---------- */
.bm-footer {
  border-top: 1px solid var(--rule); padding: var(--s-6) var(--gutter);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-5);
  font-size: 11px; letter-spacing: 0.1em; color: var(--text-secondary);
}
.bm-footer a { color: inherit; }
.bm-footer > :nth-child(2) { text-align: center; }
.bm-footer > :nth-child(3) { text-align: right; }

/* ---------- Cookie consent banner ----------
   Fixed to the bottom, above the page but below the menu drawer (120) and
   lightbox (100). Accept and Reject share one style on purpose: UK rules
   require rejecting to be as easy and as prominent as accepting. */
.bm-consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s-4) var(--s-6);
  padding: var(--s-5) var(--gutter);
  background: var(--paper); border-top: 1px solid var(--ink-900);
}
.bm-consent[hidden] { display: none; }
.bm-consent__text { margin: 0; flex: 1 1 320px; font-size: 14px; line-height: 1.55; max-width: 70ch; }
.bm-consent__actions { display: flex; gap: var(--s-3); }
.bm-consent__btn {
  font-family: var(--font-body); font-size: 12px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  padding: 12px 22px; min-width: 120px;
  border: 1px solid var(--ink-900); border-radius: 0;
  background: transparent; color: var(--ink-900); cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.bm-consent__btn:hover { background: var(--ink-900); color: var(--paper); }

/* Footer "Privacy policy / Cookie settings" row */
.bm-footer__links { margin-top: var(--s-3); display: flex; flex-wrap: wrap; gap: var(--s-4); }
.bm-footer__cookie, .bm-inline-btn {
  background: none; border: 0; padding: 0 0 1px; cursor: pointer;
  font: inherit; letter-spacing: inherit; color: inherit;
  border-bottom: 1px solid currentColor; transition: opacity .2s ease;
}
.bm-footer__cookie:hover, .bm-inline-btn:hover { opacity: .55; }

/* Email + Instagram under "Join my mailing list" */
.bm-newsletter__contact { margin: var(--s-3) 0 0; font-size: 14px; }
.bm-newsletter__contact span { color: var(--text-muted); }

/* "Site by Digital Murph" under the footer email */
.bm-footer__credit { margin-top: var(--s-3); }

/* Signup note link */
.bm-newsletter__note a { color: inherit; }

/* ---------- Text pages (privacy) ---------- */
.bm-page { padding: var(--s-9) var(--gutter); }
.bm-prose h2 { font-size: var(--fs-h3); margin: 2em 0 0.6em; }
.bm-prose code { font-size: 0.9em; }
.bm-prose__updated { margin-top: 2em; font-size: 13px; color: var(--text-secondary); }

/* ---------- 404 ---------- */
.bm-notfound { padding: var(--s-9) var(--gutter); min-height: 50vh; }
.bm-notfound .bm-text { margin-top: var(--s-5); }

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .bm-about-grid { grid-template-columns: 1fr; }
  .bm-lists { grid-template-columns: 1fr; }
  .bm-quotes { grid-template-columns: 1fr; gap: var(--s-6); }
}

/* Phones: the three-column footer squeezes to one word per line, so stack it */
@media (max-width: 600px) {
  /* Tabs: wrap whole labels onto a second row rather than squashing each one */
  .bm-tabs { flex-wrap: wrap; gap: var(--s-3) var(--s-5); }
  .bm-tab { white-space: nowrap; }
  .bm-footer { grid-template-columns: 1fr; gap: var(--s-3); }
  .bm-footer > :nth-child(2), .bm-footer > :nth-child(3) { text-align: left; }
}
