/* ============================================================================
   SHIPIFY — support.css
   Owned by the SUPPORT cell. Loads after tokens.css + shared.css.
   Tokens only: no literal colours, no off-grid spacing.

   The idea: the FAQ is a tray of blank label stock. A closed question is an
   unprinted label — tick strip down the left edge, index code, nothing else.
   Opening it runs the print head down the panel and the answer appears
   behind it. The mechanism does the explaining.
   ========================================================================== */

/* ---------------------------------------------------------------- 1. hero */

.sup-hero {
  position: relative;
  overflow: hidden;
}
/* faint feed-holes down the right edge, like continuous label stock */
.sup-hero::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  right: 0;
  width: var(--sp-300);
  pointer-events: none;
  background-image: radial-gradient(circle at 50% 50%, rgb(var(--sy-shadow) / .18) 0 3px, transparent 3.5px);
  background-size: 24px 32px;
  background-repeat: repeat-y;
}

.sup-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--sp-400);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .sup-hero__grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: var(--sp-800); }
}

.sup-hero__copy .sy-h1 { max-width: 14ch; }

/* the jump strip — printed tabs, not pills */
.sup-jump {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-100);
  margin-top: var(--sp-100);
}
.sup-jump__link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-100);
  min-height: 44px;
  padding: var(--sp-050) var(--sp-150);
  background: var(--sy-stock);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: 0 2px 0 var(--line);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  transition: transform var(--dur-quick) var(--ease-stamp),
              box-shadow var(--dur-quick) var(--ease-stamp),
              background-color var(--dur-quick) linear;
}
.sup-jump__link:hover {
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 var(--line);
}
.sup-jump__link:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line); }
.sup-jump__n {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--accent-ink);
  background: var(--line);
  padding: 2px var(--sp-050);
  border-radius: var(--r-none);
}

/* Zip behind a torn plate of stock */
.sup-hero__zip {
  position: relative;
  justify-self: center;
  width: min(100%, 320px);
}
.sup-hero__plate {
  position: relative;
  display: grid;
  place-items: center;
  padding: var(--sp-300) var(--sp-300) var(--sp-400);
  background: var(--sy-stock);
  border: 2px solid var(--line);
  border-radius: var(--r-md) var(--r-md) var(--r-none) var(--r-none);
  box-shadow: 0 18px 32px -26px rgb(var(--sy-shadow) / .9);
}
.sup-hero__plate::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: repeating-linear-gradient(0deg, rgb(var(--sy-shadow) / .035) 0 1px, transparent 1px 3px);
}
/* tear-off perforation along the bottom of the plate */
.sup-hero__plate::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: -2px;
  height: 14px;
  background-image: radial-gradient(circle at 50% 100%, var(--bg) 0 6px, transparent 6.5px);
  background-size: 16px 14px;
  background-repeat: repeat-x;
}
.sup-hero__mascot { width: min(72%, 200px); }
.sup-hero__tape {
  position: absolute;
  top: calc(-1 * var(--sp-150));
  left: var(--sp-300);
  transform: rotate(-3.5deg);
}

/* ------------------------------------------------------- 2. FAQ section */

.sup-faqsec__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-200);
  margin-bottom: var(--sp-400);
}
.sup-faqsec__note { margin: var(--sp-100) 0 0; max-width: 44ch; }
.sup-openall { flex: 0 0 auto; }

/* ------------------------------------------------------ 3. the FAQ item */

.sup-faq { display: block; }

.sup-q {
  position: relative;
  overflow: hidden;
  background: var(--sy-stock);
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 1px 0 var(--line), 0 14px 28px -26px rgb(var(--sy-shadow) / .9);
}
.sup-q + .sup-q { margin-top: var(--sp-200); }

/* tick strip down the left edge — unprinted stock until you open it */
.sup-q::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  pointer-events: none;
  background-image: repeating-linear-gradient(180deg, var(--line) 0 4px, transparent 4px 10px);
  opacity: .3;
  transition: opacity var(--dur-quick) linear;
}
.sup-q.is-open::before {
  background-image: repeating-linear-gradient(180deg, var(--accent) 0 4px, transparent 4px 10px);
  opacity: 1;
}

.sup-q__h { margin: 0; font-size: inherit; }

.sup-q__btn {
  display: flex;
  align-items: center;
  gap: var(--sp-200);
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: var(--sp-200) var(--sp-200) var(--sp-200) var(--sp-300);
  background: transparent;
  border: 0;
  border-radius: var(--r-md);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-quick) linear;
}
.sup-q__btn:hover { background: var(--surface); }

.sup-q__idx {
  flex: 0 0 auto;
  align-self: flex-start;
  padding-top: 3px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .14em;
  white-space: nowrap;
  color: var(--ink-muted);
}
.sup-q.is-open .sup-q__idx { color: var(--sy-ink-danger); }

.sup-q__text {
  flex: 1 1 auto;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-wrap: balance;
  color: var(--ink);
}

.sup-q__mark {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  transition: background-color var(--dur-quick) linear, border-color var(--dur-quick) linear;
}
.sup-q__mark::before,
.sup-q__mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 3px;
  margin: -1.5px 0 0 -7px;
  background: var(--ink);
  transition: transform var(--dur-quick) var(--ease-stamp), background-color var(--dur-quick) linear;
}
.sup-q__mark::after { transform: rotate(90deg); }
.sup-q.is-open .sup-q__mark { background: var(--accent); border-color: var(--accent); }
.sup-q.is-open .sup-q__mark::before,
.sup-q.is-open .sup-q__mark::after { background: var(--accent-ink); }
.sup-q.is-open .sup-q__mark::after { transform: rotate(0deg); }

/* ------------------------------------- 4. the panel (collapse mechanics) */
/* Default (no JS) is OPEN: nothing may be unreachable without scripting.
   .has-js is set by an inline script in <head>, before first paint, so the
   collapsed state never flashes. */

.sup-q__panel { display: grid; grid-template-rows: 1fr; }
.sup-q__inner { position: relative; min-height: 0; }

.has-js .sup-q__panel {
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms var(--ease-print);
}
.has-js .sup-q__inner {
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s linear 320ms;
}
.has-js .sup-q.is-open .sup-q__panel { grid-template-rows: 1fr; }
.has-js .sup-q.is-open .sup-q__inner { visibility: visible; transition-delay: 0s; }

.sup-q__body {
  padding: var(--sp-100) var(--sp-300) var(--sp-400) var(--sp-300);
  max-width: 64ch;
}
.sup-q__body > * + * { margin-top: var(--sp-200); }
.sup-q__body p { margin: 0; }
/* the dotted perforation between question and answer */
.sup-q__body::before {
  content: "";
  display: block;
  height: 2px;
  margin-bottom: var(--sp-300);
  background-image: radial-gradient(circle at 50% 50%, rgb(var(--sy-shadow) / .38) 0 1.6px, transparent 1.7px);
  background-size: 12px 2px;
  background-repeat: repeat-x;
}

/* the print head that runs down a freshly opened answer */
.sup-q__head {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent-bright) 14%, var(--sy-stock) 50%, var(--accent-bright) 86%, transparent);
}
.sup-q.is-printing .sup-q__head { animation: sup-head var(--dur-print) var(--ease-print) both; }
.sup-q.is-printing .sup-q__body { animation: sup-print var(--dur-print) var(--ease-print) both; }

@keyframes sup-head {
  0%   { top: 0;    opacity: 0; }
  10%  { opacity: 1; }
  86%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
@keyframes sup-print {
  0%   { opacity: .55; clip-path: inset(0 0 100% 0); filter: contrast(1.35) saturate(.55); }
  100% { opacity: 1;   clip-path: inset(0 0 0 0);    filter: none; }
}

/* ------------------------------------------------- 5. answer typography */

.sup-sub {
  margin: 0;
  padding-top: var(--sp-100);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.sup-sub + * { margin-top: var(--sp-100) !important; }

.sup-list { margin: 0; padding-left: var(--sp-300); }
.sup-list li { margin: 0; padding-left: var(--sp-050); }
.sup-list li + li { margin-top: var(--sp-150); }
.sup-list li::marker { color: var(--accent); font-weight: 700; }
.sup-list--tight li + li { margin-top: var(--sp-100); }

.sup-q__aside {
  padding: var(--sp-150) var(--sp-200);
  background: var(--surface);
  border-left: 6px solid var(--kraft);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--ink-muted);
}
.sup-q__aside:empty { display: none; }

.sup-q__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-150);
  align-items: center;
}

.sup-example { margin-top: var(--sp-200); max-width: 420px; }
.sup-example .sy-note { margin: 0; }

/* --------------------------------------------------------- 6. contact */

.sup-contact { position: relative; }
.sup-contact::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: var(--kraft);
  opacity: .55;
}

.sup-contact__grid {
  display: grid;
  gap: clamp(var(--sp-400), 5vw, var(--sp-800));
  align-items: start;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .sup-contact__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
}

.sup-contact__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-200);
  align-items: center;
}
#copy-status { min-height: var(--sp-300); margin: 0; font-family: var(--font-mono); }
#copy-status.is-ok::before { content: "\2713\00a0"; color: var(--sy-ink-danger); font-weight: 700; }
#copy-status.is-err { color: var(--sy-ink-danger); }

.sup-include { border-color: var(--line); }
.sup-include__h {
  margin: 0 0 var(--sp-150);
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}
/* kraft is light enough for --ink but not for --ink-muted: keep this text full ink */
.sup-include .sup-list { color: var(--ink); font-size: var(--fs-sm); }

.sup-contact__card { display: block; }
/* deliberately NOT position:sticky — this block carries .print-in, and the
   system's clip-path sweep would suspend a sticky child while it prints. */
.sup-desk .sy-label__line dd { word-break: break-word; }

.sup-elsewhere {
  display: flex;
  align-items: center;
  gap: var(--sp-200);
  margin-top: var(--sp-300);
  padding: var(--sp-200);
  border: 2px dashed rgb(var(--sy-shadow) / .3);
  border-radius: var(--r-md);
}
.sup-elsewhere__zip { width: 56px; flex: 0 0 auto; }
.sup-elsewhere .sy-note { margin: 0; }

/* -------------------------------------------------- 7. reduced motion */

@media (prefers-reduced-motion: reduce) {
  /* shared.css already collapses durations; the delay is ours to clear, or a
     closed panel would sit visible for 320ms with nothing to look at. */
  .has-js .sup-q__inner { transition-delay: 0s; }
  .sup-q.is-printing .sup-q__head { display: none; }
  .sup-q.is-printing .sup-q__body { animation: none; }
  .sup-jump__link:hover { transform: none; }
}

/* ----------------------------------------------------- 8. no scripting */

@media (scripting: none) {
  .sup-q__panel { grid-template-rows: 1fr; }
  .sup-q__inner { visibility: visible; overflow: visible; }
  .sup-q__mark, .sup-openall { display: none; }
  .sup-q__btn { cursor: default; }
}

/* ------------------------------------------------------------ 9. print */

@media print {
  .sup-q__panel { grid-template-rows: 1fr !important; }
  .sup-q__inner { visibility: visible !important; overflow: visible !important; }
  .sup-hero__zip, .sup-jump, .sup-openall, .sup-elsewhere { display: none; }
  .sup-q { break-inside: avoid; box-shadow: none; }
}
