/* Optimus landing — Cybertron circuit surface, scoped under .landing */

.landing {
  --landing-font-display: "Exo 2", "Segoe UI", sans-serif;
  --landing-font-body: "Manrope", "Segoe UI", sans-serif;
  --landing-brand: #154690;
  --landing-ink: #0a1628;
  --landing-muted: color-mix(in srgb, var(--landing-ink) 62%, #5a6b82);
  --landing-sea: var(--landing-brand);
  --landing-glow: #3d8fd9;
  --landing-signal: #00c2ff;
  --landing-foam: #eef3fa;
  --landing-mist: #f4f7fc;
  --landing-pcb-base: #dce4ef;
  --landing-pcb-trace: color-mix(in srgb, var(--landing-sea) 55%, #64748b);
  --landing-pcb-chip: color-mix(in srgb, var(--landing-sea) 20%, var(--landing-pcb-base));
  --landing-particle: color-mix(in srgb, var(--landing-signal) 70%, var(--landing-glow));
  --landing-artifact: color-mix(in srgb, var(--landing-pcb-trace) 55%, transparent);
  font-family: var(--landing-font-body);
  color: var(--landing-ink);
  background: var(--landing-mist);
}

[data-bs-theme="dark"] .landing {
  --landing-ink: #e8eef7;
  --landing-muted: color-mix(in srgb, var(--landing-ink) 68%, #0a1628);
  --landing-foam: #0c1628;
  --landing-mist: #060d18;
  --landing-pcb-base: #0a1220;
  --landing-pcb-trace: color-mix(in srgb, var(--landing-glow) 45%, #1e3a5f);
  --landing-pcb-chip: color-mix(in srgb, var(--landing-sea) 35%, #0d1a2d);
  background: var(--landing-mist);
  color: var(--landing-ink);
}

[data-color-theme="opal"] .landing {
  --landing-brand: #B91C1C;
  --landing-ink: #2A0A0A;
  --landing-glow: #DC2626;
  --landing-signal: #EF4444;
  --landing-foam: #fef2f2;
  --landing-mist: #fff5f5;
  --landing-pcb-trace: color-mix(in srgb, var(--landing-brand) 50%, #64748b);
}

[data-color-theme="opal"][data-bs-theme="dark"] .landing {
  --landing-ink: #fee2e2;
  --landing-foam: #1A0606;
  --landing-mist: #120404;
  --landing-pcb-base: #0E0303;
  --landing-pcb-trace: color-mix(in srgb, var(--landing-glow) 40%, #5C1414);
}

[data-color-theme="kyber"] .landing {
  --landing-brand: #10B981;
  --landing-ink: #052e16;
  --landing-glow: #34D399;
  --landing-signal: #6EE7B7;
  --landing-foam: #ecfdf5;
  --landing-mist: #f0fdf4;
  --landing-pcb-trace: color-mix(in srgb, var(--landing-brand) 50%, #64748b);
}

[data-color-theme="kyber"][data-bs-theme="dark"] .landing {
  --landing-ink: #d1fae5;
  --landing-foam: #052e16;
  --landing-mist: #022c22;
  --landing-pcb-base: #021a14;
  --landing-pcb-trace: color-mix(in srgb, var(--landing-glow) 40%, #065f46);
}

.landing-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: calc(100vh - var(--app-navbar-offset));
  display: flex;
  align-items: center;
  padding: clamp(3rem, 8vh, 5.5rem) 0 clamp(4rem, 10vh, 6rem);
}

.landing-hero__atmosphere {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* Circuit board substrate */
.landing-hero__substrate {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 55%, color-mix(in srgb, var(--landing-glow) 12%, transparent), transparent 65%),
    linear-gradient(
      180deg,
      var(--landing-mist) 0%,
      var(--landing-pcb-base) 35%,
      color-mix(in srgb, var(--landing-pcb-base) 85%, var(--landing-sea)) 100%
    );
}

/* Scattered surface debris — faint PCB fragments */
.landing-hero__artifacts {
  position: absolute;
  inset: 0;
  mask-image: radial-gradient(ellipse 100% 90% at 50% 55%, #000 25%, transparent 92%);
}

.landing-hero__artifact {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  animation: landing-artifact-breathe 8s ease-in-out infinite;
}

.landing-hero__artifact--shard {
  border: 1px solid var(--landing-artifact);
  background: color-mix(in srgb, var(--landing-pcb-chip) 35%, transparent);
  box-shadow: inset 0 0 12px color-mix(in srgb, var(--landing-glow) 8%, transparent);
}

.landing-hero__artifact--1 {
  width: 42px;
  height: 18px;
  top: 18%;
  left: 8%;
  transform: rotate(-24deg);
  animation-delay: 0s;
}

.landing-hero__artifact--2 {
  width: 28px;
  height: 12px;
  top: 72%;
  right: 10%;
  transform: rotate(18deg);
  animation-delay: -3.2s;
}

.landing-hero__artifact--trace {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--landing-artifact) 35%,
    color-mix(in srgb, var(--landing-signal) 25%, transparent) 50%,
    var(--landing-artifact) 65%,
    transparent
  );
  border: none;
}

.landing-hero__artifact--3 {
  width: 64px;
  top: 28%;
  right: 14%;
  transform: rotate(12deg);
  animation-delay: -1.4s;
}

.landing-hero__artifact--4 {
  width: 48px;
  bottom: 22%;
  left: 12%;
  transform: rotate(-8deg);
  animation-delay: -5.1s;
}

.landing-hero__artifact--pad {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--landing-glow) 30%, var(--landing-pcb-base));
  border: 1px solid var(--landing-artifact);
  box-shadow: 0 0 6px color-mix(in srgb, var(--landing-signal) 15%, transparent);
}

.landing-hero__artifact--5 { top: 34%; left: 22%; animation-delay: -2s; }
.landing-hero__artifact--6 { bottom: 30%; right: 24%; animation-delay: -4.6s; }

.landing-hero__artifact--hex {
  width: 22px;
  height: 22px;
  border: 1px solid var(--landing-artifact);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: color-mix(in srgb, var(--landing-pcb-chip) 25%, transparent);
}

.landing-hero__artifact--7 {
  top: 62%;
  left: 6%;
  transform: rotate(15deg);
  animation-delay: -6.2s;
}

.landing-hero__artifact--8 {
  top: 14%;
  right: 28%;
  width: 16px;
  height: 16px;
  animation-delay: -2.8s;
}

.landing-hero__artifact--chip {
  width: 20px;
  height: 14px;
  border: 1px solid var(--landing-artifact);
  border-radius: 2px;
  background: repeating-linear-gradient(
    90deg,
    color-mix(in srgb, var(--landing-pcb-chip) 50%, transparent) 0 2px,
    transparent 2px 4px
  );
  top: 48%;
  right: 6%;
  transform: rotate(-12deg);
  animation-delay: -1.8s;
}

.landing-hero__artifact--spark {
  width: 2px;
  height: 14px;
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--landing-signal) 40%, transparent),
    transparent
  );
  top: 40%;
  left: 78%;
  transform: rotate(35deg);
  animation-delay: -0.6s;
  box-shadow: 0 0 8px color-mix(in srgb, var(--landing-signal) 20%, transparent);
}

/* Floating energy motes */
.landing-hero__particles {
  position: absolute;
  inset: 0;
}

.landing-hero__particle {
  position: absolute;
  border-radius: 50%;
  background: var(--landing-particle);
  box-shadow: 0 0 6px color-mix(in srgb, var(--landing-particle) 45%, transparent);
  opacity: 0;
  animation: landing-particle-drift 14s ease-in-out infinite;
}

.landing-hero__particle--1 { width: 3px; height: 3px; top: 12%; left: 18%; animation-duration: 12s; animation-delay: 0s; }
.landing-hero__particle--2 { width: 2px; height: 2px; top: 22%; left: 62%; animation-duration: 16s; animation-delay: -2s; }
.landing-hero__particle--3 { width: 4px; height: 4px; top: 35%; left: 84%; animation-duration: 13s; animation-delay: -4s; }
.landing-hero__particle--4 { width: 2px; height: 2px; top: 48%; left: 42%; animation-duration: 18s; animation-delay: -1s; }
.landing-hero__particle--5 { width: 3px; height: 3px; top: 55%; left: 8%; animation-duration: 15s; animation-delay: -6s; }
.landing-hero__particle--6 { width: 2px; height: 2px; top: 68%; left: 52%; animation-duration: 11s; animation-delay: -3s; }
.landing-hero__particle--7 { width: 3px; height: 3px; top: 74%; left: 88%; animation-duration: 17s; animation-delay: -8s; }
.landing-hero__particle--8 { width: 2px; height: 2px; top: 82%; left: 28%; animation-duration: 14s; animation-delay: -5s; }
.landing-hero__particle--9 { width: 2px; height: 2px; top: 16%; left: 44%; animation-duration: 19s; animation-delay: -7s; }
.landing-hero__particle--10 { width: 3px; height: 3px; top: 28%; left: 92%; animation-duration: 12s; animation-delay: -9s; }
.landing-hero__particle--11 { width: 2px; height: 2px; top: 58%; left: 72%; animation-duration: 16s; animation-delay: -2.5s; }
.landing-hero__particle--12 { width: 4px; height: 4px; top: 44%; left: 14%; animation-duration: 13s; animation-delay: -4.5s; }
.landing-hero__particle--13 { width: 2px; height: 2px; top: 64%; left: 36%; animation-duration: 15s; animation-delay: -6.5s; }
.landing-hero__particle--14 { width: 3px; height: 3px; top: 8%; left: 76%; animation-duration: 11s; animation-delay: -1.5s; }
.landing-hero__particle--15 { width: 2px; height: 2px; top: 38%; left: 58%; animation-duration: 18s; animation-delay: -10s; }
.landing-hero__particle--16 { width: 2px; height: 2px; top: 86%; left: 64%; animation-duration: 14s; animation-delay: -3.5s; }

.landing-hero__particle:nth-child(3n) {
  border-radius: 1px;
  width: 1px;
  height: 6px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--landing-particle),
    transparent
  );
  box-shadow: none;
}

/* Film grain — ties layers together */
.landing-hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

[data-bs-theme="dark"] .landing-hero__grain {
  opacity: 0.055;
}

/* Tilted PCB plane */
.landing-hero__pcb {
  position: absolute;
  inset: -20% -8%;
  transform: perspective(720px) rotateX(56deg) scale(1.12);
  transform-origin: 50% 72%;
  mask-image: radial-gradient(ellipse 95% 85% at 50% 58%, #000 35%, transparent 88%);
}

.landing-hero__pcb-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.landing-hero__traces-base {
  stroke: var(--landing-pcb-trace);
  opacity: 0.55;
}

.landing-hero__traces-base rect {
  fill: var(--landing-pcb-chip);
  stroke: var(--landing-pcb-trace);
  opacity: 0.85;
}

.landing-hero__traces-base circle {
  fill: color-mix(in srgb, var(--landing-glow) 35%, var(--landing-pcb-base));
  stroke: var(--landing-pcb-trace);
}

.landing-hero__traces-power {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--landing-signal) 55%, transparent));
}

.landing-hero__trace {
  stroke-dasharray: 24 320;
  animation: landing-trace-flow 5s linear infinite;
}

.landing-hero__trace--1 { animation-duration: 4.5s; }
.landing-hero__trace--2 { animation-duration: 6s; animation-delay: -1.2s; }
.landing-hero__trace--3 { animation-duration: 5.5s; animation-delay: -2.4s; }
.landing-hero__trace--4 { animation-duration: 7s; animation-delay: -0.8s; stroke-dasharray: 20 280; }
.landing-hero__trace--5 { animation-duration: 5s; animation-delay: -3s; stroke-dasharray: 18 300; }
.landing-hero__trace--6 { animation-duration: 6.5s; animation-delay: -1.8s; stroke-dasharray: 22 290; }
.landing-hero__trace--7 { animation-duration: 4s; animation-delay: -2s; }
.landing-hero__trace--8 { animation-duration: 5.8s; animation-delay: -3.5s; }

/* Junction nodes — power arriving at pads */
.landing-hero__pcb-nodes {
  position: absolute;
  inset: 0;
}

.landing-hero__node {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--landing-signal);
  box-shadow:
    0 0 8px 2px color-mix(in srgb, var(--landing-signal) 50%, transparent),
    0 0 20px 4px color-mix(in srgb, var(--landing-glow) 25%, transparent);
  transform: translate(-50%, -50%);
  animation: landing-node-pulse 3s ease-in-out infinite;
}

.landing-hero__node--a { top: 42%; left: 29%; animation-delay: 0s; }
.landing-hero__node--b { top: 38%; left: 50%; animation-delay: -0.9s; }
.landing-hero__node--c { top: 52%; left: 68%; animation-delay: -1.7s; }
.landing-hero__node--d { top: 58%; left: 36%; animation-delay: -2.4s; }

.landing-hero__content {
  max-width: 42rem;
  margin-inline: auto;
  text-align: center;
  position: relative;
}

.landing-brand {
  font-family: var(--landing-font-display);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 5.25rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 1.25rem;
  color: var(--landing-brand);
  text-shadow: 0 0 40px color-mix(in srgb, var(--landing-glow) 25%, transparent);
  animation: landing-rise 0.8s ease-out both;
}

.landing-headline {
  font-family: var(--landing-font-display);
  font-weight: 500;
  font-size: clamp(1.65rem, 3.6vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 auto 1rem;
  max-width: 20ch;
  animation: landing-rise 0.8s ease-out 0.08s both;
}

.landing-lede {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.55;
  color: var(--landing-muted);
  margin: 0 auto 1.75rem;
  max-width: 36rem;
  animation: landing-rise 0.8s ease-out 0.16s both;
}

.landing-lede--note {
  margin-top: -1rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  animation: landing-rise 0.8s ease-out 0.2s both;
}

.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: center;
  animation: landing-rise 0.8s ease-out 0.24s both;
}

.landing-welcome {
  width: 100%;
  text-align: center;
  animation: landing-rise 0.8s ease-out 0.24s both;
}

.landing-welcome__greeting {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.55;
  color: var(--landing-muted);
  margin: 0 auto 1.25rem;
  max-width: 36rem;
}

.landing-welcome__action {
  display: inline-block;
  border-radius: 0.35rem;
  padding-inline: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 0 24px color-mix(in srgb, var(--landing-brand) 30%, transparent);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-welcome__action:hover,
.landing-welcome__action:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 0 32px color-mix(in srgb, var(--landing-glow) 40%, transparent);
}

.landing-cta .btn-lg {
  border-radius: 0.35rem;
  padding-inline: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.landing-cta__primary {
  box-shadow: 0 0 24px color-mix(in srgb, var(--landing-brand) 30%, transparent);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-cta__primary:hover,
.landing-cta__primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 0 32px color-mix(in srgb, var(--landing-glow) 40%, transparent);
}

.landing-cta__secondary {
  background: color-mix(in srgb, var(--landing-mist) 65%, transparent);
  backdrop-filter: blur(6px);
  border-color: color-mix(in srgb, var(--landing-brand) 45%, transparent);
}

.landing-section {
  padding: clamp(3.5rem, 9vh, 5.5rem) 0;
  border-top: 1px solid color-mix(in srgb, var(--landing-ink) 8%, transparent);
  background: var(--landing-mist);
}

.landing-section__intro,
.landing-close {
  max-width: 48rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.landing-close {
  margin-bottom: 0;
}

.landing-close .landing-cta {
  justify-content: center;
}

.landing-section__title {
  font-family: var(--landing-font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0.02em;
  margin: 0 0 0.85rem;
}

.landing-section__copy {
  margin: 0;
  color: var(--landing-muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.landing-features {
  display: grid;
  gap: 2rem 2.5rem;
}

@media (min-width: 768px) {
  .landing-features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.landing-feature {
  padding-top: 1rem;
  border-top: 2px solid color-mix(in srgb, var(--landing-sea) 55%, transparent);
}

.landing-feature__title {
  font-family: var(--landing-font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  color: var(--landing-brand);
}

.landing-feature__copy {
  margin: 0;
  color: var(--landing-muted);
  line-height: 1.5;
}

@keyframes landing-rise {
  from {
    opacity: 0;
    transform: translateY(0.85rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes landing-trace-flow {
  to {
    stroke-dashoffset: -344;
  }
}

@keyframes landing-node-pulse {
  0%, 100% {
    opacity: 0.45;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.25);
  }
}

@keyframes landing-particle-drift {
  0%, 100% {
    opacity: 0;
    transform: translate(0, 0);
  }
  12% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.25;
    transform: translate(12px, -18px);
  }
  88% {
    opacity: 0.4;
  }
}

@keyframes landing-artifact-breathe {
  0%, 100% {
    opacity: 0.12;
  }
  45% {
    opacity: 0.28;
  }
  70% {
    opacity: 0.18;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-brand,
  .landing-headline,
  .landing-lede,
  .landing-cta,
  .landing-welcome,
  .landing-hero__trace,
  .landing-hero__node,
  .landing-hero__particle,
  .landing-hero__artifact,
  .landing-cta__primary {
    animation: none !important;
    transition: none !important;
  }

  .landing-hero__particle {
    opacity: 0.2;
  }

  .landing-hero__artifact {
    opacity: 0.18;
  }

  .landing-hero__trace {
    stroke-dasharray: none;
    opacity: 0.7;
  }
}
