:root {
  /* Brand palette */
  --cream: #F5F1EA;
  --ink: #1A2332;
  --stone: #8A8478;
  --brass: #A8884A;

  /* Type scale (clamp for fluid sizing) */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'Inter', system-ui, sans-serif;
  --fs-eyebrow: 0.6875rem;       /* 11px */
  --fs-body: 0.9375rem;          /* 15px */
  --fs-h3: clamp(1.25rem, 1.5vw + 1rem, 1.75rem);
  --fs-h2: clamp(1.75rem, 2vw + 1.25rem, 2.5rem);
  --fs-hero: clamp(2.5rem, 4vw + 2rem, 4.5rem);
  --tracking-eyebrow: 0.18em;
  --tracking-button: 0.15em;

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 6rem;

  /* Layout */
  --container: 1440px;
  --container-narrow: 880px;
  --content-side-pad: clamp(1.25rem, 4vw, 3rem);
}

/* Reset + base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.05;
  margin: 0;
}
.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brass);
}
.rule {
  display: block;
  width: 32px;
  height: 1px;
  background: var(--brass);
  border: 0;
}
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--content-side-pad);
}
.cta {
  display: inline-block;
  background: var(--ink);
  color: var(--cream);
  padding: 0.875rem 1.5rem;
  font-family: var(--font-ui);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid var(--brass);
  transition: transform 0.2s;
}
.cta:hover { transform: translateY(-1px); }
.cta:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Skip link (keyboard accessibility) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--cream);
  padding: 0.625rem 1rem;
  font-family: var(--font-ui);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  text-decoration: none;
  z-index: 200;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Sticky nav */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid rgba(26, 35, 50, 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.topnav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.logo {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 400;
}
.topnav nav { display: flex; gap: 1.75rem; align-items: center; }
.topnav nav a {
  font-family: var(--font-ui);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.topnav nav a:hover { color: var(--brass); }
.topnav nav a.nav-cta {
  background: var(--ink);
  color: var(--cream);
  padding: 0.625rem 1rem;
  border-bottom: 2px solid var(--brass);
}

/* Sections */
.section {
  padding: var(--space-6) 0;
  scroll-margin-top: 80px;
}
.section-hero { padding: 0; }

/* Footer */
footer { background: var(--ink); color: var(--cream); padding: var(--space-5) 0; }
footer .container { padding: 0 var(--content-side-pad); }
/* Note: footer paragraph styling lives on .footer-eyebrow and .footer-line classes — see Task 7 footer-grid block. */

/* Hero */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 560px;
}
.hero-image {
  background: linear-gradient(135deg, #2d3e50 0%, #1a2332 70%);
  background-image: url('assets/photos/hero-twilight.jpg');
  background-size: cover;
  background-position: center;
}
.hero-content {
  padding: var(--space-6) var(--content-side-pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 480px;
}
.hero-h1 {
  font-style: italic;
  font-size: var(--fs-hero);
  margin: var(--space-3) 0 var(--space-3) 0;
  font-weight: 300;
}
.hero-sub {
  font-size: 1.0625rem;
  line-height: 1.55;
  margin: 0 0 var(--space-4) 0;
  max-width: 36ch;
  color: var(--ink);
}
.hero-ctas {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.cta-secondary {
  font-family: var(--font-ui);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-button);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--ink);
  transition: color 0.2s, border-color 0.2s;
}
.cta-secondary:hover { color: var(--brass); border-bottom-color: var(--brass); }
.cta-secondary:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.hero-spec-strip {
  background: var(--ink);
  color: var(--cream);
  padding: var(--space-3) 0;
}
.hero-specs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
}
.hero-specs > div { display: flex; flex-direction: column; }
.spec-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.875rem;
  font-weight: 300;
  line-height: 1.0;
}
.spec-label {
  font-family: var(--font-ui);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  color: var(--brass);
  text-transform: uppercase;
  margin-top: 0.5rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-image { min-height: 320px; }
  .hero-content { padding: var(--space-5) var(--content-side-pad); }
  .hero-specs { grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
}
@media (max-width: 480px) {
  .hero-specs { grid-template-columns: repeat(2, 1fr); }
}

/* Section intro (used by gallery and others) */
.section-intro {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 60ch;
  margin: var(--space-3) 0 var(--space-5);
  color: var(--ink);
}

/* Scrubber grid */
.scrubber-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
.scrubber {
  margin: 0;
}
.scrubber-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--ink);
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
  cursor: ew-resize;
}
.scrubber-frame:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 4px;
}
.scrubber-empty,
.scrubber-staged {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scrubber-staged {
  clip-path: inset(0 0 0 50%);
}
.scrubber-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--brass);
  pointer-events: none;
  transform: translateX(-50%);
}
.scrubber-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid var(--brass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 16px;
  color: var(--ink);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.scrubber-labels {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  pointer-events: none;
}
.scrubber-labels span {
  font-family: var(--font-ui);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  font-weight: 500;
  background: rgba(26, 35, 50, 0.45);
  padding: 4px 10px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.scrubber figcaption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.875rem;
  color: var(--stone);
  margin-top: 0.5rem;
  text-align: right;
}
.scrubber-fullscreen-btn {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  background: rgba(245, 241, 234, 0.9);
  border: 1px solid rgba(26, 35, 50, 0.08);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  z-index: 5;
  padding: 0;
  transition: background 0.2s, transform 0.15s;
}
.scrubber-fullscreen-btn:hover { background: var(--cream); transform: scale(1.05); }
.scrubber-fullscreen-btn:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
.scrubber-fullscreen-btn svg { pointer-events: none; }
.scrubber-frame.is-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  aspect-ratio: unset;
  background: rgba(10, 14, 22, 0.96);
  touch-action: none;
}
.scrubber-frame.is-fullscreen .scrubber-empty,
.scrubber-frame.is-fullscreen .scrubber-staged {
  object-fit: contain;
}
.scrubber-frame.is-fullscreen .scrubber-fullscreen-btn {
  bottom: 1.5rem;
  right: 1.5rem;
  width: 52px;
  height: 52px;
  background: rgba(245, 241, 234, 0.95);
  border: 2px solid var(--brass);
}
.scrubber-frame.is-fullscreen .scrubber-fullscreen-btn svg { display: none; }
.scrubber-frame.is-fullscreen .scrubber-fullscreen-btn::after {
  content: '\2715';
  font-size: 24px;
  font-weight: 300;
  color: var(--ink);
  line-height: 1;
  font-family: var(--font-ui);
}
.scrubber-prev-btn, .scrubber-next-btn {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(245, 241, 234, 0.08);
  color: var(--cream);
  border: 1px solid rgba(245, 241, 234, 0.35);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  font-family: serif;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 6;
}
.scrubber-prev-btn { left: 1.5rem; }
.scrubber-next-btn { right: 1.5rem; }
.scrubber-prev-btn:hover, .scrubber-next-btn:hover { background: rgba(245, 241, 234, 0.18); }
.scrubber-prev-btn:focus-visible, .scrubber-next-btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.scrubber-frame.is-fullscreen .scrubber-prev-btn,
.scrubber-frame.is-fullscreen .scrubber-next-btn { display: flex; }
.scrubber-frame.no-gallery .scrubber-prev-btn,
.scrubber-frame.no-gallery .scrubber-next-btn { display: none !important; }
body.scrubber-fullscreen-active { overflow: hidden; }

/* Per-room blocks in the Gallery section */
.room-blocks {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-top: var(--space-4);
}
.room-block {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.room-label {
  font-family: var(--font-ui);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--brass);
  margin: 0 0 var(--space-1);
}

@media (max-width: 768px) {
  .scrubber-grid { grid-template-columns: 1fr; gap: var(--space-3); }
  .scrubber-fullscreen-btn {
    width: 44px;
    height: 44px;
    bottom: 0.5rem;
    right: 0.5rem;
  }
}

/* Pillars (Story) */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.pillar { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.pillar:hover .pillar-image { transform: translateY(-2px); }
.pillar-image {
  aspect-ratio: 3 / 2;
  background-size: cover;
  background-position: center;
  margin-bottom: var(--space-3);
  transition: transform 0.2s;
}
.pillar h3 {
  font-size: var(--fs-h3);
  font-weight: 400;
  font-style: italic;
  margin-top: 0.5rem;
  color: var(--ink);
}

/* Feature sections (kitchen, trail) */
.section-feature { background: rgba(168, 136, 74, 0.04); }
.kitchen-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-areas:
    "gallery header"
    "gallery body";
  column-gap: var(--space-5);
  row-gap: var(--space-3);
  align-items: start;
}
.kitchen-header { grid-area: header; }
.kitchen-body { grid-area: body; }
.kitchen-grid .gallery { grid-area: gallery; }
.trail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-areas:
    "gallery header"
    "gallery body";
  column-gap: var(--space-5);
  row-gap: var(--space-3);
  align-items: start;
}
.trail-header { grid-area: header; }
.trail-body { grid-area: body; }
.trail-grid .gallery { grid-area: gallery; }
.kitchen-image, .trail-image {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  cursor: zoom-in;
}
.gallery { display: flex; flex-direction: column; gap: var(--space-2); }
.gallery-main, .gallery-thumb {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
  display: block;
}
.gallery-main { aspect-ratio: 4 / 3; width: 100%; }
.gallery-thumb { aspect-ratio: 4 / 3; }
.gallery-main img, .gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s;
}
.gallery-main:hover img, .gallery-thumb:hover img { transform: scale(1.02); }
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--space-2);
}
.gallery-main:focus-visible, .gallery-thumb:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
.kitchen-header h2, .trail-header h2 {
  font-style: italic;
  font-size: var(--fs-h2);
  margin: var(--space-2) 0;
}
.kitchen-body p, .trail-body p {
  font-size: 1rem;
  line-height: 1.65;
  margin: var(--space-3) 0;
  max-width: 50ch;
}
.callouts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin: var(--space-3) 0 0;
}
.callouts > div {
  border-top: 1px solid rgba(168, 136, 74, 0.3);
  padding: 0.75rem 0;
}
.callouts dt {
  font-family: var(--font-ui);
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
}
.callouts dd {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  color: var(--ink);
}

/* Floor plan */
.floor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.floor-grid figure { margin: 0; }
.floor-grid img { width: 100%; cursor: zoom-in; }
.floor-grid figcaption {
  font-family: var(--font-display);
  font-style: italic;
  text-align: center;
  margin-top: 0.5rem;
  color: var(--stone);
}

/* Specs (dark) */
.section-dark { background: var(--ink); color: var(--cream); }
.section-dark h2 { color: var(--cream); }
.section-dark p { color: rgba(245, 241, 234, 0.85); }
.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  margin-top: var(--space-4);
}
.spec-block h4 {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
  margin: 0 0 var(--space-2);
}
.spec-block dl { margin: 0; }
.spec-block dl > div {
  display: flex;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid rgba(168, 136, 74, 0.18);
  font-size: 0.9375rem;
}
.spec-block dt { color: rgba(245, 241, 234, 0.6); }
.spec-block dd { margin: 0; color: var(--cream); font-weight: 500; }

/* Neighborhood */
.schools { margin-top: var(--space-4); }
.schools h4 {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
}
.schools ul {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 0;
}
.schools li { padding: 0.625rem 0; border-bottom: 1px solid rgba(26, 35, 50, 0.1); }

.neighborhood-map { margin: var(--space-4) 0 var(--space-5); }
.neighborhood-map img {
  width: 100%;
  border: 1px solid rgba(26, 35, 50, 0.08);
}
.neighborhood-map figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-top: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--stone);
}
.map-legend, .map-distances {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.legend-item { display: inline-flex; align-items: center; gap: 0.5rem; }
.pin { display: inline-block; }
.pin-home { width: 10px; height: 10px; background: var(--brass); transform: rotate(45deg); }
.pin-employer { width: 10px; height: 10px; background: var(--ink); border-radius: 50%; }
.pin-trail { width: 18px; height: 3px; background: #6B7C5C; }
.map-distances strong { font-weight: 600; color: var(--ink); }

@media (max-width: 768px) {
  .pillars, .specs-grid, .floor-grid { grid-template-columns: 1fr; }
  .kitchen-grid, .trail-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "gallery"
      "body";
    gap: var(--space-3);
  }
  .callouts { grid-template-columns: 1fr; }
}

/* Showing section: form + Calendly */
.showing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: start;
}
.showing-form { margin-top: var(--space-3); display: grid; gap: var(--space-2); }
.showing-form label { display: flex; flex-direction: column; }
.showing-form label span {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
  margin-bottom: 0.375rem;
}
.showing-form input,
.showing-form textarea {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  background: var(--cream);
  color: var(--ink);
  border: 1px solid rgba(26, 35, 50, 0.2);
  padding: 0.625rem 0.75rem;
  resize: vertical;
}
.showing-form input:focus,
.showing-form textarea:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
  border-color: var(--brass);
}
.showing-form button {
  margin-top: var(--space-2);
  justify-self: start;
  cursor: pointer;
  border: 0;
}

.contact-direct {
  margin-top: var(--space-3);
  font-family: var(--font-display);
  font-style: italic;
  color: var(--stone);
}
.phone-link {
  color: var(--ink);
  font-family: var(--font-ui);
  font-style: normal;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
}

@media (max-width: 768px) {
  .showing-grid { grid-template-columns: 1fr; }
}

/* Footer 4-column grid */
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  padding: var(--space-5) 0 var(--space-3);
}
.logo-footer {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--cream);
  margin: 0 0 0.5rem;
}
.footer-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.footer-line {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(245, 241, 234, 0.7);
  margin: 0 0 0.25rem;
}
.footer-line a {
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-3); }
}

/* Mobile hamburger nav */
.nav-toggle {
  display: none;
  background: 0;
  border: 0;
  font-size: 1.5rem;
  color: var(--ink);
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}
.nav-toggle:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .topnav nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    flex-direction: column;
    padding: var(--space-3) var(--content-side-pad);
    gap: var(--space-2);
    border-top: 1px solid rgba(26, 35, 50, 0.08);
    border-bottom: 1px solid rgba(26, 35, 50, 0.08);
  }
  .topnav nav.open { display: flex; }
  .topnav nav.open a {
    padding: 0.75rem 0;
    width: 100%;
  }
}

/* Defensive: ensure form fields fill their parent on all viewports */
.showing-form input,
.showing-form textarea {
  width: 100%;
}

/* Performance: skip offscreen rendering for non-hero sections */
.section { content-visibility: auto; contain-intrinsic-size: 800px; }
.section-hero { content-visibility: visible; }

/* Lightbox (click-to-zoom for photos) */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 22, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
  padding: 2vmin;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.lightbox.open { display: flex; }
.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
}
.lightbox img {
  max-width: 100%;
  min-height: 0;
  flex: 0 1 auto;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.lightbox-caption {
  flex: 0 0 auto;
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  text-align: center;
  margin: 0;
  max-width: 60ch;
  opacity: 0.85;
  letter-spacing: 0.02em;
  padding: 0 1rem;
  line-height: 1.4;
}
.lightbox-caption:empty { display: none; }
.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(245, 241, 234, 0.08);
  color: var(--cream);
  border: 1px solid rgba(245, 241, 234, 0.35);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 300;
}
.lightbox-close:hover { background: rgba(245, 241, 234, 0.18); }
.lightbox-close:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.lightbox-prev, .lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(245, 241, 234, 0.08);
  color: var(--cream);
  border: 1px solid rgba(245, 241, 234, 0.35);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  font-family: serif;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
}
.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(245, 241, 234, 0.18); }
.lightbox-prev:focus-visible, .lightbox-next:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.lightbox.gallery-mode .lightbox-prev,
.lightbox.gallery-mode .lightbox-next { display: flex; }
body.lightbox-open { overflow: hidden; }
