/* ============================================================
   BackTheme — Components
   Load order: 1 tokens > 2 base > [3 components] > 4 mockups > 5 sections

   Reusable pieces that appear on more than one page. Anything used by
   a single section lives in backtheme-sections.css instead.

   Contents
     1. Header, logo, primary nav
     2. Colour-mode toggle (.backtheme-mode-toggle, .backtheme-mode-row)
     3. Mobile menu trigger and drawer
     4. Buttons and arrow links
     5. Chips, badges, announcement pill
     6. Card (gradient hairline border) and icon tile
     7. Check / dash lists
     8. Accordion
     9. Filter tabs
    10. Form controls
    11. Footer
    12. Scroll progress and back-to-top
   ============================================================ */

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */

.backtheme-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--backtheme-z-header);
  height: var(--backtheme-header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition:
    background-color var(--backtheme-dur-base) var(--backtheme-ease-out),
    border-color var(--backtheme-dur-base) var(--backtheme-ease-out),
    transform var(--backtheme-dur-base) var(--backtheme-ease-out);
}

.backtheme-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--backtheme-glass);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  opacity: 0;
  transition: opacity var(--backtheme-dur-base) var(--backtheme-ease-out);
}

.backtheme-header.is-stuck { border-bottom-color: var(--backtheme-line); }
.backtheme-header.is-stuck::before { opacity: 1; }
.backtheme-header.is-hidden { transform: translateY(-100%); }

.backtheme-header__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--backtheme-container-wide);
  margin-inline: auto;
  padding-inline: var(--backtheme-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--backtheme-space-s);
}

/* ---------- Logo ---------- */
.backtheme-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  border-radius: var(--backtheme-r-sm);
}

.backtheme-logo__mark {
  width: 28px;
  height: 28px;
  flex: none;
  transition: transform var(--backtheme-dur-base) var(--backtheme-ease-spring);
}

.backtheme-logo:hover .backtheme-logo__mark { transform: rotate(-6deg) scale(1.06); }

.backtheme-logo__text {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.032em;
  color: var(--backtheme-fg);
}

.backtheme-logo__text span { color: var(--backtheme-brand-ink); }

/* ---------- Desktop nav ---------- */
.backtheme-nav { display: none; }

@media (min-width: 1060px) {
  .backtheme-nav { display: flex; align-items: center; gap: 2px; }
}

.backtheme-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 13px;
  font-size: var(--backtheme-step--1);
  font-weight: 500;
  color: var(--backtheme-fg-muted);
  border-radius: var(--backtheme-r-sm);
  transition: color var(--backtheme-dur-fast) var(--backtheme-ease-out), background-color var(--backtheme-dur-fast) var(--backtheme-ease-out);
}

.backtheme-nav__link:hover {
  color: var(--backtheme-fg);
  background: light-dark(rgba(10,15,26,.045), rgba(255,255,255,.04));
}

.backtheme-nav__link[aria-current="page"] { color: var(--backtheme-fg); }

.backtheme-nav__link[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 13px; right: 13px; bottom: 1px;
  height: 2px;
  border-radius: var(--backtheme-r-full);
  background: var(--backtheme-brand-500);
}

.backtheme-header__actions { display: flex; align-items: center; gap: var(--backtheme-space-2xs); }

/* Specificity note: `.backtheme-button` sets display:inline-flex further down this file.
   These rules are compounded so the header CTA still hides on small screens. */
.backtheme-header__cta.backtheme-button { display: none; }

@media (min-width: 1060px) {
  .backtheme-header__cta.backtheme-button { display: inline-flex; }
}

/* ------------------------------------------------------------
   Mode toggle — one button, cycling dark -> light -> auto

   All three icons live in the DOM stacked in a single grid cell;
   `data-mode` on the button decides which one is visible, so the
   change cross-fades instead of swapping markup.
   ------------------------------------------------------------ */

.backtheme-mode-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--backtheme-r-full);
  color: var(--backtheme-fg-muted);
  background: var(--backtheme-surface-1);
  border: 1px solid var(--backtheme-line);
  transition:
    color var(--backtheme-dur-fast) var(--backtheme-ease-out),
    border-color var(--backtheme-dur-base) var(--backtheme-ease-out),
    background-color var(--backtheme-dur-base) var(--backtheme-ease-out),
    transform var(--backtheme-dur-base) var(--backtheme-ease-spring);
}

.backtheme-mode-toggle:hover {
  color: var(--backtheme-brand-ink);
  border-color: var(--backtheme-line-brand);
  transform: translateY(-1px);
}

.backtheme-mode-toggle:active { transform: translateY(0) scale(.94); }

.backtheme-mode-toggle__icon {
  grid-area: 1 / 1;          /* stack every icon in the same cell */
  width: 17px;
  height: 17px;
  opacity: 0;
  transform: scale(.5) rotate(-60deg);
  transition:
    opacity var(--backtheme-dur-base) var(--backtheme-ease-out),
    transform var(--backtheme-dur-slow) var(--backtheme-ease-spring);
}

.backtheme-mode-toggle[data-mode="dark"]  .backtheme-mode-toggle__icon--dark,
.backtheme-mode-toggle[data-mode="light"] .backtheme-mode-toggle__icon--light,
.backtheme-mode-toggle[data-mode="auto"]  .backtheme-mode-toggle__icon--auto {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* Drawer variant — same button, with the current mode spelled out. */
.backtheme-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--backtheme-space-s);
  padding: 10px 10px 10px 16px;
  background: var(--backtheme-surface-1);
  border: 1px solid var(--backtheme-line);
  border-radius: var(--backtheme-r-md);
}

.backtheme-mode-row__label { font-size: var(--backtheme-step--1); font-weight: 500; color: var(--backtheme-fg-muted); }

.backtheme-mode-row__value {
  display: flex;
  align-items: center;
  gap: var(--backtheme-space-2xs);
  font-size: var(--backtheme-step--1);
  font-weight: 600;
  color: var(--backtheme-fg);
}

.backtheme-mode-row .backtheme-mode-toggle { width: 40px; height: 40px; }

/* ---------- Mobile menu trigger ---------- */
.backtheme-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-right: -9px;
  border-radius: var(--backtheme-r-sm);
  color: var(--backtheme-fg);
  transition: background-color var(--backtheme-dur-fast) var(--backtheme-ease-out);
}

.backtheme-menu-toggle:hover { background: light-dark(rgba(10,15,26,.05), rgba(255,255,255,.05)); }

@media (min-width: 1060px) { .backtheme-menu-toggle { display: none; } }

.backtheme-menu-toggle__bars { position: relative; width: 19px; height: 13px; }

.backtheme-menu-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--backtheme-dur-base) var(--backtheme-ease-out), opacity var(--backtheme-dur-fast) var(--backtheme-ease-out);
}

.backtheme-menu-toggle__bars span:nth-child(1) { top: 0; }
.backtheme-menu-toggle__bars span:nth-child(2) { top: 5.5px; }
.backtheme-menu-toggle__bars span:nth-child(3) { top: 11px; }

.backtheme-menu-toggle[aria-expanded="true"] .backtheme-menu-toggle__bars span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.backtheme-menu-toggle[aria-expanded="true"] .backtheme-menu-toggle__bars span:nth-child(2) { opacity: 0; transform: scaleX(.4); }
.backtheme-menu-toggle[aria-expanded="true"] .backtheme-menu-toggle__bars span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ------------------------------------------------------------
   Mobile drawer
   ------------------------------------------------------------ */

.backtheme-drawer {
  position: fixed;
  inset: 0;
  /* Below the header on purpose: the logo stays visible and the menu
     button stays clickable to close the drawer. */
  z-index: var(--backtheme-z-drawer);
  display: flex;
  flex-direction: column;
  background: var(--backtheme-bg);
  padding-top: var(--backtheme-header-h);
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--backtheme-dur-base) var(--backtheme-ease-out), visibility 0s linear var(--backtheme-dur-base);
}

.backtheme-drawer.is-open { visibility: visible; opacity: 1; transition-delay: 0s; }

@media (min-width: 1060px) { .backtheme-drawer { display: none; } }

.backtheme-drawer__glow {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  aspect-ratio: 1;
  background: radial-gradient(circle, var(--backtheme-glow-brand) 0%, transparent 65%);
  opacity: .55;
  pointer-events: none;
}

.backtheme-drawer__inner {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--backtheme-space-l);
  padding: var(--backtheme-space-l) var(--backtheme-gutter) calc(var(--backtheme-space-l) + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.backtheme-drawer__nav { display: flex; flex-direction: column; }

.backtheme-drawer__link {
  --i: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--backtheme-space-s);
  padding: var(--backtheme-space-s) 0;
  font-size: var(--backtheme-step-3);
  font-weight: 600;
  letter-spacing: var(--backtheme-tracking-tight);
  color: var(--backtheme-fg);
  border-bottom: 1px solid var(--backtheme-line);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--backtheme-dur-slow) var(--backtheme-ease-out),
    transform var(--backtheme-dur-slow) var(--backtheme-ease-out),
    color var(--backtheme-dur-fast) var(--backtheme-ease-out);
}

.backtheme-drawer.is-open .backtheme-drawer__link {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(80ms + var(--i) * 55ms);
}

.backtheme-drawer__link:active,
.backtheme-drawer__link[aria-current="page"] { color: var(--backtheme-brand-ink); }

.backtheme-drawer__index {
  font-family: var(--backtheme-font-mono);
  font-size: var(--backtheme-step--2);
  color: var(--backtheme-fg-subtle);
  letter-spacing: var(--backtheme-tracking-wide);
}

.backtheme-drawer__foot {
  display: flex;
  flex-direction: column;
  gap: var(--backtheme-space-s);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--backtheme-dur-slow) var(--backtheme-ease-out), transform var(--backtheme-dur-slow) var(--backtheme-ease-out);
}

.backtheme-drawer.is-open .backtheme-drawer__foot { opacity: 1; transform: translateY(0); transition-delay: 420ms; }

.backtheme-drawer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--backtheme-space-xs) var(--backtheme-space-m);
  font-size: var(--backtheme-step--1);
  color: var(--backtheme-fg-muted);
}

.backtheme-drawer__meta a:hover { color: var(--backtheme-brand-ink); }

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.backtheme-button {
  --backtheme-button-bg: transparent;
  --backtheme-button-fg: var(--backtheme-fg);
  --backtheme-button-border: var(--backtheme-line-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 21px;
  min-height: 44px;
  font-size: var(--backtheme-step--1);
  font-weight: 600;
  letter-spacing: -0.008em;
  color: var(--backtheme-button-fg);
  background: var(--backtheme-button-bg);
  border: 1px solid var(--backtheme-button-border);
  border-radius: var(--backtheme-r-full);
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition:
    transform var(--backtheme-dur-base) var(--backtheme-ease-spring),
    box-shadow var(--backtheme-dur-base) var(--backtheme-ease-out),
    border-color var(--backtheme-dur-base) var(--backtheme-ease-out),
    background-color var(--backtheme-dur-base) var(--backtheme-ease-out),
    color var(--backtheme-dur-base) var(--backtheme-ease-out);
}

.backtheme-button:hover { transform: translateY(-2px); }
.backtheme-button:active { transform: translateY(0) scale(.985); }

.backtheme-button__icon { flex: none; width: 15px; height: 15px; transition: transform var(--backtheme-dur-base) var(--backtheme-ease-out); }
.backtheme-button:hover .backtheme-button__icon { transform: translateX(3px); }

.backtheme-button--primary {
  --backtheme-button-fg: var(--backtheme-on-brand);
  --backtheme-button-border: transparent;
  background: var(--backtheme-grad-brand);
  box-shadow: var(--backtheme-shadow-brand);
}

.backtheme-button--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, transparent 20%, light-dark(rgba(255,255,255,.3), rgba(255,255,255,.55)) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform var(--backtheme-dur-slower) var(--backtheme-ease-out);
}

.backtheme-button--primary:hover::before { transform: translateX(120%); }
.backtheme-button--primary:hover { box-shadow: 0 22px 52px -14px light-dark(rgba(0,100,170,.45), rgba(0,163,255,.62)); }

.backtheme-button--secondary {
  --backtheme-button-bg: light-dark(rgba(255,255,255,.7), rgba(255,255,255,.035));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.backtheme-button--secondary:hover {
  --backtheme-button-bg: light-dark(#FFFFFF, rgba(255,255,255,.075));
  --backtheme-button-border: var(--backtheme-line-brand);
  box-shadow: var(--backtheme-shadow-md);
}

.backtheme-button--ghost { --backtheme-button-border: transparent; --backtheme-button-fg: var(--backtheme-fg-muted); padding-inline: 14px; }
.backtheme-button--ghost:hover { --backtheme-button-fg: var(--backtheme-fg); --backtheme-button-bg: light-dark(rgba(10,15,26,.05), rgba(255,255,255,.05)); }

.backtheme-button--small { padding: 8px 15px; min-height: 36px; font-size: var(--backtheme-step--2); }
.backtheme-button--large { padding: 15px 28px; min-height: 52px; font-size: var(--backtheme-step-0); }
.backtheme-button--block { width: 100%; }

.backtheme-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--backtheme-step--1);
  font-weight: 600;
  color: var(--backtheme-brand-ink);
  transition: color var(--backtheme-dur-fast) var(--backtheme-ease-out), gap var(--backtheme-dur-base) var(--backtheme-ease-out);
}

.backtheme-link-arrow:hover { gap: 11px; }
.backtheme-link-arrow svg { width: 15px; height: 15px; flex: none; }

/* ------------------------------------------------------------
   Chips / badges
   ------------------------------------------------------------ */

.backtheme-chip {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 7px;
  padding: 6px 13px;
  font-size: var(--backtheme-step--2);
  font-weight: 500;
  color: var(--backtheme-fg-muted);
  background: var(--backtheme-surface-1);
  border: 1px solid var(--backtheme-line);
  border-radius: var(--backtheme-r-full);
  transition: all var(--backtheme-dur-base) var(--backtheme-ease-out);
}

.backtheme-chip:hover {
  color: var(--backtheme-fg);
  border-color: var(--backtheme-line-brand);
  box-shadow: var(--backtheme-shadow-sm);
}

.backtheme-chip__dot { width: 5px; height: 5px; border-radius: var(--backtheme-r-full); background: var(--backtheme-brand-500); flex: none; }
.backtheme-chip--static { pointer-events: none; }

.backtheme-chip--tech {
  font-family: var(--backtheme-font-mono);
  letter-spacing: 0;
  padding: 5px 10px;
  border-radius: var(--backtheme-r-xs);
  background: var(--backtheme-surface-2);
}

.backtheme-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-family: var(--backtheme-font-mono);
  font-size: var(--backtheme-step--2);
  font-weight: 500;
  letter-spacing: var(--backtheme-tracking-wide);
  color: var(--backtheme-brand-ink);
  background: light-dark(rgba(0,113,189,.07), rgba(0,163,255,.09));
  border: 1px solid var(--backtheme-line-brand);
  border-radius: var(--backtheme-r-full);
  align-self: flex-start;   /* stop it stretching in flex-column parents */
  white-space: nowrap;      /* a two-line badge reads as a broken label */
  flex: none;
}

.backtheme-badge--neutral { color: var(--backtheme-fg-muted); background: var(--backtheme-surface-2); border-color: var(--backtheme-line); }

/* Announcement pill — sits above the hero headline. */
.backtheme-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px 5px 5px;
  font-size: var(--backtheme-step--1);
  white-space: nowrap;      /* a wrapped pill reads as a broken chip */
  max-width: 100%;
  font-weight: 500;
  color: var(--backtheme-fg-muted);
  background: var(--backtheme-surface-1);
  border: 1px solid var(--backtheme-line);
  border-radius: var(--backtheme-r-full);
  box-shadow: var(--backtheme-shadow-sm);
  transition: all var(--backtheme-dur-base) var(--backtheme-ease-out);
  align-self: flex-start;
}

.backtheme-pill:hover { border-color: var(--backtheme-line-brand); transform: translateY(-1px); box-shadow: var(--backtheme-shadow-md); }

.backtheme-pill__tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-family: var(--backtheme-font-mono);
  font-size: var(--backtheme-step--2);
  font-weight: 500;
  letter-spacing: var(--backtheme-tracking-wide);
  color: var(--backtheme-on-brand);
  background: var(--backtheme-grad-brand);
  border-radius: var(--backtheme-r-full);
}

.backtheme-pill__arrow { width: 14px; height: 14px; margin-right: 6px; flex: none; color: var(--backtheme-fg-subtle); transition: transform var(--backtheme-dur-base) var(--backtheme-ease-out); }
.backtheme-pill:hover .backtheme-pill__arrow { transform: translateX(2px); }

/* The full label needs ~420px to sit on one line. Below that a shorter
   wording keeps it to a single line rather than letting it wrap. */
.backtheme-pill__short { display: inline; }
.backtheme-pill__long  { display: none; }

@media (min-width: 560px) {
  .backtheme-pill__short { display: none; }
  .backtheme-pill__long  { display: inline; }
}

@media (max-width: 559px) {
  .backtheme-pill { font-size: var(--backtheme-step--2); gap: 7px; }
  .backtheme-pill__tag { padding: 3px 8px; }
}

/* ------------------------------------------------------------
   Card
   A gradient hairline border painted with mask-composite, so the
   edge catches light at the top and fades out at the bottom. This
   is what separates a "real" surface from a flat 1px box.
   ------------------------------------------------------------ */

.backtheme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--backtheme-space-s);
  padding: var(--backtheme-space-m);
  background: var(--backtheme-surface-1);
  border-radius: var(--backtheme-r-lg);
  isolation: isolate;
  transition:
    transform var(--backtheme-dur-slow) var(--backtheme-ease-out),
    box-shadow var(--backtheme-dur-slow) var(--backtheme-ease-out),
    background-color var(--backtheme-dur-slow) var(--backtheme-ease-out);
}

/* The border itself. */
.backtheme-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    160deg,
    light-dark(rgba(10,15,26,.14), rgba(255,255,255,.16)) 0%,
    var(--backtheme-line) 38%,
    var(--backtheme-line) 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  pointer-events: none;
  transition: background var(--backtheme-dur-slow) var(--backtheme-ease-out);
}

/* Inner sheen. */
.backtheme-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--backtheme-grad-card);
  opacity: .8;
  pointer-events: none;
}

.backtheme-card--lift:hover { transform: translateY(-5px); box-shadow: var(--backtheme-shadow-lg); }

.backtheme-card--lift:hover::before {
  background: linear-gradient(
    160deg,
    light-dark(rgba(0,113,189,.45), rgba(0,163,255,.5)) 0%,
    var(--backtheme-line-brand) 40%,
    var(--backtheme-line) 100%
  );
}

/* Cursor-tracking spotlight, driven by --mx / --my from JS. */
.backtheme-card--spot > .backtheme-card__spot {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(
    300px circle at var(--mx, 50%) var(--my, 0%),
    light-dark(rgba(0,140,220,.08), rgba(0, 163, 255, .16)),
    transparent 62%
  );
  opacity: 0;
  transition: opacity var(--backtheme-dur-slow) var(--backtheme-ease-out);
  pointer-events: none;
}

.backtheme-card--spot:hover > .backtheme-card__spot { opacity: 1; }

.backtheme-card--pad-large { padding: var(--backtheme-space-l); }
.backtheme-card--flush { padding: 0; overflow: hidden; }

.backtheme-card__title { font-size: var(--backtheme-step-2); letter-spacing: var(--backtheme-tracking-tight); }
.backtheme-card__subtitle { font-size: var(--backtheme-step--1); font-weight: 500; color: var(--backtheme-brand-ink); }
.backtheme-card__body { color: var(--backtheme-fg-muted); font-size: var(--backtheme-step-0); line-height: var(--backtheme-lh-relaxed); }

/* ------------------------------------------------------------
   Icon tile
   Duotone icons need a substantial plate to sit on, not a flat square.
   ------------------------------------------------------------ */

.backtheme-icon-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: var(--backtheme-r-md);
  color: var(--backtheme-brand-ink);
  /* Built from light-dark() colour STOPS: the function takes colours,
     not whole gradients. */
  background: linear-gradient(150deg,
    light-dark(#EAF6FF, rgba(0,163,255,.16)) 0%,
    light-dark(#F4FAFF, rgba(0,163,255,.05)) 100%);
  box-shadow: inset 0 0 0 1px var(--backtheme-line-brand),
              inset 0 1px 0 light-dark(rgba(255,255,255,.9), rgba(255,255,255,.08));
  transition: all var(--backtheme-dur-slow) var(--backtheme-ease-out);
}

.backtheme-icon-tile svg { width: 24px; height: 24px; }

.backtheme-icon-tile--large { width: 54px; height: 54px; border-radius: var(--backtheme-r-lg); }
.backtheme-icon-tile--large svg { width: 27px; height: 27px; }

.backtheme-card:hover .backtheme-icon-tile,
.backtheme-industry-row:hover .backtheme-icon-tile,
.backtheme-industry-row.is-active .backtheme-icon-tile {
  color: var(--backtheme-on-brand);
  background: var(--backtheme-grad-brand);
  box-shadow: 0 10px 24px -8px light-dark(rgba(0,100,170,.4), rgba(0,163,255,.55));
  transform: translateY(-1px);
}

/* Duotone icon internals. Every symbol paints its solid mass through
   `.backtheme-icon-fill` and its detail through `.backtheme-icon-line`, both inheriting
   currentColor so one property drives the whole icon. */
.backtheme-icon-fill { fill: currentColor; opacity: .22; }
.backtheme-icon-line { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.backtheme-icon-dot  { fill: currentColor; }

/* ------------------------------------------------------------
   Lists
   ------------------------------------------------------------ */

.backtheme-check-list { display: grid; gap: var(--backtheme-space-xs); }
.backtheme-check-list--two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 480px) { .backtheme-check-list--two-column { grid-template-columns: 1fr; } }

.backtheme-check-list li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: var(--backtheme-step--1);
  color: var(--backtheme-fg-muted);
  line-height: 1.5;
}

.backtheme-check-list li::before {
  content: '';
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: var(--backtheme-r-full);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230071BD' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
    center / 11px no-repeat,
    light-dark(rgba(0,113,189,.1), rgba(0,163,255,.12));
  box-shadow: inset 0 0 0 1px var(--backtheme-line-brand);
}

/* The tick is a baked-in SVG, so dark mode needs its own brighter copy. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .backtheme-check-list li::before {
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366C8FF' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
      center / 11px no-repeat,
      rgba(0,163,255,.12);
  }
}

:root[data-theme="dark"] .backtheme-check-list li::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366C8FF' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
    center / 11px no-repeat,
    rgba(0,163,255,.12);
}

.backtheme-dash-list { display: grid; gap: 9px; }

.backtheme-dash-list li {
  position: relative;
  padding-left: 18px;
  font-size: var(--backtheme-step--1);
  color: var(--backtheme-fg-muted);
}

.backtheme-dash-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .72em;
  width: 8px;
  height: 1px;
  background: var(--backtheme-fg-subtle);
}

/* ------------------------------------------------------------
   Accordion (FAQ)
   ------------------------------------------------------------ */

.backtheme-accordion { display: grid; gap: var(--backtheme-space-2xs); }

.backtheme-accordion-item {
  background: var(--backtheme-surface-1);
  border: 1px solid var(--backtheme-line);
  border-radius: var(--backtheme-r-md);
  overflow: hidden;
  transition: border-color var(--backtheme-dur-base) var(--backtheme-ease-out), background-color var(--backtheme-dur-base) var(--backtheme-ease-out);
}

.backtheme-accordion-item:hover { border-color: var(--backtheme-line-strong); }
.backtheme-accordion-item.is-open { border-color: var(--backtheme-line-brand); background: var(--backtheme-surface-2); }

.backtheme-accordion-item__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--backtheme-space-s);
  width: 100%;
  padding: var(--backtheme-space-s) var(--backtheme-space-m);
  text-align: left;
  font-size: var(--backtheme-step-0);
  font-weight: 600;
  letter-spacing: var(--backtheme-tracking-tight);
  color: var(--backtheme-fg);
  min-height: 62px;
}

.backtheme-accordion-item__icon {
  position: relative;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: var(--backtheme-r-full);
  border: 1px solid var(--backtheme-line-strong);
  transition: all var(--backtheme-dur-base) var(--backtheme-ease-out);
}

.backtheme-accordion-item__icon::before, .backtheme-accordion-item__icon::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 9px; height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: transform var(--backtheme-dur-base) var(--backtheme-ease-out), opacity var(--backtheme-dur-fast) var(--backtheme-ease-out);
}

.backtheme-accordion-item__icon::after { transform: translate(-50%, -50%) rotate(90deg); }

.backtheme-accordion-item.is-open .backtheme-accordion-item__icon {
  color: var(--backtheme-on-brand);
  background: var(--backtheme-brand-500);
  border-color: transparent;
  transform: rotate(180deg);
}

.backtheme-accordion-item.is-open .backtheme-accordion-item__icon::after { opacity: 0; transform: translate(-50%, -50%) rotate(0deg); }

.backtheme-accordion-item__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--backtheme-dur-slow) var(--backtheme-ease-out); }
.backtheme-accordion-item.is-open .backtheme-accordion-item__panel { grid-template-rows: 1fr; }
.backtheme-accordion-item__panel > div { overflow: hidden; }

.backtheme-accordion-item__body {
  padding: 0 var(--backtheme-space-m) var(--backtheme-space-m);
  color: var(--backtheme-fg-muted);
  line-height: var(--backtheme-lh-relaxed);
  max-width: 68ch;
}

/* ------------------------------------------------------------
   Filter tabs
   ------------------------------------------------------------ */

.backtheme-filters {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--backtheme-surface-2);
  border: 1px solid var(--backtheme-line);
  border-radius: var(--backtheme-r-full);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;   /* allow the scroll container to be narrower than its tabs */
}

.backtheme-filters::-webkit-scrollbar { display: none; }

/* Scrolling tabs that stop dead at the gutter look clipped. Let the
   strip run to the viewport edges and fade out, so it reads as more
   content rather than a cut-off box. */
@media (max-width: 1199px) {
  .backtheme-filters {
    margin-inline: calc(var(--backtheme-gutter) * -1);
    padding-inline: var(--backtheme-gutter);
    border: 0;
    background: none;
    border-radius: 0;
    mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent 100%);
    scroll-padding-inline: var(--backtheme-gutter);
  }

  .backtheme-filters__button {
    background: var(--backtheme-surface-2);
    box-shadow: inset 0 0 0 1px var(--backtheme-line);
  }

  .backtheme-filters__button[aria-selected="true"] { box-shadow: 0 6px 18px -6px light-dark(rgba(0,100,170,.4), rgba(0,163,255,.5)); }
}

.backtheme-filters__button {
  flex: none;
  padding: 9px 17px;
  font-size: var(--backtheme-step--1);
  font-weight: 500;
  color: var(--backtheme-fg-muted);
  border-radius: var(--backtheme-r-full);
  white-space: nowrap;
  transition: color var(--backtheme-dur-fast) var(--backtheme-ease-out), background-color var(--backtheme-dur-base) var(--backtheme-ease-out);
}

.backtheme-filters__button:hover { color: var(--backtheme-fg); }

.backtheme-filters__button[aria-selected="true"] {
  color: var(--backtheme-on-brand);
  background: var(--backtheme-grad-brand);
  box-shadow: 0 6px 18px -6px light-dark(rgba(0,100,170,.4), rgba(0,163,255,.5));
}

/* ------------------------------------------------------------
   Forms
   ------------------------------------------------------------ */

.backtheme-field { display: flex; flex-direction: column; gap: 7px; }
.backtheme-field__label { font-size: var(--backtheme-step--1); font-weight: 500; color: var(--backtheme-fg); }
.backtheme-field__label .backtheme-field__required { color: var(--backtheme-brand-ink); }
.backtheme-field__hint { font-size: var(--backtheme-step--2); color: var(--backtheme-fg-subtle); }

.backtheme-input, .backtheme-textarea, .backtheme-select {
  width: 100%;
  padding: 13px 16px;
  min-height: 50px;
  font-size: var(--backtheme-step-0);
  color: var(--backtheme-fg);
  background: light-dark(var(--backtheme-surface-2), var(--backtheme-surface-1));
  border: 1px solid var(--backtheme-line-strong);
  border-radius: var(--backtheme-r-md);
  transition:
    border-color var(--backtheme-dur-base) var(--backtheme-ease-out),
    box-shadow var(--backtheme-dur-base) var(--backtheme-ease-out),
    background-color var(--backtheme-dur-base) var(--backtheme-ease-out);
  appearance: none;
}

.backtheme-input::placeholder, .backtheme-textarea::placeholder { color: var(--backtheme-fg-subtle); }
.backtheme-input:hover, .backtheme-textarea:hover, .backtheme-select:hover { border-color: light-dark(rgba(10,15,26,.28), rgba(255,255,255,.22)); }

.backtheme-input:focus, .backtheme-textarea:focus, .backtheme-select:focus {
  outline: none;
  background: light-dark(#FFFFFF, var(--backtheme-surface-2));
  border-color: var(--backtheme-brand-500);
  box-shadow: var(--backtheme-ring-brand);
}

.backtheme-textarea { min-height: 150px; resize: vertical; line-height: var(--backtheme-lh-normal); }

.backtheme-select {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23808A9B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 18px;
  cursor: pointer;
}

.backtheme-field.has-error .backtheme-input,
.backtheme-field.has-error .backtheme-textarea,
.backtheme-field.has-error .backtheme-select {
  border-color: var(--backtheme-danger);
  box-shadow: 0 0 0 4px light-dark(rgba(196,52,74,.1), rgba(255,90,90,.12));
}

.backtheme-field__error { display: none; align-items: center; gap: 6px; font-size: var(--backtheme-step--2); color: var(--backtheme-danger); }
.backtheme-field.has-error .backtheme-field__error { display: flex; }

.backtheme-honeypot { position: absolute !important; left: -9999px; opacity: 0; pointer-events: none; }

.backtheme-form-success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--backtheme-space-s);
  text-align: center;
  padding: var(--backtheme-space-xl) var(--backtheme-space-m);
}

.backtheme-form-success.is-shown { display: flex; }

.backtheme-form-success__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--backtheme-r-full);
  color: var(--backtheme-success);
  background: var(--backtheme-success-bg);
  border: 1px solid var(--backtheme-success-line);
}

.backtheme-form-success__icon svg { width: 30px; height: 30px; }

/* ------------------------------------------------------------
   Pagination

   Used at the foot of the blog listing. Every control is a real
   anchor, so paging still works with JavaScript disabled; the
   current page carries both aria-current and .is-current, and
   the disabled arrow is inert via aria-disabled + tabindex="-1"
   rather than being removed, so the row keeps its shape.
   ------------------------------------------------------------ */

.backtheme-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--backtheme-space-2xs);
  margin-top: var(--backtheme-space-2xl);
}

.backtheme-pagination__list { display: flex; align-items: center; gap: 5px; }

.backtheme-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  height: 44px;
  padding-inline: 14px;
  font-size: var(--backtheme-step--1);
  font-weight: 600;
  color: var(--backtheme-fg-muted);
  background: var(--backtheme-surface-1);
  border: 1px solid var(--backtheme-line);
  border-radius: var(--backtheme-r-md);
  transition:
    color var(--backtheme-dur-fast) var(--backtheme-ease-out),
    border-color var(--backtheme-dur-base) var(--backtheme-ease-out),
    background-color var(--backtheme-dur-base) var(--backtheme-ease-out),
    transform var(--backtheme-dur-base) var(--backtheme-ease-spring),
    box-shadow var(--backtheme-dur-base) var(--backtheme-ease-out);
}

.backtheme-pagination__link:hover {
  color: var(--backtheme-fg);
  border-color: var(--backtheme-line-brand);
  transform: translateY(-2px);
  box-shadow: var(--backtheme-shadow-md);
}

.backtheme-pagination__link svg { width: 15px; height: 15px; flex: none; }
.backtheme-pagination__link--prev svg { transform: rotate(180deg); }

.backtheme-pagination__link.is-current {
  color: var(--backtheme-on-brand);
  background: var(--backtheme-grad-brand);
  border-color: transparent;
  box-shadow: 0 8px 20px -8px light-dark(rgba(0,100,170,.45), rgba(0,163,255,.5));
}

.backtheme-pagination__link.is-current:hover { transform: none; }

.backtheme-pagination__link[aria-disabled="true"] {
  opacity: .4;
  pointer-events: none;
}

/* On a phone the arrows keep their icon and drop the word, so the whole
   control stays on one row instead of wrapping under the numbers. */
@media (max-width: 600px) {
  .backtheme-pagination__label { display: none; }
  .backtheme-pagination__link { min-width: 42px; height: 42px; padding-inline: 12px; }
  .backtheme-pagination__list { gap: 4px; }
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */

.backtheme-footer {
  position: relative;
  padding-top: var(--backtheme-space-3xl);
  padding-bottom: calc(var(--backtheme-space-l) + env(safe-area-inset-bottom));
  background: var(--backtheme-bg-subtle);
  border-top: 1px solid var(--backtheme-line);
  overflow: hidden;
}

.backtheme-footer__grid { display: grid; gap: var(--backtheme-space-xl); grid-template-columns: 1fr; padding-bottom: var(--backtheme-space-xl); }

@media (min-width: 680px) { .backtheme-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .backtheme-footer__grid { grid-template-columns: 1.6fr repeat(3, 1fr); gap: var(--backtheme-space-l); } }

.backtheme-footer__brand { display: flex; flex-direction: column; gap: var(--backtheme-space-s); max-width: 38ch; }

.backtheme-footer__column-title {
  font-size: var(--backtheme-step--2);
  font-family: var(--backtheme-font-mono);
  font-weight: 500;
  letter-spacing: var(--backtheme-tracking-widest);
  text-transform: uppercase;
  color: var(--backtheme-fg-subtle);
  margin-bottom: var(--backtheme-space-s);
}

.backtheme-footer__links { display: grid; gap: 11px; }

.backtheme-footer__links a {
  font-size: var(--backtheme-step--1);
  color: var(--backtheme-fg-muted);
  transition: color var(--backtheme-dur-fast) var(--backtheme-ease-out), transform var(--backtheme-dur-base) var(--backtheme-ease-out);
  display: inline-block;
}

.backtheme-footer__links a:hover { color: var(--backtheme-brand-ink); transform: translateX(3px); }

.backtheme-footer__bottom {
  display: flex;
  flex-direction: column;
  gap: var(--backtheme-space-s);
  align-items: center;
  text-align: center;
  padding-top: var(--backtheme-space-m);
  border-top: 1px solid var(--backtheme-line);
  font-size: var(--backtheme-step--1);
  color: var(--backtheme-fg-subtle);
}

@media (min-width: 680px) { .backtheme-footer__bottom { flex-direction: row; justify-content: space-between; text-align: left; } }

.backtheme-socials { display: flex; gap: var(--backtheme-space-3xs); }

.backtheme-social {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--backtheme-r-full);
  color: var(--backtheme-fg-muted);
  border: 1px solid var(--backtheme-line);
  background: var(--backtheme-surface-1);
  transition: all var(--backtheme-dur-base) var(--backtheme-ease-out);
}

.backtheme-social svg { width: 17px; height: 17px; }

.backtheme-social:hover {
  color: var(--backtheme-on-brand);
  border-color: transparent;
  background: var(--backtheme-grad-brand);
  transform: translateY(-2px);
  box-shadow: var(--backtheme-shadow-md);
}

/* ------------------------------------------------------------
   Scroll progress + back to top
   ------------------------------------------------------------ */

.backtheme-scroll-progress {
  position: fixed;
  top: 0; left: 0;
  z-index: calc(var(--backtheme-z-header) + 1);
  height: 2px;
  width: 100%;
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
  background: var(--backtheme-grad-brand);
  pointer-events: none;
}

.backtheme-to-top {
  position: fixed;
  right: var(--backtheme-gutter);
  bottom: calc(var(--backtheme-space-m) + env(safe-area-inset-bottom));
  z-index: var(--backtheme-z-sticky);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--backtheme-r-full);
  color: var(--backtheme-fg);
  background: var(--backtheme-glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--backtheme-line-strong);
  box-shadow: var(--backtheme-shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.9);
  transition: all var(--backtheme-dur-base) var(--backtheme-ease-out);
}

.backtheme-to-top.is-shown { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.backtheme-to-top:hover { border-color: var(--backtheme-line-brand); color: var(--backtheme-brand-ink); }
.backtheme-to-top svg { width: 18px; height: 18px; }
