:root {
  color-scheme: dark;
  --bg: #07110f;
  --bg-soft: #0d1814;
  --surface: #111d18;
  --surface-strong: #15251e;
  --line: rgba(198, 255, 222, 0.16);
  --text: #edf8f2;
  --muted: #9fb4aa;
  --green: #56f08d;
  --cyan: #3bd8ff;
  --amber: #f7c75b;
  --red: #ff5e67;
  --blue: #3488ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(7, 17, 15, 0.9), rgba(7, 17, 15, 1)),
    #07110f;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--green);
  color: #06100c;
  font-weight: 800;
  transform: translateY(-140%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 17, 14, 0.86);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(86, 240, 141, 0.45);
  border-radius: 8px;
  background: #0e2018;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
}

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

.brand strong {
  font-size: 0.98rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-links {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.nav-links a,
.portfolio-link {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-links a:hover,
.portfolio-link:hover {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.portfolio-link {
  border-color: rgba(59, 216, 255, 0.28);
  color: var(--cyan);
}

main {
  display: grid;
  gap: 22px;
  padding: 22px 0 0;
}

.monitor-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(520px, 1.18fr);
  gap: 22px;
  align-items: stretch;
  min-height: calc(100vh - 132px);
}

.monitor-copy,
.monitor-stage,
.dashboard-section,
.architecture-section,
.product-section,
.about-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 24, 20, 0.86);
  box-shadow: var(--shadow);
}

.monitor-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 680px;
  margin-bottom: 14px;
  font-size: 3rem;
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.8rem;
  line-height: 1.16;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
  letter-spacing: 0;
}

.lead {
  max-width: 62ch;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 1.02rem;
}

.signal-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.signal-stack span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d9f7e8;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.84rem;
}

.control-panel {
  display: grid;
  gap: 18px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: min(100%, 430px);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08130f;
}

.source-button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.source-button.is-active {
  background: var(--green);
  color: #06100c;
  font-weight: 800;
}

.range-control {
  display: grid;
  gap: 8px;
  max-width: 430px;
  color: var(--muted);
  font-size: 0.88rem;
}

.range-control input {
  width: 100%;
  accent-color: var(--green);
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.toggle-row input {
  accent-color: var(--green);
}

.monitor-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
}

.video-shell {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 460px;
  border: 1px solid rgba(59, 216, 255, 0.18);
  border-radius: 8px;
  background: #050807;
}

.video-shell img,
.video-shell video,
.video-shell canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-shell img,
.video-shell video {
  object-fit: cover;
  filter: saturate(1.04) contrast(1.02);
}

.video-shell video.is-mirrored {
  transform: scaleX(-1);
  transform-origin: center;
}

.video-shell canvas {
  z-index: 2;
  pointer-events: none;
}

.live-badge,
.metric-hud,
.attention-rail,
.tracking-debug {
  position: absolute;
  z-index: 3;
}

.live-badge {
  top: 14px;
  right: 58px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(86, 240, 141, 0.3);
  border-radius: 999px;
  background: rgba(3, 8, 6, 0.74);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}

.live-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px var(--green);
}

.metric-hud {
  top: 14px;
  left: 14px;
  width: min(470px, calc(100% - 92px));
  padding: 12px;
  border: 1px solid rgba(86, 240, 141, 0.18);
  border-radius: 8px;
  background: rgba(3, 8, 6, 0.58);
  color: #dff8e9;
  backdrop-filter: blur(8px);
}

.metric-hud p {
  margin: 0;
  font-size: 0.9rem;
}

.metric-hud strong {
  color: var(--green);
}

.attention-rail {
  top: 14px;
  right: 16px;
  bottom: 14px;
  width: 22px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
}

.attention-rail span {
  position: absolute;
  right: 3px;
  bottom: 3px;
  left: 3px;
  min-height: 8%;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(86, 240, 141, 0.55);
  transition:
    height 300ms ease,
    background 300ms ease;
}

.tracking-debug {
  right: 52px;
  bottom: 12px;
  max-width: min(360px, calc(100% - 76px));
  max-height: 210px;
  margin: 0;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid rgba(59, 216, 255, 0.28);
  border-radius: 8px;
  background: rgba(2, 8, 6, 0.72);
  color: #c9f7e5;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: pre-wrap;
  backdrop-filter: blur(8px);
}

.alert-strip {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(86, 240, 141, 0.22);
  border-radius: 8px;
  background: #0b1712;
  color: #dff8e9;
  font-weight: 700;
}

.alert-strip.is-warning {
  border-color: rgba(247, 199, 91, 0.34);
  color: var(--amber);
}

.alert-strip.is-danger {
  border-color: rgba(255, 94, 103, 0.36);
  color: var(--red);
}

.dashboard-section,
.architecture-section,
.product-section,
.about-section {
  padding: 30px;
}

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card,
.chart-panel,
.event-panel,
.insight-panel,
.pipeline article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.kpi-card {
  min-height: 144px;
  padding: 16px;
}

.kpi-card span,
.kpi-card small,
.panel-title span {
  color: var(--muted);
  font-size: 0.82rem;
}

.kpi-card strong {
  display: block;
  margin: 10px 0 6px;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr 0.95fr;
  gap: 12px;
  margin-top: 12px;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.chart-panel,
.event-panel,
.insight-panel,
.ops-grid article,
.product-grid article,
.credit-card {
  min-height: 260px;
  padding: 16px;
}

.panel-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title h3 {
  margin: 0;
}

.score-chart {
  display: grid;
  grid-template-columns: repeat(24, minmax(7px, 1fr));
  align-items: end;
  gap: 6px;
  height: 180px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 100% 25%,
    rgba(0, 0, 0, 0.16);
}

.score-bar {
  min-height: 12px;
  border-radius: 999px 999px 4px 4px;
  background: var(--green);
  box-shadow: 0 8px 22px rgba(86, 240, 141, 0.18);
  transition:
    height 300ms ease,
    background 300ms ease;
}

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

.event-list li {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  align-items: start;
  color: #d8ece2;
  font-size: 0.92rem;
}

.event-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--green);
}

.event-dot.warn {
  background: var(--amber);
}

.event-dot.danger {
  background: var(--red);
}

.insight-panel p {
  margin-bottom: 0;
  color: #d7eee2;
  font-size: 1.05rem;
}

.ops-grid article,
.product-grid article,
.credit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(59, 216, 255, 0.08), transparent 44%),
    rgba(255, 255, 255, 0.035);
}

.ops-grid article {
  min-height: 154px;
}

.ops-grid span,
.credit-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.ops-grid strong,
.credit-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.2rem;
}

.ops-grid p,
.product-grid p,
.about-copy p {
  margin-bottom: 0;
  color: var(--muted);
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pipeline article {
  min-height: 188px;
  padding: 18px;
}

.pipeline span {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: rgba(59, 216, 255, 0.12);
  color: var(--cyan);
  font-weight: 800;
}

.pipeline p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.product-grid article {
  min-height: 210px;
}

.card-index {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 34px;
  margin-bottom: 18px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(247, 199, 91, 0.12);
  color: var(--amber);
  font-weight: 800;
}

.about-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: stretch;
}

.about-copy {
  align-self: center;
}

.credit-card {
  min-height: 0;
  background:
    linear-gradient(135deg, rgba(86, 240, 141, 0.14), transparent 52%),
    rgba(255, 255, 255, 0.04);
}

.credit-card a {
  display: block;
  margin-top: 8px;
  color: var(--green);
  font-weight: 800;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding: 18px 4px 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer a {
  color: var(--green);
  font-weight: 800;
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 1120px) {
  .monitor-grid,
  .analytics-grid,
  .about-section {
    grid-template-columns: 1fr;
  }

  .monitor-grid {
    min-height: auto;
  }

  .monitor-copy {
    justify-content: start;
  }

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

@media (max-width: 760px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr;
  }

  .nav-links {
    justify-content: start;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.45rem;
  }

  .monitor-copy,
  .dashboard-section,
  .architecture-section,
  .product-section,
  .about-section {
    padding: 20px;
  }

  .video-shell {
    min-height: 360px;
  }

  .kpi-grid,
  .pipeline,
  .ops-grid,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .footer {
    align-items: start;
    flex-direction: column;
  }

  .metric-hud {
    width: calc(100% - 70px);
  }
}

@media (max-width: 480px) {
  .segmented-control {
    grid-template-columns: 1fr;
  }

  .video-shell {
    min-height: 300px;
  }

  .metric-hud p {
    font-size: 0.78rem;
  }

  .score-chart {
    grid-template-columns: repeat(12, minmax(8px, 1fr));
  }
}

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

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