/* Project showcases transferred from the supplied deployment. */
.source-case-section {
  position: relative;
  width: min(calc(100% - 48px), 1320px);
  margin: 0 auto 80px;
  padding: clamp(38px, 6vw, 72px) 0;
}

.source-case-section__inner {
  width: 100%;
  margin: 0 auto;
}

.source-case-heading {
  max-width: 860px;
  margin-bottom: clamp(30px, 5vw, 52px);
}

.source-case-heading > p {
  margin: 0 0 12px;
  color: #023fa1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.source-case-heading h2 {
  margin: 0;
  font-family: "Raleway", Arial, sans-serif;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.03;
}

.source-case-heading span {
  display: block;
  max-width: 760px;
  margin-top: 14px;
  color: rgba(61, 51, 44, 0.72);
  font-size: clamp(15px, 1.7vw, 18px);
  line-height: 1.7;
}

.source-media-sections {
  display: grid;
  gap: clamp(58px, 9vw, 112px);
}

.source-media-section {
  min-width: 0;
}

.source-media-section__header {
  display: grid;
  gap: 9px;
  max-width: 82ch;
  margin-bottom: clamp(20px, 3vw, 30px);
}

.source-media-section__header h3 {
  margin: 0;
  font-family: "Raleway", Arial, sans-serif;
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.source-media-section__header p {
  margin: 0;
  color: rgba(61, 51, 44, 0.68);
  font-size: clamp(15px, 1.7vw, 18px);
  line-height: 1.65;
}

/* Trestle's transferred browser showcase uses the dark presentation panel. */
.source-case-section--trestle {
  width: min(calc(100% - 48px), 1380px);
  padding: clamp(34px, 5vw, 58px);
  background:
    radial-gradient(circle at 12% 8%, rgba(244, 239, 230, 0.18), transparent 28%),
    radial-gradient(circle at 92% 16%, rgba(46, 99, 138, 0.52), transparent 32%),
    linear-gradient(165deg, #071d35 0%, #0f3152 52%, #183f64 100%);
  border: 1px solid rgba(244, 239, 230, 0.16);
  box-shadow: 0 32px 80px -60px rgba(7, 29, 53, 0.86);
}

.source-case-section--trestle .source-case-heading > p,
.source-case-section--trestle .source-case-heading h2,
.source-case-section--trestle .source-case-heading span,
.source-case-section--trestle .source-media-section__header h3,
.source-case-section--trestle .source-media-section__header p {
  color: #f4efe6;
}

/* Shared carousel presentation */
.source-infinite-carousel-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.source-infinite-carousel {
  width: 100%;
  height: var(--source-carousel-height, clamp(250px, 38vw, 420px));
  min-height: 220px;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.source-infinite-carousel::-webkit-scrollbar {
  display: none;
}

.source-infinite-carousel.is-dragging {
  cursor: grabbing;
}

.source-infinite-carousel__track {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 20px);
  width: max-content;
  height: 100%;
}

.source-infinite-carousel__item {
  flex: 0 0 auto;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(61, 51, 44, 0.11);
  border-radius: 2px;
  box-shadow: 0 20px 52px -40px rgba(38, 30, 25, 0.55);
}

.source-infinite-carousel__item img {
  display: block;
  width: auto;
  max-width: none;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.source-carousel-arrow,
.source-browser-edge-arrow {
  position: absolute;
  top: 50%;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  color: #023fa1;
  background: rgba(255, 255, 255, 0.92);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 30px;
  line-height: 1;
  opacity: 0.96;
  transform: translateY(-50%);
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.source-carousel-arrow:hover,
.source-carousel-arrow:focus-visible,
.source-browser-edge-arrow:hover,
.source-browser-edge-arrow:focus-visible {
  outline: none;
  transform: translateY(-50%) scale(1.04);
  box-shadow: 0 15px 32px rgba(15, 23, 42, 0.22);
}

.source-carousel-arrow--left,
.source-browser-edge-arrow--left {
  left: 7px;
}

.source-carousel-arrow--right,
.source-browser-edge-arrow--right {
  right: 7px;
}

.source-browser-edge-arrow[hidden] {
  display: none;
}

/* Interactive process book */
.interactive-book {
  display: grid;
  gap: clamp(14px, 2vw, 20px);
  width: min(100%, 1160px);
  padding: clamp(18px, 3vw, 34px);
  background: linear-gradient(155deg, #fffaf4 0%, #f6ede2 100%);
  border: 1px solid rgba(201, 179, 160, 0.32);
  border-radius: 24px;
  box-shadow: 0 28px 60px -52px rgba(15, 23, 42, 0.28);
}

.interactive-book__stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(8px, 1.5vw, 18px);
  perspective: 2200px;
  outline: none;
}

.interactive-book__stage:focus-visible {
  box-shadow: 0 0 0 2px #173f93;
}

.interactive-book__spread {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, 980px);
  aspect-ratio: 1.61;
  overflow: visible;
  background: #f5ecd8;
  border-radius: clamp(12px, 1.6vw, 18px);
  box-shadow: 0 30px 60px -32px rgba(0, 0, 0, 0.66), 0 0 0 1px rgba(255, 246, 229, 0.36);
  transform: perspective(1400px) rotateX(3deg);
}

.interactive-book__spread::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: #f5ecd8;
  border-radius: inherit;
  content: "";
}

.interactive-book__page {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #f5ecd8;
}

.interactive-book__page--left {
  border-radius: inherit 0 0 inherit;
}

.interactive-book__page--right {
  border-radius: 0 inherit inherit 0;
}

.interactive-book__page img,
.interactive-book__turn-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

.interactive-book__blank-page {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.05), transparent 22%), #f5ecd8;
}

.interactive-book__spread--cover .interactive-book__page--left .interactive-book__blank-page {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.07), transparent 28%), #efe3cc;
}

.interactive-book__page--left::after,
.interactive-book__page--right::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.interactive-book__page--left::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.12), transparent 18%);
}

.interactive-book__page--right::after {
  background: linear-gradient(270deg, rgba(0, 0, 0, 0.11), transparent 18%);
}

.interactive-book__gutter {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: 50%;
  width: clamp(14px, 2vw, 26px);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), rgba(255, 255, 255, 0.48), rgba(0, 0, 0, 0.18));
  mix-blend-mode: multiply;
  opacity: 0.56;
  pointer-events: none;
  transform: translateX(-50%);
}

.interactive-book__turn-page {
  position: absolute;
  z-index: 8;
  top: 0;
  bottom: 0;
  width: 50%;
  background: #f5ecd8;
  box-shadow: 0 18px 28px -22px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  transform-style: preserve-3d;
}

.interactive-book__turn-page--next {
  left: 50%;
  transform-origin: left center;
  animation: interactiveBookTurnNext 760ms cubic-bezier(0.22, 0.78, 0.18, 1) both;
}

.interactive-book__turn-page--prev {
  left: 0;
  transform-origin: right center;
  animation: interactiveBookTurnPrev 760ms cubic-bezier(0.22, 0.78, 0.18, 1) both;
}

.interactive-book__turn-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #f5ecd8;
  backface-visibility: hidden;
}

.interactive-book__turn-face::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(0, 0, 0, 0.12));
  mix-blend-mode: multiply;
  pointer-events: none;
  content: "";
}

.interactive-book__turn-back {
  transform: rotateY(180deg);
}

.interactive-book__turn-page--prev .interactive-book__turn-back {
  transform: rotateY(-180deg);
}

.interactive-book__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 18px);
  color: #6b5d55;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.interactive-book__controls button {
  appearance: none;
  padding: 10px 16px;
  color: #8f5658;
  background: rgba(239, 229, 219, 0.64);
  border: 1px solid rgba(181, 101, 105, 0.22);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  transition: transform 180ms ease, background 180ms ease, opacity 180ms ease;
}

.interactive-book__controls button:hover:not(:disabled),
.interactive-book__controls button:focus-visible:not(:disabled) {
  background: rgba(232, 207, 208, 0.78);
  transform: translateY(-1px);
}

.interactive-book__controls button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

@keyframes interactiveBookTurnNext {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(-180deg); }
}

@keyframes interactiveBookTurnPrev {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(180deg); }
}

/* Scrollable browser carousel for Trestle */
.source-browser-carousel-wrap {
  width: min(100%, 960px);
  margin-inline: auto;
}

.source-browser-carousel__viewport-wrap {
  position: relative;
}

.source-browser-carousel {
  display: flex;
  gap: clamp(22px, 3vw, 34px);
  width: 100%;
  padding: 6px 18px 24px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  touch-action: pan-y;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 239, 230, 0.28) transparent;
}

.source-browser-carousel::-webkit-scrollbar {
  height: 8px;
}

.source-browser-carousel::-webkit-scrollbar-thumb {
  background: rgba(244, 239, 230, 0.28);
  border-radius: 999px;
}

.source-browser-carousel.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
}

.source-browser-carousel__item {
  flex: 0 0 min(100%, 760px);
  max-width: 760px;
  min-width: 0;
  scroll-snap-align: start;
}

.source-website-frame {
  width: 100%;
  max-width: 760px;
  margin: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d7dce2;
  border-radius: 18px;
  box-shadow: 0 28px 80px -42px rgba(15, 23, 42, 0.55);
}

.source-website-frame__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.source-browser-dots {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.source-browser-dots span {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.source-browser-dots span:nth-child(1) { background: #f87171; }
.source-browser-dots span:nth-child(2) { background: #fbbf24; }
.source-browser-dots span:nth-child(3) { background: #34d399; }

.source-browser-address {
  flex: 1;
  min-width: 0;
  padding: 7px 12px;
  overflow: hidden;
  color: #334155;
  background: #eef2f7;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-browser-scroll-label {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
}

.source-website-frame__viewport {
  height: clamp(430px, 58vh, 610px);
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(27, 73, 101, 0.45) rgba(226, 232, 240, 0.75);
}

.source-website-frame__viewport::-webkit-scrollbar { width: 10px; }
.source-website-frame__viewport::-webkit-scrollbar-track { background: rgba(226, 232, 240, 0.75); }
.source-website-frame__viewport::-webkit-scrollbar-thumb {
  background: rgba(27, 73, 101, 0.45);
  border: 2px solid rgba(226, 232, 240, 0.75);
  border-radius: 999px;
}

.source-website-frame__viewport img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  image-rendering: auto;
}

.source-browser-edge-arrow {
  color: #6f8f37;
}

.source-browser-carousel__nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.source-browser-carousel__progress {
  width: 100%;
  height: 5px;
  overflow: hidden;
  background: rgba(244, 239, 230, 0.18);
  border-radius: 999px;
}

.source-browser-carousel__progress span {
  display: block;
  width: 0;
  height: 100%;
  background: #f4efe6;
  border-radius: inherit;
  transition: width 220ms ease;
}

.source-browser-carousel__nav p {
  min-width: 46px;
  margin: 0;
  color: rgba(244, 239, 230, 0.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .source-case-section--trestle {
    width: min(calc(100% - 32px), 1320px);
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .source-case-section--trestle .source-case-heading > p { color: #023fa1; }
  .source-case-section--trestle .source-case-heading h2,
  .source-case-section--trestle .source-media-section__header h3 { color: #3d332c; }
  .source-case-section--trestle .source-case-heading span,
  .source-case-section--trestle .source-media-section__header p { color: rgba(61, 51, 44, 0.68); }

  .source-browser-carousel__progress { background: rgba(23, 63, 147, 0.12); }
  .source-browser-carousel__progress span { background: #173f93; }
  .source-browser-carousel__nav p { color: rgba(23, 63, 147, 0.68); }
}

@media (max-width: 760px) {
  .source-case-section {
    width: min(calc(100% - 32px), 1320px);
    margin-bottom: 56px;
    padding-block: 28px 48px;
  }

  .source-media-sections { gap: 64px; }

  .source-carousel-arrow,
  .source-browser-edge-arrow {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    font-size: 25px;
  }

  .source-browser-carousel {
    gap: 16px;
    padding-right: 10px;
  }

  .source-browser-carousel__item {
    flex-basis: min(100%, 88vw);
    max-width: 88vw;
  }

  .source-website-frame {
    max-width: 88vw;
    border-radius: 12px;
  }

  .source-website-frame__bar {
    gap: 8px;
    padding: 0 10px;
  }

  .source-browser-scroll-label { display: none; }

  .source-website-frame__viewport {
    height: min(68svh, 620px);
  }

  .interactive-book {
    padding: 14px;
    border-radius: 18px;
  }

  .interactive-book__spread {
    width: min(100%, 520px);
  }

  .interactive-book__controls {
    font-size: 11px;
  }

  .interactive-book__controls button {
    padding: 9px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .source-infinite-carousel,
  .source-browser-carousel {
    scroll-behavior: auto;
  }

  .interactive-book__turn-page--next,
  .interactive-book__turn-page--prev {
    animation-duration: 1ms;
  }
}
