/* ==========================================================================
   SafeStep · components.css
   Reusable components, named with BEM:
     .block            the component itself
     .block__element   a part that only exists inside the block
     .block--modifier  a variation of the block or element
   State classes use the is-/has- prefix (is-active, is-done…).
   The opening loader lives in pages/home.css: only the home page has it.
   ========================================================================== */

/* Button ------------------------------------------------------------------ */
/* Hover, inspired by award-winning sites:
   1. a fill sweeps up from the bottom (::before),
   2. the label rolls up and an identical copy rolls in (.btn__text + data-label),
   3. buttons with [data-magnetic] lean towards the pointer (components/magnetic.js).
   Each variant sets --btn-fill and --btn-fill-text for its hover state. */
.btn {
  --btn-fill: var(--color-accent);
  --btn-fill-text: var(--color-on-accent);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font: 700 1rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: color .35s var(--ease-sweep), border-color .35s ease, transform .5s var(--ease-out);
}

.btn::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: var(--btn-fill);
  transform: translateY(101%);
  transition: transform .55s var(--ease-sweep);
}

.btn:hover,
.btn:focus-visible {
  color: var(--btn-fill-text);
}

.btn:hover::before,
.btn:focus-visible::before {
  transform: translateY(0);
}

.btn__label {
  display: inline-block;
  overflow: hidden;
  height: 1.2em;
  line-height: 1.2;
}

.btn__text {
  position: relative;
  display: inline-block;
  transition: transform .5s var(--ease-sweep);
}

.btn__text::after {
  content: attr(data-label);
  position: absolute;
  top: 100%;
  left: 0;
}

.btn:hover .btn__text,
.btn:focus-visible .btn__text {
  transform: translateY(-100%);
}

.btn--primary {
  background: var(--color-ink);
  color: var(--color-paper);
}

.btn--ghost {
  --btn-fill: var(--color-ink);
  --btn-fill-text: var(--color-paper);
  background: transparent;
  border-color: var(--color-line);
  color: var(--color-ink);
}

.btn--ghost:hover {
  border-color: var(--color-ink);
}

/* On the always-dark call-to-action band */
.btn--accent {
  --btn-fill: var(--color-night-fg);
  --btn-fill-text: var(--color-night);
  background: var(--color-glow);
  color: var(--color-night);
}


/* Header call to action: square-ish, solid accent (as in the reference bar) */
.btn--nav {
  --btn-fill: var(--color-ink);
  --btn-fill-text: var(--color-paper);
  padding: 13px 18px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: .92rem;
}

/* Site header ------------------------------------------------------------ */
/* Floating bar, after abatable.com: detached from the edges, solid surface,
   small 4 px corners. It hides while scrolling down and comes back as soon as
   the visitor scrolls up (components/header.js toggles .is-hidden).
   On small screens it becomes a full-width bar with a menu panel. */
.site-header {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + var(--header-top));
  left: var(--gutter);
  right: var(--gutter);
  z-index: 50;
  transition: transform .5s var(--ease-sweep);
}

.site-header.is-hidden {
  transform: translateY(calc(-100% - var(--header-top) - env(safe-area-inset-top, 0px) - 12px));
}

.site-header__bar {
  position: relative;
  max-width: 1320px;
  margin-inline: auto;
  border: 1px solid var(--color-line);
  border-radius: 4px;
  background: var(--color-surface);
  transition: box-shadow .35s ease;
}

.site-header.is-scrolled .site-header__bar {
  box-shadow: 0 18px 40px -28px color-mix(in srgb, var(--color-ink) 45%, transparent);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-h);
  padding: 12px 12px 12px 22px;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 800 1.2rem/1 var(--font-display);
  font-stretch: 112%;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.site-header__logo {
  flex: none;
  width: 32px;
  height: 32px;
  transition: transform .6s var(--ease-out);
}

.site-header__brand:hover .site-header__logo {
  transform: rotate(-8deg) scale(1.06);
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 28px;
  font-size: .95rem;
}

.site-header__link {
  padding: .4em .7em;
  border-radius: 4px;
  color: var(--color-muted);
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}

.site-header__link:hover,
.site-header__link:focus-visible {
  background: var(--color-accent-soft);
  color: var(--color-ink);
}

/* The section the visitor is in (Entregas and each delivery page) */
.site-header__link[aria-current="page"] {
  color: var(--color-ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--color-accent);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Menu button: two lines that turn into a cross (small screens only) */
.site-header__menu-btn {
  display: none;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1.5px solid var(--color-line);
  border-radius: 4px;
  background: transparent;
  color: var(--color-ink);
  cursor: pointer;
}

.site-header__menu-icon,
.site-header__menu-icon::before,
.site-header__menu-icon::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform .35s var(--ease-sweep), opacity .2s ease;
}

.site-header__menu-icon {
  position: relative;
  background: transparent;
}

.site-header__menu-icon::before,
.site-header__menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.site-header__menu-icon::before { top: -4px; }
.site-header__menu-icon::after { top: 4px; }

.site-header.is-menu-open .site-header__menu-icon::before { transform: translateY(4px) rotate(45deg); }
.site-header.is-menu-open .site-header__menu-icon::after { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 860px) {
  .site-header {
    left: 0;
    right: 0;
  }

  .site-header__bar {
    border-width: 0 0 1px;
    border-radius: 0;
  }

  .site-header__inner {
    padding: 10px var(--gutter);
  }

  .site-header__menu-btn {
    display: grid;
  }

  .site-header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 8px var(--gutter) 18px;
    border-bottom: 1px solid var(--color-line);
    background: var(--color-surface);
    font-size: 1.1rem;
  }

  .site-header.is-menu-open .site-header__nav {
    display: flex;
  }

  .site-header__link {
    padding: 14px 10px;
    color: var(--color-ink);
  }
}

@media (max-width: 480px) {
  .site-header__cta {
    display: none;
  }
}

/* Space for the floating header above the first section */
.site-header ~ main {
  padding-top: var(--header-space);
}

/* Language toggle --------------------------------------------------------- */
.lang-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1.5px solid var(--color-line);
  border-radius: 4px;
  background: transparent;
  color: var(--color-muted);
  font: 700 .8rem/1 var(--font-body);
  cursor: pointer;
}

.lang-toggle:hover {
  border-color: var(--color-ink);
}

.lang-toggle__option {
  padding: 7px 10px;
  border-radius: 3px;
  transition: background .15s, color .15s;
}

.lang-toggle__option.is-active {
  background: var(--color-ink);
  color: var(--color-paper);
}

/* Section (generic page band) -------------------------------------------- */
.section {
  padding-block: var(--section-space);
}

.section--surface {
  background: var(--color-surface);
  border-block: 1px solid var(--color-line);
}

.section--flush-top {
  padding-top: 0;
}

.section__head {
  display: grid;
  gap: 16px;
  max-width: 760px;
  margin-bottom: 48px;
}

.section__head--flush {
  margin-bottom: 0;
}

.section__lede {
  max-width: 58ch;
  color: var(--color-muted);
  font-size: 1.12rem;
}

/* Tag --------------------------------------------------------------------- */
.tag {
  justify-self: start;
  padding: 5px 12px;
  border-radius: 3px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: .82rem;
  font-weight: 700;
}

.tag--alert {
  background: var(--color-alert-soft);
  color: var(--color-alert);
}

/* Filter (segmented buttons: PESTEL table, admin requests) ---------------- */
.filter {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.filter__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--color-muted);
  font: 700 .88rem/1 var(--font-body);
  cursor: pointer;
  transition: background-color .15s, color .15s;
}

.filter__btn:hover {
  color: var(--color-ink);
}

.filter__btn[aria-pressed="true"] {
  background: var(--color-ink);
  color: var(--color-paper);
}

.filter__swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.filter__swatch--pos { background: var(--chart-pos); }
.filter__swatch--neg { background: var(--chart-neg); }

/* Site footer ------------------------------------------------------------- */
.site-footer {
  padding-block: 40px;
  color: var(--color-muted);
  font-size: .88rem;
}

.site-footer--bordered {
  border-top: 1px solid var(--color-line);
}

.site-footer__link {
  color: inherit;
  text-underline-offset: 3px;
}

.site-footer__link:hover {
  color: var(--color-ink);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

/* Interactive background texture (components/texture.js) --------------- */
.texture {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* Custom cursor ----------------------------------------------------------- */
/* Only shown when cursor.js adds .has-custom-cursor to <html> (fine pointers). */
.cursor {
  display: none;
  pointer-events: none;
  transition: opacity .2s;
}

.has-custom-cursor .cursor {
  display: block;
}

.has-custom-cursor,
.has-custom-cursor * {
  cursor: none;
}

.has-custom-cursor input[type="text"],
.has-custom-cursor input[type="email"],
.has-custom-cursor select {
  cursor: auto;
}

.is-cursor-hidden .cursor {
  opacity: 0;
}

.cursor__dot,
.cursor__ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}

.cursor__dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--color-accent);
}

.cursor__ring {
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border: 1.5px solid #fff;
  mix-blend-mode: difference;
  -webkit-mask: repeating-conic-gradient(from 22.5deg, #000 0 45deg, transparent 45deg 90deg);
  mask: repeating-conic-gradient(from 22.5deg, #000 0 45deg, transparent 45deg 90deg);
  transition: background .25s ease;
}

/* Size changes happen in cursor.js through transform: scale() */
.is-cursor-hover .cursor__ring {
  background: rgba(255, 255, 255, .14);
  -webkit-mask: none;
  mask: none;
}
