/* =============================================
   Selected Works — Sequential Scroll Stack
   ============================================= */

.sw-section {
  background: #000;
  position: relative;
  overflow: visible;
}

/* Subtle grid — matches canvas */
.sw-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.013) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.013) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* ---- Header ---- */
.sw-header {
  padding: 80px 1.5rem 44px;
  text-align: left;
}

@media screen and (min-width: 768px) and (max-width: 991px) {
  .sw-header {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media screen and (min-width: 992px) {
  .sw-header {
    padding-left: 4rem;
    padding-right: 4rem;
  }
}

.sw-header-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0 0 10px;
  font-family: 'Satoshi', 'Inter', sans-serif;
}

.sw-header-title {
  font-size: clamp(1.5rem, var(--text-size--xlarge), 1.6rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0;
  line-height: 1.25;
  margin: 0 0 12px;
  font-family: inherit;
}

.sw-header-hint {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.22);
  font-weight: 300;
  margin: 0;
  font-family: inherit;
}

/* ---- Sticky zone ---- */
.sw-sticky-zone {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

/* ---- Card stack ---- */
.sw-card-stack {
  position: relative;
  width: calc(100% - 80px);
  max-width: 840px;
  height: 100vh;
  pointer-events: none;
}

/* Subtle vertical dividers — frame the card stack */
.sw-sticky-zone::before,
.sw-sticky-zone::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background:
    linear-gradient(to bottom,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.06) 30%,
      rgba(255, 255, 255, 0.06) 70%,
      rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.sw-sticky-zone::before {
  left: 1.5rem;
}

.sw-sticky-zone::after {
  right: 1.5rem;
}

@media screen and (min-width: 768px) and (max-width: 991px) {
  .sw-sticky-zone::before {
    left: 2rem;
  }
  .sw-sticky-zone::after {
    right: 2rem;
  }
}

@media screen and (min-width: 992px) {
  .sw-sticky-zone::before {
    left: 4rem;
  }
  .sw-sticky-zone::after {
    right: 4rem;
  }
}

/* Subtle column background between dividers */
.sw-column-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.5rem;
  right: 1.5rem;
  background:
    linear-gradient(to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(18, 18, 20, 0.92) 30%,
      rgba(18, 18, 20, 0.92) 70%,
      rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  z-index: 0;
}

@media screen and (min-width: 768px) and (max-width: 991px) {
  .sw-column-bg {
    left: 2rem;
    right: 2rem;
  }
}

@media screen and (min-width: 992px) {
  .sw-column-bg {
    left: 4rem;
    right: 4rem;
  }
}

/* ---- Individual card ---- */
a.sw-card,
a.sw-card:hover,
a.sw-card * {
  text-decoration: none !important;
  color: inherit;
}

.sw-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 840px;
  border-radius: 16px;
  background: linear-gradient(165deg, #1c1c1e 0%, #141414 100%);
  border: 1px solid rgba(255, 255, 255, 0.035);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 24px 60px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  pointer-events: auto;
  will-change: transform, opacity;
  cursor: pointer;
  transition: box-shadow 0.45s ease, border-color 0.45s ease;
}

.sw-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 28px 70px rgba(0, 0, 0, 0.75);
}

/* Top luminescence edge */
.sw-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
  z-index: 5;
}

/* Floating shadow beneath card */
.sw-card::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 10%;
  right: 10%;
  height: 40px;
  background: rgba(0, 0, 0, 0.45);
  filter: blur(22px);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

/* ---- Image / mockup panel ---- */
.sw-card-image {
  position: relative;
  width: 100%;
  height: 55vh;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

/* ---- Placeholder scene (replaces real images) ---- */
.sw-ph-scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 24px 16px;
  gap: 12px;
}

.sw-ph-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sw-ph-body {
  flex: 1;
  display: flex;
  gap: 16px;
  overflow: hidden;
}

.sw-ph-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.12);
}

.sw-ph-chip {
  height: 22px;
  width: 60px;
  border-radius: 11px;
  flex-shrink: 0;
}

/* Kanban columns (Palantir card) */
.sw-ph-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 130px;
  flex-shrink: 0;
  padding-top: 4px;
}

.sw-ph-kanban {
  flex: 1;
  display: flex;
  gap: 10px;
}

.sw-ph-col {
  flex: 1;
  border-radius: 8px;
  background: rgba(var(--c), 0.08);
  border: 1px solid rgba(var(--c), 0.15);
  min-height: 120px;
}

/* Gallery (Clientelling card) */
.sw-ph-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 52%;
  flex-shrink: 0;
}

.sw-ph-img {
  flex: 1;
  border-radius: 6px;
  background: rgba(var(--c), 0.1);
  border: 1px solid rgba(var(--c), 0.18);
}

.sw-ph-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
}

/* Chat bubbles (Debrief card) */
.sw-ph-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.sw-ph-bubble {
  height: 32px;
  width: 70%;
  border-radius: 12px;
  background: rgba(var(--c), 0.1);
  border: 1px solid rgba(var(--c), 0.2);
}

.sw-ph-bubble--out {
  align-self: flex-end;
  background: rgba(var(--c), 0.18);
}

.sw-ph-insight {
  width: 38%;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid rgba(var(--c), 0.2);
  background: rgba(var(--c), 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
}

/* Screenshot variant — shows a real image instead of chrome/iframe */
.sw-card-image--screenshot {
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
}

.sw-card-image--screenshot .sw-card-grid {
  display: none;
}

.sw-card-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.sw-card-chrome {
  position: absolute;
  inset: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}

.sw-chrome-nav {
  height: 28px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  flex-shrink: 0;
}

.sw-chrome-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: block;
}

.sw-mockup-iframe {
  width: 100%;
  flex: 1;
  border: none;
  pointer-events: none;
  display: block;
}

/* Placeholder UI for cards without iframes */
.sw-placeholder-ui {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
  overflow: hidden;
}

.sw-placeholder-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-ph-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.sw-ph-dot {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  flex-shrink: 0;
}

.sw-placeholder-body {
  display: flex;
  gap: 10px;
  flex: 1;
}

.sw-ph-panel {
  flex: 1;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.sw-ph-panel--accent {
  background: rgba(var(--accent), 0.12);
  border: 1px solid rgba(var(--accent), 0.15);
}

.sw-ph-sidebar {
  width: 38%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 4px;
}

.sw-ph-row {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  width: 100%;
}

.sw-ph-chip {
  height: 22px;
  border-radius: 5px;
  margin-top: 4px;
}

/* Accent glow at bottom of image area */
.sw-card-glow {
  position: absolute;
  bottom: -24px;
  left: 30%;
  width: 160px;
  height: 80px;
  background: rgba(var(--accent), 0.06);
  filter: blur(40px);
  border-radius: 50%;
  pointer-events: none;
  transition: background 0.45s ease;
}

.sw-card:hover .sw-card-glow {
  background: rgba(var(--accent), 0.18);
}

/* Cursor glow overlay (updated via JS) */
.sw-cursor-glow {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.05), transparent 40%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 10;
}

.sw-card:hover .sw-cursor-glow {
  opacity: 1;
}

/* ---- Card body / text ---- */
.sw-card-body {
  padding: 22px 26px 24px;
  position: relative;
}

.sw-card-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sw-accent-line {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: rgba(var(--accent), 0.7);
  flex-shrink: 0;
  opacity: 0.35;
  transition: opacity 0.4s ease;
}

.sw-card:hover .sw-accent-line {
  opacity: 1;
}

.sw-card-date {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'Satoshi', 'Inter', sans-serif;
}

.sw-card-title {
  font-size: var(--fs-base);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.48;
  margin: 0;
  font-family: 'Satoshi', 'Inter', sans-serif;
  transition: color 0.3s ease;
}

.sw-card:hover .sw-card-title {
  color: rgba(255, 255, 255, 0.92);
}

.sw-arrow {
  display: inline-block;
  opacity: 0;
  margin-left: 5px;
  font-size: var(--fs-sm);
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translate(-1px, 0);
}

.sw-card:hover .sw-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

.sw-card-desc {
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.32);
  line-height: 1.65;
  margin-bottom: 16px;
  font-family: 'Satoshi', 'Inter', sans-serif;
  font-weight: 300;
}

/* ---- Tags ---- */
.sw-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sw-tag {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 100px;
  padding: 4px 10px;
  letter-spacing: 0.03em;
  font-family: 'Satoshi', 'Inter', sans-serif;
}

/* ---- View all work CTA ---- */
.sw-cta-wrapper {
  position: sticky;
  bottom: 48px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
}

.sw-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  font-size: var(--fs-sm);
  font-weight: 400;
  font-family: 'Satoshi', 'Inter', sans-serif;
  text-decoration: none;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.sw-cta:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.92);
}

.sw-cta-arrow {
  display: inline-block;
  transition: transform 0.25s ease;
}

.sw-cta:hover .sw-cta-arrow {
  transform: translateX(3px);
}

/* ---- Scroll driver (creates scroll space) ---- */
.sw-driver {
  height: 220vh;
}

@media screen and (max-width: 991px) {
  .sw-card-stack {
    max-width: calc(100vw - 24px);
    margin-left: auto;
    margin-right: auto;
  }

  .sw-card {
    max-width: calc(100vw - 24px);
    margin-left: auto;
    margin-right: auto;
  }

  .sw-card-image {
    height: 45vh;
  }

  .sw-header {
    padding: 60px 24px 30px;
  }

  .sw-card-body {
    padding: 20px 20px 22px;
  }

  /* Mobile-optimized screenshots */
  .sw-card[data-index="0"] .sw-card-image--screenshot {
    background-image: url('../images/autopilot-mobile.webp') !important;
    background-position: center center;
  }
  .sw-card[data-index="1"] .sw-card-image--screenshot {
    background-image: url('../images/kit-mobile.webp') !important;
    background-position: center center;
  }
  .sw-card[data-index="2"] .sw-card-image--screenshot {
    background-image: url('../images/debrief-mobile.webp') !important;
    background-position: center center;
  }
}
