/* ---------- Tokens ---------- */
:root {
  --bg: #080b14;
  --bg-2: #0c1020;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef2f8;
  --muted: #93a0b8;
  --dim: #6b7896;

  --accent-1: #5eb8ff;
  --accent-2: #8b7cff;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.85);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Ambient glow ---------- */
.bg-glow {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 70vh;
  background:
    radial-gradient(60% 60% at 30% 20%, rgba(94, 184, 255, 0.16), transparent 70%),
    radial-gradient(50% 50% at 75% 10%, rgba(139, 124, 255, 0.16), transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 22px; height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 0 24px -6px var(--accent-2);
}

.brand-name { font-size: 15px; color: var(--text); }

/* ---------- Layout ---------- */
main {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.hero {
  padding: 88px 0 32px;
  text-align: center;
}

h1 {
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 650;
  margin: 0 0 14px;
}

.grad {
  background: linear-gradient(100deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub {
  color: var(--muted);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto 32px;
}

/* ---------- Form ---------- */
#scanForm { max-width: 560px; margin: 0 auto; }

.field {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.field:focus-within {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

#domain {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  padding: 14px 16px;
  font-family: inherit;
}

#domain::placeholder { color: var(--dim); }

#submitBtn {
  border: none;
  cursor: pointer;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  color: #051021;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
  white-space: nowrap;
}

#submitBtn:hover { filter: brightness(1.08); }
#submitBtn:active { transform: scale(0.98); }
#submitBtn:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }

.turnstile { margin-top: 12px; display: flex; justify-content: center; }

/* ---------- Status ---------- */
.status {
  min-height: 22px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status.error { color: var(--bad); }

/* ---------- Report ---------- */
.report {
  margin-top: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  animation: rise 0.5s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.summary {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.ring { width: 116px; height: 116px; flex-shrink: 0; }
.ring-track { fill: none; stroke: rgba(255,255,255,0.07); stroke-width: 8; }
.ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.1s var(--ease), stroke 0.4s var(--ease);
}

.grade-A .ring-fill { stroke: var(--ok); }
.grade-B .ring-fill { stroke: #84cc16; }
.grade-C .ring-fill { stroke: var(--warn); }
.grade-D .ring-fill { stroke: #fb923c; }
.grade-F .ring-fill { stroke: var(--bad); }

.ring-wrap { position: relative; width: 116px; height: 116px; }
.ring-grade {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 34px; font-weight: 700;
  letter-spacing: -0.02em;
}

.summary-text { min-width: 0; }
.summary-text .domain {
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.01em;
  word-break: break-all;
}
.summary-text .score {
  color: var(--muted); font-size: 14px; margin-top: 4px;
}
.summary-text .server {
  color: var(--dim); font-size: 13px; margin-top: 6px;
  font-family: var(--mono);
}

/* ---------- Check list ---------- */
.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
  margin: 28px 0 12px;
  font-weight: 600;
}

.checks { display: grid; gap: 8px; }

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  animation: rise 0.4s var(--ease) both;
}

.check .icon {
  width: 20px; height: 20px; flex-shrink: 0;
  margin-top: 1px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}

.check.pass .icon { background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.check.fail .icon { background: rgba(248, 113, 113, 0.15); color: var(--bad); }

.check .label { font-size: 14px; font-weight: 550; }
.check .tip { font-size: 13px; color: var(--muted); margin-top: 3px; }
.check .tip code {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(255,255,255,0.05);
  padding: 1px 6px;
  border-radius: 5px;
  color: #cbd5e1;
}

.report .meta {
  margin-top: 24px;
  color: var(--dim);
  font-size: 12.5px;
  text-align: right;
  font-family: var(--mono);
}

/* ---------- Info ---------- */
.info {
  max-width: 640px;
  margin: 48px auto 0;
  display: grid;
  gap: 10px;
}

.info details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  transition: border-color 0.2s var(--ease);
}

.info details[open] { border-color: var(--border-strong); }

.info summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 550;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info summary::-webkit-details-marker { display: none; }

.info summary::after {
  content: "+";
  color: var(--dim);
  font-weight: 400;
  font-size: 18px;
  transition: transform 0.25s var(--ease);
}

.info details[open] summary::after { transform: rotate(45deg); }

.info ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13.5px;
}

.info ul li { margin: 4px 0; }

.info p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 24px 40px;
  color: var(--dim);
  font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .hero { padding-top: 56px; }
  .field { flex-direction: column; }
  #submitBtn { width: 100%; }
  .summary { gap: 18px; }
  .report { padding: 20px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}