:root {
  color-scheme: dark;
  --bg: #10141b;
  --bg-soft: #131922;
  --panel: #171c25;
  --panel-hover: #1b222d;
  --border: #2a313d;
  --border-strong: #3a4350;
  --text: #f2f4f6;
  --muted: #929ba8;
  --dim: #646e7a;
  --status-online: #31d071;
  --status-tailnet-needed: #f15a24;
  --status-down: #ff4d4d;
  --orange: #f15a24;
  --button: #202734;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  background-image: radial-gradient(circle, rgba(180, 190, 205, 0.075) 0 1px, transparent 1.3px);
  background-size: 26px 26px;
}

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

.page {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0 38px;
}

.site-header {
  display: flex;
  justify-content: center;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  width: clamp(78px, 18vw, 108px);
  height: auto;
  border-radius: 14px;
  object-fit: contain;
}

.home-main {
  padding-top: 42px;
}

.greeting {
  display: grid;
  justify-content: center;
  min-height: 1.4em;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0;
  text-align: center;
}

.greeting-measure,
.greeting-text {
  grid-area: 1 / 1;
  justify-self: center;
  white-space: nowrap;
}

.greeting-measure {
  visibility: hidden;
}

h1,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 1.34rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.service-list {
  display: grid;
  gap: 9px;
  position: relative;
}

.service-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(23, 28, 37, 0.9);
  transition: background 160ms ease, border-color 160ms ease;
}

.service-row:hover,
.service-row:focus-visible {
  border-color: var(--border-strong);
  background: var(--panel-hover);
  outline: none;
}

.service-row.private:hover,
.service-row.private:focus-visible {
  border-color: rgba(241, 90, 36, 0.42);
}

.service-row.is-checking {
  cursor: progress;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4b5563;
}

.status-dot.is-online {
  background: var(--status-online);
  box-shadow: 0 0 10px rgba(49, 208, 113, 0.34);
}

.status-dot.is-tailnet-needed {
  background: var(--status-tailnet-needed);
  box-shadow: 0 0 10px rgba(241, 90, 36, 0.28);
}

.status-dot.is-down {
  background: var(--status-down);
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.26);
}

.service-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.service-name {
  font-size: 0.98rem;
  font-weight: 720;
}

.service-url,
.tailnet-copy,
.download-links,
.steps {
  color: var(--muted);
}

.service-url {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tailnet-mark,
.dot-motif {
  display: grid;
  grid-template-columns: repeat(3, 5px);
  gap: 5px;
  width: max-content;
}

.tailnet-mark {
  justify-self: center;
  position: relative;
  width: 25px;
  height: 25px;
  overflow: hidden;
}

.tailnet-mark span,
.dot-motif span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dim);
}

.tailnet-mark span {
  position: relative;
  z-index: 1;
}

.tailnet-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(
      135deg,
      transparent 38%,
      rgba(235, 240, 247, 0.05) 44%,
      rgba(255, 255, 255, 0.5) 50%,
      rgba(235, 240, 247, 0.05) 56%,
      transparent 62%
    );
  background-repeat: no-repeat;
  background-size: 260% 260%;
  background-position: -140% -140%;
  mask-image:
    radial-gradient(circle 2.6px at 2.5px 2.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 12.5px 2.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 22.5px 2.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 2.5px 12.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 12.5px 12.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 22.5px 12.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 2.5px 22.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 12.5px 22.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 22.5px 22.5px, #000 96%, transparent 100%);
  -webkit-mask-image:
    radial-gradient(circle 2.6px at 2.5px 2.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 12.5px 2.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 22.5px 2.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 2.5px 12.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 12.5px 12.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 22.5px 12.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 2.5px 22.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 12.5px 22.5px, #000 96%, transparent 100%),
    radial-gradient(circle 2.6px at 22.5px 22.5px, #000 96%, transparent 100%);
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
}

.tailnet-mark.is-offline::after {
  opacity: 1;
  animation: tailnetSweep 3s linear infinite;
}

.tailnet-mark.is-offline span,
.tailnet-mark span {
  background: #4b5563;
}

.tailnet-mark.is-offline span:nth-child(2),
.tailnet-mark.is-offline span:nth-child(4),
.tailnet-mark.is-offline span:nth-child(6),
.tailnet-mark.is-offline span:nth-child(8),
.tailnet-mark span:nth-child(2),
.tailnet-mark span:nth-child(4),
.tailnet-mark span:nth-child(6),
.tailnet-mark span:nth-child(8) {
  background: #5f6875;
}

.tailnet-mark.is-offline span:nth-child(5),
.tailnet-mark span:nth-child(5) {
  background: #374151;
}

.tailnet-mark.is-online span {
  background: #25303c;
}

.tailnet-mark.is-online span:nth-child(4),
.tailnet-mark.is-online span:nth-child(5) {
  background: #ffffff;
}

.tailnet-mark.is-online span:nth-child(6),
.tailnet-mark.is-online span:nth-child(8) {
  background: #ffffff;
}

.tailnet-page {
  width: min(620px, calc(100% - 32px));
}

.tailnet-main {
  display: grid;
  align-items: start;
  padding-top: 54px;
}

.tailnet-panel {
  width: 100%;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(23, 28, 37, 0.9);
}

.tailnet-copy {
  margin-bottom: 0;
  line-height: 1.55;
}

.dot-motif {
  margin-bottom: 22px;
}

.dot-motif span {
  transition: background 220ms ease, opacity 220ms ease, transform 220ms ease;
}

.connecting .dot-motif span {
  opacity: 0.25;
}

.connecting .dot-motif span:nth-child(4),
.connecting .dot-motif span:nth-child(5),
.connecting .dot-motif span:nth-child(6),
.connecting .dot-motif span:nth-child(8) {
  background: var(--orange);
  opacity: 0.9;
  animation: pulse 1.9s ease-in-out infinite;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--button);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.button:hover,
.button:focus-visible {
  border-color: rgba(241, 90, 36, 0.5);
  background: #252d3a;
  outline: none;
}

.button.primary {
  border-color: var(--orange);
  background: var(--orange);
  color: #160906;
}

.button.primary:hover,
.button.primary:focus-visible {
  background: #ff6a32;
}

.download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 18px;
  font-size: 0.9rem;
}

.download-links a {
  color: var(--text);
}

.steps {
  margin: 20px 0 0;
  padding-left: 20px;
  font-size: 0.92rem;
  line-height: 1.6;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes tailnetSweep {
  0%,
  20% {
    background-position: -140% -140%;
  }
  70%,
  100% {
    background-position: 140% 140%;
  }
}

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

@media (max-width: 720px) {
  .page,
  .tailnet-page {
    width: min(100% - 24px, 860px);
    padding-top: 24px;
  }

  .home-main,
  .tailnet-main {
    padding-top: 36px;
  }

  .service-row {
    min-height: 64px;
    padding: 12px 13px;
  }

  .tailnet-panel {
    padding: 20px;
  }

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