/* ============================================================
   AUTOLINK COMPONENTS — the two /ad-accounts sections, shared.
   1. HOW IT WORKS timeline  (.hiw-*)   → docs/partials/hiw.html
   2. COMPARISON TABLE       (.cmp-*)   → docs/partials/cmp.html
   Load AFTER core.css (and before page CSS):
     <link rel="stylesheet" href="assets/css/components.css" />
     <script src="assets/js/components.js" defer></script>   (after core.js)
   The rules below are copied 1:1 from ad-accounts.html (inline <style>) so the
   look is literally the same code. ad-accounts.html itself does NOT load this
   file — if you change a rule here, change it there too (and vice versa).
   Only additions vs. the original: section wrappers (.hiw-section /
   .cmp-section), the `.site` text-wrap resets, `.hiw-meta[hidden]`, and the
   reduced-motion block at the end. Demo: /docs/components-demo
   Read docs/DESIGN-LESSONS.md before changing anything here.
   ============================================================ */

/* Section wrappers. On ad-accounts both live in one <section> that sits above
   the fixed .ambient/.grain layers (section { z-index: 2 }). */
.hiw-section, .cmp-section { position: relative; z-index: 2; }
.hiw-section { padding-top: 80px; }
.section-head.hiw-head { margin-bottom: 0; }

/* body.site (new pages) balances/prettifies h2/h3/p. ad-accounts has no
   body.site, so undo it here to keep the exact same line breaks. */
.site .section-head h2, .site .hiw-desc, .site .cmp-foot-slogan { text-wrap-style: auto; }

/* ============ SECTION HEAD (ad-accounts .section-head) ============ */
.section-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  margin-bottom: 80px;
  align-items: end;
}
.section-head .label-col {
  padding-top: 8px;
  border-top: 1px solid var(--line-2);
}
/* When section-head has only an h2 (no label-col), let it span the full row
   instead of being squeezed into the 200px label column. */
.section-head > h2:first-child {
  grid-column: 1 / -1;
}
.section-head h2 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(32px, 3.4vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0;
  max-width: min(900px, 100%);
  overflow-wrap: break-word;
}
.section-head h2 .em {
  font-family: var(--font-sans);
  font-weight: 400;
  background: linear-gradient(180deg, #FFFFFF 0%, #B8BAC0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.section-head .lead-num {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  margin-top: 4px;
}

/* ============================================================
   1. HOW IT WORKS — timeline (.hiw)
   ============================================================ */
/* ============ HOW IT WORKS — scroll-driven timeline ============ */
.hiw {
  position: relative;
  margin: 0 0 56px;
  padding: 8px 0 56px;
  overflow: hidden;
  isolation: isolate;
}
.hiw-bg {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hiw-bg .hiw-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 85%);
  opacity: 0.4;
}
.hiw-bg .hiw-orb {
  position: absolute;
  width: 700px; height: 700px;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,255,255,0.04), transparent 65%);
  filter: blur(60px);
  border-radius: 50%;
}
.hiw-inner {
  position: relative;
  z-index: 2;
}

.hiw-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 90px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg) 70%, transparent);
  z-index: 5;
  padding-top: 8px;
}
.hiw-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.hiw-progress {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.16em;
}
.hiw-progress-fill {
  width: 120px; height: 1px;
  background: var(--line-2);
  position: relative; overflow: hidden;
}
.hiw-progress-fill::before {
  content: ""; position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #FFFFFF, #B8BAC0);
  transform: scaleX(var(--hiw-p, 0));
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.hiw-progress-num {
  color: var(--text-3);
}
.hiw-progress-num .hiw-progress-cur { color: var(--text); }

.hiw-stage {
  position: relative;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0;
  /* Push the rail (line + dots) into the page margin on wide viewports,
     clamped so it never gets cut off on narrower screens. */
  --rail-shift: max(-180px, min(0px, calc((var(--grid) - 100vw) / 2 + 32px)));
}
.hiw-step-index {
  transform: translateX(var(--rail-shift, 0px));
}

/* Vertical rail */
.hiw-rail {
  position: relative;
  width: 80px;
}
.hiw-rail-line {
  position: absolute;
  left: 39px; top: 0; bottom: 0;
  width: 1px;
  z-index: 1;
  background: linear-gradient(180deg, transparent, var(--line-2) 6%, var(--line-2) 94%, transparent);
  transform: translateX(var(--rail-shift, 0px));
}
.hiw-rail-fill {
  position: absolute;
  left: 39px; top: 0;
  width: 1px;
  z-index: 1;
  height: 0;
  background: linear-gradient(180deg, #FFFFFF, #B8BAC0 60%, #6E7079);
  box-shadow: 0 0 14px rgba(255,255,255,0.5);
  transition: height 0.12s linear, top 0.12s linear;
  transform: translateX(var(--rail-shift, 0px));
}
/* Dots must paint above the fill bar so the beam never visually
   cuts through a dot — give the step-index its own stacking layer. */
.hiw-step-index { z-index: 3; }
.hiw-step { z-index: 2; }

/* Steps */
.hiw-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.hiw-step {
  position: relative;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 48px;
  padding: 64px 0 72px;
  margin-left: -80px;
  border-bottom: 1px solid var(--line);
  transition: opacity 0.7s var(--ease-out);
  opacity: 0.32;
}
.hiw-step:last-child { border-bottom: 0; }
.hiw-step.is-active { opacity: 1; }
.hiw-step.is-passed { opacity: 0.55; }
/* A step that has entered the screen keeps its text + art (no blank holes
   when scrolling fast or between steps); the active step keeps the highlight. */
.hiw-step.is-seen .hiw-tag,
.hiw-step.is-seen .hiw-title span,
.hiw-step.is-seen .hiw-desc { opacity: 1; transform: translateY(0); visibility: visible; }
.hiw-step.is-seen .hiw-art { opacity: 1; transform: translateY(0) scale(1); }
.hiw-step.is-seen:not(.is-active) { opacity: 0.55; }
@media (max-width: 900px) { .hiw-step.is-seen { opacity: 1; } }

.hiw-step-index {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 6px;
}
.hiw-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line-2);
  position: relative;
  z-index: 2;
  transition: border-color 0.5s var(--ease-out), background 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
  margin-bottom: 16px;
}
.hiw-step.is-active .hiw-dot {
  background: #FFFFFF;
  border-color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.08), 0 0 24px rgba(255,255,255,0.5);
}
.hiw-step.is-passed .hiw-dot {
  background: var(--text-3);
  border-color: var(--text-3);
}
.hiw-dot-pulse {
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.6);
  opacity: 0;
}
.hiw-step.is-active .hiw-dot-pulse {
  /* pulse animation removed */
}
@keyframes hiwDotPulse {
  0%   { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(2.6); opacity: 0; }
}
.hiw-num {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  transition: color 0.4s var(--ease-out);
}
.hiw-num { display: none; }
.hiw-step.is-active .hiw-num { color: var(--text); }

.hiw-step-body {
  display: grid;
  grid-template-columns: 1fr 480px;
  grid-template-areas:
    "text art"
    "text art"
    "text art";
  column-gap: 64px;
  row-gap: 0;
  align-items: start;
}
.hiw-step-body > .hiw-tag,
.hiw-step-body > .hiw-title,
.hiw-step-body > .hiw-desc { grid-column: 1; }
.hiw-step-body > .hiw-title { align-self: start; margin-top: 0; }
.hiw-step-body .hiw-art  { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
.hiw-tag {
  display: none;
}
.hiw-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(30px, 3.4vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0 0 14px;
  max-width: 620px;
  text-wrap: balance;
}
.hiw-title span {
  display: inline-block;
  transform: translateY(28px);
  opacity: 0;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.hiw-title span:nth-child(2) { transition-delay: 0.1s; }
.hiw-title span:nth-child(3) { transition-delay: 0.2s; }
.hiw-title-tri { letter-spacing: -0.02em; }
.hiw-title-tri span { margin-right: 0.18em; }

/* Typewriter animation for step titles */
.hiw-title.is-typewriter span {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
.hiw-caret-tw {
  display: inline-block;
  width: 0.045em;
  height: 0.78em;
  background: linear-gradient(180deg, #FFFFFF, #C8CACF);
  vertical-align: baseline;
  margin-left: 0.04em;
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.55), 0 0 18px rgba(255, 255, 255, 0.2);
  transform: translateY(0.06em);
  opacity: 0;
}
.hiw-title.is-typewriter .hiw-caret-tw { opacity: 1; }
.hiw-title.is-typing .hiw-caret-tw {
  animation: hiwCaretBlink 0.85s steps(2, end) infinite;
}
.hiw-title.is-typed .hiw-caret-tw {
  animation: hiwCaretFinish 1.6s ease-out forwards;
}
@keyframes hiwCaretBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@keyframes hiwCaretFinish {
  0% { opacity: 1; }
  20% { opacity: 0; }
  40% { opacity: 1; }
  60% { opacity: 0; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
.hiw-title .hiw-em {
  font-family: var(--font-sans);
  font-weight: 400;
  background: linear-gradient(180deg, #FFFFFF 0%, #B8BAC0 60%, #6E7079);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
.hiw-desc {
  display: block;
  visibility: hidden;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 480px;
  margin: 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s var(--ease-out) 0.15s, transform 0.7s var(--ease-out) 0.15s;
}
.hiw-step.is-active .hiw-tag,
.hiw-step.is-active .hiw-title span,
.hiw-step.is-active .hiw-desc {
  opacity: 1;
  transform: translateY(0);
}
.hiw-step.is-active .hiw-desc { visibility: visible; }

/* Step art card */
/* Wrapper for the mobile art scaler. Invisible (display:contents) on desktop
   so the art behaves exactly as before; becomes a real clipping box on mobile. */
.hiw-art-slot { display: contents; }
.hiw-art {
  position: relative;
  height: 320px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(255,255,255,0.05), transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(255,255,255,0.025), transparent 50%),
    rgba(255,255,255,0.015);
  padding: 28px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.985);
  transition: opacity 0.9s var(--ease-out) 0.25s, transform 0.9s var(--ease-out) 0.25s;
}
.hiw-art::before {
  content: ""; position: absolute;
  top: 0; left: -50%;
  width: 60%; height: 100%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.06) 50%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}
.hiw-step.is-active .hiw-art {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.hiw-step.is-active .hiw-art::before {
  opacity: 1;
  animation: hiwArtSweep 4s var(--ease-in-out) 0.6s infinite;
}
@keyframes hiwArtSweep {
  0%, 100% { transform: translateX(-30%); }
  50%      { transform: translateX(220%); }
}

/* Step counter: hidden by default (as on ad-accounts). The [hidden] attr must win over display:flex. */
.hiw-meta[hidden] { display: none; }

/* ============================================================
   2. COMPARISON TABLE (.cmp)
   ============================================================ */
/* ============ COMPARISON TABLE ============ */
.cmp-section-head {
  margin-top: 24px;
  margin-bottom: 56px;
  align-items: end;
  text-align: center;
  justify-items: center;
}
.cmp-section-head > h2:first-child {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.cmp-section-head .label-col .lead-num {
  margin-top: 0;
  display: block;
  text-transform: uppercase;
}
@media (max-width: 960px) {
  .cmp-section-head { margin-bottom: 36px; }
}
/* Underline + dot animation on the AutoLink vs alternatives heading */
.cmp-head-uline-wrap {
  position: relative;
  display: inline-block;
  padding-bottom: 0.14em;
}
.cmp-head-uline-end {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.cmp-head-uline-end::after {
  /* Acts as the period — replaces "." after "alternatives" */
  content: "";
  position: absolute;
  left: calc(100% + 0.10em);
  bottom: 0.20em;
  width: 0.13em;
  height: 0.13em;
  border-radius: 50%;
  background: var(--text);
  opacity: 0;
  transform: translateY(-6px) scale(0.4);
  transform-origin: center;
}
.cmp-section-head.in .cmp-head-uline-end::after {
  animation: cmpHeadULineDot 0.34s var(--ease-snappy, cubic-bezier(0.22, 1, 0.36, 1)) 1.55s forwards;
}
.cmp-head-uline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 0.22em;
  overflow: visible;
  display: block;
  pointer-events: none;
}
.cmp-head-uline-stroke {
  fill: none;
  stroke: var(--text);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  opacity: 0;
}
.cmp-section-head.in .cmp-head-uline-stroke {
  opacity: 1;
  animation: cmpHeadULine 1.4s cubic-bezier(0.55, 0.1, 0.4, 0.95) 0.45s forwards;
}
@keyframes cmpHeadULine {
  to { stroke-dashoffset: 0; }
}
@keyframes cmpHeadULineDot {
  0%   { opacity: 0; transform: translateY(-6px) scale(0.4); }
  55%  { opacity: 1; transform: translateY(0) scale(1.35); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.cmp {
  position: relative;
  margin: 0;
  padding: 0 0 64px;
}
.cmp-frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255,255,255,0.04), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,0.012), rgba(255,255,255,0.005));
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 30px 80px -40px rgba(0,0,0,0.6);
}
.cmp-frame::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 90% at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 50% 50%, black 30%, transparent 80%);
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}
.cmp-corner {
  position: absolute;
  width: 22px; height: 22px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out) 0.5s;
}
.cmp.in .cmp-corner { opacity: 0.6; }
.cmp-corner::before,
.cmp-corner::after {
  content: ""; position: absolute;
  background: rgba(255,255,255,0.55);
  box-shadow: 0 0 8px rgba(255,255,255,0.35);
}
.cmp-corner::before { width: 22px; height: 1px; top: 0; left: 0; }
.cmp-corner::after  { width: 1px;  height: 22px; top: 0; left: 0; }
.cmp-corner.tl { top: -1px;    left: -1px; }
.cmp-corner.tr { top: -1px;    right: -1px;   transform: scaleX(-1); }
.cmp-corner.bl { bottom: -1px; left: -1px;    transform: scaleY(-1); }
.cmp-corner.br { bottom: -1px; right: -1px;   transform: scale(-1, -1); }

.cmp-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(180px, 0.9fr) minmax(180px, 0.9fr);
}

/* Header */
.cmp-head { display: contents; }
.cmp-head .cmp-cell {
  padding: 34px 32px 26px;
  border-bottom: 1px solid var(--line-2);
  position: relative;
}
.cmp-head-feature {
  display: flex; flex-direction: column;
  justify-content: flex-end;
}
.cmp-head-feature .cmp-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.cmp-head-col {
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  text-align: center;
  border-left: 1px solid var(--line-2);
}
.cmp-head-col .cmp-col-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* AutoLink column premium treatment */
.cmp-head-al {
  background:
    radial-gradient(ellipse 110% 130% at 50% 0%, rgba(255,255,255,0.07), transparent 70%);
}
.cmp-head-al .cmp-col-title {
  background: linear-gradient(180deg, #FFFFFF 0%, #C9CBD1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.cmp-head-al::before {
  content: "";
  position: absolute;
  top: -1px; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  z-index: 1;
}
.cmp-head-std .cmp-col-title {
  color: var(--text-2);
}

/* Body rows */
.cmp-row { display: contents; }
.cmp-row .cmp-cell {
  padding: 24px 32px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  position: relative;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}
.cmp-row .cmp-mark-cell {
  justify-content: center;
  border-left: 1px solid var(--line);
}
.cmp-row .cmp-yes-cell {
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,0.022) 50%, transparent);
}
.cmp-row:last-child .cmp-cell { border-bottom: 0; }

.cmp-row .cmp-feat { gap: 22px; }
.cmp-row .cmp-ix {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.2em;
  min-width: 28px;
  font-variant-numeric: tabular-nums;
}
.cmp-row .cmp-lbl {
  font-family: var(--font-sans);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Table cells fade in together when the table enters view (no per-row stagger) */
.cmp.in .cmp-row .cmp-cell { opacity: 1; transform: translateY(0); }

/* Per-row mark + sweep animations (all timed from when row.in is set).
   Within a single row: V is drawn FIRST and completes, THEN the X is drawn,
   so each row reads as "check, then cross" — then the next row begins. */
.cmp-row.in .cm-tick     { animation: cmpTickDraw 0.34s cubic-bezier(0.55, 0.05, 0.25, 1) 0.04s forwards; }
.cmp-row.in .cm-x1       { animation: cmpXDraw 0.20s cubic-bezier(0.55, 0.05, 0.25, 1) 0.42s forwards; }
.cmp-row.in .cm-x2       { animation: cmpXDraw 0.20s cubic-bezier(0.55, 0.05, 0.25, 1) 0.55s forwards; }
.cmp-row.in .cmp-mark-yes::before { animation: cmpYesPulse 0.7s var(--ease-out) 0.34s forwards; }
.cmp-row.in .cmp-feat::after { animation: cmpRowSweep 0.7s var(--ease-out) 0.08s forwards; }

@keyframes cmpTickDraw {
  0%   { stroke-dashoffset: 56; opacity: 0; }
  14%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes cmpXDraw {
  0%   { stroke-dashoffset: 36; opacity: 0; }
  16%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes cmpYesPulse {
  0%   { opacity: 0; transform: scale(0.65); }
  50%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.55); }
}

/* Sweep line under each feature label when its mark draws */
.cmp-row .cmp-feat::after {
  content: "";
  position: absolute;
  left: 32px; right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.45), transparent);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
}
.cmp.in .cmp-row .cmp-feat::after {
  animation: cmpRowSweep 0.7s var(--ease-out) forwards;
}

/* Marks (hand-drawn pen, no circles) */
.cmp-mark {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 40px; height: 40px;
  position: relative;
}
.cmp-mark-svg {
  width: 100%; height: 100%;
  display: block;
  overflow: visible;
}
.cm-tick {
  fill: none;
  stroke: url(#cmpInkGreen);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 56;
  stroke-dashoffset: 56;
  opacity: 0;
}
.cm-x {
  fill: none;
  stroke: url(#cmpInkRed);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  opacity: 0;
}
.cmp-mark-yes .cmp-mark-svg { transform: rotate(-3deg); }
.cmp-mark-no  .cmp-mark-svg { transform: rotate(2.5deg); }
@keyframes cmpRowSweep {
  0%   { transform: scaleX(0); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* (per-row timings live above on .cmp-row.in) */

/* Footer with signature */
.cmp-foot {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(360px, 1.8fr);
  border-top: 1px solid var(--line-2);
  background:
    radial-gradient(ellipse 60% 100% at 70% 50%, rgba(255,255,255,0.025), transparent 80%);
}
.cmp-foot-meta {
  padding: 28px 36px;
  display: flex; flex-direction: column;
  justify-content: center;
}
.cmp-foot-slogan-wrap {
  position: relative;
  display: inline-block;
  align-self: flex-start;
  padding-bottom: 12px;
}
.cmp-foot-slogan {
  font-family: var(--font-sans);
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -0.022em;
  color: var(--text);
  font-weight: 500;
  margin: 0;
  display: inline-block;
  /* Writing/clip-path reveal animation removed — slogan now just appears. */
}
.cmp-slogan-end {
  position: relative;
  white-space: nowrap;
}
.cmp-slogan-end::after {
  content: "";
  position: absolute;
  left: calc(100% + 0.06em);
  bottom: 0.08em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text);
  opacity: 0;
  transform: translateY(-3px) scale(0.4);
  transform-origin: center;
}
.cmp-foot.in .cmp-slogan-end::after {
  animation: cmpFootULineDot 0.32s var(--ease-snappy) 3.30s forwards;
}
.cmp-foot-uline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 10px;
  overflow: visible;
  display: block;
  pointer-events: none;
}
.cmp-foot-uline-stroke {
  fill: none;
  stroke: var(--text);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
  opacity: 0;
}
.cmp-foot.in .cmp-foot-uline-stroke {
  opacity: 1;
  animation: cmpFootULine 1.15s cubic-bezier(0.55, 0.1, 0.4, 0.95) 2.10s forwards;
  /* synced with signature underline flourish (data-i=7) — both draw 2.10s → 3.25s */
}
@keyframes cmpFootULine {
  to { stroke-dashoffset: 0; }
}
@keyframes cmpFootULineDot {
  0%   { opacity: 0; transform: translateY(-3px) scale(0.4); }
  55%  { opacity: 1; transform: translateY(0) scale(1.35); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.cmp-foot-sig {
  position: relative;
  padding: 16px 28px 22px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background:
    radial-gradient(ellipse 120% 130% at 50% 60%, rgba(255,255,255,0.05), transparent 75%);
}
.cmp-sig-svg {
  width: 240px;
  max-width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.cmp-sig-label {
  font-family: var(--font-sans);
  font-size: 9.5px;
  color: var(--text-3);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out) 3.35s;
}
.cmp-foot.in .cmp-sig-label { opacity: 1; }

.cmp-sig-stroke {
  fill: none;
  stroke: url(#cmpInk);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--len, 400);
  stroke-dashoffset: var(--len, 400);
  opacity: 0;
}
.cmp-foot.in .cmp-sig-stroke {
  opacity: 1;
  animation: cmpSigDraw var(--dur, 0.4s) cubic-bezier(0.45, 0.05, 0.4, 1) var(--d, 0s) forwards;
}
@keyframes cmpSigDraw {
  from { stroke-dashoffset: var(--len, 400); }
  to   { stroke-dashoffset: 0; }
}
.cmp-sig-dot { opacity: 0; transform-origin: center; }
.cmp-foot.in .cmp-sig-dot {
  animation: cmpSigDot 0.18s var(--ease-snappy) var(--ddot, 1.7s) forwards;
}
@keyframes cmpSigDot {
  0%   { opacity: 0; transform: translateY(-2px) scale(0.6); }
  60%  { opacity: 1; transform: translateY(0) scale(1.3); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
/* Per-stroke timing — starts from when footer enters view */
.cmp-sig-stroke[data-i="0"] { --len: 240; --dur: 0.22s; --d: 0.20s; }
.cmp-sig-stroke[data-i="1"] { --len: 32;  --dur: 0.08s; --d: 0.44s; }
.cmp-sig-stroke[data-i="2"] { --len: 540; --dur: 0.48s; --d: 0.54s; }
.cmp-sig-stroke[data-i="3"] { --len: 26;  --dur: 0.06s; --d: 1.04s; }
.cmp-sig-stroke[data-i="4"] { --len: 240; --dur: 0.24s; --d: 1.12s; }
.cmp-sig-stroke[data-i="5"] { --len: 400; --dur: 0.42s; --d: 1.38s; }
.cmp-sig-stroke[data-i="6"] { --len: 140; --dur: 0.16s; --d: 1.82s; }
/* data-i=7 is the signature's underline flourish — draw it in lockstep with
   the slogan underline on the left (2.10s → 3.25s) for a single synced beat. */
.cmp-sig-stroke[data-i="7"] { --len: 480; --dur: 1.15s; --d: 2.10s; }
/* i-dot pops at the same instant as the slogan-end period on the left */
.cmp-sig-dot { --ddot: 3.30s; }

@media (max-width: 860px) {
  .cmp-grid { grid-template-columns: minmax(0, 1.4fr) 92px 92px; }
  .cmp-foot { grid-template-columns: 1fr; }
  .cmp-foot-sig { border-left: 0; border-top: 1px solid var(--line); }
  .cmp-row .cmp-cell { padding: 18px 18px; }
  .cmp-head .cmp-cell { padding: 22px 18px 16px; }
  .cmp-row .cmp-feat { gap: 14px; }
  .cmp-row .cmp-lbl { font-size: 14px; }
  .cmp-head-col .cmp-col-title { font-size: 12.5px; white-space: normal; }
  .cmp-head-col .cmp-col-sub { display: none; }
  .cmp-head-feature .cmp-head-tag { font-size: 13px; max-width: none; }
  .cmp-mark { width: 28px; height: 28px; }
  .cmp-row .cmp-feat::after { left: 18px; }
}
@media (max-width: 520px) {
  .cmp-grid { grid-template-columns: minmax(0, 1fr) 64px 64px; }
  .cmp-row .cmp-feat { gap: 10px; }
  .cmp-row .cmp-ix { display: none; }
  .cmp-row .cmp-lbl { font-size: 13.5px; text-wrap: balance; }
  .cmp-row .cmp-cell { padding: 16px 12px; }
  .cmp-head .cmp-cell { padding: 18px 12px 12px; }
  .cmp-foot-meta { padding: 20px 14px; }
  .cmp-foot-slogan { font-size: 18px; }
  .cmp-foot-sig { padding: 14px 12px 18px; }
  .cmp-sig-svg { width: 180px; }
  .cmp-row .cmp-feat::after { left: 12px; }
}

/* ============ RESPONSIVE (kept last so it wins — same order as ad-accounts) ============ */
@media (max-width: 960px) {
  .section-head { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 900px) {
  .hiw-stage { grid-template-columns: 48px 1fr; }
  .hiw-rail { width: 48px; }
  .hiw-rail-line, .hiw-rail-fill { left: 23px; }
  .hiw-step { grid-template-columns: 48px 1fr; gap: 24px; margin-left: -48px; padding: 56px 0; }
  /* Stack art below text when there's no room beside it: drop to a single
     column and clear the 2-column area template so the art doesn't land in a
     phantom zero-width track. Art is the last child, so it flows under the text. */
  .hiw-step-body {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    column-gap: 0;
    row-gap: 32px;
    align-items: start;
    /* Let the 1fr column shrink below the form's min-content width. Without
       this the form rows forced the column (and heading) wider than the screen
       on iOS Safari, so nothing scaled and it overflowed off the right edge. */
    min-width: 0;
  }
  /* Art stacks below the text. On mobile the slot becomes a real clipping box,
     sized by JS (components.js) to the scaled art. The art is laid out at native
     480x320 and shrunk with transform:scale (NOT zoom — Safari mis-clips zoom +
     overflow:hidden). Panels too small to read (< 0.33) get .hiw-art-hide. */
  .hiw-art-slot {
    display: block;
    grid-column: 1;
    align-self: start;
    overflow: hidden;
    margin-inline: auto;
    min-width: 0;
    max-width: 100%;
  }
  .hiw-step-body .hiw-art {
    grid-column: 1;
    grid-row: auto;
    align-self: start;
    width: 100%;
    height: 280px;
    margin-inline: auto;
  }
  .hiw-art.hiw-art-fit  { width: 480px; height: 320px; max-width: none; transform-origin: top left; }
  .hiw-art.hiw-art-hide { display: none; }
}

/* Short / landscape viewports — compact the steps so the height-scaled art + heading fit. */
@media (max-height: 600px) and (max-width: 900px) {
  .hiw-step { padding: 26px 0; }
  .hiw-step-body { row-gap: 14px; }
}
@media (max-width: 420px) { html .cmp-head-col .cmp-col-title { font-size: 10px; letter-spacing: 0.04em; } }
@media (max-width: 400px) {
  .cmp-section-head h2 { font-size: clamp(21px, 7vw, 32px); }
}

/* ============ REDUCED MOTION (html.reduced is set by boot.js) ============
   Everything renders in its final state: steps fully visible, rail fill
   without easing, ✓/✗ marks + signature already drawn. */
html.reduced .hiw-step,
html.reduced .hiw-title span,
html.reduced .hiw-desc,
html.reduced .hiw-art,
html.reduced .hiw-dot,
html.reduced .hiw-rail-fill,
html.reduced .hiw-progress-fill::before { transition: none !important; }
html.reduced .hiw-title span,
html.reduced .hiw-desc { opacity: 1; transform: none; visibility: visible; }
html.reduced .hiw-art { opacity: 1; transform: none; }
html.reduced .hiw-art::before { animation: none !important; opacity: 0; }
html.reduced .hiw-caret-tw { animation: none !important; opacity: 0; }

html.reduced .cmp-row .cmp-cell,
html.reduced .cmp-corner,
html.reduced .cmp-sig-label { transition: none !important; }
html.reduced .cmp-row .cmp-cell { opacity: 1; transform: none; }
html.reduced .cmp-corner { opacity: 0.6; }
html.reduced .cm-tick,
html.reduced .cm-x,
html.reduced .cmp-sig-stroke,
html.reduced .cmp-head-uline-stroke,
html.reduced .cmp-foot-uline-stroke { animation: none !important; stroke-dashoffset: 0 !important; opacity: 1; }
html.reduced .cmp-sig-dot,
html.reduced .cmp-head-uline-end::after,
html.reduced .cmp-slogan-end::after { animation: none !important; opacity: 1; transform: none; }
html.reduced .cmp-sig-label { opacity: 1; }
html.reduced .cmp-row .cmp-feat::after,
html.reduced .cmp-mark-yes::before { animation: none !important; opacity: 0; }
