/* Ominous landing — scoped to body.home-page */
body.home-page {
  margin: 0;
  min-height: 100vh;
  background: #070708;
  color: #e4e0dc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}

body.home-page .home-splash {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, #1a0a0a 0%, #070708 55%, #000 100%);
  transition: opacity 0.85s ease, visibility 0.85s ease;
}

body.home-page .home-main {
  position: relative;
  z-index: 2;
}

body.home-page .home-splash.home-splash--out {
  opacity: 0;
  visibility: hidden;
}

body.home-page .home-main .home-fade-with-main {
  opacity: 0;
  transition: opacity 0.85s ease;
}

body.home-page .home-main.home-main--visible .home-fade-with-main {
  opacity: 1;
}

/* Disable startup splash/fade/type boot animations. */
body.home-page.home-no-startup-anim .home-splash {
  display: none;
  transition: none !important;
}

body.home-page.home-no-startup-anim .home-main .home-fade-with-main {
  opacity: 1 !important;
  transition: none !important;
}

body.home-page.home-no-startup-anim .home-csv-frame-wrap {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.home-page .home-main .navbar-custom {
  background: rgba(10, 10, 12, 0.94) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(10px);
}

body.home-page .home-main .navbar-brand {
  color: #ece8e0 !important;
}

body.home-page .home-main .text-muted {
  color: #8a8580 !important;
}

body.home-page .home-split {
  max-width: 1320px;
  margin: 0 auto;
}

body.home-page .home-split-row {
  --bs-gutter-x: 0;
}

body.home-page .home-left {
  padding: 0;
}

/* Never allow the right panel to stack under the hook section */
@media (max-width: 991.98px) {
  body.home-page .home-split-row {
    position: relative;
  }

  body.home-page .home-left {
    position: relative;
    z-index: 3;
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  body.home-page .home-right {
    display: block !important;
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    min-height: 0;
    margin-top: 0;
    overflow: visible !important;
    isolation: isolate;
    z-index: 1;
  }

  body.home-page .home-right > * {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body.home-page .home-right::before {
    content: "";
    position: absolute;
    inset: -10px -22px -18px -24px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.88;
    transform: translateX(4px) scale(1.14);
    background:
      linear-gradient(
        to bottom,
        rgba(7, 7, 8, 0.1) 0%,
        rgba(7, 7, 8, 0.68) 60%,
        rgba(7, 7, 8, 1) 100%
      ),
      radial-gradient(
        circle at 1.95px 1.95px,
        rgba(201, 196, 188, 0.5) 1.5px,
        transparent 1.65px
      );
    background-size: 100% 100%, 15px 15px;
    background-repeat: no-repeat, repeat;
  }
}

/* Crossfade illusion only while the panel is still on the right side */
@media (min-width: 0px) and (max-width: 1600px) {
  /* Keep the dot layer from being clipped by layout wrappers. */
  body.home-page .home-main,
  body.home-page .home-split,
  body.home-page .home-split-row,
  body.home-page .home-right {
    overflow: visible !important;
  }
}

@media (min-width: 1461px) and (max-width: 1600px) {
  body.home-page .home-right {
    position: relative;
    overflow: visible;
    isolation: isolate;
  }

  body.home-page .home-right::before {
    content: "";
    position: absolute;
    inset: -4px -14px -10px -6px;
    pointer-events: none;
    z-index: 2;
    opacity: 0.1;
    transform: translateX(4px) scale(1.01);
    background:
      linear-gradient(
        to bottom,
        rgba(7, 7, 8, 0.07) 0%,
        rgba(7, 7, 8, 0.48) 54%,
        rgba(7, 7, 8, 0.84) 100%
      ),
      radial-gradient(
        circle at 1.3px 1.3px,
        rgba(201, 196, 188, 0.22) 0.9px,
        transparent 1.05px
      );
    background-size: 100% 100%, 13px 13px;
    background-repeat: no-repeat, repeat;
  }
}

@media (min-width: 1321px) and (max-width: 1460px) {
  body.home-page .home-right {
    position: relative;
    overflow: visible;
    isolation: isolate;
  }

  body.home-page .home-right::before {
    content: "";
    position: absolute;
    inset: -6px -18px -12px -8px;
    pointer-events: none;
    z-index: 2;
    opacity: 0.16;
    transform: translateX(6px) scale(1.02);
    background:
      linear-gradient(
        to bottom,
        rgba(7, 7, 8, 0.08) 0%,
        rgba(7, 7, 8, 0.56) 56%,
        rgba(7, 7, 8, 0.9) 100%
      ),
      radial-gradient(
        circle at 1.35px 1.35px,
        rgba(201, 196, 188, 0.27) 0.95px,
        transparent 1.1px
      );
    background-size: 100% 100%, 12px 12px;
    background-repeat: no-repeat, repeat;
  }
}

@media (min-width: 992px) and (max-width: 1320px) {
  body.home-page .home-right {
    position: relative;
    overflow: visible;
    isolation: isolate;
  }

  body.home-page .home-right::before {
    content: "";
    position: absolute;
    inset: -8px -26px -16px -12px;
    pointer-events: none;
    z-index: 2;
    opacity: 0.3;
    transform: translateX(8px) scale(1.04);
    background:
      linear-gradient(
        to bottom,
        rgba(7, 7, 8, 0.08) 0%,
        rgba(7, 7, 8, 0.6) 58%,
        rgba(7, 7, 8, 0.96) 100%
      ),
      radial-gradient(
        circle at 1.4px 1.4px,
        rgba(201, 196, 188, 0.35) 1px,
        transparent 1.15px
      );
    background-size: 100% 100%, 12.5px 12.5px;
    background-repeat: no-repeat, repeat;
    transition:
      opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 520ms cubic-bezier(0.22, 1, 0.36, 1),
      inset 520ms cubic-bezier(0.22, 1, 0.36, 1),
      background-size 520ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.home-page .home-right > * {
    position: relative;
    z-index: 1;
    opacity: 0.9;
    transition: opacity 220ms ease;
  }
}

/* Width-bridge after lg breakpoint: single continuous retract */
@media (min-width: 992px) and (max-width: 1320px) {
  body.home-page .home-right::before {
    inset: -10px -30px -18px calc(-300px + (100vw - 992px) * 0.82);
    opacity: 0.78;
    transform: translateX(10px) scale(1.18);
    background-size: 100% 100%, 14.4px 14.4px;
  }
}

@media (min-width: 992px) and (max-width: 1200px) {
  body.home-page .home-right > * {
    opacity: 0.46;
  }
}

@media (min-width: 992px) and (max-width: 1080px) {
  body.home-page .home-right > * {
    opacity: 0.2;
  }
}

/* Final bridge before mobile handoff */
@media (min-width: 992px) and (max-width: 1030px) {
  body.home-page .home-right > * {
    opacity: 0.08;
    pointer-events: none;
  }
}

/* Prevent abrupt grid-mode snap right after 992px */
@media (min-width: 992px) and (max-width: 1200px) {
  body.home-page .home-split-row {
    position: relative;
  }

  body.home-page .home-left {
    position: relative;
    z-index: 3;
  }

  body.home-page .home-right {
    position: absolute !important;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    min-height: 0;
    margin-top: 0;
    z-index: 1;
    isolation: isolate;
  }

  body.home-page .home-right > * {
    opacity: 0.06;
    pointer-events: none;
  }

  body.home-page .home-right::before {
    inset: -10px -30px -18px calc(-26px - (1200px - 100vw) * 0.46);
    opacity: 0.86;
    transform: translateX(8px) scale(1.18);
    background-size: 100% 100%, 14.5px 14.5px;
  }
}

body.home-page .home-hook {
  position: relative;
  z-index: 4002;
  margin: 0 0 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(1.35rem, 4vw, 2.1rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #c9c4bc;
  text-shadow: 0 0 40px rgba(180, 40, 40, 0.35), 0 0 80px rgba(0, 0, 0, 0.8);
  opacity: 1 !important;
  animation: none !important;
  transition: none !important;
  filter: none !important;
  mix-blend-mode: normal;
}

body.home-page .home-typed {
  min-height: 1.55em;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  line-height: 1.55;
  color: #9c9790;
  margin: 0 0 0.5rem;
}

body.home-page .home-typed.home-typed-emphasis {
  color: #dcd7cf;
  font-weight: 600;
}

body.home-page .home-typed .home-caret {
  display: inline-block;
  width: 0.55ch;
  margin-left: 1px;
  border-bottom: 2px solid rgba(200, 80, 80, 0.75);
  animation: home-caret-blink 0.95s step-end infinite;
  vertical-align: baseline;
}

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

body.home-page .home-csv-frame-wrap {
  margin-top: 1rem;
  width: min(100%, 460px);
  height: clamp(520px, 72vh, 680px);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(220, 215, 207, 0.3);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.5);
  background: #121214;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 340ms ease, transform 340ms ease;
}

body.home-page .home-csv-frame-wrap.home-csv-frame-wrap--loaded {
  opacity: 1;
  transform: translateY(0);
}

body.home-page .home-csv-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #121214;
}

body.home-page .home-right .card {
  background: rgba(18, 18, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e4e0dc;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

body.home-page .home-right .text-muted {
  color: #8a8580 !important;
}

body.home-page .home-right .text-primary {
  color: #c9c4bc !important;
}

body.home-page .home-right .form-control {
  background: #121214;
  border-color: rgba(255, 255, 255, 0.15);
  color: #ece8e0;
}

body.home-page .home-right .btn-primary {
  background: #dcd7cf;
  border-color: #000;
  color: #0a0a0a;
  font-weight: 700;
  letter-spacing: 0.03em;
}

body.home-page .home-right .btn-primary:hover {
  background: #efede8;
  border-color: #000;
  color: #000;
}

body.home-page .home-right .bg-light {
  background: #121214 !important;
  color: #d0ccc4 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

body.home-page .home-early-access {
  position: fixed;
  left: max(0.75rem, env(safe-area-inset-left));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 2003;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45em;
  margin: 0;
  max-width: calc(100vw - 1.5rem);
  font-size: clamp(0.8rem, 2.4vw, 1.05rem);
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #b8b4ac;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

body.home-page .home-early-access__gif {
  flex-shrink: 0;
  width: auto;
  height: 2lh;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

@supports not (height: 1lh) {
  body.home-page .home-early-access__gif {
    height: 1.85em;
  }
}

body.home-page .home-early-access__text {
  white-space: nowrap;
}

/* Dedicated dots layer (outside the row/grid) */
body.home-page .home-split {
  position: relative;
  overflow: visible;
}

body.home-page .home-upload-dots {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 50%;
  pointer-events: none;
  z-index: 0;
  transform-origin: left center;
}

body.home-page .home-hook-layer {
  position: relative;
  z-index: 5000;
  isolation: isolate;
}

body.home-page .home-upload-dots::before {
  content: "";
  position: absolute;
  inset: -10px -30px -18px -22px;
  background:
    linear-gradient(
      to bottom,
      rgba(7, 7, 8, 0.1) 0%,
      rgba(7, 7, 8, 0.68) 60%,
      rgba(7, 7, 8, 1) 100%
    ),
    radial-gradient(
      circle at 1.9px 1.9px,
      rgba(201, 196, 188, 0.46) 1.45px,
      transparent 1.62px
    );
  background-size: 100% 100%, 14.8px 14.8px;
  background-repeat: no-repeat, repeat;
  opacity: 0.16;
  transform: translateX(4px) scale(1.02);
  transform-origin: left center;
  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1),
    inset 520ms cubic-bezier(0.22, 1, 0.36, 1),
    background-size 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Disable old in-card dot pseudo-layer to avoid conflicts */
body.home-page .home-right::before {
  content: none !important;
}

@media (max-width: 1320px) {
  body.home-page .home-upload-dots::before {
    opacity: 0.5;
    transform: translateX(8px) scale(1.12);
    inset: -10px -30px -18px -28px;
    background-size: 100% 100%, 15.2px 15.2px;
  }

  body.home-page .home-right > * {
    opacity: 0.5 !important;
  }
}

@media (max-width: 1200px) {
  body.home-page .home-upload-dots::before {
    opacity: 0.72;
    transform: translateX(10px) scale(1.18);
    inset: -10px -30px -18px -36px;
    background-size: 100% 100%, 15.6px 15.6px;
  }

  body.home-page .home-right > * {
    opacity: 0.2 !important;
    pointer-events: none !important;
  }
}

/* Mobile: keep dots on page by default, anchored where upload column lives */
@media (max-width: 991.98px) {
  body.home-page .home-upload-dots {
    left: 48%;
    right: -2%;
    bottom: -8%;
  }

  body.home-page .home-upload-dots::before {
    opacity: 0.86;
    transform: translateX(10px) scale(1.2);
    inset: -12px -28px -22px -42px;
    background-size: 100% 100%, 16px 16px;
  }

  body.home-page .home-right {
    display: none !important;
  }
}

/* Final stability overrides: keep upload in right column and morph from dots */
@media (min-width: 992px) {
  body.home-page .home-split-row {
    position: relative;
  }

  body.home-page .home-left {
    position: relative;
    z-index: 3;
  }

  body.home-page .home-right {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 4;
    display: block !important;
    margin-top: 0 !important;
    min-height: 0 !important;
  }
}

@media (min-width: 992px) and (max-width: 1080px) {
  body.home-page .home-right > * {
    opacity: calc(0.12 + (100vw - 992px) * 0.01) !important;
  }

  body.home-page .home-upload-dots::before {
    opacity: calc(0.9 - (100vw - 992px) * 0.0102);
    transform: translateX(calc(12px - (100vw - 992px) * 0.136))
      scale(calc(1.22 - (100vw - 992px) * 0.0025));
  }
}

@media (min-width: 992px) and (max-width: 1080px) {
  body.home-page .home-right > * {
    pointer-events: none !important;
  }
}

@media (min-width: 1081px) {
  body.home-page .home-right > * {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body.home-page .home-upload-dots::before {
    opacity: 0 !important;
    transform: translateX(0) scale(1) !important;
  }
}

/* Layout reset: stack frame first, then upload; keep frame at 80vw. */
body.home-page .home-upload-dots {
  display: none !important;
}

body.home-page .home-split-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(7.2rem, 12.8vw, 11.2rem);
}

body.home-page .home-left,
body.home-page .home-right {
  width: 80vw !important;
  max-width: 80vw !important;
  flex: 0 0 auto !important;
  margin: 0 auto;
}

body.home-page .home-csv-frame-wrap {
  width: 80vw;
  max-width: 80vw;
  margin: 0.9rem auto 0;
}

body.home-page .home-right {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  display: block !important;
  min-height: 0 !important;
  z-index: 4;
  isolation: isolate;
}

body.home-page .home-right > * {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Obstruction overlay: starts over upload card, then fades when revealed. */
body.home-page .home-upload-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

body.home-page .home-upload-card > *:not(.home-upload-dots) {
  position: relative;
  z-index: 2;
  opacity: 0.03 !important;
  pointer-events: none !important;
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.home-page .home-upload-card.home-upload-card--clear > *:not(.home-upload-dots) {
  opacity: 1 !important;
  pointer-events: auto !important;
}

body.home-page .home-upload-card .home-upload-dots {
  display: block !important;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

body.home-page .home-upload-card .home-upload-dots::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.99 !important;
  transform: translateX(8px) scale(1.08) !important;
  transform-origin: center;
  background:
    linear-gradient(
      to bottom,
      rgba(7, 7, 8, 0.2) 0%,
      rgba(7, 7, 8, 0.78) 55%,
      rgba(7, 7, 8, 1) 100%
    ),
    radial-gradient(
      circle at 1.9px 1.9px,
      rgba(201, 196, 188, 0.5) 1.45px,
      transparent 1.62px
    );
  background-size: 100% 100%, 14.8px 14.8px;
  background-repeat: no-repeat, repeat;
  animation: home-upload-dots-drift 14s linear infinite;
  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.home-page .home-upload-card.home-upload-card--clear .home-upload-dots::before {
  opacity: 0 !important;
  transform: translateX(0) scale(1.02) !important;
}

@media (max-width: 767.98px) {
  body.home-page .home-upload-card .home-upload-dots::before {
    opacity: 0.99 !important;
    background-size: 100% 100%, 15.6px 15.6px;
  }
}

@keyframes home-upload-dots-drift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 0 0, 14.8px 14.8px;
  }
}
