:root {
  color-scheme: dark;
  background-color: #05070d;
}

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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: #05070d;
  color: #eaf7ff;
  font-family: 'IBM Plex Mono', monospace;
}

body.page-home {
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}

body.page-home input,
body.page-home textarea,
body.page-home select,
body.page-home button,
body.page-home [role='button'] {
  user-select: text;
  -webkit-user-select: text;
}

.page-wrapper {
  position: relative;
  display: grid;
  gap: clamp(2rem, 3vw, 3.5rem);
  padding: clamp(2.4rem, 5vw, 3.8rem) clamp(1.4rem, 4vw, 2.6rem)
    clamp(6rem, 12vw, 7.5rem);
}

.site-footer {
  position: relative;
  z-index: 5;
  margin: clamp(3rem, 8vw, 4.5rem) auto 4px;
  padding: 1.4rem clamp(1.4rem, 4vw, 2.6rem);
  text-align: center;
  color: rgba(220, 244, 255, 0.8);
  backdrop-filter: blur(14px);
  background: linear-gradient(200deg, rgba(5, 10, 18, 0.9), rgba(4, 8, 16, 0.82));
  border: 1px solid rgba(90, 200, 255, 0.22);
  border-radius: 1.1rem;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
  width: min(100%, 42rem);
}

.site-footer p {
  margin: 0;
}

@media (min-width: 961px) {
  .page-wrapper {
    padding-bottom: calc(clamp(6rem, 12vw, 7.5rem) + 5rem);
  }

  .site-footer {
    position: fixed;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    margin: 0 0 4px;
    width: min(100%, 42rem);
  }
}

.cortex-hud {
  z-index: 4;
  position: relative;
  margin: 0 auto clamp(1.6rem, 6vw, 2.4rem);
  padding: clamp(1.4rem, 4vw, 1.85rem);
  width: min(100%, 42rem);
  border-radius: 1.5rem;
  background: linear-gradient(200deg, rgba(6, 14, 28, 0.9), rgba(4, 10, 20, 0.82));
  border: 1px solid rgba(102, 204, 255, 0.25);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.cortex-hud__badge {
  display: inline-block;
  margin-bottom: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(0, 187, 255, 0.14);
  color: #9cf6ff;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cortex-hud__title {
  margin: 0;
  font-size: 1.35rem;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.cortex-hud__subtitle {
  margin: 0.65rem auto 0;
  max-width: 32rem;
  color: rgba(198, 236, 255, 0.86);
  line-height: 1.5;
}

.cortex-hud__readouts {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: rgba(173, 236, 255, 0.9);
}

.cortex-hud__value {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.1rem;
  color: #fff;
}

.cortex-log {
  position: relative;
  margin: 0 auto clamp(2rem, 6vw, 3rem);
  padding: clamp(1.6rem, 5vw, 2.2rem);
  width: min(100%, 46rem);
  border-radius: 1.6rem;
  background: linear-gradient(210deg, rgba(8, 16, 30, 0.88), rgba(6, 12, 24, 0.82));
  border: 1px solid rgba(90, 200, 255, 0.2);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.cortex-log h1 {
  margin: 0 0 1rem;
  font-size: 1.9rem;
  color: #fff;
  letter-spacing: 0.04em;
}

.cortex-log__body {
  max-height: 12rem;
  overflow: hidden;
  color: rgba(211, 244, 255, 0.88);
  line-height: 1.6;
}

.cortex-log__toggle {
  margin-top: 1.2rem;
  display: none;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(120, 220, 255, 0.38);
  background: rgba(4, 12, 24, 0.75);
  color: #e7f9ff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}


.cortex-log__cta {
  margin-top: 1.5rem;
  color: rgba(132, 220, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
}

@media (max-width: 1400px) {
  body.page-home .cortex-log {
    inset: auto;
    max-width: min(100%, 34rem);
    margin: clamp(1rem, 6vw, 1.6rem) auto;
    padding: clamp(1rem, 6vw, 1.45rem) clamp(1.05rem, 6vw, 1.6rem);
    border-radius: clamp(0.85rem, 4vw, 1.2rem);
    background: linear-gradient(210deg, rgba(10, 16, 28, 0.95), rgba(3, 10, 20, 0.85));
    border: 1px solid rgba(102, 204, 255, 0.24);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  }

  .cortex-log:not(:first-of-type) {
    margin-top: clamp(1rem, 6vw, 1.8rem);
  }

  .cortex-log:first-of-type {
    margin-top: 0;
  }

  body.page-home .cortex-log h1 {
    font-size: clamp(1.2rem, 6vw, 1.55rem);
  }

  body.page-home .cortex-log p {
    font-size: clamp(0.92rem, 4vw, 1.02rem);
  }

  body.page-home .cortex-log__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: clamp(0.55rem, 4vw, 0.75rem) clamp(0.85rem, 6vw, 1.3rem);
    border-radius: 999px;
    border: 1px solid rgba(102, 204, 255, 0.35);
    background: rgba(6, 16, 28, 0.85);
    color: rgba(214, 244, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: clamp(0.78rem, 3.4vw, 0.9rem);
    font-weight: 600;
  }

  body.page-home .cortex-log__toggle:focus-visible,
  body.page-home .cortex-log__toggle:hover {
    outline: none;
    background: rgba(12, 26, 40, 0.95);
    border-color: rgba(160, 236, 255, 0.55);
    box-shadow: 0 0 0 2px rgba(0, 255, 204, 0.15);
  }

  body.page-home [data-cortex-log-state="collapsed"] .cortex-log__body,
  body.page-home [data-cortex-log-state="collapsed"] .cortex-log__cta {
    display: none;
  }

  body.page-home [data-cortex-log-state="collapsed"] .cortex-log__body {
    max-height: clamp(6.2rem, 28vw, 8rem);
    overflow: hidden;
    position: relative;
  }

  body.page-home [data-cortex-log-state="collapsed"] .cortex-log__body::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: clamp(2rem, 12vw, 3rem);
    background: linear-gradient(0deg, rgba(10, 16, 28, 0.96), rgba(10, 16, 28, 0));
  }

  body.page-home [data-cortex-log-state="expanded"] .cortex-log__body {
    max-height: none;
  }

  body.page-home [data-cortex-log-state="expanded"] .cortex-log__body::after {
    display: none;
  }
}


.cortex-sidepanel {
  position: sticky;
  top: clamp(2rem, 4vw, 3rem);
  margin: 0 auto clamp(2rem, 5vw, 3rem);
  padding: clamp(0.9rem, 3vw, 1.2rem);
  width: min(100%, 20rem);
  border-radius: 1.3rem;
  background: linear-gradient(200deg, rgba(6, 10, 20, 0.92), rgba(4, 10, 18, 0.9));
  border: 1px solid rgba(70, 160, 255, 0.22);
  box-shadow: 0 26px 50px rgba(0, 0, 0, 0.45);
}

.cortex-sidepanel h2 {
  margin: 0 0 0.6rem;
  color: #f0fbff;
  font-size: 1.05rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cortex-sidepanel ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(0.7rem, 2.2vw, 1rem);
  row-gap: clamp(0.35rem, 1.1vw, 0.5rem);
}

@media (max-width: 720px) {
  .cortex-sidepanel ul {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: clamp(0.6rem, 2vw, 0.75rem);
  }
}

.cortex-sidepanel a {
  color: rgba(156, 224, 255, 0.9);
  text-decoration: none;
  font-size: 0.9rem;
}

.intro-message {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: min(32rem, 80%);
  margin: clamp(1.4rem, 6vw, 2.2rem) auto 0;
  color: rgba(220, 244, 255, 0.9);
}

.intro-message__lead {
  display: block;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e9faff;
}

.intro-message__extended {
  display: block;
  margin-top: 0.4rem;
  color: rgba(182, 236, 255, 0.82);
}

.mobile-node-directory {
  display: none;
}

@media (max-width: 1400px) {
  body.page-home .mobile-node-directory {
    display: block;
    width: min(100%, 34rem);
    margin: clamp(0.75rem, 5vw, 1.4rem) auto;
    padding: clamp(0.35rem, 2vw, 0.6rem);
    position: relative;
    z-index: 7;
    border-radius: clamp(0.85rem, 3.6vw, 1.2rem);
    background: linear-gradient(200deg, rgba(10, 16, 28, 0.92), rgba(4, 12, 20, 0.85));
    border: 1px solid rgba(102, 204, 255, 0.22);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  }

  body.page-home .mobile-node-directory {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: clamp(0.85rem, 5vw, 1.75rem);
    margin: 0;
    width: min(92vw, 34rem);
    z-index: 24;
  }

  body.page-home main {
    padding-top: 0;
  }

  body.page-home .page-wrapper > .cortex-log:first-of-type {
    margin-top: 0;
  }

  @supports (bottom: max(0px, 0px)) {
    body.page-home .mobile-node-directory {
      bottom: max(env(safe-area-inset-bottom, 0px), clamp(0.85rem, 5vw, 1.75rem));
    }
  }

  body.page-home .mobile-node-directory__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(0.6rem, 3vw, 0.9rem);
    padding: clamp(0.75rem, 4.8vw, 1rem) clamp(0.85rem, 6vw, 1.2rem);
    border: 1px solid rgba(102, 204, 255, 0.35);
    border-radius: clamp(0.75rem, 3.4vw, 1.05rem);
    background: rgba(6, 12, 22, 0.75);
    color: rgba(212, 242, 255, 0.92);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: clamp(0.8rem, 3.8vw, 0.92rem);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  }

  body.page-home .mobile-node-directory__toggle::before {
    content: "";
    width: clamp(1rem, 4vw, 1.35rem);
    height: clamp(0.75rem, 3vw, 1rem);
    flex: 0 0 auto;
    border-radius: 0.25rem;
    background:
      linear-gradient(
        to bottom,
        rgba(212, 242, 255, 0.95) 0%,
        rgba(212, 242, 255, 0.95) 20%,
        transparent 20%,
        transparent 40%,
        rgba(212, 242, 255, 0.95) 40%,
        rgba(212, 242, 255, 0.95) 60%,
        transparent 60%,
        transparent 80%,
        rgba(212, 242, 255, 0.95) 80%,
        rgba(212, 242, 255, 0.95) 100%
      );
  }

  body.page-home .mobile-node-directory__toggle:focus-visible,
  body.page-home .mobile-node-directory__toggle:hover {
    outline: none;
    background: rgba(12, 24, 38, 0.85);
    border-color: rgba(160, 236, 255, 0.55);
    box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.12);
  }

  body.page-home .mobile-node-directory__label {
    flex: 1 1 auto;
    text-align: left;
  }

  body.page-home .mobile-node-directory__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 3vw, 1.2rem);
    transition: transform 0.25s ease;
  }

  body.page-home [data-node-directory-open="true"] .mobile-node-directory__chevron {
    transform: rotate(180deg);
  }

  body.page-home [data-node-directory-open="true"] .mobile-node-directory__toggle {
    border-color: rgba(0, 255, 204, 0.45);
    color: #ffffff;
  }

  body.page-home .mobile-node-directory__panel {
    margin-top: clamp(0.35rem, 2vw, 0.6rem);
    padding: clamp(0.45rem, 3vw, 0.75rem) clamp(0.55rem, 5vw, 1rem) clamp(0.65rem, 4.5vw, 1.05rem);
    border-radius: clamp(0.7rem, 3vw, 1rem);
    background: rgba(4, 10, 18, 0.9);
    border: 1px solid rgba(102, 204, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
    max-height: min(60vh, 28rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body.page-home .mobile-node-directory__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + clamp(0.4rem, 2.5vw, 0.7rem));
    margin: 0;
    width: 100%;
    box-shadow:
      0 18px 42px rgba(0, 0, 0, 0.45),
      inset 0 0 0 1px rgba(0, 0, 0, 0.35);
    max-height: min(70vh, 32rem);
  }

  body.page-home .mobile-node-directory__panel[hidden] {
    display: none;
  }

  body.page-home .mobile-node-directory__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(0.55rem, 4vw, 0.85rem);
  }

  body.page-home .mobile-node-directory__link {
    width: 100%;
    min-height: clamp(3.3rem, 10vw, 4.05rem);
    padding: clamp(1rem, 4.4vw, 1.25rem) clamp(1.1rem, 5.4vw, 1.5rem);
    border-radius: clamp(0.75rem, 3.4vw, 1.05rem);
    border: 1px solid rgba(102, 204, 255, 0.28);
    background: rgba(9, 16, 28, 0.85);
    color: rgba(221, 243, 255, 0.92);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: clamp(0.78rem, 2.8vw, 0.92rem);
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  }

  body.page-home .mobile-node-directory__link:focus-visible,
  body.page-home .mobile-node-directory__link:hover {
    outline: none;
    background: rgba(14, 26, 40, 0.95);
    border-color: rgba(160, 236, 255, 0.55);
    transform: translateY(-1px);
  }
}

#cortex {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: transparent;
  pointer-events: auto;
  transform-origin: top left;
}

body.page-home #cortex {
  pointer-events: none;
}

body.page-home #cortex.cortex--interactive:not(.canvas--suspended) {
  pointer-events: auto;
  touch-action: none;
}

body.page-home
  #cortex.cortex--interactive.canvas--captures-touch:not(.canvas--suspended) {
  touch-action: none;
}

body.page-home
  #cortex.cortex--interactive.canvas--captures-touch.canvas--touch-lock:not(
    .canvas--suspended
  ) {
  touch-action: none;
}

@media (max-width: 960px) {
  .page-wrapper {
    padding-top: clamp(1.4rem, 8vw, 2.4rem);
    padding-bottom: clamp(3rem, 12vw, 4.4rem);
  }

  .site-footer {
    position: static;
    margin-top: clamp(2.5rem, 9vw, 4rem);
    width: min(100%, 38rem);
  }

  .cortex-sidepanel {
    order: 3;
    position: static;
    top: auto;
  }
}

@media (max-width: 768px) {
  .cortex-hud {
    display: none;
  }

  .intro-message__extended {
    display: none;
  }

}
