/* Thin site scrollbar and the compact "back to top" control with a scroll-progress ring. */
html { scrollbar-width: thin; scrollbar-color: var(--c-lime) var(--c-ink); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--c-ink); }
::-webkit-scrollbar-thumb { background: var(--c-lime-deep); border: 1px solid var(--c-ink); }
::-webkit-scrollbar-thumb:hover { background: var(--c-lime); }

.to-top {
  --to-top-size: 42px;
  --to-top-bg: var(--c-lime);
  --to-top-fg: var(--c-ink);
  position: fixed;
  right: clamp(16px, 2.5vw, 34px);
  bottom: calc(clamp(16px, 2.5vw, 30px) + 82px);
  z-index: 79;
  width: var(--to-top-size);
  height: var(--to-top-size);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--to-top-bg);
  color: var(--to-top-fg);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(.9);
  transition: opacity .25s ease, visibility .25s ease, transform .3s var(--ease-out, ease), background .25s ease, color .25s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.to-top:hover { transform: scale(1.06); }
.to-top--light { --to-top-bg: var(--c-ink); --to-top-fg: var(--c-white); }
.to-top__ring, .to-top__progress { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.to-top__ring { fill: none; stroke: currentColor; stroke-width: 1.5; opacity: .22; }
.to-top__progress { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: butt; stroke-dasharray: 113.1; stroke-dashoffset: 113.1; }
.to-top__arrow { width: 13px; height: 13px; position: relative; z-index: 1; }
body.is-transitioning .to-top, body.site-nav-open .to-top { opacity: 0; visibility: hidden; pointer-events: none; }
@media (max-width: 620px) {
  .to-top { --to-top-size: 38px; bottom: calc(clamp(16px, 2.5vw, 30px) + 74px); }
  .to-top__arrow { width: 12px; height: 12px; }
}

/* Align the back-to-top centre with the support bubble. */
.to-top { right: calc(clamp(16px, 2.5vw, 34px) + 7px); }
@media (max-width: 620px) { .to-top { right: calc(clamp(16px, 2.5vw, 34px) + 6px); } }

/* Eyes stay readable on both bubble variants. */
.support--dark .support__cat-cut { fill: var(--c-white, #fff) !important; }
.support--light .support__cat-cut { fill: var(--c-ink, #080a09) !important; }

/* One button language across the tool pages: logo + the same hover swap. */
.site-btn::before,
.case-action::before,
.shell .btn::before,
#preview .btn::before {
  content: ""; flex: 0 0 auto; width: 14px; height: 13px;
  background: url("../assets/logo.svg") center / contain no-repeat;
  display: inline-block;
}
.site-btn::before { filter: brightness(0); }
.site-btn--outline::before { filter: none; }
.site-btn--outline:hover::before { filter: brightness(0); }
.case-action::before { filter: none; opacity: .9; }
.case-action:hover::before, .case-action.is-active::before { filter: brightness(0); opacity: 1; }
.shell .btn::before, #preview .btn::before { filter: brightness(0); }
.shell .btn--ghost::before { filter: none; }

/* Converter primary buttons use the same lime/white swap as the rest of the site. */
.shell .btn {
  background: var(--c-lime) !important;
  border: 1px solid var(--c-lime) !important;
  color: var(--c-ink) !important;
  font-family: "Jost";
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.shell .btn:hover {
  background: var(--c-white) !important;
  border-color: var(--c-white) !important;
  color: var(--c-ink) !important;
  filter: none;
  transform: translateY(-1px);
}
.shell .btn--ghost {
  background: transparent !important;
  border-color: var(--c-line-strong) !important;
  color: var(--c-text) !important;
}
.shell .btn--ghost:hover {
  background: var(--c-lime) !important;
  border-color: var(--c-lime) !important;
  color: var(--c-ink) !important;
}
.shell .btn--reset {
  background: var(--c-lime) !important;
  border-color: var(--c-lime) !important;
  color: var(--c-ink) !important;
}

/* No sideways drift; fixed badges stay inside the viewport. */
html, body { overflow-x: clip; }
@media (max-width: 900px) {
  .site-actions { margin-left: auto; }
}

.case-mini { display: inline-flex; align-items: center; gap: 5px; }
.case-mini::before {
  content: ""; width: 10px; height: 9px; flex: 0 0 auto;
  background: url("../assets/logo.svg") center / contain no-repeat;
}
.case-mini:hover { background: var(--c-lime); border-color: var(--c-lime); color: var(--c-ink); }
.case-mini:hover::before { filter: brightness(0); }

/* === Shared button language (copied from the player page) =========================
   Two types only: lime primary and outline/dark secondary. Same Jost type, 4px radius,
   same 10px gap and the same white hover swap everywhere. */
.site-btn,
.case-action,
.shell .btn,
#preview .btn {
  min-height: 48px;
  padding: 0 22px;
  gap: 10px;
  border: 1px solid var(--c-lime);
  border-radius: var(--r-2, 4px);
  background: var(--c-lime);
  color: var(--c-ink);
  font: 600 clamp(.68rem, 1.05vw, .82rem)/1 "Jost";
  letter-spacing: .07em;
  text-transform: uppercase;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.site-btn:hover,
.shell .btn:hover,
#preview .btn:hover {
  background: var(--c-white) !important;
  border-color: var(--c-white) !important;
  color: var(--c-ink) !important;
  transform: translateY(-1px);
}
.site-btn--outline,
.case-action {
  background: transparent !important;
  border-color: var(--c-line-strong) !important;
  color: var(--c-text) !important;
}
.site-btn--outline:hover,
.case-action:hover {
  background: var(--c-lime) !important;
  border-color: var(--c-lime) !important;
  color: var(--c-ink) !important;
}
.case-action.is-active {
  background: var(--c-lime) !important;
  border-color: var(--c-lime) !important;
  color: var(--c-ink) !important;
}

/* Logo variants: black/white-eye files, never a flat black silhouette. */
.site-btn::before,
.case-action::before,
.case-mini::before,
.shell .btn::before,
#preview .btn::before {
  content: ""; flex: 0 0 auto; width: 15px; height: 14px;
  background: url("../assets/logo-black.svg") center / contain no-repeat;
  display: inline-block; filter: none;
}
.site-btn--outline::before,
.case-action::before,
.case-mini::before,
.shell .btn--ghost::before {
  background-image: url("../assets/logo.svg");
}
.site-btn--outline:hover::before,
.case-action:hover::before,
.case-action.is-active::before,
.case-mini:hover::before,
.shell .btn--ghost:hover::before {
  background-image: url("../assets/logo-black.svg");
}
.case-mini { min-height: 26px; padding: 0 8px; gap: 6px; font: 500 .56rem/1 "Jost"; border-radius: var(--r-2, 4px); }

/* Player inline marks: match the provided black/white-eye variants. */
.btn--lime, .btn--paper, .btn--outline-dark { --btn-cut: var(--c-white); }
.btn--dark, .btn--ghost { --btn-cut: var(--c-ink); }
.btn--lime:hover, .btn--paper:hover, .btn--outline-dark:hover,
.btn--dark:hover, .btn--ghost:hover { --btn-cut: var(--c-white); }

/* Rebuild the player's primary CTA spacing on the shared pages. */
.site-btn img, .shell .btn img, #preview .btn img { width: 15px; height: 14px; object-fit: contain; }

/* Keep the converter's own button variants from overriding the shared two-type system. */
.shell .btn--reset { background: var(--c-lime) !important; border-color: var(--c-lime) !important; color: var(--c-ink) !important; }

/* Scroll progress lives outside the arrow circle, with a visible gap. */
.to-top { --to-top-ring: #fff; overflow: visible; }
.to-top--light { --to-top-ring: var(--c-ink); }
.to-top__ring, .to-top__progress {
  position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px);
  transform: rotate(-90deg); pointer-events: none; overflow: visible;
  color: var(--to-top-ring);
  transition: color .25s ease;
}
.to-top__ring { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .28; }
.to-top__progress {
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: butt;
  transition: stroke-dashoffset .16s linear, color .25s ease;
}

.to-top__ring, .to-top__progress { max-width: none !important; max-height: none !important; }

.site-btn--outline:hover::before,
.case-action:hover::before,
.case-action.is-active::before,
.case-mini:hover::before { filter: none; }
.case-mini { height: auto; }

.to-top__ring { stroke: var(--to-top-ring) !important; }
.to-top__progress { stroke: var(--to-top-ring) !important; }

/* Single filled button style on dark surfaces. */
.case-action,
.case-mini {
  display: inline-flex; align-items: center; justify-content: flex-start;
  min-height: 48px; padding: 0 18px; gap: 10px;
  background: var(--c-lime) !important;
  border: 1px solid var(--c-lime) !important;
  border-radius: var(--r-2, 4px);
  color: var(--c-ink) !important;
  font: 600 clamp(.68rem, 1.05vw, .82rem)/1 "Jost";
  letter-spacing: .06em; text-transform: uppercase; line-height: 1;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.case-action::before, .case-mini::before { background-image: url("../assets/logo-black.svg") !important; }
.case-action:hover, .case-mini:hover,
.case-action.is-active {
  background: var(--c-white) !important;
  border-color: var(--c-white) !important;
  color: var(--c-ink) !important;
  transform: translateY(-1px);
}
.case-action:hover::before, .case-mini:hover::before,
.case-action.is-active::before { background-image: url("../assets/logo-black.svg") !important; filter: none !important; }
.case-mini { min-height: 30px; height: auto; padding: 0 9px; font-size: .58rem; }
.shell .btn--ghost {
  background: var(--c-lime) !important;
  border-color: var(--c-lime) !important;
  color: var(--c-ink) !important;
}
.shell .btn--ghost::before { background-image: url("../assets/logo-black.svg") !important; }
.shell .btn--ghost:hover {
  background: var(--c-white) !important;
  border-color: var(--c-white) !important;
  color: var(--c-ink) !important;
}

/* On light surfaces the same button becomes black, with a green hover. */
.band--paper .btn, .band--paper-warm .btn, .band--lime .btn,
.band--paper .site-btn, .band--paper-warm .site-btn, .band--lime .site-btn,
.page .btn, .page .site-btn {
  background: var(--c-ink) !important;
  border-color: var(--c-ink) !important;
  color: var(--c-white) !important;
}
.band--paper .btn:hover, .band--paper-warm .btn:hover, .band--lime .btn:hover,
.band--paper .site-btn:hover, .band--paper-warm .site-btn:hover, .band--lime .site-btn:hover,
.page .btn:hover, .page .site-btn:hover {
  background: var(--c-lime) !important;
  border-color: var(--c-lime) !important;
  color: var(--c-ink) !important;
}
.band--paper .site-btn::before, .band--paper-warm .site-btn::before,
.band--lime .site-btn::before, .page .site-btn::before { background-image: url("../assets/logo-white.svg") !important; }
.band--paper .site-btn:hover::before, .band--paper-warm .site-btn:hover::before,
.band--lime .site-btn:hover::before, .page .site-btn:hover::before { background-image: url("../assets/logo-black.svg") !important; filter: none !important; }
.band--paper .btn, .band--paper-warm .btn, .band--lime .btn, .page .btn { --btn-cut: var(--c-ink); }
.band--paper .btn:hover, .band--paper-warm .btn:hover, .band--lime .btn:hover, .page .btn:hover { --btn-cut: var(--c-white); }

.btn--ghost {
  background: var(--c-lime) !important;
  border-color: var(--c-lime) !important;
  color: var(--c-ink) !important;
}
.btn--ghost:hover {
  background: var(--c-white) !important;
  border-color: var(--c-white) !important;
  color: var(--c-ink) !important;
}

.btn--ghost { --btn-cut: var(--c-white); }
.btn--ghost:hover { --btn-cut: var(--c-white); }
.btn--outline-dark { --btn-cut: var(--c-white); }

/* Make the shared buttons match the player CTA metrics, including the icon size. */
.site-btn,
.case-action,
.shell .btn,
#preview .btn {
  min-height: 56px;
  padding: 0 26px;
  gap: 10px;
  justify-content: center;
  font-size: clamp(.68rem, 1.05vw, .82rem);
  line-height: 1;
  white-space: nowrap;
}
.site-btn::before,
.case-action::before,
.shell .btn::before,
#preview .btn::before {
  width: 17px; height: 16px;
  filter: none !important;
}
.site-btn img,
.shell .btn img,
#preview .btn img { width: 17px; height: 16px; }
.case-action { justify-content: center; }
.case-mini::before { width: 12px; height: 11px; filter: none !important; }
@media (max-width: 720px) {
  .site-btn,
  .case-action,
  .shell .btn,
  #preview .btn {
    min-height: 52px;
    padding: 0 17px;
    gap: 8px;
    font-size: clamp(.64rem, 3.1vw, .72rem);
    letter-spacing: .045em;
  }
  .site-btn::before, .case-action::before, .shell .btn::before, #preview .btn::before { width: 15px; height: 14px; }
}

/* Every CTA uses the player's 4px corner radius, including the converter's zero-radius reset. */
.btn, .site-btn, .case-action, .case-mini, .shell .btn, #preview .btn {
  border-radius: var(--r-2, 4px) !important;
}

@media (max-width: 560px) {
  h1, h2, h3 { overflow-wrap: anywhere; }
}
