/* ==========================================================================
   SEO Skaner — design tokens
   Motyw: instrument diagnostyczny (wskaźnik zegarowy, LED-y, linia skanera).
   ========================================================================== */
:root {
  --paper: #eef1ef;
  --paper-raised: #ffffff;
  --ink: #10161f;
  --ink-soft: #4b5563;
  --panel: #17233d;
  --panel-soft: #223257;
  --line: #d7dcd8;

  --signal-good: #17916b;
  --signal-good-bg: #e4f4ec;
  --signal-warn: #c98617;
  --signal-warn-bg: #fbf0dd;
  --signal-bad: #c8433f;
  --signal-bad-bg: #fbe6e5;
  --signal-teal: #0f8b8d;

  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;

  --radius: 4px;
  --shadow-device: 0 1px 0 rgba(16, 22, 31, 0.04), 0 12px 24px -16px rgba(16, 22, 31, 0.25);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Faint scanline texture across the whole page — quiet, not decorative noise */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(16, 22, 31, 0.012) 0px,
    rgba(16, 22, 31, 0.012) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

/* ---- Header ---- */
.panel-header {
  background: var(--panel);
  color: #dfe6f2;
}
.panel-header .wrap {
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
}
.brand-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--signal-good);
  box-shadow: 0 0 0 3px rgba(23, 145, 107, 0.25);
  flex-shrink: 0;
  align-self: center;
}
.brand-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.14em;
}
.brand-tag {
  font-size: 12px;
  color: #8b9ab3;
  letter-spacing: 0.02em;
}

/* ---- Hero ---- */
.hero {
  padding: 72px 0 40px;
  position: relative;
  z-index: 2;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal-teal);
  margin: 0 0 14px;
}
.hero-title {
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  font-weight: 700;
  max-width: 14ch;
}
.hero-sub {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 36px;
}

.scan-form { max-width: 640px; }

.input-device {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-device);
  padding: 6px 6px 6px 16px;
}
.input-led {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #c3cac6;
  flex-shrink: 0;
  margin-right: 12px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.input-led.is-valid {
  background: var(--signal-good);
  box-shadow: 0 0 0 3px rgba(23, 145, 107, 0.18);
}
#url-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
  padding: 12px 8px;
  min-width: 0;
}
#url-input::placeholder { color: #9aa3ac; }

.scan-btn {
  border: none;
  background: var(--panel);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}
.scan-btn:hover { background: var(--panel-soft); }
.scan-btn:active { transform: scale(0.98); }
.scan-btn:disabled { opacity: 0.55; cursor: progress; }

.input-hint {
  font-size: 13px;
  color: #7a8590;
  margin: 10px 2px 0;
}

/* ---- Loading state ---- */
.loading { padding: 12px 0 56px; position: relative; z-index: 2; }
.scan-device {
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-device);
}
.scan-device-bar {
  height: 3px;
  background: #0e1728;
  position: relative;
  overflow: hidden;
}
.scan-line {
  position: absolute;
  top: 0; left: -30%;
  width: 30%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--signal-teal), transparent);
  animation: sweep 1.3s linear infinite;
}
@keyframes sweep {
  from { left: -30%; }
  to { left: 100%; }
}
.scan-device-body { padding: 22px 24px; }
.scan-status {
  font-family: var(--font-mono);
  font-size: 14px;
  color: #cfe0e0;
  margin: 0 0 4px;
}
.scan-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #6f829a;
  margin: 0;
  word-break: break-all;
}

@media (prefers-reduced-motion: reduce) {
  .scan-line { animation: none; left: 0; width: 100%; opacity: 0.5; }
}

/* ---- Error panel ---- */
.error-panel {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--signal-bad-bg);
  border: 1px solid rgba(200, 67, 63, 0.25);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 48px;
  position: relative;
  z-index: 2;
}
.error-led {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--signal-bad);
  margin-top: 6px;
  flex-shrink: 0;
}
.error-title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--signal-bad);
  margin: 0 0 4px;
}
.error-message { margin: 0; color: var(--ink); font-size: 14.5px; }

/* ---- Results ---- */
.results {
  padding-bottom: 80px;
  position: relative;
  z-index: 2;
}

.gauge-panel {
  display: flex;
  align-items: center;
  gap: 36px;
  background: var(--panel);
  color: #eef1f5;
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-device);
  flex-wrap: wrap;
}

.gauge-wrap {
  position: relative;
  width: 200px;
  flex-shrink: 0;
}
.gauge { width: 100%; display: block; }
.gauge-track {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  opacity: 0.9;
}
.gauge-track--bad { stroke: var(--signal-bad); }
.gauge-track--warn { stroke: var(--signal-warn); }
.gauge-track--good { stroke: var(--signal-good); }
.gauge-needle {
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  transform-origin: 100px 100px;
  transform: rotate(-90deg);
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.gauge-hub { fill: #fff; }
.gauge-readout {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-family: var(--font-mono);
}
.gauge-score { font-size: 34px; font-weight: 700; }
.gauge-max { font-size: 14px; color: #8b9ab3; }

.gauge-meta { flex: 1; min-width: 220px; }
.gauge-grade {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--signal-teal);
  margin: 0 0 6px;
}
.gauge-url {
  font-size: 15px;
  color: #cdd6e3;
  margin: 0 0 20px;
  word-break: break-all;
}
.gauge-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0;
}
.gauge-stats dt {
  font-size: 11px;
  color: #8b9ab3;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.gauge-stats dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
}

.categories { display: grid; gap: 20px; }

.category {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.category-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.category-score {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.check {
  display: flex;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f2f0;
}
.check:last-child { border-bottom: none; }

.check-led {
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.check.is-good .check-led { background: var(--signal-good); }
.check.is-warning .check-led { background: var(--signal-warn); }
.check.is-error .check-led { background: var(--signal-bad); }

.check-body { min-width: 0; }
.check-name {
  font-weight: 600;
  font-size: 14.5px;
  margin: 0 0 3px;
}
.check-message {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 6px;
}
.check-advice {
  font-size: 13.5px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}
.check.is-good .check-advice { display: none; }

/* ---- Footer ---- */
.panel-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  position: relative;
  z-index: 2;
}
.panel-footer p {
  font-size: 13px;
  color: #8a9199;
  margin: 0;
}

/* ---- Responsive ---- */
@media (max-width: 560px) {
  .hero { padding: 48px 0 32px; }
  .hero-title { max-width: none; }
  .input-device { flex-wrap: wrap; }
  .scan-btn { width: 100%; margin-top: 6px; }
  .gauge-panel { padding: 24px; }
  .gauge-stats { grid-template-columns: 1fr; gap: 10px; }
}

/* ---- Focus visibility ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--signal-teal);
  outline-offset: 2px;
}
