/* =========================================================
   Learn hub — the three-step path. Builds on style.css + adlc.css (role colours).
   ========================================================= */

.learn-hero { padding-bottom: 16px; }

/* Role colours as text and badge backgrounds need more contrast than as borders: amber and pink
   on white were 3.0-4.4:1 (review). Mix toward the text colour, which darkens them in light mode and
   lightens them in dark mode, so both themes clear 4.5:1. */
.ls-step {
  --role-text: color-mix(in srgb, var(--role) 68%, var(--text));
  --role-strong: color-mix(in srgb, var(--role) 68%, var(--text));
}
.learn-steps { padding: 8px 0 100px; }

.steps-path {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  counter-reset: step;
}

.ls-step { position: relative; display: flex; flex-direction: column; gap: 10px; }

/* Arrows between the cards show the order. */
.ls-step + .ls-step::before {
  content: "→";
  content: "→" / "";
  position: absolute;
  left: -16px;
  top: 92px;
  font: 600 18px var(--font-display);
  color: var(--text-muted);
}

.step-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 20px 20px 18px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--role);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.step-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--role) 50%, var(--border)); }

.step-n {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--role-strong);
  color: var(--bg);
  font: 600 15px var(--font-display);
}

.step-badge {
  position: absolute;
  top: 20px;
  right: 18px;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--role) 14%, transparent);
  color: var(--role-text);
  font-size: 12px;
  font-weight: 600;
}

.step-art { width: 120px; height: 80px; margin: 6px 0 2px; }
.step-card h2 { margin: 0; font-family: var(--font-display); font-size: 21px; }
.step-card p { margin: 0; color: var(--text-muted); font-size: 14.5px; line-height: 1.55; }
/* Right padding keeps the meta line clear of the → (they overlapped at some widths). */
.step-meta { margin-top: auto; padding: 8px 30px 0 0; font: 500 12.5px var(--font-mono); color: var(--role-text); }

.step-go {
  position: absolute;
  right: 18px;
  bottom: 16px;
  font-size: 20px;
  color: var(--role-text);
  transition: transform 0.15s ease;
}

.step-card:hover .step-go { transform: translateX(3px); }

/* Card illustrations */
.a-phone { fill: none; stroke: var(--pm); stroke-width: 3; }
.a-arrow { fill: none; stroke: var(--text-muted); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.a-agent { fill: var(--agent); }
.a-agent-line { stroke: var(--agent); stroke-width: 3; }
.a-eye { fill: var(--bg-elevated); }
.a-ring { fill: none; stroke: color-mix(in srgb, var(--agent) 35%, var(--border)); stroke-width: 5; }
.a-node.h { fill: var(--human); }
.a-node.a { fill: var(--agent); }
.a-node.g { fill: var(--gate); }
.a-pad { fill: none; stroke: var(--human); stroke-width: 3; }
.a-dpad { stroke: var(--human); stroke-width: 3; stroke-linecap: round; }
.a-btn { fill: var(--human); }

.phase-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.phase-chips a {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
}

.phase-chips a:hover { color: var(--accent-strong); border-color: var(--accent); }

.learn-more {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.learn-more h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: 18px; }
.learn-more ul { margin: 0; padding-left: 18px; color: var(--text-muted); }
.learn-more li { margin: 4px 0; }

/* Reference model: download card */
.ref-model {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 28px;
  align-items: center;
  margin-top: 44px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
}

.ref-kicker {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.ref-text h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: 24px; line-height: 1.2; }
.ref-text p { margin: 0 0 16px; color: var(--text-muted); font-size: 15px; line-height: 1.6; }

.ref-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.ref-note { margin: 0 0 12px !important; font-size: 13px !important; }

.ref-diff { font-size: 13.5px !important; padding-left: 12px; border-left: 3px solid var(--border); }
.ref-textalt { font-size: 14px; color: var(--text-muted); }
.ref-textalt summary { cursor: pointer; font-weight: 600; color: var(--text); }
.ref-textalt ol { margin: 10px 0 0; padding-left: 20px; line-height: 1.55; }
.ref-textalt li { margin: 6px 0; }
.ref-textalt strong { color: var(--text); }

/* The diagram paints its own light background in both themes; the frame keeps it from floating. */
.ref-figure {
  display: block;
  order: 2;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ref-figure:hover { transform: translateY(-2px); }
.ref-figure img { display: block; width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
  .step-card,
  .step-go,
  .ref-figure { transition: none; }
  .step-card:hover,
  .ref-figure:hover { transform: none; }
}

@media (max-width: 900px) {
  .ref-model { grid-template-columns: 1fr; padding: 18px; }
  .ref-figure { order: 0; }
  .steps-path { grid-template-columns: 1fr; gap: 26px; }
  .ls-step + .ls-step::before { content: "↓"; content: "↓" / ""; left: 24px; top: -24px; }
}
