/* KORT-X landing composition. Loaded after the legacy inline rules. */

.home-shell {
  --bg: #080a0c;
  --text: #f2f3ef;
  --header-bg: rgba(8, 10, 12, 0.82);
  --card-bg: rgba(255, 255, 255, 0.035);
  --glass-border: rgba(242, 243, 239, 0.13);
  --menu-bg: #0b0e11;
  --primary: #69c6ff;
  --kx-mint: #78e0bd;
  --kx-orange: #ff8856;
  --kx-muted: #899199;
  background: var(--bg);
}

.home-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
}

.home-shell::after {
  z-index: 1;
  background: radial-gradient(circle at 55% 46%, transparent 0 20%, rgba(8, 10, 12, 0.2) 48%, rgba(8, 10, 12, 0.86) 100%);
}

.home-shell .aurora {
  display: none;
}

.home-shell #kx-field {
  z-index: 1;
  opacity: 0.72;
}

.home-shell .grid-floor {
  z-index: 2;
  height: 26vh;
  opacity: 0.45;
}

.home-shell .hud {
  top: 92px;
  right: 34px;
  bottom: 34px;
  left: 34px;
  z-index: 3;
}

.home-shell .hud b {
  width: 12px;
  height: 12px;
  border-color: rgba(120, 224, 189, 0.42);
}

.home-shell .hud-tele {
  color: var(--kx-mint);
  opacity: 0.52;
}

.home-shell header {
  height: 72px;
  padding: 0 40px;
  background: var(--header-bg);
  border-bottom-color: rgba(242, 243, 239, 0.1);
  animation: none;
}

.home-shell .nav-logo {
  font-size: 20px;
  letter-spacing: 4px;
}

.home-shell .status-pending {
  color: var(--kx-mint);
  opacity: 0.9;
}

.home-shell .status-description {
  opacity: 0.42;
}

.home-shell .gh-link,
.home-shell .lang-select {
  min-height: 30px;
  border-radius: 2px;
  opacity: 0.62;
}

.home-shell #theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.home-shell .hero {
  position: relative;
  z-index: 4;
  width: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(380px, 1.1fr) minmax(330px, 0.9fr) minmax(230px, 0.58fr);
  grid-template-rows: 1fr;
  align-items: center;
  gap: 4vw;
  padding: 104px 6vw 42px;
}

.home-shell .hero-copy {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  position: relative;
  z-index: 12;
  max-width: 650px;
  transform: translateY(-54px);
}

.home-shell .hero-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--kx-mint);
  font: 700 9px/1.2 'Consolas', 'SFMono-Regular', monospace;
  letter-spacing: 3px;
}

.home-shell .hero-kicker::before {
  content: '';
  width: 34px;
  height: 1px;
  background: var(--kx-mint);
}

.home-shell .hero-wordmark {
  margin: 0;
  color: var(--text);
  font-size: 112px;
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: 0;
  white-space: nowrap;
}

.home-shell .hero-wordmark span {
  color: var(--kx-orange);
  font-weight: 300;
}

.home-shell .hero-deck {
  max-width: 500px;
  margin-top: 28px;
  color: var(--kx-muted);
  font-size: 14px;
  line-height: 1.75;
}

.home-shell .hero-title {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: start;
  z-index: 13;
  width: auto;
  margin-top: 174px;
  padding: 0;
  color: var(--text);
  background: none;
  filter: none;
  opacity: 0.92;
  animation: none;
  font: 600 10px/1.4 'Inter', system-ui, sans-serif;
  letter-spacing: 5px;
  text-align: left;
}

.home-shell .bf-main-section {
  position: relative;
  right: auto;
  bottom: auto;
  left: auto;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: start;
  z-index: 14;
  margin-top: 288px;
  transform: none;
  animation: none;
}

.home-shell .bf-main-btn {
  min-height: 44px;
  gap: 18px;
  padding: 0 18px;
  border-color: rgba(255, 136, 86, 0.5);
  border-radius: 2px;
  opacity: 1;
  color: var(--text);
}

.home-shell .bf-main-btn:hover,
.home-shell .bf-main-btn:focus-visible {
  border-color: var(--kx-orange);
  background: rgba(255, 136, 86, 0.08);
  box-shadow: 0 0 28px rgba(255, 136, 86, 0.12);
}

.home-shell .bf-main-label {
  color: inherit;
  background: none;
  filter: none;
  font-size: 9px !important;
  letter-spacing: 3px;
}

.home-shell .bf-main-arrow {
  color: var(--kx-orange);
}

.home-shell .cube-wrap {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  z-index: 15;
  align-self: center;
  justify-self: center;
  margin: 0;
  transform: none;
  animation: none;
}

.home-shell .cube-wrap::before {
  content: '01 / NAVIGATION CORE';
  position: absolute;
  top: -96px;
  left: -40px;
  width: 300px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(105, 198, 255, 0.38);
  color: var(--primary);
  font: 700 8px/1 'Consolas', monospace;
  letter-spacing: 3px;
  opacity: 0.82;
}

.home-shell .cube-wrap::after {
  content: 'LIVE FIELD  /  LAB 01  /  45.94 N';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -88px;
  color: var(--kx-muted);
  font: 600 7px/1 'Consolas', monospace;
  letter-spacing: 2px;
  white-space: nowrap;
}

.home-shell #cube-viewport,
.home-shell .cube-face {
  width: 220px;
  height: 220px;
}

.home-shell #cube-viewport {
  outline-offset: 12px;
}

.home-shell .face-front { transform: translateZ(110px); }
.home-shell .face-back { transform: rotateY(180deg) translateZ(110px); }
.home-shell .face-right { transform: rotateY(90deg) translateZ(110px); }
.home-shell .face-left { transform: rotateY(-90deg) translateZ(110px); }
.home-shell .face-top { transform: rotateX(90deg) translateZ(110px); }
.home-shell .face-bottom { transform: rotateX(-90deg) translateZ(110px); }

.home-shell .cube-face {
  border-color: rgba(105, 198, 255, 0.64);
  filter: brightness(0.86) contrast(1.18) saturate(0.88);
  box-shadow:
    inset 0 0 36px rgba(8, 10, 12, 0.58),
    0 0 24px rgba(105, 198, 255, 0.08);
}

.home-shell .cube-wrap:hover .cube-face,
.home-shell #cube-viewport:focus-visible .cube-face {
  filter: brightness(1.02) contrast(1.14) saturate(1.08);
  border-color: var(--kx-mint);
}

.home-shell .cube-glow {
  width: 280px;
  height: 24px;
  bottom: -74px;
  background: rgba(105, 198, 255, 0.24);
  filter: blur(24px);
}

.home-shell .cube-hint {
  top: auto;
  bottom: -58px;
  color: var(--kx-mint);
  opacity: 0.86;
}

.home-shell .cube-hint span {
  padding: 5px 8px;
  border: 1px solid rgba(120, 224, 189, 0.3);
  border-radius: 2px;
  background: rgba(8, 10, 12, 0.72);
  font-size: 7px;
  letter-spacing: 3px;
}

.home-shell .capability-rail {
  grid-column: 3;
  grid-row: 1;
  position: relative;
  z-index: 12;
  width: 100%;
  padding-left: 28px;
  border-left: 1px solid rgba(242, 243, 239, 0.13);
}

.home-shell .rail-heading {
  margin-bottom: 22px;
  color: var(--kx-muted);
  font: 700 8px/1 'Consolas', monospace;
  letter-spacing: 3px;
}

.home-shell .capability-rail a {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 4px 10px;
  padding: 16px 0;
  border-top: 1px solid rgba(242, 243, 239, 0.1);
  color: var(--text);
  text-decoration: none;
}

.home-shell .capability-rail a:hover strong,
.home-shell .capability-rail a:focus-visible strong {
  color: var(--kx-mint);
}

.home-shell .rail-no {
  grid-row: 1 / 3;
  color: var(--kx-orange);
  font: 700 8px/1.5 'Consolas', monospace;
}

.home-shell .capability-rail strong {
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 2px;
  transition: color 0.2s ease;
}

.home-shell .capability-rail small {
  color: var(--kx-muted);
  font-size: 9px;
  line-height: 1.5;
}

.home-shell .rail-status {
  margin-top: 24px;
  color: var(--kx-muted);
  font: 700 7px/1 'Consolas', monospace;
  letter-spacing: 2px;
}

.home-shell .rail-status i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--kx-mint);
  box-shadow: 0 0 10px rgba(120, 224, 189, 0.7);
}

.home-shell #front-menu::before {
  background: rgba(4, 6, 8, 0.9);
  backdrop-filter: blur(14px);
}

.home-shell .menu-panel {
  width: min(860px, calc(100vw - 80px));
  padding: 22px;
  border-color: rgba(105, 198, 255, 0.48);
  border-radius: 2px;
  background: var(--menu-bg);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.72);
}

.home-shell .menu-head {
  padding: 4px 2px 16px;
  margin-bottom: 12px;
}

.home-shell .menu-head-label {
  color: var(--kx-mint);
}

.home-shell .menu-head-dot {
  background: var(--kx-orange);
  box-shadow: 0 0 10px rgba(255, 136, 86, 0.72);
}

.home-shell .menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.home-shell .menu-btn {
  min-height: 62px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.025);
}

.home-shell .menu-btn:hover,
.home-shell .menu-btn:focus-visible {
  border-color: var(--kx-mint);
  background: rgba(120, 224, 189, 0.08);
  color: var(--text);
}

.home-shell .menu-btn:hover .mi,
.home-shell .menu-btn:focus-visible .mi,
.home-shell .menu-btn:hover .ma,
.home-shell .menu-btn:focus-visible .ma {
  color: var(--kx-mint);
}

.home-shell .hero:has(#front-menu.open) .hero-copy,
.home-shell .hero:has(#front-menu.open) > .hero-title,
.home-shell .hero:has(#front-menu.open) > .bf-main-section,
.home-shell .hero:has(#front-menu.open) > .capability-rail,
.home-shell .hero:has(#front-menu.open) > .cube-wrap {
  opacity: 0.12;
}

.home-shell #chat-widget {
  right: 28px;
  bottom: 28px;
  border-radius: 4px;
}

.home-shell #chat-widget.minimized {
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  border-color: rgba(255, 136, 86, 0.48);
  background: radial-gradient(circle at center, #050608 0 35%, #23313a 62%, var(--kx-orange) 100%);
}

.home-shell #chat-widget.maximized {
  border-radius: 4px;
}

.home-shell[data-theme="light"] {
  --bg: #f0f2ef;
  --text: #101416;
  --header-bg: rgba(240, 242, 239, 0.88);
  --card-bg: rgba(16, 20, 22, 0.035);
  --glass-border: rgba(16, 20, 22, 0.15);
  --menu-bg: #f7f8f5;
  --kx-muted: #5f686d;
}

.home-shell[data-theme="light"]::before {
  background-image:
    linear-gradient(rgba(16, 20, 22, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 20, 22, 0.045) 1px, transparent 1px);
}

.home-shell[data-theme="light"]::after {
  background: radial-gradient(circle at 55% 46%, transparent 0 20%, rgba(240, 242, 239, 0.18) 50%, rgba(240, 242, 239, 0.9) 100%);
}

.home-shell[data-theme="light"] .cube-face {
  filter: brightness(1.08) contrast(1.03) saturate(0.92);
}

.home-shell[data-theme="light"] #front-menu::before {
  background: rgba(225, 229, 226, 0.9);
}

/* The navigation hint under the cube.

   In light theme it was effectively unreadable: the brand cyan is pale
   against a pale page, the cube-glow blob sits directly behind the text, and
   hintPulse drops the whole element to 0.3 opacity twice per cycle. Darker
   ink and a much higher floor on the pulse; dark theme is untouched. */

.home-shell[data-theme="light"] .cube-hint {
  color: #0a3a5e;
  opacity: 0.92;
  animation: introFade 1s ease 1.5s backwards,
             hintPulseLight 2.6s ease-in-out 2.6s infinite;
}

@keyframes hintPulseLight {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

/* Keep the text above the glow it overlaps. */
.home-shell .cube-hint { z-index: 16; }

/* That glow is a blurred blue bar. On a dark page it reads as light bleeding
   from under the cube; on a pale one it reads as a grey smudge sitting behind
   the hint. Thin it down in light theme so the text has a clean backdrop. */
.home-shell[data-theme="light"] .cube-glow {
  background: rgba(105, 198, 255, 0.10);
}

@media (max-width: 1180px) {
  .home-shell .hero {
    grid-template-columns: minmax(360px, 1fr) minmax(330px, 0.86fr);
    gap: 5vw;
    padding-right: 8vw;
    padding-left: 8vw;
  }

  .home-shell .capability-rail {
    display: none;
  }

  .home-shell .hero-wordmark {
    font-size: 82px;
  }
}

@media (max-width: 760px) {
  .home-shell header {
    height: 58px;
    padding: 0 16px;
  }

  .home-shell .nav-logo {
    font-size: 17px;
    letter-spacing: 3px;
  }

  .home-shell .status-description,
  .home-shell .gh-text {
    display: none;
  }

  .home-shell .gh-link {
    width: 30px;
    min-height: 30px;
    justify-content: center;
    padding: 0;
  }

  .home-shell .hero {
    display: block;
    min-height: 100dvh;
    padding: 86px 20px 24px;
  }

  .home-shell .hero-copy {
    max-width: 340px;
    transform: none;
  }

  .home-shell .hero-kicker {
    margin-bottom: 12px;
    font-size: 7px;
    letter-spacing: 2px;
  }

  .home-shell .hero-wordmark {
    font-size: 58px;
  }

  .home-shell .hero-deck {
    max-width: 315px;
    margin-top: 16px;
    font-size: 11px;
    line-height: 1.55;
  }

  .home-shell .hero-title {
    position: absolute;
    top: 228px;
    left: 20px;
    margin: 0;
    font-size: 8px;
    letter-spacing: 3px;
  }

  .home-shell .cube-wrap {
    position: absolute;
    top: 49%;
    left: 50%;
    margin: 0;
    transform: translate(-50%, -50%);
  }

  .home-shell #cube-viewport,
  .home-shell .cube-face {
    width: 150px;
    height: 150px;
  }

  .home-shell .face-front { transform: translateZ(75px); }
  .home-shell .face-back { transform: rotateY(180deg) translateZ(75px); }
  .home-shell .face-right { transform: rotateY(90deg) translateZ(75px); }
  .home-shell .face-left { transform: rotateY(-90deg) translateZ(75px); }
  .home-shell .face-top { transform: rotateX(90deg) translateZ(75px); }
  .home-shell .face-bottom { transform: rotateX(-90deg) translateZ(75px); }

  .home-shell .cube-wrap::before {
    top: -64px;
    left: -20px;
    width: 190px;
  }

  .home-shell .cube-wrap::after {
    bottom: -72px;
  }

  .home-shell .cube-glow {
    width: 200px;
    bottom: -58px;
  }

  .home-shell .cube-hint {
    bottom: -48px;
  }

  .home-shell .bf-main-section {
    position: absolute;
    right: auto;
    bottom: 28px;
    left: 20px;
    margin: 0;
  }

  .home-shell .menu-panel {
    width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);
    padding: 14px;
  }

  .home-shell .menu-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .home-shell .menu-btn {
    min-height: 42px;
    padding: 8px 10px;
  }

  .home-shell #chat-widget {
    right: 16px;
    bottom: 18px;
  }

  .home-shell #chat-widget.minimized {
    width: 44px !important;
    height: 44px !important;
  }
}

@media (max-height: 650px) and (max-width: 760px) {
  .home-shell .hero {
    padding-top: 72px;
  }

  .home-shell .hero-deck {
    display: none;
  }

  .home-shell .hero-title {
    top: 184px;
  }

  .home-shell .cube-wrap {
    top: 51%;
    transform: translate(-50%, -50%) scale(0.82);
  }

  .home-shell .bf-main-section {
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-shell .cube-wrap,
  .home-shell .hero-copy,
  .home-shell .hero-title,
  .home-shell .bf-main-section {
    animation: none !important;
  }
}
