/* ==========================================================================
   Explainer visuals

   Diagrams for the content pages that explain a single idea:
   - .dum-column       /duty-under-management hero: duty paid is the tip
   - .limits-timeline  /duty-reclaim hero: the three claim windows to scale
   - .route-finder     /duty-reclaim: questions that land on a claim route
   - .journey          /customs-data-guide hero: the steps to your data
   - .guide-nav states /customs-data-guide: current section and progress

   Each shows its final state without JS and under reduced motion. The
   figures come from the page copy beside them.
   ========================================================================== */

/* Hero split used by all three pages: copy left, visual right. */
.explainer-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

@media (max-width: 991px) {
  .explainer-hero {
    grid-template-columns: 1fr;
  }
}

/* ── Duty under management column ───────────────────────────────────────── */

.dum-column {
  display: grid;
  grid-template-columns: auto 7rem 1fr;
  gap: 0 1rem;
  margin: 0;
  color: var(--white);
}

.dum-column__total {
  display: flex;
  align-items: center;
  padding-right: 0.75rem;
  border-right: 2px solid rgba(255, 255, 255, 0.35);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}

.dum-column__total strong {
  margin-bottom: 0.5rem;
  color: var(--gold);
  font-size: 1.5rem;
}

.dum-column__stack {
  display: flex;
  flex-direction: column;
  height: 22rem;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(20, 5, 28, 0.4);
}

.dum-column__seg {
  flex: 0 0 var(--h);
  background: var(--seg);
  transform-origin: bottom center;
}

.dum-column__seg--sp { --seg: linear-gradient(180deg, #b28cff, var(--purple-accent)); }
.dum-column__seg--fta { --seg: linear-gradient(180deg, #8f5cff, #6d35d8); }
.dum-column__seg--paid { --seg: var(--gold); }

.dum-column__labels {
  display: flex;
  flex-direction: column;
  height: 22rem;
}

.dum-column__label {
  position: relative;
  flex: 0 0 var(--h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.85);
}

.dum-column__label strong {
  font-size: 1.375rem;
  color: var(--white);
}

/* The paid segment is thin, so its label sits beneath the waterline. */
.dum-column__label--paid {
  justify-content: flex-start;
  padding-top: 0.25rem;
}

.dum-column__label--paid strong {
  color: var(--gold);
}

.dum-column__waterline {
  position: absolute;
  left: -8.25rem;
  right: 0;
  top: 0;
  border-top: 2px dashed rgba(255, 255, 255, 0.55);
}

.dum-column__waterline span {
  position: absolute;
  right: 0;
  top: -1.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .dum-column__seg {
    animation: dum-grow 0.9s var(--ease-out) both;
  }

  .dum-column__seg--paid { animation-delay: 0.3s; }
  .dum-column__seg--fta { animation-delay: 0.9s; }
  .dum-column__seg--sp { animation-delay: 1.5s; }

  .dum-column__label,
  .dum-column__total {
    animation: dum-fade 0.6s ease both;
  }

  .dum-column__label--paid { animation-delay: 0.7s; }
  .dum-column__label--fta { animation-delay: 1.3s; }
  .dum-column__label--sp { animation-delay: 1.9s; }
  .dum-column__total { animation-delay: 2.3s; }
}

@keyframes dum-grow {
  from { transform: scaleY(0); }
  to { transform: none; }
}

@keyframes dum-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 479px) {
  .dum-column {
    grid-template-columns: auto 5rem 1fr;
  }

  .dum-column__waterline {
    left: -6.25rem;
  }
}

/* ── Reclaim windows timeline ───────────────────────────────────────────── */

.limits-timeline {
  margin: 0;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
}

.limits-timeline__title {
  margin: 0 0 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.limits-timeline__rows {
  display: grid;
  gap: 1.125rem;
}

.limits-timeline__row {
  display: grid;
  gap: 0.4375rem;
}

.limits-timeline__name {
  font-size: 0.875rem;
  font-weight: 600;
}

.limits-timeline__track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  height: 1.75rem;
}

.limits-timeline__bar {
  flex: 0 0 var(--w);
  height: 100%;
  border-radius: 6px;
  background: var(--bar, var(--purple-accent));
  transform-origin: left center;
}

.limits-timeline__row--main .limits-timeline__bar {
  --bar: var(--gold);
}

.limits-timeline__value {
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}

.limits-timeline__row--main .limits-timeline__value {
  position: absolute;
  right: 0.75rem;
  color: var(--purple-dark);
}

.limits-timeline__axis {
  position: relative;
  height: 2.25rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.72);
}

.limits-timeline__axis span {
  position: absolute;
  top: 0;
  left: var(--x);
  padding-top: 0.5rem;
  transform: translateX(-50%);
  white-space: nowrap;
}

.limits-timeline__axis span::before {
  content: '';
  position: absolute;
  top: -0.25rem;
  left: 50%;
  height: 0.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.5);
}

.limits-timeline__axis span:first-child { transform: none; }
.limits-timeline__axis span:first-child::before { left: 0; }
.limits-timeline__axis span:last-child { transform: translateX(-100%); }
.limits-timeline__axis span:last-child::before { left: auto; right: 0; }

.limits-timeline__caption {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}

@media (prefers-reduced-motion: no-preference) {
  .limits-timeline__bar {
    animation: limits-grow 1s var(--ease-out) both;
    animation-delay: calc(0.3s + var(--i, 0) * 0.3s);
  }

  .limits-timeline__value {
    animation: dum-fade 0.5s ease both;
    animation-delay: calc(1s + var(--i, 0) * 0.3s);
  }
}

@keyframes limits-grow {
  from { transform: scaleX(0); }
  to { transform: none; }
}

/* ── Route finder ───────────────────────────────────────────────────────── */

.route-finder {
  margin: var(--space-lg) 0;
  padding: var(--space-lg);
  border: 1px solid var(--purple-tint-3);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.route-finder__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: var(--space-md);
}

.route-finder__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--purple-heading);
}

.route-finder__restart {
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--purple-tint-3);
  border-radius: 99px;
  background: transparent;
  color: var(--purple-accent-hover);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.route-finder__trail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0 0 var(--space-sm);
  padding: 0;
  list-style: none;
}

.route-finder__trail li {
  padding: 0.25rem 0.625rem;
  border-radius: 99px;
  background: var(--purple-tint-1);
  color: var(--purple-heading);
  font-size: 0.75rem;
  font-weight: 600;
}

.route-finder__question {
  margin: 0 0 var(--space-sm);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--purple-heading);
}

.route-finder__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.625rem;
}

.route-finder__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--purple-tint-3);
  border-radius: var(--border-radius);
  background: var(--form-bg);
  color: var(--purple-primary);
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.route-finder__option::after {
  content: '\2192';
  flex: none;
  color: var(--purple-accent);
  font-weight: 700;
}

.route-finder__option:hover {
  border-color: var(--purple-accent);
  background: var(--white);
}

.route-finder__result {
  padding: var(--space-md);
  border-left: 4px solid var(--purple-accent);
  border-radius: var(--border-radius);
  background: var(--purple-tint-1);
}

.route-finder__result-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple-accent-hover);
}

.route-finder__result-route {
  margin: 0 0 0.5rem;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--purple-heading);
}

.route-finder__result p {
  margin: 0 0 0.5rem;
}

.route-finder__result p:last-child {
  margin-bottom: 0;
}

.route-finder__result .route-finder__note {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.route-finder__step {
  animation: route-in var(--dur-base) var(--ease-out);
}

@keyframes route-in {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: none; }
}

/* ── Data journey ───────────────────────────────────────────────────────── */

.journey {
  list-style: none;
  margin: var(--space-lg) auto 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  max-width: 64rem;
  counter-reset: journey;
}

.journey li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 0 0.25rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.85);
}

/* The rail between stops. */
.journey li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 1.375rem;
  left: calc(50% + 1.625rem);
  right: calc(-50% + 1.625rem);
  border-top: 2px dashed rgba(255, 255, 255, 0.3);
}

.journey__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.journey__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.journey li:last-child .journey__icon {
  background: var(--gold);
  box-shadow: none;
  color: var(--purple-dark);
}

.journey li:last-child {
  color: var(--gold);
}

@media (prefers-reduced-motion: no-preference) {
  .journey li {
    animation: dum-fade 0.5s ease both;
    animation-delay: calc(0.2s + var(--i, 0) * 0.12s);
  }
}

/* On a phone the strip would push the sign-in signpost, which is what most
   visitors to the guide came for, below the fold. The steps are all in the
   guide itself. */
@media (max-width: 767px) {
  .journey {
    display: none;
  }
}

/* ── Guide section nav: where you are ───────────────────────────────────── */

.guide-nav__link.is-current {
  background: var(--purple-heading);
  border-color: var(--purple-heading);
  color: var(--white);
}

.guide-nav__progress {
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 100%;
  background: var(--purple-accent);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
}

/* ── Light variants for use on white sections ───────────────────────────── */

.dum-column--light {
  color: var(--purple-primary);
}

.dum-column--light .dum-column__total {
  border-right-color: var(--purple-tint-2);
  color: var(--text-muted);
}

.dum-column--light .dum-column__total strong,
.dum-column--light .dum-column__label--paid strong,
.dum-column--light .dum-column__waterline span {
  color: var(--gold-text);
}

.dum-column--light .dum-column__label {
  color: var(--purple-primary);
}

.dum-column--light .dum-column__label strong {
  color: var(--purple-heading);
}

.dum-column--light .dum-column__waterline {
  border-top-color: var(--purple-heading);
  opacity: 0.6;
}

.dum-column--light .dum-column__stack {
  box-shadow: var(--shadow-md);
}

/* Inline links in explainer copy. */
.problem-split a:not(.btn),
.cost-share-wrap a:not(.btn) {
  color: var(--purple-accent-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Problem list beside a diagram (role pages) ─────────────────────────── */

.problem-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.problem-split__visual {
  display: flex;
  justify-content: center;
}

.problem-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-md);
}

.problem-list li {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: var(--space-sm);
}

.problem-list__mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: color-mix(in srgb, #c8364a 10%, white);
  color: #c8364a;
}

.problem-list__mark svg {
  width: 1.25rem;
  height: 1.25rem;
}

.problem-list h3 {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
}

.problem-list p {
  margin: 0;
}

.problem-row {
  list-style: none;
  margin: var(--space-xl) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
}

@media (max-width: 991px) {
  .problem-split {
    grid-template-columns: 1fr;
  }

  .problem-row {
    grid-template-columns: 1fr;
  }
}

/* ── Broker network: one importer, several filers ───────────────────────── */

.broker-net {
  width: 100%;
  max-width: 34rem;
  height: auto;
  overflow: visible;
}

.broker-net__wire {
  fill: none;
  stroke: var(--purple-tint-2);
  stroke-width: 2.5;
  stroke-dasharray: 5 6;
}

.broker-net__hub { fill: var(--gold); }
.broker-net__hub-ring { fill: none; stroke: var(--gold); stroke-opacity: 0.35; stroke-width: 2; }

.broker-net__hub-text,
.broker-net__hub-sub,
.broker-net__node text,
.broker-net__caption {
  font-family: var(--font-primary);
  text-anchor: middle;
}

.broker-net__hub-text { font-size: 18px; font-weight: 700; fill: var(--purple-dark); }
.broker-net__hub-sub { font-size: 10px; font-weight: 600; fill: var(--purple-dark); }

.broker-net__node rect { fill: var(--white); stroke: var(--purple-tint-3); }
.broker-net__node .broker-net__name { font-size: 12px; font-weight: 700; fill: var(--purple-heading); text-anchor: start; }
.broker-net__node .broker-net__meta { font-size: 10px; font-weight: 500; fill: var(--text-muted); text-anchor: start; }
.broker-net__node .broker-net__rate-track { fill: var(--off-white); stroke: none; }
.broker-net__node .broker-net__rate { fill: var(--rate, var(--purple-accent)); stroke: none; }
.broker-net__node .broker-net__rate-label { text-anchor: end; }

.broker-net__caption { font-size: 12px; font-weight: 600; fill: var(--text-muted); }

@media (prefers-reduced-motion: no-preference) {
  .broker-net__wire {
    animation: two-doors-flow 1.6s linear infinite;
  }
}

@keyframes two-doors-flow {
  to { stroke-dashoffset: -22; }
}

/* ── Pricing: a plan's cost as a share of duty under management ─────────── */

.cost-share-wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.cost-share {
  padding: var(--space-lg);
  border: 1px solid var(--purple-tint-3);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.cost-share__controls {
  display: grid;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.cost-share__label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cost-share__tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.375rem;
  margin: 0;
  padding: 0.25rem;
  border: 0;
  border-radius: 99px;
  background: var(--off-white);
}

.cost-share__tiers input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cost-share__tiers label {
  display: grid;
  place-items: center;
  min-height: 2.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 99px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--purple-primary);
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.cost-share__tiers label small {
  font-weight: 500;
  font-size: 0.75rem;
  opacity: 0.8;
}

.cost-share__tiers input:checked + label {
  background: var(--purple-heading);
  color: var(--white);
}

.cost-share__tiers input:focus-visible + label {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.cost-share__range-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cost-share__range-head output {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--purple-heading);
}

.cost-share__range {
  width: 100%;
  accent-color: var(--purple-accent);
}

.cost-share__result {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem var(--space-md);
  align-items: center;
}

.cost-share__pct {
  grid-row: span 2;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  color: var(--gold-text);
  font-variant-numeric: tabular-nums;
}

.cost-share__sentence {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.cost-share__bar {
  position: relative;
  height: 1.5rem;
  margin: var(--space-md) 0 0.5rem;
  border-radius: 6px;
  background: var(--purple-tint-1);
  overflow: hidden;
}

.cost-share__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: max(4px, var(--share, 0.36%));
  background: var(--gold);
  transition: width var(--dur-base) var(--ease-out);
}

.cost-share__bar-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cost-share__note {
  margin: var(--space-md) 0 0;
  padding-top: var(--space-sm);
  border-top: 1px dashed var(--purple-tint-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

@media (max-width: 991px) {
  .cost-share-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 479px) {
  .cost-share__result {
    grid-template-columns: 1fr;
  }

  .cost-share__pct {
    grid-row: auto;
  }
}
