/* ============================================================================
   SHIPIFY — css/features.css
   Owned by the FEATURES cell. Loads AFTER tokens.css + shared.css.
   Namespace: .fx-*  ·  every value comes from tokens.css or shared.css.

   The page reads as a run of continuous label stock: a punched feed rail down
   both edges, six label cards, then one detail row per feature — each row
   anchored by a real 4x6 label or a piece of original print-shop art.
   ========================================================================== */

/* ------------------------------------------------------------- 1. head -- */

.fx-head__split { align-items: start; }

.fx-head__split .sy-stack > p:not(.sy-lede):not(.sy-eyebrow) { margin-bottom: 0; }

.fx-chiprow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-100);
  list-style: none;
  margin: 0;
  padding: 0;
}

.fx-head__art {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 440px;
  margin-inline: auto;
}

.fx-label { width: 100%; }
.fx-head__art .fx-label--head { z-index: 1; }

/* Zip sits on the top-left of the label so the stock reads as feeding out of it */
.fx-zip--idle {
  position: relative;
  z-index: 2;
  margin: 0 auto calc(var(--sp-300) * -1) 0;
  transform-origin: 50% 100%;
  animation: fx-idle 3.6s var(--ease-print) infinite alternate;
}
@keyframes fx-idle {
  from { transform: translateY(0) rotate(-0.6deg); }
  to   { transform: translateY(-5px) rotate(0.6deg); }
}

/* ------------------------------------------------------------ 2. cards -- */

.fx-sectionhead { max-width: 62ch; }

.fx-cards {
  display: grid;
  gap: var(--sp-300);
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  list-style: none;
  margin: var(--sp-600) 0 0;
  padding: 0;
}

.fx-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-150);
  overflow: hidden;
  padding: var(--sp-400) var(--sp-300) var(--sp-300);
  background: var(--sy-stock);
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 10px 24px -18px rgb(var(--sy-shadow) / .8);
  transition:
    transform var(--dur-quick) var(--ease-stamp),
    box-shadow var(--dur-quick) var(--ease-stamp),
    border-color var(--dur-quick) linear;
}

/* the tear-off perforation across the top of every card */
.fx-card::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0; right: 0;
  top: var(--sp-150);
  height: 4px;
  pointer-events: none;
  background-image: radial-gradient(circle at 50% 50%, rgb(var(--sy-shadow) / .22) 0 1.6px, transparent 1.7px);
  background-size: 11px 4px;
  background-repeat: repeat-x;
  opacity: .7;
}

/* a print head sweeps the card once on hover / keyboard focus */
.fx-card::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: -2px; right: -2px;
  top: 0;
  height: 3px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent-bright), transparent);
}
.fx-card:hover::after,
.fx-card:focus-within::after { animation: fx-sweep 640ms var(--ease-print) 1; }
@keyframes fx-sweep {
  0%   { top: 0; opacity: 0; }
  12%  { opacity: 1; }
  86%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.fx-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 18px 30px -22px rgb(var(--sy-shadow) / .95);
}
.fx-card:focus-within { border-color: var(--accent); }
.fx-card:has(.fx-card__link:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.fx-card:has(.fx-card__link:focus-visible) .fx-card__link { outline: none; }

.fx-card--live { border-color: var(--accent); }

.fx-card__num {
  position: absolute;
  top: var(--sp-300);
  right: var(--sp-300);
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: .06em;
  /* recessive, but still clears AA as large text — not a decorative-exemption dodge */
  color: var(--ink-muted);
  opacity: .7;
}

.fx-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.15;
  padding-right: var(--sp-600);   /* keeps the title clear of the numeral */
}
.fx-card__link {
  color: var(--ink);
  text-decoration: none;
}
/* the whole card is the hit target */
.fx-card__link::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
}
.fx-card__link:hover { text-decoration: underline; text-decoration-color: var(--accent); }

.fx-card__body {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.55;
}
.fx-card__chip {
  align-self: flex-start;
  margin-top: auto;
}

/* card icons — original, drawn in the same ink as the labels */
.fx-icon { width: 48px; height: 48px; }
.fx-icon__paper  { fill: var(--kraft); stroke: var(--line); stroke-width: 2.5; }
.fx-icon__stock  { fill: var(--sy-stock); stroke: var(--line); stroke-width: 2.5; stroke-linejoin: round; }
.fx-icon__rule   { fill: none; stroke: var(--line); stroke-width: 2.5; stroke-linecap: round; }
.fx-icon__route  { fill: none; stroke: var(--line); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 0.1 5.5; }
.fx-icon__arrow  { fill: none; stroke: var(--line); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.fx-icon__strike { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }
.fx-icon__hot, .fx-icon__hotdot { fill: var(--accent); }
.fx-icon__tick { fill: none; stroke: var(--accent-ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------- 3. the feed rail ----- */

.fx-rows { position: relative; }

/* punched sprocket holes down both edges, like continuous label backing */
.fx-rows::before,
.fx-rows::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 28px;
  display: none;
  pointer-events: none;
  background-image: radial-gradient(circle at 14px 20px, rgb(var(--sy-shadow) / .11) 0 5px, transparent 5.5px);
  background-size: 28px 40px;
  background-repeat: repeat-y;
}
.fx-rows::before { left: 0;  border-right: 2px solid rgb(var(--sy-shadow) / .09); }
.fx-rows::after  { right: 0; border-left:  2px solid rgb(var(--sy-shadow) / .09); }
@media (min-width: 1280px) {
  .fx-rows::before, .fx-rows::after { display: block; }
}

/* ------------------------------------------------------ 4. detail rows -- */

.fx-row + .fx-row { border-top: 2px solid rgb(var(--sy-shadow) / .12); }

.fx-row__split { align-items: center; }

.fx-row__copy > p { margin-bottom: 0; max-width: 58ch; }
.fx-row__copy .sy-eyebrow { margin-bottom: 0; }

.fx-row__art {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  margin-inline: auto;
}

/* on wide screens every other row puts the art on the left, DOM order intact */
@media (min-width: 900px) {
  .fx-row--flip .fx-row__art { order: -1; }
}

.fx-caption { margin: var(--sp-200) 0 0; }

/* the batch: two ghost sheets under the printed label */
.fx-stack { position: relative; }
.fx-stack::before,
.fx-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: 0 10px 20px -18px rgb(var(--sy-shadow) / .8);
}
.fx-stack::before { transform: rotate(-2.4deg) translate(-10px, 8px); }
.fx-stack::after  { transform: rotate(1.6deg) translate(9px, 5px); }
.fx-stack > .sy-label { position: relative; z-index: 1; }

/* address-book art */
.fx-art { width: 100%; height: auto; }
.fx-art__card  { fill: var(--surface); stroke: var(--line); stroke-width: 3; }
.fx-art__front { fill: var(--sy-stock); stroke: var(--line); stroke-width: 3; }
.fx-art__tab   { fill: var(--line); }
.fx-art__rule  { fill: none; stroke: var(--line); stroke-width: 3; stroke-linecap: round; opacity: .5; }
.fx-art__mark  { fill: var(--accent); }
.fx-art__tick  { fill: none; stroke: var(--accent-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.fx-art__lip   { fill: var(--kraft); stroke: var(--line); stroke-width: 3; stroke-linejoin: round; }

/* scan list — the events a tracking board shows */
.fx-scans {
  position: relative;
  list-style: none;
  margin: var(--sp-300) 0 0;
  padding: var(--sp-200);
  background: var(--sy-stock);
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  box-shadow: 0 10px 24px -20px rgb(var(--sy-shadow) / .8);
}
.fx-scans::before {
  content: "";
  position: absolute;
  left: 21px;
  top: var(--sp-400);
  bottom: var(--sp-400);
  width: 2px;
  /* crisper than a dotted border, which all but disappears at 2px */
  background-image: repeating-linear-gradient(180deg, rgb(var(--sy-shadow) / .55) 0 3px, transparent 3px 7px);
}
.fx-scan {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-150);
  padding-block: var(--sp-100);
  color: var(--ink-muted);
}
.fx-scan__dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: var(--r-none);
}
.fx-scan--last { color: var(--ink); font-weight: 700; }
.fx-scan--last .fx-scan__dot { background: var(--accent); border-color: var(--accent); }

/* Zip, twice more — never as filler */
.fx-zip--cheer {
  width: clamp(96px, 14vw, 124px);
  margin: calc(var(--sp-300) * -1) var(--sp-200) 0 auto;
}
.fx-zip--shrug {
  width: clamp(104px, 15vw, 136px);
  margin: calc(var(--sp-200) * -1) var(--sp-100) 0 auto;
  transform: rotate(3deg);
}

/* -------------------------------------------------------- 5. the board -- */

.fx-board .sy-table-wrap { margin-top: var(--sp-600); }
.fx-board .sy-table th[scope="row"] {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 600;
  white-space: normal;
}
.fx-board .sy-table td { font-weight: 600; }
.fx-board__note { margin-top: var(--sp-300); max-width: 62ch; }

/* ---------------------------------------------------------- 6. the CTA -- */

.fx-cta__card {
  position: relative;
  display: grid;
  gap: var(--sp-400);
  align-items: center;
  grid-template-columns: 1fr;
  overflow: hidden;
  padding: clamp(var(--sp-400), 5vw, var(--sp-800));
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 18px 34px -26px rgb(var(--sy-shadow) / .9);
}
.fx-cta__card::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: var(--sp-150);
  height: 4px;
  pointer-events: none;
  background-image: radial-gradient(circle at 50% 50%, rgb(var(--sy-shadow) / .22) 0 1.6px, transparent 1.7px);
  background-size: 12px 4px;
  background-repeat: repeat-x;
  opacity: .6;
}
.fx-cta__copy > p { margin-bottom: 0; }
.fx-zip--wave { width: clamp(132px, 20vw, 190px); justify-self: center; }
@media (min-width: 820px) {
  .fx-cta__card { grid-template-columns: auto 1fr; }
}

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

@media (prefers-reduced-motion: reduce) {
  .fx-zip--idle { animation: none; transform: none; }
  .fx-card:hover, .fx-card:focus-within { transform: none; }
  .fx-card::after,
  .fx-card:hover::after,
  .fx-card:focus-within::after { animation: none; opacity: 0; }
}

/* ----------------------------------------------------------- 8. print --- */

@media print {
  .fx-zip, .fx-card::after, .fx-rows::before, .fx-rows::after { display: none !important; }
  .fx-card, .fx-cta__card, .fx-scans { box-shadow: none; break-inside: avoid; }
  .fx-stack::before, .fx-stack::after { display: none; }
}
