/**
 * Nimbus BCI Presentation Styles
 * Professional pitch deck styling with dark theme and yellow accents
 */

/* ============================================
   BASE STYLES
   ============================================ */

body {
  font-family: "Inter", sans-serif;
  background-color: #0a0a0f;
}

/* ============================================
   SLIDE ANIMATIONS & TRANSITIONS
   ============================================ */

.slide {
  display: none !important;
  animation: fadeIn 0.5s ease-in-out;
}

/* Full-bleed product slide: opacity-only entrance (avoids scale() subpixel blur on large bitmaps) */
.slide.slide-image-full {
  animation: slideImageFadeIn 0.45s ease-out;
}

@keyframes slideImageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/*
 * nimbus_studio_slide8.png is 1024×576 — cap at native px to avoid upscale blur.
 * For retina sharpness, replace with a 2× export and bump the max-* values.
 */
.studio-screenshot-crisp {
  width: auto;
  height: auto;
  max-width: min(100%, 1024px);
  max-height: min(100%, 576px);
  object-fit: contain;
  object-position: center;
}

/* Slide 12: identical image slot height for both product shots */
.slide12-media-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 11rem;
}

@media (min-width: 640px) {
  .slide12-media-slot {
    height: 13rem;
  }
}

@media (min-width: 768px) {
  .slide12-media-slot {
    height: 15rem;
  }
}

.slide12-media-slot img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

/* Benchmark slide: paired dark-theme nimbusbench charts */
.benchmark-charts-grid {
  max-width: 58rem;
  margin-left: auto;
  margin-right: auto;
  align-items: stretch;
}

.benchmark-figure {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: min(42vh, 21rem);
  background-color: #000000;
}

.team-photo {
  width: 7rem;
  height: 7rem;
  object-fit: cover;
}

.benchmark-dark-chart {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Slide 13: BCI stack partnership diagram */
.bci-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 24rem;
  margin-left: auto;
  margin-right: auto;
  min-height: min(52vh, 26rem);
  justify-content: center;
}

.bci-stack-layer {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
  background-color: rgba(17, 24, 39, 0.65);
  text-align: center;
}

.bci-stack-layer--middleware {
  border-color: rgba(96, 165, 250, 0.55);
  background-color: rgba(30, 58, 138, 0.35);
}

.bci-stack-layer__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
}

.bci-stack-layer__sub {
  margin: 0.15rem 0 0;
  font-size: 0.65rem;
  line-height: 1.35;
  color: #94a3b8;
}

.bci-stack-adaptive {
  border: 1px dashed rgba(148, 163, 184, 0.45);
  border-radius: 0.65rem;
  padding: 0.65rem 0.55rem;
  background-color: rgba(15, 23, 42, 0.5);
  flex: 1;
}

.bci-stack-adaptive__label {
  margin: 0 0 0.4rem;
  text-align: center;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.bci-stack-adaptive__row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.bci-stack-nimbus {
  flex: 1.15;
  border: 2px solid rgba(250, 204, 21, 0.75);
  border-radius: 0.5rem;
  padding: 0.6rem 0.45rem;
  background-color: rgba(113, 63, 18, 0.35);
  text-align: center;
}

.bci-stack-nimbus__title {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 800;
  color: #fde047;
}

.bci-stack-nimbus__sub {
  margin: 0.15rem 0 0.45rem;
  font-size: 0.64rem;
  color: #fcd34d;
}

.bci-stack-loop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: #fef9c3;
}

.bci-stack-loop__arrow {
  color: rgba(253, 224, 71, 0.7);
}

.bci-stack-or {
  display: flex;
  align-items: center;
  font-size: 0.55rem;
  color: #64748b;
}

.bci-stack-alt {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.5rem;
  padding: 0.55rem 0.4rem;
  background-color: rgba(17, 24, 39, 0.45);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.bci-stack-alt__title {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  color: #e2e8f0;
}

.bci-stack-alt__sub {
  margin: 0.15rem 0 0;
  font-size: 0.55rem;
  color: #94a3b8;
}

.bci-stack-io {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  padding: 0 0.15rem;
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.bci-stack-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.55rem;
  color: #94a3b8;
}

.bci-stack-legend li {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.bci-stack-legend__swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 0.125rem;
}

.bci-stack-legend__swatch--nimbus {
  background-color: rgba(250, 204, 21, 0.85);
}

.bci-stack-legend__swatch--middleware {
  background-color: rgba(96, 165, 250, 0.85);
}

.bci-stack-legend__swatch--stack {
  border: 1px solid rgba(148, 163, 184, 0.55);
  background-color: rgba(17, 24, 39, 0.65);
}

.bci-partner-usps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bci-partner-usps__item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.bci-partner-usps__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(250, 204, 21, 0.25);
  background-color: rgba(17, 24, 39, 0.8);
  color: #facc15;
}

.bci-partner-usps__icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.slide.active {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

/* Override for full-image slides: header above, image below */
.slide.active.slide-image-full {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  align-self: stretch !important;
  justify-content: flex-start !important;
  padding: 0 !important;
  overflow: hidden !important;
  height: 100% !important;
  width: 100% !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide,
  .slide.slide-image-full {
    animation: none;
  }

  .card-style {
    transition: none;
  }

  .card-style:hover {
    transform: none;
    box-shadow: none;
  }

  .transition-smooth {
    transition: none;
  }

  button:not(:disabled):hover {
    transform: none;
    box-shadow: none;
  }
}

/* ============================================
   CARD COMPONENTS
   ============================================ */

.card-style {
  background-color: #111827;
  border: 1px solid rgba(250, 204, 21, 0.2);
  transition: all 0.3s ease;
}

.card-style:hover {
  border-color: rgba(250, 204, 21, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.1);
}

/* ============================================
   RESPONSIVE TABLE STYLES
   ============================================ */

.table-container table th,
.table-container table td {
  vertical-align: top;
}

/* Advisory LIBR mark on dark background */
.advisory-logo-libr {
  max-width: 120px;
  object-fit: contain;
  filter: brightness(10) grayscale(1);
}

@media (max-width: 767px) {
  .table-container:not(:has(.table-cards)) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-container:not(:has(.table-cards)) table {
    width: 100%;
    min-width: 600px;
  }

  .table-cards {
    min-width: 0;
  }

  .table-cards thead {
    display: none;
  }

  .table-cards tbody tr {
    display: block;
    margin-bottom: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.5rem;
    padding: 0.5rem 0.65rem;
    background-color: rgba(17, 24, 39, 0.65);
  }

  .table-cards tbody tr:last-child {
    margin-bottom: 0;
  }

  .table-cards tbody td {
    display: block;
    border: none !important;
    padding: 0.35rem 0 !important;
  }

  .table-cards tbody td:first-child {
    font-size: 0.875rem;
    font-weight: 700;
    color: #f8fafc;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25) !important;
    margin-bottom: 0.35rem;
    padding-bottom: 0.45rem !important;
  }

  .table-cards tbody td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.15rem;
  }

  .table-cards tbody td.table-cards-highlight {
    border: 1px solid rgba(250, 204, 21, 0.45) !important;
    border-radius: 0.375rem;
    margin-top: 0.25rem;
    padding: 0.45rem 0.5rem !important;
    background-color: rgba(113, 63, 18, 0.25);
  }

  .table-cards-compact tbody td:not(:first-child):not(.table-cards-highlight) {
    display: none;
  }

  .table-cards-compact-note {
    display: block;
  }

  .team-photo {
    width: 4.5rem;
    height: 4.5rem;
  }

  .tech-core-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .tech-core-features .card-style {
    margin-bottom: 0;
  }

  .tech-core-features .mt-3.flex {
    grid-column: 1 / -1;
    margin-top: 0.35rem;
    gap: 0.75rem;
  }

  .bci-stack {
    min-height: 0;
    gap: 0.35rem;
  }

  .bci-stack-adaptive {
    padding: 0.45rem 0.5rem;
  }

  .bci-stack-or,
  .bci-stack-alt {
    display: none;
  }

  .bci-stack-adaptive__row {
    gap: 0;
  }

  .bci-stack-nimbus {
    flex: 1;
  }

  .slide12-media-slot {
    height: 9rem;
  }

  .advisory-card-detail {
    display: none;
  }

  .mobile-accordion-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .mobile-accordion {
    border-radius: 0.5rem;
    padding: 0.55rem 0.65rem;
  }

  .mobile-accordion__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    list-style: none;
    cursor: pointer;
    font-weight: 700;
    color: #f8fafc;
    font-size: 0.875rem;
  }

  .mobile-accordion__summary::-webkit-details-marker {
    display: none;
  }

  .mobile-accordion__summary::after {
    content: "+";
    margin-left: auto;
    font-size: 1rem;
    font-weight: 700;
    color: #facc15;
    line-height: 1;
  }

  .mobile-accordion[open] .mobile-accordion__summary::after {
    content: "−";
  }

  .mobile-accordion__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    background-color: #4b5563;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.03em;
  }

  .mobile-accordion__badge--active {
    background-color: #facc15;
    color: #000;
  }

  .mobile-accordion__title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .mobile-accordion__meta {
    font-size: 0.75rem;
    font-weight: 700;
  }

  .mobile-accordion__body {
    margin-top: 0.5rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
  }

  .mobile-accordion__body p {
    margin: 0 0 0.45rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #cbd5e1;
  }

  .mobile-accordion__body p:last-child {
    margin-bottom: 0;
  }

  .mobile-accordion__label {
    display: block;
    margin-bottom: 0.1rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
  }

  .mobile-accordion__highlight {
    color: #fde047 !important;
    font-weight: 600;
  }

  .benchmark-figure--latency {
    display: none;
  }

  .benchmark-figure {
    height: min(34vh, 17rem);
  }

  .benchmark-mobile-note {
    display: block;
  }
}

@media (min-width: 768px) {
  .benchmark-mobile-note {
    display: none;
  }

  .table-cards-compact-note {
    display: none;
  }
}

/* Scroll hint when slide content extends below the fold (mobile) */
@media (max-width: 767px) {
  #slides-wrapper {
    scroll-behavior: smooth;
  }

  #slides-wrapper.can-scroll::after {
    content: "";
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: block;
    height: 2.5rem;
    margin-top: -2.5rem;
    pointer-events: none;
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.85) 100%
    );
  }
}

/* Extra-compact layout for short phone viewports (e.g. iPhone SE) */
@media (max-width: 767px) and (max-height: 740px) {
  #presentation-container {
    min-height: 78dvh !important;
    height: min(96dvh, 56rem) !important;
    max-height: 98dvh !important;
  }

  .table-cards tbody tr {
    margin-bottom: 0.4rem;
    padding: 0.35rem 0.5rem;
  }

  .table-cards-compact-note {
    display: none;
  }

  .slide-competitive h2 {
    font-size: 1.125rem;
    margin-bottom: 0.35rem;
  }

  .slide-competitive .table-cards tbody tr {
    margin-bottom: 0.3rem;
    padding: 0.3rem 0.45rem;
  }

  .slide-competitive .table-cards tbody td:first-child {
    font-size: 0.75rem;
    margin-bottom: 0.15rem;
    padding-bottom: 0.25rem !important;
  }

  .slide-competitive .table-cards tbody td.table-cards-highlight {
    padding: 0.25rem 0.4rem !important;
    margin-top: 0.1rem;
    font-size: 0.75rem;
  }

  .slide-competitive .table-cards-compact tbody td.table-cards-highlight span.block {
    display: none;
  }

  .benchmark-figure {
    height: min(24vh, 10.5rem);
  }

  .bci-stack-layer__sub,
  .bci-stack-io,
  .bci-stack-nimbus__sub {
    display: none;
  }

  .bci-stack-layer,
  .bci-stack-nimbus {
    padding: 0.4rem 0.5rem;
  }

  .bci-stack-adaptive {
    padding: 0.35rem;
  }

  .mobile-accordion {
    padding: 0.45rem 0.55rem;
  }

  .slide-solution-cards h4 {
    font-size: 0.625rem;
    line-height: 1.25;
  }
}

/* ============================================
   NAVIGATION BUTTONS
   ============================================ */

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:not(:disabled):active {
  transform: translateY(0);
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Focus indicators for keyboard navigation */
button:focus-visible,
a:focus-visible {
  outline: 2px solid #fdb714;
  outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #fdb714;
  color: #000;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Smooth transitions for interactive elements */
.transition-smooth {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Text shadow for better readability on images */
.text-shadow-strong {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* ============================================
   PDF EXPORT MODE (?export=pdf&slide=N)
   A4 landscape (297mm × 210mm) — one slide per PDF page
   ============================================ */

/* Match browser base (Tailwind default 16px) — 12px was shrinking the whole deck */
html.pdf-export {
  font-size: 16px;
}

html.pdf-export,
html.pdf-export body {
  width: 297mm;
  height: 210mm;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background-color: #0a0a0f !important;
  min-height: 0 !important;
  max-height: none !important;
  display: block !important;
}

html.pdf-export .skip-to-content,
html.pdf-export #sr-announcement,
html.pdf-export footer,
html.pdf-export button {
  display: none !important;
}

html.pdf-export #presentation-container {
  width: 297mm !important;
  height: 210mm !important;
  max-width: none !important;
  min-height: 210mm !important;
  max-height: 210mm !important;
  flex: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

html.pdf-export #slides-wrapper {
  display: block !important;
  width: 297mm !important;
  height: 210mm !important;
  flex: none !important;
  overflow: hidden !important;
  padding: 0 !important;
}

/* showSlide() adds p-8/md:p-12 on wrapper — strip for full-bleed PDF */
html.pdf-export #slides-wrapper.p-8,
html.pdf-export #slides-wrapper.md\:p-12,
html.pdf-export #slides-wrapper.lg\:p-16 {
  padding: 0 !important;
}

/* Hide every slide; nth-child rules below reveal the requested index only */
html.pdf-export-single .slide {
  display: none !important;
  animation: none !important;
}

html.pdf-export-single[data-export-slide="0"]
  #slides-wrapper
  > .slide:nth-child(1),
html.pdf-export-single[data-export-slide="1"]
  #slides-wrapper
  > .slide:nth-child(2),
html.pdf-export-single[data-export-slide="2"]
  #slides-wrapper
  > .slide:nth-child(3),
html.pdf-export-single[data-export-slide="3"]
  #slides-wrapper
  > .slide:nth-child(4),
html.pdf-export-single[data-export-slide="4"]
  #slides-wrapper
  > .slide:nth-child(5),
html.pdf-export-single[data-export-slide="5"]
  #slides-wrapper
  > .slide:nth-child(6),
html.pdf-export-single[data-export-slide="6"]
  #slides-wrapper
  > .slide:nth-child(7),
html.pdf-export-single[data-export-slide="7"]
  #slides-wrapper
  > .slide:nth-child(8),
html.pdf-export-single[data-export-slide="8"]
  #slides-wrapper
  > .slide:nth-child(9),
html.pdf-export-single[data-export-slide="9"]
  #slides-wrapper
  > .slide:nth-child(10),
html.pdf-export-single[data-export-slide="10"]
  #slides-wrapper
  > .slide:nth-child(11),
html.pdf-export-single[data-export-slide="11"]
  #slides-wrapper
  > .slide:nth-child(12),
html.pdf-export-single[data-export-slide="12"]
  #slides-wrapper
  > .slide:nth-child(13),
html.pdf-export-single[data-export-slide="13"]
  #slides-wrapper
  > .slide:nth-child(14),
html.pdf-export-single[data-export-slide="14"]
  #slides-wrapper
  > .slide:nth-child(15),
html.pdf-export-single[data-export-slide="15"]
  #slides-wrapper
  > .slide:nth-child(16),
html.pdf-export-single[data-export-slide="16"]
  #slides-wrapper
  > .slide:nth-child(17),
html.pdf-export-single[data-export-slide="17"]
  #slides-wrapper
  > .slide:nth-child(18),
html.pdf-export-single[data-export-slide="18"]
  #slides-wrapper
  > .slide:nth-child(19),
html.pdf-export-single[data-export-slide="19"]
  #slides-wrapper
  > .slide:nth-child(20) {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 297mm !important;
  height: 210mm !important;
  min-height: 210mm !important;
  max-height: 210mm !important;
  overflow: hidden !important;
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  page-break-after: auto;
  break-after: auto;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

html.pdf-export .team-photo {
  width: 7.5rem;
  height: 7.5rem;
}

html.pdf-export,
html.pdf-export * {
  animation: none !important;
  transition: none !important;
}

html.pdf-export-single .slide.slide-image-full {
  align-items: stretch !important;
  justify-content: flex-start !important;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  body {
    background-color: #0a0a0f !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
  }

  .skip-to-content,
  #sr-announcement,
  footer,
  button {
    display: none !important;
  }

  #presentation-container {
    width: 100% !important;
    max-width: none !important;
    min-height: auto !important;
    height: auto !important;
    max-height: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #slides-wrapper {
    overflow: visible !important;
    padding: 0 !important;
  }

  html:not(.pdf-export-single) .slide {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 297mm !important;
    height: 210mm !important;
    min-height: 210mm !important;
    max-height: 210mm !important;
    overflow: hidden !important;
    page-break-after: always;
    page-break-inside: avoid;
    break-after: page;
    break-inside: avoid;
    animation: none !important;
  }

  html:not(.pdf-export-single) .slide:last-child {
    page-break-after: auto;
  }

  html:not(.pdf-export-single) .slide.slide-image-full {
    justify-content: flex-start !important;
  }
}
