.dither-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.dither-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.grid-scan {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.grid-scan-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.grid-scan-preview {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 168px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: #0b0b0e;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.grid-scan-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.grid-scan-status {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(10, 10, 12, 0.6);
  color: #ffffff;
  font:
    500 11px/1.4 system-ui,
    -apple-system,
    sans-serif;
  backdrop-filter: blur(8px);
}

.grid-scan-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.floating-lines-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.floating-lines-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* design tokens for the dark-first rebuild, lime and green come from the site's brand variables */
.td-section {
  --td-bg: #021a16;
  --td-bg-2: #01332a;
  --td-green: #21a300;
  --td-lime: #c2ff26;
  --td-lime-soft: rgba(194, 255, 38, 0.12);
  --td-text: #e6efe9;
  --td-muted: #9fb5ad;
  --td-faint: rgba(230, 239, 233, 0.5);
  --td-line: rgba(255, 255, 255, 0.08);
  --td-line-strong: rgba(255, 255, 255, 0.14);
  --td-radius: 20px;
  --td-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--td-bg);
  color: var(--td-text);
  font-family: inherit;
  /* every section pads both edges, so two in a row stack into double this, kept modest so the stacked gap doesn't read as dead space */
  padding: clamp(48px, 5.5vw, 80px) 0;
  -webkit-font-smoothing: antialiased;
}

.td-section *,
.td-section *::before,
.td-section *::after {
  box-sizing: border-box;
}

.td-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* absolute layer for animated backgrounds, sits under the container */
.td-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* faint lime grid that fades out from the center through a radial mask */
.td-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(194, 255, 38, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(194, 255, 38, 0.07) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 100%);
}

/* top and bottom fades so neighboring sections blend into each other */
.td-fade-edges::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--td-bg) 0%, transparent 18%, transparent 82%, var(--td-bg) 100%);
}

/* section header */
.td-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  max-width: 760px;
}

.td-header--center {
  align-items: center;
  text-align: center;
  margin: 0 auto;
}

.td-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border: 1px solid rgba(194, 255, 38, 0.25);
  border-radius: 999px;
  background: rgba(194, 255, 38, 0.06);
  color: var(--td-lime);
  font-family: var(--td-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.td-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--td-lime);
  box-shadow: 0 0 12px var(--td-lime);
}

.td-h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 1.25rem + 3vw, 3.5rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.td-header--center .td-h2 {
  justify-content: center;
}

.td-lead {
  margin: 0;
  color: var(--td-muted);
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.25rem);
  line-height: 1.6;
}

.td-mono-label {
  font-family: var(--td-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--td-lime);
}

/* buttons */
.td-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.td-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.td-btn:hover {
  transform: translateY(-1px);
}

.td-btn--primary {
  background: var(--td-lime);
  color: #021a16;
  box-shadow:
    0 0 0 1px rgba(194, 255, 38, 0.5),
    0 10px 40px -10px rgba(194, 255, 38, 0.7);
}

.td-btn--primary:hover {
  background: #d4ff63;
  box-shadow:
    0 0 0 1px rgba(194, 255, 38, 0.7),
    0 14px 48px -10px rgba(194, 255, 38, 0.9);
}

.td-btn--ghost {
  border: 1px solid var(--td-line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
}

.td-btn--ghost:hover {
  border-color: rgba(194, 255, 38, 0.4);
  background: rgba(194, 255, 38, 0.06);
}

.td-btn svg {
  transition: transform 0.2s ease;
}

.td-btn:hover svg {
  transform: translateX(3px);
}

/* glass card with a cursor-following spotlight, position comes from --mx and --my set by useSpotlight */
.td-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--td-line);
  border-radius: var(--td-radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  transition:
    border-color 0.3s ease,
    transform 0.3s ease;
}

.td-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(194, 255, 38, 0.12), transparent 45%);
  transition: opacity 0.3s ease;
}

.td-card:hover {
  border-color: rgba(194, 255, 38, 0.3);
}

.td-card:hover::before {
  opacity: 1;
}

.td-card > * {
  position: relative;
  z-index: 1;
}

.td-icon-tile {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(194, 255, 38, 0.25);
  border-radius: 12px;
  background: rgba(194, 255, 38, 0.07);
  color: var(--td-lime);
}

/* rotating conic beam around a frame, done with a spinning pseudo element since @property is ignored in shadow roots */
.td-beam-frame {
  position: relative;
  padding: 1px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--td-line-strong);
}

.td-beam-frame::before {
  content: '';
  position: absolute;
  inset: -60%;
  background: conic-gradient(from 0deg, transparent 0deg 290deg, rgba(194, 255, 38, 0.15) 310deg, var(--td-lime) 350deg, transparent 360deg);
  animation: td-spin 7s linear infinite;
}

.td-beam-frame__inner {
  position: relative;
  border-radius: 17px;
  overflow: hidden;
  background: var(--td-bg);
}

.td-beam-frame__inner img {
  display: block;
  width: 100%;
  height: auto;
}

@keyframes td-spin {
  to {
    transform: rotate(1turn);
  }
}

/* scroll reveal toggled by useReveal */
.td-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--td-delay, 0ms);
}

.td-reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .td-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .td-beam-frame::before {
    animation: none;
  }
}

/* deployment card, same palette and frame as the catalog card so the two read as one set */
.dc {
  --dc-lime: #c2ff26;
  --dc-text: #e6efe9;
  --dc-muted: #9fb5ad;
  --dc-line: rgba(255, 255, 255, 0.1);
  --dc-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--dc-line);
  border-radius: 20px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(33, 163, 0, 0.09), transparent 60%),
    #0a1411;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.8);
  color: var(--dc-text);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  text-align: left;
}

:where(.dc) :where(ul) {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* the local terminal the command is typed into */
.dc__term {
  overflow: hidden;
  border: 1px solid var(--dc-line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
}

.dc__bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--dc-line);
}

.dc__bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.dc__line {
  display: block;
  padding: 16px 14px;
  overflow: hidden;
  font-family: var(--dc-mono);
  font-size: 14px;
  white-space: nowrap;
}

.dc__prompt {
  color: var(--dc-lime);
}

.dc__caret {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--dc-lime);
  animation: dc-blink 1s steps(1) infinite;
}

@keyframes dc-blink {
  50% {
    opacity: 0;
  }
}

/* one box per provider in a fixed-height row, the running one grows into the space the others give up */
.dc__targets {
  display: flex;
  gap: 10px;
  height: 172px;
  margin-top: 14px;
}

.dc__target {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--dc-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  transition:
    flex-grow 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
    border-color 0.3s ease,
    background-color 0.3s ease;
}

.dc__target.is-running {
  flex-grow: 3;
  border-color: rgba(194, 255, 38, 0.55);
  background: rgba(33, 163, 0, 0.14);
}

.dc__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.is-running .dc__meta {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.dc__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--dc-muted);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

.is-running .dc__icon {
  background: rgba(194, 255, 38, 0.12);
  color: var(--dc-lime);
}

.dc__label {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dc__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.dc__where {
  color: var(--dc-muted);
  font-size: 12px;
  line-height: 1.3;
}

.dc__state {
  display: none;
  margin-left: auto;
  color: var(--dc-lime);
  font-family: var(--dc-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.is-running .dc__state {
  display: block;
}

/* the graph waits for the box to finish growing, then draws in node by node in --i order */
.dc__graph {
  position: absolute;
  top: 60px;
  left: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 72px);
  overflow: visible;
}

.dc__edge,
.dc__node {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.is-running .dc__edge,
.is-running .dc__node {
  opacity: 1;
  transition-delay: calc(450ms + var(--i) * 120ms);
}

.dc__edge {
  fill: none;
  stroke: rgba(230, 239, 233, 0.55);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.is-running .dc__edge {
  animation: dc-flow 0.8s linear infinite;
}

@keyframes dc-flow {
  to {
    stroke-dashoffset: -7;
  }
}

.dc__node text {
  font-family: var(--dc-mono);
  font-size: 9px;
  text-anchor: middle;
}

.dc__node--table rect {
  fill: #f2a33a;
}

.dc__node--table text {
  fill: #2a1700;
  font-weight: 600;
}

.dc__node--fn rect {
  fill: #1f4a3a;
  stroke: rgba(194, 255, 38, 0.35);
}

.dc__node--fn text {
  fill: var(--dc-text);
}

@media (prefers-reduced-motion: reduce) {
  .dc__caret,
  .is-running .dc__edge {
    animation: none;
  }
}

/* phones stack the boxes, the running one grows downward instead of sideways */
@media (max-width: 640px) {
  .dc {
    padding: 16px;
    border-radius: 16px;
  }

  .dc__line {
    font-size: 12px;
  }

  .dc__targets {
    flex-direction: column;
    gap: 8px;
    height: 400px;
  }

  .dc__meta {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
}

.td-deploy__scan {
  opacity: 0.75;
}

/* dither only exists for the stacked layout, kept faint so the cards read over it */
.td-deploy__dither {
  display: none;
  opacity: 0.45;
}

.td-deploy__layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: clamp(40px, 6vw, 80px);
}

.td-deploy__items {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 40px;
}

.td-deploy__item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 22px 24px;
  background: rgba(2, 26, 22, 0.72);
  backdrop-filter: blur(10px);
}

.td-deploy__title {
  margin: 0 0 6px;
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.35;
}

.td-deploy__body {
  margin: 0;
  color: var(--td-muted);
  font-size: 15px;
  line-height: 1.6;
}

.td-deploy__visual {
  position: relative;
}

/* crops the white fade baked into the bottom of the product view png, it was made for a light section */
.td-deploy__visual img {
  aspect-ratio: 2.35 / 1;
  object-fit: cover;
  object-position: top center;
}

.td-deploy__visual::before {
  content: '';
  position: absolute;
  inset: 10% 5%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(194, 255, 38, 0.22), transparent);
  filter: blur(40px);
}

@media (max-width: 960px) {
  .td-deploy__layout {
    grid-template-columns: 1fr;
  }

  /* gridscan sizes its room to the canvas and the tall stacked section turns it into a narrow shaft, so it's dropped once the layout stacks */
  .td-deploy__scan {
    display: none;
  }

  .td-deploy__dither {
    display: block;
  }
}

