:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --text: #111111;
  --muted: #555555;
  --border: #d8d8d8;
  --accent: #111111;
  --accent-soft: #f4f4f4;
  --shadow: 0 10px 24px rgba(17, 17, 17, 0.06), 0 2px 6px rgba(17, 17, 17, 0.04);
  --shadow-compact: 0 6px 14px rgba(17, 17, 17, 0.08), 0 1px 3px rgba(17, 17, 17, 0.06);
  --radius: 6px;
  --content: min(1200px, calc(100vw - 2rem));
  --font-body: "Helvetica Neue", "Segoe UI", sans-serif;
  --font-display: "Helvetica Neue", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
}

body.is-lightbox-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.site-shell {
  width: var(--content);
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.site-header {
  padding: 1.25rem 0 1rem;
}

.site-header.compact {
  padding-bottom: 0.5rem;
}

.eyebrow,
.section-label {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.1;
  font-weight: 600;
}

h1 {
  font-size: clamp(1.1rem, 3vw, 2.3rem);
}

.compact h1 {
  font-size: clamp(1rem, 2.5vw, 1.6rem);
}

.intro,
.page-intro p,
.hero-card p,
.gallery-card p,
.viewer-error p,
.site-footer small {
  color: var(--muted);
}

.intro {
  max-width: 46rem;
  margin: 1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.6;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.site-nav a,
.button-link,
.viewer-nav-buttons button,
.lightbox-arrow,
.lightbox-close {
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-compact);
}

.site-nav a,
.button-link,
.viewer-nav-buttons button,
.lightbox-arrow {
  padding: 0.78rem 1rem;
}

.site-nav a[aria-current="page"] {
  background: var(--accent-soft);
}

.page {
  display: grid;
  gap: 1.4rem;
}

.hero-card,
.page-intro,
.gallery-card,
.viewer-error,
.viewer-strip-section,
.pannellum-shell,
.lightbox-dialog {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card,
.page-intro,
.viewer-error,
.viewer-strip-section {
  padding: 1.4rem;
}

.hero-card {
  display: grid;
  gap: 1rem;
}

.card-grid,
.gallery-grid {
  display: grid;
  gap: 1rem;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.detail-grid {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}

.gallery-card {
  overflow: hidden;
}

.gallery-card a,
.gallery-card button {
  display: grid;
  gap: 0.9rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.gallery-card figure {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f4f4f4;
  position: relative;
  border-radius: calc(var(--radius) + 1px);
}

.panorama-grid .gallery-card figure {
  aspect-ratio: 16 / 9;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-card-body {
  padding: 0 1rem 1rem;
}

.gallery-card h3 {
  font-size: 0.96rem;
  font-weight: 400;
}

.gallery-card p {
  margin: 0.45rem 0 0;
  line-height: 1.5;
}

.home-card .gallery-card-body {
  position: absolute;
  inset: 0;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.12));
}

.home-card a,
.home-card button {
  position: relative;
  overflow: hidden;
}

.home-card h3 {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

.home-card .meta {
  display: none;
}

.gallery-card .meta {
  margin-top: 0.8rem;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 500;
}

.pannellum-shell {
  min-height: clamp(320px, 66vh, 720px);
  overflow: hidden;
}

#pannellum-viewer {
  width: 100%;
  min-height: inherit;
}

.pannellum-frame {
  border: 0;
  display: block;
}

.pano-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
}

.pano-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.pano-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0 0 0.75rem;
  background: #111111;
  color: #ffffff;
  border-radius: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.pano-lightbox-dialog .pannellum-shell {
  min-height: 0;
  height: 100%;
  align-self: stretch;
  width: 100%;
}

.pano-lightbox-title {
  position: absolute;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: calc(100% - 7rem);
  font-size: 1rem;
  color: #ffffff;
  margin: 0;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.pano-lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}

.pano-nav {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  align-items: start;
  flex-wrap: nowrap;
  overflow: hidden;
  padding: 0 0.75rem;
}

.pano-thumb-link {
  width: min(84px, 9vw);
  color: #ffffff;
  text-decoration: none;
  flex: 0 0 auto;
}

.pano-overview-link {
  width: min(84px, 9vw);
  color: #ffffff;
  text-decoration: none;
  flex: 0 0 auto;
}

.pano-overview-box {
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.pano-overview-link figcaption {
  display: none;
}

.pano-thumb-link figure {
  margin: 0;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #2a2a2a;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.pano-thumb-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
}

.pano-thumb-link figcaption {
  display: none;
}

.pano-thumb-link.is-current figure,
.pano-thumb-link[aria-current="true"] figure {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.pano-thumb-link.is-current img,
.pano-thumb-link[aria-current="true"] img {
  opacity: 1;
}

.pano-thumb-link.is-current figcaption,
.pano-thumb-link[aria-current="true"] figcaption {
  color: #ffffff;
  font-weight: 700;
}

.pano-thumb-arrow {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  pointer-events: none;
}

.pano-overlay-arrow {
  opacity: 0.3;
  background: rgba(255, 255, 255, 0.18);
  color: #111111;
  border-color: rgba(255, 255, 255, 0.25);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}

.pano-lightbox-dialog:hover .pano-overlay-arrow,
.pano-lightbox-dialog:focus-within .pano-overlay-arrow,
.detail-lightbox-dialog:hover .pano-overlay-arrow,
.detail-lightbox-dialog:focus-within .pano-overlay-arrow {
  opacity: 0.6;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 1.6rem 0 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100vw - 1rem));
  max-height: calc(100vh - 1rem);
  margin: 0.5rem auto;
  padding: 1rem;
  display: grid;
  gap: 0.8rem;
  background: #ffffff;
}

.detail-lightbox .lightbox-backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.detail-lightbox-dialog {
  --detail-overlay-clearance: clamp(2.85rem, 5vh, 3.5rem);
  --detail-viewport-height: calc(100dvh - 9rem);
  width: 100vw;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0 0 0.2rem;
  background: #111111;
  color: #ffffff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.2rem;
}

.detail-lightbox-dialog.is-image-fullscreen {
  padding: 0;
  gap: 0;
  background: #000000;
}

.detail-lightbox-dialog.is-image-fullscreen .pano-lightbox-title,
.detail-lightbox-dialog.is-image-fullscreen .detail-lightbox-download,
.detail-lightbox-dialog.is-image-fullscreen .detail-nav,
.detail-lightbox-dialog.is-image-fullscreen .pano-lightbox-close,
.detail-lightbox-dialog.is-image-fullscreen .lightbox-arrow {
  display: none;
}

.lightbox-close {
  justify-self: end;
  width: 3rem;
  height: 3rem;
  font-size: 1.8rem;
}

.lightbox-figure {
  margin: 0;
  position: relative;
  display: grid;
  gap: 0.8rem;
  justify-items: center;
}

.detail-lightbox-figure {
  min-height: 0;
  height: var(--detail-viewport-height);
  align-self: stretch;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--detail-overlay-clearance) 0.3rem 0.05rem;
  touch-action: none;
}

.detail-lightbox-dialog.is-image-fullscreen .detail-lightbox-figure {
  height: var(--detail-viewport-height);
  padding: 0;
  background: #000000;
}

.detail-lightbox-dialog.is-image-fullscreen .detail-swipe-stage {
  background: #000000;
}

.detail-swipe-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.detail-swipe-track {
  display: flex;
  width: 100%;
  height: 100%;
  transform: translateX(calc(-100% + var(--detail-swipe-offset, 0px)));
  will-change: transform;
}

.detail-swipe-slide {
  flex: 0 0 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.12rem;
}

.detail-lightbox-dialog.is-image-fullscreen .detail-swipe-slide {
  padding: 0;
}

.lightbox-figure img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 13rem);
  object-fit: contain;
  border-radius: var(--radius);
}

.detail-swipe-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.detail-lightbox-figure .detail-swipe-image {
  max-width: 100%;
  max-height: 100%;
}

.detail-swipe-image-current {
  --detail-zoom-scale: 1;
  --detail-zoom-x: 0px;
  --detail-zoom-y: 0px;
  transform: translate(var(--detail-zoom-x), var(--detail-zoom-y)) scale(var(--detail-zoom-scale));
  transform-origin: center center;
  will-change: transform;
}

.detail-swipe-image-current.is-zoom-animated {
  transition: transform 180ms ease-out;
}

.detail-swipe-image-current.is-zoom-interacting {
  transition: none;
}

.detail-lightbox-dialog.is-image-fullscreen .detail-swipe-image {
  border-radius: 0;
}

.detail-swipe-stage.is-animating .detail-swipe-track {
  transition: transform 180ms ease-out;
}

.lightbox-figure figcaption {
  text-align: center;
  color: var(--muted);
}

.detail-nav {
  padding: 0 0.45rem 0.05rem;
}

.detail-lightbox-download {
  position: absolute;
  top: 0.45rem;
  left: 0.5rem;
  z-index: 2;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.18);
  border: 0;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}

.detail-lightbox .pano-lightbox-title {
  top: 0.45rem;
  width: calc(100% - 8.5rem);
}

.detail-lightbox .pano-thumb-link,
.detail-lightbox .pano-overview-link {
  color: #ffffff;
}

.detail-lightbox .pano-thumb-link figcaption,
.detail-lightbox .pano-overview-link figcaption {
  color: #ffffff;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.75rem;
  height: 3.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 2rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.92);
  opacity: 0.3;
  transition: opacity 160ms ease;
}

.lightbox-figure:hover .lightbox-arrow,
.lightbox-figure:focus-within .lightbox-arrow {
  opacity: 0.45;
}

.lightbox-arrow-left {
  left: 0.5rem;
}

.lightbox-arrow-right {
  right: 0.5rem;
}

.empty-state {
  padding: 1rem;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px dashed var(--border);
  color: var(--muted);
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100vw - 1rem, 100%);
  }

  .site-header {
    padding-top: 0.6rem;
  }

  .site-nav {
    gap: 0.5rem;
  }

  .site-nav a,
  .button-link {
    display: block;
    flex: 0 0 calc(50% - 0.25rem);
    text-align: center;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightbox-dialog {
    width: calc(100vw - 0.5rem);
    max-height: calc(100vh - 0.5rem);
    margin: 0.25rem;
    padding: 0.75rem;
  }

  .detail-lightbox-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0 0 0.2rem;
    border: 0;
    box-shadow: none;
  }

  .detail-lightbox .pano-overview-box {
    font-size: 0.48rem;
    line-height: 1;
  }

  .lightbox-arrow {
    width: 2.5rem;
    height: 3rem;
  }

  .pano-lightbox-dialog {
    height: 100vh;
    margin: 0;
    padding: 0 0 0.75rem;
  }

  .pano-nav {
    gap: 0.3rem;
  }

  .pano-thumb-link {
    width: min(11vw, 72px);
  }

  .pano-overview-link {
    width: min(11vw, 72px);
  }

  .pano-overview-box {
    font-size: 0.48rem;
    line-height: 1;
    padding: 0 0.15rem;
  }
}
