:root {
  color-scheme: dark;
  --ink: #f4f2e8;
  --muted: #a7aa9e;
  --line: rgba(244, 242, 232, 0.16);
  --panel: rgba(24, 27, 23, 0.82);
  --panel-strong: #1e211c;
  --accent: #c7ff3f;
  --test: #ffb45b;
  --bg: #10120f;
  --max: 1320px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 80% 4%, rgba(199, 255, 63, 0.09), transparent 27rem),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 42px 42px, 42px 42px, auto;
  color: var(--ink);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.page-shell {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.masthead {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 20px;
  font-weight: 900;
  transform: rotate(-3deg);
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0.16em;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 10px;
}

.system-state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.system-state strong {
  color: var(--ink);
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(199, 255, 63, 0.5);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  60% { box-shadow: 0 0 0 8px rgba(199, 255, 63, 0); }
  100% { box-shadow: 0 0 0 0 rgba(199, 255, 63, 0); }
}

.hero {
  padding: 84px 0 72px;
  border-bottom: 1px solid var(--line);
}

.hero-kicker,
.eyebrow,
.section-index {
  color: var(--accent);
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.55fr);
  gap: 80px;
  align-items: end;
  margin-top: 24px;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(58px, 8.2vw, 118px);
  font-weight: 850;
  letter-spacing: -0.075em;
  line-height: 0.88;
}

h1 em {
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 1px var(--accent);
}

.hero-copy {
  max-width: 670px;
  margin: 34px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.hero-meta {
  border-top: 1px solid var(--line);
}

.hero-meta > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.hero-meta span {
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.hero-meta strong {
  font-family: Consolas, monospace;
  font-size: 13px;
  font-weight: 500;
}

.controls {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 18, 15, 0.9);
  backdrop-filter: blur(16px);
}

.search-box {
  display: flex;
  width: min(100%, 470px);
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 180ms ease, background 180ms ease;
}

.search-box:focus-within {
  border-color: var(--accent);
  background: rgba(199, 255, 63, 0.04);
}

.search-box > span:first-child {
  color: var(--accent);
  font-size: 22px;
}

.search-box input {
  width: 100%;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-box input::placeholder {
  color: #797d73;
}

kbd {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 11px;
}

.filters {
  display: flex;
  gap: 7px;
}

.filter {
  min-height: 46px;
  padding: 0 17px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.07em;
  transition: 160ms ease;
}

.filter:hover,
.filter:focus-visible,
.filter.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #10120f;
  outline: none;
}

.service-section {
  padding: 70px 0 20px;
}

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

.section-heading > div {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  letter-spacing: -0.045em;
}

.section-heading p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

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

.service-card {
  position: relative;
  display: flex;
  min-height: 300px;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.service-card::after {
  position: absolute;
  right: -26px;
  bottom: -62px;
  color: rgba(255, 255, 255, 0.025);
  content: attr(data-env);
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  transform: rotate(-90deg);
  transform-origin: left bottom;
}

.service-card:hover,
.service-card:focus-visible {
  z-index: 2;
  background: var(--accent);
  color: #10120f;
  outline: none;
  transform: translateY(-4px);
}

.service-section--test .service-card:hover,
.service-section--test .service-card:focus-visible {
  background: var(--test);
}

.service-card:hover .eyebrow,
.service-card:hover .card-footer,
.service-card:focus-visible .eyebrow,
.service-card:focus-visible .card-footer {
  color: #25271f;
}

.card-top,
.card-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-code {
  display: grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  padding: 0 8px;
  border: 1px solid currentColor;
  font-family: Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.live--test i {
  background: var(--test);
}

.service-card:hover .live i,
.service-card:focus-visible .live i {
  background: #10120f;
}

.card-copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
  padding: 32px 0;
}

.service-section--test .eyebrow {
  color: var(--test);
}

.card-copy h3 {
  margin: 8px 0 12px;
  font-size: clamp(25px, 2.4vw, 37px);
  letter-spacing: -0.045em;
}

.card-copy p {
  max-width: 290px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.service-card:hover .card-copy p,
.service-card:focus-visible .card-copy p {
  color: #35382e;
}

.card-footer {
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 11px;
}

.card-footer b {
  font-size: 20px;
  font-weight: 400;
}

.empty-state {
  padding: 110px 20px;
  text-align: center;
}

.empty-state span {
  color: var(--accent);
  font-family: Consolas, monospace;
  letter-spacing: 0.15em;
}

.empty-state p {
  color: var(--muted);
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 60px;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
}

footer button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  padding: 13px 17px;
  background: var(--accent);
  color: #10120f;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 180ms ease;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

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

  .hero-meta {
    max-width: 520px;
  }

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

@media (max-width: 660px) {
  .page-shell {
    width: min(calc(100% - 24px), var(--max));
  }

  .masthead {
    min-height: 74px;
  }

  .system-state span:last-child {
    font-size: 0;
  }

  .system-state span:last-child strong {
    font-size: 12px;
  }

  .system-state span:last-child::after {
    content: " ONLINE";
    font-size: 10px;
  }

  .hero {
    padding: 60px 0 48px;
  }

  h1 {
    font-size: clamp(52px, 18vw, 78px);
  }

  .hero-copy {
    font-size: 15px;
  }

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

  .controls {
    gap: 10px;
  }

  .search-box {
    width: 100%;
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .filter {
    padding: 0 8px;
  }

  .service-section {
    padding-top: 52px;
  }

  .section-heading {
    gap: 10px;
  }

  .service-grid,
  .service-grid--test {
    grid-template-columns: 1fr;
  }

  .service-card {
    min-height: 270px;
  }

  footer {
    gap: 12px;
  }
}

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