:root {
  --black: #02070b;
  --deep: #050c12;
  --panel: #0a151f;
  --panel-2: #101f2c;
  --panel-3: #162a39;
  --line: #344c5d;
  --line-light: #6f8798;
  --white: #eef7fd;
  --silver: #b8cad7;
  --muted: #91a6b5;
  --blue: #66ccff;
  --amber: #ffc25f;
  --amber-soft: #ffe1a6;
  --green: #72ffad;
  --font-ui: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-mono: "Courier New", Courier, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--black);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 50% -12rem, rgba(84, 172, 225, 0.18), transparent 42rem),
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px),
    #02070b;
  background-size: auto, 28px 28px, 28px 28px, auto;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

.scanlines,
.screen-grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.scanlines {
  opacity: 0.075;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(255,255,255,0.28) 4px
  );
}

.screen-grain {
  opacity: 0.025;
  background-image: repeating-radial-gradient(
    circle at 0 0,
    transparent 0,
    rgba(255,255,255,0.95) 1px,
    transparent 2px
  );
  background-size: 4px 4px;
  animation: grain 0.24s steps(2) infinite;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: #010407;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.boot-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.boot-terminal {
  width: min(48rem, 100%);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border: 1px solid #2e566f;
  outline: 4px solid #061018;
  box-shadow:
    0 0 0 5px #183044,
    0 0 50px rgba(102, 204, 255, 0.12);
  color: var(--green);
  background: #02080d;
  font: clamp(0.78rem, 2vw, 1rem)/1.5 var(--font-mono);
}

.boot-brand {
  margin: 0 0 1.5rem;
  color: var(--white);
}

.boot-line {
  margin: 0.45rem 0;
  opacity: 0;
  animation: show-line 0.05s linear forwards;
}

.boot-1 { animation-delay: 0.14s; }
.boot-2 { animation-delay: 0.34s; }
.boot-3 { animation-delay: 0.56s; }
.boot-4 { animation-delay: 0.80s; }

.boot-skip {
  margin: 1.7rem 0 0;
  color: #5f7889;
  font-size: 0.68em;
  letter-spacing: 0.08em;
}

.console {
  width: min(1420px, calc(100% - 26px));
  margin: 16px auto;
  overflow: hidden;
  border: 1px solid #536f82;
  outline: 5px solid #050a0f;
  box-shadow:
    0 0 0 6px #1c3040,
    0 0 0 7px #020609,
    0 24px 90px rgba(0,0,0,0.75);
  background: linear-gradient(180deg, rgba(11,24,35,0.99), rgba(4,10,15,0.99));
}

.topbar,
.footer {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.62rem 1rem;
  color: #bed0dc;
  border-bottom: 1px solid #496477;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), transparent 42%),
    linear-gradient(180deg, #1a2d3b, #0a141d);
  box-shadow: inset 0 -1px 0 #020609;
  font: 0.74rem/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-title,
.topbar-status {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.diamond {
  color: var(--amber);
  filter: drop-shadow(0 0 6px rgba(255,194,95,0.9));
}

.online-light,
.module-light {
  display: inline-block;
  border-radius: 50%;
}

.online-light {
  width: 8px;
  height: 8px;
  background: var(--green);
  box-shadow:
    0 0 0 2px #08110d,
    0 0 8px rgba(114,255,173,0.9);
  animation: pulse 1.8s ease-in-out infinite;
}

.sfx-button {
  min-height: 28px;
  padding: 0 0.65rem;
  border: 1px solid #415d70;
  border-top-color: #7b94a6;
  border-left-color: #7b94a6;
  color: #adc0cd;
  background: linear-gradient(#1d303d, #091218);
  box-shadow: inset -1px -1px 0 #02070b;
  font: inherit;
  cursor: pointer;
}

.sfx-button:hover,
.sfx-button:focus-visible,
.sfx-button[aria-pressed="true"] {
  color: var(--amber-soft);
  border-color: var(--amber);
  outline: none;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: 480px;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem 2.4rem;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px),
    radial-gradient(circle at 50% 38%, rgba(72,165,222,0.17), transparent 20rem),
    linear-gradient(180deg, #07121b, #040a0f);
  background-size: 24px 24px, 24px 24px, auto, auto;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  left: 12%;
  z-index: -1;
  width: 76%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(111,177,218,0.58), transparent);
}

.hero::before { top: 22%; }
.hero::after { bottom: 18%; }

.corner {
  position: absolute;
  width: 54px;
  height: 54px;
  opacity: 0.85;
}

.top-left {
  top: 22px;
  left: 22px;
  border-top: 2px solid #7893a6;
  border-left: 2px solid #7893a6;
}

.top-right {
  top: 22px;
  right: 22px;
  border-top: 2px solid #7893a6;
  border-right: 2px solid #7893a6;
}

.bottom-left {
  left: 22px;
  bottom: 22px;
  border-left: 2px solid #7893a6;
  border-bottom: 2px solid #7893a6;
}

.bottom-right {
  right: 22px;
  bottom: 22px;
  border-right: 2px solid #7893a6;
  border-bottom: 2px solid #7893a6;
}

.radar {
  position: absolute;
  top: 35%;
  left: 50%;
  z-index: -1;
  width: min(430px, 72vw);
  aspect-ratio: 1;
  border: 1px solid rgba(107,174,216,0.18);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  mask-image: linear-gradient(to bottom, #000 0 68%, transparent 96%);
}

.radar-circle {
  position: absolute;
  border: 1px solid rgba(107,174,216,0.16);
  border-radius: 50%;
}

.circle-1 { inset: 14%; }
.circle-2 { inset: 29%; }
.circle-3 { inset: 44%; }

.radar-axis {
  position: absolute;
  background: rgba(107,174,216,0.14);
}

.axis-x {
  top: 50%;
  left: -8%;
  width: 116%;
  height: 1px;
}

.axis-y {
  top: -8%;
  left: 50%;
  width: 1px;
  height: 116%;
}

.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 318deg,
    rgba(102,204,255,0.15) 344deg,
    transparent 360deg
  );
  animation: radar-spin 13s linear infinite;
}

.brand-lockup {
  display: grid;
  justify-items: center;
  text-align: center;
}

.panda-head {
  width: min(250px, 58vw);
  max-height: 250px;
  object-fit: contain;
  filter:
    drop-shadow(0 16px 22px rgba(0,0,0,0.72))
    drop-shadow(0 0 18px rgba(99,191,246,0.17));
  transition: transform 180ms ease, filter 180ms ease;
}

.panda-head:hover {
  transform: translateY(-2px) scale(1.012);
  filter:
    drop-shadow(0 17px 24px rgba(0,0,0,0.76))
    drop-shadow(0 0 25px rgba(255,194,95,0.22));
}

.wordmark {
  display: grid;
  justify-items: center;
  margin-top: 0.15rem;
  text-transform: uppercase;
}

.wordmark-main {
  color: #f1f6fa;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 0.84;
  letter-spacing: 0.06em;
  background: linear-gradient(
    to bottom,
    #ffffff 0%,
    #dce8ef 34%,
    #8197a7 50%,
    #d5e0e7 68%,
    #657b8c 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow:
    0 2px 0 rgba(255,255,255,0.16),
    0 4px 0 #0a131a,
    0 8px 16px rgba(0,0,0,0.62);
}

.wordmark-sub {
  margin-top: 0.42rem;
  color: #b8c7d1;
  font: 0.98rem/1 var(--font-ui);
  letter-spacing: 0.58em;
  padding-left: 0.58em;
  text-shadow: 0 2px 5px #000;
}

.hero-eyebrow {
  margin: 1.35rem 0 0;
  color: var(--amber);
  font: 700 0.73rem/1.2 var(--font-mono);
  letter-spacing: 0.2em;
  text-shadow: 0 0 10px rgba(255,194,95,0.2);
}

.hero-heading {
  margin-top: 1.15rem;
}

.hero-heading h1 {
  margin: 0;
  color: var(--white);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(2.3rem, 6vw, 4.2rem);
  font-weight: 400;
  letter-spacing: 0.075em;
  line-height: 1;
  text-shadow:
    0 2px 0 #1c3343,
    0 4px 0 #04080b,
    0 0 22px rgba(102,204,255,0.14);
}

.hero-heading p {
  margin: 0.8rem auto 0;
  color: #a6bac8;
  font-size: clamp(0.9rem, 1.8vw, 1rem);
}

.hero-readout {
  position: absolute;
  right: 30px;
  bottom: 28px;
  display: grid;
  gap: 0.33rem;
  color: #8099aa;
  font: 0.66rem/1.15 var(--font-mono);
  letter-spacing: 0.08em;
  text-align: right;
}

.directory {
  padding: 1.05rem;
  background:
    linear-gradient(90deg, transparent, rgba(102,169,209,0.045), transparent),
    #071018;
}

.directory-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #2d4556;
  color: #c9d8e2;
  background: linear-gradient(#152736, #09141d);
  font: 700 0.73rem/1 var(--font-mono);
  letter-spacing: 0.12em;
}

.directory-code {
  color: #7891a2;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.system-card {
  position: relative;
  min-height: 154px;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.35rem 0.85rem;
  padding: 0.9rem;
  overflow: hidden;
  color: var(--white);
  text-decoration: none;
  border: 1px solid #4e6b7e;
  border-top-color: #758fa0;
  border-left-color: #758fa0;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.055), transparent 31%),
    linear-gradient(180deg, #142635, #08121a 64%, #050c12);
  box-shadow:
    inset -2px -2px 0 #02070b,
    inset 2px 2px 0 rgba(255,255,255,0.035),
    0 6px 17px rgba(0,0,0,0.26);
  transition: transform 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
}

.system-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(102,204,255,0.085), transparent);
  transform: translateX(-115%);
  transition: transform 390ms ease;
}

.system-card:hover,
.system-card:focus-visible {
  z-index: 2;
  transform: translateY(-2px);
  border-color: var(--amber);
  outline: none;
  box-shadow:
    inset -2px -2px 0 #02070b,
    inset 2px 2px 0 rgba(255,255,255,0.05),
    0 0 0 1px rgba(255,194,95,0.18),
    0 10px 24px rgba(0,0,0,0.42),
    0 0 22px rgba(255,194,95,0.07);
}

.system-card:hover::before,
.system-card:focus-visible::before {
  transform: translateX(115%);
}

.system-card:active {
  transform: translateY(1px);
}

.module-number {
  grid-row: 1 / -1;
  display: grid;
  place-items: start center;
  align-self: stretch;
  padding-top: 0.08rem;
  color: #8299a8;
  border-right: 1px solid #314957;
  font: 700 1rem/1 var(--font-mono);
}

.module-light {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 7px;
  height: 7px;
  background: #405d4b;
  box-shadow: 0 0 0 2px #07100a;
  transition: background 130ms ease, box-shadow 130ms ease;
}

.system-card:hover .module-light,
.system-card:focus-visible .module-light {
  background: var(--amber);
  box-shadow:
    0 0 0 2px #130d05,
    0 0 10px rgba(255,194,95,0.9);
}

.module-type {
  color: var(--amber);
  font: 700 0.62rem/1.2 var(--font-mono);
  letter-spacing: 0.095em;
}

.system-card strong {
  color: #f1f8fc;
  font-size: clamp(1.18rem, 2.2vw, 1.72rem);
  line-height: 1.05;
  letter-spacing: 0.045em;
  text-shadow: 0 2px 0 #03070a;
}

.module-description {
  max-width: 30rem;
  color: #a2b6c4;
  font-size: 0.82rem;
  line-height: 1.42;
}

.launch-label {
  align-self: end;
  color: #839cac;
  font: 700 0.64rem/1 var(--font-mono);
  letter-spacing: 0.08em;
  transition: color 130ms ease;
}

.system-card:hover .launch-label,
.system-card:focus-visible .launch-label {
  color: var(--amber-soft);
}

.status-terminal {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.68rem 1rem;
  color: var(--green);
  border-top: 1px solid #314b5a;
  border-bottom: 1px solid #314b5a;
  background: #030a0f;
  font: 0.74rem/1.3 var(--font-mono);
  letter-spacing: 0.05em;
}

.terminal-prompt {
  color: var(--amber);
}

.cursor {
  animation: blink 0.9s steps(1) infinite;
}

.footer {
  min-height: 36px;
  color: #718999;
  border-bottom: 0;
  font-size: 0.62rem;
}

@keyframes show-line {
  to { opacity: 1; }
}

@keyframes blink {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.72; }
  50% { opacity: 1; }
}

@keyframes radar-spin {
  to { transform: rotate(360deg); }
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1px, 1px); }
  50% { transform: translate(1px, -1px); }
  75% { transform: translate(1px, 1px); }
}

@media (max-width: 1080px) {
  .system-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .console {
    width: min(100% - 18px, 1420px);
    margin: 10px auto;
    outline-width: 3px;
  }

  .hero {
    min-height: 445px;
    padding-inline: 1rem;
  }

  .panda-head {
    width: min(220px, 58vw);
  }

  .hero-readout {
    display: none;
  }

  .directory {
    padding: 0.8rem;
  }

  .system-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .topbar {
    font-size: 0.61rem;
  }

  .topbar-title {
    max-width: 13rem;
  }

  .topbar-status > span:nth-child(2) {
    display: none;
  }

  .sfx-button {
    min-height: 26px;
    padding-inline: 0.45rem;
  }

  .hero {
    min-height: 420px;
  }

  .corner {
    width: 38px;
    height: 38px;
  }

  .wordmark-sub {
    font-size: 0.72rem;
    letter-spacing: 0.44em;
    padding-left: 0.44em;
  }

  .hero-eyebrow {
    max-width: 18rem;
    line-height: 1.5;
  }

  .directory-code {
    display: none;
  }

  .system-card {
    min-height: 148px;
    grid-template-columns: 36px 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .boot-screen {
    display: none;
  }
}
