:root {
  --bg: #0a0f0a;
  --bg-2: #0d140d;
  --bg-3: #111a11;
  --bg-4: #152015;
  --ink: #4aff4a;
  --ink-bright: #66ff66;
  --muted: #2d7d2d;
  --muted-dim: #1a661a;
  --line: #1a3d1a;
  --line-bright: #2a5a2a;
  --neon: #33ff33;
  --neon-dim: rgba(51, 255, 51, 0.12);
  --neon-glow: 0 0 2px currentColor, 0 0 8px rgba(51, 255, 51, 0.45);
  --phosphor: 0 0 2px currentColor, 0 0 5px rgba(51, 255, 51, 0.4);
  --red: #ff3344;
  --red-dim: rgba(255, 51, 68, 0.2);
  --warn: #7dff3a;
  --font-ui: "Share Tech Mono", "Courier New", ui-monospace, monospace;
  --font-mono: "Share Tech Mono", "Courier New", ui-monospace, monospace;
  --radius: 0;
  --max: 1080px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  letter-spacing: 0.02em;
  text-shadow: 0 0 1px rgba(51, 255, 51, 0.35);
}

/* Scanlines — full viewport, non-interactive */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.22) 2px,
    rgba(0, 0, 0, 0.22) 3px
  );
  opacity: 0.55;
}

/* CRT vignette / tube edge */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  background: radial-gradient(
    ellipse at center,
    transparent 52%,
    rgba(0, 0, 0, 0.35) 78%,
    rgba(0, 0, 0, 0.72) 100%
  );
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.55);
}

/* Extra phosphor wash (existing DOM hook) */
.crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  background:
    radial-gradient(ellipse at center, rgba(51, 255, 51, 0.04), transparent 65%),
    repeating-linear-gradient(
      to bottom,
      rgba(51, 255, 51, 0.015) 0,
      transparent 1px,
      transparent 3px
    );
  opacity: 0.85;
  mix-blend-mode: screen;
}

/* Moving CRT refresh / beam line */
.crt-refresh {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  pointer-events: none;
  z-index: 10;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(102, 255, 102, 0.15) 25%,
    rgba(102, 255, 102, 0.45) 50%,
    rgba(102, 255, 102, 0.15) 75%,
    transparent 100%
  );
  box-shadow:
    0 0 12px 2px rgba(51, 255, 51, 0.35),
    0 0 28px 4px rgba(51, 255, 51, 0.15);
  mix-blend-mode: screen;
  opacity: 0.28;
  will-change: transform;
  animation: crt-refresh-sweep 6s linear infinite;
}

/* Brief static flash layer (shown during glitch) */
.crt-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 11;
  opacity: 0;
  mix-blend-mode: screen;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 1px,
      rgba(51, 255, 51, 0.08) 1px,
      rgba(51, 255, 51, 0.08) 2px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 2px,
      rgba(0, 0, 0, 0.12) 2px,
      rgba(0, 0, 0, 0.12) 3px
    );
}

body.glitch-active .crt-noise {
  animation: crt-noise-flash 0.35s steps(2, end) 1;
}

body.glitch-active .wrap {
  animation: crt-glitch-jitter 0.35s steps(2, end) 1;
}

body.glitch-active .crt {
  opacity: 1;
  filter: brightness(1.35);
}

body.glitch-active::before {
  opacity: 0.85;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
  animation: crt-flicker 7s ease-in-out infinite;
}

.hero {
  margin-bottom: 2.75rem;
}

.back {
  margin: 0 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.back a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.back a:hover,
.back a:focus-visible {
  color: var(--neon);
  text-shadow: var(--phosphor);
  outline: none;
}

.hero__tag {
  margin: 0 0 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--neon);
  text-shadow: var(--phosphor);
}

.hero__title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-bright);
  text-shadow: var(--neon-glow);
  line-height: 1.1;
}

.hero__logo {
  display: block;
  height: 0.85em;
  width: auto;
  flex-shrink: 0;
  filter:
    grayscale(1)
    brightness(1.4)
    sepia(1)
    hue-rotate(70deg)
    saturate(4)
    drop-shadow(0 0 8px rgba(51, 255, 51, 0.55));
}

.hero__sub {
  margin: 0.7rem 0 1.1rem;
  color: var(--muted);
  max-width: 36rem;
}

.hero__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero__meta[data-state="ok"] {
  border-color: rgba(51, 255, 51, 0.45);
  color: var(--neon);
  text-shadow: var(--phosphor);
  box-shadow: 0 0 12px rgba(51, 255, 51, 0.12);
}

.hero__meta[data-state="error"] {
  border-color: rgba(255, 51, 68, 0.55);
  color: var(--red);
  text-shadow: 0 0 4px rgba(255, 51, 68, 0.5);
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(45, 125, 45, 0.5);
}

.hero__meta[data-state="ok"] .pulse {
  background: var(--neon);
  animation: pulse 1.6s ease-out infinite;
}

.hero__meta[data-state="error"] .pulse {
  background: var(--red);
  box-shadow: 0 0 6px rgba(255, 51, 68, 0.6);
}

.hero__meta[data-state="loading"] .pulse {
  animation: pulse 1.2s ease-out infinite;
}

.sep {
  opacity: 0.45;
}

.section {
  margin-bottom: 2.5rem;
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line-bright);
  padding-bottom: 0.55rem;
}

.section__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-bright);
  text-shadow: var(--phosphor);
}

.section__head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.15rem 1.15rem 1.2rem;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  min-height: 11.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--muted-dim);
}

.card[data-up="true"]::before {
  background: var(--neon);
  box-shadow: 0 0 10px rgba(51, 255, 51, 0.55);
}

.card[data-soon]::before {
  background: var(--warn);
  opacity: 0.7;
}

.card[data-soon] .card__top {
  justify-content: flex-end;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-bright);
  box-shadow: 0 0 18px rgba(51, 255, 51, 0.12);
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted-dim);
  box-shadow: 0 0 0 3px rgba(26, 102, 26, 0.3);
}

.status-dot[data-status="up"] {
  background: var(--neon);
  box-shadow: 0 0 0 3px var(--neon-dim), 0 0 10px var(--neon);
  animation: pulse 1.8s ease-out infinite;
}

.status-dot[data-status="down"] {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-dim), 0 0 8px rgba(255, 51, 68, 0.5);
}

.status-dot[data-status="soon"] {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(125, 255, 58, 0.2);
}

.card__badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warn);
  border: 1px solid rgba(125, 255, 58, 0.35);
  padding: 0.12rem 0.4rem;
  text-shadow: 0 0 4px rgba(125, 255, 58, 0.35);
}

.card__name {
  margin: 0.2rem 0 0;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-bright);
  text-shadow: var(--phosphor);
}

.card__desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.4rem;
  padding: 0.55rem 0.75rem;
  color: var(--neon);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--neon-dim);
  border: 1px solid rgba(51, 255, 51, 0.35);
  text-shadow: var(--phosphor);
}

.card__btn:hover,
.card__btn:focus-visible {
  background: rgba(51, 255, 51, 0.2);
  border-color: var(--neon);
  box-shadow: 0 0 14px rgba(51, 255, 51, 0.2);
  outline: none;
}

.term {
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
}

.term[data-state="error"] {
  border-color: rgba(255, 51, 68, 0.45);
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.term__dots {
  display: flex;
  gap: 5px;
}

.term__dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-dim);
  border: 1px solid var(--line-bright);
}

.term__dots i:nth-child(1) { background: var(--red); opacity: 0.85; }
.term__dots i:nth-child(2) { background: var(--warn); opacity: 0.75; }
.term__dots i:nth-child(3) { background: var(--neon); opacity: 0.9; }

.term__title {
  color: var(--muted);
  flex: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.term__live {
  color: var(--muted);
  letter-spacing: 0.14em;
}

.term[data-state="ok"] .term__live {
  color: var(--neon);
  text-shadow: var(--phosphor);
}

.term[data-state="error"] .term__live {
  color: var(--red);
  text-shadow: 0 0 4px rgba(255, 51, 68, 0.5);
}

.term__nodata {
  margin: 0;
  padding: 0.85rem 1rem 0;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-shadow: 0 0 4px rgba(255, 51, 68, 0.4);
}

.metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem;
}

.metric {
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 0.55rem 0.7rem 0.6rem;
}

.metric--wide {
  grid-column: 1 / -1;
}

.metric[hidden] {
  display: none !important;
}

.metric__label,
.services__title {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.metric__value {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-bright);
  text-shadow: var(--phosphor);
}

.metric__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.metric__row .metric__value {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
}

.metric__row .metric__value--pct {
  font-size: 1.15rem;
  color: var(--ink-bright);
}

.metric__pct {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.metric__sub {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.bar {
  margin-top: 0.45rem;
  height: 10px;
  background: #050805;
  border: 1px solid var(--line);
  overflow: hidden;
}

.bar__fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--muted-dim), var(--neon));
  box-shadow: 0 0 10px rgba(51, 255, 51, 0.45);
  transition: width 0.5s ease, background 0.3s ease;
}

.bar[data-level="warn"] .bar__fill {
  background: linear-gradient(90deg, #3d8a1a, var(--warn));
  box-shadow: 0 0 12px rgba(125, 255, 58, 0.4);
}

.bar[data-level="crit"] .bar__fill {
  background: linear-gradient(90deg, #8a1020, var(--red));
  box-shadow: 0 0 12px rgba(255, 51, 68, 0.45);
}

.services {
  padding: 0 0.85rem 1rem;
}

.services__title {
  margin: 0 0 0.55rem;
}

.services__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.services__list li {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.65rem;
  background: var(--bg-3);
  border: 1px solid var(--line);
  font-size: 0.95rem;
}

.services__list li[data-up="true"] {
  border-color: rgba(51, 255, 51, 0.35);
  box-shadow: inset 0 0 12px rgba(51, 255, 51, 0.05);
}

.services__list li[data-up="false"] {
  border-color: rgba(255, 51, 68, 0.35);
  box-shadow: inset 0 0 12px rgba(255, 51, 68, 0.06);
}

.svc__icon {
  font-size: 0.95rem;
}

.svc__name {
  color: var(--ink);
}

.svc__id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.uptime {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 1.1rem 1.1rem 0.4rem;
}

.uptime-group {
  padding: 0.15rem 0 0.85rem;
}

.uptime-group:not([hidden]) ~ .uptime-group:not([hidden]) {
  margin-top: 0.35rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
}

.uptime-group__title {
  margin: 0 0 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-shadow: var(--phosphor);
}

.uptime-group__rows {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.uptime-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 13rem) 1fr;
  gap: 0.65rem 0.9rem;
  align-items: center;
}

.uptime-name {
  font-size: 0.92rem;
  min-width: 0;
  color: var(--ink);
}

.uptime-name strong {
  font-weight: 400;
  letter-spacing: 0.04em;
  text-shadow: var(--phosphor);
}

.uptime-id {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  word-break: break-all;
}

.uptime-blocks {
  display: flex;
  gap: 2px;
  min-width: 0;
}

.uptime-block {
  flex: 1 1 0;
  min-width: 3px;
  height: 22px;
  border-radius: 0;
  background: #0f1a0f;
  border: 1px solid #152515;
}

.uptime-block--up {
  background: var(--neon);
  border-color: rgba(51, 255, 51, 0.5);
  box-shadow: 0 0 8px rgba(51, 255, 51, 0.35);
}

.uptime-block--down {
  background: var(--red);
  border-color: rgba(255, 51, 68, 0.5);
  box-shadow: 0 0 8px rgba(255, 51, 68, 0.35);
}

.uptime-block--unknown {
  background: #0f1a0f;
  border-color: var(--line);
}

.uptime-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.2rem;
  padding: 0.85rem 1.1rem 1.15rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.uptime-legend .uptime-block {
  display: inline-block;
  width: 12px;
  height: 12px;
  min-width: 12px;
  flex: none;
  vertical-align: -2px;
  margin-right: 0.35rem;
  box-shadow: none;
}

.foot {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.foot p {
  margin: 0;
}

.foot__link {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

.foot__link:hover,
.foot__link:focus-visible {
  color: var(--neon);
  text-shadow: var(--phosphor);
  opacity: 1;
  outline: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(51, 255, 51, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(51, 255, 51, 0); }
  100% { box-shadow: 0 0 0 0 rgba(51, 255, 51, 0); }
}

@keyframes crt-flicker {
  0%,
  100% { opacity: 1; }
  48% { opacity: 1; }
  50% { opacity: 0.97; }
  52% { opacity: 1; }
  78% { opacity: 0.985; }
  80% { opacity: 1; }
}

@keyframes crt-refresh-sweep {
  0% { transform: translate3d(0, -5vh, 0); }
  100% { transform: translate3d(0, 105vh, 0); }
}

@keyframes crt-glitch-jitter {
  0% {
    transform: translate3d(0, 0, 0);
    filter: none;
  }
  20% {
    transform: translate3d(-3px, 1px, 0);
    filter: brightness(1.25);
  }
  40% {
    transform: translate3d(4px, -1px, 0);
    filter: brightness(1.4) contrast(1.1);
  }
  60% {
    transform: translate3d(-2px, 0, 0);
    filter: brightness(1.15);
  }
  80% {
    transform: translate3d(2px, 1px, 0);
    filter: brightness(1.3);
  }
  100% {
    transform: translate3d(0, 0, 0);
    filter: none;
  }
}

@keyframes crt-noise-flash {
  0% { opacity: 0; }
  15% { opacity: 0.45; }
  35% { opacity: 0.2; }
  55% { opacity: 0.55; }
  75% { opacity: 0.15; }
  100% { opacity: 0; }
}

@media (min-width: 700px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }

  .services__list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 699px) {
  .uptime-row {
    grid-template-columns: 1fr;
    gap: 0.28rem;
  }

  .uptime-block {
    height: 14px;
    min-width: 2px;
  }
}

@media (min-width: 980px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wrap {
    animation: none !important;
  }

  .crt-refresh {
    animation: none !important;
    display: none !important;
  }

  body.glitch-active .wrap,
  body.glitch-active .crt-noise,
  body.glitch-active .crt {
    animation: none !important;
    filter: none !important;
    transform: none !important;
  }

  .pulse,
  .status-dot,
  .bar__fill,
  .card {
    animation: none !important;
    transition: none !important;
  }
}
