:root {
  color-scheme: dark;
  --bg: #06080d;
  --panel: rgba(12, 18, 27, 0.72);
  --panel-strong: rgba(17, 28, 40, 0.88);
  --line: rgba(183, 214, 255, 0.16);
  --line-strong: rgba(77, 232, 245, 0.42);
  --text: #eef6ff;
  --muted: #94a8bb;
  --cyan: #46eaf7;
  --mint: #8ff3bd;
  --amber: #f6c765;
  --pink: #ff7aa8;
  --ink: #061016;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(6, 8, 13, 0.36), var(--bg) 62%),
    linear-gradient(135deg, rgba(70, 234, 247, 0.13), transparent 34%),
    linear-gradient(235deg, rgba(246, 199, 101, 0.09), transparent 31%),
    #06080d;
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, black, transparent 78%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, transparent, rgba(70, 234, 247, 0.08), transparent),
    repeating-linear-gradient(180deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 7px);
  opacity: 0.48;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  border-radius: 0;
}

#signal-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  opacity: 0.78;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(6, 8, 13, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(135deg, rgba(70, 234, 247, 0.2), rgba(143, 243, 189, 0.08)),
    rgba(255, 255, 255, 0.03);
  color: var(--cyan);
  font-weight: 900;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy small,
.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav a,
.mode-button,
.secondary-action,
.primary-action,
.login-actions button,
.login-actions a,
.session button,
.card-link {
  min-height: 40px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  cursor: pointer;
}

.nav a:hover,
.secondary-action:hover,
.mode-button:hover,
.card-link:hover {
  border-color: var(--line-strong);
  color: var(--cyan);
}

.mode-button.active,
.primary-action,
.login-actions button {
  border-color: rgba(70, 234, 247, 0.78);
  background: var(--cyan);
  color: var(--ink);
  font-weight: 900;
}

main {
  overflow: hidden;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: clamp(28px, 6vw, 82px);
  align-items: center;
  min-height: calc(100vh - 77px);
  padding: clamp(48px, 7vw, 104px) clamp(18px, 6vw, 86px) 64px;
}

.hero-copy {
  max-width: 900px;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 920px;
  margin-bottom: 22px;
  font-size: clamp(2.55rem, 6.7vw, 7.1rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 3.1rem);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  letter-spacing: 0;
}

.hero-text {
  max-width: 680px;
  margin-bottom: 18px;
  color: #d5e6f6;
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.75;
}

.hero-claims {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 30px;
}

.hero-claims span {
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.045);
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 146px;
}

.control-deck {
  position: relative;
  display: grid;
  gap: 18px;
  min-height: 420px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(145deg, rgba(14, 23, 34, 0.94), rgba(8, 12, 19, 0.58)),
    rgba(255, 255, 255, 0.03);
  padding: 20px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.control-deck::before {
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  content: "";
}

.deck-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
}

.deck-head strong {
  color: var(--text);
}

.race-core {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
  align-self: end;
  min-height: 122px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    linear-gradient(90deg, rgba(70, 234, 247, 0.16), rgba(143, 243, 189, 0.05)),
    rgba(0, 0, 0, 0.2);
  padding: 16px;
}

.core-badge {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: rgba(70, 234, 247, 0.12);
  color: var(--cyan);
  font-size: 1.5rem;
  font-weight: 900;
}

.race-core strong {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.race-core small {
  color: var(--muted);
  line-height: 1.6;
}

.loop-map {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.loop-map span,
.decision-bar span {
  display: grid;
  min-height: 52px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.045);
  color: #d9e8f6;
  font-weight: 800;
}

.loop-map span:nth-child(1),
.loop-map span:nth-child(2),
.loop-map span:nth-child(3) {
  color: var(--amber);
}

.loop-map span:nth-child(4),
.loop-map span:nth-child(5) {
  color: var(--cyan);
}

.loop-map span:nth-child(6) {
  color: var(--mint);
}

.decision-bar {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.decision-bar span {
  min-height: 42px;
  color: var(--muted);
  font-size: 0.88rem;
}

.decision-bar span:nth-child(1) {
  color: var(--mint);
}

.decision-bar span:nth-child(3) {
  color: var(--pink);
}

.decision-bar span:nth-child(4) {
  color: var(--amber);
}

.pipeline-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-self: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}

.pipeline-strip span {
  display: grid;
  min-height: 74px;
  place-items: center;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--cyan);
  font-weight: 900;
}

.pipeline-strip span:last-child {
  border-right: 0;
  color: var(--amber);
}

.signal-stack {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  align-self: end;
}

.signal-stack i {
  display: block;
  height: 10px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  opacity: 0.72;
}

.signal-stack i:nth-child(2) {
  width: 78%;
  background: linear-gradient(90deg, var(--mint), transparent);
}

.signal-stack i:nth-child(3) {
  width: 56%;
  background: linear-gradient(90deg, var(--amber), transparent);
}

.signal-stack i:nth-child(4) {
  width: 88%;
  background: linear-gradient(90deg, var(--pink), transparent);
}

.pipeline,
.products,
.developer {
  padding: 70px clamp(18px, 6vw, 86px);
}

.section-head {
  max-width: 980px;
  margin-bottom: 24px;
}

.section-head.compact {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-head.split {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  max-width: none;
}

.flow-grid,
.product-grid,
.dev-grid {
  display: grid;
  gap: 14px;
}

.flow-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.flow-grid article,
.product-card,
.dev-card,
.login-panel,
.member-admin {
  border: 1px solid var(--line);
  background: var(--panel);
}

.flow-grid article {
  display: grid;
  min-height: 124px;
  padding: 18px;
  align-content: space-between;
}

.flow-grid span {
  color: var(--amber);
  font-weight: 900;
}

.flow-grid small {
  color: var(--muted);
  line-height: 1.4;
}

.product-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.product-card {
  position: relative;
  display: grid;
  min-height: 142px;
  padding: 18px;
  overflow: hidden;
}

.product-card::after {
  position: absolute;
  right: 14px;
  bottom: 8px;
  color: rgba(255, 255, 255, 0.07);
  content: attr(data-index);
  font-size: 3.8rem;
  font-weight: 900;
}

.product-card.available {
  border-color: rgba(70, 234, 247, 0.5);
  background: linear-gradient(145deg, rgba(17, 37, 48, 0.84), rgba(12, 18, 27, 0.72));
}

.product-card.planned {
  opacity: 0.82;
}

.product-card h3 {
  position: relative;
  z-index: 1;
  align-self: start;
}

.product-card .card-link {
  position: relative;
  z-index: 1;
  align-self: end;
  justify-self: start;
  color: var(--cyan);
  font-weight: 800;
}

.product-card.planned .card-link {
  color: var(--muted);
  cursor: default;
}

.developer {
  border-top: 1px solid var(--line);
  background: rgba(5, 8, 13, 0.58);
}

.session {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.login-panel {
  display: grid;
  grid-template-columns: 1fr minmax(190px, 260px) minmax(190px, 240px) auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
}

.login-copy p,
.form-message,
.dev-card p,
.module-list li {
  color: var(--muted);
  line-height: 1.65;
}

.login-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.login-panel input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.login-panel input:focus {
  border-color: var(--cyan);
}

.login-actions {
  display: flex;
  gap: 8px;
}

.form-message {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 20px;
}

.member-admin {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 18px;
  margin: 18px 0;
  padding: 18px;
}

.member-form {
  display: grid;
  grid-template-columns: 1fr minmax(190px, 260px) minmax(140px, 180px);
  gap: 14px;
  align-items: end;
}

.member-form h3,
.member-form p {
  margin: 0;
}

.member-form p,
.member-list small {
  color: var(--muted);
  line-height: 1.6;
}

.member-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.member-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.member-form input:focus {
  border-color: var(--cyan);
}

.member-actions {
  display: grid;
  gap: 8px;
}

.member-actions button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: rgba(70, 234, 247, 0.1);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.member-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.member-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  color: var(--text);
}

.dev-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dev-card {
  display: grid;
  gap: 14px;
  min-height: 226px;
  padding: 20px;
}

.dev-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.dev-card .code {
  color: var(--mint);
  font-weight: 900;
}

.module-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.module-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
  font-size: 0.9rem;
}

.module-list a {
  color: var(--cyan);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 6vw, 86px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .flow-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-grid,
  .dev-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .login-panel,
  .member-admin,
  .member-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .topbar,
  .section-head.compact,
  .section-head.split,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .nav a,
  .mode-button {
    flex: 1 1 auto;
  }

  .hero {
    min-height: auto;
    padding-top: 42px;
  }

  h1 {
    font-size: clamp(2.35rem, 15vw, 4rem);
  }

  .pipeline-strip {
    grid-template-columns: 1fr;
  }

  .pipeline-strip span {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .race-core,
  .loop-map,
  .decision-bar {
    grid-template-columns: 1fr;
  }

  .core-badge {
    width: 72px;
    height: 72px;
  }

  .flow-grid,
  .product-grid,
  .dev-grid,
  .login-panel,
  .member-admin,
  .member-form {
    grid-template-columns: 1fr;
  }
}
