/* Before/after slider + project/portfolio preview styles (uses tokens from styles.css) */
.ba {
  --ba-pos: 50%;
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 16 / 9; background: var(--gray-100); box-shadow: var(--shadow-lg);
  user-select: none; -webkit-user-select: none; touch-action: pan-y; cursor: ew-resize;
}
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.ba-before-wrap { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--ba-pos)) 0 0); }
.ba-label {
  position: absolute; top: 12px; z-index: 2; padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(44,43,40,.78); color: var(--white); pointer-events: none;
}
.ba-label-before { left: 12px; }
.ba-label-after { right: 12px; background: var(--ochre); color: var(--charcoal); }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: var(--ba-pos); z-index: 3; width: 44px; margin-left: -22px;
  background: none; border: 0; padding: 0; cursor: ew-resize; touch-action: none;
}
.ba-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: var(--white); box-shadow: 0 0 6px rgba(0,0,0,.35); }
.ba-knob {
  position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: var(--white); color: var(--brand-blue); display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.3); transition: transform .15s;
}
.ba-knob svg { width: 26px; height: 26px; }
.ba.is-dragging .ba-knob, .ba-handle:hover .ba-knob { transform: scale(1.08); }
.ba-handle:focus-visible { outline: none; }
.ba-handle:focus-visible .ba-knob { outline: 3px solid var(--ochre); outline-offset: 2px; }
.ba-caption { margin-top: .75rem; color: var(--gray-500); font-size: .95rem; }
.ba-hint { font-size: .85rem; color: var(--gray-500); margin-top: .25rem; }

.ba-thumbs { display: flex; gap: .75rem; margin-top: 1rem; overflow-x: auto; padding-bottom: .25rem; }
.ba-thumbs button {
  flex: 0 0 auto; width: 150px; padding: 0; border: 3px solid transparent; border-radius: 8px; overflow: hidden;
  background: none; cursor: pointer; text-align: left; font: inherit;
}
.ba-thumbs button img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.ba-thumbs button span { display: block; font-size: .78rem; padding: .3rem .4rem; color: var(--gray-700); background: var(--gray-50); }
.ba-thumbs button[aria-pressed="true"] { border-color: var(--ochre); }
.ba-thumbs button:focus-visible { outline: 3px solid var(--brand-blue); outline-offset: 2px; }

.preview-banner { background: var(--ochre); color: var(--charcoal); text-align: center; font-size: .85rem; font-weight: 600; padding: .45rem 1rem; }
.project-hero { padding: 2.5rem 0 1rem; }
.project-hero .eyebrow { color: var(--ochre-hover); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.project-hero h1 { color: var(--brand-blue); font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.15; margin: .35rem 0 .5rem; }
.project-hero p { color: var(--gray-500); max-width: 60ch; }
.project-body { padding: 1rem 0 3rem; }
.project-writeup { margin-top: 2rem; max-width: 70ch; }
.project-writeup h2 { color: var(--brand-blue); margin-bottom: .5rem; }
.project-writeup p { margin-bottom: .8rem; }
.sample-flag { display: inline-block; background: var(--cream); border: 1px dashed var(--ochre); color: var(--ochre-hover); font-weight: 700; font-size: .78rem; padding: .2rem .6rem; border-radius: 6px; margin-bottom: .6rem; }
.project-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 1rem 0; font-size: .95rem; }
.project-facts strong { color: var(--brand-blue); }
.project-cta { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .75rem; }

.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; padding: 1rem 0 3rem; }
.portfolio-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.portfolio-card .ba { border-radius: 0; box-shadow: none; }
.portfolio-card .ba-knob { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
.portfolio-card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.portfolio-card h3 { color: var(--brand-blue); font-size: 1.1rem; }
.portfolio-card p { color: var(--gray-500); font-size: .92rem; flex: 1; }
.portfolio-card .card-link { font-weight: 600; color: var(--brand-blue-mid); }
.portfolio-card .card-link:hover { color: var(--ochre-hover); }
@media (max-width: 600px) { .ba-thumbs button { width: 120px; } .project-hero { padding-top: 1.5rem; } }
