/* tools.css — /tools/ hub and the tool pages.
 *
 * Self-contained on purpose: these are landing pages, and pulling the whole of
 * search.css (the only other home of the Search Focus slider) to style one
 * control would cost them their first paint. The .search-focus* rules at the
 * bottom are that same control, kept byte-comparable with search.css so the two
 * read alike.
 */

/* ── Page shell ──────────────────────────────────────────────────────────── */
.tool-page {
  padding: 0 0 4rem;
}

.tool-page .container {
  max-width: 980px;
}

.tool-container {
  max-width: 820px !important;
}

/* Demo, then form. One column at every width: the video is the explanation and
   it belongs before the thing it explains. */
.tool-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Hero — same scale as the pricing page: big, centred, tight ─────────── */
.tool-hero {
  padding: 2.25rem 0 2rem;
  text-align: center;
}

.tool-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}
.tool-breadcrumb a { color: var(--color-text-muted); text-decoration: none; }
.tool-breadcrumb a:hover { color: var(--color-text); }

.tool-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 1rem;
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.1);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-hero__title {
  max-width: 20ch;
  margin: 0 auto;
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--color-text);
}

/* Same treatment as .about-hero-content h1 .hero-word-accent — that file is not
   loaded here, and the two must stay the same word-accent, not two of them. */
.tool-hero__title .hero-word-accent {
  background: linear-gradient(135deg, #a78bfa 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tool-hero__lede {
  max-width: 46rem;
  margin: 1.1rem auto 0;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

/* ── The tool card ───────────────────────────────────────────────────────── */
.tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 22px;
  padding: 1.5rem;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

/* Drop zone — the tool itself, so it gets the room. */
.tool-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  padding: 2.75rem 1.25rem 2.25rem;
  border: 1.5px dashed var(--color-border);
  border-radius: 18px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color 180ms, background 180ms;
}
.tool-drop:hover,
.tool-drop:focus-visible,
.tool-drop.is-drag-over {
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(139, 92, 246, 0.06);
  outline: none;
}

.tool-drop__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 0.35rem;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.tool-drop__main {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
}
.tool-drop__meta { font-size: 0.82rem; }

.tool-drop__btn {
  margin-top: 0.6rem;
  padding: 0.62rem 1.4rem;
  border-radius: 999px;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tool-drop__privacy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 0.55rem;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* "or paste a link" — the fallback, and it should read like one. */
.tool-or {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.35rem 0 0.85rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tool-or::before,
.tool-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.tool-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.tool-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 180ms, box-shadow 180ms;
}
.tool-input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.tool-input::placeholder { color: var(--color-text-muted); }

.tool-hint {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin: 0.5rem 0 0;
}

.tool-field { margin-top: 1.25rem; }
.tool-field[hidden] { display: none !important; }

/* ── Preview ─────────────────────────────────────────────────────────────── */
.tool-preview {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1rem;
  padding: 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg);
}
.tool-preview[hidden] { display: none !important; }
.tool-preview__img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--color-surface);
}
.tool-preview__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}
.tool-preview__name {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tool-preview__remove {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
}
.tool-preview__remove:hover { color: var(--color-text); }

/* ── Submit / feedback ───────────────────────────────────────────────────── */
.tool-submit {
  width: 100%;
  margin-top: 1.35rem;
  height: 50px;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.tool-submit__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: tool-spin 700ms linear infinite;
}
.tool-card.is-busy .tool-submit__spinner { display: inline-block; }

@keyframes tool-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .tool-submit__spinner { animation-duration: 2.4s; }
}

.tool-error {
  margin: 1rem 0 0;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  font-size: 0.85rem;
  line-height: 1.5;
}
[data-theme="light"] .tool-error { color: #b91c1c; }

/* ── The demo ────────────────────────────────────────────────────────────── */
.tool-demo { margin: 0; }

.tool-demo__frame {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

/* The slot is sized before a single byte of video has arrived, so nothing
   shifts. Deliberately wider than the source 4:3 (34/25 = 1.36 against 1.333):
   the recording carries a black band baked into its top and bottom edge — 4px
   of 1080 on the current take, measured, not guessed — and `cover` scales the
   frame just past the box so those rows fall outside it. That crops ~2% of the
   height, which is page chrome, and leaves margin for the next re-record. */
.tool-demo__video {
  display: block;
  width: 100%;
  aspect-ratio: 34 / 25;
  object-fit: cover;
  object-position: center;
  background: var(--color-bg);
}

.tool-demo__toggle {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(12, 12, 18, 0.65);
  backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  transition: background 180ms, transform 180ms;
}
.tool-demo__toggle:hover { background: rgba(12, 12, 18, 0.85); transform: scale(1.06); }

.tool-demo__caption {
  margin: 0.85rem 0.2rem 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

/* ── The explainer — one block, made to be read and to be quoted ─────────── */
.tool-explainer {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.25rem 2rem 2rem;
  border: 1px solid var(--color-border);
  border-radius: 22px;
  background: var(--color-surface);
}

.tool-explainer__title {
  font-size: clamp(1.35rem, 2.6vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 auto 1.25rem;
  color: var(--color-text);
  max-width: 24ch;
  text-align: center;
}

.tool-explainer__prose p {
  margin: 0 0 1rem;
  font-size: 0.97rem;
  line-height: 1.75;
  color: var(--color-text-muted);
}
.tool-explainer__prose p:last-child { margin-bottom: 0; }
.tool-explainer__prose strong { color: var(--color-text); font-weight: 600; }

.tool-explainer__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  padding: 1.4rem 0 0;
  margin: 1.4rem 0 0;
  border-top: 1px solid var(--color-border);
}
.tool-explainer__chips li {
  padding: 0.34rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ── Content sections ────────────────────────────────────────────────────── */
.tool-section { margin-top: 3.5rem; }

.tool-section__heading {
  text-align: center;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 1.6rem;
  color: var(--color-text);
}

/* Steps — cards, numbered */
.tool-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.tool-step {
  padding: 1.4rem 1.35rem;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: var(--color-surface);
  transition: border-color 180ms, transform 180ms;
}
.tool-step:hover {
  border-color: rgba(139, 92, 246, 0.35);
  transform: translateY(-2px);
}
.tool-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 0.9rem;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--color-primary);
  font-size: 1.05rem;
  font-weight: 800;
}
.tool-step__title {
  font-size: 0.98rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--color-text);
}
.tool-step__text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* Facts — compact cards */
.tool-facts {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.tool-fact {
  padding: 1.15rem 1.15rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
}
.tool-fact__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 0.7rem;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--color-primary);
}
.tool-fact__title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
  color: var(--color-text);
}
.tool-fact__text {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* FAQ */
.tool-faq {
  display: grid;
  gap: 0.55rem;
  max-width: 780px;
  margin: 0 auto;
}
.tool-faq__item {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  padding: 0.9rem 1.1rem;
}
.tool-faq__item summary {
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
}
.tool-faq__item summary::-webkit-details-marker { display: none; }
.tool-faq__item summary::after {
  content: "+";
  float: right;
  color: var(--color-text-muted);
  font-weight: 400;
}
.tool-faq__item[open] summary::after { content: "\2013"; }
.tool-faq__item p {
  margin: 0.6rem 0 0;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

/* Upsell band */
.tool-upsell {
  text-align: center;
  padding: 2.25rem 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 22px;
  background: linear-gradient(140deg, rgba(139, 92, 246, 0.14), rgba(6, 182, 212, 0.08));
}
.tool-upsell__title {
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.7rem;
  color: var(--color-text);
}
.tool-upsell__text {
  max-width: 52ch;
  margin: 0 auto 1.3rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}
.tool-upsell__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

/* ── /tools/ index ───────────────────────────────────────────────────────── */
.tool-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.tool-card-link {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: var(--color-surface);
  text-decoration: none;
  transition: border-color 180ms, transform 180ms;
}
.tool-card-link:hover {
  border-color: rgba(139, 92, 246, 0.45);
  transform: translateY(-2px);
}
.tool-card-link__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text);
}
.tool-card-link__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-text-muted);
  flex: 1;
}
.tool-card-link__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* ── Search Focus slider — mirrors search.css ────────────────────────────── */
.tool-focus {
  margin-top: 1.35rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--color-border);
}
.tool-focus[hidden] { display: none !important; }

.tool-focus__heading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.6rem;
}

.search-focus { display: flex; flex-direction: column; gap: 8px; }

.search-focus__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: help;
  color: var(--color-text-muted, #71717a);
  opacity: 0.6;
  transition: opacity 180ms;
  position: relative;
}
.search-focus__info:hover { opacity: 1; }
.search-focus__info[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  width: max-content;
  max-width: 260px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
  color: #fff;
  background: rgba(15, 15, 20, 0.95);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
  z-index: 10000;
}
.search-focus__info[data-tooltip]:hover::after,
.search-focus__info[data-tooltip]:focus::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.search-focus__track-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 2px;
}

.search-focus__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 300ms ease, opacity 300ms ease, filter 300ms ease;
  color: var(--color-text-muted, #71717a);
}
.search-focus__icon--image.is-active {
  color: #06b6d4;
  transform: scale(1.25);
  filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.5));
}
.search-focus__icon--image.is-faded { transform: scale(0.85); opacity: 0.4; }
.search-focus__icon--text.is-active {
  color: #f59e0b;
  transform: scale(1.25);
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.5));
}
.search-focus__icon--text.is-faded { transform: scale(0.85); opacity: 0.4; }

.search-focus__slider-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-focus__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(to right, #06b6d4, #6366f1 50%, #f59e0b);
}
.search-focus__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--color-primary, #8b5cf6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: box-shadow 150ms ease, transform 150ms ease;
}
.search-focus__slider::-webkit-slider-thumb:hover {
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.5);
  transform: scale(1.1);
}
.search-focus__slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--color-primary, #8b5cf6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.search-focus__slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #06b6d4, #6366f1 50%, #f59e0b);
}

.search-focus__notch {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 14px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  pointer-events: none;
}

.search-focus__label {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted, #71717a);
  transition: color 200ms;
  min-height: 1.2em;
}

/* ── Small screens ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .tool-hero { padding-top: 1.5rem; }
  .tool-card { padding: 1.1rem; border-radius: 18px; }
  .tool-drop { padding: 2rem 1rem 1.75rem; }
  .tool-drop__main { font-size: 1.02rem; }
  .tool-section { margin-top: 2.5rem; }
  .tool-explainer { padding: 1.5rem 1.2rem 1.4rem; border-radius: 18px; }
  .tool-demo__frame { border-radius: 18px; }
}
