/*
Theme Name: BgRemove
Theme URI: https://wordpress.org/
Author: BgRemove
Description: Free AI background remover. The landing page and tool run entirely in the visitor's browser — photos are never uploaded to the server.
Version: 1.4.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: MIT
License URI: https://opensource.org/licenses/MIT
Text Domain: bgremove
Tags: one-column, custom-logo, featured-images, full-width-template
*/

:root {
  --brand-50: #f0f4ff;
  --brand-100: #e0e9ff;
  --brand-200: #c7d6fe;
  --brand-400: #818cf8;
  --brand-600: #5046e5;
  --brand-700: #4338ca;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --green-600: #16a34a;
  --red-500: #ef4444;
  --shadow-card: 0 0 0 1px rgba(0, 0, 0, 0.03), 0 2px 4px rgba(0, 0, 0, 0.05), 0 12px 24px rgba(0, 0, 0, 0.05);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 80rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--gray-900);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--brand-600);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  flex-shrink: 0;
}

.icon-lg {
  width: 2rem;
  height: 2rem;
}

.icon-xl {
  width: 2.5rem;
  height: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  cursor: pointer;
  background: var(--brand-600);
  color: #fff;
  font-weight: 500;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.btn:hover {
  background: var(--brand-700);
}

.btn-md {
  padding: 0.625rem 1.5rem;
  font-size: 0.95rem;
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

.btn-light {
  background: #fff;
  color: var(--brand-600);
  font-weight: 600;
  padding: 0.75rem 2rem;
}

.btn-light:hover {
  background: var(--brand-50);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-100);
}

body.admin-bar .site-header {
  top: 32px;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: var(--brand-600);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark .custom-logo {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  object-fit: cover;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 2rem;
}

.nav-desktop a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
}

.nav-desktop a:hover {
  color: var(--gray-900);
}

.header-cta {
  display: none;
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--gray-900);
}

.menu-toggle .icon-close {
  display: none;
}

.menu-toggle.is-open .icon-menu {
  display: none;
}

.menu-toggle.is-open .icon-close {
  display: block;
}

.mobile-nav {
  display: none;
  padding: 1rem 0 1.25rem;
  border-top: 1px solid var(--gray-100);
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 0.5rem 0;
  color: var(--gray-600);
}

.mobile-nav .btn {
  margin-top: 0.75rem;
  width: 100%;
}

/* Hero */
.hero {
  padding: 4rem 0 2rem;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99, 102, 241, 0.15), transparent);
  text-align: center;
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-600);
}

.hero h1 {
  margin: 0 0 1.5rem;
  font-size: 2.25rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.gradient-text {
  background: linear-gradient(135deg, #5046e5 0%, #7c3aed 50%, #db2777 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-lead {
  margin: 0 auto 3rem;
  max-width: 42rem;
  font-size: 1.125rem;
  color: var(--gray-500);
}

.tool-section {
  padding: 0 0 6rem;
  margin-top: -1rem;
}

/* Tool */
.tool {
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
}

.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 56rem;
  margin: 0 auto 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.tool-tab {
  flex: 0 0 auto;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-600);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.tool-tab.is-active,
.tool-tab:hover {
  border-color: var(--brand-600);
  color: var(--brand-600);
  background: var(--brand-50);
}

.field-row,
.preset-row,
.scene-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700);
}

.field input,
.field select {
  border: 1px solid var(--gray-200);
  border-radius: 0.6rem;
  padding: 0.45rem 0.6rem;
  font: inherit;
  font-weight: 500;
  min-width: 7rem;
  background: #fff;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  padding-bottom: 0.45rem;
}

.btn-ghost {
  background: #fff;
  color: var(--brand-600);
  box-shadow: inset 0 0 0 1px var(--brand-200);
}

.btn-ghost:hover {
  background: var(--brand-50);
}

.scene-btn,
.preset-btn {
  border: 1px solid var(--gray-200);
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
}

.scene-btn.is-active,
.preset-btn.is-active {
  border-color: var(--brand-600);
  color: var(--brand-600);
  background: var(--brand-50);
}

.batch-card {
  margin-top: 1rem;
  padding: 1.25rem;
}

.batch-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.batch-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--gray-100);
  border-radius: 0.7rem;
}

.batch-list .ok { color: var(--green-600); }
.batch-list .bad { color: var(--red-500); }

.tool-panel.is-hidden {
  display: none !important;
}

.editor-stage {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #f3f4f6;
  touch-action: none;
  cursor: crosshair;
}

.editor-stage canvas {
  display: block;
  width: 100%;
  height: auto;
}

.editor-stage .mask-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.generator-card,
.prompt-field textarea {
  width: 100%;
}

.generator-card {
  padding: 1.25rem;
}

.prompt-field textarea {
  min-height: 6.5rem;
  resize: vertical;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  font: inherit;
  font-weight: 500;
}

.upload-zone {
  background: linear-gradient(135deg, #fafafa 0%, #f5f3ff 100%);
  border: 2px dashed #c7d2fe;
  border-radius: 1rem;
  padding: 3rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  border-color: #6366f1;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  transform: translateY(-1px);
}

.upload-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  border-radius: 1rem;
  background: var(--brand-100);
  color: var(--brand-600);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone h2 {
  margin: 0;
  font-size: 1.125rem;
}

.upload-zone p {
  margin: 0.25rem 0 0;
  color: var(--gray-500);
}

.upload-zone .btn {
  margin-top: 1.25rem;
}

.hint {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--gray-400);
}

.error-text {
  margin: 1rem 0 0;
  text-align: center;
  color: var(--red-500);
  font-size: 0.875rem;
}

.samples {
  margin-top: 2rem;
}

.samples p {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.sample-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sample {
  position: relative;
  width: 5rem;
  height: 5rem;
  padding: 0;
  border: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--gray-200);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sample:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px var(--brand-600);
}

.sample img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sample span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.sample:hover span {
  opacity: 1;
}

.card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.processing {
  padding: 3rem 1.25rem;
  text-align: center;
}

.processing-icon {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1.5rem;
  border-radius: 1rem;
  background: var(--brand-100);
  color: var(--brand-600);
  display: flex;
  align-items: center;
  justify-content: center;
}

.processing h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.processing p {
  margin: 0 0 1.5rem;
  color: var(--gray-500);
}

.progress-track {
  width: 100%;
  max-width: 20rem;
  height: 0.5rem;
  margin: 0 auto;
  background: var(--gray-100);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--brand-600);
  border-radius: 999px;
  transition: width 0.25s ease-out;
}

.progress-label {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--gray-400);
}

.processing-thumb {
  max-width: 20rem;
  margin: 2rem auto 0;
  border-radius: 0.75rem;
  overflow: hidden;
  opacity: 0.5;
}

@keyframes pulse-ring {
  0%,
  100% {
    transform: scale(0.95);
    opacity: 0.7;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

.processing-pulse {
  animation: pulse-ring 2s ease-in-out infinite;
}

.result-head,
.result-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.result-head {
  border-bottom: 1px solid var(--gray-100);
}

.result-foot {
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  flex-wrap: wrap;
  align-items: flex-end;
}

.status-ok {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--green-600);
  font-weight: 500;
}

.size-note {
  display: none;
  font-size: 0.75rem;
  color: var(--gray-400);
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: 0;
  background: transparent;
  color: var(--gray-500);
  font-size: 0.875rem;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--gray-700);
}

.compare {
  display: grid;
}

.pane {
  padding: 1.5rem;
}

.pane + .pane {
  border-top: 1px solid var(--gray-100);
}

.pane h3 {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
}

.preview-frame {
  border-radius: 0.75rem;
  overflow: hidden;
  min-height: 280px;
  max-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
}

.preview-frame img {
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.checkerboard {
  background-color: #f9fafb;
  background-image:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.bg-controls {
  width: 100%;
}

.bg-controls > p {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.swatch {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  border: 2px solid var(--gray-200);
  padding: 0;
  cursor: pointer;
  background: #fff;
}

.swatch.is-active {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand-600);
}

.swatches .btn {
  margin-left: auto;
}

.color-wrap {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
}

.color-wrap input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Stats / features */
.stats {
  background: var(--gray-50);
  padding: 4rem 0;
}

.stats-grid,
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.stat {
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 1.875rem;
  line-height: 1.1;
}

.stat span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.section {
  padding: 6rem 0;
}

.section-head {
  text-align: center;
  margin-bottom: 4rem;
}

.section-head h2,
.faq h2,
.cta h2 {
  margin: 0 0 1rem;
  font-size: 1.875rem;
  letter-spacing: -0.02em;
}

.section-head p,
.faq-lead {
  margin: 0 auto;
  max-width: 42rem;
  color: var(--gray-500);
  font-size: 1.125rem;
}

.feature-grid,
.steps {
  display: grid;
  gap: 2rem;
}

.feature {
  padding: 1.5rem;
  border: 1px solid var(--gray-100);
  border-radius: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature:hover {
  border-color: var(--brand-200);
  box-shadow: 0 10px 24px rgba(80, 70, 229, 0.08);
}

.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: var(--brand-50);
  color: var(--brand-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: background 0.2s ease;
}

.feature:hover .feature-icon {
  background: var(--brand-100);
}

.feature h3,
.step h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.feature p,
.step p {
  margin: 0;
  color: var(--gray-500);
  line-height: 1.7;
}

.steps-section {
  background: var(--gray-50);
}

.step {
  text-align: center;
}

.step-num {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1.5rem;
  border-radius: 1rem;
  background: var(--brand-600);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta {
  background: var(--brand-600);
  color: #fff;
  text-align: center;
  padding: 6rem 0;
}

.cta p {
  margin: 0 0 2rem;
  font-size: 1.125rem;
  color: var(--brand-100);
}

.faq h2 {
  text-align: center;
}

.faq-lead {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 1rem;
}

.faq-list {
  max-width: 48rem;
  margin: 0 auto;
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  overflow: hidden;
}

.faq-item button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border: 0;
  background: #fff;
  text-align: left;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-900);
}

.faq-item button:hover {
  background: var(--gray-50);
}

.faq-item .icon {
  color: var(--gray-400);
  transition: transform 0.2s ease;
}

.faq-item.is-open .icon {
  transform: rotate(180deg);
}

.faq-item .answer {
  display: none;
  padding: 0 1.5rem 1rem;
  color: var(--gray-600);
  line-height: 1.7;
}

.faq-item.is-open .answer {
  display: block;
}

/* Footer */
.site-footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  padding: 4rem 0 0;
}

.footer-brand {
  grid-column: 1 / -1;
}

.footer-brand p {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--gray-500);
  line-height: 1.7;
  max-width: 18rem;
}

.footer-col h4 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.footer-col a {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.footer-col a:hover {
  color: var(--gray-700);
}

.footer-bottom {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--gray-400);
}

.footer-bottom p {
  margin: 0;
}

.legal {
  display: flex;
  gap: 1.5rem;
}

.legal a:hover {
  color: var(--gray-600);
}

.page-wrap {
  max-width: 48rem;
  margin: 0 auto;
  padding: 4rem 1rem 6rem;
}

.page-wrap h1 {
  margin-top: 0;
}

.is-hidden {
  display: none !important;
}

@media (min-width: 640px) {
  .wrap {
    padding: 0 1.5rem;
  }

  .hero {
    padding: 6rem 0 3rem;
  }

  .hero h1,
  .section-head h2,
  .faq h2,
  .cta h2 {
    font-size: 2.25rem;
  }

  .hero-lead {
    font-size: 1.25rem;
  }

  .stat strong {
    font-size: 2.25rem;
  }

  .size-note {
    display: inline;
  }

  .footer-bottom {
    flex-direction: row;
  }
}

@media (min-width: 768px) {
  .nav-desktop,
  .header-cta {
    display: flex;
  }

  .menu-toggle,
  .mobile-nav {
    display: none !important;
  }

  .compare {
    grid-template-columns: 1fr 1fr;
  }

  .pane + .pane {
    border-top: 0;
    border-left: 1px solid var(--gray-100);
  }

  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }

  .steps {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
  }

  .footer-brand {
    grid-column: auto;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

@media (min-width: 1024px) {
  .wrap {
    padding: 0 2rem;
  }

  .hero h1 {
    font-size: 3.75rem;
  }

  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Photoroom-style tools grid */
.tools-grid-section {
  background: #fff;
  padding-top: 0;
}

.tools-grid-head .eyebrow {
  margin-bottom: 0.5rem;
  color: var(--brand-600);
  font-weight: 500;
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.35rem;
  }
}

.tool-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--gray-100);
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  padding: 0;
  font: inherit;
  color: inherit;
}

.tool-card:hover {
  border-color: var(--gray-200);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.tool-card.is-active {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 2px var(--brand-200), 0 12px 24px rgba(80, 70, 229, 0.08);
}

.tool-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--gray-100);
}

.tool-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.tool-card:hover .tool-card-media img {
  transform: scale(1.05);
}

.tool-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.tool-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  background: rgba(17, 24, 39, 0.28);
  pointer-events: none;
  z-index: 1;
}

.tool-card-body {
  padding: 1rem 1.15rem 1.2rem;
}

.tool-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.tool-card-icon {
  width: 1rem;
  height: 1rem;
  color: var(--gray-700);
  flex-shrink: 0;
}

.tool-card-body h3 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.35;
}

.tool-card-body p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--gray-500);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== Individual tool pages ========== */
.tool-page {
  padding-bottom: 4rem;
}

.tp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--gray-400);
  padding-top: 1.25rem;
  margin-bottom: 1.5rem;
}

.tp-breadcrumb a:hover {
  color: var(--brand-600);
}

.tp-title-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  max-width: 48rem;
  margin: 0 auto 2rem;
}

.tp-title-row-center {
  text-align: center;
  flex-direction: column;
  align-items: center;
}

.tp-title-row h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.tp-lead {
  margin: 0;
  color: var(--gray-500);
  font-size: 1.05rem;
  line-height: 1.55;
}

.tp-title-icon {
  color: var(--gray-900);
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.tp-title-row-center .tp-title-icon {
  margin: 0 0 0.5rem;
}

.tp-hero-centered {
  padding: 2rem 0 3rem;
}

.tp-stage {
  position: relative;
  max-width: 52rem;
  margin: 0 auto 2rem;
  padding: 0 4rem;
}

.tp-stage.is-busy .tp-float,
.tp-dual-grid.is-busy {
  opacity: 0.35;
  pointer-events: none;
}

.tp-dropzone {
  position: relative;
  z-index: 2;
  min-height: 280px;
  border-radius: 1.5rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  cursor: pointer;
  border: 1px solid var(--gray-100);
  background-color: #fff;
}

.tp-dropzone.is-dragging {
  box-shadow: inset 0 0 0 2px var(--brand-400);
}

.tp-cta {
  gap: 0.5rem;
}

.tp-plus {
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 600;
}

.tp-drop-hint {
  margin: 0;
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.95rem;
}

.tp-float {
  position: absolute;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 1rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  z-index: 3;
  background: #fff;
}

.tp-float-left {
  left: 0;
  top: 18%;
  transform: rotate(-8deg);
}

.tp-float-right {
  right: 0;
  bottom: 8%;
  width: 150px;
  height: 150px;
  transform: rotate(7deg);
}

.tp-samples {
  text-align: center;
  margin-top: 2rem;
}

.tp-samples > p {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.tp-sample-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.tp-sample {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 0.75rem;
  overflow: hidden;
  width: 72px;
  height: 72px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}

.tp-sample:hover {
  transform: scale(1.05);
}

.tp-sample img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Split layout */
.tp-hero-split {
  padding-bottom: 2rem;
}

.tp-split {
  display: grid;
  gap: 2rem;
  align-items: center;
  padding-bottom: 2rem;
}

@media (min-width: 900px) {
  .tp-split {
    grid-template-columns: 1fr 1.1fr;
    gap: 3rem;
    min-height: 520px;
  }
}

.tp-split-copy h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.tp-split-copy .tp-lead {
  margin-bottom: 1.5rem;
  max-width: 34rem;
}

.tp-micro {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--gray-400);
}

.tp-split-visual {
  position: relative;
  min-height: 360px;
  border-radius: 1.25rem;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.tp-split-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.08);
}

.tp-split-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  max-width: 360px;
  width: 100%;
}

.tp-split-card-img {
  width: 100%;
  border-radius: 0.75rem;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.tp-video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.tp-video-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.5rem;
}

.tp-split-editor {
  max-width: 48rem;
}

.tp-split-editor .tp-dropzone {
  min-height: 120px;
}

/* Dual compare layout */
.tp-hero-dual {
  padding-bottom: 2rem;
}

.tp-dual-grid {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (min-width: 900px) {
  .tp-dual-grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: stretch;
  }
}

.tp-compare {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  min-height: 320px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  background: var(--gray-100);
  user-select: none;
}

.tp-compare-base,
.tp-compare-after img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 320px;
}

.tp-compare-after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 50% 0 0);
  overflow: hidden;
}

.tp-compare-after img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tp-compare-label {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  background: rgba(17, 24, 39, 0.75);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  z-index: 2;
}

.tp-compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--brand-600);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(80, 70, 229, 0.4);
}

.tp-compare-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 4;
  margin: 0;
}

@media (max-width: 767px) {
  .tp-stage {
    padding: 0;
  }

  .tp-float {
    display: none;
  }

  .tp-title-row:not(.tp-title-row-center) {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}

.tool-card {
  text-decoration: none;
  color: inherit;
}
