:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #070b16;
  color: #ecf2ff;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 28%),
    radial-gradient(circle at 95% 20%, rgba(168, 85, 247, 0.16), transparent 24%),
    linear-gradient(180deg, #08111f 0%, #05080f 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08), transparent 26%),
    radial-gradient(circle at 20% 80%, rgba(14, 165, 233, 0.08), transparent 22%);
  pointer-events: none;
}

.page-shell {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7c3aed, #0ea5e9);
  border-radius: 22px;
  box-shadow: 0 24px 55px rgba(14, 165, 233, 0.18);
  font-size: 1.9rem;
}

.site-header h1 {
  margin: 0 0 6px;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.site-header p {
  margin: 0;
  color: #cbd5e1;
}

nav {
  display: flex;
  gap: 22px;
}

nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  transition: color 160ms ease;
}

nav a:hover {
  color: white;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 420px;
  gap: 32px;
  align-items: start;
}

.hero-copy {
  max-width: 700px;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 18px;
  color: #818cf8;
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-copy h2 {
  margin: 0 0 22px;
  font-size: clamp(2.8rem, 4vw, 4.6rem);
  line-height: 1.02;
}

.hero-copy p {
  margin: 0 0 30px;
  color: #cbd5e1;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.hero-stats div {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 20px;
  padding: 18px;
}

.hero-stats span {
  display: block;
  font-size: 1.95rem;
  font-weight: 700;
}

.hero-stats p {
  margin: 8px 0 0;
  color: #94a3b8;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, opacity 180ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #38bdf8);
  box-shadow: 0 20px 45px rgba(56, 189, 248, 0.24);
}

.btn-secondary {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.12);
}

.btn-tertiary {
  width: 100%;
  color: #e2e8f0;
  background: rgba(71, 85, 105, 0.16);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hero-panel {
  display: grid;
  gap: 20px;
}

.card {
  border-radius: 30px;
  background: rgba(8, 15, 28, 0.86);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(148, 163, 184, 0.1);
  padding: 28px;
}

.card-title {
  font-size: 0.94rem;
  color: #a5b4fc;
  margin-bottom: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.address-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.address-card input {
  width: 100%;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.98);
  color: #eef2ff;
  font-size: 0.96rem;
  font-weight: 600;
}

.icon-btn {
  min-width: 56px;
  min-height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 1.1rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  font-size: 0.95rem;
}

.controls-card .control-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.domain-select {
  display: grid;
  gap: 10px;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.domain-select select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.98);
  color: #eef2ff;
  padding: 14px 16px;
}

.inbox-section {
  margin-top: 42px;
}

.inbox-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.inbox-top h3 {
  margin: 0 0 6px;
  font-size: 1.8rem;
}

.inbox-top p {
  margin: 0;
  color: #94a3b8;
}

.badge {
  display: inline-flex;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(71, 85, 105, 0.16);
  color: #cbd5e1;
  font-weight: 600;
}

.inbox-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
}

.inbox-list-card,
.message-detail-card {
  min-height: 420px;
}

.message-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.message-item {
  background: rgba(12, 18, 34, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 22px;
  padding: 18px 20px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.message-item:hover {
  transform: translateY(-1px);
  background: rgba(29, 78, 216, 0.14);
}

.message-item.active {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.14);
}

.message-item h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.message-item p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.7;
  font-size: 0.95rem;
}

.message-detail {
  min-height: 320px;
  display: grid;
  gap: 18px;
}

.message-detail h4 {
  margin: 0;
  font-size: 1.1rem;
}

.message-detail p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.75;
}

.message-detail .message-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  color: #94a3b8;
  font-size: 0.95rem;
}

.message-detail pre {
  margin: 0;
  padding: 18px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  white-space: pre-wrap;
  overflow-x: auto;
}

.speedtest-section {
  margin-top: 52px;
}

.speedtest-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 24px;
}

.speedtest-heading .eyebrow {
  margin-bottom: 10px;
  color: #67e8f9;
}

.speedtest-heading h3 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 2.4vw, 2.5rem);
}

.speedtest-heading p,
.speedtest-panel-top p,
.speedtest-note {
  margin: 0;
  color: #94a3b8;
  line-height: 1.7;
}

.speedtest-status {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-radius: 999px;
  background: rgba(8, 145, 178, 0.12);
  color: #a5f3fc;
  font-weight: 700;
}

.speedtest-status[data-state="running"] {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.25);
  color: #fde68a;
}

.speedtest-status[data-state="complete"] {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.25);
  color: #a7f3d0;
}

.speedtest-status[data-state="error"] {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.25);
  color: #fecaca;
}

.speedtest-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 24px;
}

.speedtest-panel {
  display: flex;
  flex-direction: column;
}

.speedtest-panel-top {
  display: grid;
  gap: 8px;
}

.speedtest-panel-top .card-title {
  margin: 0;
}

.speedtest-reading {
  display: grid;
  place-items: center;
  padding: 26px 0;
}

.speed-gauge {
  --gauge-progress: 0deg;
  position: relative;
  display: grid;
  width: min(100%, 210px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#22d3ee var(--gauge-progress), rgba(71, 85, 105, 0.28) 0);
  transition: background 220ms ease;
}

.speed-gauge::after {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: inherit;
  background: #0b1422;
  content: "";
}

.speed-gauge-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
  text-align: center;
}

.speed-gauge-content strong {
  font-size: 2.35rem;
  line-height: 1;
}

.speed-gauge-content span {
  color: #94a3b8;
  font-size: 0.88rem;
}

.speed-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.speed-metric {
  display: grid;
  gap: 7px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  background: rgba(12, 18, 34, 0.92);
}

.speed-metric > span {
  color: #94a3b8;
  font-size: 0.88rem;
}

.speed-metric strong {
  color: #f8fafc;
  font-size: 1.35rem;
}

.speed-metric small {
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
}

.speedtest-start {
  width: 100%;
  margin-top: 18px;
}

.speedtest-info {
  display: grid;
  align-content: start;
  gap: 20px;
}

.speedtest-info .card-title {
  margin: 0;
}

.speedtest-info dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

.speedtest-info dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.speedtest-info dt {
  color: #94a3b8;
}

.speedtest-info dd {
  margin: 0;
  color: #e2e8f0;
  font-weight: 600;
  text-align: right;
}

.empty-state {
  margin: 0;
  color: #94a3b8;
}

.features-section {
  margin-top: 52px;
}

.features-section h3,
.how-it-works h3 {
  margin: 0 0 24px;
  font-size: clamp(2rem, 2.4vw, 2.5rem);
}

.feature-grid,
.steps-grid {
  display: grid;
  gap: 18px;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.step-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 26px;
  padding: 24px;
}

.feature-card h4,
.step-card h4 {
  margin: 0 0 12px;
}

.feature-card p,
.step-card p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.75;
}

.step-card {
  display: grid;
  gap: 18px;
}

.step-pill {
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.16);
  color: #c7d2fe;
  font-weight: 700;
}

.site-footer {
  margin-top: 48px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  min-width: 260px;
  max-width: 90%;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #eef2ff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .inbox-grid {
    grid-template-columns: 1fr;
  }
  .speedtest-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding: 22px 16px 32px;
  }
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }
  nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .hero-stats {
    grid-template-columns: 1fr;
  }
  .speedtest-heading {
    align-items: start;
    flex-direction: column;
  }
  .speed-metric-grid {
    grid-template-columns: 1fr;
  }
}
