/* Loaded after the design's three stylesheets (index, store-interactions,
   store-pages), which are copied verbatim from the Signal build — keep edits
   here so those files can be re-synced from the design without merging.

   The design ran its cart and facts modal on Base UI; here they are native
   <dialog>s (focus trap, Escape and inert page for free). Undo the UA dialog
   box model so the design's .store-* rules position them exactly as before. */
dialog.store-cart-drawer,
dialog.store-facts-modal {
  margin: 0;
  padding: 0;
  max-width: none;
}
/* The design's display:flex beats the UA's closed-dialog display:none. */
dialog.store-cart-drawer:not([open]),
dialog.store-facts-modal:not([open]) {
  display: none;
}
dialog.store-cart-drawer {
  max-height: none;
  border-width: 0 0 0 1px;
  width: min(480px, 100%); /* 100vw overshoots by the scrollbar on narrow desktop windows */
}
dialog.store-cart-drawer::backdrop,
dialog.store-facts-modal::backdrop {
  background: rgb(10 25 17 / 35%);
  backdrop-filter: blur(3px);
}

/* ── Motion ──────────────────────────────────────────────────────────────
   Everything that opens, closes or swaps eases instead of snapping. One
   curve throughout; prefers-reduced-motion gets the instant versions. */
:root {
  --sx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sx-ease-in: cubic-bezier(0.4, 0, 1, 1);
}
@keyframes sx-fade-in {
  from { opacity: 0; transform: translateY(8px); }
}
@keyframes sx-turn-in {
  from { opacity: 0; transform: rotate(-90deg) scale(0.6); }
}

/* Mobile menu stays mounted (Header sets data-open + inert) so it can slide. */
body.signal-site .signal-mobile-menu:not([data-open]) {
  visibility: hidden;
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}
@media (min-width: 901px) {
  body.signal-site .signal-mobile-menu { display: none !important; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Page to page: cross-document view transition (plain <a> navigations). */
  @view-transition { navigation: auto; }
  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 0.3s; }

  /* Cart drawer + facts modal (useModal drives the data-*-style hooks). */
  dialog.store-cart-drawer { transition: transform 0.45s var(--sx-ease); }
  dialog.store-facts-modal { transition: opacity 0.35s var(--sx-ease), transform 0.45s var(--sx-ease); }
  dialog.store-cart-drawer[data-ending-style],
  dialog.store-facts-modal[data-ending-style] {
    transition-duration: 0.32s;
    transition-timing-function: var(--sx-ease-in);
  }
  dialog.store-cart-drawer::backdrop,
  dialog.store-facts-modal::backdrop { transition: opacity 0.4s var(--sx-ease); }
  dialog[data-starting-style]::backdrop,
  dialog[data-ending-style]::backdrop { opacity: 0; }

  /* The home page's own facts <dialog> and any other plain dialog: CSS-only. */
  dialog.facts-dialog,
  dialog.sx-dialog {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    transition: opacity 0.35s var(--sx-ease), transform 0.45s var(--sx-ease),
      overlay 0.45s allow-discrete, display 0.45s allow-discrete;
  }
  dialog.facts-dialog[open],
  dialog.sx-dialog[open] { opacity: 1; transform: none; }
  dialog.facts-dialog::backdrop,
  dialog.sx-dialog::backdrop {
    opacity: 0;
    transition: opacity 0.4s var(--sx-ease), overlay 0.45s allow-discrete, display 0.45s allow-discrete;
  }
  dialog.facts-dialog[open]::backdrop,
  dialog.sx-dialog[open]::backdrop { opacity: 1; }
  @starting-style {
    dialog.facts-dialog[open],
    dialog.sx-dialog[open] { opacity: 0; transform: translateY(18px) scale(0.98); }
    dialog.facts-dialog[open]::backdrop,
    dialog.sx-dialog[open]::backdrop { opacity: 0; }
  }

  /* Mobile menu: fade/slide, links follow in a short stagger. Visibility flips
     after the fade on close, immediately on open. */
  body.signal-site .signal-mobile-menu {
    transition: opacity 0.3s var(--sx-ease), transform 0.4s var(--sx-ease), visibility 0s linear 0.4s;
  }
  body.signal-site .signal-mobile-menu[data-open] {
    transition: opacity 0.3s var(--sx-ease), transform 0.4s var(--sx-ease), visibility 0s;
  }
  body.signal-site .signal-mobile-menu a { transition: opacity 0.35s var(--sx-ease), transform 0.45s var(--sx-ease); }
  body.signal-site .signal-mobile-menu:not([data-open]) a { opacity: 0; transform: translateY(-8px); }
  body.signal-site .signal-mobile-menu[data-open] a:nth-child(2) { transition-delay: 0.03s; }
  body.signal-site .signal-mobile-menu[data-open] a:nth-child(3) { transition-delay: 0.06s; }
  body.signal-site .signal-mobile-menu[data-open] a:nth-child(4) { transition-delay: 0.09s; }
  body.signal-site .signal-mobile-menu[data-open] a:nth-child(5) { transition-delay: 0.12s; }
  body.signal-site .signal-menu-toggle svg { animation: sx-turn-in 0.35s var(--sx-ease); }

  /* Accordions (FAQ, article contents, policy nav): height eases open/shut
     where ::details-content is supported, instant elsewhere. */
  :root { interpolate-size: allow-keywords; }
  details::details-content {
    block-size: 0;
    overflow-y: clip;
    transition: block-size 0.45s var(--sx-ease), content-visibility 0.45s allow-discrete;
  }
  details[open]::details-content { block-size: auto; }
  details { transition: background-color 0.3s ease; }
  summary :is(i, svg) { transition: transform 0.35s var(--sx-ease); }

  /* Swapped-in content fades rather than pops: gallery tabs, journal results,
     inline messages. */
  [role="tabpanel"],
  .journal-grid > *,
  .journal-empty,
  .sx-fade { animation: sx-fade-in 0.45s var(--sx-ease) both; }

  /* Hover/press states ease everywhere a rule didn't already set a transition. */
  :where(body.signal-site) :where(a, button, label, summary, input, select, textarea, [role="tab"]) {
    transition: color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  }
}

/* ── Header icons ───────────────────────────────────────────────────────
   The design's cart/account hover (dark green text) is mud on the green
   header; invert like the menu toggle beside them instead. */
body.signal-site .store-header :is(.store-cart-button, .store-account):hover {
  background: #11150d;
  color: #45ed37;
}

/* Mobile menu: a visible rule sets "Your account" apart from the page links
   (the design's 20% cream row rule disappears on the ink panel). */
body.signal-site .signal-mobile-menu a:has(+ a.signal-mobile-account) { border-bottom-color: transparent; }
body.signal-site .signal-mobile-menu a.signal-mobile-account { border-top: 1px solid #45ed37; }

/* ── App pages kit ──────────────────────────────────────────────────────
   Checkout, account, order confirmation and email preferences on the Signal
   tokens (ink #11150d, cream #faf3e9, green #45ed37, rule #11150d55). */
body.signal-site .sx-page { padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 8vw, 112px); }
body.signal-site .sx-wrap { width: min(100% - 32px, 1120px); margin-inline: auto; }
body.signal-site .sx-narrow { width: min(100% - 32px, 620px); margin-inline: auto; }
body.signal-site .sx-eyebrow {
  font: 600 0.72rem/1.4 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2f7d25;
  margin: 0 0 14px;
}
body.signal-site .sx-title { font-size: clamp(2.5rem, 6.5vw, 4.5rem); line-height: 0.95; margin: 0 0 18px; }
body.signal-site .sx-lede { font-size: 1.05rem; line-height: 1.6; color: #3d4437; max-width: 56ch; margin: 0 0 32px; }
body.signal-site .sx-h2 { font: 850 1.25rem/1.2 Archivo, Arial, sans-serif; letter-spacing: -0.02em; margin: 0 0 16px; }
body.signal-site .sx-muted { color: #5c6455; }
/* Cards mirror the design's .support-help: ink frame, heavy top rule. */
body.signal-site .sx-card { background: transparent; border: 1px solid #11150d; border-top-width: 4px; padding: clamp(20px, 3vw, 32px); }
body.signal-site .sx-card--ink { background: #11150d; color: #faf3e9; }
body.signal-site .sx-card--green { background: #eee9dc; border-top: 6px solid #45ed37; }
body.signal-site .sx-stack > * + * { margin-top: 16px; }
body.signal-site .sx-label {
  display: block;
  font: 700 0.7rem/1.4 Archivo, Arial, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4d5546;
  margin: 0 0 8px;
}
body.signal-site .sx-input {
  width: 100%;
  min-height: 54px;
  padding: 15px 16px;
  background: transparent;
  color: #11150d;
  font: 400 1rem/1.4 Archivo, Arial, sans-serif;
  border: 1px solid #11150d;
  border-radius: 0;
}
body.signal-site .sx-input::placeholder { color: #8a8f82; }
body.signal-site .sx-input:focus-visible { outline: 3px solid #11150d; outline-offset: 0; background: #fff; }
body.signal-site .sx-input[aria-invalid="true"] { background: #fde4dc; border-color: #b3261e; }
body.signal-site .sx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 54px;
  padding: 17px 23px;
  background: #11150d;
  color: #faf3e9;
  font: 800 11px/1.4 Archivo, Arial, sans-serif;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  border: 1px solid #11150d;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
}
body.signal-site .sx-btn svg { color: #45ed37; }
body.signal-site .sx-btn:hover { background: #45ed37; color: #11150d; }
body.signal-site .sx-btn:hover svg { color: #11150d; }
body.signal-site .sx-btn:disabled { opacity: 0.5; cursor: not-allowed; }
body.signal-site .sx-btn--block { width: 100%; }
body.signal-site .sx-btn--quiet { background: transparent; color: #11150d; }
body.signal-site .sx-btn--quiet:hover { background: #11150d; color: #faf3e9; }
body.signal-site .sx-link { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
body.signal-site :is(.sx-link, .sx-pill):has(> svg) { display: inline-flex; align-items: center; gap: 0.35em; }
body.signal-site .sx-notice:has(> svg) { display: flex; align-items: center; gap: 0.5em; }
body.signal-site .sx-notice { padding: 14px 16px; background: #e3f5dc; color: #173a1c; border: 1px solid #11150d; border-left-width: 4px; font-size: 0.95rem; line-height: 1.5; }
body.signal-site .sx-notice--error { background: #fbe1d8; color: #6b1d0c; border-color: #b3261e; }
body.signal-site .sx-pill {
  display: inline-block;
  padding: 4px 9px;
  font: 700 0.68rem/1.3 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #45ed37;
  color: #11150d;
  border: 1px solid #11150d;
}
body.signal-site .sx-pill--muted { background: #e3d8c6; }
body.signal-site .sx-pill--warn { background: #ffd9a3; }
body.signal-site .sx-pill--danger { background: #fbcfc1; }
/* Key/value rows rule off like the design's tables. */
body.signal-site .sx-rows { display: grid; border-top: 1px solid currentColor; }
body.signal-site .sx-rows > * { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent); }

/* Plain Signal dialog (e.g. the /classified QR email capture). */
dialog.sx-dialog {
  margin: auto;
  width: min(100% - 32px, 460px);
  padding: clamp(24px, 4vw, 36px);
  background: #faf3e9;
  color: #11150d;
  border: 1px solid #11150d;
  border-radius: 0;
}
dialog.sx-dialog::backdrop { background: rgb(10 25 17 / 35%); backdrop-filter: blur(3px); }
body.signal-site .sx-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  color: #11150d;
  border: 1px solid #11150d;
  cursor: pointer;
}
body.signal-site .sx-dialog-close:hover { background: #11150d; color: #faf3e9; }

/* Exit-intent email capture (components/ExitIntentPopup). */
body.signal-site .sx-exit-title { font-size: clamp(1.5rem, 4vw, 1.9rem); line-height: 1.05; padding-right: 44px; }
body.signal-site .sx-exit-copy { margin: 0 0 22px; line-height: 1.55; }
body.signal-site .sx-exit-copy strong { color: #11150d; }
body.signal-site .sx-exit-fine { margin: 14px 0 0; font-size: 0.78rem; }
body.signal-site .sx-exit-error { margin: 8px 0 0; font-size: 0.85rem; color: #8a2410; }
body.signal-site .sx-exit-check {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  background: #45ed37;
  color: #11150d;
}

/* Multi-paragraph customer reviews: keep the blank line between paragraphs. */
body.signal-site .final-reviews-list .e-customer blockquote { white-space: pre-line; }
