/* Auto-Nudge explainer. Markup: [data-an] in index.html; behaviour: assets/auto-nudge.js. */

.an-wrap { padding: clamp(64px, 8vw, 104px) 0; background: #1a1612; color: #f3ece0; }
.an-wrap .section-chip { background: rgba(243, 236, 224, .1); color: #f3ece0; }
.an-wrap h2 { color: #fff; }
.an-wrap .lead { color: #d8cfbc; }
.an-head { max-width: 800px; }
.an-head .lead { margin-top: 16px; }

.an {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 16px;
  margin-top: clamp(28px, 3.5vw, 44px);
  align-items: stretch;
}
.an__stage {
  margin: 0;
  border-radius: 16px;
  background: #221d18;
  border: 1px solid rgba(243, 236, 224, .12);
  overflow: hidden;
  position: relative;
}
.an__svg { display: block; width: 100%; height: 100%; min-height: 240px; }
.an__cap { position: absolute; left: 16px; bottom: 10px; margin: 0; font-size: 12px; color: rgba(243, 236, 224, .5); }

.an-soil { fill: #2e261e; }
.an-fill { fill: rgba(40, 140, 39, .22); }
.an-ground-ghost { fill: none; stroke: #d9cfbf; stroke-opacity: .45; stroke-width: 1.6; stroke-dasharray: 3 5; }
.an-design { fill: none; stroke: #f3ece0; stroke-opacity: .7; stroke-width: 1.8; stroke-dasharray: 10 8; }
.an-target { fill: none; stroke: var(--brand-orange); stroke-width: 2.4; }
.an-surface { fill: none; stroke: #d9cfbf; stroke-width: 2; stroke-linejoin: round; }
.an-dim path { fill: none; stroke: #f3ece0; stroke-width: 1.4; }
.an-machine { fill: #2a241e; stroke: #d9cfbf; stroke-width: 2; stroke-linejoin: round; }
.an-machine-line { fill: none; stroke: #d9cfbf; stroke-width: 6; stroke-linecap: round; }
.an-tire { fill: #120f0c; stroke: #d9cfbf; stroke-width: 2; }
.an-edge { stroke: #fff; stroke-width: 3.5; stroke-linecap: round; }
.an-scraper { transition: opacity .25s ease; }
/* a dark halo keeps a note readable where a line runs through it (the pass-1 target crosses its label) */
.an-note { font-family: "Caveat", "Segoe Print", cursive; font-size: 26px; font-weight: 600; fill: #f3ece0; paint-order: stroke; stroke: #221d18; stroke-width: 6px; stroke-linejoin: round; }
.an-note--sm { font-size: 23px; }
/* phone: the 1000-unit scene shrinks to ~350px, so the notes are set larger (auto-nudge.js places
   them with the same factor) and the caption moves out from under the bottom labels */
@media (max-width: 560px) {
  .an-note { font-size: 44px; stroke-width: 9px; }
  .an-note--sm { font-size: 40px; }
  .an__cap { position: static; padding: 0 16px 12px; }
}

/* the app's Auto-Nudge panel (dark theme), working controls */
.an__panel {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: #121212;
  border: 1px solid rgba(243, 236, 224, .14);
  font-size: 13px;
}
.an__tag {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(74, 222, 128, .12);
  border: 1px solid rgba(74, 222, 128, .45);
  color: #fff;
  font-weight: 800;
  letter-spacing: .06em;
  font-size: 12px;
}
.an__tag svg { width: 14px; height: 14px; }
.an__max { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; gap: 6px; }
.an__max-val { text-align: center; color: rgba(255, 255, 255, .8); }
.an__max-val b { display: block; color: #fff; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.an__btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: #262626;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.an__btn:hover:not(:disabled) { filter: brightness(1.15); }
.an__btn:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; }
.an__btn:disabled { opacity: .35; cursor: default; }
.an__btn--plus { min-height: 54px; background: #3b82f6; font-size: 16px; }
.an__btn--minus { min-height: 46px; background: #1e3a8a; font-size: 15px; }
.an__count { text-align: center; padding: 2px 0; }
.an__count b { display: block; color: #4ade80; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.an__count span { color: rgba(255, 255, 255, .6); }
.an__stats { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .1); }
.an__stats div { display: flex; justify-content: space-between; gap: 8px; color: rgba(255, 255, 255, .65); }
.an__stats b { color: #fff; font-variant-numeric: tabular-nums; }
.an__play { background: transparent; border: 1px solid rgba(243, 236, 224, .25); min-height: 34px; font-weight: 600; color: #f3ece0; }

/* captions under the explainer (modes/ditching.html: Set / Stage / Advance). A caption with
   data-an-hint="max|target|pass" points at its control while hovered (assets/auto-nudge.js sets
   data-hint on [data-an]). */
.an-steps {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px);
  margin-top: clamp(24px, 3vw, 36px);
}
.an-steps__item { position: relative; padding-top: 16px; border-top: 1px solid rgba(243, 236, 224, .16); }
.an-steps__item::before { content: ""; position: absolute; left: 0; top: -2px; width: 36px; height: 3px; border-radius: 2px; background: var(--brand-orange); transition: width .25s ease; }
.an-steps__item[data-an-hint]:hover::before { width: 72px; }
.an-steps h3 { font-size: 18px; line-height: 1.3; color: #fff; }
.an-steps p { margin: 6px 0 0; font-size: 15px; line-height: 1.55; color: #cfc6b4; }
.an-steps__k { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-orange); }
.an[data-hint="max"] .an__max,
.an[data-hint="pass"] .an__btn--plus,
.an[data-hint="target"] .an__stats { outline: 2px solid var(--brand-orange); outline-offset: 4px; border-radius: 10px; }
.an[data-hint="target"] .an-target { stroke-width: 4.5; }
.an-avail { margin-top: 22px; font-size: 14px; color: rgba(243, 236, 224, .6); }
/* Implement Slope scrolls to the explainer when the page has no #auto-nudge (assets/slope-iq.js) */
.an { scroll-margin-top: calc(var(--nav-h, 68px) + 24px); }
@media (prefers-reduced-motion: reduce) { .an-steps__item::before { transition: none; } }
html.da-still .an-steps__item::before { transition: none; }

@media (max-width: 900px) {
  .an { grid-template-columns: 1fr; }
  .an__panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an__tag, .an__stats, .an__play { grid-column: 1 / -1; }
  .an-steps { grid-template-columns: 1fr; }
}

.an .visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 900px) { .an__svg { height: auto; min-height: 0; aspect-ratio: 1000 / 430; } }
.an-placed { fill: #5a4636; }
.an-note { transition: opacity .4s ease; }

/* "Your Slope-IQ design" badge: auto-nudge.js builds it into the stage when Implement Slope
   hands a design over. Over the scene on wide screens (on the end of the run with more sky,
   .is-right), above it on narrow ones. */
.an__mine {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px;
  max-width: calc(100% - 24px);
  padding: 4px 6px 4px 12px;
  border-radius: 10px;
  background: rgba(18, 18, 18, .86);
  border: 1px solid rgba(74, 222, 128, .45);
  font-size: 13px;
  line-height: 1.3;
}
.an__mine.is-right { left: auto; right: 12px; }
.an__mine[hidden] { display: none; }
.an__mine:focus { outline: none; }
.an__mine:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; }
.an__mine-t { color: #fff; font-weight: 700; }
.an__mine-back {
  min-height: 28px; padding: 4px 6px;
  border: 0; background: none;
  font: inherit; font-weight: 600; color: #d8cfbc;
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.an__mine-back:hover { color: #fff; }
.an__mine-back:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .an__mine:not([hidden]) { animation: an-mine-in .35s ease both; }
  @keyframes an-mine-in { from { opacity: 0; transform: translateY(-6px); } }
}
@media (max-width: 900px) {
  .an__mine, .an__mine.is-right { position: static; max-width: none; margin: 10px 10px 0; }
}
