:root {
  --bg: #071013;
  --panel: rgba(18, 29, 34, 0.82);
  --panel-strong: rgba(24, 39, 45, 0.94);
  --line: rgba(166, 188, 196, 0.18);
  --text: #f4fbf8;
  --muted: #9db0b6;
  --soft: #d7e5e1;
  --green: #49d17d;
  --blue: #64b5ff;
  --amber: #f4c96d;
  --red: #ff7f7f;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(73, 209, 125, 0.16), transparent 30%),
    radial-gradient(circle at 86% 16%, rgba(100, 181, 255, 0.13), transparent 32%),
    linear-gradient(135deg, #061013 0%, #0d171a 48%, #10180f 100%);
  letter-spacing: 0;
}

button,
input,
a {
  font: inherit;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 54px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 28px;
  min-height: 330px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-copy,
.hero-visual,
.toolbar,
.stat,
.section-head,
.domain-section {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 330px;
  padding: 38px;
  border-radius: 22px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin-bottom: 22px;
  padding: 9px 12px;
  border: 1px solid rgba(73, 209, 125, 0.28);
  border-radius: 999px;
  color: #bff6d0;
  background: rgba(73, 209, 125, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.signal {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(73, 209, 125, 0.12);
}

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

h1 {
  max-width: 760px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.96;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-visual {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(10, 21, 25, 0.96), rgba(28, 48, 42, 0.88)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 54px);
}

.hero-visual::before,
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 18%;
  border: 1px solid rgba(215, 229, 225, 0.13);
  border-radius: 50%;
}

.hero-visual::after {
  inset: 30%;
}

.orbit {
  position: absolute;
  border: 1px dashed rgba(100, 181, 255, 0.26);
  border-radius: 50%;
  transform: rotate(-16deg);
}

.orbit-one {
  inset: 18px 42px;
}

.orbit-two {
  inset: 72px 86px;
  transform: rotate(28deg);
}

.domain-node {
  position: absolute;
  display: grid;
  min-width: 64px;
  height: 42px;
  place-items: center;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  color: var(--soft);
  background: rgba(7, 16, 19, 0.78);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
  font-size: 13px;
  font-weight: 800;
}

.primary-node {
  top: 46%;
  left: 50%;
  min-width: 82px;
  height: 52px;
  color: #071013;
  background: var(--green);
  transform: translate(-50%, -50%);
}

.node-a { top: 21%; left: 22%; }
.node-b { top: 28%; right: 18%; }
.node-c { bottom: 22%; left: 16%; }
.node-d { bottom: 18%; right: 20%; }

.toolbar {
  position: sticky;
  top: 14px;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(11, 22, 26, 0.88);
}

.search-wrap {
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
}

.search-wrap:focus-within {
  border-color: rgba(73, 209, 125, 0.78);
  box-shadow: 0 0 0 4px rgba(73, 209, 125, 0.12);
}

.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 16px;
}

.search-wrap input::placeholder {
  color: #71878e;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill,
.ghost-button,
.action {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--soft);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.filter-pill {
  padding: 0 13px;
}

.filter-pill.active {
  border-color: rgba(73, 209, 125, 0.64);
  color: #071013;
  background: var(--green);
}

.filter-pill:hover,
.ghost-button:hover,
.action:hover {
  transform: translateY(-1px);
  border-color: rgba(215, 229, 225, 0.34);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  min-height: 92px;
  padding: 18px;
  border-radius: 16px;
}

.stat-value {
  display: block;
  color: var(--text);
  font-size: 28px;
  font-weight: 850;
}

.stat-label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 20px;
  border-radius: 18px;
}

.section-head h2 {
  font-size: 22px;
}

.section-head p {
  margin-top: 6px;
  color: var(--muted);
}

.ghost-button,
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  text-decoration: none;
}

.domain-groups {
  display: grid;
  gap: 18px;
}

.domain-section {
  padding: 18px;
  border-radius: 20px;
}

.domain-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.domain-header h2 {
  font-size: 20px;
}

.domain-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

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

.link-card {
  display: flex;
  min-height: 236px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid rgba(166, 188, 196, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.028));
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(73, 209, 125, 0.34);
  background: linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.036));
}

.card-top {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.favicon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: #071013;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-weight: 900;
}

.favicon::before {
  content: attr(data-letter);
}

.card-title-wrap {
  min-width: 0;
}

.card-title-wrap h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}

.url {
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-active {
  color: #071013;
  background: var(--green);
}

.status-utility {
  color: #071013;
  background: var(--blue);
}

.status-paused {
  color: #1c1400;
  background: var(--amber);
}

.status-offline {
  color: #280606;
  background: var(--red);
}

.description {
  margin: 16px 0;
  color: #c7d6d2;
  font-size: 14px;
  line-height: 1.65;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.tag {
  padding: 5px 8px;
  border: 1px solid rgba(166, 188, 196, 0.16);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0,0,0,0.14);
  font-size: 12px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.action.primary {
  border-color: rgba(73, 209, 125, 0.48);
  color: #071013;
  background: var(--green);
  font-weight: 850;
}

.copy.copied {
  border-color: rgba(73, 209, 125, 0.7);
  color: #bff6d0;
}

.empty-state {
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  max-width: min(420px, calc(100% - 40px));
  padding: 13px 15px;
  border: 1px solid rgba(73, 209, 125, 0.38);
  border-radius: 12px;
  color: var(--soft);
  background: rgba(8, 18, 20, 0.94);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(73, 209, 125, 0.7);
  outline-offset: 3px;
}

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

  .hero-copy {
    min-height: 280px;
  }

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

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

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero-copy {
    min-height: 250px;
    padding: 24px;
    border-radius: 18px;
  }

  .hero-visual {
    min-height: 220px;
  }

  .lede {
    font-size: 16px;
  }

  .stats-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .domain-header {
    align-items: stretch;
    flex-direction: column;
  }

  .card-top {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .status-chip {
    grid-column: 1 / -1;
    width: fit-content;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
