:root {
  --bg: #050505;
  --bg-elevated: #0c0c0c;
  --bg-soft: #111111;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f5f5;
  --text-muted: #a1a1a1;
  --text-dim: #6b6b6b;
  --accent: #ededed;
  --accent-hover: #ffffff;
  --danger: #f87171;
  --ok: #3ecf8e;
  --warn: #f5a524;
  --radius: 12px;
  --font: "DM Sans", system-ui, sans-serif;
  --max: 720px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% 40%, rgba(255, 255, 255, 0.05), transparent 55%),
    linear-gradient(180deg, #080808 0%, var(--bg) 45%, #030303 100%);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-align: center;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.glow {
  display: none;
}

.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  width: 100%;
  padding: 1.1rem 1.75rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--text);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--text);
}

.page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 2rem;
}

main {
  width: 100%;
}

.flash-wrap {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.flash {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  font-size: 0.95rem;
  animation: rise 0.45s ease both;
}

.flash-success {
  border-color: rgba(62, 207, 142, 0.35);
  color: var(--ok);
}

.flash-error {
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--danger);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 0 1.5rem;
  animation: rise 0.7s ease both;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  line-height: 1.1;
}

.brand-hero {
  display: block;
  font-family: var(--font);
  font-size: clamp(2.4rem, 7vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
}

.hero-lead {
  max-width: 34rem;
  margin: 1.25rem auto 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.25rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.03);
}

.btn-block {
  width: 100%;
  margin-top: 0.5rem;
}

.panel {
  margin-top: 2rem;
  padding: 2rem 0 0;
  border-top: 1px solid var(--line);
  animation: rise 0.65s ease both;
  animation-delay: 0.08s;
  text-align: center;
}

.panel h2 {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1.4rem, 3.5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.section-lead {
  margin: 0.65rem auto 0;
  color: var(--text-muted);
  max-width: 36rem;
}

.steps {
  list-style: none;
  margin: 1.75rem auto 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  max-width: 28rem;
  text-align: left;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.steps h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.steps p {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.step-num {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1.2;
  min-width: 2.2rem;
}

.aside {
  margin: 1.5rem auto 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 32rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem auto 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  max-width: 32rem;
  justify-items: center;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-value {
  font-family: var(--font);
  font-size: clamp(1.5rem, 3.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-label {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.form-panel {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.ping-form {
  margin-top: 1.75rem;
  display: grid;
  gap: 1.15rem;
  text-align: left;
}

.field label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.field input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.number-stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: stretch;
  gap: 0.5rem;
}

.number-stepper .interval-input {
  width: 100%;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.number-stepper .interval-input::-webkit-outer-spin-button,
.number-stepper .interval-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 46px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #161616;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.stepper-btn svg {
  width: 16px;
  height: 16px;
}

.stepper-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.28);
  background: #1d1d1d;
}

.stepper-btn:active {
  transform: scale(0.96);
  background: #222;
}

.stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.field.has-error .number-stepper .interval-input,
.field.has-error .stepper-btn {
  border-color: rgba(248, 113, 113, 0.55);
}

.field input::placeholder {
  color: var(--text-dim);
}

.field input:focus {
  border-color: rgba(255, 255, 255, 0.35);
  background: #141414;
}

.field.has-error input {
  border-color: rgba(248, 113, 113, 0.55);
}

.hint,
.error {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
}

.hint {
  color: var(--text-dim);
}

.error {
  color: var(--danger);
}

.form-errors {
  color: var(--danger);
  font-size: 0.9rem;
}

.target-list {
  list-style: none;
  margin: 1.5rem auto 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
  max-width: 32rem;
  text-align: left;
}

.target-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}

.target-domain {
  display: block;
  font-weight: 500;
  word-break: break-all;
}

.target-meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.code {
  font-size: 0.85rem;
  color: var(--ok);
  white-space: nowrap;
}

.code.muted {
  color: var(--text-dim);
}

.foot {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: auto;
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.88rem;
}

.foot p {
  margin: 0;
}

.page-creator {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: none;
  width: 100%;
}

.page-creator main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.creator-box {
  box-sizing: border-box;
  width: 480px;
  height: 347px;
  max-width: calc(100vw - 2rem);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 40px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--bg-elevated);
  animation: rise 0.65s ease both;
}

.creator-icon {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.creator-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.creator-text {
  margin: 0.65rem 0 0;
  max-width: 22rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.creator-actions {
  display: grid;
  gap: 0.65rem;
  width: 100%;
  margin-top: 1.25rem;
}

.creator-actions .btn {
  padding: 0.72rem 1.1rem;
}

.creator-actions .btn-block {
  margin-top: 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .top {
    flex-wrap: wrap;
    gap: 0.85rem 1.25rem;
    padding: 1rem 1.25rem;
  }

  .page {
    margin-top: 0;
    padding-top: 1.5rem;
  }

  .creator-box {
    width: 100%;
    height: auto;
    min-height: 347px;
    padding: 2rem 1.25rem;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .target-list li {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .creator-box,
  .hero,
  .panel,
  .flash,
  .btn:hover {
    animation: none;
    transform: none;
  }
}
