/* How DIG works: the excavator explainer on ditch-assist-dig.html (section.digx).
   Behaviour in assets/dig-explainer.js. Same scene language as the kit explainer (kit-explainer.css):
   cream line art on the dark stage, DIG yellow only on the DIG parts, green for the design grade. */

.digx { padding: clamp(64px, 8vw, 112px) 0; background: var(--bg); }
.digx__head { max-width: 780px; }
.digx__head h2 { margin-top: 14px; }
.digx__head .lead { margin-top: 18px; }

.digx__stage {
  position: relative;
  margin: clamp(28px, 4vw, 44px) 0 0;
  border-radius: 18px;
  overflow: hidden;
  background: #1a1612;
  aspect-ratio: 12 / 5;
  color: #f3ece0;
  isolation: isolate;
}
.digx__svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.digx__cap-out { margin: 8px 2px 0; font-size: 12px; color: var(--ink-3); text-align: right; }

/* scene */
.digx .soil { fill: #241e18; }
.digx .soil-hatch { stroke: #3a3128; stroke-width: 1.4; }
.digx .air { fill: #1a1612; }
.digx .ground { fill: none; stroke: #8b8172; stroke-width: 2; stroke-linejoin: round; }
.digx .design { fill: none; stroke: var(--brand-green); stroke-width: 3.5; stroke-linecap: round; }
.digx .note { font-family: "Caveat", "Segoe Print", cursive; font-size: 24px; font-weight: 600; fill: #f3ece0; }
.digx .machine { fill: #2a241e; stroke: #d9cfbf; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.digx .machine-line { fill: none; stroke: #d9cfbf; stroke-width: 2; stroke-linecap: round; }
.digx .roller { fill: #120f0c; stroke: #d9cfbf; stroke-width: 1.6; }
.digx .glass { fill: rgba(217, 207, 191, .1); }
.digx .cab-tab { fill: #0b0a09; stroke: #f9a902; stroke-width: 1.4; }
.digx .pin { fill: #1a1612; stroke: #d9cfbf; stroke-width: 2; }
.digx .arm-out { fill: none; stroke: #d9cfbf; stroke-linecap: round; }
.digx .arm-in { fill: none; stroke: #2a241e; stroke-linecap: round; }
.digx .arm-out--boom { stroke-width: 22; }
.digx .arm-in--boom { stroke-width: 18; }
.digx .arm-out--stick { stroke-width: 16; }
.digx .arm-in--stick { stroke-width: 12; }
.digx .cyl { fill: none; stroke: #d9cfbf; stroke-width: 4; stroke-linecap: round; opacity: .75; }
.digx .bucket { fill: #2a241e; stroke: #d9cfbf; stroke-width: 2; stroke-linejoin: round; }
.digx .bucket-tooth { fill: #d9cfbf; }
.digx .load { fill: #6b5640; }
.digx .mast { stroke: #d9cfbf; stroke-width: 3.5; stroke-linecap: round; }
.digx .rx { fill: #f3f1ec; }
.digx .rx-band { fill: #3a3a3a; }
.digx .dig-part { fill: var(--brand-yellow); stroke: #1a1612; stroke-width: 1.6; }
.digx .antenna { stroke: #d9cfbf; stroke-width: 2.4; stroke-linecap: round; }
.digx .cable { fill: none; stroke: #f3ece0; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 5 4; opacity: .75; }
.digx .wifi-path { fill: none; stroke: #f3ece0; stroke-opacity: .35; stroke-width: 1.6; stroke-dasharray: 2 7; stroke-linecap: round; }
.digx .wifi-arc { fill: none; stroke: var(--brand-yellow); stroke-width: 2.2; stroke-linecap: round; animation: digx-ping 1.8s ease-out infinite; }
.digx .wifi-arc:nth-child(2) { animation-delay: .3s; }
.digx .wifi-arc:nth-child(3) { animation-delay: .6s; }
@keyframes digx-ping { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

/* numbered parts, keyed to the list under the scene */
.digx .mk-disc { fill: #fff; stroke: #1a1612; stroke-width: 2.5; }
.digx .mk-num { font: 800 17px/1 var(--font-body); fill: #1a1612; }
.digx .mk-tick { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; opacity: .85; }

/* the tablet in the cab: Excavator mode, simplified */
.digx__tab {
  position: absolute; right: 16px; top: 50%;
  transform: translateY(-50%);
  width: clamp(240px, 29%, 330px);
  padding: 7px;
  border-radius: 16px;
  background: #0b0a09;
  border: 1px solid rgba(243, 236, 224, .28);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8);
  font-size: 12px; line-height: 1.3;
}
.digx__tab-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 2px 6px 7px; color: rgba(243, 236, 224, .72); font-size: 11.5px; }
.digx__rtk { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.digx__fix { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(40, 140, 39, .25); }
.digx__screen { border-radius: 9px; overflow: hidden; background: #0f0f0f; border: 1px solid rgba(243, 236, 224, .1); }
.digx__app { display: block; width: 100%; height: auto; }
.digx__app .a-bg { fill: #121212; }
.digx__app .a-map { fill: #1b1d1b; }
.digx__app .a-grid { stroke: #262a26; stroke-width: 1; }
.digx__app .a-route { stroke: #f59e0b; stroke-width: 2.2; stroke-dasharray: 1 5; stroke-linecap: round; fill: none; }
.digx__app .a-me { fill: #166534; stroke: #fff; stroke-width: 2; }
.digx__app .a-chev { fill: none; stroke: #1f7a3c; stroke-width: 7; stroke-linejoin: miter; transition: opacity .2s ease; }
.digx__app .a-ok { fill: rgba(18, 18, 18, .85); stroke: #4ade80; stroke-width: 1.5; }
.digx__app .a-ok-t { font: 700 10px/1 var(--font-body); fill: #4ade80; letter-spacing: 1.4px; }
.digx__app .a-bar { fill: rgba(243, 236, 224, .92); }
.digx__app .a-num { font: 700 21px/1 "SF Mono", Menlo, Consolas, monospace; fill: #166534; }
.digx__app .a-unit { font: 700 11px/1 var(--font-body); fill: #166534; }
.digx__app .a-lbl { font: 800 11px/1 var(--font-body); fill: #166534; letter-spacing: 1.2px; }
.digx__app .a-col { fill: #161616; }
.digx__app .a-col-line { stroke: rgba(255, 255, 255, .14); stroke-width: 1; }
.digx__app .a-target { stroke: #60a5fa; stroke-width: 2; }
.digx__app .a-ptr { fill: #facc15; }
.digx__app .a-ptr--on { fill: #4ade80; }
.digx__app .a-cut { font: 700 8px/1 var(--font-body); fill: #ef4444; letter-spacing: .8px; }
.digx__app .a-fill { font: 700 8px/1 var(--font-body); fill: #60a5fa; letter-spacing: .8px; }
.digx__app .a-small { font: 700 7px/1 var(--font-body); fill: rgba(255, 255, 255, .55); letter-spacing: .6px; }
.digx__hud { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 4px 0; border-top: 1px solid rgba(243, 236, 224, .12); color: rgba(243, 236, 224, .7); }
.digx__hud b { display: block; color: #fff; font-weight: 700; font-size: 12.5px; }
.digx__act { color: #fff; font-weight: 600; }

/* the parts, keyed to the numbers on the machine */
.digx__key { list-style: none; margin: clamp(20px, 2.6vw, 30px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.digx__key li { display: grid; grid-template-columns: 28px 1fr; gap: 4px 10px; align-items: start; align-content: start; }
.digx__key-n { grid-row: span 2; display: inline-grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; font-size: 13px; font-weight: 800; line-height: 1; }
.digx__key strong { font-size: 16px; line-height: 1.3; color: var(--ink); }
/* four across: every title takes two lines, so all four descriptions start level */
@media (min-width: 1001px) { .digx__key strong { min-height: 2.6em; } }
.digx__key p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.digx__run { margin: 18px 0 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); max-width: 70ch; }
.digx__run b { color: var(--ink); }

@media (prefers-reduced-motion: reduce) { .digx .wifi-arc { animation: none; opacity: .8; } }
html.da-still .digx .wifi-arc { animation: none; opacity: .8; }

@media (max-width: 1000px) { .digx__key { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* below this width the tablet would cover the machine, so it docks under the scene */
@media (max-width: 760px) {
  .digx__stage { aspect-ratio: auto; border-radius: 12px; }
  .digx__svg { position: static; height: auto; aspect-ratio: 670 / 470; }
  .digx .note { display: none; }
  .digx .mk-disc { stroke-width: 3; }
  .digx__tab {
    position: relative; top: auto; right: auto; transform: none;
    width: auto; margin: 4px 8px 8px; padding: 6px 7px 7px;
    border: 1.5px solid rgba(243, 236, 224, .55); border-radius: 12px; box-shadow: none;
  }
  .digx__tab-top { padding: 0 2px 6px; font-size: 11px; color: #f3ece0; }
}
@media (max-width: 560px) { .digx__key { grid-template-columns: 1fr; } }
