:root {
  color-scheme: light dark;
  --bg: #edf1f7;
  --ink: #0d1424;
  --muted: #5b6579;
  --line: rgba(13, 20, 36, .14);
  --ok: #0a9a6b;
  --off: #d6454b;
  --glow: rgba(42, 69, 255, .18);
  --dot: rgba(13, 20, 36, .18);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070b16;
    --ink: #eaeef8;
    --muted: #8d97ae;
    --line: rgba(234, 238, 248, .14);
    --ok: #3fd6a0;
    --off: #ff6b72;
    --glow: rgba(124, 140, 255, .24);
    --dot: rgba(234, 238, 248, .14);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  color: var(--ink);
  background: radial-gradient(60rem 36rem at 85% -10%, var(--glow), transparent 70%);
  -webkit-font-smoothing: antialiased;
}

/* dot grid that fades out toward the edges */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(var(--dot) 1px, transparent 1.3px) 0 0 / 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}

main {
  width: min(100% - 3rem, 56rem);
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  padding-block: 1.5rem;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.top {
  display: flex;
  align-items: center;
  gap: .6rem;
  font: .875rem var(--mono);
  color: var(--muted);
}

.dot {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70%  { box-shadow: 0 0 0 .55rem transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.stage {
  align-self: center;
  display: grid;
  gap: 2.75rem;
  padding-block: 3rem;
}

h1 {
  font-size: clamp(2.1rem, 8.5vw, 5.5rem);
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: 1;
  overflow-wrap: anywhere;
}

.hero p {
  max-width: 34rem;
  margin-top: 1.1rem;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--muted);
}

/* response panel: stays dark in both themes */
.panel {
  background: #0c1222;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  box-shadow: 0 30px 60px -32px rgba(10, 20, 60, .55);
  overflow: hidden;
}

.bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font: .8125rem var(--mono);
  color: #8d97ae;
}

.method { color: #8fa2ff; font-weight: 600; }
.path   { color: #e6eaf5; }
.status { margin-left: auto; color: #3fd6a0; }

.code {
  padding: 1.15rem 1.25rem 1.3rem;
  font: .9375rem/1.75 var(--mono);
  color: #e6eaf5;
  overflow-x: auto;
  white-space: pre;
  display: flex;
  flex-direction: column;
}

.ln { display: block; opacity: 0; transition: opacity .35s ease; }
.ln.show { opacity: 1; }

.k  { color: #8fa2ff; }
.s  { color: #7ee0b8; }
.n  { color: #ffc56b; }
.nl { color: #ff8fa3; }
.p  { color: #6b7694; }

.caret {
  display: inline-block;
  width: .6ch;
  height: 1.1em;
  margin-left: .5ch;
  vertical-align: text-bottom;
  background: #8fa2ff;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

footer {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: .8125rem;
  color: var(--muted);
}

@media (max-width: 520px) {
  main { width: min(100% - 2rem, 56rem); }
  .code { font-size: .8125rem; }
}

@media (prefers-reduced-motion: reduce) {
  .dot, .caret { animation: none; }
  .ln { transition: none; }
}

/* ---------- stack ---------- */
.stack h2 {
  margin-bottom: .85rem;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--muted);
}

.stack h2 span {
  margin-left: .6rem;
  font-weight: 400;
  font-size: .8125rem;
  font-family: var(--mono);
}

.stack ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}

.tile {
  --c: #8d97ae;
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem .9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .3s ease, background-color .3s ease;
}

.go { --c: #00add8; }
.py { --c: #ffd43b; }
.ts { --c: #3a8fe0; }
.rb { --c: #e3534a; }
.rs { --c: #f74c00; }
.kt { --c: #a54be8; }

.mark {
  flex: none;
  width: 3.5rem;
  height: 2.75rem;
  padding: .55rem .5rem;
  border-radius: 9px;
  background: #0c1222;
  border: 1px solid rgba(255, 255, 255, .1);
  transition: box-shadow .3s ease, border-color .3s ease;
}

.mark svg { display: block; width: 100%; height: 100%; }
.go .mark { padding: .4rem .3rem; }

.meta { display: grid; gap: .15rem; line-height: 1.2; min-width: 0; }
.meta b { font-size: .9375rem; font-weight: 600; }

.meta small {
  display: flex;
  align-items: center;
  gap: .45rem;
  white-space: nowrap;
  font-size: .8125rem;
  color: var(--muted);
}

/* status indicator: green + pulse = online, red + static = offline */
.meta small::before {
  content: "";
  flex: none;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--off);
}

.is-online small::before {
  background: var(--ok);
  animation: pulse 2.4s ease-out infinite;
}

/* online: glowing in the language's own color */
.tile.is-online {
  border-color: color-mix(in srgb, var(--c) 40%, transparent);
  background: color-mix(in srgb, var(--c) 8%, transparent);
}

.is-online .mark {
  border-color: color-mix(in srgb, var(--c) 60%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 25%, transparent),
              0 0 22px -2px color-mix(in srgb, var(--c) 60%, transparent);
  animation: breathe 4s ease-in-out infinite;
}

/* offline: quiet, dashed, grayscale, no glow */
.tile.is-offline { border-style: dashed; }
.is-offline .mark svg { filter: grayscale(1); opacity: .55; }
.is-offline .meta b { color: var(--muted); }

@keyframes breathe {
  50% {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 18%, transparent),
                0 0 12px -2px color-mix(in srgb, var(--c) 40%, transparent);
  }
}

@media (max-width: 760px) {
  .stack ul { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .stack ul { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .is-online .mark, .is-online small::before { animation: none; }
}