/* Landing page: styles not covered cleanly by Tailwind utilities */

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, system-ui, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

.hero-grid {
  position: relative;
}

.hero-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0;
  -webkit-mask-image: radial-gradient(ellipse at center, black 55%, transparent 80%);
  mask-image: radial-gradient(ellipse at center, black 55%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.hero-grid > * {
  position: relative;
  z-index: 1;
}

.media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* Before / after comparison slider (hero) */
.ba-slider {
  --ba-pos: 50%;
  /* Extra zoom on top of aspect crop; raise to crop sides more */
  --ba-zoom: 1.12;
  user-select: none;
  touch-action: none;
}

.ba-slider__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 1.25rem;
  background: #f3f4f6;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 40px rgba(15, 23, 42, 0.08);
}

.ba-slider__img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: translate(-50%, -50%) scale(var(--ba-zoom));
  pointer-events: none;
}

.ba-slider__img--after {
  z-index: 0;
}

.ba-slider__before {
  position: absolute;
  inset: 0;
  z-index: 1;
  clip-path: inset(0 calc(100% - var(--ba-pos)) 0 0);
}

.ba-slider__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ba-pos);
  width: 0;
  z-index: 2;
  pointer-events: none;
}

.ba-slider__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.ba-slider__knob {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  background: #fff;
  color: var(--color-ink, #0b0f1a);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.08),
    0 8px 24px rgba(15, 23, 42, 0.14);
}

.ba-slider__range {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: ew-resize;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}

.ba-slider__range:focus-visible {
  opacity: 1;
  outline: 2px solid var(--color-primary, #ec2a7a);
  outline-offset: -2px;
  border-radius: 1.25rem;
}

.ba-slider__labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-tertiary, #64748b);
}

details[data-faq-item] summary {
  list-style: none;
}

details[data-faq-item] summary::-webkit-details-marker {
  display: none;
}

details[data-faq-item][open] .faq-chevron {
  transform: rotate(180deg);
}

.feedback-tab-label {
  writing-mode: vertical-rl;
}

#manuals-container[data-layout="grid"] .manuals-list-wrap {
  display: none;
}

#manuals-container[data-layout="list"] .manuals-grid {
  display: none;
}

[hidden] {
  display: none !important;
}

.preview-body {
  scrollbar-gutter: stable;
}

.preview-tabs {
  scrollbar-width: none;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 150ms ease;
}

.preview-tabs::-webkit-scrollbar {
  height: 0;
  background: transparent;
  transition: height 150ms ease;
}

.preview-tabs::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.15);
  border-radius: 9999px;
}

.preview-tabs:hover,
.preview-tabs:focus-within {
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.3) transparent;
}

.preview-tabs:hover::-webkit-scrollbar,
.preview-tabs:focus-within::-webkit-scrollbar {
  height: 6px;
}

.preview-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/*
 * iOS Safari auto-zooms form controls when font-size < 16px on focus.
 * Force 16px on <sm viewports without altering desktop typography.
 */
@media (max-width: 639px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px;
  }
}

.cookie-banner {
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-banner--visible {
  transform: translateY(0);
}

@supports (padding: env(safe-area-inset-bottom)) {
  .cookie-banner {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner {
    transition: none;
  }
}

/* Honor iOS safe areas on fixed/sticky elements near edges. */
@supports (padding: env(safe-area-inset-bottom)) {
  #preview-overlay > div[data-preview-overlay-slot] {
    padding-bottom: env(safe-area-inset-bottom);
  }

  #app-menu .app-menu-panel {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    padding-top: max(1.5rem, env(safe-area-inset-top));
  }
}
