/* Stone Creations of Long Island — concept stylesheet
   Coursed-stone system: expanded Archivo for the lintel wordmark and headings,
   Source Serif 4 for reading, limestone / charcoal / olive grounds, 8px mortar joints. */

:root {
  --limestone: #D8D4C9;
  --honed: #E8E6DF;
  --charcoal: #282A28;
  --charcoal-2: #333632;
  --olive: #4F5838;
  --olive-deep: #434B2F;
  --joint: #B5AE9F;
  --lamp: #C9A267;
  --ink: #252724;
  --ink-soft: #4A4D47;
  --on-dark: #EDEBE4;
  --on-dark-soft: #C4C1B7;

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --gutter: 24px;
  --wrap: 1320px;
  --joint-w: 8px;
  --header-h: 72px;
  --section: clamp(4.5rem, 3rem + 6vw, 9rem);

  --step--1: 0.9375rem;
  --step-0: 1.125rem;
  --step-1: 1.3125rem;
  --step-2: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);
  --step-3: clamp(2rem, 1.35rem + 2.5vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--limestone);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  font-stretch: 112%;
  line-height: 1.08;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); line-height: 1.15; }
h4 { font-size: var(--step-1); line-height: 1.2; }
p { margin: 0 0 1em; max-width: 36rem; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
ul, ol, dl, dd { margin: 0; padding: 0; }

:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }
.band-charcoal :focus-visible,
.band-olive :focus-visible,
.hero :focus-visible,
.site-header :focus-visible,
.menu :focus-visible,
.site-footer :focus-visible,
.lightbox :focus-visible { outline-color: var(--lamp); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 100;
  padding: 12px 16px; background: var(--honed); color: var(--ink);
  font-family: var(--sans); font-size: 1rem;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.band-limestone { background: var(--limestone); }
.band-honed { background: var(--honed); }
.band-charcoal { background: var(--charcoal); color: var(--on-dark); }
.band-olive { background: var(--olive); color: #F3F2EC; }

section[id] { scroll-margin-top: calc(var(--header-h) + 8px); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.75rem 1.35rem;
  border: 1px solid transparent; border-radius: 2px;
  font-family: var(--sans); font-weight: 500; font-size: 1rem; font-stretch: 100%;
  line-height: 1.2; letter-spacing: 0.005em; text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.button-light { background: var(--honed); color: var(--charcoal); }
.button-light:hover { background: #FFFFFF; }
.button-ghost { border-color: rgba(237, 235, 228, 0.7); color: #FFFFFF; background: rgba(40, 42, 40, 0.18); }
.button-ghost:hover { background: rgba(40, 42, 40, 0.45); border-color: #FFFFFF; }
.button-olive { background: var(--olive); color: #FFFFFF; }
.button-olive:hover { background: var(--olive-deep); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; align-items: center; gap: 28px;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  color: #FFFFFF;
  font-family: var(--sans);
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}
.site-header.is-solid { background: var(--charcoal); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06); }
.header-brand {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; min-height: 44px; align-self: center;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-weight: 600; font-stretch: 125%; font-size: 1.0625rem; letter-spacing: 0.02em;
  text-transform: uppercase; text-decoration: none;
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}
.site-header.is-solid .header-brand { opacity: 1; visibility: visible; transition: opacity 0.35s ease; }
.header-nav { display: flex; gap: 26px; }
.header-nav a, .header-call {
  font-size: 0.9688rem; font-weight: 500; text-decoration: none;
  padding: 12px 0; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
.site-header.is-solid .header-nav a,
.site-header.is-solid .header-call { text-shadow: none; }
.header-nav a:hover, .header-call:hover { text-decoration: underline; text-underline-offset: 0.35em; }
.header-call { white-space: nowrap; }
.header-call-label { font-weight: 600; }
.menu-button {
  display: none;
  min-width: 44px; min-height: 44px; padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 2px;
  background: rgba(40, 42, 40, 0.25); color: #FFFFFF;
  font: 500 0.9688rem/1 var(--sans); cursor: pointer;
}
.site-header.is-solid .menu-button { background: transparent; }

@media (max-width: 1080px) {
  .header-nav { display: none; }
  .menu-button { display: inline-flex; align-items: center; }
  .site-header { gap: 12px; }
  .header-call {
    display: inline-flex; align-items: center; gap: 0.3em; min-height: 44px; padding: 0 14px;
    border-radius: 2px; background: var(--honed); color: var(--charcoal); text-shadow: none;
  }
  .header-call:hover { text-decoration: none; background: #FFFFFF; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; --header-h: 64px; }
  .header-call-number { display: none; }
  .header-brand { font-size: 0.9375rem; }
}

/* ---------- Menu ---------- */
.menu { position: fixed; inset: 0; z-index: 60; }
.menu[hidden] { display: none; }
.menu-backdrop {
  position: absolute; inset: 0; background: rgba(20, 21, 20, 0.55);
  opacity: 0; transition: opacity 0.28s ease;
}
.menu-sheet {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(420px, 88vw);
  display: flex; flex-direction: column; gap: 28px;
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) 28px;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--charcoal); color: var(--on-dark);
  transform: translateX(100%); transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.menu.is-open .menu-backdrop { opacity: 1; }
.menu.is-open .menu-sheet { transform: none; }
.menu-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--header-h);
}
.menu-brand { font: 600 0.9375rem/1.2 var(--sans); font-stretch: 125%; letter-spacing: 0.02em; text-transform: uppercase; }
.menu-close {
  min-width: 44px; min-height: 44px; padding: 0 14px;
  border: 1px solid rgba(237, 235, 228, 0.6); border-radius: 2px;
  background: transparent; color: var(--on-dark);
  font: 500 0.9688rem/1 var(--sans); cursor: pointer;
}
.menu-nav { display: flex; flex-direction: column; border-top: 1px solid rgba(237, 235, 228, 0.16); }
.menu-nav a {
  padding: 14px 0; border-bottom: 1px solid rgba(237, 235, 228, 0.16);
  font: 500 clamp(1.375rem, 1.1rem + 1.4vw, 1.75rem)/1.15 var(--sans); font-stretch: 112%;
  text-decoration: none;
}
.menu-contact { margin-top: auto; font-size: 1rem; color: var(--on-dark-soft); }
.menu-phone { display: inline-block; margin-bottom: 6px; color: var(--on-dark); font: 500 1.5rem/1.2 var(--sans); font-stretch: 112%; text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  .menu-backdrop, .menu-sheet { transition: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate;
  height: 100vh; height: 100svh; min-height: 520px; max-height: 1100px;
  overflow: hidden;
  background: var(--charcoal); color: #FFFFFF;
}
.hero-slides, .hero-slide, .hero-slide picture, .hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-slide { opacity: 0; z-index: 0; }
.hero-slide img { object-fit: cover; object-position: var(--focus, 50% 50%); }
.hero-slide.is-prev { opacity: 1; z-index: 1; }
.hero-slide.is-current { opacity: 1; z-index: 2; }
.hero.is-animated .hero-slide.is-current { animation: hero-in 2.2s ease-in-out both; }
.hero.is-animated .hero-slide.is-current img { animation: hero-drift 12s linear both; }
.hero-slide.is-failed { display: none; }
@keyframes hero-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes hero-drift { from { transform: scale(1); } to { transform: scale(1.04); } }
.hero-slide:nth-child(1) { --focus: 50% 60%; }
.hero-slide:nth-child(2) { --focus: 50% 62%; }
.hero-slide:nth-child(3) { --focus: 55% 55%; }

.hero-shade {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(24, 26, 24, 0.55) 0, rgba(24, 26, 24, 0) 180px),
    linear-gradient(to top, rgba(24, 26, 24, 0.82) 0%, rgba(24, 26, 24, 0.5) 30%, rgba(24, 26, 24, 0) 62%);
}
.hero-content {
  position: absolute; z-index: 4;
  left: 0; right: 0; bottom: 0;
  max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) max(clamp(28px, 4.5vh, 56px), env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "statement statement" "actions controls" "wordmark wordmark";
  align-items: center;
}
.hero-statement {
  grid-area: statement;
  max-width: 31rem; margin-bottom: 20px;
  font-size: clamp(1.0625rem, 0.95rem + 0.45vw, 1.3125rem); line-height: 1.5;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.45);
}
.hero-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 12px; }
.wordmark { grid-area: wordmark; container-type: inline-size; margin-top: clamp(22px, 4.5vh, 44px); font-weight: 600; letter-spacing: 0; line-height: 1; text-wrap: initial; }
.wordmark-main {
  display: block;
  /* one line of expanded capitals spanning the content width: the full name measures about 12.3em */
  font-size: calc((min(100vw, 1368px) - 48px) / 12.45);
  font-size: calc(100cqi / 12.45);
  font-stretch: 125%; font-weight: 640;
  line-height: 0.86; letter-spacing: -0.005em; text-transform: uppercase; white-space: nowrap;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.25);
}
.wordmark-sub {
  display: block; margin-top: 0.55em;
  font-family: var(--serif); font-style: italic; font-weight: 400; font-stretch: 100%;
  font-size: clamp(1.125rem, 0.9rem + 1vw, 1.75rem); letter-spacing: 0.01em;
}
.hero-controls {
  grid-area: controls; justify-self: end;
  display: flex; align-items: center; gap: 4px; margin-right: -10px;
}
.hero-controls[hidden] { display: none; }
.hero-toggle, .hero-dot {
  position: relative; width: 44px; height: 44px; padding: 0; border: 0;
  background: transparent; color: #FFFFFF; cursor: pointer;
}
.hero-toggle-icon { position: absolute; inset: 0; margin: auto; width: 14px; height: 16px; }
.hero-toggle-icon::before, .hero-toggle-icon::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 4px; background: currentColor;
}
.hero-toggle-icon::before { left: 2px; }
.hero-toggle-icon::after { right: 2px; }
.hero-toggle.is-paused .hero-toggle-icon::before {
  left: 2px; width: 0; height: 0; background: none;
  border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent currentColor;
}
.hero-toggle.is-paused .hero-toggle-icon::after { display: none; }
.hero-dots { display: flex; }
.hero-dot[hidden] { display: none; }
.hero-dot::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 22px; height: 3px; margin: -1.5px 0 0 -11px;
  background: rgba(255, 255, 255, 0.45);
  transition: background-color 0.3s ease;
}
.hero-dot[aria-current="true"]::before { background: #FFFFFF; }
.hero-dot:hover::before { background: rgba(255, 255, 255, 0.8); }

/* Portrait phones and tablets: stack STONE / CREATIONS; "CREATIONS" measures about 7.5em */
@media (max-width: 899px) and (orientation: portrait) {
  .hero-content {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "statement" "actions" "wordmark" "controls";
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
  .wordmark-main span { display: block; }
  .wordmark-main { font-size: calc((100vw - 32px) / 7.75); font-size: calc(100cqi / 7.75); }
  .hero-controls { justify-self: start; margin: 12px 0 0 -12px; }
}
@media (max-width: 899px) and (orientation: landscape) {
  .hero { min-height: 340px; }
  .hero-statement { display: none; }
  .wordmark { margin-top: 14px; }
  .wordmark-sub { font-size: 1.0625rem; margin-top: 0.4em; }
  .hero-content { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .hero-actions .button { flex: 1 1 auto; padding-inline: 0.9rem; }
}

/* ---------- Section heads ---------- */
.section-head { display: grid; gap: 16px; margin-bottom: clamp(2.5rem, 2rem + 2vw, 4rem); }
.section-head p { color: var(--ink-soft); font-size: var(--step-1); line-height: 1.5; max-width: 34rem; }
@media (min-width: 1024px) {
  .section-head { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end; }
  .section-head h2 { grid-column: 1 / 7; }
  .section-head p { grid-column: 8 / 13; }
}

/* ---------- Intro ---------- */
.intro { padding-top: var(--section); padding-bottom: clamp(3rem, 2rem + 3vw, 5rem); }
.intro-grid { display: grid; gap: 28px; }
.intro-copy p:first-child { font-size: var(--step-1); line-height: 1.55; }
figcaption { font-family: var(--sans); font-size: var(--step--1); line-height: 1.45; color: var(--ink-soft); }
.intro-course { margin-top: 8px; }
.intro-course .course-item figcaption { padding-top: 12px; font-family: var(--sans); font-size: var(--step--1); line-height: 1.45; color: var(--ink-soft); }
@media (min-width: 1024px) {
  .intro-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: clamp(3rem, 2rem + 2vw, 4.5rem); }
  .intro-title { grid-column: 1 / 7; }
  .intro-copy { grid-column: 8 / 13; padding-top: 0.35rem; }
  .intro-course { grid-column: 1 / -1; margin-top: 0; }
}

/* ---------- Services ---------- */
.services { padding-top: clamp(3rem, 2rem + 3vw, 5rem); padding-bottom: var(--section); border-top: 1px solid var(--joint); }
.svc { display: grid; gap: 22px; margin-bottom: clamp(4rem, 3rem + 4vw, 7.5rem); }
.svc-text h3 { margin-bottom: 16px; }
.svc-figure img { width: 100%; }
.svc-figure-portrait img { aspect-ratio: 3 / 4; object-fit: cover; max-height: min(86vh, 880px); }
.ruled-list { list-style: none; margin-top: 22px; border-top: 1px solid var(--joint); max-width: 30rem; }
.ruled-list li {
  padding: 10px 0; border-bottom: 1px solid var(--joint);
  font-family: var(--sans); font-size: 1rem; line-height: 1.35;
}
/* Phones: the photograph follows its heading directly, then the copy */
@media (max-width: 759px) {
  .svc-text { display: contents; }
  .svc-text h3 { order: 1; margin-bottom: 0; }
  .svc-figure { order: 2; }
  .svc-text p, .svc-text .ruled-list { order: 3; margin: 0; }
  .svc-figure-portrait img { aspect-ratio: 4 / 5; object-position: 50% 60%; max-height: 72vh; }
}
/* Tablets and landscape phones: two even columns, copy beside the photograph */
@media (min-width: 760px) and (max-width: 1023px) {
  .svc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--gutter); align-items: start; }
  .svc-text-first .svc-text { grid-column: 1; grid-row: 1; }
  .svc-text-first .svc-figure { grid-column: 2; grid-row: 1; }
  .svc-image-first .svc-figure { grid-column: 1; grid-row: 1; }
  .svc-image-first .svc-text { grid-column: 2; grid-row: 1; }
  .svc-figure-portrait img { aspect-ratio: 4 / 5; object-position: 50% 60%; }
  .svc-image-first .svc-figure img { aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 50%; }
}
@media (min-width: 1024px) {
  .svc { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
  /* text column shares the photo's top and bottom anchors: copy at the top, ruled list on the photo's baseline */
  .svc-text-first { align-items: stretch; }
  .svc-text-first .svc-text { grid-column: 1 / 7; grid-row: 1; display: flex; flex-direction: column; padding-top: 0.25rem; }
  .svc-text-first .svc-text .ruled-list { margin-top: auto; padding-top: 0; }
  .svc-text-first .svc-figure { grid-column: 8 / 13; grid-row: 1; align-self: start; }
  .svc-text-first .svc-figure img { aspect-ratio: 4 / 5; max-height: 620px; object-position: 50% 55%; }
  .svc-image-first .svc-figure { grid-column: 1 / 9; grid-row: 1; }
  .svc-image-first .svc-text { grid-column: 9 / 13; grid-row: 1; padding-top: 0.25rem; padding-left: 8px; }
  .svc-image-first .svc-figure img { aspect-ratio: 3 / 2; object-fit: cover; }
}

/* Coursed pairs: photos laid edge to edge with an 8px joint, heights matched by aspect ratio */
.svc-pair { margin-top: 0; }
.svc-pair-title { margin-bottom: 24px; }
.course { display: flex; flex-wrap: wrap; gap: 32px var(--joint-w); }
.course-item { flex: 1 1 100%; min-width: 0; }
.course-item img { width: 100%; }
.course-item figcaption { padding: 18px 8px 0 0; color: inherit; font-family: var(--serif); font-size: var(--step-0); line-height: 1.6; }
.course-item figcaption h3,
.course-item figcaption h4 { margin-bottom: 10px; }
.course-item figcaption p { max-width: 32rem; }
.ar-169 { --ar: 1.7778; }
.ar-32 { --ar: 1.5; }
.ar-43 { --ar: 1.3333; }
.ar-34 { --ar: 0.75; }
.ar-23 { --ar: 0.6667; }
@media (min-width: 720px) {
  .course { flex-wrap: nowrap; }
  .course-item { flex: var(--ar) 1 0; }
}
.services-dark { padding-block: clamp(3rem, 2rem + 4vw, 6rem); }
.course-dark figcaption p { color: var(--on-dark-soft); }
.course-dark figcaption h3 { color: var(--on-dark); }

/* ---------- Materials and care ---------- */
.materials { padding-block: var(--section); }
.materials-grid { display: grid; gap: 48px; }
.care h2 { margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.25rem); }
.care h3 { margin-bottom: 14px; }
.fine { font-size: 1rem; line-height: 1.55; color: var(--ink-soft); }
.material-list { border-top: 1px solid var(--joint); }
.material-list div {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px;
  padding: 14px 0; border-bottom: 1px solid var(--joint);
}
.material-list dt { font-family: var(--sans); font-weight: 600; font-size: 0.9375rem; color: var(--olive); }
.material-list dd { font-size: 1.0625rem; line-height: 1.45; }
@media (min-width: 640px) {
  .material-list div { grid-template-columns: 11rem minmax(0, 1fr); gap: 20px; align-items: baseline; }
}
@media (min-width: 1024px) {
  .materials-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end; }
  .care { grid-column: 1 / 6; }
  .material-list { grid-column: 7 / 13; }
}

/* ---------- Recent work ---------- */
.recent { padding-block: var(--section); }
.journal { list-style: none; border-top: 1px solid var(--ink); }
.journal-entry {
  display: grid; gap: 8px 24px;
  padding: 24px 0 26px; border-bottom: 1px solid var(--joint);
}
.journal-entry time { font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; color: var(--olive); }
.journal-entry h3 { margin-bottom: 8px; }
.journal-entry p { max-width: 40rem; }
.journal-entry > a { font-family: var(--sans); font-size: 0.9688rem; font-weight: 500; align-self: start; justify-self: start; padding: 6px 0; }
@media (min-width: 900px) {
  .journal-entry { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: baseline; }
  .journal-entry time { grid-column: 1 / 3; }
  .journal-entry > div { grid-column: 3 / 10; }
  .journal-entry > a { grid-column: 10 / 13; justify-self: end; text-align: right; }
}

/* ---------- Gallery ---------- */
.gallery { padding-block: var(--section); }
.gallery-head { display: grid; gap: 24px; margin-bottom: 18px; }
.gallery-head h2 { margin-bottom: 14px; }
.gallery-head p { color: var(--on-dark-soft); max-width: 32rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-content: end; }
.filters button {
  min-height: 44px; padding: 0 16px;
  border: 1px solid rgba(237, 235, 228, 0.38); border-radius: 2px;
  background: transparent; color: var(--on-dark);
  font: 500 0.9688rem/1 var(--sans); cursor: pointer;
}
.filters button:hover { border-color: var(--on-dark); }
.filters button[aria-pressed="true"] { background: var(--on-dark); border-color: var(--on-dark); color: var(--charcoal); }
.gallery-count { margin: 0 0 22px; font-family: var(--sans); font-size: 0.9375rem; color: var(--on-dark-soft); }
@media (min-width: 1024px) {
  .gallery-head { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: end; }
  .filters { justify-content: flex-end; }
}

/* Justified ashlar courses: each stone's width follows its aspect ratio */
.gallery-grid {
  --row: 300px;
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 28px var(--joint-w);
}
.gallery-grid::after { content: ""; flex: 100000 1 0; }
.g-item { flex: calc(var(--ar) * 100) 1 calc(var(--ar) * var(--row)); min-width: 0; }
.g-item[hidden] { display: none; }
.g-item button {
  display: block; width: 100%; padding: 0; border: 0; background: var(--charcoal-2);
  cursor: zoom-in;
}
.g-item img { width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; transition: opacity 0.25s ease; }
.g-item button:hover img { opacity: 0.88; }
.g-item p { margin: 10px 0 0; font-family: var(--sans); font-size: 0.9375rem; line-height: 1.4; color: var(--on-dark-soft); }
@media (max-width: 1023px) { .gallery-grid { --row: 230px; } }
@media (max-width: 640px) {
  .gallery-grid { --row: 150px; gap: 22px var(--joint-w); }
}
@media (max-width: 420px) {
  .gallery-grid { --row: 128px; }
}

/* ---------- Contact ---------- */
.contact { padding-block: var(--section); }
.contact-grid { display: grid; gap: 48px; }
.contact-details h2 { margin-bottom: 18px; }
.contact-lead { font-size: var(--step-1); line-height: 1.5; margin-bottom: 28px; }
.contact-list { border-top: 1px solid rgba(243, 242, 236, 0.3); margin-bottom: 24px; }
.contact-list div {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 16px; align-items: baseline;
  padding: 12px 0; border-bottom: 1px solid rgba(243, 242, 236, 0.3);
}
.contact-list dt { font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; color: #DADCCB; }
.contact-list dd { font-size: 1.0625rem; line-height: 1.45; min-width: 0; }
.contact-list a { text-decoration-color: rgba(243, 242, 236, 0.55); }
.contact-phone { font: 500 clamp(1.5rem, 1.2rem + 1.2vw, 2rem)/1.15 var(--sans); font-stretch: 112%; white-space: nowrap; text-decoration: none; }
.contact-email { overflow-wrap: anywhere; }
@media (max-width: 420px) {
  .contact-list div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
.band-olive .fine { color: #DCDECD; max-width: 32rem; }

.callback {
  align-self: start;
  padding: clamp(22px, 2rem, 40px);
  background: var(--honed); color: var(--ink);
  border-radius: 2px;
}
.demo-label {
  max-width: none; margin: 0 0 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--joint);
  text-align: center; font-family: var(--sans); font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.02em; color: var(--olive);
}
.callback h3 { margin-bottom: 20px; }
.callback-form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1px solid #8F8A7E; border-radius: 2px;
  background: #FBFAF7; color: var(--ink);
  font: 400 1.0625rem/1.3 var(--serif);
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--olive); outline-offset: 1px; border-color: var(--olive); }
.field input[aria-invalid="true"] { border-color: #8A3B2E; }
.callback-form .button { justify-self: start; margin-top: 4px; }
.form-note { font-size: 0.9688rem; line-height: 1.5; color: var(--ink-soft); margin: 0; }
.form-status { margin: 0; font-family: var(--sans); font-size: 0.9688rem; line-height: 1.45; color: var(--olive-deep); font-weight: 500; }
.form-status:empty { display: none; }
.form-status.is-error { color: #8A3B2E; }
@media (min-width: 1024px) {
  .contact-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
  .contact-details { grid-column: 1 / 6; }
  .callback { grid-column: 7 / 13; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .callback-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .callback-form .button, .form-note, .form-status { grid-column: 1 / -1; }
}

/* ---------- Footer ---------- */
.site-footer {
  padding: clamp(3rem, 2rem + 3vw, 4.5rem) 0 max(28px, env(safe-area-inset-bottom));
  background: var(--charcoal); color: var(--on-dark-soft);
  font-family: var(--sans); font-size: 0.9375rem; line-height: 1.6;
}
.footer-grid { display: grid; gap: 24px; margin-bottom: 36px; }
.footer-brand { margin-bottom: 10px; color: var(--on-dark); font-weight: 600; font-stretch: 125%; font-size: 1.0625rem; letter-spacing: 0.02em; text-transform: uppercase; }
.footer-brand span { font-family: var(--serif); font-style: italic; font-weight: 400; font-stretch: 100%; text-transform: none; letter-spacing: 0; }
.site-footer a { color: var(--on-dark); }
.disclosure { margin: 0; padding-top: 22px; border-top: 1px solid rgba(237, 235, 228, 0.16); max-width: none; }
@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 5fr 4fr 3fr; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  --vv-top: 0px; --vv-left: 0px; --vv-w: 100vw; --vv-h: 100vh;
  position: fixed; inset: auto;
  top: var(--vv-top); left: var(--vv-left);
  width: var(--vv-w); height: var(--vv-h);
  max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(22, 23, 22, 0.97); color: var(--on-dark);
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(22, 23, 22, 0.9); }
.lightbox-frame {
  position: absolute; inset: 0;
  container-type: inline-size;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}
.lightbox-close {
  justify-self: end;
  min-width: 44px; min-height: 44px; padding: 0 16px;
  border: 1px solid rgba(237, 235, 228, 0.6); border-radius: 2px;
  background: var(--charcoal); color: var(--on-dark);
  font: 500 1rem/1 var(--sans); cursor: pointer;
}
.lightbox-figure {
  min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center;
  padding: 10px 0;
}
.lightbox-figure img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; min-height: 0; }
.lightbox-figure figcaption { padding-top: 10px; color: var(--on-dark-soft); text-align: center; max-width: 40rem; }
.lightbox-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lightbox-nav button {
  min-width: 44px; min-height: 44px; padding: 0 16px;
  border: 1px solid rgba(237, 235, 228, 0.38); border-radius: 2px;
  background: transparent; color: var(--on-dark);
  font: 500 0.9688rem/1 var(--sans); cursor: pointer;
}
.lightbox-count { font-family: var(--sans); font-size: 0.9375rem; color: var(--on-dark-soft); text-align: center; }
/* very narrow visual viewports (for example a pinch-zoomed small phone): keep Close and both arrows in view */
@container (max-width: 280px) {
  .lightbox-count { display: none; }
  .lightbox-nav button, .lightbox-close { padding: 0 10px; }
}
@media (max-height: 460px) {
  .lightbox-frame { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr) auto; column-gap: 12px; }
  .lightbox-close { grid-column: 2; grid-row: 1; align-self: start; }
  .lightbox-figure { grid-column: 1; grid-row: 1 / 3; padding: 0; }
  .lightbox-nav { grid-column: 2; grid-row: 2; flex-direction: column; align-items: stretch; }
  .lightbox-figure figcaption { font-size: 0.875rem; padding-top: 6px; }
}

@media print {
  .site-header, .hero-controls, .menu, .lightbox { display: none !important; }
  .hero { height: auto; min-height: 0; }
}

/* JS-balanced courses override the CSS flex fallback */
.gallery-grid.is-justified .g-item { flex: 0 0 auto; }
.gallery-grid.is-justified::after { display: none; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
