/* ==========================================================================
   Components — masthead, buttons, plates, rail, lightbox
   ========================================================================== */

/* ---- Wordmark ------------------------------------------------------------ */
.wordmark {
  display: inline-grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 0.55rem;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}
.wordmark__peg {
  grid-row: 1 / span 2;
  width: 12px; height: 12px;
  background: var(--marker);
  outline: 1px solid var(--ink);
  align-self: start; margin-top: 2px;
}
.wordmark__name {
  font-weight: 800; font-stretch: 120%;
  font-size: 1.28rem; letter-spacing: 0.015em; text-transform: uppercase;
}
.wordmark__sub {
  font-family: var(--f-mono); font-weight: 500;
  font-size: 0.6rem; letter-spacing: 0.42em; text-transform: uppercase;
  margin-top: 0.4rem; color: var(--ink-soft);
}
.on-dark .wordmark__peg { outline-color: transparent; }
.on-dark .wordmark__sub { color: var(--on-dark-soft); }

/* ---- Masthead ------------------------------------------------------------- */
.masthead {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: var(--head-h);
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.masthead.is-stuck { border-bottom-color: var(--line); }
.masthead__in {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav { display: none; }
.nav ul { display: flex; gap: clamp(18px, 2.2vw, 36px); }
.nav a {
  font-size: 0.9rem; font-weight: 500; font-stretch: 104%; text-decoration: none;
  padding-block: 0.4em;
  background: linear-gradient(var(--marker), var(--marker)) 0 100% / 0 3px no-repeat;
  transition: background-size 0.35s var(--ease);
}
.nav a:hover, .nav a[aria-current="true"] { background-size: 100% 3px; }
.masthead__actions { display: flex; align-items: center; gap: 18px; }
.tel {
  font-family: var(--f-mono); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.02em;
  text-decoration: none; display: none; white-space: nowrap;
}
.tel:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

.menu-btn {
  font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.09em; text-transform: uppercase;
  border: 1px solid var(--ink); padding: 0.75em 1em; display: inline-flex; gap: 0.7em; align-items: center;
}
.menu-btn__bars { width: 14px; height: 8px; border-block: 1.5px solid currentColor; position: relative; }
.menu-btn__bars::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: currentColor; translate: 0 -50%; }

.drawer {
  position: fixed; inset: var(--head-h) 0 0 0; z-index: 39; overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); border-bottom: 1px solid var(--line);
  padding: 8px var(--pad) 28px;
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0s 0.25s;
}
.drawer.is-open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
.drawer a.drawer__link {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.95em 0; border-bottom: 1px solid var(--line);
  font-size: 1.35rem; font-weight: 600; font-stretch: 108%; letter-spacing: -0.015em; text-decoration: none;
}
.drawer a.drawer__link .label { color: var(--ink-soft); }
.drawer__cta { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

@media (min-width: 1000px) {
  .nav { display: block; }
  .tel { display: inline; }
  .menu-btn, .drawer { display: none; }
}
@media (max-width: 999px) {
  .masthead__actions .btn { display: none; }
}

/* ---- Buttons & links ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 0.9em;
  padding: 0.7em 0.7em 0.7em 1.25em;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: 0;
  font-weight: 600; font-stretch: 104%; font-size: 0.92rem; line-height: 1.1; letter-spacing: 0.005em;
  text-decoration: none;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.btn__arrow {
  width: 1.9em; height: 1.9em; display: grid; place-items: center;
  background: var(--marker); color: var(--ink); flex: none;
  transition: transform 0.35s var(--ease);
}
.btn__arrow svg { width: 0.95em; height: 0.95em; }
.btn:hover { background: var(--moss); border-color: var(--moss); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn--sm { padding: 0.5em 0.5em 0.5em 1em; font-size: 0.82rem; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--on-dark { background: var(--marker); color: var(--ink); border-color: var(--marker); }
.btn--on-dark .btn__arrow { background: var(--ink); color: var(--marker); }
.btn--on-dark:hover { background: var(--on-dark); border-color: var(--on-dark); }

.link {
  display: inline-flex; align-items: baseline; gap: 0.5em;
  font-weight: 600; font-stretch: 104%; font-size: 0.95rem; text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 0.2em;
  transition: background-size 0.3s var(--ease);
}
.link:hover { background-size: 100% 3px; }

/* ---- Plates (framed photographs) ------------------------------------------ */
.plate { position: relative; }
.plate__frame { position: relative; background: var(--paper-deep); overflow: hidden; }
.plate__frame > img { width: 100%; height: 100%; object-fit: cover; }
.js .plate__frame > img { opacity: 0; transition: opacity 0.7s var(--ease); }
.js .plate__frame > img.is-loaded { opacity: 1; }

/* Four crop ticks sitting just outside the frame */
.ticks { --tick: var(--ink); position: relative; }
.ticks::after {
  content: ""; position: absolute; inset: -9px; pointer-events: none; z-index: 2;
  background:
    linear-gradient(var(--tick), var(--tick)) top left / 11px 1px no-repeat,
    linear-gradient(var(--tick), var(--tick)) top left / 1px 11px no-repeat,
    linear-gradient(var(--tick), var(--tick)) top right / 11px 1px no-repeat,
    linear-gradient(var(--tick), var(--tick)) top right / 1px 11px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom left / 11px 1px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom left / 1px 11px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom right / 11px 1px no-repeat,
    linear-gradient(var(--tick), var(--tick)) bottom right / 1px 11px no-repeat;
}
.on-dark .ticks, .section--ink .ticks, .section--moss .ticks { --tick: var(--on-dark-soft); }

/* Caption: a mono slug led by a marker peg */
.cap {
  display: flex; gap: 0.7em; align-items: baseline;
  font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-soft); line-height: 1.45; margin-top: 14px;
}
.cap::before { content: ""; flex: none; width: 7px; height: 7px; background: var(--marker); outline: 1px solid var(--ink); translate: 0 -1px; }
.section--ink .cap, .section--moss .cap { color: var(--on-dark-soft); }
.section--ink .cap::before, .section--moss .cap::before { outline-color: transparent; }

/* Dimension line — a measured span with a label in the middle */
.dim {
  display: flex; align-items: center; gap: 0.8em;
  font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft);
}
.dim::before, .dim::after {
  content: ""; flex: 1; height: 9px;
  background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
  border-inline: 1px solid currentColor;
}
.dim::before { border-right: 0; } .dim::after { border-left: 0; }

/* Photo callouts: numbered pegs with a leader to a mono label */
.callouts { position: absolute; inset: 0; z-index: 3; }
.callout { position: absolute; left: var(--x); top: var(--y); translate: -50% -50%; }
.callout__n {
  display: grid; place-items: center; width: 22px; height: 22px;
  background: var(--marker); color: var(--ink);
  font: 600 0.7rem/1 var(--f-mono);
  box-shadow: 0 0 0 4px rgba(14, 20, 16, 0.3);
}
.callout__t {
  position: absolute; top: 50%; left: calc(100% + 16px); translate: 0 -50%;
  white-space: nowrap; background: var(--ink); color: var(--paper);
  padding: 0.55em 0.8em; font: 500 0.66rem/1 var(--f-mono); letter-spacing: 0.09em; text-transform: uppercase;
}
.callout__t::before { content: ""; position: absolute; right: 100%; top: 50%; width: 16px; height: 1px; background: var(--ink); }
.callout[data-side="l"] .callout__t { left: auto; right: calc(100% + 16px); }
.callout[data-side="l"] .callout__t::before { right: auto; left: 100%; }

/* ---- Levelling-staff rail (desktop) --------------------------------------- */
.staff {
  display: none;
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail); z-index: 30;
  pointer-events: none; color: var(--ink);
  transition: color 0.45s;
}
.staff[data-theme="dark"] { color: var(--on-dark); }
.staff__ticks {
  position: absolute; left: 20px; top: var(--head-h); bottom: 28px; width: 16px; opacity: 0.55;
  background:
    repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 10px) left / 8px 100% no-repeat,
    repeating-linear-gradient(to bottom, currentColor 0 1.5px, transparent 1.5px 50px) left / 16px 100% no-repeat;
}
.staff__marker {
  position: absolute; left: 14px; top: 0; transform: translateY(var(--y, 0px));
  display: flex; align-items: center; will-change: transform;
}
.staff__peg { width: 14px; height: 14px; background: var(--marker); box-shadow: 0 0 0 1px var(--ink); transition: box-shadow 0.45s; }
.staff[data-theme="dark"] .staff__peg { box-shadow: 0 0 0 1px transparent; }
.staff__label {
  position: absolute; top: 20px; left: 0;
  font: 500 0.58rem/1 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
}
@media (min-width: 1100px) { .staff { display: block; } }

/* Mobile progress line */
.progress {
  position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 50;
  background: var(--marker); transform-origin: left; transform: scaleX(var(--p, 0));
}
@media (min-width: 1100px) { .progress { display: none; } }

/* ---- Mobile action bar ----------------------------------------------------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 38;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--ink); color: var(--on-dark);
  transform: translateY(100%); transition: transform 0.4s var(--ease);
  padding-bottom: env(safe-area-inset-bottom);
}
.actionbar.is-on { transform: none; }
.actionbar a {
  display: flex; align-items: center; justify-content: center; gap: 0.7em;
  padding: 1.05em 0.5em; text-decoration: none;
  font-weight: 600; font-stretch: 104%; font-size: 0.95rem;
}
.actionbar a + a { background: var(--marker); color: var(--ink); }
@media (min-width: 900px) { .actionbar { display: none; } }

/* ---- Lightbox ---------------------------------------------------------------- */
.lightbox {
  border: 0; padding: 0; margin: 0; max-width: none; max-height: none;
  width: 100%; height: 100%;
  background: rgba(14, 20, 16, 0.96); color: var(--on-dark);
}
.lightbox::backdrop { background: rgba(14, 20, 16, 0.96); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; animation: lbIn 0.35s var(--ease); }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox__bar, .lightbox__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--pad);
}
.lightbox__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 var(--pad); }
.lightbox__img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox__btn {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 1px solid var(--line-dark); color: var(--on-dark);
  transition: background-color 0.2s, color 0.2s;
}
.lightbox__btn:hover { background: var(--marker); color: var(--ink); border-color: var(--marker); }
.lightbox__btn svg { width: 18px; height: 18px; }
.lightbox__nav { display: flex; gap: 8px; }
.lightbox__cap { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--on-dark-soft); max-width: 60ch; }

/* callout label placed beneath its peg */
.callout[data-side="b"] .callout__t { left: 50%; top: calc(100% + 16px); translate: -50% 0; }
.callout[data-side="b"] .callout__t::before { right: auto; left: 50%; top: auto; bottom: 100%; width: 1px; height: 16px; }
