/* ==========================================================================
   THE THRESHOLD — Split Reality Gate (White Square vs. Deep Blue Square)
   ========================================================================== */

.world--threshold {
  position: relative;
  min-height: 100svh;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  transition: grid-template-columns 0.72s var(--ease-out-expo);
}

/* Desktop hover expansion — dramatic editorial split */
@media (min-width: 861px) {
  .world--threshold[data-hover="quiet"] {
    grid-template-columns: 1.24fr 0.76fr;
  }
  .world--threshold[data-hover="abyss"] {
    grid-template-columns: 0.76fr 1.24fr;
  }
}

/* Floating Center Sovereign Emblem at the Meridian */
.threshold-meridian {
  position: fixed;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(8, 12, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  color: #F6F4EE;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  pointer-events: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  white-space: nowrap;
}

.threshold-meridian__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--klein-bright);
  box-shadow: 0 0 10px var(--klein-glow);
}

/* Split Halves */
.gate-half {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(86px, 11vh, 120px) clamp(26px, 5vw, 72px) clamp(64px, 8vh, 88px);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  text-align: left;
  transition: background-color 0.45s ease;
}

/* LEFT: WHITE SQUARE — QUIET MONOGRAPH */
.gate-half--quiet {
  background: var(--paper);
  color: var(--ink);
  border-right: 1px solid rgba(17, 19, 24, 0.12);
}

.gate-half--quiet::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(0, 47, 167, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 47, 167, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.65;
  pointer-events: none;
  z-index: -2;
}

.gate-half__art--quiet {
  position: relative;
  width: min(340px, 72%);
  margin: clamp(18px, 3vh, 36px) auto;
  mix-blend-mode: multiply;
  opacity: 0.88;
  transform: translateY(0) scale(0.98);
  transition: transform 0.72s var(--ease-out-expo), opacity 0.45s ease;
  pointer-events: none;
}

.gate-half--quiet:hover .gate-half__art--quiet,
.gate-half--quiet:focus-visible .gate-half__art--quiet {
  transform: translateY(-6px) scale(1.03);
  opacity: 1;
}

/* RIGHT: DEEP BLUE SQUARE — THE FULL ABYSS */
.gate-half--abyss {
  background:
    radial-gradient(circle at 65% 42%, rgba(28, 86, 255, 0.24) 0%, rgba(3, 6, 18, 0) 58%),
    linear-gradient(160deg, #04091B 0%, #020510 100%);
  color: var(--ice);
}

.gate-half--abyss::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(75, 139, 255, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(75, 139, 255, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 60% 45%, #000 15%, transparent 80%);
  pointer-events: none;
  z-index: -2;
}

.gate-half__art--abyss {
  position: relative;
  width: min(390px, 84%);
  margin: clamp(12px, 2.5vh, 28px) auto;
  border-radius: 16px;
  mask-image: radial-gradient(ellipse 84% 82% at 52% 48%, #000 58%, transparent 100%);
  opacity: 0.88;
  transform: translateY(0) scale(0.98);
  transition: transform 0.72s var(--ease-out-expo), opacity 0.45s ease, filter 0.55s ease;
  pointer-events: none;
  filter: saturate(1.06);
}

.gate-half--abyss:hover .gate-half__art--abyss,
.gate-half--abyss:focus-visible .gate-half__art--abyss {
  transform: translateY(-8px) scale(1.045);
  opacity: 1;
  filter: saturate(1.18) drop-shadow(0 0 36px rgba(37, 99, 255, 0.35));
}

/* Shared Gate Typography */
.gate-half__kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gate-half--quiet .gate-half__kicker {
  color: var(--klein);
}

.gate-half--abyss .gate-half__kicker {
  color: var(--klein-glow);
}

.gate-half__key {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 0.68rem;
  border: 1px solid currentColor;
  opacity: 0.72;
}

.gate-half__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 440px;
}

.gate-half__title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 4.4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
}

.gate-half__desc {
  margin: 0;
  font-size: clamp(0.95rem, 1.15vw, 1.06rem);
  line-height: 1.55;
}

.gate-half--quiet .gate-half__desc {
  color: var(--ink-muted);
}

.gate-half--abyss .gate-half__desc {
  color: var(--ice-muted);
}

/* Tactile Pill Buttons */
.pill-cta {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s ease, background 0.25s ease;
}

.pill-cta--ivory {
  background: var(--paper-elevated);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 2px 0 rgba(17, 19, 24, 0.08), 0 10px 26px rgba(17, 19, 24, 0.06);
}

.gate-half--quiet:hover .pill-cta--ivory {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: translateY(-2px);
}

.pill-cta--cobalt {
  background: linear-gradient(135deg, #1751F0 0%, #002FA7 100%);
  color: #fff;
  border: 1px solid rgba(130, 180, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(37, 99, 255, 0.25), 0 14px 36px rgba(0, 47, 167, 0.52);
}

.gate-half--abyss:hover .pill-cta--cobalt {
  background: linear-gradient(135deg, #2B6BFF 0%, #0C40CC 100%);
  transform: translateY(-2px);
  box-shadow: 0 0 26px rgba(59, 130, 255, 0.65), 0 16px 40px rgba(0, 47, 167, 0.62);
}

.pill-cta__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.pill-cta--ivory .pill-cta__dot {
  background: var(--klein);
}

.gate-half--quiet:hover .pill-cta--ivory .pill-cta__dot {
  background: var(--paper);
}

.pill-cta--cobalt .pill-cta__dot {
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

/* Threshold Whisper Bottom Bar (instant escape hatch for legal/support) */
.threshold-foot {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(8, 12, 24, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  color: rgba(242, 245, 252, 0.78);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.threshold-foot a {
  color: #fff;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.threshold-foot a:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.threshold-foot__sep {
  opacity: 0.35;
}

/* Mobile Stacked Split */
@media (max-width: 860px) {
  .world--threshold {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    overflow: visible;
  }

  .gate-half {
    padding: 36px 24px 36px;
    gap: 12px;
  }

  .gate-half--quiet {
    border-right: 0;
    border-bottom: 1px solid rgba(17, 19, 24, 0.12);
    padding-top: 76px;
  }

  .gate-half--abyss {
    padding-top: 36px;
    padding-bottom: 40px;
  }

  .gate-half__art--quiet,
  .gate-half__art--abyss {
    width: min(240px, 68%);
    margin: 10px auto;
  }

  .threshold-meridian {
    top: 14px;
    font-size: 0.64rem;
    padding: 7px 13px;
  }

  .threshold-foot {
    position: static;
    transform: none;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    padding: 14px 18px;
    background: #020510;
    font-size: 0.68rem;
    gap: 8px 10px;
    white-space: normal;
  }
}
