/* ==========================================================================
   Shieldmark — shared chrome: logo, navigation, trust strip, footer, toast
   ========================================================================== */

/* ---------- Logo ---------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.32rem;
  letter-spacing: -0.03em;
  color: var(--navy);
}
.logo__mark {
  width: 36px;
  height: 40px;
  flex: none;
  transition: transform 0.4s var(--ease-spring);
}
.logo:hover .logo__mark { transform: rotate(-8deg) scale(1.06); }
.logo__word span { color: var(--blue); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.nav.is-scrolled {
  border-bottom-color: var(--hairline);
  box-shadow: 0 10px 30px -20px rgba(11, 27, 63, 0.25);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__links a {
  position: relative;
  display: block;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.nav__links a:hover { background: var(--blue-50); }
.nav__links a[aria-current="true"] { color: var(--blue); }
.nav__links a[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  transform: translateX(-50%);
}
.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav__toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 0 var(--navy);
}
.nav__toggle span {
  display: block;
  width: 20px;
  height: 2.5px;
  margin: 4px auto;
  border-radius: 2px;
  background: var(--navy);
  transition: transform 0.3s var(--ease-out), opacity 0.2s;
}
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 1024px) {
  .nav__toggle { display: block; }
  .nav__menu {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    padding: 12px var(--gutter) 24px;
    background: #fff;
    border-bottom: var(--border);
    box-shadow: 0 30px 40px -30px rgba(11, 27, 63, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s var(--ease-out), visibility 0.25s;
  }
  .nav.is-open .nav__menu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav__links {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .nav__links a {
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 1.05rem;
  }
  .nav__links a[aria-current="true"]::after { display: none; }
  .nav__links a[aria-current="true"] { background: var(--blue-50); }
  .nav__actions .btn { display: none; }
  .nav__menu .nav__menu-cta { display: flex; }
}
.nav__menu-cta {
  display: none;
  margin-top: 12px;
}
.nav__menu-cta .btn { width: 100%; }

/* ---------- Trust strip ---------- */
.trust {
  position: relative;
  padding-block: clamp(56px, 7vw, 88px);
  border-block: 1px solid var(--hairline);
  background: #fff;
}
.trust__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.trust__stats > li { display: flex; }
.trust__stat {
  flex: 1;
  padding: 26px 24px;
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1.5px solid var(--hairline);
  transition: border-color 0.25s, transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.trust__stat:hover {
  border-color: var(--navy);
  transform: translateY(-4px);
  box-shadow: 0 4px 0 var(--navy);
}
.trust__num {
  display: block;
  font-size: clamp(2.2rem, 3.6vw, 3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--navy);
}
.trust__num small {
  font-size: 0.5em;
  letter-spacing: -0.01em;
  color: var(--blue);
  margin-left: 4px;
}
.trust__label {
  display: block;
  margin-top: 10px;
  font-weight: 700;
  color: var(--navy);
}
.trust__desc {
  display: block;
  margin-top: 4px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}
.trust__browsers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
  margin-top: clamp(36px, 5vw, 52px);
}
.trust__browsers-label {
  margin-right: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}
.trust__browser {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1.5px solid var(--hairline);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--navy);
  background: #fff;
  transition: border-color 0.2s, background-color 0.2s;
}
.trust__browser:hover { border-color: var(--navy); background: var(--blue-50); }
.trust__browser svg { width: 16px; height: 16px; color: var(--blue); }

@media (max-width: 900px) {
  .trust__stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .trust__stat { padding: 20px 18px; }
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  overflow: hidden;
  padding-top: clamp(72px, 9vw, 110px);
  background: var(--navy);
  color: #c9d4ee;
}
.footer__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 48px;
}
.footer .logo { color: #fff; }
.footer .logo__word span { color: var(--blue-300); }
.footer__tagline {
  max-width: 340px;
  margin-top: 18px;
  line-height: 1.65;
}
.footer__col h3 {
  margin-bottom: 16px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
}
.footer__col ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer__col a {
  color: #c9d4ee;
  transition: color 0.2s;
}
.footer__col a:hover { color: #fff; }
.footer__bottom {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: clamp(56px, 7vw, 80px);
  padding-block: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
  color: #8fa0c7;
}
.footer__bottom a:hover { color: #fff; }
.footer__bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

@media (max-width: 900px) {
  .footer__grid { grid-template-columns: repeat(3, 1fr); }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer__grid { grid-template-columns: repeat(2, 1fr); gap: 36px 24px; }
}

/* ---------- Install buttons (the real bookmarklet) ---------- */
.install-drag {
  cursor: grab;
  touch-action: none;
}
.install-drag:active { cursor: grabbing; }
.install-drag svg { width: 20px; height: 23px; }
/* Pulsing dashed ring that says "drag me" */
.install-drag::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px dashed var(--install-ring, var(--blue));
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  animation: install-ring 2.6s ease-in-out infinite;
}
.btn--yellow.install-drag { --install-ring: var(--yellow); }
.install-drag:hover::after { animation: none; opacity: 1; }
.install-copy.is-copied { --btn-bg: var(--green); --btn-fg: var(--navy); }

.install-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}
.install-hint b { color: var(--navy); }
.install-hint a { color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.install-hint svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--blue);
  animation: install-nudge 1.6s ease-in-out infinite;
}
.install-hint--light,
.install-hint--light b,
.install-hint--light a { color: #fff; }
.install-hint--light svg { color: var(--yellow); }
/* Shortcuts bar looks hidden (js/drag-helper.js): the hint turns into a clear "show it first" callout */
.install-hint.is-bar-hidden {
  width: fit-content;
  max-width: 100%;
  padding: 8px 14px 8px 10px;
  border: 1.5px solid #e2a600;
  border-radius: 14px;
  background: var(--yellow-100);
  color: var(--navy);
}
.install-hint.is-bar-hidden svg { color: #b07d00; }
.install-hint--light.is-bar-hidden { border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.14); color: #fff; }
.install-hint--light.is-bar-hidden svg { color: var(--yellow); }
.install-hint kbd { margin: 0 1px; font-size: 0.82em; transition: transform 0.12s var(--ease-out), box-shadow 0.12s, background-color 0.12s; }
.install-hint kbd.is-down { transform: translateY(2px); box-shadow: 0 0 0 var(--navy), 0 0 0 3px rgba(255, 200, 61, 0.6); background: var(--yellow); }
.dh.is-bar-hidden .dh-sub { visibility: visible; }

@keyframes install-ring {
  0%, 100% { opacity: 0; transform: scale(0.94); }
  50% { opacity: 0.9; transform: scale(1); }
}
@keyframes install-nudge {
  0%, 100% { transform: translateY(2px); }
  50% { transform: translateY(-3px); }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 14px 20px 14px 16px;
  border: var(--border);
  border-radius: 18px;
  background: #fff;
  color: var(--navy);
  font-weight: 600;
  box-shadow: var(--shadow-pop-sm), var(--shadow-soft);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform 0.45s var(--ease-spring), opacity 0.3s;
  pointer-events: none;
}
.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}
.toast__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 2px solid var(--navy);
  border-radius: 10px;
  background: var(--yellow);
}
.toast__icon svg { width: 18px; height: 18px; }

/* ---------- Drag helper (js/drag-helper.js) ----------
   While an install button is being dragged, a band at the top points at the shortcuts bar.
   Everything here ignores the pointer, so it never gets in the way of the drop. */
.dh {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.dh::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(11, 27, 63, 0.28);
}
.dh-zone {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 24px 42px;
  border-top: 4px dashed #fff;
  background: linear-gradient(180deg, var(--blue) 0%, rgba(31, 91, 255, 0.92) 55%, rgba(31, 91, 255, 0) 100%);
  color: #fff;
  text-align: center;
  transform: translateY(-100%);
  transition: transform 0.45s var(--ease-spring), padding 0.3s;
}
html.is-dragging-install .dh { opacity: 1; }
html.is-dragging-install .dh-zone { transform: none; }
.dh[data-state="near"] .dh-zone,
.dh[data-state="out"] .dh-zone { padding-bottom: 64px; }
.dh-arrows { display: flex; flex-direction: column; align-items: center; margin-bottom: 2px; }
.dh-arrows svg {
  width: 30px;
  height: 18px;
  margin-top: -6px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: dh-rise 1.1s ease-in-out infinite;
}
.dh-arrows svg:nth-child(2) { animation-delay: 0.12s; opacity: 0.7; }
.dh-arrows svg:nth-child(3) { animation-delay: 0.24s; opacity: 0.45; }
.dh-title { font-size: clamp(1.25rem, 2.4vw, 1.7rem); font-weight: 800; letter-spacing: -0.02em; }
.dh-sub { font-size: 0.95rem; font-weight: 600; color: #dce7ff; }
.dh[data-state="out"] .dh-sub { visibility: hidden; }
@keyframes dh-rise {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* After letting go: confirmation (or a nudge to drag higher) */
.dh-done {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 301;
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 14px 14px 14px 16px;
  border: 2px solid var(--navy);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-pop);
  color: var(--navy);
  opacity: 0;
  transform: translate(-50%, -24px) scale(0.96);
  visibility: hidden;
  transition: opacity 0.3s, transform 0.45s var(--ease-spring), visibility 0s 0.45s;
}
.dh-done.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
  transition: opacity 0.3s, transform 0.45s var(--ease-spring), visibility 0s;
}
.dh-done-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}
.dh-done[data-kind="hint"] .dh-done-icon { background: var(--yellow); color: var(--navy); }
.dh-done-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dh-done-body { display: grid; gap: 2px; }
.dh-done-body b { font-size: 1.02rem; font-weight: 800; }
.dh-done-body span { font-size: 0.92rem; color: var(--muted); }
.dh-done-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-left: 6px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--navy);
  cursor: pointer;
}
.dh-done-close:hover { background: var(--blue-100); }
.dh-done-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }

@media (prefers-reduced-motion: reduce) {
  .dh-zone, .dh-done { transition: none; }
  .dh-arrows svg { animation: none; }
}

/* ---------- Shortcuts bar just opened (Ctrl/⌘ + Shift + B) ----------
   The top edge glows where the bar appeared, and every install button pulses: "drag me up there". */
.kh-glow {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 299;
  height: 6px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--blue), #7fdcff, var(--green), #7fdcff, var(--blue));
  background-size: 200% 100%;
  box-shadow: 0 0 18px 4px rgba(31, 91, 255, 0.55), 0 0 60px 12px rgba(127, 220, 255, 0.35);
  opacity: 0;
  transform: scaleY(0.4);
  transform-origin: top;
  transition: opacity 0.35s, transform 0.35s;
}
html.kh-bar .kh-glow {
  opacity: 1;
  transform: none;
  animation: kh-sweep 1.6s linear infinite, kh-breathe 1.2s ease-in-out infinite;
}
@keyframes kh-sweep { to { background-position: -200% 0; } }
@keyframes kh-breathe {
  0%, 100% { box-shadow: 0 0 18px 4px rgba(31, 91, 255, 0.55), 0 0 60px 12px rgba(127, 220, 255, 0.35); }
  50% { box-shadow: 0 0 26px 8px rgba(31, 91, 255, 0.75), 0 0 90px 22px rgba(127, 220, 255, 0.5); }
}
html.kh-next .install-drag { animation: kh-btn 1.2s ease-in-out 5; }
@keyframes kh-btn {
  0%, 100% { box-shadow: 0 4px 0 var(--btn-shadow), 0 0 0 0 rgba(255, 200, 61, 0); }
  50% { box-shadow: 0 4px 0 var(--btn-shadow), 0 0 0 10px rgba(255, 200, 61, 0.55); }
}
@media (prefers-reduced-motion: reduce) {
  html.kh-bar .kh-glow { animation: none; }
  html.kh-next .install-drag { animation: none; box-shadow: 0 4px 0 var(--btn-shadow), 0 0 0 6px rgba(255, 200, 61, 0.55); }
}

/* Calibration readout for the "bar already showing" guess: add ?bardebug to the address */
.kh-debug {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 400;
  padding: 10px 12px;
  border: 2px solid var(--navy);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-pop-sm);
  color: var(--navy);
  font: 600 12px/1.6 var(--font-mono);
  white-space: pre;
}