/* ClearCutBG — Custom Styles */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 5rem;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -2px rgba(37, 99, 235, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #fff;
  color: #1e40af;
  border: 2px solid #bfdbfe;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-secondary:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

/* Navbar dropdown */
.dropdown-panel {
  animation: dropdownIn 0.18s ease;
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: block;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #475569;
  transition: background 0.12s ease, color 0.12s ease;
}

.dropdown-item:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.mobile-nav-link {
  display: block;
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #475569;
  border-radius: 0.5rem;
  transition: background 0.12s ease, color 0.12s ease;
}

.mobile-nav-link:hover {
  background: #f1f5f9;
  color: #1d4ed8;
}

#navbar.scrolled {
  box-shadow: 0 1px 12px rgba(15, 23, 42, 0.06);
}

#tools-dropdown-btn[aria-expanded="true"] #tools-chevron {
  transform: rotate(180deg);
}

/* Upload zone */
.upload-zone.drag-over {
  border-color: #2563eb;
  background: rgba(239, 246, 255, 0.9);
  transform: scale(1.01);
}

.upload-zone.upload-success {
  border-color: #10b981;
  background: rgba(236, 253, 245, 0.6);
}

/* Placeholder card animation */
.placeholder-card-inner {
  animation: fadeSlideUp 0.5s ease;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Before / After Slider */
.ba-slider-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  user-select: none;
  touch-action: none;
  cursor: col-resize;
}

.ba-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba-before {
  position: relative;
  z-index: 1;
}

.ba-after-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  clip-path: inset(0 0 0 50%);
}

.ba-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ba-label {
  position: absolute;
  top: 1rem;
  z-index: 4;
  padding: 0.35rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  border-radius: 9999px;
  pointer-events: none;
}

.ba-label-before {
  left: 1rem;
}

.ba-label-after {
  right: 1rem;
}

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 5;
  width: 4px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  touch-action: none;
}

.ba-handle-line {
  flex: 1;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.ba-handle-knob {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  transition: transform 0.12s ease;
}

.ba-handle:hover .ba-handle-knob,
.ba-handle:focus .ba-handle-knob {
  transform: scale(1.08);
}

.ba-handle:focus {
  outline: none;
}

.ba-handle:focus .ba-handle-knob {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.4), 0 2px 12px rgba(0, 0, 0, 0.25);
}

/* Slider processing overlay */
.slider-processing {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.97) 0%, rgba(255, 255, 255, 0.98) 100%);
  backdrop-filter: blur(4px);
  min-height: 16rem;
}

.slider-processing.hidden {
  display: none;
}

.slider-processing-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid #bfdbfe;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.slider-processing-text {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
}

.slider-processing-subtext {
  font-size: 0.8125rem;
  color: #64748b;
}

#download-panel.is-ready {
  opacity: 1;
  pointer-events: auto;
}

#download-panel.is-ready[aria-disabled="false"] {
  opacity: 1;
}

.btn-primary:disabled,
.btn-primary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
  transform: none;
  box-shadow: none;
}

#slider-section.reveal {
  animation: fadeSlideUp 0.45s ease;
}

/* Format selector */
.format-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.format-btn:hover {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.format-btn.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.format-btn.active .premium-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.format-btn-premium:not(.active):hover {
  border-color: #fbbf24;
  background: #fffbeb;
  color: #b45309;
}

.premium-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 0.25rem;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
}

/* Trust badges */
.trust-badge {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.trust-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trust-icon svg {
  width: 1.375rem;
  height: 1.375rem;
  color: #2563eb;
}

/* Section typography */
.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-desc {
  font-size: 1.0625rem;
  color: #64748b;
  line-height: 1.65;
}

/* Category tabs */
.category-tab {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.category-tab:hover {
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.category-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 4px 14px -2px rgba(37, 99, 235, 0.35);
}

/* Category cards */
.category-card {
  text-align: center;
}

.category-card-img-wrap {
  border-radius: 1rem;
  overflow: hidden;
  aspect-ratio: 1;
  background: #f1f5f9;
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.08);
  border: 1px solid #e2e8f0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card:hover .category-card-img-wrap {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px -8px rgba(37, 99, 235, 0.15);
}

.category-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.category-img.updating {
  opacity: 0;
  transform: scale(0.97);
}

.category-card-label {
  margin-top: 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.checkerboard {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

/* Story sections */
.story-image-wrap {
  position: relative;
}

.story-image {
  width: 100%;
  height: auto;
  border-radius: 1.25rem;
  object-fit: cover;
  object-position: center center;
  aspect-ratio: 4 / 3;
  position: relative;
  z-index: 1;
  box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.15);
}

.story-image--top {
  object-position: top center;
}

.story-image-accent {
  position: absolute;
  bottom: -1rem;
  left: -1rem;
  width: 60%;
  height: 60%;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-radius: 1.25rem;
  z-index: 0;
}

.story-image-accent-right {
  left: auto;
  right: -1rem;
}

.story-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: #475569;
}

/* Tool cards */
.tool-card {
  background: #fff;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px -8px rgba(37, 99, 235, 0.12);
}

.tool-card-img-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.tool-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: transform 0.4s ease;
  transform-origin: center center;
}

.tool-card-img--top {
  object-position: top center;
  transform-origin: top center;
}

.tool-card:hover .tool-card-img {
  transform: scale(1.05);
}

.tool-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.3), transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tool-card:hover .tool-card-overlay {
  opacity: 1;
}

/* Pricing */
.pricing-card {
  position: relative;
  padding: 2rem;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px -8px rgba(15, 23, 42, 0.08);
}

.pricing-card-featured {
  border-color: #2563eb;
  box-shadow: 0 8px 30px -8px rgba(37, 99, 235, 0.2);
}

/* FAQ */
.faq-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.faq-item:hover {
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.06);
}

.faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1e293b;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.faq-trigger:hover {
  color: #2563eb;
}

.faq-chevron {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: #94a3b8;
  transition: transform 0.25s ease;
}

.faq-trigger[aria-expanded="true"] .faq-chevron {
  transform: rotate(180deg);
  color: #2563eb;
}

.faq-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.faq-panel.open {
  max-height: 20rem;
}

.faq-panel p {
  padding: 0 1.25rem 1.125rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #64748b;
}

/* CTA */
.cta-banner {
  box-shadow: 0 20px 60px -12px rgba(37, 99, 235, 0.35);
}

/* Footer */
.footer-link {
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: #fff;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  background: #1e293b;
  color: #94a3b8;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.social-icon:hover {
  background: #2563eb;
  color: #fff;
  transform: translateY(-2px);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  padding: 2rem;
  background: #fff;
  border-radius: 1.5rem;
  box-shadow: 0 24px 64px -12px rgba(15, 23, 42, 0.25);
  animation: modalIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close:hover {
  background: #f1f5f9;
  color: #475569;
}

body.modal-open {
  overflow: hidden;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 110;
  padding: 0.75rem 1.25rem;
  background: #0f172a;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  animation: toastIn 0.3s ease;
}

.toast.hidden {
  display: none;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Responsive tweaks */
@media (max-width: 1023px) {
  .ba-slider-wrap {
    aspect-ratio: 3 / 2;
  }
}

@media (max-width: 639px) {
  .trust-badge {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .format-btn {
    padding: 0.4375rem 0.75rem;
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
