.carousel-expand-btn {
  display: none;
}

.nh-expand-btn {
  display: none;
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease;
  z-index: 10;
}

#carousel-fullscreen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.96);
}

#carousel-fullscreen.active {
  display: block;
}

#carousel-fs-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, width 0.3s ease, height 0.3s ease;
}

#carousel-fullscreen.rotated #carousel-fs-inner {
  transform: rotate(90deg);
  transform-origin: center center;
  width: 100vh;
  height: 100vw;
  top: 50%;
  left: 50%;
  margin-top: calc(-50vw);
  margin-left: calc(-50vh);
}

#carousel-fs-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100001;
  transition: background 0.2s ease;
}

#carousel-fs-close:active {
  background: rgba(0, 0, 0, 0.7);
}

#carousel-fs-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  touch-action: none;
  display: flex;
  align-items: center;
}

#carousel-fs-track {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.carousel-fs-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}

.carousel-fs-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  will-change: transform;
  border-radius: 6px;
}

#carousel-fs-prev,
#carousel-fs-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100001;
  transition: background 0.15s ease;
}

#carousel-fs-prev {
  left: 8px;
}

#carousel-fs-next {
  right: 8px;
}

#carousel-fs-prev:active,
#carousel-fs-next:active {
  background: rgba(0, 0, 0, 0.7);
}

#carousel-fs-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 4px;
  padding: 4px 10px;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  z-index: 100001;
  user-select: none;
  pointer-events: none;
}

#carousel-fs-zoom {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 28px;
  padding: 3px;
  z-index: 100001;
}

#carousel-fs-zoom button {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s ease;
}

#carousel-fs-zoom button:active {
  background: rgba(255, 255, 255, 0.15);
}

.nh-expand-btn:active {
  transform: scale(0.92);
  background: rgba(0, 0, 0, 0.75);
}

#nh-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.96);
}

#nh-lightbox.active {
  display: block;
}

#nh-lightbox-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, width 0.3s ease, height 0.3s ease;
}

#nh-lightbox.rotated #nh-lightbox-inner {
  transform: rotate(90deg);
  transform-origin: center center;
  width: 100vh;
  height: 100vw;
  top: 50%;
  left: 50%;
  margin-top: calc(-50vw);
  margin-left: calc(-50vh);
}

#nh-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100001;
  transition: background 0.2s ease;
}

#nh-lightbox-close:active {
  background: rgba(0, 0, 0, 0.7);
}

#nh-lightbox-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  touch-action: none;
  display: flex;
  align-items: center;
}

#nh-lightbox-track {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.nh-lightbox-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}

.nh-lightbox-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  will-change: transform;
  border-radius: 6px;
}

#nh-lightbox-prev,
#nh-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100001;
  transition: background 0.15s ease;
}

#nh-lightbox-prev {
  left: 8px;
}

#nh-lightbox-next {
  right: 8px;
}

#nh-lightbox-prev:active,
#nh-lightbox-next:active {
  background: rgba(0, 0, 0, 0.7);
}

#nh-lightbox-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 4px;
  padding: 4px 10px;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  z-index: 100001;
  user-select: none;
  pointer-events: none;
}

#nh-lightbox-zoom {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 28px;
  padding: 3px;
  z-index: 100001;
}

#nh-lightbox-zoom button {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s ease;
}

#nh-lightbox-zoom button:active {
  background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
  .nh-section-heading {
    font-family: 'Archivo Black', sans-serif !important;
    font-size: 40px !important;
  }

  .nh-expand-btn {
    display: flex;
  }

  .carousel-expand-btn {
    display: flex !important;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 25;
    transition: background 0.2s ease, transform 0.15s ease;
  }

  .carousel-expand-btn:active {
    transform: scale(0.92);
    background: rgba(0, 0, 0, 0.75);
  }
}

@media (max-width: 768px) {
  .nh-hero-carousel {
    height: 420px !important;
    margin: 40px 0 0 0 !important;
  }

  .mesh-gradient-container {
    display: none !important;
  }

  .gradient-carousel-container {
    background-image: url('/assets/images/Grainy Gradient Background 6.jpg');
    background-size: cover;
    background-position: center;
    padding: 1rem;
  }

  .gradient-carousel-nav {
    width: 40px !important;
    height: 40px !important;
    top: auto !important;
    bottom: 3.5rem !important;
    transform: none !important;
  }

  .gradient-carousel-nav:hover {
    transform: scale(1.1) !important;
  }

  .gradient-carousel-prev {
    left: 0.75rem !important;
  }

  .gradient-carousel-next {
    right: 0.75rem !important;
  }

  .gradient-carousel-title {
    font-size: 18px;
    margin-bottom: 2.5rem;
  }

  .gradient-carousel-image-container {
    max-width: 90%;
    max-height: 75%;
  }

  .gradient-carousel-indicators {
    bottom: 1rem;
  }

  .nh-section-heading {
    font-size: 40px !important;
    margin: 40px auto 2rem auto !important;
    padding: 0 1rem !important;
  }

  #overview-section {
    padding-bottom: 2.5rem !important;
  }

  .nh-overview-divider {
    display: block;
    width: 100%;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0;
  }

  .nh-overview-stack {
    gap: 0 !important;
  }

  .nh-overview-text-lg {
    font-size: 28px !important;
  }

  .nh-overview-text {
    font-size: 22px !important;
  }

  #scrolling-section {
    min-height: auto !important;
    padding: 4rem 0 !important;
  }

  .nh-scroll-inner {
    flex-direction: column !important;
    padding: 0 1rem !important;
  }

  .nh-left-col {
    width: 100% !important;
    padding-right: 0 !important;
  }

  #text-container {
    gap: 3rem !important;
    padding-top: 0 !important;
    padding-bottom: 2rem !important;
  }

  .scroll-text-item {
    opacity: 1 !important;
    filter: none !important;
  }

  .nh-scroll-text {
    font-size: 24px !important;
  }

  #fixed-card {
    position: relative !important;
    right: auto !important;
    top: auto !important;
    width: 100% !important;
    padding: 0 1rem;
    margin-bottom: 2rem;
  }

  .nh-summary-section {
    margin-top: 48px !important;
    padding: 2rem 1rem 4rem 1rem !important;
    gap: 1rem !important;
  }

  .nh-summary-section .nh-section-heading {
    font-size: 40px !important;
    margin-bottom: 1rem !important;
  }

  .nh-summary-section .nh-problem-text {
    font-size: 24px !important;
  }

  .nh-research-squares-wrap {
    margin-bottom: 2rem !important;
  }

  .nh-card-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    flex-wrap: unset !important;
    overflow-x: unset !important;
    -webkit-overflow-scrolling: unset;
    scroll-snap-type: unset;
    gap: 0.75rem !important;
    padding-bottom: 0;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    justify-items: center;
    width: 100% !important;
  }

  .nh-card {
    flex: unset !important;
    scroll-snap-align: unset;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem !important;
  }

  .nh-square {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
  }

  .nh-square img,
  .nh-square svg {
    width: 55% !important;
    height: 55% !important;
  }

  .nh-square dotlottie-player {
    width: 80% !important;
    height: 80% !important;
  }

  .nh-card-title {
    font-size: 13px !important;
  }

  .nh-card-desc {
    display: none !important;
  }

  .nh-card-text {
    max-width: 100% !important;
    width: 100%;
  }

  .nh-divider {
    margin: 40px auto !important;
  }

  .nh-full-width-section {
    padding: 0 1rem !important;
    margin-top: 40px !important;
  }

  .nh-subsection-heading {
    font-size: 24px !important;
  }

  .nh-body-text {
    font-size: 16px !important;
  }

  .nh-rearchitecture-heading {
    padding-top: 0 !important;
  }

  .nh-design-ideologies-section {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  .nh-hypothesis-section {
    padding-top: 0 !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .nh-hypothesis-section > div {
    width: 100% !important;
  }

  .hypothesis-square {
    width: 100% !important;
    max-width: 100% !important;
    height: 560px !important;
    margin-top: 0 !important;
    box-sizing: border-box !important;
  }

  .hypothesis-circles-header {
    gap: 20px !important;
    padding-top: 28px !important;
    padding-bottom: 20px !important;
  }

  .hypothesis-circles-header div {
    width: 64px !important;
    font-size: 28px !important;
  }

  .hypothesis-content-area {
    overflow: hidden !important;
  }

  .hypothesis-item {
    padding: 0 20px !important;
    gap: 14px !important;
    box-sizing: border-box !important;
  }

  .hypothesis-item > div:first-child {
    font-size: 26px !important;
    margin-top: 24px !important;
    text-align: center !important;
  }

  .hypothesis-item .typo-title {
    font-size: 26px !important;
    margin-top: 24px !important;
    text-align: center !important;
  }

  .hypothesis-item > div:nth-child(2) {
    font-size: 17px !important;
    max-width: 100% !important;
    line-height: 1.55 !important;
  }

  .hypothesis-item dotlottie-player {
    width: 220px !important;
    height: 220px !important;
    margin-top: 0 !important;
  }

  .typo-h1 { font-size: 44px !important; }
  .typo-h2 { font-size: 34px !important; }
  .typo-h3 { font-size: 28px !important; }
  .typo-h4 { font-size: 22px !important; }
  .typo-body { font-size: 17px !important; }

  .rolodex-container {
    height: 100% !important;
  }

  .rolodex-item {
    width: 280px !important;
    height: 110px !important;
    padding: 12px 16px !important;
    gap: 16px !important;
  }

  .rolodex-item-icon {
    width: 44px !important;
    height: 44px !important;
  }

  .rolodex-item-title {
    font-size: 18px !important;
  }

  .rolodex-item-desc {
    font-size: 13px !important;
  }

  .nh-design-ideologies-title {
    font-size: 28px !important;
  }

  .nh-design-ideologies-desc {
    font-size: 16px !important;
  }

  .nh-design-evolution {
    padding: 0 1rem !important;
    margin-bottom: 40px !important;
  }

  .nh-design-evolution .nh-section-heading {
    font-size: 48px !important;
    margin-bottom: 30px !important;
  }

  .nh-design-sub-section {
    margin-bottom: 40px !important;
  }

  .nh-design-sub-section h3 {
    font-size: 24px !important;
  }

  .nh-design-sub-section p {
    font-size: 16px !important;
  }

  .nh-personal-anecdote {
    padding-top: 0 !important;
    margin-bottom: 60px !important;
  }

  .nh-personal-anecdote .nh-section-heading {
    font-size: 48px !important;
    margin-bottom: 2rem !important;
  }

  .nh-blockquote {
    padding: 1.5rem !important;
    max-width: 100% !important;
  }

  .nh-blockquote p {
    font-size: 16px !important;
    line-height: 1.7 !important;
  }

  .nh-impact-section,
  .nh-lessons-section,
  .nh-opportunities-section {
    padding-top: 0 !important;
    margin-bottom: 40px !important;
  }

  .nh-impact-section h3,
  .nh-lessons-section h3,
  .nh-opportunities-section h3 {
    font-size: 24px !important;
  }

  .nh-impact-section p,
  .nh-lessons-section p,
  .nh-opportunities-section p {
    font-size: 16px !important;
  }

  .scroll-to-top-btn {
    bottom: 6rem !important;
    right: 1rem !important;
    min-width: 48px !important;
    height: 48px !important;
    padding: 0 16px !important;
  }

  .scroll-to-top-text {
    display: none;
  }

  .legacy-modal {
    top: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 100000 !important;
  }

  .legacy-modal-content {
    padding: 1rem;
    margin: 1rem auto;
  }

  .modal-image-container {
    height: 40vh;
  }

  .modal-info {
    flex-direction: column;
    gap: 1rem;
  }

  .modal-text h3 {
    font-size: 22px;
  }

  .modal-text p {
    font-size: 14px;
  }

  .modal-close-btn {
    top: 0.75rem;
    right: 0.75rem;
  }

  h1 {
    font-size: 28px !important;
    margin-top: 24px !important;
  }

  .nh-chips-row {
    margin-top: -1rem !important;
  }

  .chip {
    padding: 12px 16px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .nh-section-heading {
    font-size: 40px !important;
  }

  .nh-overview-stack {
    gap: 0 !important;
  }

  .nh-overview-text-lg {
    font-size: 22px !important;
  }

  .nh-overview-text {
    font-size: 18px !important;
  }

  .nh-scroll-text {
    font-size: 20px !important;
  }

  .nh-card {
    flex: unset !important;
    width: 100%;
  }

  .nh-square {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
  }

  .hypothesis-square {
    max-width: 100% !important;
    height: 560px !important;
  }

  .nh-summary-section .nh-problem-text {
    font-size: 20px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-text-item,
  .fade-in-text,
  .gradient-carousel-track,
  .gradient-carousel-slide,
  .rolodex-track,
  .rolodex-item,
  .hypothesis-item {
    transition: none !important;
    animation: none !important;
  }
}
