:root {
  color-scheme: dark;
  --bg: #0b0f12;
  --bg-soft: #11171d;
  --panel: #151c23;
  --panel-strong: #19232c;
  --text: #f5f7f8;
  --muted: #9caab6;
  --quiet: #687684;
  --line: #26323d;
  --line-strong: #354552;
  --accent: #64d6af;
  --accent-strong: #27b987;
  --warn: #f1c86b;
  --bad: #f06f6f;
  --blue: #8bb7ff;
  --shadow: 0 24px 80px rgb(0 0 0 / 35%);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #edf1f4;
    --bg-soft: #f7f9fb;
    --panel: #ffffff;
    --panel-strong: #f8fbfd;
    --text: #111820;
    --muted: #536373;
    --quiet: #6e7c88;
    --line: #d7e0e7;
    --line-strong: #c4d0da;
    --accent: #0f8c68;
    --accent-strong: #087553;
    --warn: #946409;
    --bad: #b63434;
    --blue: #275fae;
    --shadow: 0 24px 70px rgb(28 45 58 / 15%);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgb(100 214 175 / 16%), transparent 28rem),
    linear-gradient(180deg, var(--bg-soft), var(--bg) 28rem);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

a,
button {
  color: inherit;
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 3;
  padding: 0.75rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.skip:focus {
  top: 1rem;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgb(11 15 18 / 78%);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 4.5rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 0.75rem;
  min-width: max-content;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(135deg, rgb(100 214 175 / 95%), rgb(139 183 255 / 90%));
  border-radius: 8px;
  color: #06100d;
  display: inline-flex;
  font-weight: 900;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.wordmark {
  font-size: 1.05rem;
  letter-spacing: 0;
}

.brand-context {
  color: var(--quiet);
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

nav a {
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.45rem 0.7rem;
  text-decoration: none;
}

nav a:hover {
  background: rgb(255 255 255 / 5%);
  border-color: var(--line);
  color: var(--text);
}

.operator {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.85rem;
  gap: 0.5rem;
  min-height: 2rem;
  padding: 0 0.75rem;
  white-space: nowrap;
}

.status-dot,
.mini {
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgb(100 214 175 / 12%);
  display: inline-block;
  height: 0.55rem;
  width: 0.55rem;
}

.shell {
  margin: 0 auto;
  max-width: 1280px;
  padding: 2rem 1.25rem 3rem;
}

.hero,
.client-system,
.card {
  background: linear-gradient(180deg, rgb(255 255 255 / 4%), transparent), var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 2rem;
  position: relative;
}

.hero::after {
  background:
    linear-gradient(90deg, rgb(100 214 175 / 35%), transparent 24%),
    repeating-linear-gradient(
      90deg,
      rgb(255 255 255 / 8%) 0,
      rgb(255 255 255 / 8%) 1px,
      transparent 1px,
      transparent 32px
    );
  bottom: 0;
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
}

.eyebrow,
.label {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 0.55rem;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(2.25rem, 5vw, 4.8rem);
  line-height: 0.95;
  margin-bottom: 0.85rem;
}

h2 {
  font-size: 1.05rem;
  margin-bottom: 0;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.hero-copy {
  font-size: 1.05rem;
  margin-bottom: 0;
  max-width: 46rem;
}

.client-system {
  align-items: center;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(11rem, 0.35fr) minmax(0, 1fr) minmax(20rem, 0.9fr);
  margin-top: 1rem;
  padding: 1rem;
}

.client-system p {
  margin-bottom: 0;
}

.hero-actions {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

button {
  border: 0;
  border-radius: 7px;
  cursor: default;
  font: inherit;
  font-weight: 800;
  min-height: 2.75rem;
  padding: 0 1rem;
}

.primary {
  background: var(--accent);
  color: #06100d;
}

.secondary {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.metrics {
  display: grid;
  gap: 0.75rem;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.metrics div,
.delivery-grid div {
  background: rgb(255 255 255 / 4%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}

dt,
.delivery-grid span {
  color: var(--quiet);
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

dd,
.delivery-grid strong {
  color: var(--text);
  font-size: 1.45rem;
  font-weight: 850;
  margin: 0;
}

.workspace {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1rem;
}

.card {
  min-height: 13rem;
  padding: 1rem;
}

.span-2 {
  grid-column: span 2;
}

.card-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.pill {
  align-items: center;
  background: rgb(139 183 255 / 12%);
  border: 1px solid rgb(139 183 255 / 28%);
  border-radius: 999px;
  color: var(--blue);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  min-height: 1.7rem;
  padding: 0 0.65rem;
  white-space: nowrap;
}

.pill.good {
  background: rgb(100 214 175 / 12%);
  border-color: rgb(100 214 175 / 28%);
  color: var(--accent);
}

.pill.warn {
  background: rgb(241 200 107 / 12%);
  border-color: rgb(241 200 107 / 32%);
  color: var(--warn);
}

.pill.bad {
  background: rgb(240 111 111 / 12%);
  border-color: rgb(240 111 111 / 32%);
  color: var(--bad);
}

.timeline,
.compact-list,
.status-list,
.audit-log {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline {
  display: grid;
  gap: 0.85rem;
}

.timeline li {
  align-items: flex-start;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.timeline strong,
.approval strong,
.compact-list strong,
.audit-log span {
  color: var(--text);
}

.timeline p,
.approval p {
  font-size: 0.9rem;
  margin: 0.2rem 0 0;
}

.timeline time,
.audit-log time {
  color: var(--quiet);
  font-size: 0.78rem;
  white-space: nowrap;
}

.rail {
  background: var(--line-strong);
  border-radius: 999px;
  height: 2.25rem;
  margin-top: 0.1rem;
  width: 0.25rem;
}

.rail.good,
.mini.good {
  background: var(--accent);
}

.rail.warn,
.mini.warn,
.node.warn {
  background: var(--warn);
}

.mini.bad,
.node.bad {
  background: var(--bad);
}

.approval {
  background: rgb(255 255 255 / 4%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem;
}

.approval + .approval {
  margin-top: 0.75rem;
}

.approval.muted {
  opacity: 0.78;
}

.compact-list {
  display: grid;
  gap: 0.65rem;
}

.compact-list li,
.audit-log li,
.status-list li {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
  min-height: 2.25rem;
}

.compact-list li:last-child,
.audit-log li:last-child,
.status-list li:last-child {
  border-bottom: 0;
}

.status-list {
  display: grid;
  gap: 0.2rem;
}

.status-list li {
  justify-content: flex-start;
}

.delivery-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.delivery-grid strong {
  font-size: 1rem;
}

.node-map {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 0 1rem;
}

.node {
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgb(255 255 255 / 18%), transparent), var(--accent);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 14%);
}

.meter {
  background: rgb(255 255 255 / 7%);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 0.85rem;
  margin-bottom: 1rem;
  overflow: hidden;
}

.meter span {
  background: linear-gradient(90deg, var(--accent), var(--warn));
  display: block;
  height: 100%;
  width: 41%;
}

.audit-log {
  display: grid;
  gap: 0.2rem;
}

.audit-log li {
  justify-content: flex-start;
}

@media (max-width: 1060px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 1rem 1.25rem;
  }

  nav {
    justify-content: flex-start;
  }

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

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .metrics,
  .client-system,
  .workspace,
  .delivery-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .card-header,
  .timeline li {
    grid-template-columns: 1fr;
  }

  .card-header {
    align-items: flex-start;
  }

  .timeline li {
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.85rem;
  }

  .timeline li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .rail {
    display: none;
  }
}

@media (max-width: 560px) {
  nav a {
    padding: 0.4rem 0.55rem;
  }
}

@media (max-width: 460px) {
  .shell {
    padding: 1rem 0.75rem 2rem;
  }

  .hero-actions,
  button {
    width: 100%;
  }

  .operator {
    white-space: normal;
  }
}

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