:root {
  --tree-width: 941;
  --tree-height: 1672;
  --viewport-gutter: clamp(10px, 1.4vw, 22px);
  --cream: #fff9df;
  --cream-deep: #f3e9bd;
  --paper: #f8f0cf;
  --gold: #a77916;
  --forest: #173f24;
  --forest-soft: #2f6b34;
  --bark: #724317;
  --ink: #1f291f;
  --blue: #176ec8;
  --blue-soft: #dcefff;
  --purple: #7140a4;
  --purple-soft: #eee1ff;
  --orange: #dd6a12;
  --orange-soft: #ffe2bd;
  --green: #4b891f;
  --green-soft: #edf6c9;
  --shadow: rgba(34, 42, 21, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  position: relative;
  overflow: hidden;
  color: var(--ink);
  background: #eee6bd;
  font-family: Georgia, "Times New Roman", serif;
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  inset: -28px;
  z-index: -2;
  background:
    linear-gradient(rgba(248, 240, 207, 0.62), rgba(248, 240, 207, 0.72)),
    url("../DFF Vertical Tree_USA Selected_NEW.png") center / cover no-repeat;
  filter: blur(12px) saturate(0.9);
  transform: scale(1.03);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(85, 55, 16, 0.2), transparent 16%, transparent 84%, rgba(85, 55, 16, 0.2)),
    radial-gradient(circle at 50% 98%, rgba(103, 140, 57, 0.24), transparent 24%);
  pointer-events: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.kiosk-shell {
  width: 100vw;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--viewport-gutter);
  overflow: hidden;
}

.tree-stage {
  position: relative;
  width: min(
    calc(100vw - (var(--viewport-gutter) * 2)),
    calc((100vh - (var(--viewport-gutter) * 2)) * var(--tree-width) / var(--tree-height))
  );
  width: min(
    calc(100vw - (var(--viewport-gutter) * 2)),
    calc((100svh - (var(--viewport-gutter) * 2)) * var(--tree-width) / var(--tree-height))
  );
  aspect-ratio: var(--tree-width) / var(--tree-height);
  max-height: calc(100vh - (var(--viewport-gutter) * 2));
  max-height: calc(100svh - (var(--viewport-gutter) * 2));
  filter: drop-shadow(0 20px 34px rgba(66, 55, 26, 0.34));
  overflow: hidden;
}

.tree-region-link {
  position: absolute;
  z-index: 8;
  top: 0.8%;
  width: 49%;
  height: 6.4%;
  background: transparent;
}

.tree-region-link--india {
  left: 0.8%;
}

.tree-region-link--usa {
  right: 0.8%;
}

.tree-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  object-fit: contain;
  transform-origin: 50% 100%;
  animation: treeGrow 3.2s cubic-bezier(0.18, 0.74, 0.24, 1) both;
}

.tree-glow-image {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  opacity: 0;
  -webkit-mask-image: radial-gradient(
    ellipse var(--active-leaf-glow-radius-x, 0%) var(--active-leaf-glow-radius-y, 0%) at
      var(--active-leaf-glow-x, 50%) var(--active-leaf-glow-y, 50%),
    #000 0 58%,
    rgba(0, 0, 0, 0.82) 72%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse var(--active-leaf-glow-radius-x, 0%) var(--active-leaf-glow-radius-y, 0%) at
      var(--active-leaf-glow-x, 50%) var(--active-leaf-glow-y, 50%),
    #000 0 58%,
    rgba(0, 0, 0, 0.82) 72%,
    transparent 100%
  );
  transition: opacity 500ms ease;
}

.tree-stage.has-active-leaf-glow .tree-glow-image {
  animation: suppliedLeafGlow 2.5s ease-in-out infinite;
}

.leaf-layer,
.leaf-hotspot,
.tree-highlight-layer,
.tree-highlight {
  position: absolute;
}

.tree-highlight-layer {
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  animation: leafLayerIn 0.9s ease 2.2s both;
}

.tree-highlight {
  display: block;
  border-radius: 18px;
  transform: translate(-50%, -50%);
  animation: boardGlow 4.8s ease-in-out infinite;
}

.tree-highlight::before,
.tree-highlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.tree-highlight::before {
  background: radial-gradient(ellipse at center, rgba(130, 85, 18, 0.34), rgba(130, 85, 18, 0.17) 56%, transparent 78%);
  filter: blur(2px);
}

.tree-highlight::after {
  /* Keep the pulsing glow, without drawing a border around the tree labels. */
  content: none;
}

.highlight-education {
  left: 49.5%;
  top: 27.8%;
  width: 17.5%;
  height: 5.8%;
  animation-delay: 0s;
}

.highlight-dignity {
  left: 33.5%;
  top: 40%;
  width: 20%;
  height: 6.2%;
  animation-delay: 0.35s;
}

.highlight-women {
  left: 67%;
  top: 40%;
  width: 20%;
  height: 6.2%;
  animation-delay: 0.7s;
}

.highlight-senior {
  left: 32%;
  top: 54%;
  width: 20%;
  height: 6.2%;
  animation-delay: 1.05s;
}

.highlight-medical {
  left: 34.5%;
  top: 69%;
  width: 20%;
  height: 6.2%;
  animation-delay: 1.4s;
}

.highlight-animal {
  left: 69.5%;
  top: 55%;
  width: 20%;
  height: 6.2%;
  animation-delay: 1.75s;
}

.highlight-community {
  left: 68%;
  top: 71.5%;
  width: 20%;
  height: 6.2%;
  animation-delay: 2.1s;
}

.highlight-impact {
  left: 50%;
  top: 77%;
  width: 18%;
  height: 6.8%;
  border-radius: 50%;
  animation-delay: 2.45s;
}

.leaf-layer {
  inset: 0;
  z-index: 3;
  opacity: 0;
  animation: leafLayerIn 0.9s ease 2.35s both;
}

.leaf-hotspot {
  border: 0;
  border-radius: 45%;
  color: transparent;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  opacity: 1;
  transform: rotate(var(--leaf-rotation, 0deg));
}

.leaf-hotspot::before,
.leaf-hotspot::after {
  content: "";
  position: absolute;
  left: var(--dot-x, 50%);
  top: var(--dot-y, 50%);
  pointer-events: none;
}

.leaf-hotspot::before {
  width: clamp(36px, 4.8vmin, 64px);
  height: clamp(36px, 4.8vmin, 64px);
  border-radius: 50%;
  background: color-mix(in srgb, var(--leaf-color) 35%, transparent);
  filter: blur(2px);
  transform: translate(-50%, -50%) rotate(calc(-1 * var(--leaf-rotation, 0deg)));
  animation: dotHalo 2.7s ease-in-out infinite;
  animation-delay: var(--leaf-delay, 0s);
}

.leaf-hotspot::after {
  width: clamp(18px, 2.4vmin, 30px);
  height: clamp(18px, 2.4vmin, 30px);
  border: 2px solid rgba(255, 249, 218, 0.92);
  border-radius: 50%;
  background:
    linear-gradient(color-mix(in srgb, var(--leaf-color) 68%, rgba(255, 249, 218, 0.78)), color-mix(in srgb, var(--leaf-color) 45%, rgba(255, 249, 218, 0.82)));
  box-shadow:
    0 2px 7px rgba(58, 38, 14, 0.2),
    0 0 0 5px rgba(255, 247, 205, 0.1);
  transform: translate(-50%, -50%) rotate(calc(-1 * var(--leaf-rotation, 0deg)));
  animation: dotFade 2.7s ease-in-out infinite;
  animation-delay: var(--leaf-delay, 0s);
}

.leaf-hotspot:focus-visible,
.leaf-hotspot:hover {
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.leaf-hotspot:hover::before,
.leaf-hotspot:focus-visible::before {
  animation-duration: 1.4s;
}

.leaf-hotspot:hover::after,
.leaf-hotspot:focus-visible::after {
  animation-duration: 1.4s;
}

.leaf-hotspot:active {
  transform: rotate(var(--leaf-rotation, 0deg)) scale(0.985);
}

@keyframes treeGrow {
  0% {
    clip-path: inset(100% 0 0 0);
    opacity: 0.2;
    transform: scaleY(0.82) translateY(5%);
    filter: saturate(0.82);
  }

  38% {
    clip-path: inset(48% 0 0 0);
    opacity: 0.86;
    transform: scaleY(0.94) translateY(2%);
  }

  100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
    transform: scaleY(1) translateY(0);
    filter: saturate(1);
  }
}

@keyframes leafLayerIn {
  to {
    opacity: 1;
  }
}

@keyframes boardGlow {
  0%,
  100% {
    opacity: 0.42;
    transform: translate(-50%, -50%) scale(0.985);
  }

  50% {
    opacity: 0.96;
    transform: translate(-50%, -50%) scale(1.025);
  }
}

@keyframes dotFade {
  0%,
  100% {
    opacity: 0.2;
    transform: translate(-50%, -50%) rotate(calc(-1 * var(--leaf-rotation, 0deg))) scale(0.9);
  }

  50% {
    opacity: 0.58;
    transform: translate(-50%, -50%) rotate(calc(-1 * var(--leaf-rotation, 0deg))) scale(1.08);
  }
}

@keyframes dotHalo {
  0%,
  100% {
    opacity: 0.06;
    transform: translate(-50%, -50%) rotate(calc(-1 * var(--leaf-rotation, 0deg))) scale(0.75);
  }

  50% {
    opacity: 0.22;
    transform: translate(-50%, -50%) rotate(calc(-1 * var(--leaf-rotation, 0deg))) scale(1.18);
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
}

.modal.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 249, 223, 0.24), transparent 30%),
    rgba(43, 32, 11, 0.28);
  backdrop-filter: blur(3px);
}

.modal-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(940px, calc(100vw - 42px));
  max-height: min(86vh, 920px);
  transform: translate(-50%, -50%);
  overflow: visible;
  border: 3px double rgba(117, 83, 16, 0.56);
  border-radius: 8px;
  background: rgba(248, 240, 207, 0.97);
  box-shadow: 0 22px 64px rgba(38, 28, 10, 0.44);
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: inherit;
  overflow: auto;
  padding: clamp(24px, 3vw, 38px);
  background:
    linear-gradient(180deg, rgba(255, 252, 230, 0.96), rgba(240, 225, 174, 0.94)),
    repeating-linear-gradient(92deg, rgba(114, 67, 23, 0.07) 0 1px, transparent 1px 12px);
  border-radius: 8px;
}

.project-heading {
  display: grid;
  grid-template-columns: clamp(116px, 16vw, 160px) 1fr;
  gap: 18px;
  align-items: center;
  padding-right: 70px;
}

.project-logo-frame {
  width: 100%;
  aspect-ratio: 1.35 / 1;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid rgba(117, 83, 16, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 4px 14px rgba(108, 74, 18, 0.1);
}

.project-logo-frame img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.project-title-group {
  min-width: 0;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.media-panel {
  display: grid;
  gap: 10px;
  max-height: min(58vh, 620px);
  overflow: auto;
  padding-right: 4px;
  scrollbar-color: rgba(117, 83, 16, 0.48) rgba(255, 249, 222, 0.34);
  scrollbar-width: thin;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gallery-thumb {
  min-height: 104px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(117, 83, 16, 0.28);
  border-radius: 7px;
  background: rgba(255, 249, 222, 0.82);
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(70, 50, 18, 0.16);
  opacity: 0;
  transform: translateY(8px);
  animation: imageTileIn 440ms ease both;
}

.gallery-thumb:nth-child(2) {
  animation-delay: 80ms;
}

.gallery-thumb:nth-child(3) {
  animation-delay: 160ms;
}

.gallery-thumb:nth-child(4) {
  animation-delay: 240ms;
}

.gallery-thumb:nth-child(n + 5) {
  animation-delay: 320ms;
}

.gallery-thumb:focus-visible,
.gallery-thumb:hover {
  outline: 0;
  border-color: var(--forest-soft);
  box-shadow:
    0 0 0 3px rgba(237, 246, 201, 0.72),
    0 8px 18px rgba(70, 50, 18, 0.24);
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

@keyframes imageTileIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(23, 63, 36, 0.22);
  border-radius: 50%;
  color: var(--forest);
  background: rgba(255, 252, 230, 0.84);
  font: 700 40px/1 Arial, sans-serif;
  cursor: pointer;
}

.close-button:focus-visible,
.close-button:hover {
  outline: 0;
  background: #ffffff;
  border-color: rgba(23, 63, 36, 0.48);
}

.category-pill {
  align-self: flex-start;
  max-width: calc(100% - 70px);
  padding: 9px 14px;
  border: 2px solid var(--category-color);
  border-radius: 999px;
  color: var(--category-color);
  background: var(--category-soft);
  font: 700 clamp(13px, 1.2vw, 16px)/1.25 Arial, Helvetica, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#modalTitle {
  max-width: 100%;
  margin: 0;
  color: #1d3360;
  font: 700 clamp(22px, 2.3vw, 32px)/1.18 Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

/* Approved compact layout for all project popups. */
.modal-panel.is-prototype-layout {
  width: min(720px, calc(100vw - 42px));
}

.is-prototype-layout .project-card {
  gap: 14px;
  padding: clamp(20px, 2.4vw, 29px) clamp(23px, 3vw, 36px) 23px;
}

.is-prototype-layout .project-heading {
  grid-template-columns: clamp(78px, 9.75vw, 99px) 1fr;
  gap: 16px;
  padding-right: 32px;
}

.is-prototype-layout .project-logo-frame {
  padding: 8px;
}

.is-prototype-layout .category-pill {
  display: none;
}

.is-prototype-layout #modalTitle {
  font-size: clamp(18px, 1.6vw, 23px);
}

.is-prototype-layout .close-button {
  top: 12px;
  right: 14px;
  width: 18px;
  height: 18px;
  border-width: 1px;
  font-size: 14px;
}

.is-prototype-layout .project-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.is-prototype-layout .media-panel {
  order: -1;
  display: block;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.is-prototype-layout .gallery-thumbs {
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.is-prototype-layout .gallery-thumb {
  min-height: 0;
  aspect-ratio: 1.45 / 1;
}

.is-prototype-layout #modalDescription {
  gap: 9px;
}

.is-prototype-layout .project-details p,
.is-prototype-layout .project-details ul {
  font-size: clamp(13px, 0.9vw, 15px);
  line-height: 1.35;
}

#modalDescription {
  display: grid;
  gap: 12px;
}

.project-details p,
.project-details ul {
  margin: 0;
  color: #303030;
  font: 400 clamp(16px, 1.25vw, 19px)/1.55 Arial, Helvetica, sans-serif;
}

.project-details ul {
  padding-left: 24px;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: clamp(18px, 3vw, 36px);
}

.image-viewer.is-open {
  display: grid;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 18, 8, 0.78);
  backdrop-filter: blur(3px);
}

.image-viewer img {
  position: relative;
  z-index: 1;
  width: auto;
  height: auto;
  max-width: calc(100vw - 72px);
  max-height: calc(100vh - 72px);
  object-fit: contain;
  border: 3px double rgba(245, 226, 166, 0.76);
  border-radius: 8px;
  background: rgba(248, 240, 207, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

.viewer-close-button {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 249, 222, 0.72);
  border-radius: 50%;
  color: #fff9de;
  background: rgba(42, 34, 16, 0.82);
  font: 700 42px/1 Arial, sans-serif;
  cursor: pointer;
}

@media (max-aspect-ratio: 4 / 5) {
  .modal-panel {
    width: min(720px, calc(100vw - 26px));
    max-height: 84vh;
  }

  .project-card {
    gap: 14px;
    padding: 24px 26px 26px;
  }

  .project-heading {
    grid-template-columns: 104px 1fr;
    gap: 14px;
    padding-right: 58px;
  }

  .project-layout {
    grid-template-columns: minmax(0, 0.95fr) minmax(190px, 0.8fr);
    gap: 14px;
  }

  .media-panel {
    order: 0;
  }

  .gallery-thumb {
    min-height: 72px;
  }

  #modalTitle {
    font-size: clamp(21px, 3vw, 28px);
  }

  .project-details p,
  .project-details ul {
    font-size: clamp(16px, 2.4vw, 19px);
  }
}

@media (max-width: 720px) {
  body {
    overflow: hidden;
  }

  .kiosk-shell {
    height: 100vh;
    height: 100svh;
  }

  .modal-panel {
    width: calc(100vw - 20px);
    max-height: 76vh;
  }

  .project-card {
    padding: 20px 20px 22px;
  }

  .project-heading {
    grid-template-columns: 78px 1fr;
    padding-right: 56px;
  }

  .close-button {
    width: 48px;
    height: 48px;
    font-size: 34px;
  }
}

/* Automatic kiosk tour shown until a visitor interacts. */
.guided-tour {
  position: fixed;
  inset: 0;
  z-index: 16;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 820ms ease;
}

.guided-tour.is-open {
  opacity: 1;
}

.guided-tour-wash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 48%, rgba(255, 250, 225, 0.22), transparent 33%);
  opacity: 0;
  transition: opacity 820ms ease;
}

.guided-tour.is-open .guided-tour-wash {
  opacity: 1;
}

.guided-tour-card {
  position: relative;
  width: min(82vw, 630px);
  max-height: min(71vh, 840px);
  overflow: hidden;
  padding: clamp(20px, 2.6vw, 34px);
  border: 1px solid rgba(117, 83, 16, 0.42);
  border-radius: 8px;
  background: rgba(255, 250, 227, 0.94);
  box-shadow: 0 18px 50px rgba(50, 35, 10, 0.25);
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  transition: opacity 700ms ease, transform 820ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.guided-tour.is-open .guided-tour-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.guided-tour-kicker {
  margin: 0 0 4px;
  color: #7b5418;
  font-size: clamp(12px, 1.7vmin, 17px);
  letter-spacing: 0;
  text-transform: uppercase;
}

.guided-tour-category {
  margin: 0 0 16px;
  color: var(--tour-category-color, #173f24);
  font-size: clamp(24px, 3.8vmin, 46px);
  font-weight: 600;
  line-height: 1.08;
}

.guided-tour-projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.guided-tour-project {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 8px;
  border: 1px solid rgba(117, 83, 16, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.68);
}

.guided-tour-project img {
  width: 56px;
  height: 48px;
  object-fit: contain;
}

.guided-tour-project p {
  margin: 0;
  color: #2c381f;
  font-size: clamp(12px, 1.6vmin, 16px);
  line-height: 1.25;
}

.guided-tour-slideshow {
  position: relative;
  min-height: clamp(150px, 24vh, 280px);
  overflow: hidden;
  border-radius: 7px;
  background: rgba(119, 91, 31, 0.12);
}

.guided-tour-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transform: scale(1);
  transition: opacity 1300ms ease;
}

.guided-tour-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.tree-highlight.is-tour-active {
  animation: tourBoardGlow 1.8s ease-in-out infinite;
}

.tree-highlight.is-tour-active::before {
  background: radial-gradient(ellipse at center, rgba(91, 57, 9, 0.48), rgba(126, 82, 18, 0.24) 54%, transparent 76%);
}

.leaf-hotspot.is-tour-active::before {
  opacity: 0.42;
  animation-duration: 1.5s;
}

.leaf-hotspot.is-tour-active::after {
  opacity: 0.92;
  animation-duration: 1.5s;
}

@keyframes tourBoardGlow {
  0%,
  100% {
    opacity: 0.52;
    transform: translate(-50%, -50%) scale(0.99);
  }

  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.045);
  }
}

@media (max-width: 620px) {
  .guided-tour-card {
    width: min(90vw, 480px);
  }

  .guided-tour-projects {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guided-tour,
  .guided-tour-card,
  .guided-tour-slide {
    transition-duration: 1ms;
  }
}
/* Idle guided-tour placement and compact vertical card. */
.guided-tour {
  display: block;
}

.guided-tour-card {
  position: absolute;
  left: var(--tour-card-x, 50%);
  top: var(--tour-card-y, 50%);
  width: min(34vw, 365px);
  max-height: min(66vh, 760px);
  padding: clamp(14px, 1.9vw, 24px);
  transform: translate(-50%, calc(-50% + 14px)) scale(0.985);
}

.guided-tour.is-open .guided-tour-card {
  transform: translate(-50%, -50%) scale(1);
}

.guided-tour-kicker {
  font-size: clamp(10px, 1.3vmin, 14px);
}

.guided-tour-category {
  margin-bottom: 10px;
  font-size: clamp(19px, 2.7vmin, 30px);
}

.guided-tour-projects {
  grid-template-columns: 1fr;
  gap: 7px;
  margin-bottom: 9px;
}

.guided-tour-project {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  min-height: 50px;
  padding: 6px;
}

.guided-tour-project img {
  width: 44px;
  height: 36px;
}

.guided-tour-project p {
  font-size: clamp(10px, 1.25vmin, 13px);
  line-height: 1.18;
}

.guided-tour-slideshow {
  min-height: clamp(105px, 16vh, 190px);
}

@media (max-width: 620px) {
  .guided-tour-card {
    left: 50%;
    width: min(78vw, 360px);
  }
}
/* Project-only idle tour, calibrated for a 2160 x 3840 portrait kiosk. */
.guided-tour-card {
  width: min(19.5vw, 360px);
  max-height: min(32.5vh, 600px);
  padding: clamp(9px, 0.94vw, 14px);
  border-color: color-mix(in srgb, var(--tour-leaf-color, #526d44) 72%, #3c2d12);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--tour-leaf-color, #526d44) 74%, #fff9df), color-mix(in srgb, var(--tour-leaf-color, #526d44) 88%, #e7dca7));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--tour-leaf-color, #526d44) 32%, transparent);
}

.guided-tour-kicker,
.guided-tour-category {
  display: none;
}

.guided-tour-projects {
  margin-bottom: 5px;
}

.guided-tour-project {
  display: block;
  min-height: 0;
  padding: 2px 3px 4px;
  border: 0;
  background: transparent;
}

.guided-tour-project p {
  color: #2e2614;
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  font-size: clamp(10px, 1.12vmin, 14px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
}

.guided-tour-slideshow {
  min-height: clamp(90px, 11.88vh, 194px);
}

.guided-tour-slide {
  transition: opacity 1300ms ease;
}

@media (max-width: 620px) {
  .guided-tour-card {
    width: min(63vw, 315px);
  }
}

.viewer-nav-button {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: clamp(52px, 5.5vmin, 76px);
  height: clamp(52px, 5.5vmin, 76px);
  padding: 0 0 5px;
  border: 2px solid rgba(255, 249, 222, 0.72);
  border-radius: 50%;
  color: #fff9de;
  background: rgba(42, 34, 16, 0.82);
  font: 400 clamp(42px, 5.6vmin, 68px)/0.8 Arial, sans-serif;
  cursor: pointer;
  transform: translateY(-50%);
}

.viewer-nav-button--previous {
  left: clamp(14px, 3vw, 52px);
}

.viewer-nav-button--next {
  right: clamp(14px, 3vw, 52px);
}

.viewer-nav-button:hover,
.viewer-nav-button:focus-visible {
  outline: 0;
  border-color: #ffffff;
  background: rgba(75, 60, 20, 0.94);
}

/* Anchor the top edge of the animated panel at the center of its leaf. */
.guided-tour-card {
  transform: translate(-50%, 14px) scale(0.985);
}

.guided-tour.is-open .guided-tour-card {
  transform: translate(-50%, 0) scale(1);
}

/* The supplied tree image provides the exact illustrated halo for each leaf. */
.leaf-hotspot.is-tour-active {
  background: transparent;
  box-shadow: none;
  animation: none;
}

@keyframes suppliedLeafGlow {
  0%,
  100% {
    opacity: 0.68;
  }

  50% {
    opacity: 1;
  }
}

/* Larger leaf-matched tour cards, with their top edge anchored at the leaf center. */
.guided-tour-card {
  width: min(23.4vw, 432px);
  max-height: min(39vh, 720px);
  padding: clamp(11px, 1.13vw, 17px);
  border-color: color-mix(in srgb, var(--tour-leaf-color, #526d44) 82%, #201609);
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--tour-leaf-color, #526d44) 94%, #fff9df),
    color-mix(in srgb, var(--tour-leaf-color, #526d44) 84%, #291b0c)
  );
  box-shadow: 0 16px 40px color-mix(in srgb, var(--tour-leaf-color, #526d44) 46%, transparent);
}

.guided-tour-project p {
  color: #fff9e8;
  text-shadow: 0 1px 2px rgba(32, 22, 9, 0.52);
}

.guided-tour-slideshow {
  min-height: clamp(108px, 14.25vh, 233px);
}

.leaf-hotspot.is-tour-active {
  background: radial-gradient(
    ellipse at var(--dot-x, 50%) var(--dot-y, 50%),
    color-mix(in srgb, var(--leaf-color) 34%, transparent) 0 38%,
    transparent 74%
  );
  animation: activeLeafGlow 1.8s ease-in-out infinite;
}

/* The supplied artwork is the only leaf highlight during the guided tour. */
.tree-stage.has-active-leaf-glow .leaf-hotspot.is-tour-active {
  outline: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
}

@keyframes activeLeafGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 clamp(5px, 0.55vmin, 10px) color-mix(in srgb, var(--leaf-color) 38%, transparent),
      0 0 clamp(20px, 2.4vmin, 44px) color-mix(in srgb, var(--leaf-color) 50%, transparent);
  }

  50% {
    box-shadow:
      0 0 0 clamp(8px, 0.9vmin, 16px) color-mix(in srgb, var(--leaf-color) 54%, transparent),
      0 0 clamp(30px, 3.5vmin, 64px) color-mix(in srgb, var(--leaf-color) 72%, transparent);
  }
}

@media (max-width: 620px) {
  .guided-tour-card {
    width: min(75.6vw, 378px);
  }
}

/* Position the animation card from runtime leaf geometry. */
.guided-tour-card,
.guided-tour.is-open .guided-tour-card {
  left: var(--tour-card-x, 50%);
  top: var(--tour-card-y, 50%);
  width: min(var(--tour-card-width, 432px), calc(100vw - 40px));
  max-width: calc(100vw - 32px);
  max-height: min(900px, calc(100vh - 40px));
  transition:
    opacity 700ms ease,
    transform 820ms cubic-bezier(0.2, 0.8, 0.2, 1),
    width 520ms ease,
    left 520ms ease,
    top 520ms ease;
}

.guided-tour-card {
  transform: translate(-50%, calc(-50% + 12px)) scale(0.985);
}

.guided-tour.is-open .guided-tour-card {
  transform: translate(-50%, -50%) scale(1);
}

.guided-tour-slideshow {
  width: 100%;
  height: var(--tour-image-height, 233px);
  min-height: 0;
  transition: height 520ms ease;
}

.guided-tour-project-header {
  display: grid;
  grid-template-columns: clamp(52px, 3.2vw, 64px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 0.8vw, 14px);
}

.guided-tour-project-logo {
  width: clamp(52px, 3.2vw, 64px);
  height: clamp(46px, 2.8vw, 56px);
  padding: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.86);
  object-fit: contain;
}

.guided-tour-project-header p {
  text-align: left;
  font-size: clamp(18px, 1.08vw, 24px);
  font-weight: 900;
  line-height: 1.1;
}
