:root, .hd {
  --hd-page: #ffffff;
  --hd-bg: #f6f7f9;
  --hd-fg: #1f2328;
  --hd-muted: #5f6670;
  --hd-faint: #8a919b;
  --hd-card: #ffffff;
  --hd-line: #dfe3e8;
  --hd-accent: #2b59c3;
  --hd-accent-fg: #ffffff;
  --hd-strong: #8b3fa8;
  --hd-strong-soft: #f5ecf8;
  --hd-open: #2b59c3;
  --hd-open-soft: #e8eefb;
  --hd-sys: #1f2328;
  --hd-sys-soft: #eef0f3;
  --hd-gold: #a86b00;
  --hd-gold-soft: #fbf1dc;
  --hd-driving: #2f6fd6;
  --hd-outdoor: #d0612a;
  --hd-indoor: #1a9468;
  --hd-video: #e9ecef;
  --hd-radius: 6px;
  --hd-maxw: 1320px;

  --hd-p1: #4f7cac; --hd-p1-ink: #436992;
  --hd-p2: #c68a1e; --hd-p2-ink: #9a6a12;
  --hd-p3: #7e5ba6; --hd-p3-ink: #6b4d8d;
  --hd-p4: #2e8b78; --hd-p4-ink: #277666;
}
[data-hd-theme="dark"], [data-hd-theme="dark"] .hd, .hd[data-hd-theme="dark"] {
  --hd-page: #1c1e22;
  --hd-bg: #23262b;
  --hd-fg: #e6e8eb;
  --hd-muted: #a3a9b2;
  --hd-faint: #7c838d;
  --hd-card: #2b2f35;
  --hd-line: #3d424a;
  --hd-accent: #7ea2ff;
  --hd-accent-fg: #14161a;
  --hd-strong: #d08ae8;
  --hd-strong-soft: #3a2b41;
  --hd-open: #7ea2ff;
  --hd-open-soft: #26304a;
  --hd-sys: #e6e8eb;
  --hd-sys-soft: #343941;
  --hd-gold: #e0a83a;
  --hd-gold-soft: #3d3220;
  --hd-driving: #6b9cf0;
  --hd-outdoor: #ee8a57;
  --hd-indoor: #43c194;
  --hd-video: #33373e;
  --hd-p1: #86aee0; --hd-p1-ink: #9dbde6;
  --hd-p2: #e5ad4b; --hd-p2-ink: #ecbe6c;
  --hd-p3: #b596dc; --hd-p3-ink: #c4aae3;
  --hd-p4: #5cc4ad; --hd-p4-ink: #79d0bc;
}

.hd { background: var(--hd-bg); color: var(--hd-fg); padding: 44px 0 52px; }
.hd *, .hd *::before, .hd *::after { box-sizing: border-box; }
.hd-wrap { max-width: var(--hd-maxw); margin: 0 auto; padding: 0 24px; }
.hd-head { text-align: center; margin: 0 0 22px; }
.hd-head h2 { margin: 0; font-size: clamp(24px, 3.2vw, 32px); line-height: 1.2; letter-spacing: -.01em; }
.hd-head p { margin: 8px auto 0; max-width: 760px; color: var(--hd-muted); font-size: clamp(15px, 1.9vw, 18px); }

.hd-fig { margin: 0; padding: 12px; background: #ffffff; border-radius: 12px; border: 1px solid var(--hd-line); }
.hd-fig img { display: block; width: 100%; height: auto; }
.hd-crops { display: none; }
.hd-crop { margin: 0; padding: 8px; background: #ffffff; border-radius: 12px; border: 1px solid var(--hd-line); }
.hd-crop-in { position: relative; overflow: hidden; margin: 0 auto; aspect-ratio: var(--hd-fw) / var(--hd-fh);
  width: min(100%, calc(440px * var(--hd-fw) / var(--hd-fh))); }
.hd-crop-in img { position: absolute; top: 0; left: calc(var(--hd-fx) / var(--hd-fw) * -100%);
  width: calc(var(--hd-full) / var(--hd-fw) * 100%); height: auto; max-width: none; display: block; }

.hd-ex { --hd-ar: 16 / 9; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 44px auto 0; }
.hd-tile { position: relative; flex: 0 1 380px; min-width: 0; border-radius: 8px; overflow: hidden; background: var(--hd-video); aspect-ratio: var(--hd-ar); }
.hd-tile video { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.hd-corner { position: absolute; left: 6px; bottom: 6px; font-size: 11.5px; line-height: 1.2; color: #fff; background: rgba(20, 22, 26, .66); padding: 2px 7px; border-radius: 4px; pointer-events: none; }
.hd-arrow { flex: none; width: 18px; height: 12px; color: var(--hd-faint); }
.hd-arrow svg { display: block; width: 100%; height: 100%; }
.hd-arrow path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hd-gap { flex: none; width: 4px; }

.hd-perc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; background: var(--hd-video); }
.hd-perc-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.hd-perc-cell { position: relative; min-height: 0; overflow: hidden; }
.hd-perc-cell video { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.hd-tag { position: absolute; left: 3px; bottom: 3px; font-size: 9.5px; line-height: 1.15; color: #fff; background: rgba(20, 22, 26, .66); padding: 1px 4px; border-radius: 3px; pointer-events: none; }

.hd-mosaic-wrap { margin: 28px auto 0; }
.hd-mosaic { --hd-mar: 1440 / 204; width: 100%; aspect-ratio: auto; border-radius: 6px; flex: none;
  height: 0; padding-bottom: calc(100% / (var(--hd-mar)) * var(--hd-mrows, 3) / var(--hd-mgrid, 5)); }
.hd-mosaic video { position: absolute; top: 0; left: 0; width: 100%; height: auto; }
.hd-count { margin: 8px 0 0; text-align: center; font-size: 14px; color: var(--hd-muted); }
.hd-count b { color: var(--hd-fg); font-size: 16px; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .hd-fig { display: none; }
  .hd-crops { display: grid; gap: 12px; }
  .hd-ex { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 32px; }
  .hd-arrow, .hd-gap { display: none; }
}
@media (max-width: 640px) {
  .hd { padding: 32px 0 40px; }
  .hd-wrap { padding: 0 16px; }
}

#pipeline.hd .sec-head { margin-bottom: 10px; }
#pipeline.hd .hd-fig { max-width: 1000px; }
#pipeline.hd .hd-ex { max-width: 1000px; margin-top: 12px; }
#pipeline.hd .hd-mosaic-wrap { max-width: 1000px; margin-top: 10px; }
#pipeline.hd + #baselines.sec { padding-top: 62px; }

.hd-crops > .hd-crop:nth-child(1) .hd-crop-in { --hd-fw: 177.5 !important; }
.hd-crops > .hd-crop:nth-child(2) .hd-crop-in { --hd-fx: 191.6 !important; --hd-fw: 257.8 !important; }
@media (max-width: 640px) { #pipeline.hd + #baselines.sec { padding-top: 40px; } }

#pipeline.hd[data-hd-theme] .hd-mosaic { position: relative; overflow: hidden; }
#pipeline.hd[data-hd-theme] .hd-ex { margin-top: 26px; }
#pipeline.hd[data-hd-theme] .hd-mosaic-wrap { margin-top: 26px; }
#pipeline.hd[data-hd-theme] .hd-count { margin-top: 6px; }
@media (max-width: 760px) { #pipeline.hd[data-hd-theme] .hd-ex, #pipeline.hd[data-hd-theme] .hd-mosaic-wrap { margin-top: 20px; } }
