:root {
  --bg: #08111f;
  --bg-soft: #101c31;
  --panel: rgba(8, 15, 27, 0.72);
  --panel-strong: rgba(12, 22, 39, 0.88);
  --line: rgba(153, 190, 255, 0.18);
  --line-strong: rgba(153, 190, 255, 0.34);
  --text: #eef4ff;
  --muted: #99abc8;
  --accent: #7ef7c9;
  --accent-deep: #22c38e;
  --warning: #ffd36e;
  --danger: #ff7c7c;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --theme-chip: rgba(255, 255, 255, 0.06);
  --theme-thumb: linear-gradient(135deg, #9bffdf 0%, #66e7bc 100%);
  --theme-thumb-text: #052116;
  --topbar-bg: rgba(6, 13, 24, 0.72);
  --hover-soft: rgba(255, 255, 255, 0.05);
  --button-primary-text: #042114;
  --button-primary-bg: linear-gradient(135deg, var(--accent) 0%, #98ffe0 100%);
  --button-secondary-bg: rgba(255, 255, 255, 0.05);
  --button-secondary-text: var(--text);
}

body[data-theme="light"] {
  --bg: #f6f2ea;
  --bg-soft: #e7dece;
  --panel: rgba(255, 252, 247, 0.8);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --line: rgba(36, 32, 28, 0.1);
  --line-strong: rgba(36, 32, 28, 0.18);
  --text: #171513;
  --muted: #645d56;
  --accent: #171513;
  --accent-deep: #171513;
  --warning: #8a5d00;
  --danger: #8d2020;
  --shadow: 0 22px 56px rgba(38, 31, 23, 0.1);
  --theme-chip: rgba(23, 21, 19, 0.06);
  --theme-thumb: linear-gradient(135deg, #111111 0%, #3a3a3a 100%);
  --theme-thumb-text: #ffffff;
  --topbar-bg: rgba(255, 250, 244, 0.9);
  --hover-soft: rgba(23, 21, 19, 0.06);
  --button-primary-text: #f8f4ee;
  --button-primary-bg: linear-gradient(135deg, #171513 0%, #36312c 100%);
  --button-secondary-bg: rgba(255, 255, 255, 0.82);
  --button-secondary-text: #171513;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(52, 123, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 82% 18%, rgba(126, 247, 201, 0.16), transparent 24rem),
    linear-gradient(180deg, #091121 0%, #08111f 54%, #050a14 100%);
  font-family: "Avenir Next", "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
}

body[data-theme="light"] {
  background:
    radial-gradient(circle at top left, rgba(0, 0, 0, 0.08), transparent 28rem),
    radial-gradient(circle at 82% 18%, rgba(0, 0, 0, 0.06), transparent 24rem),
    linear-gradient(180deg, #faf7f1 0%, #f1ece4 54%, #ebe4da 100%);
}

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

button {
  font: inherit;
}

code {
  padding: 0.18rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.6;
}

.orb-a {
  top: 6rem;
  left: -4rem;
  width: 18rem;
  height: 18rem;
  background: rgba(36, 135, 255, 0.25);
  animation: driftA 11s ease-in-out infinite;
}

.orb-b {
  right: -3rem;
  top: 16rem;
  width: 15rem;
  height: 15rem;
  background: rgba(126, 247, 201, 0.2);
  animation: driftB 13s ease-in-out infinite;
}

.grid-glow {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 84%);
}

.shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.topbar {
  position: sticky;
  top: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.admin-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0.4rem 0.45rem;
  border-radius: 999px;
  color: var(--text);
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.admin-link:hover {
  background: var(--hover-soft);
}

.admin-link-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--theme-chip);
  color: var(--text);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.admin-link span:last-child {
  font-weight: 800;
}

.topnav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.topnav a,
.pill-link {
  padding: 0.72rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.topnav a:hover,
.pill-link:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--hover-soft);
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.theme-toggle {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.theme-toggle-track {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-width: 126px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--theme-chip);
}

.theme-toggle-label {
  position: relative;
  z-index: 1;
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  color: var(--muted);
}

.theme-toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: var(--theme-thumb);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
  transition: transform 180ms ease;
}

body[data-theme="light"] .theme-toggle-thumb {
  transform: translateX(100%);
}

body[data-theme="dark"] .theme-toggle-dark,
body:not([data-theme]) .theme-toggle-dark,
body[data-theme="light"] .theme-toggle-light {
  color: var(--theme-thumb-text);
}

.hero,
.status-layout {
  display: grid;
  gap: 20px;
}

.hero {
  grid-template-columns: 1.2fr 0.85fr;
  align-items: start;
  min-height: auto;
  padding-top: 32px;
}

.hero-copy,
.hero-panel,
.card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-copy {
  border-radius: var(--radius-xl);
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 0.85rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  line-height: 0.95;
}

h1 {
  font-size: clamp(3rem, 7vw, 5.7rem);
  max-width: 10ch;
}

h2 {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
}

h3 {
  font-size: 1.1rem;
  line-height: 1.15;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1.9rem;
}

.btn,
.icon-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.btn {
  padding: 0.92rem 1.2rem;
  font-weight: 700;
}

.btn-small {
  padding: 0.72rem 1rem;
}

.btn-primary {
  color: var(--button-primary-text);
  background: var(--button-primary-bg);
}

.btn-secondary {
  color: var(--button-secondary-text);
  background: var(--button-secondary-bg);
  border-color: var(--line);
}

body[data-theme="light"] .btn-primary,
body[data-theme="light"] .btn-secondary,
body[data-theme="light"] .icon-btn,
body[data-theme="light"] .pill-link,
body[data-theme="light"] .topnav a,
body[data-theme="light"] .admin-link-mark,
body[data-theme="light"] .theme-toggle-track {
  box-shadow: 0 10px 24px rgba(34, 28, 23, 0.06);
}

body[data-theme="light"] .pill-link,
body[data-theme="light"] .topnav a {
  color: #4f4842;
  border-color: rgba(36, 32, 28, 0.08);
  background: rgba(255, 255, 255, 0.52);
}

body[data-theme="light"] .admin-link {
  border: 1px solid rgba(36, 32, 28, 0.08);
  background: rgba(255, 255, 255, 0.52);
}

body[data-theme="light"] .admin-link:hover,
body[data-theme="light"] .topnav a:hover,
body[data-theme="light"] .pill-link:hover {
  border-color: rgba(36, 32, 28, 0.14);
  background: rgba(255, 255, 255, 0.94);
}

body[data-theme="light"] .btn-secondary,
body[data-theme="light"] .icon-btn {
  border-color: rgba(36, 32, 28, 0.12);
}

body[data-theme="light"] .status-badge {
  background: rgba(23, 21, 19, 0.05);
}

body[data-theme="light"] .status-badge::before {
  box-shadow: 0 0 0 6px rgba(23, 21, 19, 0.05);
}

.hero-panel {
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-head,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.hero-head {
  margin-bottom: 18px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.status-badge::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.06);
}

.status-badge.is-online {
  color: var(--accent);
}

.status-badge.is-offline {
  color: var(--danger);
}

.status-badge.is-loading {
  color: var(--warning);
}

.address-card,
.status-tile,
.narrative-card,
.info-card {
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.address-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
}

.label {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.address {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.icon-btn {
  min-width: 70px;
  padding: 0.8rem 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.metric-strip {
  margin: 0;
  display: grid;
  gap: 14px;
}

.metric-strip div {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.metric-strip dt {
  color: var(--muted);
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.metric-strip dd {
  margin: 0.5rem 0 0;
  font-size: 1.08rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.status-layout {
  margin-top: 20px;
  grid-template-columns: 1.1fr 0.9fr;
}

.card {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hero-status-grid {
  margin-top: 0;
}

.status-tile {
  padding: 18px;
  border-radius: var(--radius-lg);
}

.status-tile span {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.status-tile strong {
  display: block;
  margin-top: 0.7rem;
  font-size: 1.5rem;
  line-height: 1.1;
}

.status-tile p,
.narrative-card p,
.steps p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.steps {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}

.steps li {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 16px;
  align-items: start;
}

.steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  color: #03180f;
  background: linear-gradient(135deg, #98ffe0 0%, #61e9ba 100%);
  font-weight: 900;
}

.download-panel {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
}

.download-panel p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.download-panel .eyebrow {
  margin-bottom: 0.7rem;
}

.download-panel .btn {
  flex: 0 0 auto;
}

.hash-line {
  overflow-wrap: anywhere;
}

.facts {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.facts li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.facts li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.facts span {
  color: var(--muted);
}

.facts strong {
  text-align: right;
}

.facts strong a {
  color: inherit;
  text-decoration: none;
}

.facts strong a:hover {
  color: var(--accent);
}

.bottom-bar {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 18;
  width: min(430px, calc(100vw - 44px));
  margin-top: 0;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.facts-inline {
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 0;
}

.facts-inline li {
  min-width: 0;
  padding: 4px 14px;
  border-bottom: 0;
  border-right: 1px solid var(--line);
  flex-direction: column;
  align-items: flex-start;
}

.facts-inline li:nth-child(2n) {
  border-right: 0;
}

.facts-inline li:last-child {
  border-right: 0;
}

.facts-inline strong {
  margin-top: 0.5rem;
  text-align: left;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(20px);
  padding: 0.9rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(4, 10, 18, 0.92);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

@keyframes driftA {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(32px, 22px, 0);
  }
}

@keyframes driftB {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-28px, 24px, 0) scale(1.06);
  }
}

@media (max-width: 940px) {
  .topbar,
  .hero,
  .status-layout,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
    border-radius: 28px;
    align-items: flex-start;
  }

  .hero-copy,
  .hero-panel,
  .card,
  .bottom-bar {
    padding: 22px;
  }

  .bottom-bar {
    position: static;
    width: auto;
    margin-top: 20px;
  }

  .hero {
    min-height: auto;
    padding-top: 18px;
  }

  h1 {
    max-width: none;
  }
}

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

  .topbar {
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
  }

  .topnav,
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-link {
    width: fit-content;
    max-width: 100%;
    align-self: flex-start;
    padding-right: 0.9rem;
  }

  .topnav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .topnav a {
    text-align: center;
    padding-left: 0.82rem;
    padding-right: 0.82rem;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }

  .theme-toggle {
    width: 100%;
  }

  .theme-toggle-track {
    width: 100%;
  }

  .topbar-actions .btn {
    width: 100%;
  }

  .facts-inline {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .facts-inline li {
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .facts-inline li:nth-child(2n) {
    border-right: 0;
  }

  .facts-inline li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .address-card,
  .panel-head,
  .section-head,
  .download-panel,
  .facts li {
    flex-direction: column;
    align-items: flex-start;
  }

  .address {
    font-size: 1.2rem;
  }

  .steps li {
    grid-template-columns: 1fr;
  }

  .steps span {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn,
  .icon-btn {
    width: 100%;
    justify-content: center;
  }
}
