/* Lazy-DaSH page: hero scenario grid, lightbox, how-it-works stepper, video chapters, results. */
:root {                                   /* palette from the video and the clips */
  --ld-paper: #fafaf7;                    /* the clips' background */
  --ld-band: #f3f1ec;                     /* sand-tinted section band */
  --ld-ink: #1f2328;
  --ld-muted: #5b6470;
  --ld-rule: #e4e1da;
  --ld-task: #7e57c2;                     /* task layer purple */
  --ld-motion: #2e7d32;                   /* motion layer green */
  --ld-accent: #e06c00;                   /* result numbers */
  /* index.css tokens, retinted */
  --primary-color: var(--ld-task);
  --primary-hover: #6a46ad;
  --text-primary: var(--ld-ink);
  --text-secondary: var(--ld-muted);
  --background-primary: var(--ld-paper);
  --background-secondary: var(--ld-band);
  --background-accent: #ebe8e1;
  --border-color: var(--ld-rule);
}
body {
  background: var(--ld-paper);
  color: var(--ld-ink);
}
a {
  color: var(--ld-task);
}
a:hover {
  color: var(--primary-hover);
}

/* section headings: a numbered label instead of the template's gradient underline */
main {
  counter-reset: ld-section;
}
.title.is-3 {
  color: var(--ld-ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.title.is-3::after {
  display: none;
}
h2.title.is-3::before {
  counter-increment: ld-section;
  content: counter(ld-section, decimal-leading-zero);
  display: block;
  margin-bottom: 4px;
  font: 600 0.8rem/1 Inter, sans-serif;
  letter-spacing: 0.14em;
  color: var(--ld-accent);
}

/* ---------------------------------------------------------------- hero */
.ld-hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: var(--ld-paper);
}
.ld-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 2px;
  background: var(--ld-paper);
}
.ld-cell {
  position: relative;
  padding: 0;
  border: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: #ddd center / cover no-repeat;
}
.ld-cell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.ld-cell::after {                       /* label chip */
  content: attr(data-label);
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ld-ink);
  font: 600 13px/1.5 Inter, sans-serif;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
  transition: background 0.2s ease, color 0.2s ease;
}
.ld-cell::before {                      /* "Explore" cue, on the hovered or spotlit cell */
  content: 'Explore';
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(31, 35, 40, 0.82);
  color: #fff;
  font: 600 13px/1.4 Inter, sans-serif;
  white-space: nowrap;
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.ld-spot-ring {                         /* the travelling outline + "Explore" cue (lazydash.js) */
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 3px solid var(--ld-task);
  pointer-events: none;
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.45, 0, 0.25, 1), width 0.5s cubic-bezier(0.45, 0, 0.25, 1),
    height 0.5s cubic-bezier(0.45, 0, 0.25, 1), opacity 0.3s ease;
}
.ld-spot-ring span {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(31, 35, 40, 0.82);
  color: #fff;
  font: 600 13px/1.4 Inter, sans-serif;
}
.is-demo .ld-spot-ring {
  opacity: 1;
}
.ld-grid:not(.is-demo) .ld-cell:hover,   /* while the spotlight runs, only its ring is shown */
.ld-cell:focus-visible {
  outline: 3px solid var(--ld-task);
  outline-offset: -3px;
}
.ld-grid:not(.is-demo) .ld-cell:hover video,
.ld-cell:focus-visible video,
.ld-cell.is-spot video {
  transform: scale(1.04);
}
.ld-grid:not(.is-demo) .ld-cell:hover::before,
.ld-cell:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, -50%);
}
.ld-grid:not(.is-demo) .ld-cell:hover::after,
.ld-cell:focus-visible::after,
.ld-cell.is-spot::after {
  background: var(--ld-task);
  color: #fff;
}
.ld-cell::after {
  z-index: 1;
}
.ld-cell:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: -3px;
}

.ld-card {                              /* the center 2x2 block of the grid */
  grid-area: 2 / 2 / 4 / 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 28px;
  background: var(--ld-paper);
  text-align: center;
  overflow: hidden;
}
.ld-title {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ld-ink);
}
.ld-subtitle {
  margin-top: 6px;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 500;
  color: var(--ld-muted);
}
.ld-authors {
  margin-top: 14px;
  font-size: 0.98rem;
  color: var(--ld-muted);
}
.ld-authors a {
  color: var(--ld-ink);
  text-decoration: underline;
  text-decoration-color: rgba(126, 87, 194, 0.45);
  text-underline-offset: 3px;
}
.ld-authors a:hover {
  color: var(--ld-task);
}
.ld-venue {
  margin-top: 2px;
  font-weight: 600;
  color: var(--ld-ink);
}
.ld-buttons {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.ld-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 18px;
  border-radius: 999px;
  background: var(--ld-ink);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s ease, transform 0.2s ease;
}
.ld-btn:hover {
  background: var(--ld-task);
  transform: translateY(-1px);
}
.ld-stats {
  margin-top: 16px;
  font-size: 1.05rem;
  color: var(--ld-ink);
}
.ld-stats b {
  color: var(--ld-accent);
  font-size: 1.2em;
}
.ld-hint {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #94a3b8;
}

/* ---------------------------------------------------------------- tl;dr */
.ld-tldr,
.ld-results {
  background: var(--ld-band);
}
.ld-tldr p {
  font-size: 1.15rem;
  line-height: 1.7;
  text-align: center;
  color: var(--ld-ink);
}

/* ---------------------------------------------------------------- how it works */
.ld-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0 16px;
}
.ld-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 14px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #fff;
  color: var(--ld-muted);
  font: 600 0.95rem/1.3 Inter, sans-serif;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.ld-tab:hover {
  border-color: #94a3b8;
}
.ld-tab { --kind: var(--ld-task); }
.ld-tab.is-motion { --kind: var(--ld-motion); }
.ld-tab.is-active {
  border-color: var(--kind);
  color: var(--ld-ink);
  box-shadow: var(--shadow-md);
}
.ld-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--background-accent);
  font-size: 0.85rem;
}
.ld-tab.is-active .ld-num {
  background: var(--kind);
  color: #fff;
}
.ld-bar {                               /* progress of the clip playing in this tab */
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: var(--kind);
}
.ld-tab.is-done .ld-bar {
  width: 100%;
  background: #cbd5e1;
}
.ld-step-panel {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 28px;
  align-items: center;
}
.ld-step-video video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #fff;
}
.ld-sbar {                              /* the clip's own controls */
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.ld-sb-play {
  min-width: 36px;
  padding: 3px 9px;
  border: 1px solid var(--ld-rule);
  border-radius: 6px;
  background: #fff;
  color: var(--ld-ink);
  font: 600 0.9rem Inter, sans-serif;
  cursor: pointer;
}
.ld-sb-play:hover {
  border-color: var(--ld-task);
  color: var(--ld-task);
}
.ld-sb-slider {
  flex: 1;
  accent-color: var(--ld-task);
}
.ld-sb-time {
  font: 500 0.85rem/1 ui-monospace, Menlo, Consolas, monospace;
  color: var(--ld-muted);
  white-space: nowrap;
}
.ld-step-video video {
  cursor: pointer;
}
.ld-step {
  display: none;
}
.ld-step.is-active {
  display: block;
  animation: ld-fade 0.35s ease;
}
.ld-step h3 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--kind, var(--ld-ink));
  margin-bottom: 10px;
}
.ld-step.is-task { --kind: var(--ld-task); }
.ld-step.is-motion { --kind: var(--ld-motion); }
.ld-step p {
  color: var(--ld-ink);
  line-height: 1.65;
  margin-bottom: 10px;
}
@keyframes ld-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.ld-figures {                           /* one column, full width */
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 1100px;
  margin: 28px auto 0;
}
.ld-figure {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #fff;
  cursor: zoom-in;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.ld-figure:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.ld-figure img {
  width: 100%;
  height: auto;
  display: block;
}
.ld-figure span {
  display: block;
  margin-top: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ld-muted);
}

/* ---------------------------------------------------------------- video */
.ld-video {
  background: var(--ld-paper);
}
#full-video {
  width: 100%;
  display: block;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  background: #000;
}
/* chapters: a numbered series of thumbnail cards on one line; the hovered one comes forward, the rest fade */
.ld-chapters {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.ld-chapters::before {                  /* the line that joins the series */
  content: '';
  position: absolute;
  left: 4%;
  right: 4%;
  top: calc((100% - 44px) / 2);
  height: 2px;
  background: var(--ld-rule);
}
.ld-chapters li {
  position: relative;
}
.ld-chapters button {
  display: block;
  width: 100%;
  padding: 6px;
  border: 1px solid var(--ld-rule);
  border-radius: 12px;
  background: #fff;
  color: var(--ld-ink);
  font: 600 0.88rem/1.25 Inter, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.ld-chapters:hover button:not(:hover) {
  opacity: 0.55;
}
.ld-chapters button:hover,
.ld-chapters button:focus-visible {
  transform: translateY(-4px) scale(1.04);
  border-color: var(--ld-task);
  box-shadow: 0 10px 24px rgba(31, 35, 40, 0.16);
  outline: none;
  opacity: 1;
}
.ld-chapters button.is-active {
  border-color: var(--ld-task);
  box-shadow: 0 0 0 2px rgba(126, 87, 194, 0.25);
}
.ld-ch-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--ld-band);
}
.ld-ch-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ld-ch-thumb::after {                   /* play mark on hover */
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 14px solid #fff;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  transform: translate(-35%, -50%);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ld-chapters button:hover .ld-ch-thumb::after,
.ld-chapters button:focus-visible .ld-ch-thumb::after {
  opacity: 1;
}
.ld-ch-bar {                            /* progress through the playing chapter */
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: var(--ld-task);
}
.ld-ch-text {
  display: block;
  padding: 6px 2px 2px;
}
.ld-ch-num {
  color: var(--ld-accent);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  margin-right: 2px;
}
.ld-ch-text small {
  display: block;
  color: var(--ld-muted);
  font: 500 0.78rem Inter, sans-serif;
}

/* results takeaways */
.ld-takeaways {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 6px 0 28px;
}
.ld-take {
  padding: 16px 18px;
  border: 1px solid var(--ld-rule);
  border-radius: 14px;
  background: #fff;
}
.ld-take b {
  display: block;
  font: 700 2.2rem/1.05 Inter, sans-serif;
  letter-spacing: -0.02em;
  color: var(--ld-accent);
}
.ld-take b em {
  font-style: normal;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
}
.ld-take span {
  display: block;
  margin-top: 4px;
  font-weight: 700;
  color: var(--ld-ink);
}
.ld-take small {
  display: block;
  margin-top: 2px;
  color: var(--ld-muted);
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------- results */
.ld-lead {
  text-align: center;
  color: var(--ld-muted);
  margin-bottom: 18px;
}
.ld-results-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 28px;
  align-items: center;
}
.ld-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}
.ld-table th,
.ld-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
}
.ld-table th {
  font-weight: 600;
  color: var(--ld-muted);
}
.ld-table td:first-child {
  font-weight: 600;
}
.ld-table td:nth-child(2) {
  color: var(--ld-muted);
}
.ld-table td:last-child {
  color: var(--ld-accent);
  font-weight: 600;
}
.ld-hw video {
  width: 100%;
  display: block;
  border-radius: 12px;
}
.ld-hw p {
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--ld-muted);
}
.ld-note {
  margin-top: 18px;
  text-align: center;
  color: var(--ld-ink);
}

/* ---------------------------------------------------------------- abstract */
.ld-abstract summary {
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
}
.ld-abstract p {
  margin-top: 12px;
  line-height: 1.7;
  color: var(--ld-ink);
  text-align: justify;
}

/* ---------------------------------------------------------------- lightbox */
.ld-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.88);
  padding: 16px;
}
.ld-lightbox[hidden] {
  display: none;
}
.ld-lb-inner {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: min(1200px, 100%);
}
.ld-lb-media {
  display: grid;
  place-items: center;
}
.ld-lb-media video,
.ld-lb-media img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  border-radius: 10px;
  background: #fff;
}
.ld-lb-caption {
  grid-column: 1 / -1;
  text-align: center;
  color: #e2e8f0;
}
.ld-lb-caption b {
  color: #fff;
  margin-right: 6px;
}
.ld-lb-nav,
.ld-lb-close {
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s ease;
}
.ld-lb-nav:hover,
.ld-lb-close:hover {
  background: rgba(255, 255, 255, 0.28);
}
.ld-lb-nav {
  width: 48px;
  height: 48px;
  font-size: 2rem;
  line-height: 1;
}
.ld-lb-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  font-size: 1.6rem;
}
.ld-lightbox.is-image .ld-lb-nav,
.ld-lightbox.is-image .ld-lb-mode {
  visibility: hidden;
}
.ld-lb-media video {
  width: min(960px, calc((100vh - 150px) * 4 / 3), 100%);
}
.ld-lb-mode {
  display: inline-flex;
  margin-right: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  overflow: hidden;
  vertical-align: middle;
}
.ld-lb-mode button {
  padding: 2px 12px;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  font: 600 0.85rem Inter, sans-serif;
  cursor: pointer;
}
.ld-lb-mode button[aria-pressed="true"] {
  background: #fff;
  color: var(--ld-ink);
}

/* ---------------------------------------------------------------- 3D replay (replay.js) */
.ld-replay {
  position: relative;
  width: min(960px, calc((100vh - 150px) * 4 / 3), 100%);
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #f7f7f5;
}
.ld-replay[hidden] {
  display: none;
}
.rp-view,
.rp-view canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.rp-hint {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 0.8rem;
  pointer-events: none;
}
.rp-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(247, 247, 245, 0.85);
  color: var(--ld-muted);
  font-weight: 600;
}
.rp-loading[hidden],
.rp-hint[hidden] {
  display: none;
}
.rp-bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.2);
}
.rp-bar button,
.rp-bar select {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: #fff;
  color: var(--ld-ink);
  font: 600 0.9rem Inter, sans-serif;
  padding: 3px 9px;
  cursor: pointer;
}
.rp-play {
  min-width: 38px;
}
.rp-slider {
  flex: 1;
  min-width: 60px;
  accent-color: var(--primary-color);
}
.rp-clock {
  font: 500 0.85rem/1 ui-monospace, Menlo, Consolas, monospace;
  color: var(--ld-ink);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- phones and small tablets */
@media (max-width: 768px) {
  .ld-hero {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    background: #fff;
  }
  .ld-card {
    grid-area: auto;
    grid-column: 1 / -1;
    padding: 28px 16px 20px;
  }
  .ld-grid {
    position: relative;                 /* holds the demo cursor */
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
  }
  .ld-cell {
    aspect-ratio: 4 / 3;
  }
  .ld-cell::after {
    font-size: 11px;
    left: 6px;
    bottom: 6px;
  }
  .ld-tabs,
  .ld-takeaways {
    grid-template-columns: repeat(2, 1fr);
  }
  .ld-chapters {
    grid-template-columns: repeat(3, 1fr);
  }
  .ld-chapters::before {
    display: none;
  }
  .ld-tab {
    gap: 8px;
    padding: 10px 10px 12px;
    font-size: 0.82rem;
    overflow-wrap: anywhere;
  }
  .ld-step-panel,
  .ld-results-row,
  .ld-figures {
    grid-template-columns: 1fr;
  }
  .ld-lb-inner {
    grid-template-columns: 1fr 1fr;
  }
  .ld-lb-media {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .ld-lb-prev {
    justify-self: start;
  }
  .ld-lb-next {
    justify-self: end;
  }
}

@media (min-width: 769px) and (max-height: 760px) {
  .ld-title { font-size: 2.4rem; }
  .ld-authors { margin-top: 8px; font-size: 0.9rem; }
  .ld-buttons { margin-top: 10px; }
  .ld-stats { margin-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .ld-cell video,
  .ld-figure,
  .ld-btn {
    transition: none;
  }
}
