html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

body {
  overflow-x: hidden;
}

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

/* hide homepage floating stack on non-home pages */
body:not(.homepage-page) #jh-stack,
body:not(.homepage-page) #jh-viewer {
  display: none !important;
}

/* also hide the floating stack on pages that use the global lightbox */
body:has(#global-lightbox) #jh-stack,
body:has(#global-lightbox) #jh-viewer {
  display: none !important;
}

/* hide homepage-style top pinned intro/nav on non-home pages */
body:has(#global-lightbox) .page_container[local-style="12285424"] {
  display: none !important;
}

/* if homepage-style intro row is rendered directly in project content, hide it too */
body:has(#global-lightbox) .page_content > [grid-row]:first-child,
body:has(#global-lightbox) .page_content > div[grid-row]:first-child,
body:has(#global-lightbox) .page_content > br:first-child {
  display: none !important;
}

/* floating stack */
#jh-stack {
  position: fixed;
  top: 110px;
  left: 32px;
  width: 180px;
  height: 180px;
  z-index: 1000;
  pointer-events: none;
  animation: jhFloating 22s ease-in-out infinite;
  overflow: visible;
}

#jh-stack img {
  position: absolute;
  top: 0;
  left: 0;
  width: 180px;
  max-width: 180px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  pointer-events: auto;
  cursor: pointer;
}

#jh-stack .img-top {
  z-index: 2;
  transform: rotate(-1.2deg) translate(0,0);
}

#jh-stack .img-bottom {
  z-index: 1;
  transform: rotate(1.8deg) translate(8px,8px);
}

#jh-stack:hover .img-top {
  transform: rotate(-4deg) translate(-12px,-8px);
}

#jh-stack:hover .img-bottom {
  transform: rotate(4deg) translate(24px,18px);
}

#jh-stack .label-text {
  position: absolute;
  bottom: -2px;
  left: 0;
  font-size: 14px;
  line-height: 1.2;
  color: #000;
  background: rgba(255,255,255,0.95);
  padding: 4px 8px;
  white-space: nowrap;
  z-index: 1001;
}

@keyframes jhFloating {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(12px,-22px); }
  50%  { transform: translate(-14px,18px); }
  75%  { transform: translate(10px,20px); }
  100% { transform: translate(0,0); }
}

/* homepage viewer */
#jh-viewer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px 20px;
  box-sizing: border-box;
}

#jh-viewer.open {
  display: flex;
}

#jh-modal {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  text-align: center;
  pointer-events: auto;
}

#jh-image {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

#jh-caption {
  display: block;
  font-size: 13px;
  margin-top: 12px;
  color: #ccc;
  font-style: italic;
  text-align: center;
}

#jh-image.is-hidden,
#jh-caption.is-hidden {
  display: none !important;
}

#jh-link-slide {
  display: none;
  max-width: 100%;
  max-height: 80vh;
  padding: 28px 24px;
  border-radius: 12px;
  background: #111;
  color: #eee;
  width: min(720px, 90vw);
  margin: 0 auto;
  text-align: left;
}

#jh-link-slide.is-active {
  display: block !important;
}

#jh-link-slide h2 {
  margin: 0 0 10px 0;
  font-size: 28px;
}

#jh-link-slide p {
  margin: 0 0 18px 0;
  font-size: 15px;
  color: #cfcfcf;
}

.link-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.link-button,
.link-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
}

.link-button {
  background: #fff;
  color: #111;
}

.link-secondary {
  background: transparent;
  color: #ddd;
  border: 1px solid #333;
}

.viewer-hint {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  color: #777;
  font-size: 12px;
  white-space: nowrap;
}

/* bottom project navigation */
body:has(#global-lightbox) {
  padding-bottom: 60px !important;
}

body:has(#global-lightbox) .page_container[local-style="12285420"] {
  display: block !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: rgba(255,255,255,0.96) !important;
  border-top: 1px solid rgba(0,0,0,0.08) !important;
  z-index: 9000 !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body:has(#global-lightbox) .page_container[local-style="12285420"] .page,
body:has(#global-lightbox) .page_container[local-style="12285420"] .page_content,
body:has(#global-lightbox) .page_container[local-style="12285420"] .container,
body:has(#global-lightbox) .page_container[local-style="12285420"] bodycopy,
body:has(#global-lightbox) .page_container[local-style="12285420"] [grid-row],
body:has(#global-lightbox) .page_container[local-style="12285420"] [grid-col] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: auto !important;
}

body:has(#global-lightbox) .page_container[local-style="12285420"] .page_background {
  display: none !important;
}

body:has(#global-lightbox) .page_container[local-style="12285420"] [grid-col="5"] {
  display: none !important;
}

body:has(#global-lightbox) .page_container[local-style="12285420"] [grid-col="7"] {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
}

body:has(#global-lightbox) .page_container[local-style="12285420"] a,
body:has(#global-lightbox) .page_container[local-style="12285420"] a:visited {
  color: #111 !important;
  font-size: 14px !important;
  text-decoration: none !important;
  display: inline-block !important;
}

/* non-home page image lightbox */
#global-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.94);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  box-sizing: border-box;
}

#global-lightbox.is-open {
  display: flex;
}

#global-lightbox-inner {
  position: relative;
  width: 100%;
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#global-lightbox-image {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
}

#global-lightbox-close,
#global-lightbox-prev,
#global-lightbox-next {
  position: absolute;
  background: rgba(0,0,0,0.45);
  color: white;
  border: 1px solid rgba(255,255,255,0.5);
  padding: 10px 14px;
  cursor: pointer;
}

#global-lightbox-close { top:16px; right:16px; }
#global-lightbox-prev { left:16px; top:50%; transform:translateY(-50%); }
#global-lightbox-next { right:16px; top:50%; transform:translateY(-50%); }

body:not(.homepage-page) .page_content img,
body:has(#global-lightbox) .page_content img {
  cursor: zoom-in;
}

body.jh-no-scroll,
body.lightbox-open {
  overflow: hidden !important;
}

/* ---- project page layout adjustments ---- */

/* push project content slightly down so it doesn't collide with the fixed top home link */
body:has(#global-lightbox) .page_container:not([local-style="12285420"]):not([local-style="12285424"]) .content_padding {
  padding-top: 4.75rem !important;
}

/* pull project text inward from the far left/right edges */
body:has(#global-lightbox) .page_container:not([local-style="12285420"]):not([local-style="12285424"]) .content_padding {
  padding-left: 3.25rem !important;
  padding-right: 3.25rem !important;
}

/* mobile adjustment so spacing still feels balanced */
@media (max-width: 768px) {
  body:has(#global-lightbox) .page_container:not([local-style="12285420"]):not([local-style="12285424"]) .content_padding {
    padding-top: 4rem !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

/* ---- About page CV normalization ---- */
[local-style="12285422"] [grid-col="x11"]:last-child {
  font-size: 13px !important;
  line-height: 1.5 !important;
}

[local-style="12285422"] [grid-col="x11"]:last-child small,
[local-style="12285422"] [grid-col="x11"]:last-child b,
[local-style="12285422"] [grid-col="x11"]:last-child a,
[local-style="12285422"] [grid-col="x11"]:last-child sup {
  font-size: inherit !important;
  line-height: inherit !important;
}