.portfolio-section { scroll-margin-top: 5rem; }
.portfolio-section .section-head, .portfolio-messages .section-head { margin-bottom: 1rem; }
.portfolio-section .section-head h2, .portfolio-messages .section-head h2 { margin-top: 0; }
.portfolio-note { margin: 0 0 1.4rem; color: #65536b; font-size: .9rem; }
.portfolio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 1.8rem); }
.portfolio-example { margin: 0; overflow: hidden; border: 1px solid #e1d3e6; border-radius: 1rem; background: #fcf8f6; }
.portfolio-example figcaption { padding: .9rem 1rem; color: #31203e; font-size: 1rem; font-weight: 750; }
.portfolio-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.portfolio-pair img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
.portfolio-pair span { display: block; padding: .8rem .7rem; color: #392847; font-size: clamp(.76rem, 1.6vw, .92rem); font-weight: 700; }
.portfolio-link { display: inline-block; margin-top: 1.35rem; }
.portfolio-messages { background: #231731; color: #fff5ff; }
.portfolio-messages .section-head > p { color: #e0cde9; }
.portfolio-thread {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #7a627d;
  border-radius: 1.35rem;
  background: #eee7db;
  color: #202127;
}
.portfolio-thread > header {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-height: 68px;
  padding: .75rem 1rem;
  background: #225548;
  color: #fff;
}
.chat-avatar {
  display: block;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #f2dfec;
}
.portfolio-thread h3 { margin: 0; font-size: 1rem; line-height: 1.25; }
.portfolio-bubbles {
  display: grid;
  align-content: center;
  flex: 1;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.35rem);
  margin: 0;
  list-style: none;
  background: radial-gradient(circle, #ab967c28 1px, transparent 1.5px) 0 0 / 15px 15px, #f0e9de;
}
.portfolio-bubble {
  position: relative;
  justify-self: start;
  width: fit-content;
  max-width: 88%;
  padding: .65rem .85rem;
  border-radius: .2rem .85rem .85rem .85rem;
  background: #fffefa;
  color: #232a29;
  box-shadow: 0 1px 3px #3e30251c;
  line-height: 1.48;
  overflow-wrap: anywhere;
}
.portfolio-reply { justify-self: end; border-radius: .85rem .2rem .85rem .85rem; background: #daefda; }
.portfolio-bubble span { display: block; color: #35574b; font-size: .78rem; font-weight: 750; }
.portfolio-bubble p { margin: .15rem 0 0; font-size: .94rem; }
.chat-footer { padding: .75rem 1rem; background: #fffcf7; border-top: 1px solid #e1d7c9; }
.portfolio-thread .text-link { display: inline-block; margin: 0; color: #3b3151; }
@media (max-width: 720px) { .portfolio-grid { grid-template-columns: minmax(0, 1fr); } }

.portfolio-carousel {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - var(--carousel-gap)) / 2);
  --carousel-gap: clamp(1rem, 3vw, 1.8rem);
  gap: var(--carousel-gap);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-width: thin;
  scrollbar-color: #946ca8 #35263f;
  padding-bottom: .45rem;
}
.portfolio-carousel .portfolio-thread { scroll-snap-align: start; min-width: 0; }
.portfolio-carousel-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .65rem 1rem;
  margin-top: .9rem;
}
.portfolio-carousel-controls[hidden] { display: none; }
.portfolio-carousel-controls button {
  min-height: 44px;
  padding: .5rem .9rem;
  border: 1px solid #9670a6;
  border-radius: .65rem;
  background: #3c2851;
  color: #fff1fb;
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
}
.portfolio-carousel-controls button:hover:not(:disabled) { background: #543667; }
.portfolio-carousel-controls button:disabled { opacity: .5; cursor: default; }
.portfolio-carousel-controls span { color: #e9d5ef; font-size: .86rem; }
.portfolio-carousel:focus-visible, .portfolio-carousel-controls button:focus-visible { outline: 2px solid #f4c5ed; outline-offset: 3px; }
@media (max-width: 720px) { .portfolio-carousel { grid-auto-columns: 100%; } }
