/* Responsive width utilities */
@media (min-width: 768px) {
  .w-md-auto { width: auto !important; }
}

/* Base overrides for Bootstrap landing pages */
:root {
  --bs-font-sans-serif: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Palette: #BF6F84 · #F294C0 · #4C4E73 · #D0EFF2 · #0D0D0D */
  --bs-primary: #4C4E73;
  --bs-primary-rgb: 76, 78, 115;
  --bs-primary-bg-subtle: #eaeaf2;
  --bs-primary-text-emphasis: #2e3048;
  --bs-link-color: #4C4E73;
  --bs-link-color-rgb: 76, 78, 115;
  --bs-link-hover-color: #3a3c5a;
  --bs-link-hover-color-rgb: 58, 60, 90;
}

/* Override Bootstrap button colors — slate purple */
.btn-primary {
  --bs-btn-bg: #4C4E73;
  --bs-btn-border-color: #4C4E73;
  --bs-btn-hover-bg: #3a3c5a;
  --bs-btn-hover-border-color: #2e3048;
  --bs-btn-active-bg: #2e3048;
  --bs-btn-active-border-color: #22243a;
  --bs-btn-disabled-bg: #4C4E73;
  --bs-btn-disabled-border-color: #4C4E73;
}

.btn-outline-primary {
  --bs-btn-color: #4C4E73;
  --bs-btn-border-color: #4C4E73;
  --bs-btn-hover-bg: #4C4E73;
  --bs-btn-hover-border-color: #4C4E73;
  --bs-btn-active-bg: #3a3c5a;
  --bs-btn-active-border-color: #3a3c5a;
}

/* Text utilities */
.text-primary {
  color: #4C4E73 !important;
}

body {
  font-family: var(--bs-font-sans-serif);
}

.min-vh-75 {
  min-height: 75vh;
}

/* Hero gradient bg — ice blue to soft pink */
.hero-section {
  background: linear-gradient(135deg, #D0EFF2 0%, rgba(242,148,192,0.1) 50%, rgba(208,239,242,0.4) 100%);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Card hover */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,.08) !important;
}

/* CTA section gentle pulse */
#contact-form .btn-primary {
  position: relative;
  overflow: hidden;
}

/* Accordion overrides */
.accordion-button:not(.collapsed) {
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  box-shadow: none;
}
.accordion-button:focus {
  box-shadow: none;
  border-color: var(--bs-primary);
}

/* Form focus */
.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
}

/* Stats display */
.display-5 {
  letter-spacing: -0.02em;
}

/* ── Parser Demo: GSAP pinned screen ── */
.pd-section {
  /* 4 steps × 100vh = total scroll distance for the pinned section */
  height: 400vh;
  position: relative;
}

/* Wrapper that gets pinned — must have opaque bg to cover hero */
.pd-pin-wrapper {
  background: linear-gradient(180deg, #fff 0%, #eef8f9 100%);
  position: relative;
  z-index: 2;
  padding-bottom: 2rem;
}

.pd-header {
  padding: 3rem 0 2rem;
}

/* Pinned layout: two-column grid that stays fixed */
.pd-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 2.5rem;
  align-items: center;
  min-height: 80vh;
}

/* Left: step indicators */
.pd-steps {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.pd-step {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1rem;
  border-left: 3px solid var(--bs-border-color, #dee2e6);
  opacity: 0.3;
  transition: opacity 0.4s ease, border-color 0.4s ease;
}
.pd-step.is-active {
  opacity: 1;
  border-left-color: var(--bs-primary, #4C4E73);
}
.pd-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bs-secondary-bg, #e9ecef);
  color: var(--bs-secondary-color);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
  transition: background 0.4s ease, color 0.4s ease;
}
.pd-step.is-active .pd-step-num {
  background: var(--bs-primary, #4C4E73);
  color: #fff;
}
.pd-step-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.3rem;
}
.pd-step-desc {
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
  margin: 0;
  line-height: 1.5;
}
/* Right: screen mockup wrapper */
.pd-screen-wrap {
  width: 100%;
}

.pd-screen {
  background: #1a1a2e;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.05);
}

/* Title bar */
.pd-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: #141425;
}
.pd-dots {
  display: flex;
  gap: 6px;
}
.pd-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.pd-dots span:nth-child(1) { background: #ff5f57; }
.pd-dots span:nth-child(2) { background: #febc2e; }
.pd-dots span:nth-child(3) { background: #28c840; }
.pd-titlebar-text {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Viewport: panel container */
.pd-viewport {
  position: relative;
  min-height: 380px;
  overflow: hidden;
}
.pd-panel {
  position: absolute;
  inset: 0;
  padding: 1.25rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}
.pd-panel.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Panel 0: Sources ── */
.pd-sources-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.pd-sources-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.4);
}
.pd-sources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.pd-source-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
}
.pd-source-card i {
  font-size: 1rem;
  opacity: 0.7;
}
.pd-source-card span:first-of-type {
  flex: 1;
}
.pd-source-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 1rem;
}
.pd-source-badge.connected {
  background: rgba(25,135,84,0.15);
  color: #28c840;
}
.pd-source-badge.ready {
  background: rgba(13,110,253,0.15);
  color: #BF6F84;
}
.pd-source-recent {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.pd-source-recent-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}
.pd-source-file {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.4rem;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.75);
  font-size: 0.78rem;
}
.pd-source-file span:first-of-type {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pd-source-via {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
}

/* ── Panel 1: Processing ── */
.pd-processing {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.pd-proc-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pd-proc-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.pd-proc-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
}
.pd-proc-item.done {
  background: rgba(25,135,84,0.1);
  color: rgba(255,255,255,0.85);
}
.pd-proc-item.active {
  background: rgba(13,110,253,0.12);
  color: #fff;
}
.pd-proc-item.pending {
  opacity: 0.4;
}

.pd-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--bs-primary, #4C4E73);
  border-radius: 50%;
  animation: pdSpin 0.8s linear infinite;
}

.pd-proc-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.pd-proc-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bs-primary, #4C4E73), #BF6F84);
  border-radius: 2px;
  transition: width 0.6s ease;
}
.pd-proc-time {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  text-align: right;
}

/* ── Panel 2: Summary ── */
.pd-summary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pd-sum-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.pd-sum-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.pd-sum-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(255,255,255,0.05);
}
.pd-sum-key {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.4);
  min-width: 85px;
}
.pd-sum-val {
  flex: 1;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
}
.pd-sum-score {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
}
.pd-sum-score.high {
  background: rgba(25,135,84,0.15);
  color: #28c840;
}
.pd-sum-score.med {
  background: rgba(255,193,7,0.15);
  color: #febc2e;
}

/* ── Panel 3: Chat ── */
.pd-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.pd-chat-msgs {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
  overflow: hidden;
}
.pd-msg {
  display: flex;
}
.pd-msg-user {
  justify-content: flex-end;
}
.pd-msg-bot {
  justify-content: flex-start;
}
.pd-bubble {
  padding: 0.6rem 0.9rem;
  border-radius: 0.85rem;
  font-size: 0.82rem;
  line-height: 1.5;
  max-width: 88%;
}
.pd-bubble-user {
  background: var(--bs-primary, #4C4E73);
  color: #fff;
  border-bottom-right-radius: 0.2rem;
}
.pd-bubble-bot {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border-bottom-left-radius: 0.2rem;
}
.pd-cite {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.pd-chat-bar {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.pd-chat-bar input {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 2rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.4);
}
.pd-chat-bar button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--bs-primary, #4C4E73);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

/* ── Palette utility classes for project cards ── */
/* #4C4E73 — slate */
.bg-palette-slate { background-color: rgba(76,78,115,0.1) !important; }
.text-palette-slate { color: #4C4E73 !important; }
/* #BF6F84 — rose */
.bg-palette-rose { background-color: rgba(191,111,132,0.12) !important; }
.text-palette-rose { color: #BF6F84 !important; }
/* #F294C0 — pink */
.bg-palette-pink { background-color: rgba(242,148,192,0.12) !important; }
.text-palette-pink { color: #d47aa5 !important; }
/* #D0EFF2 — ice */
.bg-palette-ice { background-color: rgba(208,239,242,0.35) !important; }
.text-palette-ice { color: #5ba8b0 !important; }
/* #0D0D0D — dark */
.bg-palette-dark { background-color: rgba(13,13,13,0.08) !important; }
.text-palette-dark { color: #333 !important; }

/* ── Project marquee ── */
.marquee {
  position: relative;
  overflow: hidden;
  padding: 0 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
}
.marquee-left {
  animation: marqueeLeft 40s linear infinite;
}
.marquee-right {
  animation: marqueeRight 40s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
.marquee-card {
  flex: 0 0 340px;
  max-width: 340px;
}
@keyframes marqueeLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes marqueeRight {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}
@media (max-width: 767.98px) {
  .marquee-card {
    flex: 0 0 280px;
    max-width: 280px;
  }
  .marquee-left { animation-duration: 30s; }
  .marquee-right { animation-duration: 30s; }
}

/* ── Keyframes ── */
@keyframes pdSpin {
  to { transform: rotate(360deg); }
}

/* Responsive tweaks */
@media (max-width: 767.98px) {
  .display-4 {
    font-size: 2rem;
  }
  .min-vh-75 {
    min-height: auto;
    padding: 2rem 0;
  }
}

/* Parser demo: tablet and below — no pin, tap to switch */
@media (max-width: 991.98px) {
  .pd-section {
    height: auto;
  }
  .pd-pin-wrapper {
    padding: 2rem 0;
  }
  .pd-header {
    padding: 1rem 0 1.5rem;
  }
  .pd-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: auto;
  }
  .pd-steps {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .pd-steps::-webkit-scrollbar {
    display: none;
  }
  .pd-step {
    flex: 1 0 0;
    min-width: 0;
    padding: 0.6rem 0.4rem;
    border-left: none;
    border-radius: 0.75rem;
    background: var(--bs-secondary-bg, #f8f9fa);
    cursor: pointer;
    flex-direction: column;
    gap: 0.35rem;
    text-align: center;
    align-items: center;
    display: flex;
  }
  .pd-step.is-active {
    background: var(--bs-primary);
    border-left: none;
  }
  .pd-step.is-active .pd-step-num {
    background: #fff;
    color: var(--bs-primary);
  }
  .pd-step.is-active .pd-step-title {
    color: #fff;
  }
  .pd-step.is-active .pd-step-desc {
    color: rgba(255,255,255,0.7);
  }
  .pd-step-desc {
    display: none;
  }
  .pd-step-title {
    font-size: 0.72rem;
    line-height: 1.2;
  }
  .pd-step-num {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
  .pd-viewport {
    min-height: 380px;
  }
  .pd-screen {
    border-radius: 0.75rem;
  }
  .pd-sources-grid {
    grid-template-columns: 1fr;
  }
  .pd-bubble {
    font-size: 0.78rem;
    max-width: 92%;
  }
  .pd-sum-key {
    min-width: 70px;
    font-size: 0.68rem;
  }
  .pd-sum-val {
    font-size: 0.78rem;
  }
}
