/* ==========================================================================
   Views — hero, wizard, logic map, review, versions, templates, tour
   ========================================================================== */

/* ============================================================== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  padding: var(--s-7) var(--s-6);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 140% at 88% -10%, color-mix(in srgb, var(--brand-sky) 22%, transparent), transparent 62%),
    radial-gradient(90% 120% at 4% 110%, color-mix(in srgb, var(--brand-teal) 16%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
}
/* The colour fan from the logo, echoed as a hairline along the top edge */
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 4px;
  background: linear-gradient(90deg,
    var(--brand-gold) 0 25%, var(--brand-lime) 25% 50%,
    var(--brand-teal) 50% 75%, var(--brand-crimson) 75% 100%);
  transform-origin: left;
  animation: fanIn var(--d-slower) var(--e-out) both;
}
@keyframes fanIn { from { transform: scaleX(0); } }

.hero-grid {
  position: relative; display: grid; gap: var(--s-6);
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
}
/* The headline carries its own emphasis. "titik awal" is the point the
   sentence turns on, so it steps up in weight — a gradient clipped to text
   made the colour do a job the type should do, and cost the phrase its
   contrast on every background it sat on. */
.hero h1 {
  font-size: var(--t-4xl);
  font-weight: 500;
  letter-spacing: -.03em;
  max-width: 16ch;
}
.hero h1 .accent { font-weight: 700; }
.hero p.lede {
  margin-top: var(--s-4); font-size: var(--t-md);
  color: var(--ink-soft); max-width: 54ch;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: var(--s-5);
  margin-top: var(--s-6); padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.hero-stat b {
  display: block; font-family: var(--font-head);
  font-size: var(--t-2xl); font-weight: 600; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.hero-stat span { font-size: var(--t-xs); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }

/* Animated door — the brand mark as the hero illustration */
.hero-art { display: grid; place-items: center; }
.hero-art .logo-mark { width: min(280px, 70vw); height: auto; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-art { order: -1; }
  .hero-art .logo-mark { width: min(180px, 46vw); }
  .hero { padding: var(--s-6) var(--s-4); }
}

/* =========================================================== Workbench === */
.workbench {
  display: grid; gap: var(--s-5);
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 1100px) { .workbench { grid-template-columns: minmax(0, 1fr); } }

/* ---- Step rail ---------------------------------------------------------- */
.steps { padding: var(--s-4); display: grid; gap: 4px; position: sticky; top: calc(var(--topbar) + var(--s-4)); }
@media (max-width: 1100px) {
  .steps { position: static; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); overflow-x: auto; scroll-snap-type: x mandatory; }
  .step { scroll-snap-align: start; }
}

.step {
  position: relative;
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3);
  min-height: 56px;
  border-radius: var(--r-md);
  text-align: left; color: var(--ink-soft);
  transition: background-color var(--d-fast) var(--e-out), color var(--d-fast) var(--e-out);
}
.step:hover { background: var(--surface-3); }
.step[aria-current="step"] { background: var(--lv-wash, var(--accent-wash)); color: var(--ink); }
.step-num {
  display: grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-3); color: var(--ink-soft);
  font-family: var(--font-head); font-size: var(--t-sm); font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background-color var(--d-base) var(--e-out-expo), color var(--d-base) var(--e-out), transform var(--d-base) var(--e-out-expo);
}
/* Level `-solid` tones are fills, not text backgrounds: white on teal is
   2.7:1 and on gold 1.6:1. The `-ink` tone is contrast-checked against
   --surface in both themes, so that is the pair used wherever text sits
   on a level colour. */
.step[aria-current="step"] .step-num {
  background: var(--lv-ink, var(--accent-ink)); color: var(--surface);
  transform: scale(1.06);
}
.step.done .step-num { background: var(--success-wash); color: var(--success); }
.step.done .step-num svg { width: 15px; height: 15px; stroke-width: 3; }
.step-txt { display: grid; min-width: 0; line-height: 1.3; }
.step-txt b { font-family: var(--font-head); font-size: var(--t-base); font-weight: 600; }
.step-txt span { font-size: var(--t-xs); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Composer ----------------------------------------------------------- */
.composer { padding: var(--s-6); min-height: 460px; }
@media (max-width: 600px) { .composer { padding: var(--s-4); } }

/* Step transition: content slides in from the direction of travel */
.composer-inner { animation: stepIn var(--d-slow) var(--e-out) both; }
.composer-inner[data-dir="back"] { animation-name: stepInBack; }
@keyframes stepIn     { from { opacity: 0; transform: translateX(18px); } }
@keyframes stepInBack { from { opacity: 0; transform: translateX(-18px); } }

.composer-foot {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  margin-top: var(--s-6); padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.composer-foot .hint { font-size: var(--t-xs); color: var(--ink-faint); }
.composer-foot .spacer { margin-left: auto; }
.composer-foot .grp { display: flex; gap: var(--s-3); flex-wrap: wrap; }

/* ---- Node list (outcomes / outputs / activities) ------------------------ */
.level-tabs { display: flex; gap: var(--s-2); margin-bottom: var(--s-5); overflow-x: auto; padding-bottom: 2px; }
.level-tab {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 38px; padding: 0 var(--s-4);
  border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--ink-soft);
  font-family: var(--font-head); font-size: var(--t-sm); font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--d-base) var(--e-out), color var(--d-base) var(--e-out), transform var(--d-fast) var(--e-out);
}
.level-tab:hover { transform: translateY(-1px); }
.level-tab .n {
  min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center; border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-soft);
  font-size: var(--t-xs); font-variant-numeric: tabular-nums;
}
.level-tab[aria-selected="true"] { background: var(--lv-wash); color: var(--lv-ink); }
/* Level solids are fills, not text backgrounds — the count sits on the wash
   with the text-safe -ink tone instead. */
.level-tab[aria-selected="true"] .n { background: var(--surface); color: var(--lv-ink); }

.node-list { display: grid; gap: var(--s-3); }
.node {
  position: relative;
  display: flex; align-items: flex-start; gap: var(--s-4);
  padding: var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color var(--d-fast) var(--e-out), box-shadow var(--d-fast) var(--e-out), transform var(--d-fast) var(--e-out);
}
/* The selected level tab names the level and .node-idx is already tinted with
   it, so the rail was a third statement of the same fact. */
.node { border-color: color-mix(in srgb, var(--lv-solid) 30%, var(--line)); }
.node:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); transform: translateY(-1px); }
.node-idx {
  flex: none; font-family: var(--font-mono); font-size: var(--t-xs);
  font-weight: 600; color: var(--lv-ink, var(--ink-faint));
  padding-top: 3px; font-variant-numeric: tabular-nums;
}
.node-body { flex: 1; min-width: 0; }
.node-body .kicker {
  display: block; font-size: var(--t-xs); font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--lv-ink, var(--ink-faint)); margin-bottom: 3px;
}
.node-body p { overflow-wrap: anywhere; }
.node-tools { display: flex; gap: 2px; flex: none; }
.node-tools .icon-btn { width: 34px; height: 34px; }
.node-tools .icon-btn svg { width: 16px; height: 16px; }
.node-tools .icon-btn.del:hover { background: var(--danger-wash); color: var(--danger); }

/* Enter / leave choreography for list items */
.node.is-new { animation: nodeIn var(--d-slow) var(--e-out-expo) both; }
@keyframes nodeIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
.node.is-leaving { animation: nodeOut var(--d-base) var(--e-inout) both; }
@keyframes nodeOut { to { opacity: 0; transform: translateX(24px) scale(.96); } }

.add-row {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  width: 100%; min-height: 48px; margin-top: var(--s-3);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--ink-soft);
  font-family: var(--font-head); font-weight: 600; font-size: var(--t-sm);
  transition: border-color var(--d-fast) var(--e-out), color var(--d-fast) var(--e-out), background-color var(--d-fast) var(--e-out);
}
.add-row svg { width: 17px; height: 17px; }
.add-row:hover { border-color: var(--lv-solid, var(--accent)); color: var(--lv-ink, var(--accent-ink)); background: var(--lv-wash, var(--accent-wash)); }

/* ---- Assumption cards --------------------------------------------------- */
.gate-list { display: grid; gap: var(--s-3); }
.gate {
  position: relative; padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--lv-assume-wash);
  border: 1px solid color-mix(in srgb, var(--lv-assume-solid) 26%, transparent);
}
.gate-top { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-2); }
.gate-top small {
  font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--lv-assume-ink);
}
.gate-top .node-tools { margin-left: auto; }

/* Which link the assumption guards. Sits under the sentence because it is a
   property of what was just written, not a separate question. */
.gate-bridge { display: block; margin-top: var(--s-3); }
.gate-bridge select {
  width: 100%; min-height: 38px;
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  border: 1px solid color-mix(in srgb, var(--lv-assume-solid) 32%, transparent);
  background: var(--surface);
  color: var(--ink); font-size: var(--t-sm);
  /* The browser's own arrow ships with no design system; the rest of the app
     themes its chrome, so this does too. */
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: var(--s-7);
  transition: border-color var(--d-fast) var(--e-out);
}
.gate-bridge select:hover { border-color: var(--lv-assume-solid); }

/* ============================================================ Logic map == */
.map-wrap { padding: var(--s-5); overflow: hidden; }
.map-head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-5); }
.map-head .spacer { margin-left: auto; }

.map-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: var(--s-3); }
.map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(216px, 1fr));
  /* The gutters are not decoration: the bundled connectors are drawn in them,
     so they need enough room for the curve to read as a link. */
  column-gap: var(--s-7);
  row-gap: var(--s-4);
  min-width: 1040px;
}
@media (max-width: 780px) {
  .map { grid-template-columns: minmax(0, 1fr); min-width: 0; column-gap: 0; row-gap: var(--s-5); }
  .map-scroll { overflow-x: visible; }
}

.map-col { display: grid; gap: var(--s-3); align-content: start; }
.map-col-head { display: flex; align-items: center; gap: var(--s-2); padding-bottom: var(--s-2); }
.map-col-head .swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--lv-solid); flex: none; }
.map-col-head b { font-family: var(--font-head); font-size: var(--t-sm); font-weight: 600; }
/* The count sits beside its own label, not at the far edge of the column —
   flushed right it reads as belonging to the next column along. */
.map-col-head .n {
  min-width: 20px; height: 20px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--lv-wash); color: var(--lv-ink);
  font-size: var(--t-xs); font-weight: 700; font-variant-numeric: tabular-nums;
}

/* Drop zone */
.map-drop {
  display: grid; gap: var(--s-3); align-content: start;
  min-height: 120px; padding: var(--s-2);
  border-radius: var(--r-md);
  border: 1.5px dashed transparent;
  transition: background-color var(--d-base) var(--e-out), border-color var(--d-base) var(--e-out);
}
.map-drop.drop-active { background: var(--lv-wash); border-color: var(--lv-solid); }

.map-card {
  position: relative;
  padding: var(--s-4) var(--s-4) var(--s-3);
  background: var(--surface);
  /* The column header states the level with a swatch and a name, so a thick
     accent bar on every card underneath repeated it. A 1px level border keeps
     the card tied to its column without shouting it a second time. */
  border: 1px solid var(--lv-solid);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  cursor: grab;
  transition: box-shadow var(--d-fast) var(--e-out), transform var(--d-fast) var(--e-out),
              border-color var(--d-fast) var(--e-out), opacity var(--d-fast) var(--e-out);
}
.map-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.map-card:active { cursor: grabbing; }
.map-card.dragging { opacity: .45; box-shadow: var(--sh-4); transform: scale(1.03) rotate(1deg); cursor: grabbing; }
.map-card.is-new { animation: nodeIn var(--d-slow) var(--e-out-expo) both; }
.map-card p { font-size: var(--t-sm); overflow-wrap: anywhere; }
.map-card .grip {
  position: absolute; top: var(--s-2); right: var(--s-2);
  color: var(--ink-faint); opacity: 0;
  transition: opacity var(--d-fast) var(--e-out);
}
.map-card:hover .grip, .map-card:focus-within .grip { opacity: 1; }
.map-card .grip svg { width: 15px; height: 15px; }

/* Keyboard / pointer alternative to dragging (WCAG 2.2 — Dragging Movements) */
/* grid-template-rows 0fr -> 1fr instead of a guessed max-height: it animates
   to the row's real height, so the reveal never clips a taller row and never
   pauses on the slack of an over-large maximum. */
.map-card-tools {
  display: grid; grid-template-rows: 0fr;
  opacity: 0; overflow: hidden;
  transition: opacity var(--d-base) var(--e-out), grid-template-rows var(--d-base) var(--e-out);
}
.map-card-tools > .tools-row {
  display: flex; gap: 2px; min-height: 0; overflow: hidden;
  margin-top: var(--s-2); padding-top: var(--s-2); border-top: 1px solid var(--line);
}
.map-card:hover .map-card-tools,
.map-card:focus-within .map-card-tools,
.map-card.tools-open .map-card-tools { opacity: 1; grid-template-rows: 1fr; }
.map-card-tools .icon-btn { width: 30px; height: 30px; }
.map-card-tools .icon-btn svg { width: 14px; height: 14px; }
.map-card-tools .icon-btn[disabled] { opacity: .28; }
.map-card-tools .sp { margin-left: auto; }

.map-empty {
  display: grid; place-items: center; gap: var(--s-2);
  padding: var(--s-5) var(--s-3);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  font-size: var(--t-xs); color: var(--ink-faint); text-align: center;
}

/* Assumption gate strip sitting between the columns */
.map-gate {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: var(--s-1) 0;
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-pill);
  background: var(--lv-assume-wash);
  color: var(--lv-assume-ink);
  font-size: var(--t-xs); font-weight: 700; white-space: nowrap;
  cursor: pointer;
  transition: transform var(--d-fast) var(--e-out), box-shadow var(--d-fast) var(--e-out);
}
.map-gate:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.map-gate svg { width: 13px; height: 13px; }

/* Connector layer — drawn behind the cards */
.map-links { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: visible; }
.map-links path {
  fill: none; stroke-width: 1.6; stroke-linecap: round;
  stroke-dasharray: var(--len); stroke-dashoffset: var(--len);
  animation: drawLink var(--d-slower) var(--e-out) forwards;
  opacity: .5;
}
@keyframes drawLink { to { stroke-dashoffset: 0; } }
.map-col, .map-drop { position: relative; z-index: 1; }

/* ============================================================== Review === */
.review-grid { display: grid; gap: var(--s-5); grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; }
@media (max-width: 900px) { .review-grid { grid-template-columns: minmax(0, 1fr); } }

.review-splash { padding: var(--s-6); display: grid; gap: var(--s-4); align-content: start; }

/* The un-run state is one column at a reading width, not a split that has
   nothing to put in its second half. */
.review-intro { max-width: var(--measure); display: grid; gap: var(--s-4); justify-items: start; }
.review-intro .view-title { max-width: 20ch; }
.review-lede { color: var(--ink-soft); max-width: var(--measure-tight); }
.review-checks-h {
  font-family: var(--font-head); font-size: var(--t-base); font-weight: 600;
  margin-top: var(--s-3);
}
.review-checks {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: var(--s-2);
  font-size: var(--t-sm);
}
.review-checks li { display: flex; align-items: center; gap: var(--s-3); color: var(--ink-soft); }
.review-checks .dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--lv-solid);
}
.review-splash h3 { max-width: 22ch; }
.review-splash p { color: var(--ink-soft); font-size: var(--t-sm); }

.score-row { display: grid; grid-template-columns: 108px minmax(0, 1fr) 44px; gap: var(--s-3); align-items: center; padding: var(--s-2) 0; }
.score-row > span { font-size: var(--t-sm); font-weight: 600; font-family: var(--font-head); }
.score-row > b { text-align: right; font-size: var(--t-sm); font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.score-row .bar > i { background: var(--lv-solid); }
@media (max-width: 480px) { .score-row { grid-template-columns: 84px minmax(0, 1fr) 40px; } }

.risk-list { display: grid; gap: var(--s-3); margin-top: var(--s-5); }
.risk {
  display: flex; gap: var(--s-3); padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--lv-assume-wash);
  border: 1px solid color-mix(in srgb, var(--lv-assume-solid) 34%, transparent);
  font-size: var(--t-sm);
}
.risk svg { width: 17px; height: 17px; flex: none; color: var(--lv-assume-ink); margin-top: 2px; }
.risk b { display: block; font-family: var(--font-head); color: var(--ink); }
.risk span { color: var(--ink-soft); }

.ind-table { display: grid; gap: var(--s-2); margin-top: var(--s-5); }
.ind {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2);
  transition: border-color var(--d-fast) var(--e-out);
}
.ind:hover { border-color: var(--line-strong); }
.ind p { flex: 1; min-width: 0; font-size: var(--t-sm); }
.ind .btn { flex: none; }
.ind.used { background: var(--success-wash); border-color: color-mix(in srgb, var(--success) 30%, transparent); }

/* ============================================================ Versions === */
.version {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2);
  transition: border-color var(--d-fast) var(--e-out), transform var(--d-fast) var(--e-out);
}
.version:hover { border-color: var(--line-strong); transform: translateX(2px); }
.version .v-dot {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent-wash); color: var(--accent-ink);
}
.version .v-dot svg { width: 16px; height: 16px; }
.version-body { flex: 1; min-width: 0; }
.version-body { display: grid; gap: 2px; }
.version-body b { font-family: var(--font-head); font-size: var(--t-base); display: block; }
.version-body span { font-size: var(--t-xs); color: var(--ink-soft); }
.version-body .v-alias { color: var(--ink-faint); font-style: italic; }
.version-body time { font-variant-numeric: tabular-nums; }

/* =========================================================== Templates === */
.tpl-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tpl {
  position: relative; overflow: hidden;
  display: grid; gap: var(--s-3); align-content: start;
  padding: var(--s-5);
  text-align: left;
  border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--sh-1);
  transition: transform var(--d-base) var(--e-out), box-shadow var(--d-base) var(--e-out), border-color var(--d-base) var(--e-out);
}
.tpl::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: var(--lv-solid); transform: scaleX(0); transform-origin: left;
  transition: transform var(--d-slow) var(--e-out);
}
.tpl:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: var(--line-strong); }
.tpl:hover::before, .tpl:focus-visible::before { transform: scaleX(1); }
.tpl-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--lv-wash); color: var(--lv-ink); }
.tpl-ico svg { width: 21px; height: 21px; }
.tpl b { font-family: var(--font-head); font-size: var(--t-md); font-weight: 600; }
.tpl p { font-size: var(--t-sm); color: var(--ink-soft); }
.tpl .tpl-meta { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-1); }

/* ================================================================ Tour === */
.tour-veil {
  position: fixed; inset: 0; z-index: 150;
  background: color-mix(in srgb, var(--brand-navy-deep) 62%, transparent);
  opacity: 0; visibility: hidden;
  transition: opacity var(--d-base) var(--e-out), visibility var(--d-base);
}
.tour-veil.open { opacity: 1; visibility: visible; }
.tour-spot {
  position: fixed; z-index: 151; pointer-events: none;
  border-radius: var(--r-md);
  box-shadow: 0 0 0 9999px color-mix(in srgb, var(--brand-navy-deep) 62%, transparent),
              0 0 0 3px var(--accent);
  transition: all var(--d-slow) var(--e-inout);
}
.tour-pop {
  position: fixed; z-index: 152;
  width: min(340px, calc(100vw - var(--s-6)));
  padding: var(--s-5);
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-4);
  transition: all var(--d-slow) var(--e-inout);
}
.tour-pop h4 { font-size: var(--t-md); margin-bottom: var(--s-2); }
.tour-pop p { font-size: var(--t-sm); color: var(--ink-soft); }
.tour-foot { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-5); }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); transition: all var(--d-base) var(--e-out-expo); }
.tour-dots i.on { width: 18px; border-radius: var(--r-pill); background: var(--accent); }

/* ======================================================= Scroll reveal ===
   Scoped to .js-reveal (set by motion.js) so content is never hidden unless
   the script that reveals it is actually running. */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(14px); }
[data-reveal].revealed {
  opacity: 1; transform: none;
  transition: opacity var(--d-slow) var(--e-out), transform var(--d-slow) var(--e-out);
  transition-delay: var(--reveal-delay, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  .js-reveal [data-reveal] { opacity: 1; transform: none; }
}

/* ==========================================================================
   Learn — the "how it works" tutorial view
   ========================================================================== */
.learn { display: grid; gap: var(--s-6); max-width: 940px; }

.learn-intro { display: grid; gap: var(--s-3); }
.learn-intro h2 { max-width: 20ch; }
.learn-lede { color: var(--ink-soft); font-size: var(--t-md); max-width: 64ch; line-height: 1.65; }
.learn-lede b { color: var(--ink); font-weight: 600; }
.learn-time {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-size: var(--t-xs); color: var(--ink-faint); font-weight: 600;
}
.learn-time svg { width: 14px; height: 14px; }
.learn-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-3); }

.learn-block { display: grid; gap: var(--s-3); }
.learn-block h3 { max-width: 26ch; }
.learn-sub { color: var(--ink-soft); max-width: 66ch; line-height: 1.65; }
.learn-sub b { color: var(--ink); font-weight: 600; }

/* ---- the four-level ladder ---------------------------------------------- */
.ladder { display: grid; gap: var(--s-3); margin-top: var(--s-2); }
.rung {
  position: relative;
  padding: var(--s-5); padding-left: calc(var(--s-5) + 5px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
  display: grid; gap: var(--s-4);
}
.rung::before {
  content: ""; position: absolute; left: 0; top: var(--s-5); bottom: var(--s-5);
  width: 5px; border-radius: 0 5px 5px 0; background: var(--lv-solid);
}
.rung-head { display: flex; align-items: flex-start; gap: var(--s-4); }
.rung-head > div { flex: 1; min-width: 0; }
.rung-head b { font-family: var(--font-head); font-size: var(--t-lg); font-weight: 600; display: block; }
.rung-head p { color: var(--ink-soft); font-size: var(--t-sm); margin-top: 3px; max-width: 58ch; }
.rung-ico {
  flex: none; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: var(--r-md);
  background: var(--lv-wash); color: var(--lv-ink);
}
.rung-ico svg { width: 21px; height: 21px; }
/* A readable order badge, not a faint watermark: a numeral tinted to near
   invisibility reads as a rendering fault, and it still has to clear 4.5:1
   because it is real text on screen. */
.rung-n {
  flex: none; display: grid; place-items: center;
  min-width: 26px; height: 26px; padding: 0 7px;
  border-radius: var(--r-pill);
  background: var(--lv-wash); color: var(--lv-ink);
  font-family: var(--font-head); font-size: var(--t-sm);
  font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
}
.rung-q {
  display: flex; gap: var(--s-3); align-items: flex-start;
  padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  background: var(--lv-wash); color: var(--ink);
  font-size: var(--t-sm); line-height: 1.55;
}
.rung-q svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--lv-ink); }
.rung-q b { font-family: var(--font-head); color: var(--lv-ink); }

/* Good vs wrong, side by side — the comparison is the teaching, so it must
   read as one unit rather than two unrelated boxes. */
.rung-ex { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.ex {
  padding: var(--s-4); border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-2);
  display: grid; gap: var(--s-2); align-content: start;
}
.ex p { font-size: var(--t-sm); line-height: 1.55; }
.ex-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-xs); font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.ex-tag svg { width: 14px; height: 14px; }
.ex.good { border-color: color-mix(in srgb, var(--success) 34%, transparent); background: var(--success-wash); }
.ex.good .ex-tag { color: var(--success); }
.ex.bad { border-color: color-mix(in srgb, var(--lv-assume-solid) 30%, transparent); background: var(--lv-assume-wash); }
.ex.bad .ex-tag { color: var(--lv-assume-ink); }
@media (max-width: 720px) { .rung-ex { grid-template-columns: 1fr; } }

/* ---- outcome vs output -------------------------------------------------- */
.vs-grid {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: var(--s-4); align-items: stretch; margin-top: var(--s-2);
}
.vs-card {
  display: grid; gap: var(--s-3); align-content: start;
  padding: var(--s-5); border-radius: var(--r-lg);
  border: 1px solid var(--lv-solid); background: var(--surface);
  box-shadow: var(--sh-1);
}
.vs-ex { font-family: var(--font-head); font-size: var(--t-md); line-height: 1.45; }
.vs-why { font-size: var(--t-sm); color: var(--ink-soft); }
.vs-arrow { display: grid; place-items: center; color: var(--ink-faint); }
.vs-arrow svg { width: 26px; height: 26px; }
@media (max-width: 720px) {
  .vs-grid { grid-template-columns: 1fr; }
  .vs-arrow { transform: rotate(90deg); }
}

/* ---- assumptions -------------------------------------------------------- */
.assume-demo {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: var(--s-4);
  margin-top: var(--s-2);
}
.assume-side, .assume-bridge {
  padding: var(--s-5); border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--surface);
  display: grid; gap: var(--s-3); align-content: start;
}
.assume-side p { font-size: var(--t-sm); line-height: 1.7; color: var(--ink-soft); }
.assume-bridge {
  background: var(--lv-assume-wash);
  border-color: color-mix(in srgb, var(--lv-assume-solid) 26%, transparent);
}
.assume-bridge p { font-size: var(--t-sm); line-height: 1.6; }
@media (max-width: 720px) { .assume-demo { grid-template-columns: 1fr; } }

/* ---- the five steps ----------------------------------------------------- */
.learn-steps { display: grid; gap: var(--s-2); margin-top: var(--s-2); }
.learn-step {
  display: flex; align-items: center; gap: var(--s-4);
  padding: var(--s-4); min-height: 64px; text-align: left;
  border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color var(--d-fast) var(--e-out),
              transform var(--d-fast) var(--e-out),
              box-shadow var(--d-fast) var(--e-out);
}
.learn-step:hover { transform: translateX(3px); border-color: var(--lv-solid); box-shadow: var(--sh-2); }
.learn-step-n {
  flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--lv-ink); color: var(--surface);
  font-family: var(--font-head); font-weight: 700; font-size: var(--t-sm);
}
.learn-step-txt { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.learn-step-txt b { font-family: var(--font-head); font-size: var(--t-base); font-weight: 600; }
.learn-step-txt span { font-size: var(--t-xs); color: var(--ink-soft); }
.learn-step-go {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-xs); font-weight: 600; color: var(--lv-ink);
  opacity: 0; transform: translateX(-4px);
  transition: opacity var(--d-fast) var(--e-out), transform var(--d-base) var(--e-out);
}
.learn-step-go svg { width: 15px; height: 15px; }
.learn-step:hover .learn-step-go, .learn-step:focus-visible .learn-step-go { opacity: 1; transform: none; }
@media (max-width: 560px) { .learn-step-go { display: none; } }

/* ---- FAQ ---------------------------------------------------------------- */
.faq-list { display: grid; gap: var(--s-2); margin-top: var(--s-2); }
.faq {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); overflow: hidden;
}
.faq summary {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4); min-height: 56px; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: var(--t-base);
  list-style: none;
  transition: background-color var(--d-fast) var(--e-out);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--surface-2); }
.faq summary span:first-child { flex: 1; min-width: 0; }
.faq-mark { flex: none; display: grid; place-items: center; color: var(--ink-faint); }
.faq-mark svg { width: 17px; height: 17px; transition: transform var(--d-base) var(--e-out-expo); }
.faq[open] .faq-mark svg { transform: rotate(90deg); }
.faq[open] summary { background: var(--surface-2); }
.faq > p {
  padding: 0 var(--s-4) var(--s-4);
  color: var(--ink-soft); font-size: var(--t-sm); line-height: 1.65; max-width: 68ch;
}

.learn-foot { display: flex; justify-content: center; padding: var(--s-4) 0 var(--s-6); }

/* Second rail group heading needs air above it. */
.rail-heading-2 { margin-top: var(--s-5); }

/* A step that was opened and left empty is not a finished step. Hollow ring,
   no tick — "visited" must never read as "done". */
.step.visited .step-num {
  background: transparent;
  color: var(--ink-faint);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}


/* icons.js emits an <svg> with no intrinsic size, so an icon dropped into a
   grid cell stretched to the cell: the empty map showed four 178px plus signs.
   Every icon in a bare container gets a size here. */
.map-empty svg { width: 22px; height: 22px; }
.empty svg { width: 34px; height: 34px; }

/* The map is a horizontal scroller that almost always overflows at desktop
   widths; the Activities column was cut mid-word with nothing to say so. */
.map-scroll { scroll-padding-inline: var(--s-4); }
@media (min-width: 781px) {
  .map-scroll {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent 100%);
  }
  .map-scroll.at-end { -webkit-mask-image: none; mask-image: none; }
}

/* ==========================================================================
   The chain — the descent that replaced the level tabs
   ========================================================================== */
.chain { display: grid; gap: 0; }

/* The impact stays pinned at the top of the descent: every question below is
   reaching for it, so it must not scroll out of the argument. */
.chain-anchor {
  margin: 0 0 var(--s-2);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  background: var(--lv-wash);
  border: 1px solid color-mix(in srgb, var(--lv-solid) 30%, transparent);
}
.chain-anchor figcaption {
  font-size: var(--t-xs); font-weight: 700; color: var(--lv-ink);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: var(--s-2);
}
.chain-anchor blockquote {
  margin: 0; font-family: var(--font-head); font-size: var(--t-md);
  line-height: 1.45; max-width: var(--measure-tight);
}

.chain-link {
  position: relative;
  padding: var(--s-5) 0 var(--s-5) var(--s-6);
  display: grid; gap: var(--s-3);
}
/* One continuous line down the whole descent, tinted per level: the chain is
   literally drawn, rather than implied by three tabs sitting side by side. */
.chain-link::before {
  content: ""; position: absolute; left: 7px; top: 0; bottom: 0;
  width: 2px; background: var(--lv-solid); opacity: .45;
}
.chain-link:last-of-type::before { bottom: auto; height: 36px; }
.chain-link::after {
  content: ""; position: absolute; left: 2px; top: calc(var(--s-5) + 6px);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--lv-solid);
  box-shadow: 0 0 0 4px var(--surface);
}

.chain-q {
  font-family: var(--font-head); font-size: var(--t-lg);
  font-weight: 500; line-height: 1.35; max-width: 44ch;
  text-wrap: balance;
}
.chain-meta { display: flex; align-items: center; gap: var(--s-3); }
.chain-count { font-size: var(--t-xs); color: var(--ink-soft); }

@media (max-width: 600px) {
  .chain-link { padding-left: var(--s-5); }
  .chain-link::before { left: 5px; }
  .chain-link::after { left: 0; width: 10px; height: 10px; }
}

/* ==========================================================================
   Workshop mode — the same document, read across a room
   ========================================================================== */
:root[data-stage="on"] {
  --t-xs: .9375rem; --t-sm: 1.0625rem; --t-base: 1.25rem;
  --t-md: 1.4375rem; --t-lg: 1.625rem; --t-xl: 2rem;
  --t-2xl: 2.5rem;  --t-3xl: 3rem;     --t-4xl: 3.75rem;
}
/* Workshop mode projects the work and hides everything that is not it. The
   .limit-bar that used to sit in this selector list is gone; .rail and
   #mapSection are not, and taking the whole rule out with it left the rail
   occupying the single column the shell collapses to, which pushed the work
   off the screen. */
:root[data-stage="on"] .rail,
:root[data-stage="on"] #mapSection { display: none; }
:root[data-stage="on"] .shell { grid-template-columns: minmax(0, 1fr); }
:root[data-stage="on"] .workbench { grid-template-columns: minmax(0, 1fr); }
:root[data-stage="on"] .page { width: min(1100px, 100%); }
:root[data-stage="on"] .steps {
  position: static; grid-auto-flow: column; grid-auto-columns: 1fr; overflow: visible;
}
:root[data-stage="on"] .step-txt span { display: none; }
.stage-note {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4);
  border-radius: var(--r-md);
  background: var(--accent-wash); color: var(--accent-ink);
  font-size: var(--t-sm); font-weight: 600;
}
.stage-note svg { width: 18px; height: 18px; flex: none; }
/* The way out sits at the far end, where a control that leaves belongs. */
.stage-note .btn { margin-left: auto; flex: none; }
:root:not([data-stage="on"]) .stage-note { display: none; }


@media (max-width: 600px) {
  /* The summary step ends with three buttons; in one nowrap row they reached
     508px on a 375px screen. Stack the footer and let each take the width. */
  .composer-foot { flex-direction: column; align-items: stretch; }
  .composer-foot .spacer { display: none; }
  .composer-foot .grp { width: 100%; }
  .composer-foot .grp .btn { flex: 1 1 12ch; }
}

@media (max-width: 600px) {
  /* .btn is nowrap by design, but "Tur singkat antarmuka" at lg size is wider
     than a 375px screen minus the card's padding, so the whole learn card had
     a min-content of 357px and pushed the document sideways. Stacked and
     allowed to wrap, the label sets its own height instead. */
  .learn-cta { flex-direction: column; align-items: stretch; }
  .learn-cta .btn { width: 100%; white-space: normal; height: auto; min-height: 52px; padding: var(--s-3) var(--s-4); }
  .learn-intro { padding: var(--s-4); }
}
