/* Fonts: self-hosted, latin + latin-ext subsets */
@font-face {
  font-family: 'Source Serif 4';
  src: url('../fonts/source-serif-4-latin.woff2') format('woff2');
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  src: url('../fonts/source-serif-4-latin-ext.woff2') format('woff2');
  font-weight: 200 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Onest';
  src: url('../fonts/onest-latin.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  src: url('../fonts/onest-latin-ext.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Tokens */
:root {
  --bg: #fbf8f3;
  --surface: #f3eee6;
  --surface-strong: #ebe4d8;
  --ink: #2b2925;
  --muted: #5d5950;
  --accent: #55603e;
  --accent-strong: #434c30;
  --accent-soft: #e4e6d6;
  --line: #e2dbcf;
  --on-accent: #ffffff;

  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-sans: 'Onest', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

  --step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-0: clamp(1.0625rem, 1.02rem + 0.18vw, 1.125rem);
  --step-1: clamp(1.1875rem, 1.1rem + 0.4vw, 1.4375rem);
  --step-2: clamp(1.375rem, 1.25rem + 0.6vw, 1.75rem);
  --step-3: clamp(2rem, 1.6rem + 1.9vw, 3.125rem);
  --step-4: clamp(2.875rem, 2rem + 4.2vw, 5.25rem);

  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur-ui: 200ms;
  --shadow-soft: 0 1px 2px rgb(60 50 35 / 6%), 0 8px 24px -12px rgb(60 50 35 / 18%);
  --shadow-lift: 0 2px 4px rgb(60 50 35 / 6%), 0 18px 36px -16px rgb(60 50 35 / 28%);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--step-4); line-height: 1.06; letter-spacing: -0.015em; margin: 0 0 0.35em; }
h2 { font-size: var(--step-3); line-height: 1.15; margin: 0 0 0.5em; }
h3 { font-size: var(--step-2); line-height: 1.25; font-weight: 550; margin: 0; }
p { margin: 0 0 1em; max-width: 65ch; text-wrap: pretty; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.container { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.section { padding-block: clamp(3.5rem, 2.5rem + 5vw, 6.5rem); }
.eyebrow {
  font-size: var(--step--1); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 0.9rem;
}
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink); max-width: 32ch; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.skip {
  position: absolute; left: 1rem; top: -100px; z-index: 10;
  padding: 0.75rem 1rem; border-radius: var(--radius-sm); background: var(--ink); color: var(--bg);
}
.skip:focus { top: 1rem; }

/* Header */
.header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 1rem 0.5rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.65rem; min-height: 44px; padding-block: 0.25rem;
  font-family: var(--font-serif); font-optical-sizing: auto; font-weight: 600;
  font-size: 1.5rem; line-height: 1.1; text-decoration: none;
}
.brand-mark { flex: none; width: auto; height: 40px; }
.brand-text { display: flex; flex-direction: column; }
.brand-place {
  font-family: var(--font-sans); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 0.15rem;
}
.nav { display: flex; gap: 0.25rem 0.5rem; margin-right: -0.5rem; }
.nav-extra { display: none !important; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: 0.5rem;
  font-size: var(--step--1); font-weight: 500; color: var(--muted); text-decoration: none;
  border-radius: 8px; transition: color var(--dur-ui) var(--ease);
}
.nav a:hover { color: var(--ink); }

/* Hero */
.hero { padding-block: clamp(1.75rem, 1rem + 4vw, 5rem) clamp(3rem, 2rem + 4vw, 5.5rem); }
.hero-text { max-width: 40rem; }
.hero .lead { margin-bottom: 1.75rem; }
.call {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; max-width: 22rem; min-height: 76px; padding: 0.7rem 2rem;
  --call-radius: 14px;
  border-radius: var(--call-radius); background: var(--accent); color: var(--on-accent);
  text-align: center; text-decoration: none; line-height: 1.25;
  box-shadow: 0 1px 2px rgb(40 45 25 / 8%), 0 4px 12px -6px rgb(40 45 25 / 16%);
  transition: background-color var(--dur-ui) var(--ease), box-shadow var(--dur-ui) var(--ease), transform 150ms var(--ease);
}
.call-label { font-size: var(--step--1); font-weight: 500; letter-spacing: 0.04em; opacity: 0.92; }
.call-number { font-size: 1.5rem; font-weight: 600; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.call:hover { background: var(--accent-strong); box-shadow: 0 1px 2px rgb(40 45 25 / 10%), 0 6px 16px -8px rgb(40 45 25 / 22%); }
.call:active { transform: translateY(1px) scale(0.99); box-shadow: 0 1px 1px rgb(40 45 25 / 10%); }
/* Keep the button's own radius when focused */
.call:focus-visible { outline-offset: 4px; border-radius: var(--call-radius); }
.hero-mark { display: none; }

/* Services */
.services { border-top: 1px solid var(--line); }
.services-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.service { padding: 1.25rem 1.25rem 1.1rem; border-radius: var(--radius); background: var(--surface); }
.service h3 { margin-bottom: 0.35rem; }
.service p { margin: 0; color: var(--muted); }

/* Gallery */
.gallery { border-top: 1px solid var(--line); }
.section-heading { margin-bottom: clamp(1.75rem, 1.2rem + 2vw, 2.75rem); }
.section-heading h2 { margin-bottom: 0.35em; }
.gallery-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(1.25rem, 0.8rem + 1.6vw, 2rem); }
.card {
  min-width: 0; margin: 0; overflow: hidden;
  border-radius: var(--radius); background: var(--surface);
  transition: translate 250ms var(--ease), box-shadow 250ms var(--ease), background-color 250ms var(--ease);
}
.gallery-open { display: block; cursor: zoom-in; }
.gallery-open:focus-visible { outline-offset: -3px; border-radius: var(--radius) var(--radius) 0 0; }
.card img {
  width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  background: var(--surface-strong);
}
.card figcaption { padding: 0.9rem 1.1rem 1rem; }
.card h3 { font-size: var(--step-1); }
.js .gallery-grid:not(.is-expanded) > .gallery-extra { display: none; }
.gallery-extra.is-entering { animation: card-in 300ms var(--ease) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } }
.gallery-more { display: flex; justify-content: center; margin-top: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.gallery-more[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) {
  .card:hover { translate: 0 -4px; box-shadow: var(--shadow-lift); background: #f5f1ea; }
}

/* About and contact */
.about { background: var(--surface); }
.about-grid { display: grid; gap: 2.5rem; }
.about-grid > * { min-width: 0; }
.about-intro .lead { margin-bottom: 0.75rem; }
.details { margin: 0; display: grid; gap: 1.25rem; align-content: start; }
.details > div { padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.details > div:last-child { border-bottom: 0; padding-bottom: 0; }
.details dt { font-size: var(--step--1); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.2rem; }
.details dd { margin: 0; overflow-wrap: anywhere; font-size: var(--step-1); }
.detail-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 500; text-decoration: underline; text-decoration-color: rgb(85 96 62 / 45%);
  text-decoration-thickness: 1.5px; text-underline-offset: 0.25em;
  transition: text-decoration-color var(--dur-ui) var(--ease), color var(--dur-ui) var(--ease);
}
.detail-link:hover { color: var(--accent-strong); text-decoration-color: currentColor; }

.location h3 { margin-bottom: 0.9rem; }
.map { position: relative; height: 280px; border-radius: var(--radius); overflow: hidden; background: var(--surface-strong); }
.map-placeholder {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.6rem; padding: 1.25rem; text-align: center;
  background:
    radial-gradient(circle at 50% 38%, rgb(255 255 255 / 55%), transparent 60%),
    repeating-linear-gradient(135deg, transparent 0 22px, rgb(85 96 62 / 5%) 22px 23px),
    var(--surface-strong);
}
.map-pin { width: 30px; height: 30px; color: var(--accent); }
.map-address { margin: 0; font-weight: 500; }
.map-load, .pill-button {
  min-height: 48px; padding: 0.6rem 1.4rem; border: 1.5px solid var(--accent); border-radius: 999px;
  background: var(--bg); color: var(--accent-strong); font-weight: 600; cursor: pointer;
  transition: background-color var(--dur-ui) var(--ease), color var(--dur-ui) var(--ease), transform 150ms var(--ease);
}
.map-load:hover, .pill-button:hover { background: var(--accent); color: var(--on-accent); }
.map-load:active, .pill-button:active { transform: scale(0.98); }
.map-hint { margin: 0; font-size: var(--step--1); color: var(--muted); max-width: 32ch; }
.map-frame { display: block; width: 100%; height: 100%; border: 0; }
.map-link {
  display: inline-flex; align-items: center; min-height: 48px; margin-top: 0.25rem;
  font-weight: 500; color: var(--accent-strong);
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.25em;
}
.map-link:hover { color: var(--ink); }

/* Footer */
.footer { border-top: 1px solid var(--line); }
.footer-inner {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem;
  padding-block: 2rem; color: var(--muted); font-size: var(--step--1);
}
.footer .brand { color: var(--ink); font-size: 1.375rem; }
.footer .brand-mark { height: 28px; }
.footer-top { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 0.25em; }
.footer-meta { margin: 0; }
.footer-meta a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 0.25em; }

/* Plain pages: privacy, 404 */
.page { padding-block: clamp(2rem, 1rem + 4vw, 4.5rem) clamp(3rem, 2rem + 4vw, 6rem); }
.page h1 { font-size: var(--step-3); }
.prose h2 { font-size: var(--step-2); margin: 2.25rem 0 0.5rem; }
.prose a { color: var(--accent-strong); text-underline-offset: 0.2em; }
.page-updated { margin-top: 2.5rem; font-size: var(--step--1); }
a.pill-button { display: inline-flex; align-items: center; text-decoration: none; }
.not-found-actions { margin: 1.75rem 0; }

/* Lightbox */
.lightbox {
  width: min(1100px, 100% - 1.5rem); max-width: none;
  height: min(860px, 100dvh - 1.5rem); max-height: none;
  padding: clamp(0.75rem, 0.5rem + 1vw, 1.25rem); border: 0; border-radius: 20px;
  background: var(--bg); color: var(--ink); box-shadow: 0 30px 80px -20px rgb(20 18 12 / 45%);
}
.lightbox::backdrop { background: rgb(30 28 22 / 72%); }
.lightbox-layout { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 0.75rem; }
.lightbox-header, .lightbox-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.lightbox-header h2 { font-size: var(--step-2); margin: 0; padding-left: 0.25rem; }
.lightbox-stage { min-height: 0; overflow: hidden; border-radius: 12px; background: var(--surface); touch-action: pan-y pinch-zoom; }
.lightbox-image { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; view-transition-name: lightbox-image; }
.lightbox-caption { margin: 0; text-align: center; font-size: var(--step--1); color: var(--muted); font-variant-numeric: tabular-nums; }
.icon-button {
  flex: none; display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background-color var(--dur-ui) var(--ease), transform 150ms var(--ease);
}
.icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover { background: var(--surface-strong); }
.icon-button:active { transform: scale(0.94); }
.icon-button:focus-visible { outline-offset: 2px; border-radius: 999px; }
.text-button {
  flex: none; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 48px; padding: 0 1rem 0 1.25rem;
  border: 0; border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 500; cursor: pointer;
  transition: background-color var(--dur-ui) var(--ease), transform 150ms var(--ease);
}
.text-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.text-button:hover { background: var(--surface-strong); }
.text-button:active { transform: scale(0.97); }
.text-button:focus-visible { outline-offset: 2px; border-radius: 999px; }
body.lightbox-open { overflow: hidden; }

/* Motion */
.lightbox[open] { animation: lightbox-in 200ms var(--ease) both; }
.lightbox[open]::backdrop { animation: backdrop-in 200ms var(--ease) both; }
.lightbox.is-closing { animation: lightbox-out 180ms var(--ease) both; }
.lightbox.is-closing::backdrop { animation: backdrop-out 180ms var(--ease) both; }
@keyframes lightbox-in { from { opacity: 0; transform: translateY(8px) scale(0.99); } }
@keyframes lightbox-out { to { opacity: 0; transform: translateY(8px) scale(0.99); } }
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes backdrop-out { to { opacity: 0; } }

::view-transition-group(lightbox-image) { animation-duration: 220ms; animation-timing-function: var(--ease); }
::view-transition-old(lightbox-image), ::view-transition-new(lightbox-image) { animation-duration: 220ms; animation-timing-function: var(--ease); }
html[data-lb-dir='next']::view-transition-old(lightbox-image) { animation-name: lb-out-left; }
html[data-lb-dir='next']::view-transition-new(lightbox-image) { animation-name: lb-in-right; }
html[data-lb-dir='prev']::view-transition-old(lightbox-image) { animation-name: lb-out-right; }
html[data-lb-dir='prev']::view-transition-new(lightbox-image) { animation-name: lb-in-left; }
@keyframes lb-out-left { to { opacity: 0; transform: translateX(-24px); } }
@keyframes lb-out-right { to { opacity: 0; transform: translateX(24px); } }
@keyframes lb-in-right { from { opacity: 0; transform: translateX(24px); } }
@keyframes lb-in-left { from { opacity: 0; transform: translateX(-24px); } }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
    @keyframes reveal {
      from { opacity: 0; transform: translateY(12px); animation-timing-function: var(--ease); }
      to { opacity: 1; transform: none; }
    }
  }
}

/* Breakpoints */
@media (min-width: 640px) {
  .container { width: min(1160px, 100% - 4rem); }
  .header { padding-block: 1.75rem 0.75rem; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .call { width: auto; min-width: 18rem; }
  .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}
@media (min-width: 640px) and (max-width: 1023.98px) {
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; row-gap: 0; }
  .details > div, .details > div:last-child { padding: 1rem 0; border-bottom: 0; border-top: 1px solid var(--line); }
}
@media (min-width: 768px) {
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3rem; }
  /* 220px at 768, ~282px at 1024, 320px from ~1180 */
  .hero-mark {
    display: grid; place-items: center; width: clamp(220px, 24vw + 36px, 320px); aspect-ratio: 1;
    margin-right: clamp(0rem, 4vw - 1rem, 3rem);
    border-radius: 50%; background: var(--surface);
  }
  /* Optical nudge: the drawing's mass sits right of its box */
  .hero-mark img { width: 67%; height: auto; translate: -3.5% -1%; }
  .nav { gap: 1rem; }
  .nav-extra { display: inline-flex !important; }
  .brand { font-size: 1.625rem; }
  .brand-text { flex-direction: row; align-items: baseline; gap: 0.6rem; }
  .brand-place { font-size: var(--step--1); margin-top: 0; }
  .call { min-width: 20rem; min-height: 88px; padding: 0.9rem 2.5rem; --call-radius: 16px; }
  .call-label { font-size: 1rem; }
  .call-number { font-size: 1.875rem; }
}
@media (min-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .about-grid { column-gap: 4.5rem; row-gap: 3rem; }
  .about-intro { grid-column: 1; grid-row: 1; }
  .about-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .details { grid-column: 2; grid-row: 1; padding-top: 0.25rem; }
  .location { grid-column: 1 / -1; grid-row: 2; }
  .map { height: auto; aspect-ratio: 21 / 9; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .card:hover { translate: none; }
}
