:root {
  --ld-bg: #050505;
  --ld-bg-2: #0b0d10;
  --ld-surface: #0f1216;
  --ld-surface-2: #151a21;
  --ld-text: #f4f6f8;
  --ld-muted: #8b95a5;
  --ld-accent: #00e5c0;
  --ld-accent-dim: rgba(0, 229, 192, 0.14);
  --ld-line: rgba(244, 246, 248, 0.1);
  --ld-line-strong: rgba(0, 229, 192, 0.35);
  --ld-danger: #ff4d5e;
  --ld-display: "Space Grotesk", system-ui, sans-serif;
  --ld-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ld-max: 1180px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body.landing-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  background: var(--ld-bg);
  color: var(--ld-text);
  font-family: var(--ld-display);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.ld-skip {
  position: absolute;
  left: -9999px;
  top: 0;
}

.ld-skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--ld-accent);
  color: #041016;
  padding: 0.5rem 0.75rem;
}

.ld-shell {
  position: relative;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* —— Nav —— */
.ld-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.25rem);
  border-bottom: 1px solid transparent;
  background: rgba(5, 5, 5, 0.82);
  backdrop-filter: blur(12px);
}

.ld-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ld-text);
  text-decoration: none;
  min-width: 0;
}

.ld-brand img {
  height: 26px;
  width: auto;
  flex-shrink: 0;
}

.ld-brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
}

.ld-brand-tag {
  font-family: var(--ld-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--ld-accent);
  border: 1px solid var(--ld-line-strong);
  padding: 0.18rem 0.4rem;
}

.ld-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ld-nav-link {
  font-family: var(--ld-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ld-muted);
  text-decoration: none;
}

.ld-nav-link:hover {
  color: var(--ld-text);
}

.ld-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0.7rem 1.15rem;
  font-family: var(--ld-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ld-btn:focus-visible {
  outline: 2px solid var(--ld-accent);
  outline-offset: 3px;
}

.ld-btn-primary {
  background: var(--ld-accent);
  color: #041016;
  border-color: var(--ld-accent);
}

.ld-btn-primary:hover {
  background: #33f0d0;
  transform: translateY(-1px);
}

.ld-btn-ghost {
  background: transparent;
  border-color: var(--ld-line);
  color: var(--ld-text);
}

.ld-btn-ghost:hover {
  border-color: var(--ld-accent);
  background: var(--ld-accent-dim);
}

.ld-btn-lg {
  padding: 0.9rem 1.35rem;
}

/* —— Hero —— */
.ld-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-content: end;
  gap: 1.5rem;
  padding: clamp(5.5rem, 12vh, 7.5rem) clamp(1rem, 4vw, 2.25rem) 1.5rem;
  isolation: isolate;
  width: 100%;
}

.ld-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 75% 15%, rgba(0, 229, 192, 0.1), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 90%, rgba(80, 120, 180, 0.08), transparent 50%),
    linear-gradient(180deg, #050505 0%, #080a0d 50%, #050505 100%);
  overflow: hidden;
}

.ld-grid-floor {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
  opacity: 0.7;
}

.ld-mesh {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.45;
  pointer-events: none;
}

.ld-mesh .link {
  stroke: rgba(0, 229, 192, 0.28);
  stroke-width: 1;
  fill: none;
  stroke-dasharray: 3 7;
  animation: ld-dash 22s linear infinite;
}

.ld-mesh .node {
  fill: var(--ld-accent);
  opacity: 0.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: ld-pulse 3.8s ease-in-out infinite;
}

.ld-mesh .node:nth-of-type(3n) { animation-delay: 0.7s; }
.ld-mesh .node:nth-of-type(3n + 1) { animation-delay: 1.5s; }

.ld-mesh .node-core {
  fill: #fff;
  opacity: 0.95;
}

@keyframes ld-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 0.95; transform: scale(1.2); }
}

@keyframes ld-dash {
  to { stroke-dashoffset: -140; }
}

.ld-hero-inner {
  max-width: var(--ld-max);
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.ld-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
}

.ld-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--ld-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--ld-accent);
}

.ld-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ld-accent);
  box-shadow: 0 0 0 0 rgba(0, 229, 192, 0.55);
  animation: ld-status-pulse 2s ease-out infinite;
}

@keyframes ld-status-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 229, 192, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(0, 229, 192, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 229, 192, 0); }
}

.ld-meta-code {
  font-family: var(--ld-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--ld-muted);
}

.ld-brand-hero {
  margin: 0 0 0.85rem;
  font-size: clamp(4rem, 16vw, 8.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.88;
  color: var(--ld-text);
}

.ld-hero-title {
  margin: 0 0 0.9rem;
  max-width: 14ch;
  font-size: clamp(1.35rem, 3.5vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ld-accent);
}

.ld-hero-lead {
  max-width: 34rem;
  margin: 0 0 1.75rem;
  color: var(--ld-muted);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 500;
}

.ld-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.ld-hero-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  max-width: var(--ld-max);
  width: 100%;
  margin: 0 auto;
}

.ld-rail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--ld-line);
  background: rgba(15, 18, 22, 0.72);
  backdrop-filter: blur(6px);
}

.ld-rail-item span {
  font-family: var(--ld-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--ld-muted);
}

.ld-rail-item strong {
  font-family: var(--ld-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ld-text);
}

/* —— Sections —— */
.ld-section {
  padding: clamp(3.5rem, 9vh, 5.5rem) clamp(1rem, 4vw, 2.25rem);
}

.ld-section-inner {
  max-width: var(--ld-max);
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.ld-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 2rem;
}

.ld-kicker {
  margin: 0 0 0.55rem;
  font-family: var(--ld-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ld-accent);
}

.ld-section h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.55rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.ld-section-lead {
  margin: 0;
  max-width: 22rem;
  color: var(--ld-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.ld-systems {
  background: var(--ld-bg-2);
  border-top: 1px solid var(--ld-line);
  border-bottom: 1px solid var(--ld-line);
}

.ld-card-grid,
.ld-loop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ld-panel {
  position: relative;
  min-width: 0;
  padding: 1.25rem 1.2rem 1.35rem;
  background: var(--ld-surface);
  border: 1px solid var(--ld-line);
}

.ld-panel-corners::before,
.ld-panel-corners::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid var(--ld-accent);
  opacity: 0.7;
  pointer-events: none;
}

.ld-panel-corners::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.ld-panel-corners::after {
  right: -1px;
  bottom: -1px;
  border-left: 0;
  border-top: 0;
}

.ld-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ld-panel-id,
.ld-panel-state,
.ld-loop-phase {
  font-family: var(--ld-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
}

.ld-panel-id,
.ld-loop-phase {
  color: var(--ld-muted);
}

.ld-panel-state {
  color: var(--ld-accent);
}

.ld-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ld-panel p,
.ld-loop-panel > span:last-child {
  margin: 0;
  color: var(--ld-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.ld-loop-panel {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 100%;
}

.ld-loop-panel strong {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ld-cta {
  padding-bottom: clamp(3rem, 8vh, 4.5rem);
}

.ld-cta .ld-section-lead {
  margin: 0.75rem 0 1.5rem;
  max-width: 28rem;
}

.ld-cta-panel {
  position: relative;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  border: 1px solid var(--ld-line);
  background:
    linear-gradient(135deg, rgba(0, 229, 192, 0.06), transparent 45%),
    var(--ld-surface);
}

.ld-cta-panel h2 {
  max-width: 16ch;
}

/* —— Footer —— */
.ld-footer {
  padding: 1.25rem clamp(1rem, 4vw, 2.25rem) 1.75rem;
  border-top: 1px solid var(--ld-line);
}

.ld-footer-inner {
  max-width: var(--ld-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--ld-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ld-muted);
}

.ld-footer-brand em {
  font-style: normal;
  color: var(--ld-muted);
  opacity: 0.8;
}

.ld-footer a {
  color: var(--ld-accent);
  text-decoration: none;
}

.ld-footer a:hover {
  text-decoration: underline;
}

/* —— Motion —— */
.ld-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.ld-reveal.is-visible {
  opacity: 1;
  transform: none;
}

.ld-reveal-delay-1 { transition-delay: 0.07s; }
.ld-reveal-delay-2 { transition-delay: 0.14s; }
.ld-reveal-delay-3 { transition-delay: 0.21s; }

/* —— Responsive —— */
@media (max-width: 900px) {
  .ld-hero-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ld-nav-link {
    display: none;
  }
}

@media (max-width: 720px) {
  .ld-card-grid,
  .ld-loop-grid {
    grid-template-columns: 1fr;
  }

  .ld-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .ld-section-lead {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .ld-nav {
    padding: 0.75rem 1rem;
  }

  .ld-brand-tag {
    display: none;
  }

  .ld-nav-actions .ld-btn {
    padding: 0.55rem 0.8rem;
    font-size: 0.68rem;
  }

  .ld-hero {
    min-height: auto;
    padding-top: 5.25rem;
    padding-bottom: 1.25rem;
    align-content: start;
  }

  .ld-brand-hero {
    font-size: clamp(3.25rem, 22vw, 4.5rem);
  }

  .ld-hero-title {
    max-width: none;
  }

  .ld-hero-ctas {
    width: 100%;
  }

  .ld-hero-ctas .ld-btn,
  .ld-cta .ld-btn {
    width: 100%;
  }

  .ld-hero-rail {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .ld-section {
    padding: 2.75rem 1rem;
  }

  .ld-mesh {
    opacity: 0.28;
  }

  .ld-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 380px) {
  .ld-hero-rail {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .ld-mesh .link,
  .ld-mesh .node,
  .ld-status i {
    animation: none;
  }

  .ld-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .ld-btn {
    transition: none;
  }
}
