:root {
  color-scheme: dark;
  --bg: oklch(0.115 0.018 250);
  --bg-2: oklch(0.16 0.025 250);
  --panel: color-mix(in oklch, oklch(0.22 0.026 250) 78%, transparent);
  --panel-strong: oklch(0.22 0.027 250);
  --panel-soft: oklch(0.18 0.022 250);
  --ink: oklch(0.96 0.006 80);
  --ink-2: oklch(0.8 0.012 85);
  --muted: oklch(0.66 0.018 245);
  --line: color-mix(in oklch, var(--ink) 14%, transparent);
  --line-strong: color-mix(in oklch, var(--ink) 24%, transparent);
  --accent: oklch(0.78 0.145 68);
  --accent-strong: oklch(0.68 0.16 58);
  --accent-soft: color-mix(in oklch, var(--accent) 18%, transparent);
  --good: oklch(0.78 0.12 160);
  --warn: oklch(0.82 0.13 82);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, color-mix(in oklch, var(--accent) 15%, transparent), transparent 32rem),
    radial-gradient(circle at 82% 6%, oklch(0.42 0.08 255 / 0.28), transparent 30rem),
    linear-gradient(180deg, var(--bg), oklch(0.09 0.015 250) 52%, var(--bg));
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

::selection {
  color: oklch(0.13 0.018 250);
  background: var(--accent);
}

#field-canvas {
  position: fixed;
  inset: 0;
  z-index: -3;
  width: 100%;
  height: 100%;
  opacity: 1.45;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(90deg, oklch(1 0 0 / 0.035) 1px, transparent 1px),
    linear-gradient(0deg, oklch(1 0 0 / 0.03) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: oklch(0.11 0.018 250 / 0.76);
  backdrop-filter: blur(18px);
}

.brand,
.deploy-state,
.nav-pills,
.button,
.view-toggle,
.command-bar,
.tag,
.product-id,
.status-pill {
  font-size: 13px;
  font-weight: 750;
}

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

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.brand-glyph {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(145deg, oklch(0.29 0.03 250), oklch(0.13 0.018 250));
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.1);
}

.brand-glyph span {
  position: absolute;
  left: 9px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform-origin: left;
}

.brand-glyph span:nth-child(1) { top: 10px; width: 13px; }
.brand-glyph span:nth-child(2) { top: 17px; width: 19px; }
.brand-glyph span:nth-child(3) { top: 24px; width: 10px; }

.nav-pills,
.view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(0.15 0.02 250 / 0.78);
}

.nav-pills a,
.view-toggle button {
  min-height: 34px;
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  transition: color 180ms var(--ease), background 180ms var(--ease), transform 180ms var(--ease);
}

.nav-pills a:hover,
.view-toggle button:hover,
.view-toggle button.active {
  color: var(--ink);
  background: oklch(1 0 0 / 0.08);
}

.nav-pills a:active,
.view-toggle button:active,
.button:active {
  transform: translateY(1px);
}

.deploy-state {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-2);
}

.deploy-state i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 5px oklch(0.78 0.12 160 / 0.13);
}

main {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 44px) 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
  gap: clamp(26px, 5vw, 70px);
  align-items: center;
  min-height: calc(100dvh - 66px);
  padding: 70px 0 52px;
}

.system-line {
  margin: 0 0 14px;
  color: var(--accent);
  font: 760 12px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h1 {
  max-width: 900px;
  font-size: clamp(42px, 5.85vw, 80px);
  line-height: 0.99;
}

h1 span {
  display: block;
}

h2 {
  font-size: clamp(30px, 4.3vw, 58px);
  line-height: 1.02;
}

h3 {
  font-size: 19px;
  line-height: 1.15;
}

.hero-lede {
  max-width: 68ch;
  margin: 26px 0 0;
  color: var(--ink-2);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.72;
  text-wrap: pretty;
}

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

.signal-strip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: oklch(0.09 0.014 250 / 0.48);
  font: 750 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.signal-strip i {
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--line), var(--accent));
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 17px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  white-space: nowrap;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease);
}

.button.primary {
  color: oklch(0.12 0.016 250);
  border-color: transparent;
  background: var(--accent);
}

.button.ghost {
  color: var(--ink);
  background: oklch(1 0 0 / 0.045);
}

.button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.briefing-console,
.arena-card,
.route-card,
.thesis-card,
.command-bar,
.product-card,
.product-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, oklch(0.22 0.027 250 / 0.82), oklch(0.14 0.02 250 / 0.76));
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.08);
}

.briefing-console {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.briefing-console::before,
.arena-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 20%), oklch(0.83 0.14 68 / 0.2), transparent 34%);
  opacity: 0.8;
}

.console-top,
.panel-title,
.candidate-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.console-top b,
.panel-title b,
.candidate-title b {
  color: var(--ink);
}

.metric-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.metric-card {
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: oklch(0.1 0.015 250 / 0.48);
}

.metric-card strong {
  display: block;
  font-size: 44px;
  line-height: 0.9;
  letter-spacing: -0.035em;
}

.metric-card span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.latest-stack {
  position: relative;
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.latest-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: oklch(1 0 0 / 0.045);
}

.latest-item time,
.product-id {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.latest-item b {
  display: block;
  line-height: 1.35;
}

.latest-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.section {
  padding: 72px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 26px;
}

.section-heading > p {
  max-width: 48ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
}

.arena-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.arena-card {
  position: relative;
  overflow: hidden;
  min-height: 620px;
}

.radar-stage {
  position: absolute;
  inset: 18px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at center, transparent 0 14%, oklch(1 0 0 / 0.055) 14.2% 14.5%, transparent 14.7% 29%, oklch(1 0 0 / 0.042) 29.2% 29.5%, transparent 29.7% 44%, oklch(1 0 0 / 0.034) 44.2% 44.5%, transparent 44.7% 60%, oklch(1 0 0 / 0.03) 60.2% 60.5%, transparent 60.7%),
    linear-gradient(90deg, transparent calc(50% - 0.5px), oklch(0.83 0.14 68 / 0.28), transparent calc(50% + 0.5px)),
    linear-gradient(0deg, transparent calc(50% - 0.5px), oklch(0.83 0.14 68 / 0.22), transparent calc(50% + 0.5px)),
    oklch(0.1 0.014 250 / 0.76);
}

.radar-stage::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: conic-gradient(from 0deg, transparent 0 74%, oklch(0.83 0.14 68 / 0.25), transparent 86% 100%);
  animation: radarSweep 7s linear infinite;
  mix-blend-mode: screen;
}

.radar-stage::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid oklch(0.83 0.14 68 / 0.16);
  border-radius: 12px;
  pointer-events: none;
}

.axis-label {
  position: absolute;
  z-index: 3;
  color: var(--muted);
  font: 750 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.axis-label.top { top: 18px; left: 50%; transform: translateX(-50%); }
.axis-label.bottom { bottom: 18px; left: 50%; transform: translateX(-50%); }
.axis-label.left { left: 18px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.axis-label.right { right: 18px; top: 50%; transform: translateY(-50%) rotate(90deg); }

.radar-node {
  position: absolute;
  z-index: 5;
  display: grid;
  grid-template-columns: 34px minmax(88px, max-content);
  align-items: center;
  gap: 9px;
  max-width: 220px;
  padding: 7px 9px 7px 7px;
  border: 1px solid oklch(1 0 0 / 0.16);
  border-radius: 999px;
  background: oklch(0.12 0.016 250 / 0.82);
  backdrop-filter: blur(12px);
  transform: translate(-50%, -50%);
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), background 220ms var(--ease);
}

.radar-node:hover {
  z-index: 9;
  border-color: var(--accent);
  background: oklch(0.2 0.025 250 / 0.92);
  transform: translate(-50%, -50%) scale(1.04);
}

.radar-node img,
.mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.radar-node .mark {
  width: 34px;
  height: 34px;
}

.radar-node b {
  display: block;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
}

.radar-node span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

.map-label {
  position: absolute;
  z-index: 4;
  max-width: 210px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-2);
  background: oklch(0.08 0.012 250 / 0.55);
}

.map-label b {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.map-label span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
}

.route-panel {
  display: grid;
  gap: 12px;
}

.route-card {
  padding: 18px;
}

.route-card strong {
  display: block;
  font-size: 19px;
}

.route-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.route-card .route-products {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  background: oklch(1 0 0 / 0.045);
}

.status-pill {
  color: oklch(0.1 0.015 250);
  background: var(--warn);
  border-color: transparent;
}

.thesis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.thesis-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  min-height: 260px;
}

.thesis-card::before {
  content: attr(data-index);
  position: absolute;
  right: 14px;
  top: 6px;
  color: oklch(1 0 0 / 0.06);
  font: 800 82px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.thesis-card h3 {
  position: relative;
  max-width: 24ch;
}

.thesis-card p {
  position: relative;
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.72;
}

.product-heading {
  align-items: center;
}

.command-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 180px auto;
  gap: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.command-bar label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.command-bar input,
.command-bar select,
.command-bar button {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: oklch(0.09 0.014 250 / 0.72);
}

.command-bar input,
.command-bar select {
  padding: 10px 12px;
}

.command-bar button {
  align-self: end;
  padding: 10px 14px;
  font-weight: 750;
}

.command-bar input::placeholder {
  color: oklch(0.62 0.018 245);
  opacity: 1;
}

.command-bar input:focus,
.command-bar select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.result-meta strong {
  color: var(--ink);
}

.product-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}

.product-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  min-height: 292px;
  padding: 18px;
  transition: transform 220ms var(--ease), border-color 220ms var(--ease), background 220ms var(--ease);
}

.product-card:hover {
  border-color: color-mix(in oklch, var(--accent) 60%, var(--line));
  transform: translateY(-3px);
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), oklch(0.83 0.14 68 / 0.16), transparent 34%);
  opacity: 0;
  transition: opacity 220ms var(--ease);
}

.product-card:hover::before {
  opacity: 1;
}

.product-top,
.table-product {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.mark {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--accent);
  background: oklch(0.08 0.012 250 / 0.86);
  font-weight: 850;
}

.product-card h3,
.table-product strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card small,
.table-product small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.product-card p {
  position: relative;
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.72;
}

.tag-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.card-links {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.card-links a {
  color: var(--accent);
  font-size: 13px;
  font-weight: 780;
}

.product-table-wrap {
  overflow-x: auto;
}

.product-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 14px;
}

.product-table th,
.product-table td {
  padding: 14px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.product-table th {
  color: var(--muted);
  font-size: 12px;
}

.product-table tr:hover td {
  background: oklch(1 0 0 / 0.045);
}

.hidden {
  display: none !important;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes radarSweep {
  to { transform: rotate(360deg); }
}

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

  .deploy-state {
    justify-self: start;
  }

  .hero,
  .arena-grid,
  .arena-card {
    min-height: 560px;
  }

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

  .command-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  main {
    padding-inline: 14px;
  }

  .topbar {
    padding-inline: 14px;
  }

  .nav-pills {
    overflow-x: auto;
    justify-content: flex-start;
    width: 100%;
  }

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

  h1 {
    font-size: clamp(40px, 12vw, 56px);
  }

  .metric-grid,
  .thesis-grid,
  .command-bar {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: grid;
    gap: 12px;
  }

  .arena-card {
    min-height: 680px;
  }

  .radar-node {
    grid-template-columns: 30px minmax(74px, max-content);
    max-width: 172px;
    padding: 6px;
  }

  .radar-node .mark {
    width: 30px;
    height: 30px;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
